Example #1
0
 public function setOrderStatusAction()
 {
     header('Content-type: text/plain; charset=utf-8');
     header('Cache-Control: no-store, no-cache');
     header('Expires: ' . date('r'));
     $orderId = Validate::validateInputVar('orderId', 'INPUT_GET', 'int');
     $statusId = Validate::validateInputVar('statusId', 'INPUT_GET', 'int');
     if (!$orderId || !$statusId) {
         throw new Exception('Неверный id для смены статуса заказа');
     }
     $model = new OrderTableModel();
     echo $model->setOrderStatus($orderId, $statusId);
 }