public function XulyVeTrungHienTai() { $m_datve = new Default_Model_Datve(); $date = date("Y-m-d"); $arr_thongtin = $m_datve->showDatVeWhere($date); foreach ($arr_thongtin as $key => $value) { $content = $value['content']; $status = substr($content, 0, 2); if ($status == "xs") { $content = substr($content, 3); $phone = $value['phone']; $this->phantichchuoi($content, $phone, $date, $phone); } } }
public function insertDatVeCT($arr_data) { $status = "Receive_Inbox"; $phone = ""; $date = ""; $content = ""; if (isset($arr_data[2])) { $phone = $arr_data[2]; $arr_name = explode("<", $phone); $phone = $arr_name[0]; // $phone = preg_replace('/\s+/', '', $phone); $phone = str_replace(" ", '', $phone); $phone = mysql_real_escape_string($phone); $phone_temp = substr($phone, 0, 3); if ($phone_temp == "+84") { $phone_temp = '0' . substr($phone, 3); $phone = $phone_temp; } } if (isset($arr_data[3])) { $date = $arr_data[3]; $date = date_create($date); $date = date_format($date, "Y-m-d H:i:s"); } if (isset($arr_data[4])) { $content = $arr_data[4]; // $content =mysql_real_escape_string($content); } if (isset($arr_data[1])) { $status = $arr_data[1]; } $m_datve = new Default_Model_Datve(); if ($m_datve->checkDatVe($phone, $date) < 1) { if ($phone != "" && $date != "" && $content != "") { if ($status == "Receive_Inbox") { if ($this->checkDateOK($date)) { $params = array("phone" => $phone, "date" => $date, "content" => $content); return $m_datve->insertDatVe($params); } else { return; } } } } else { return false; } }