Initial import
This commit is contained in:
33
application/controllers/v1/system/Genno.php
Normal file
33
application/controllers/v1/system/Genno.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user