init backend presensi

This commit is contained in:
mwpn
2026-03-05 14:37:36 +07:00
commit b4fda6b9c9
319 changed files with 27261 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
/**
* Satu set pengaturan presensi terpusat: jam masuk & jam pulang sekolah.
* Koordinat sekolah tetap di table zones (SMA1-SCHOOL).
*/
class CreateSchoolPresenceSettingsTable extends Migration
{
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true,
],
'time_masuk_start' => [
'type' => 'TIME',
'null' => true,
'comment' => 'Mulai window absen masuk (misal 06:30)',
],
'time_masuk_end' => [
'type' => 'TIME',
'null' => true,
'comment' => 'Akhir window absen masuk (misal 07:00)',
],
'time_pulang_start' => [
'type' => 'TIME',
'null' => true,
'comment' => 'Mulai window absen pulang (misal 14:00)',
],
'time_pulang_end' => [
'type' => 'TIME',
'null' => true,
'comment' => 'Akhir window absen pulang (misal 14:30)',
],
'created_at' => [
'type' => 'DATETIME',
'null' => true,
],
'updated_at' => [
'type' => 'DATETIME',
'null' => true,
],
]);
$this->forge->addKey('id', true);
$this->forge->createTable('school_presence_settings');
// Satu row default
$this->db->table('school_presence_settings')->insert([
'time_masuk_start' => '06:30:00',
'time_masuk_end' => '07:00:00',
'time_pulang_start' => '14:00:00',
'time_pulang_end' => '14:30:00',
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
]);
}
public function down()
{
$this->forge->dropTable('school_presence_settings');
}
}