Esempio n. 1
0
         $ticket->setAssignedPerson($person);
     } catch (Exception $e) {
     }
 } elseif (isset($row['dept'])) {
     try {
         $department = new Department($row['dept']);
         $ticket->setAssignedPerson($department->getDefaultPerson());
     } catch (Exception $e) {
     }
 }
 // Check the location against Master Address
 // Master Address data should overwrite information from ReqPro
 $row['street_num'] = preg_replace('/[^a-zA-Z0-9\\-\\&\\s\'\\/]/', '', $row['street_num']);
 if ($row['street_num']) {
     $query = preg_match('/[a-zA-Z]/', $row['street_num']) ? $row['street_num'] : "{$row['street_num']} {$row['street_dir']} {$row['street_name']} {$row['street_type']} {$row['sud_type']} {$row['sud_num']}";
     $data = AddressService::getLocationData($query);
     echo $query . ' ==> ';
     if (count($data)) {
         $ticket->setAddressServiceData($data);
     } else {
         if (is_numeric($row['street_num'])) {
             $location = "{$row['street_num']} {$row['street_dir']} {$row['street_name']} {$row['street_type']} {$row['sud_type']} {$row['sud_num']}";
             $location = preg_replace('/\\s+/', ' ', $location);
             $ticket->setLocation($location);
         } else {
             $ticket->setLocation($row['street_num']);
         }
     }
 } else {
     $location = "{$row['street_dir']} {$row['street_name']} {$row['street_type']} {$row['sud_type']} {$row['sud_num']}";
     $location = preg_replace('/\\s+/', ' ', $location);
Esempio n. 2
0
 {
     $result = true;
     $securedMethods = ["getGoods", "getAdminOrder", "updateGood", "getGood", "getGoodImages", "deleteGood", "getDescriptionKeys", "getGoodsKeys", "getNextGoodCode", "uploadImagesForGood", "updatePrices", "listBooklets", "getBooklet", "saveBooklet", "deleteBooklet", "getBookletBackgrounds", "saveOrder"];
     if (in_array($methodName, $securedMethods)) {
         $result = isset($_SERVER['HTTPS']) && SessionManager::sessionStart() && AuthManager::isAuth();
     }
     return $result;
 }
 if (checkAccess($method)) {
     try {
         switch ($method) {
             case 'getPrices':
                 echo json_encode(PriceService::getPrices());
                 break;
             case 'getAddresses':
                 echo json_encode(AddressService::getAddresses());
                 break;
             case 'getGoods':
                 echo json_encode(GoodsService::getGoods(-1));
                 break;
             case 'updateGood':
                 $id = Utils::getFromPOST('id');
                 $data = Utils::getFromPOST('data');
                 echo json_encode(GoodsService::updateGood($id, $data));
                 break;
             case 'getGood':
                 $id = Utils::getFromPOST('id');
                 echo json_encode(GoodsService::getGood($id));
                 break;
             case 'getGoodImages':
                 $id = Utils::getFromPOST('id');