Advertisement
sanych_dv

Untitled

Nov 23rd, 2016
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. static public function addHistoryLog($table_name, $record_id, $action, $data = array())
  2.     {
  3.         $user_id = Lib_User::getUser()->getUid();
  4.  
  5.         $compressed_data = base64_encode(gzcompress(json_encode($data), 9));
  6.  
  7.         $updateFields = array(
  8.             'timestamp' => time(),
  9.             'table_name' => $table_name,
  10.             'record_id' => $record_id,
  11.             'action' => $action,
  12.             'user_id' => $user_id,
  13.             'param1' => $compressed_data
  14.         );
  15.  
  16.         $query = Lib_MysqlManage::insertRequestFromArray($updateFields, 'data_history_log');
  17.  
  18.         Lib_MysqlManage::makeQuery($query);
  19.        
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement