Пример #1
0
 function __construct()
 {
     $actions = array("sendToWhse", "oversold", "complete");
     parent::__construct();
     if (isset($_POST['action']) && in_array($_POST['action'], $actions)) {
         if ($_POST['action'] === "sendToWhse") {
             $this->updateStatus(1);
             $mail = new email();
             $mail->pulled($_POST);
             $trak = new trakItem();
             $trak->returnItem($_POST['trakSKU'], $_POST['qty']);
             $this->log("ITEM SENT TO WHSE: " . $_POST['orderID'] . " " . $_POST['scSKU']);
         }
         if ($_POST['action'] === "oversold") {
             $this->updateStatus(2);
             $mail = new email();
             $mail->oversold($_POST);
             $sc = new SCitem($_POST['scSKU']);
             $sc->setQty(0);
             $this->log("ITEM MARKED OVERSOLD: " . $_POST['orderID'] . " " . $_POST['scSKU']);
         }
         if ($_POST['action'] === "complete") {
             $this->completeItem($_POST);
             $this->log("ITEM REMOVED AS COMPLETE: " . $_POST['orderID'] . " " . $_POST['scSKU']);
         }
     }
 }