Initial commit

This commit is contained in:
meusinfirmary
2025-04-22 14:33:37 +07:00
commit b9891d2f81
1305 changed files with 452033 additions and 0 deletions

49
app/Models/Region.php Executable file
View File

@ -0,0 +1,49 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Region extends Model
{
public static function listProv()
{
return DB::select("SELECT * FROM t_region GROUP BY kodeProv;");
}
public static function getLikeProv($prname)
{
return DB::select("SELECT * FROM t_region WHERE nmProvinsiKel LIKE ? GROUP BY kodeProv;", ['%'.$prname.'%']);
}
public static function listCity($kodeProv)
{
return DB::select("SELECT * FROM t_region WHERE kodeProv = ? GROUP BY kodeKab;", [$kodeProv]);
}
public static function getLikeCity($ktname)
{
return DB::select("SELECT * FROM t_region WHERE nmKotamadyaKel LIKE ? GROUP BY kodeKab;", ['%'.$ktname.'%']);
}
public static function listDistrict($kodeKab)
{
return DB::select("SELECT * FROM t_region WHERE kodeKab = ? GROUP BY kodeKec;", [$kodeKab]);
}
public static function getLikeDistrict($kcname)
{
return DB::select("SELECT * FROM t_region WHERE nmKecamatanKel LIKE ? GROUP BY kodeKec;", ['%'.$kcname.'%']);
}
public static function listVillage($kodeKec)
{
return DB::select("SELECT * FROM t_region WHERE kodeKec = ? GROUP BY kodeKel;", [$kodeKec]);
}
public static function getLikeVillage($klname)
{
return DB::select("SELECT * FROM t_region WHERE nmKelurahan LIKE ? GROUP BY kodeKel;", ['%'.$klname.'%']);
}
}