Batch 6a: application controllers base
This commit is contained in:
30
application/controllers/tools/Synctablev1.php
Normal file
30
application/controllers/tools/Synctablev1.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
class Synctablev1 extends MY_Controller
|
||||
{
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
//$this->db = $this->load->database('regional', true);
|
||||
$this->db = $this->load->database('onedev', true);
|
||||
}
|
||||
|
||||
function update() {
|
||||
$md5 = $this->sys_input["md5"];
|
||||
$param = $this->sys_input["param"];
|
||||
$j_param = json_encode($param);
|
||||
$l_md5 = md5($j_param);
|
||||
if ($md5 != $l_md5 ) {
|
||||
echo json_encode(array("status" => "ERR", "message" => "MD5 $md5 <> $l_md5"));
|
||||
exit;
|
||||
}
|
||||
$table = $param["table"];
|
||||
$records = $param["records"];
|
||||
$id = $param["id"];
|
||||
$qry = $this->db->update_batch($table,$records,$id);
|
||||
if (! $qry ) {
|
||||
echo json_encode( array("status" => "ERR", "message" => print_r($this->db->error(),true)));
|
||||
} else {
|
||||
echo json_encode( array("status" => "OK", "message" => ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user