<?php

namespace App\Database\Seeds;

use CodeIgniter\Database\Seeder;

class LocationSeeder extends Seeder
{
  public function run()
  {
    $now = date('Y-m-d H:i:s');

    // location
    $data = [
      ['LocationID' => 1, 'LocCode' => 'QLOC', 'LocFull' => 'Dummy Location', 'LocType' => 'ROOM', 'Description' => 'Location made for dummy testing', 'CreateDate' => "$now" ],
      ['LocationID' => 2, 'LocCode' => 'DEFLOC', 'LocFull' => 'Default Location', 'LocType' => 'ROOM', 'Description' => 'Default location', 'CreateDate' => "$now" ]
    ];
    $this->db->table('location')->insertBatch($data);
    $data = [
      ['LocationID' => 1, 'Street1' => 'Jalan Nginden', 'Street2' => 'Intan Raya', 'City' => 'Surabaya', 'Province' => 'East Java', 'PostCode' => '60222', 'CreateDate' => "$now"],
      ['LocationID' => 2, 'Street1' => 'Jalan ', 'Street2' => 'Jalan jalan', 'City' => 'Depok', 'Province' => 'DKI Jakarta', 'PostCode' => '10123', 'CreateDate' => "$now"]
    ];
    $this->db->table('locationaddress')->insertBatch($data);
  }
}
