create location + location dummy

This commit is contained in:
mahdahar 2025-09-11 11:09:04 +07:00
parent 353a10d831
commit e7e9fc1b99
9 changed files with 577 additions and 357 deletions

View File

@ -47,4 +47,10 @@ $routes->get('/api/religion', 'Religion::index');
$routes->get('/api/religion/(:num)', 'Religion::show/$1');
$routes->get('/api/ethnic', 'Ethnic::index');
$routes->get('/api/ethnic/(:num)', 'Ethnic::show/$1');
$routes->get('/api/ethnic/(:num)', 'Ethnic::show/$1');
$routes->get('/api/location', 'Location::index');
$routes->get('/api/location/(:num)', 'Location::show/$1');
$routes->post('/api/location', 'Location::create');
$routes->patch('/api/location/(:num)', 'Location::update/$1');
$routes->delete('/api/location/(:num)', 'Patient::delete/$1');

View File

@ -14,6 +14,226 @@ class Location extends Controller {
}
public function index() {
$rows = $this->db->table('location')
->select("location.LocationID, LocCode, Parent, LocFull, Description, Street1, Street2, City, Province, PostCode, GeoLocationSystem, GeoLocationData")
->join("locationaddress", "location.LocationID=locationaddress.LocationID")
->get()->getRowArray();
if (empty($rows)) {
return $this->respond([
'status' => 'success',
'message' => "Location no Data.",
'data' => [],
], 200);
}
return $this->respond([
'status' => 'success',
'message'=> "Locations fetched successfully",
'data' => $rows,
], 200);
}
public function show($LocationID = null) {
$rows = $this->db->table('location')
->select("location.LocationID, LocCode, Parent, LocFull, Description, Street1, Street2, City, Province, PostCode, GeoLocationSystem, GeoLocationData")
->join("locationaddress", "location.LocationID=locationaddress.LocationID")
->where('location.LocationID', (int) $LocationID)
->get()->getResultArray();
if (empty($rows)) {
return $this->respond([
'status' => 'success',
'message' => "Patient with ID $LocationID not found.",
'data' => [],
], 200);
}
return $this->respond([
'status' => 'success',
'message'=> "Locations fetched successfully",
'data' => $rows,
], 200);
}
public function create() {
try {
$input = $this->request->getJSON(true);
$now = date('Y-m-d H:i:s');
// Prepare data
$dataLocation = $this->prepareLocationData($input, $now, 'create');
$dataLocationAddress = $this->prepareLocationAddressData($input, $now, 'create');
// Validation rules
$rulesLocation = [
'LocCode' => 'required|is_unique[location.LocCode]|max_length[6]',
'LocFull' => 'required',
];
if (!$this->validateData($dataLocation, $rulesLocation)) {
return $this->failValidationErrors($this->validator->getErrors());
}
// Start transaction
$this->db->transStart();
// Insert location
$this->db->table('location')->insert($dataLocation);
$newLocationID = $this->db->insertID();
// Insert address if available
if (!empty($dataLocationAddress)) {
$dataLocationAddress['LocationID'] = $newLocationID;
$this->db->table('locationaddress')->insert($dataLocationAddress);
}
// Complete transaction
$this->db->transComplete();
if ($this->db->transStatus() === false) {
$dbError = $this->db->error();
return $this->failServerError(
'Failed to create location data (transaction rolled back): ' . ($dbError['message'] ?? 'Unknown database error')
);
}
return $this->respondCreated([
'status' => 'success',
'message' => 'Location created successfully',
'data' => $newLocationID,
], 201);
} catch (\Throwable $e) {
// Ensure rollback if something goes wrong
if ($this->db->transStatus() !== false) {
$this->db->transRollback();
}
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function update($LocationID = null) {
try {
$input = $this->request->getJSON(true);
$now = $this->now;
// Prepare data
$dataLocation = $this->prepareLocationData($input, $now, 'update');
$dataLocationAddress = $this->prepareLocationAddressData($input, $now, 'update');
// Validation rules
$rulesLocation = [
'LocCode' => 'required|is_unique[location.LocCode]|max_length[6]',
'LocFull' => 'required',
];
if (!$this->validateData($dataLocation, $rulesLocation)) {
return $this->failValidationErrors( $this->validator->getErrors());
}
// Start transaction
$this->db->transStart();
// Insert location
$this->db->table('location')->where('LocationID', $LocationID)->update($dataLocation);
// Insert address if available
if (!empty($dataLocationAddress)) {
$dataLocationAddress['LocationID'] = $LocationID;
$this->db->table('locationaddress')->upsert($dataLocationAddress);
}
// Complete transaction
$this->db->transComplete();
if ($this->db->transStatus() === false) {
$dbError = $this->db->error();
return $this->failServerError(
'Failed to update location data (transaction rolled back): ' . ($dbError['message'] ?? 'Unknown database error')
);
}
return $this->respondCreated([
'status' => 'success',
'message' => 'Location updated successfully',
'data' => $LocationID,
], 201);
} catch (\Throwable $e) {
// Ensure rollback if something goes wrong
if ($this->db->transStatus() !== false) {
$this->db->transRollback();
}
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
public function delete($LocationID = null) {
try {
if (!$LocationID) {
return $this->failValidationError('LocationID is required.');
}
$location = $this->db->table('location')->where('LocationID', $LocationID)->get()->getRow();
if (!$location) {
return $this->failNotFound("LocationID with {$LocationID} not found.");
}
$this->db->table('location')->where('LocationID', $LocationID)->update(['DelDate' => $this->now()]);
return $this->respondDeleted([
'status' => 'success',
'message' => "Location with {$LocationID} deleted successfully."
]);
} catch (\Throwable $e) {
// Ensure rollback if something goes wrong
if ($this->db->transStatus() !== false) {
$this->db->transRollback();
}
return $this->failServerError('Something went wrong: ' . $e->getMessage());
}
}
private function prepareLocationData(array $input, string $now, string $mode = 'create'): array {
$LinkTo = null;
if (!empty($input['LinkTo'])) {
$ids = array_column($input['LinkTo'], 'InternalPID');
$LinkTo = implode(',', $ids);
}
$data = [
"LocCode" => $input['LocCode'] ?? null,
"Parent" => $input['Parent'] ?? null,
"LocFull" => $input['LocFull'] ?? null,
"Description" => $input['Description'] ?? null,
];
if ($mode === 'create') {
$data["CreateDate"] = $now;
}
return $data;
}
private function prepareLocationAddressData(array $input, string $now, string $mode = 'create'): array {
$data = [
"LocationID" => $input['LocationID'] ?? null,
"Street1" => $input['Street1'] ?? null,
"Street2" => $input['Street2'] ?? null,
"City" => $input['City'] ?? null,
"Province" => $input['Province'] ?? null,
"PostCode" => $input['PostCode'] ?? null,
"GeoLocationSystem" => $input['GeoLocationSystem'] ?? null,
"GeoLocationData" => $input['GeoLocationData'] ?? null,
];
if ($mode === 'create') {
$data["CreateDate"] = $now;
}
return $data;
}
}

View File

@ -22,9 +22,9 @@ class CreateLocationTable extends Migration {
$this->forge->addField([
'LocationID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'Street1' => ['type' => 'INT', 'null' => true],
'Street2' => ['type' => 'VARCHAR', 'constraint' => 6, 'null' => false],
'City' => ['type' => 'INT', 'null' => true],
'Street1' => ['type' => 'Varchar', 'constraint' => 255, 'null' => true],
'Street2' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false],
'City' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
'Province' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
'PostCode' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
'GeoLocationSystem' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],

View File

@ -1,263 +0,0 @@
<?php
namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
class CountrySeeder extends Seeder {
public function run() {
$data = [
['IntCountryID'=>1, 'CountryID'=>'AFG', 'Country'=>'Afghanistan'],
['IntCountryID'=>2, 'CountryID'=>'ALA', 'Country'=>'Åland Islands'],
['IntCountryID'=>3, 'CountryID'=>'ALB', 'Country'=>'Albania'],
['IntCountryID'=>4, 'CountryID'=>'DZA', 'Country'=>'Algeria'],
['IntCountryID'=>5, 'CountryID'=>'ASM', 'Country'=>'American Samoa'],
['IntCountryID'=>6, 'CountryID'=>'AND', 'Country'=>'Andorra'],
['IntCountryID'=>7, 'CountryID'=>'AGO', 'Country'=>'Angola'],
['IntCountryID'=>8, 'CountryID'=>'AIA', 'Country'=>'Anguilla'],
['IntCountryID'=>9, 'CountryID'=>'ATA', 'Country'=>'Antarctica'],
['IntCountryID'=>10, 'CountryID'=>'ATG', 'Country'=>'Antigua and Barbuda'],
['IntCountryID'=>11, 'CountryID'=>'ARG', 'Country'=>'Argentina'],
['IntCountryID'=>12, 'CountryID'=>'ARM', 'Country'=>'Armenia'],
['IntCountryID'=>13, 'CountryID'=>'ABW', 'Country'=>'Aruba'],
['IntCountryID'=>14, 'CountryID'=>'AUS', 'Country'=>'Australia'],
['IntCountryID'=>15, 'CountryID'=>'AUT', 'Country'=>'Austria'],
['IntCountryID'=>16, 'CountryID'=>'AZE', 'Country'=>'Azerbaijan'],
['IntCountryID'=>17, 'CountryID'=>'BHS', 'Country'=>'Bahamas'],
['IntCountryID'=>18, 'CountryID'=>'BHR', 'Country'=>'Bahrain'],
['IntCountryID'=>19, 'CountryID'=>'BGD', 'Country'=>'Bangladesh'],
['IntCountryID'=>20, 'CountryID'=>'BRB', 'Country'=>'Barbados'],
['IntCountryID'=>21, 'CountryID'=>'BLR', 'Country'=>'Belarus'],
['IntCountryID'=>22, 'CountryID'=>'BEL', 'Country'=>'Belgium'],
['IntCountryID'=>23, 'CountryID'=>'BLZ', 'Country'=>'Belize'],
['IntCountryID'=>24, 'CountryID'=>'BEN', 'Country'=>'Benin'],
['IntCountryID'=>25, 'CountryID'=>'BMU', 'Country'=>'Bermuda'],
['IntCountryID'=>26, 'CountryID'=>'BTN', 'Country'=>'Bhutan'],
['IntCountryID'=>27, 'CountryID'=>'BOL', 'Country'=>'Bolivia, Plurinational State of'],
['IntCountryID'=>28, 'CountryID'=>'BES', 'Country'=>'Bonaire, Sint Eustatius and Saba[d]'],
['IntCountryID'=>29, 'CountryID'=>'BIH', 'Country'=>'Bosnia and Herzegovina'],
['IntCountryID'=>30, 'CountryID'=>'BWA', 'Country'=>'Botswana'],
['IntCountryID'=>31, 'CountryID'=>'BVT', 'Country'=>'Bouvet Island'],
['IntCountryID'=>32, 'CountryID'=>'BRA', 'Country'=>'Brazil'],
['IntCountryID'=>33, 'CountryID'=>'IOT', 'Country'=>'British Indian Ocean Territory'],
['IntCountryID'=>34, 'CountryID'=>'BRN', 'Country'=>'Brunei Darussalam'],
['IntCountryID'=>35, 'CountryID'=>'BGR', 'Country'=>'Bulgaria'],
['IntCountryID'=>36, 'CountryID'=>'BFA', 'Country'=>'Burkina Faso'],
['IntCountryID'=>37, 'CountryID'=>'BDI', 'Country'=>'Burundi'],
['IntCountryID'=>38, 'CountryID'=>'CPV', 'Country'=>'Cabo Verde'],
['IntCountryID'=>39, 'CountryID'=>'KHM', 'Country'=>'Cambodia'],
['IntCountryID'=>40, 'CountryID'=>'CMR', 'Country'=>'Cameroon'],
['IntCountryID'=>41, 'CountryID'=>'CAN', 'Country'=>'Canada'],
['IntCountryID'=>42, 'CountryID'=>'CYM', 'Country'=>'Cayman Islands'],
['IntCountryID'=>43, 'CountryID'=>'CAF', 'Country'=>'Central African Republic'],
['IntCountryID'=>44, 'CountryID'=>'TCD', 'Country'=>'Chad'],
['IntCountryID'=>45, 'CountryID'=>'CHL', 'Country'=>'Chile'],
['IntCountryID'=>46, 'CountryID'=>'CHN', 'Country'=>'China[c]'],
['IntCountryID'=>47, 'CountryID'=>'CXR', 'Country'=>'Christmas Island'],
['IntCountryID'=>48, 'CountryID'=>'CCK', 'Country'=>'Cocos (Keeling) Islands'],
['IntCountryID'=>49, 'CountryID'=>'COL', 'Country'=>'Colombia'],
['IntCountryID'=>50, 'CountryID'=>'COM', 'Country'=>'Comoros'],
['IntCountryID'=>51, 'CountryID'=>'COG', 'Country'=>'Congo'],
['IntCountryID'=>52, 'CountryID'=>'COD', 'Country'=>'Congo, Democratic Republic of the'],
['IntCountryID'=>53, 'CountryID'=>'COK', 'Country'=>'Cook Islands'],
['IntCountryID'=>54, 'CountryID'=>'CRI', 'Country'=>'Costa Rica'],
['IntCountryID'=>55, 'CountryID'=>'CIV', 'Country'=>"Côte d'Ivoire"],
['IntCountryID'=>56, 'CountryID'=>'HRV', 'Country'=>'Croatia'],
['IntCountryID'=>57, 'CountryID'=>'CUB', 'Country'=>'Cuba'],
['IntCountryID'=>58, 'CountryID'=>'CUW', 'Country'=>'Curaçao'],
['IntCountryID'=>59, 'CountryID'=>'CYP', 'Country'=>'Cyprus[c]'],
['IntCountryID'=>60, 'CountryID'=>'CZE', 'Country'=>'Czechia'],
['IntCountryID'=>61, 'CountryID'=>'DNK', 'Country'=>'Denmark'],
['IntCountryID'=>62, 'CountryID'=>'DJI', 'Country'=>'Djibouti'],
['IntCountryID'=>63, 'CountryID'=>'DMA', 'Country'=>'Dominica'],
['IntCountryID'=>64, 'CountryID'=>'DOM', 'Country'=>'Dominican Republic'],
['IntCountryID'=>65, 'CountryID'=>'ECU', 'Country'=>'Ecuador'],
['IntCountryID'=>66, 'CountryID'=>'EGY', 'Country'=>'Egypt'],
['IntCountryID'=>67, 'CountryID'=>'SLV', 'Country'=>'El Salvador'],
['IntCountryID'=>68, 'CountryID'=>'GNQ', 'Country'=>'Equatorial Guinea'],
['IntCountryID'=>69, 'CountryID'=>'ERI', 'Country'=>'Eritrea'],
['IntCountryID'=>70, 'CountryID'=>'EST', 'Country'=>'Estonia'],
['IntCountryID'=>71, 'CountryID'=>'SWZ', 'Country'=>'Eswatini'],
['IntCountryID'=>72, 'CountryID'=>'ETH', 'Country'=>'Ethiopia'],
['IntCountryID'=>73, 'CountryID'=>'FLK', 'Country'=>'Falkland Islands (Malvinas)[c]'],
['IntCountryID'=>74, 'CountryID'=>'FRO', 'Country'=>'Faroe Islands'],
['IntCountryID'=>75, 'CountryID'=>'FJI', 'Country'=>'Fiji'],
['IntCountryID'=>76, 'CountryID'=>'FIN', 'Country'=>'Finland'],
['IntCountryID'=>77, 'CountryID'=>'FRA', 'Country'=>'France'],
['IntCountryID'=>78, 'CountryID'=>'GUF', 'Country'=>'French Guiana'],
['IntCountryID'=>79, 'CountryID'=>'PYF', 'Country'=>'French Polynesia'],
['IntCountryID'=>80, 'CountryID'=>'ATF', 'Country'=>'French Southern Territories'],
['IntCountryID'=>81, 'CountryID'=>'GAB', 'Country'=>'Gabon'],
['IntCountryID'=>82, 'CountryID'=>'GMB', 'Country'=>'Gambia'],
['IntCountryID'=>83, 'CountryID'=>'GEO', 'Country'=>'Georgia'],
['IntCountryID'=>84, 'CountryID'=>'DEU', 'Country'=>'Germany'],
['IntCountryID'=>85, 'CountryID'=>'GHA', 'Country'=>'Ghana'],
['IntCountryID'=>86, 'CountryID'=>'GIB', 'Country'=>'Gibraltar'],
['IntCountryID'=>87, 'CountryID'=>'GRC', 'Country'=>'Greece'],
['IntCountryID'=>88, 'CountryID'=>'GRL', 'Country'=>'Greenland'],
['IntCountryID'=>89, 'CountryID'=>'GRD', 'Country'=>'Grenada'],
['IntCountryID'=>90, 'CountryID'=>'GLP', 'Country'=>'Guadeloupe'],
['IntCountryID'=>91, 'CountryID'=>'GUM', 'Country'=>'Guam'],
['IntCountryID'=>92, 'CountryID'=>'GTM', 'Country'=>'Guatemala'],
['IntCountryID'=>93, 'CountryID'=>'GGY', 'Country'=>'Guernsey'],
['IntCountryID'=>94, 'CountryID'=>'GIN', 'Country'=>'Guinea'],
['IntCountryID'=>95, 'CountryID'=>'GNB', 'Country'=>'Guinea-Bissau'],
['IntCountryID'=>96, 'CountryID'=>'GUY', 'Country'=>'Guyana'],
['IntCountryID'=>97, 'CountryID'=>'HTI', 'Country'=>'Haiti'],
['IntCountryID'=>98, 'CountryID'=>'HMD', 'Country'=>'Heard Island and McDonald Islands'],
['IntCountryID'=>99, 'CountryID'=>'VAT', 'Country'=>'Holy See'],
['IntCountryID'=>100, 'CountryID'=>'HND', 'Country'=>'Honduras'],
['IntCountryID'=>101, 'CountryID'=>'HKG', 'Country'=>'Hong Kong'],
['IntCountryID'=>102, 'CountryID'=>'HUN', 'Country'=>'Hungary'],
['IntCountryID'=>103, 'CountryID'=>'ISL', 'Country'=>'Iceland'],
['IntCountryID'=>104, 'CountryID'=>'IND', 'Country'=>'India'],
['IntCountryID'=>105, 'CountryID'=>'IDN', 'Country'=>'Indonesia'],
['IntCountryID'=>106, 'CountryID'=>'IRN', 'Country'=>'Iran, Islamic Republic of'],
['IntCountryID'=>107, 'CountryID'=>'IRQ', 'Country'=>'Iraq'],
['IntCountryID'=>108, 'CountryID'=>'IRL', 'Country'=>'Ireland'],
['IntCountryID'=>109, 'CountryID'=>'IMN', 'Country'=>'Isle of Man'],
['IntCountryID'=>110, 'CountryID'=>'ISR', 'Country'=>'Israel'],
['IntCountryID'=>111, 'CountryID'=>'ITA', 'Country'=>'Italy'],
['IntCountryID'=>112, 'CountryID'=>'JAM', 'Country'=>'Jamaica'],
['IntCountryID'=>113, 'CountryID'=>'JPN', 'Country'=>'Japan'],
['IntCountryID'=>114, 'CountryID'=>'JEY', 'Country'=>'Jersey'],
['IntCountryID'=>115, 'CountryID'=>'JOR', 'Country'=>'Jordan'],
['IntCountryID'=>116, 'CountryID'=>'KAZ', 'Country'=>'Kazakhstan'],
['IntCountryID'=>117, 'CountryID'=>'KEN', 'Country'=>'Kenya'],
['IntCountryID'=>118, 'CountryID'=>'KIR', 'Country'=>'Kiribati'],
['IntCountryID'=>119, 'CountryID'=>'PRK', 'Country'=>'Korea, Democratic People\'s Republic of'],
['IntCountryID'=>120, 'CountryID'=>'KOR', 'Country'=>'Korea, Republic of'],
['IntCountryID'=>121, 'CountryID'=>'KWT', 'Country'=>'Kuwait'],
['IntCountryID'=>122, 'CountryID'=>'KGZ', 'Country'=>'Kyrgyzstan'],
['IntCountryID'=>123, 'CountryID'=>'LAO', 'Country'=>'Lao People\'s Democratic Republic'],
['IntCountryID'=>124, 'CountryID'=>'LVA', 'Country'=>'Latvia'],
['IntCountryID'=>125, 'CountryID'=>'LBN', 'Country'=>'Lebanon'],
['IntCountryID'=>126, 'CountryID'=>'LSO', 'Country'=>'Lesotho'],
['IntCountryID'=>127, 'CountryID'=>'LBR', 'Country'=>'Liberia'],
['IntCountryID'=>128, 'CountryID'=>'LBY', 'Country'=>'Libya'],
['IntCountryID'=>129, 'CountryID'=>'LIE', 'Country'=>'Liechtenstein'],
['IntCountryID'=>130, 'CountryID'=>'LTU', 'Country'=>'Lithuania'],
['IntCountryID'=>131, 'CountryID'=>'LUX', 'Country'=>'Luxembourg'],
['IntCountryID'=>132, 'CountryID'=>'MAC', 'Country'=>'Macao'],
['IntCountryID'=>133, 'CountryID'=>'MDG', 'Country'=>'Madagascar'],
['IntCountryID'=>134, 'CountryID'=>'MWI', 'Country'=>'Malawi'],
['IntCountryID'=>135, 'CountryID'=>'MYS', 'Country'=>'Malaysia'],
['IntCountryID'=>136, 'CountryID'=>'MDV', 'Country'=>'Maldives'],
['IntCountryID'=>137, 'CountryID'=>'MLI', 'Country'=>'Mali'],
['IntCountryID'=>138, 'CountryID'=>'MLT', 'Country'=>'Malta'],
['IntCountryID'=>139, 'CountryID'=>'MHL', 'Country'=>'Marshall Islands'],
['IntCountryID'=>140, 'CountryID'=>'MTQ', 'Country'=>'Martinique'],
['IntCountryID'=>141, 'CountryID'=>'MRT', 'Country'=>'Mauritania'],
['IntCountryID'=>142, 'CountryID'=>'MUS', 'Country'=>'Mauritius'],
['IntCountryID'=>143, 'CountryID'=>'MYT', 'Country'=>'Mayotte'],
['IntCountryID'=>144, 'CountryID'=>'MEX', 'Country'=>'Mexico'],
['IntCountryID'=>145, 'CountryID'=>'FSM', 'Country'=>'Micronesia, Federated States of'],
['IntCountryID'=>146, 'CountryID'=>'MDA', 'Country'=>'Moldova, Republic of'],
['IntCountryID'=>147, 'CountryID'=>'MCO', 'Country'=>'Monaco'],
['IntCountryID'=>148, 'CountryID'=>'MNG', 'Country'=>'Mongolia'],
['IntCountryID'=>149, 'CountryID'=>'MNE', 'Country'=>'Montenegro'],
['IntCountryID'=>150, 'CountryID'=>'MSR', 'Country'=>'Montserrat'],
['IntCountryID'=>151, 'CountryID'=>'MAR', 'Country'=>'Morocco'],
['IntCountryID'=>152, 'CountryID'=>'MOZ', 'Country'=>'Mozambique'],
['IntCountryID'=>153, 'CountryID'=>'MMR', 'Country'=>'Myanmar'],
['IntCountryID'=>154, 'CountryID'=>'NAM', 'Country'=>'Namibia'],
['IntCountryID'=>155, 'CountryID'=>'NRU', 'Country'=>'Nauru'],
['IntCountryID'=>156, 'CountryID'=>'NPL', 'Country'=>'Nepal'],
['IntCountryID'=>157, 'CountryID'=>'NLD', 'Country'=>'Netherlands, Kingdom of the'],
['IntCountryID'=>158, 'CountryID'=>'NCL', 'Country'=>'New Caledonia'],
['IntCountryID'=>159, 'CountryID'=>'NZL', 'Country'=>'New Zealand'],
['IntCountryID'=>160, 'CountryID'=>'NIC', 'Country'=>'Nicaragua'],
['IntCountryID'=>161, 'CountryID'=>'NER', 'Country'=>'Niger'],
['IntCountryID'=>162, 'CountryID'=>'NGA', 'Country'=>'Nigeria'],
['IntCountryID'=>163, 'CountryID'=>'NIU', 'Country'=>'Niue'],
['IntCountryID'=>164, 'CountryID'=>'NFK', 'Country'=>'Norfolk Island'],
['IntCountryID'=>165, 'CountryID'=>'MKD', 'Country'=>'North Macedonia'],
['IntCountryID'=>166, 'CountryID'=>'MNP', 'Country'=>'Northern Mariana Islands'],
['IntCountryID'=>167, 'CountryID'=>'NOR', 'Country'=>'Norway'],
['IntCountryID'=>168, 'CountryID'=>'OMN', 'Country'=>'Oman'],
['IntCountryID'=>169, 'CountryID'=>'PAK', 'Country'=>'Pakistan'],
['IntCountryID'=>170, 'CountryID'=>'PLW', 'Country'=>'Palau'],
['IntCountryID'=>171, 'CountryID'=>'PSE', 'Country'=>'Palestine, State of[c]'],
['IntCountryID'=>172, 'CountryID'=>'PAN', 'Country'=>'Panama'],
['IntCountryID'=>173, 'CountryID'=>'PNG', 'Country'=>'Papua New Guinea'],
['IntCountryID'=>174, 'CountryID'=>'PRY', 'Country'=>'Paraguay'],
['IntCountryID'=>175, 'CountryID'=>'PER', 'Country'=>'Peru'],
['IntCountryID'=>176, 'CountryID'=>'PHL', 'Country'=>'Philippines'],
['IntCountryID'=>177, 'CountryID'=>'PCN', 'Country'=>'Pitcairn'],
['IntCountryID'=>178, 'CountryID'=>'POL', 'Country'=>'Poland'],
['IntCountryID'=>179, 'CountryID'=>'PRT', 'Country'=>'Portugal'],
['IntCountryID'=>180, 'CountryID'=>'PRI', 'Country'=>'Puerto Rico'],
['IntCountryID'=>181, 'CountryID'=>'QAT', 'Country'=>'Qatar'],
['IntCountryID'=>182, 'CountryID'=>'REU', 'Country'=>'Réunion'],
['IntCountryID'=>183, 'CountryID'=>'ROU', 'Country'=>'Romania'],
['IntCountryID'=>184, 'CountryID'=>'RUS', 'Country'=>'Russian Federation'],
['IntCountryID'=>185, 'CountryID'=>'RWA', 'Country'=>'Rwanda'],
['IntCountryID'=>186, 'CountryID'=>'BLM', 'Country'=>'Saint Barthélemy'],
['IntCountryID'=>187, 'CountryID'=>'SHN', 'Country'=>'Saint Helena, Ascension and Tristan da Cunha[e]'],
['IntCountryID'=>188, 'CountryID'=>'KNA', 'Country'=>'Saint Kitts and Nevis'],
['IntCountryID'=>189, 'CountryID'=>'LCA', 'Country'=>'Saint Lucia'],
['IntCountryID'=>190, 'CountryID'=>'MAF', 'Country'=>'Saint Martin (French part)'],
['IntCountryID'=>191, 'CountryID'=>'SPM', 'Country'=>'Saint Pierre and Miquelon'],
['IntCountryID'=>192, 'CountryID'=>'VCT', 'Country'=>'Saint Vincent and the Grenadines'],
['IntCountryID'=>193, 'CountryID'=>'WSM', 'Country'=>'Samoa'],
['IntCountryID'=>194, 'CountryID'=>'SMR', 'Country'=>'San Marino'],
['IntCountryID'=>195, 'CountryID'=>'STP', 'Country'=>'Sao Tome and Principe'],
['IntCountryID'=>196, 'CountryID'=>'SAU', 'Country'=>'Saudi Arabia'],
['IntCountryID'=>197, 'CountryID'=>'SEN', 'Country'=>'Senegal'],
['IntCountryID'=>198, 'CountryID'=>'SRB', 'Country'=>'Serbia'],
['IntCountryID'=>199, 'CountryID'=>'SYC', 'Country'=>'Seychelles'],
['IntCountryID'=>200, 'CountryID'=>'SLE', 'Country'=>'Sierra Leone'],
['IntCountryID'=>201, 'CountryID'=>'SGP', 'Country'=>'Singapore'],
['IntCountryID'=>202, 'CountryID'=>'SXM', 'Country'=>'Sint Maarten (Dutch part)'],
['IntCountryID'=>203, 'CountryID'=>'SVK', 'Country'=>'Slovakia'],
['IntCountryID'=>204, 'CountryID'=>'SVN', 'Country'=>'Slovenia'],
['IntCountryID'=>205, 'CountryID'=>'SLB', 'Country'=>'Solomon Islands'],
['IntCountryID'=>206, 'CountryID'=>'SOM', 'Country'=>'Somalia'],
['IntCountryID'=>207, 'CountryID'=>'ZAF', 'Country'=>'South Africa'],
['IntCountryID'=>208, 'CountryID'=>'SGS', 'Country'=>'South Georgia and the South Sandwich Islands'],
['IntCountryID'=>209, 'CountryID'=>'SSD', 'Country'=>'South Sudan'],
['IntCountryID'=>210, 'CountryID'=>'ESP', 'Country'=>'Spain'],
['IntCountryID'=>211, 'CountryID'=>'LKA', 'Country'=>'Sri Lanka'],
['IntCountryID'=>212, 'CountryID'=>'SDN', 'Country'=>'Sudan'],
['IntCountryID'=>213, 'CountryID'=>'SUR', 'Country'=>'Suriname'],
['IntCountryID'=>214, 'CountryID'=>'SJM', 'Country'=>'Svalbard and Jan Mayen[f]'],
['IntCountryID'=>215, 'CountryID'=>'SWE', 'Country'=>'Sweden'],
['IntCountryID'=>216, 'CountryID'=>'CHE', 'Country'=>'Switzerland'],
['IntCountryID'=>217, 'CountryID'=>'SYR', 'Country'=>'Syrian Arab Republic'],
['IntCountryID'=>218, 'CountryID'=>'TWN', 'Country'=>'Taiwan, Province of China[c]'],
['IntCountryID'=>219, 'CountryID'=>'TJK', 'Country'=>'Tajikistan'],
['IntCountryID'=>220, 'CountryID'=>'TZA', 'Country'=>'Tanzania, United Republic of'],
['IntCountryID'=>221, 'CountryID'=>'THA', 'Country'=>'Thailand'],
['IntCountryID'=>222, 'CountryID'=>'TLS', 'Country'=>'Timor-Leste'],
['IntCountryID'=>223, 'CountryID'=>'TGO', 'Country'=>'Togo'],
['IntCountryID'=>224, 'CountryID'=>'TKL', 'Country'=>'Tokelau'],
['IntCountryID'=>225, 'CountryID'=>'TON', 'Country'=>'Tonga'],
['IntCountryID'=>226, 'CountryID'=>'TTO', 'Country'=>'Trinidad and Tobago'],
['IntCountryID'=>227, 'CountryID'=>'TUN', 'Country'=>'Tunisia'],
['IntCountryID'=>228, 'CountryID'=>'TUR', 'Country'=>'Türkiye'],
['IntCountryID'=>229, 'CountryID'=>'TKM', 'Country'=>'Turkmenistan'],
['IntCountryID'=>230, 'CountryID'=>'TCA', 'Country'=>'Turks and Caicos Islands'],
['IntCountryID'=>231, 'CountryID'=>'TUV', 'Country'=>'Tuvalu'],
['IntCountryID'=>232, 'CountryID'=>'UGA', 'Country'=>'Uganda'],
['IntCountryID'=>233, 'CountryID'=>'UKR', 'Country'=>'Ukraine'],
['IntCountryID'=>234, 'CountryID'=>'ARE', 'Country'=>'United Arab Emirates'],
['IntCountryID'=>235, 'CountryID'=>'GBR', 'Country'=>'United Kingdom of Great Britain and Northern Ireland'],
['IntCountryID'=>236, 'CountryID'=>'USA', 'Country'=>'United States of America'],
['IntCountryID'=>237, 'CountryID'=>'UMI', 'Country'=>'United States Minor Outlying Islands[g]'],
['IntCountryID'=>238, 'CountryID'=>'URY', 'Country'=>'Uruguay'],
['IntCountryID'=>239, 'CountryID'=>'UZB', 'Country'=>'Uzbekistan'],
['IntCountryID'=>240, 'CountryID'=>'VUT', 'Country'=>'Vanuatu'],
['IntCountryID'=>241, 'CountryID'=>'VEN', 'Country'=>'Venezuela, Bolivarian Republic of'],
['IntCountryID'=>242, 'CountryID'=>'VNM', 'Country'=>'Viet Nam'],
['IntCountryID'=>243, 'CountryID'=>'VGB', 'Country'=>'Virgin Islands (British)'],
['IntCountryID'=>244, 'CountryID'=>'VIR', 'Country'=>'Virgin Islands (U.S.)'],
['IntCountryID'=>245, 'CountryID'=>'WLF', 'Country'=>'Wallis and Futuna'],
['IntCountryID'=>246, 'CountryID'=>'ESH', 'Country'=>'Western Sahara[c]'],
['IntCountryID'=>247, 'CountryID'=>'YEM', 'Country'=>'Yemen'],
['IntCountryID'=>248, 'CountryID'=>'ZMB', 'Country'=>'Zambia'],
['IntCountryID'=>249, 'CountryID'=>'ZWE', 'Country'=>'Zimbabwe']
];
$this->db->table('country')->insertBatch($data);
}
}

View File

@ -0,0 +1,21 @@
<?php
namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
class DummySeeder extends Seeder {
public function run() {
// location
$data = [
['LocationID'=>1, 'LocCode'=>'QLOC', 'LocFull'=>'Dummy Location', 'Description'=>'Location made for dummy testing' ]
];
$this->db->table('location')->insertBatch($data);
// locationAddress
$data = [
['LocationID'=>1, 'Street1'=>'Jalan Nginden', 'Street2'=>'Intan Raya', 'City'=>'Surabaya', 'Province'=>'East Java', 'PostCode'=>'60222']
];
$this->db->table('locationaddress')->insertBatch($data);
}
}

View File

@ -1,23 +0,0 @@
<?php
namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
class EthnicSeeder extends Seeder
{
public function run()
{
$data = [
['EthnicID'=>1, 'Ethnic'=>'Papua Melanezoid'],
['EthnicID'=>2, 'Ethnic'=>'Negroid'],
['EthnicID'=>3, 'Ethnic'=>'Weddoid'],
['EthnicID'=>4, 'Ethnic'=>'Melayu Mongoloid_Proto Melayu'],
['EthnicID'=>5, 'Ethnic'=>'Melayu Mongoloid_Deutro Melayu'],
['EthnicID'=>6, 'Ethnic'=>'Tionghoa'],
['EthnicID'=>7, 'Ethnic'=>'India'],
['EthnicID'=>8, 'Ethnic'=>'Arab'],
];
$this->db->table('ethnic')->insertBatch($data);
}
}

View File

@ -0,0 +1,325 @@
<?php
namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
class MainSeeder extends Seeder {
public function run() {
// ethnic
$data = [
['EthnicID'=>1, 'Ethnic'=>'Papua Melanezoid'],
['EthnicID'=>2, 'Ethnic'=>'Negroid'],
['EthnicID'=>3, 'Ethnic'=>'Weddoid'],
['EthnicID'=>4, 'Ethnic'=>'Melayu Mongoloid_Proto Melayu'],
['EthnicID'=>5, 'Ethnic'=>'Melayu Mongoloid_Deutro Melayu'],
['EthnicID'=>6, 'Ethnic'=>'Tionghoa'],
['EthnicID'=>7, 'Ethnic'=>'India'],
['EthnicID'=>8, 'Ethnic'=>'Arab'],
];
$this->db->table('ethnic')->insertBatch($data);
// country
$data = [
['IntCountryID'=>1, 'CountryID'=>'AFG', 'Country'=>'Afghanistan'],
['IntCountryID'=>2, 'CountryID'=>'ALA', 'Country'=>'Åland Islands'],
['IntCountryID'=>3, 'CountryID'=>'ALB', 'Country'=>'Albania'],
['IntCountryID'=>4, 'CountryID'=>'DZA', 'Country'=>'Algeria'],
['IntCountryID'=>5, 'CountryID'=>'ASM', 'Country'=>'American Samoa'],
['IntCountryID'=>6, 'CountryID'=>'AND', 'Country'=>'Andorra'],
['IntCountryID'=>7, 'CountryID'=>'AGO', 'Country'=>'Angola'],
['IntCountryID'=>8, 'CountryID'=>'AIA', 'Country'=>'Anguilla'],
['IntCountryID'=>9, 'CountryID'=>'ATA', 'Country'=>'Antarctica'],
['IntCountryID'=>10, 'CountryID'=>'ATG', 'Country'=>'Antigua and Barbuda'],
['IntCountryID'=>11, 'CountryID'=>'ARG', 'Country'=>'Argentina'],
['IntCountryID'=>12, 'CountryID'=>'ARM', 'Country'=>'Armenia'],
['IntCountryID'=>13, 'CountryID'=>'ABW', 'Country'=>'Aruba'],
['IntCountryID'=>14, 'CountryID'=>'AUS', 'Country'=>'Australia'],
['IntCountryID'=>15, 'CountryID'=>'AUT', 'Country'=>'Austria'],
['IntCountryID'=>16, 'CountryID'=>'AZE', 'Country'=>'Azerbaijan'],
['IntCountryID'=>17, 'CountryID'=>'BHS', 'Country'=>'Bahamas'],
['IntCountryID'=>18, 'CountryID'=>'BHR', 'Country'=>'Bahrain'],
['IntCountryID'=>19, 'CountryID'=>'BGD', 'Country'=>'Bangladesh'],
['IntCountryID'=>20, 'CountryID'=>'BRB', 'Country'=>'Barbados'],
['IntCountryID'=>21, 'CountryID'=>'BLR', 'Country'=>'Belarus'],
['IntCountryID'=>22, 'CountryID'=>'BEL', 'Country'=>'Belgium'],
['IntCountryID'=>23, 'CountryID'=>'BLZ', 'Country'=>'Belize'],
['IntCountryID'=>24, 'CountryID'=>'BEN', 'Country'=>'Benin'],
['IntCountryID'=>25, 'CountryID'=>'BMU', 'Country'=>'Bermuda'],
['IntCountryID'=>26, 'CountryID'=>'BTN', 'Country'=>'Bhutan'],
['IntCountryID'=>27, 'CountryID'=>'BOL', 'Country'=>'Bolivia, Plurinational State of'],
['IntCountryID'=>28, 'CountryID'=>'BES', 'Country'=>'Bonaire, Sint Eustatius and Saba[d]'],
['IntCountryID'=>29, 'CountryID'=>'BIH', 'Country'=>'Bosnia and Herzegovina'],
['IntCountryID'=>30, 'CountryID'=>'BWA', 'Country'=>'Botswana'],
['IntCountryID'=>31, 'CountryID'=>'BVT', 'Country'=>'Bouvet Island'],
['IntCountryID'=>32, 'CountryID'=>'BRA', 'Country'=>'Brazil'],
['IntCountryID'=>33, 'CountryID'=>'IOT', 'Country'=>'British Indian Ocean Territory'],
['IntCountryID'=>34, 'CountryID'=>'BRN', 'Country'=>'Brunei Darussalam'],
['IntCountryID'=>35, 'CountryID'=>'BGR', 'Country'=>'Bulgaria'],
['IntCountryID'=>36, 'CountryID'=>'BFA', 'Country'=>'Burkina Faso'],
['IntCountryID'=>37, 'CountryID'=>'BDI', 'Country'=>'Burundi'],
['IntCountryID'=>38, 'CountryID'=>'CPV', 'Country'=>'Cabo Verde'],
['IntCountryID'=>39, 'CountryID'=>'KHM', 'Country'=>'Cambodia'],
['IntCountryID'=>40, 'CountryID'=>'CMR', 'Country'=>'Cameroon'],
['IntCountryID'=>41, 'CountryID'=>'CAN', 'Country'=>'Canada'],
['IntCountryID'=>42, 'CountryID'=>'CYM', 'Country'=>'Cayman Islands'],
['IntCountryID'=>43, 'CountryID'=>'CAF', 'Country'=>'Central African Republic'],
['IntCountryID'=>44, 'CountryID'=>'TCD', 'Country'=>'Chad'],
['IntCountryID'=>45, 'CountryID'=>'CHL', 'Country'=>'Chile'],
['IntCountryID'=>46, 'CountryID'=>'CHN', 'Country'=>'China[c]'],
['IntCountryID'=>47, 'CountryID'=>'CXR', 'Country'=>'Christmas Island'],
['IntCountryID'=>48, 'CountryID'=>'CCK', 'Country'=>'Cocos (Keeling) Islands'],
['IntCountryID'=>49, 'CountryID'=>'COL', 'Country'=>'Colombia'],
['IntCountryID'=>50, 'CountryID'=>'COM', 'Country'=>'Comoros'],
['IntCountryID'=>51, 'CountryID'=>'COG', 'Country'=>'Congo'],
['IntCountryID'=>52, 'CountryID'=>'COD', 'Country'=>'Congo, Democratic Republic of the'],
['IntCountryID'=>53, 'CountryID'=>'COK', 'Country'=>'Cook Islands'],
['IntCountryID'=>54, 'CountryID'=>'CRI', 'Country'=>'Costa Rica'],
['IntCountryID'=>55, 'CountryID'=>'CIV', 'Country'=>"Côte d'Ivoire"],
['IntCountryID'=>56, 'CountryID'=>'HRV', 'Country'=>'Croatia'],
['IntCountryID'=>57, 'CountryID'=>'CUB', 'Country'=>'Cuba'],
['IntCountryID'=>58, 'CountryID'=>'CUW', 'Country'=>'Curaçao'],
['IntCountryID'=>59, 'CountryID'=>'CYP', 'Country'=>'Cyprus[c]'],
['IntCountryID'=>60, 'CountryID'=>'CZE', 'Country'=>'Czechia'],
['IntCountryID'=>61, 'CountryID'=>'DNK', 'Country'=>'Denmark'],
['IntCountryID'=>62, 'CountryID'=>'DJI', 'Country'=>'Djibouti'],
['IntCountryID'=>63, 'CountryID'=>'DMA', 'Country'=>'Dominica'],
['IntCountryID'=>64, 'CountryID'=>'DOM', 'Country'=>'Dominican Republic'],
['IntCountryID'=>65, 'CountryID'=>'ECU', 'Country'=>'Ecuador'],
['IntCountryID'=>66, 'CountryID'=>'EGY', 'Country'=>'Egypt'],
['IntCountryID'=>67, 'CountryID'=>'SLV', 'Country'=>'El Salvador'],
['IntCountryID'=>68, 'CountryID'=>'GNQ', 'Country'=>'Equatorial Guinea'],
['IntCountryID'=>69, 'CountryID'=>'ERI', 'Country'=>'Eritrea'],
['IntCountryID'=>70, 'CountryID'=>'EST', 'Country'=>'Estonia'],
['IntCountryID'=>71, 'CountryID'=>'SWZ', 'Country'=>'Eswatini'],
['IntCountryID'=>72, 'CountryID'=>'ETH', 'Country'=>'Ethiopia'],
['IntCountryID'=>73, 'CountryID'=>'FLK', 'Country'=>'Falkland Islands (Malvinas)[c]'],
['IntCountryID'=>74, 'CountryID'=>'FRO', 'Country'=>'Faroe Islands'],
['IntCountryID'=>75, 'CountryID'=>'FJI', 'Country'=>'Fiji'],
['IntCountryID'=>76, 'CountryID'=>'FIN', 'Country'=>'Finland'],
['IntCountryID'=>77, 'CountryID'=>'FRA', 'Country'=>'France'],
['IntCountryID'=>78, 'CountryID'=>'GUF', 'Country'=>'French Guiana'],
['IntCountryID'=>79, 'CountryID'=>'PYF', 'Country'=>'French Polynesia'],
['IntCountryID'=>80, 'CountryID'=>'ATF', 'Country'=>'French Southern Territories'],
['IntCountryID'=>81, 'CountryID'=>'GAB', 'Country'=>'Gabon'],
['IntCountryID'=>82, 'CountryID'=>'GMB', 'Country'=>'Gambia'],
['IntCountryID'=>83, 'CountryID'=>'GEO', 'Country'=>'Georgia'],
['IntCountryID'=>84, 'CountryID'=>'DEU', 'Country'=>'Germany'],
['IntCountryID'=>85, 'CountryID'=>'GHA', 'Country'=>'Ghana'],
['IntCountryID'=>86, 'CountryID'=>'GIB', 'Country'=>'Gibraltar'],
['IntCountryID'=>87, 'CountryID'=>'GRC', 'Country'=>'Greece'],
['IntCountryID'=>88, 'CountryID'=>'GRL', 'Country'=>'Greenland'],
['IntCountryID'=>89, 'CountryID'=>'GRD', 'Country'=>'Grenada'],
['IntCountryID'=>90, 'CountryID'=>'GLP', 'Country'=>'Guadeloupe'],
['IntCountryID'=>91, 'CountryID'=>'GUM', 'Country'=>'Guam'],
['IntCountryID'=>92, 'CountryID'=>'GTM', 'Country'=>'Guatemala'],
['IntCountryID'=>93, 'CountryID'=>'GGY', 'Country'=>'Guernsey'],
['IntCountryID'=>94, 'CountryID'=>'GIN', 'Country'=>'Guinea'],
['IntCountryID'=>95, 'CountryID'=>'GNB', 'Country'=>'Guinea-Bissau'],
['IntCountryID'=>96, 'CountryID'=>'GUY', 'Country'=>'Guyana'],
['IntCountryID'=>97, 'CountryID'=>'HTI', 'Country'=>'Haiti'],
['IntCountryID'=>98, 'CountryID'=>'HMD', 'Country'=>'Heard Island and McDonald Islands'],
['IntCountryID'=>99, 'CountryID'=>'VAT', 'Country'=>'Holy See'],
['IntCountryID'=>100, 'CountryID'=>'HND', 'Country'=>'Honduras'],
['IntCountryID'=>101, 'CountryID'=>'HKG', 'Country'=>'Hong Kong'],
['IntCountryID'=>102, 'CountryID'=>'HUN', 'Country'=>'Hungary'],
['IntCountryID'=>103, 'CountryID'=>'ISL', 'Country'=>'Iceland'],
['IntCountryID'=>104, 'CountryID'=>'IND', 'Country'=>'India'],
['IntCountryID'=>105, 'CountryID'=>'IDN', 'Country'=>'Indonesia'],
['IntCountryID'=>106, 'CountryID'=>'IRN', 'Country'=>'Iran, Islamic Republic of'],
['IntCountryID'=>107, 'CountryID'=>'IRQ', 'Country'=>'Iraq'],
['IntCountryID'=>108, 'CountryID'=>'IRL', 'Country'=>'Ireland'],
['IntCountryID'=>109, 'CountryID'=>'IMN', 'Country'=>'Isle of Man'],
['IntCountryID'=>110, 'CountryID'=>'ISR', 'Country'=>'Israel'],
['IntCountryID'=>111, 'CountryID'=>'ITA', 'Country'=>'Italy'],
['IntCountryID'=>112, 'CountryID'=>'JAM', 'Country'=>'Jamaica'],
['IntCountryID'=>113, 'CountryID'=>'JPN', 'Country'=>'Japan'],
['IntCountryID'=>114, 'CountryID'=>'JEY', 'Country'=>'Jersey'],
['IntCountryID'=>115, 'CountryID'=>'JOR', 'Country'=>'Jordan'],
['IntCountryID'=>116, 'CountryID'=>'KAZ', 'Country'=>'Kazakhstan'],
['IntCountryID'=>117, 'CountryID'=>'KEN', 'Country'=>'Kenya'],
['IntCountryID'=>118, 'CountryID'=>'KIR', 'Country'=>'Kiribati'],
['IntCountryID'=>119, 'CountryID'=>'PRK', 'Country'=>'Korea, Democratic People\'s Republic of'],
['IntCountryID'=>120, 'CountryID'=>'KOR', 'Country'=>'Korea, Republic of'],
['IntCountryID'=>121, 'CountryID'=>'KWT', 'Country'=>'Kuwait'],
['IntCountryID'=>122, 'CountryID'=>'KGZ', 'Country'=>'Kyrgyzstan'],
['IntCountryID'=>123, 'CountryID'=>'LAO', 'Country'=>'Lao People\'s Democratic Republic'],
['IntCountryID'=>124, 'CountryID'=>'LVA', 'Country'=>'Latvia'],
['IntCountryID'=>125, 'CountryID'=>'LBN', 'Country'=>'Lebanon'],
['IntCountryID'=>126, 'CountryID'=>'LSO', 'Country'=>'Lesotho'],
['IntCountryID'=>127, 'CountryID'=>'LBR', 'Country'=>'Liberia'],
['IntCountryID'=>128, 'CountryID'=>'LBY', 'Country'=>'Libya'],
['IntCountryID'=>129, 'CountryID'=>'LIE', 'Country'=>'Liechtenstein'],
['IntCountryID'=>130, 'CountryID'=>'LTU', 'Country'=>'Lithuania'],
['IntCountryID'=>131, 'CountryID'=>'LUX', 'Country'=>'Luxembourg'],
['IntCountryID'=>132, 'CountryID'=>'MAC', 'Country'=>'Macao'],
['IntCountryID'=>133, 'CountryID'=>'MDG', 'Country'=>'Madagascar'],
['IntCountryID'=>134, 'CountryID'=>'MWI', 'Country'=>'Malawi'],
['IntCountryID'=>135, 'CountryID'=>'MYS', 'Country'=>'Malaysia'],
['IntCountryID'=>136, 'CountryID'=>'MDV', 'Country'=>'Maldives'],
['IntCountryID'=>137, 'CountryID'=>'MLI', 'Country'=>'Mali'],
['IntCountryID'=>138, 'CountryID'=>'MLT', 'Country'=>'Malta'],
['IntCountryID'=>139, 'CountryID'=>'MHL', 'Country'=>'Marshall Islands'],
['IntCountryID'=>140, 'CountryID'=>'MTQ', 'Country'=>'Martinique'],
['IntCountryID'=>141, 'CountryID'=>'MRT', 'Country'=>'Mauritania'],
['IntCountryID'=>142, 'CountryID'=>'MUS', 'Country'=>'Mauritius'],
['IntCountryID'=>143, 'CountryID'=>'MYT', 'Country'=>'Mayotte'],
['IntCountryID'=>144, 'CountryID'=>'MEX', 'Country'=>'Mexico'],
['IntCountryID'=>145, 'CountryID'=>'FSM', 'Country'=>'Micronesia, Federated States of'],
['IntCountryID'=>146, 'CountryID'=>'MDA', 'Country'=>'Moldova, Republic of'],
['IntCountryID'=>147, 'CountryID'=>'MCO', 'Country'=>'Monaco'],
['IntCountryID'=>148, 'CountryID'=>'MNG', 'Country'=>'Mongolia'],
['IntCountryID'=>149, 'CountryID'=>'MNE', 'Country'=>'Montenegro'],
['IntCountryID'=>150, 'CountryID'=>'MSR', 'Country'=>'Montserrat'],
['IntCountryID'=>151, 'CountryID'=>'MAR', 'Country'=>'Morocco'],
['IntCountryID'=>152, 'CountryID'=>'MOZ', 'Country'=>'Mozambique'],
['IntCountryID'=>153, 'CountryID'=>'MMR', 'Country'=>'Myanmar'],
['IntCountryID'=>154, 'CountryID'=>'NAM', 'Country'=>'Namibia'],
['IntCountryID'=>155, 'CountryID'=>'NRU', 'Country'=>'Nauru'],
['IntCountryID'=>156, 'CountryID'=>'NPL', 'Country'=>'Nepal'],
['IntCountryID'=>157, 'CountryID'=>'NLD', 'Country'=>'Netherlands, Kingdom of the'],
['IntCountryID'=>158, 'CountryID'=>'NCL', 'Country'=>'New Caledonia'],
['IntCountryID'=>159, 'CountryID'=>'NZL', 'Country'=>'New Zealand'],
['IntCountryID'=>160, 'CountryID'=>'NIC', 'Country'=>'Nicaragua'],
['IntCountryID'=>161, 'CountryID'=>'NER', 'Country'=>'Niger'],
['IntCountryID'=>162, 'CountryID'=>'NGA', 'Country'=>'Nigeria'],
['IntCountryID'=>163, 'CountryID'=>'NIU', 'Country'=>'Niue'],
['IntCountryID'=>164, 'CountryID'=>'NFK', 'Country'=>'Norfolk Island'],
['IntCountryID'=>165, 'CountryID'=>'MKD', 'Country'=>'North Macedonia'],
['IntCountryID'=>166, 'CountryID'=>'MNP', 'Country'=>'Northern Mariana Islands'],
['IntCountryID'=>167, 'CountryID'=>'NOR', 'Country'=>'Norway'],
['IntCountryID'=>168, 'CountryID'=>'OMN', 'Country'=>'Oman'],
['IntCountryID'=>169, 'CountryID'=>'PAK', 'Country'=>'Pakistan'],
['IntCountryID'=>170, 'CountryID'=>'PLW', 'Country'=>'Palau'],
['IntCountryID'=>171, 'CountryID'=>'PSE', 'Country'=>'Palestine, State of[c]'],
['IntCountryID'=>172, 'CountryID'=>'PAN', 'Country'=>'Panama'],
['IntCountryID'=>173, 'CountryID'=>'PNG', 'Country'=>'Papua New Guinea'],
['IntCountryID'=>174, 'CountryID'=>'PRY', 'Country'=>'Paraguay'],
['IntCountryID'=>175, 'CountryID'=>'PER', 'Country'=>'Peru'],
['IntCountryID'=>176, 'CountryID'=>'PHL', 'Country'=>'Philippines'],
['IntCountryID'=>177, 'CountryID'=>'PCN', 'Country'=>'Pitcairn'],
['IntCountryID'=>178, 'CountryID'=>'POL', 'Country'=>'Poland'],
['IntCountryID'=>179, 'CountryID'=>'PRT', 'Country'=>'Portugal'],
['IntCountryID'=>180, 'CountryID'=>'PRI', 'Country'=>'Puerto Rico'],
['IntCountryID'=>181, 'CountryID'=>'QAT', 'Country'=>'Qatar'],
['IntCountryID'=>182, 'CountryID'=>'REU', 'Country'=>'Réunion'],
['IntCountryID'=>183, 'CountryID'=>'ROU', 'Country'=>'Romania'],
['IntCountryID'=>184, 'CountryID'=>'RUS', 'Country'=>'Russian Federation'],
['IntCountryID'=>185, 'CountryID'=>'RWA', 'Country'=>'Rwanda'],
['IntCountryID'=>186, 'CountryID'=>'BLM', 'Country'=>'Saint Barthélemy'],
['IntCountryID'=>187, 'CountryID'=>'SHN', 'Country'=>'Saint Helena, Ascension and Tristan da Cunha[e]'],
['IntCountryID'=>188, 'CountryID'=>'KNA', 'Country'=>'Saint Kitts and Nevis'],
['IntCountryID'=>189, 'CountryID'=>'LCA', 'Country'=>'Saint Lucia'],
['IntCountryID'=>190, 'CountryID'=>'MAF', 'Country'=>'Saint Martin (French part)'],
['IntCountryID'=>191, 'CountryID'=>'SPM', 'Country'=>'Saint Pierre and Miquelon'],
['IntCountryID'=>192, 'CountryID'=>'VCT', 'Country'=>'Saint Vincent and the Grenadines'],
['IntCountryID'=>193, 'CountryID'=>'WSM', 'Country'=>'Samoa'],
['IntCountryID'=>194, 'CountryID'=>'SMR', 'Country'=>'San Marino'],
['IntCountryID'=>195, 'CountryID'=>'STP', 'Country'=>'Sao Tome and Principe'],
['IntCountryID'=>196, 'CountryID'=>'SAU', 'Country'=>'Saudi Arabia'],
['IntCountryID'=>197, 'CountryID'=>'SEN', 'Country'=>'Senegal'],
['IntCountryID'=>198, 'CountryID'=>'SRB', 'Country'=>'Serbia'],
['IntCountryID'=>199, 'CountryID'=>'SYC', 'Country'=>'Seychelles'],
['IntCountryID'=>200, 'CountryID'=>'SLE', 'Country'=>'Sierra Leone'],
['IntCountryID'=>201, 'CountryID'=>'SGP', 'Country'=>'Singapore'],
['IntCountryID'=>202, 'CountryID'=>'SXM', 'Country'=>'Sint Maarten (Dutch part)'],
['IntCountryID'=>203, 'CountryID'=>'SVK', 'Country'=>'Slovakia'],
['IntCountryID'=>204, 'CountryID'=>'SVN', 'Country'=>'Slovenia'],
['IntCountryID'=>205, 'CountryID'=>'SLB', 'Country'=>'Solomon Islands'],
['IntCountryID'=>206, 'CountryID'=>'SOM', 'Country'=>'Somalia'],
['IntCountryID'=>207, 'CountryID'=>'ZAF', 'Country'=>'South Africa'],
['IntCountryID'=>208, 'CountryID'=>'SGS', 'Country'=>'South Georgia and the South Sandwich Islands'],
['IntCountryID'=>209, 'CountryID'=>'SSD', 'Country'=>'South Sudan'],
['IntCountryID'=>210, 'CountryID'=>'ESP', 'Country'=>'Spain'],
['IntCountryID'=>211, 'CountryID'=>'LKA', 'Country'=>'Sri Lanka'],
['IntCountryID'=>212, 'CountryID'=>'SDN', 'Country'=>'Sudan'],
['IntCountryID'=>213, 'CountryID'=>'SUR', 'Country'=>'Suriname'],
['IntCountryID'=>214, 'CountryID'=>'SJM', 'Country'=>'Svalbard and Jan Mayen[f]'],
['IntCountryID'=>215, 'CountryID'=>'SWE', 'Country'=>'Sweden'],
['IntCountryID'=>216, 'CountryID'=>'CHE', 'Country'=>'Switzerland'],
['IntCountryID'=>217, 'CountryID'=>'SYR', 'Country'=>'Syrian Arab Republic'],
['IntCountryID'=>218, 'CountryID'=>'TWN', 'Country'=>'Taiwan, Province of China[c]'],
['IntCountryID'=>219, 'CountryID'=>'TJK', 'Country'=>'Tajikistan'],
['IntCountryID'=>220, 'CountryID'=>'TZA', 'Country'=>'Tanzania, United Republic of'],
['IntCountryID'=>221, 'CountryID'=>'THA', 'Country'=>'Thailand'],
['IntCountryID'=>222, 'CountryID'=>'TLS', 'Country'=>'Timor-Leste'],
['IntCountryID'=>223, 'CountryID'=>'TGO', 'Country'=>'Togo'],
['IntCountryID'=>224, 'CountryID'=>'TKL', 'Country'=>'Tokelau'],
['IntCountryID'=>225, 'CountryID'=>'TON', 'Country'=>'Tonga'],
['IntCountryID'=>226, 'CountryID'=>'TTO', 'Country'=>'Trinidad and Tobago'],
['IntCountryID'=>227, 'CountryID'=>'TUN', 'Country'=>'Tunisia'],
['IntCountryID'=>228, 'CountryID'=>'TUR', 'Country'=>'Türkiye'],
['IntCountryID'=>229, 'CountryID'=>'TKM', 'Country'=>'Turkmenistan'],
['IntCountryID'=>230, 'CountryID'=>'TCA', 'Country'=>'Turks and Caicos Islands'],
['IntCountryID'=>231, 'CountryID'=>'TUV', 'Country'=>'Tuvalu'],
['IntCountryID'=>232, 'CountryID'=>'UGA', 'Country'=>'Uganda'],
['IntCountryID'=>233, 'CountryID'=>'UKR', 'Country'=>'Ukraine'],
['IntCountryID'=>234, 'CountryID'=>'ARE', 'Country'=>'United Arab Emirates'],
['IntCountryID'=>235, 'CountryID'=>'GBR', 'Country'=>'United Kingdom of Great Britain and Northern Ireland'],
['IntCountryID'=>236, 'CountryID'=>'USA', 'Country'=>'United States of America'],
['IntCountryID'=>237, 'CountryID'=>'UMI', 'Country'=>'United States Minor Outlying Islands[g]'],
['IntCountryID'=>238, 'CountryID'=>'URY', 'Country'=>'Uruguay'],
['IntCountryID'=>239, 'CountryID'=>'UZB', 'Country'=>'Uzbekistan'],
['IntCountryID'=>240, 'CountryID'=>'VUT', 'Country'=>'Vanuatu'],
['IntCountryID'=>241, 'CountryID'=>'VEN', 'Country'=>'Venezuela, Bolivarian Republic of'],
['IntCountryID'=>242, 'CountryID'=>'VNM', 'Country'=>'Viet Nam'],
['IntCountryID'=>243, 'CountryID'=>'VGB', 'Country'=>'Virgin Islands (British)'],
['IntCountryID'=>244, 'CountryID'=>'VIR', 'Country'=>'Virgin Islands (U.S.)'],
['IntCountryID'=>245, 'CountryID'=>'WLF', 'Country'=>'Wallis and Futuna'],
['IntCountryID'=>246, 'CountryID'=>'ESH', 'Country'=>'Western Sahara[c]'],
['IntCountryID'=>247, 'CountryID'=>'YEM', 'Country'=>'Yemen'],
['IntCountryID'=>248, 'CountryID'=>'ZMB', 'Country'=>'Zambia'],
['IntCountryID'=>249, 'CountryID'=>'ZWE', 'Country'=>'Zimbabwe']
];
$this->db->table('country')->insertBatch($data);
// race
$data = [
['RaceID'=>1, 'Race'=>'Jawa'],
['RaceID'=>2, 'Race'=>'Sunda'],
['RaceID'=>3, 'Race'=>'Batak'],
['RaceID'=>4, 'Race'=>'Suku asal Sulawesi lainnya'],
['RaceID'=>5, 'Race'=>'Madura'],
['RaceID'=>6, 'Race'=>'Betawi'],
['RaceID'=>7, 'Race'=>'Minangkabau'],
['RaceID'=>8, 'Race'=>'Bugis'],
['RaceID'=>9, 'Race'=>'Melayu'],
['RaceID'=>10, 'Race'=>'Suku asal Sumatera Selatan'],
['RaceID'=>11, 'Race'=>'Suku asal Banten'],
['RaceID'=>12, 'Race'=>'Suku asal Nusa Tenggara Timur'],
['RaceID'=>13, 'Race'=>'Banjar'],
['RaceID'=>14, 'Race'=>'Aceh'],
['RaceID'=>15, 'Race'=>'Bali'],
['RaceID'=>16, 'Race'=>'Sasak'],
['RaceID'=>17, 'Race'=>'Dayak'],
['RaceID'=>18, 'Race'=>'Tionghoa'],
['RaceID'=>19, 'Race'=>'Suku asal Papua'],
['RaceID'=>20, 'Race'=>'Makassar'],
['RaceID'=>21, 'Race'=>'Suku asal Sumatera lainnya'],
['RaceID'=>22, 'Race'=>'Suku asal Maluku'],
['RaceID'=>23, 'Race'=>'Suku asal Kalimantan lainnya'],
['RaceID'=>24, 'Race'=>'Cirebon'],
['RaceID'=>25, 'Race'=>'Suku asal Jambi'],
['RaceID'=>26, 'Race'=>'Suku Lampung'],
['RaceID'=>27, 'Race'=>'Suku asal Nusa Tenggara Barat lainnya'],
['RaceID'=>28, 'Race'=>'Gorontalo'],
['RaceID'=>29, 'Race'=>'Minahasa'],
['RaceID'=>30, 'Race'=>'Nias'],
['RaceID'=>31, 'Race'=>'Asing/luar negeri']
];
$this->db->table('race')->insertBatch($data);
//religion
$data = [
['ReligionID'=>1, 'Religion'=>'Islam'],
['ReligionID'=>2, 'Religion'=>'Kristen'],
['ReligionID'=>3, 'Religion'=>'Katolik'],
['ReligionID'=>4, 'Religion'=>'Hindu'],
['ReligionID'=>5, 'Religion'=>'Buddha'],
['ReligionID'=>6, 'Religion'=>'Konghucu'],
['ReligionID'=>7, 'Religion'=>'Lainnya'],
];
$this->db->table('religion')->insertBatch($data);
}
}

View File

@ -1,44 +0,0 @@
<?php
namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
class RaceSeeder extends Seeder {
public function run() {
$data = [
['RaceID'=>1, 'Race'=>'Jawa'],
['RaceID'=>2, 'Race'=>'Sunda'],
['RaceID'=>3, 'Race'=>'Batak'],
['RaceID'=>4, 'Race'=>'Suku asal Sulawesi lainnya'],
['RaceID'=>5, 'Race'=>'Madura'],
['RaceID'=>6, 'Race'=>'Betawi'],
['RaceID'=>7, 'Race'=>'Minangkabau'],
['RaceID'=>8, 'Race'=>'Bugis'],
['RaceID'=>9, 'Race'=>'Melayu'],
['RaceID'=>10, 'Race'=>'Suku asal Sumatera Selatan'],
['RaceID'=>11, 'Race'=>'Suku asal Banten'],
['RaceID'=>12, 'Race'=>'Suku asal Nusa Tenggara Timur'],
['RaceID'=>13, 'Race'=>'Banjar'],
['RaceID'=>14, 'Race'=>'Aceh'],
['RaceID'=>15, 'Race'=>'Bali'],
['RaceID'=>16, 'Race'=>'Sasak'],
['RaceID'=>17, 'Race'=>'Dayak'],
['RaceID'=>18, 'Race'=>'Tionghoa'],
['RaceID'=>19, 'Race'=>'Suku asal Papua'],
['RaceID'=>20, 'Race'=>'Makassar'],
['RaceID'=>21, 'Race'=>'Suku asal Sumatera lainnya'],
['RaceID'=>22, 'Race'=>'Suku asal Maluku'],
['RaceID'=>23, 'Race'=>'Suku asal Kalimantan lainnya'],
['RaceID'=>24, 'Race'=>'Cirebon'],
['RaceID'=>25, 'Race'=>'Suku asal Jambi'],
['RaceID'=>26, 'Race'=>'Suku Lampung'],
['RaceID'=>27, 'Race'=>'Suku asal Nusa Tenggara Barat lainnya'],
['RaceID'=>28, 'Race'=>'Gorontalo'],
['RaceID'=>29, 'Race'=>'Minahasa'],
['RaceID'=>30, 'Race'=>'Nias'],
['RaceID'=>31, 'Race'=>'Asing/luar negeri']
];
$this->db->table('race')->insertBatch($data);
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
class ReligionSeeder extends Seeder
{
public function run()
{
$data = [
['ReligionID'=>1, 'Religion'=>'Islam'],
['ReligionID'=>2, 'Religion'=>'Kristen'],
['ReligionID'=>3, 'Religion'=>'Katolik'],
['ReligionID'=>4, 'Religion'=>'Hindu'],
['ReligionID'=>5, 'Religion'=>'Buddha'],
['ReligionID'=>6, 'Religion'=>'Konghucu'],
['ReligionID'=>7, 'Religion'=>'Lainnya'],
];
$this->db->table('religion')->insertBatch($data);
}
}