Esempio n. 1
0
 static function processException($e)
 {
     $msg = core_log::logException($e);
     if (app::getConfig('app/echo_exception')) {
         echo nl2br($msg);
     }
 }
Esempio n. 2
0
 public function __construct()
 {
     parent::__construct();
     $this->log("Load Extension: Parameter");
 }
Esempio n. 3
0
 public function __construct($msg)
 {
     core_log::log($msg, 'controller.exception.log');
 }
Esempio n. 4
0
 /**
  * F*****G SHIT FUNCTION . SORRY FOR THS F**K
  * @param $csv
  * @param $orig
  * @return array
  * @throws Exception
  */
 protected function _pareseEmailBodyCsv($csv, $orig)
 {
     //$orig = $this->_prepareCsvString($csv);
     $csv = $this->_prepareCsvString($orig);
     $array = explode(';', $csv);
     if (!is_array($array) || !isset($array[0]) || !isset($array[1]) || !isset($array[2]) || !isset($array[3]) || !isset($array[4])) {
         $csv = $this->tryEncodeUtf8($orig);
         $csv = $this->_prepareCsvString($csv);
         core_debug::dump($csv);
         $array = str_getcsv($csv, ';');
     }
     if (!is_array($array) || !isset($array[0]) || !isset($array[1]) || !isset($array[2]) || !isset($array[3]) || !isset($array[4])) {
         $csv = $this->tryEncodebase64($orig);
         $csv = $this->_prepareCsvString($csv);
         core_debug::dump($csv);
         $array = str_getcsv($csv, ';');
     }
     if (!is_array($array) || !isset($array[0]) || !isset($array[1]) || !isset($array[2]) || !isset($array[3]) || !isset($array[4])) {
         throw new Exception('Error while parsing email body');
     }
     $lat = $array[1];
     $long = $array[2];
     $user_id = $this->_getUserByImei($array[0]);
     $user = new manage_model_user();
     $user->load($user_id);
     $city_name = core_google_geo::findCityName($lat, $long);
     if (!$city_name) {
         $city_id = $user->getData('city_id');
     } else {
         $city_id = $this->_getCityIdByName($city_name);
     }
     $data = array('imei' => $array[0], 'user_id' => $user_id, 'lat' => $lat, 'long' => $long, 'date' => $array[3] / 1000, 'activity_id' => $array[4], 'city_id' => $city_id);
     core_log::log($data, self::$grabtime . '.event.imap.log');
     return $data;
 }
Esempio n. 5
0
 public function addTradePointAction()
 {
     try {
         $tpData = array('name' => $this->getRequest()->getParam('spn'), 'address' => $this->getRequest()->getParam('adr'), 'long' => $this->getRequest()->getParam('long'), 'lat' => $this->getRequest()->getParam('lat'), 'contact_person ' => $this->getRequest()->getParam('con'), 'phone' => $this->getRequest()->getParam('tel'), 'personal_count' => $this->getRequest()->getParam('per'), 'rate' => $this->getRequest()->getParam('ppr'), 'web' => $this->getRequest()->getParam('web'), 'email' => $this->getRequest()->getParam('eml'), 'info' => $this->getRequest()->getParam('inf'), 'is_light_box' => $this->getRequest()->getParam('ilb'), 'is_panel' => $this->getRequest()->getParam('ipl'), 'shelf' => $this->getRequest()->getParam('slf'), 'competitor_id' => $this->getRequest()->getParam('competitor_id'));
         $img_64 = $this->getRequest()->getParam('img');
         $uniqid = uniqid('tp');
         $file_path = app::getConfig("dir/sd") . 'tp' . DS . 'img' . DS . date('Y') . DS . date('m') . DS . date('d') . DS . $uniqid . '.jpg';
         $file_url = 'sd' . DS . 'tp' . DS . 'img' . DS . date('Y') . DS . date('m') . DS . date('d') . DS . $uniqid . '.jpg';
         core_fs::createDirIfNotExists(dirname($file_path));
         $this->_saveRequestImage($file_path, $img_64);
         $tpData['image'] = $file_url;
         $trade_point = new manage_model_tradepoint();
         $trade_point->setData($tpData);
         $trade_point->save();
         core_log::log($trade_point->getData(), 'tp/' . date('d-m-Y') . 'trade_points.added.log');
         $request = $_REQUEST;
         unset($request['img']);
         $request['img'] = $file_path;
         core_log::log($request, 'tp/' . date('d-m-Y') . 'trade_point.request.log');
         $this->_xhrOk();
     } catch (Exception $e) {
         $request = $_REQUEST;
         unset($request['img']);
         $request['img'] = $file_path;
         core_log::logException($e);
         core_log::log($request, 'tp/' . date('d-m-Y') . 'trade_point.request.log');
         core_log::log($e->getMessage(), 'tp/' . date('d-m-Y') . 'trade_point.error.log');
         $this->_xhrErr('err: see exception log');
     }
 }