Files
2026-04-15 15:23:57 +07:00

34 lines
838 B
PHP
Executable File

<?php
class Genno extends MY_Controller {
var $db_onedev;
public function index()
{
$sql = "truncate noreg_prefix;";
$this->db_onedev->query($ql);
$sql = "insert into noreg_prefix(NoregPrefixYear,
NoregPrefixMonth, NoregPrefixCode )
values(?,?,?)";
$year = 2019;
$month = 12;
$xcode = 0;
for($i_y= $year ; $i_y < 2030 ; $i_y++ ) {
$s_month = 1;
if ($i_y == 2019 ) $s_month = 12;
for($i_x = $s_month; $i_x < 13; $i_x++) {
$scode = sprintf("%03d",$xcode);
$this->db_onedev->query($sql, array($i_y,$i_x, $scode));
if ($scode == "999") break;
$xcode++;
}
}
}
public function __construct()
{
parent::__construct();
$this->db_onedev = $this->load->database("onedev", true);
}
}
?>