Ejemplo n.º 1
0
 function actionClose($oid)
 {
     $today = date('Y-m-d', strtotime('today'));
     //получить данные о рекламациях
     $con = Order::getOrderById($oid);
     $noer = 1;
     if (!Datas::isRekl($con['contract'])) {
         $allrekl = Order::getOrdersLikeParam('contract', $con['contract']);
         foreach ($allrekl as $order) {
             $rekl = Datas::isRekl($order['contract']);
             $stan = OrderStan::getOrdersByPole('oid', $order['id']);
             if ($stan[$order['id']]['sborka_end'] == 0 && $rekl == 1) {
                 $noer = 0;
             }
         }
     }
     if ($noer == 1) {
         $res1 = OrderStan::updateStanByParam('sborka_end_date', $today, $oid);
         $res2 = OrderStan::updateStanByParam('sborka_end', '2', $oid);
         echo $res1 && $res2;
         //           echo $noer;
     } else {
         echo $noer;
     }
     return true;
 }
Ejemplo n.º 2
0
 function actionCloseTech()
 {
     $oid = $_POST['oid'];
     $today = date('Y-m-d', strtotime('today'));
     $res1 = OrderStan::updateStanByParam('tech_date', $today, $oid);
     $res2 = OrderStan::updateStanByParam('tech_end', '2', $oid);
     echo $res1 && $res2;
     return true;
 }
Ejemplo n.º 3
0
 function actionTransfer()
 {
     $oid = $_POST['oid'];
     $date = $_POST['date'];
     OrderStan::updateStanByParam('plan', $date, $oid);
     return true;
 }
Ejemplo n.º 4
0
 function actionChangeDateStan()
 {
     $oid = $_POST['oid'];
     $pole = $_POST['pole'];
     $poledb = $this->arr_stan_date[$pole];
     $date = $_POST['date'];
     $datedb = preg_replace('/(\\d{1,2})\\.(\\d{1,2})\\.(\\d{4})/', '\\3-\\2-\\1', $date);
     $resget = OrderStan::getOrdersByPole('oid', $oid);
     if ($resget[$oid][$poledb] == '0000-00-00') {
         $res = OrderStan::updateStanByParam($poledb, $datedb, $oid);
     } else {
         $res = $resget[$oid][$poledb];
     }
     echo $res;
     return true;
 }