Files
BE_IBL/application/libraries/Soresultlog.php
2026-04-15 15:16:12 +07:00

70 lines
1.7 KiB
PHP

<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Soresultlog
{
function __construct()
{
$CI = &get_instance();
$this->db_onedev = $CI->load->database("default", true);
$this->db_smartone = $CI->load->database("default", true);
}
function clean_mysqli_connection($dbc)
{
while (mysqli_more_results($dbc)) {
if (mysqli_next_result($dbc)) {
$result = mysqli_use_result($dbc);
if (get_class($result) == 'mysqli_stmt') {
mysqli_stmt_free_result($result);
} else {
unset($result);
}
}
}
}
public function step_action($act,$re_id,$userid)
{
//$CI = &get_instance();
//$this->db = $CI->load->database("one", true);
$sql = "INSERT INTO so_reactionlog(
So_REActionLogDate,
So_REActionLogSo_ResultEntryID,
So_REActionLogAction,
So_REActionLogUserID
)
VALUES(
NOW(),?,?,?
)";
$qry = $this->db_onedev->query($sql, array($re_id,$act,$userid));
if (!$qry) {
return array(false, print_r($this->db_onedev->error(), true));
}else
return array(true);
}
public function log_result($data_json,$re_id,$userid)
{
//$CI = &get_instance();
//$this->db = $CI->load->database("one", true);
//echo $re_id;
$sql = "INSERT INTO cpone_log.log_resultentry_so(
Log_ResultEntrySoDate,
Log_ResultEntrySoReID,
Log_ResultEntrySoJSON,
Log_ResultEntrySoUserID
)
VALUES(
NOW(),?,?,?
)";
$qry = $this->db_onedev->query($sql, array($re_id,$data_json,$userid));
if (!$qry) {
return array(false, print_r($this->db_onedev->error(), true));
}else
return array(true);
}
}