Beispiel #1
0
<?php

require_once "../../../Web/PHP/Models/General.php";
require "../Views/Admin.php";
require_once "../../../Web/PHP/Models/PDO.php";
require_once "../../../Web/PHP/Models/DB.php";
require_once "../Models/LB_DB.php";
require_once '../../../Web/PHP/Models/General.php';
$Inputs = filter_input_array(INPUT_GET);
$Query = "UPDATE `lbxxdb50`.`mgmt__ticket` SET bIs_Accepted = 0 WHERE Id = " . $Inputs['Ticket__Id'] . ";";
$MySQL = ccPDO::___GET("lbxxdb50", false, $Inputs['DB_Host']);
$bSuccess = ccDB::RUN__Query__INSERT(array($Query), $MySQL);
if ($bSuccess === true) {
    $File__Names = ccLB_Proc::crGET___Ticket__Pictures($Inputs);
    if ($Inputs['DB_Host'] === "localhost") {
        $bSuccess = ccLB_Proc__Ticket::MOVE__Files($File__Names, "WIP", "Deleted");
    } else {
        $bSuccess = ccLB_Proc__Ticket::MOVE__Files__FTP($File__Names, "WIP", "Deleted");
    }
}
echo json_encode(array($bSuccess));
Beispiel #2
0
 private function TXT_Action__32($DB)
 {
     $Schema = $this->Retained->GET___Class___FROM___Match_Object($DB);
     $Table__Name = $Schema->__NEW___Table___FROM___Match_Action("Ticket_", $DB, $this->Retained->GET__iPhrase__Min());
     // FLOAT === +1 / -1 --> VAT
     $Phrase_A1_B1 = ccPhrase__Custom::__NEW_AFTER___N_whType_whLine_whMarker($this, 1, 0, ")");
     $VAT = ccLB_Proc__Ticket::PARSE___VAT($Phrase_A1_B1->Value);
     if ($VAT === false) {
         $Phrase_A1_B1 = ccPhrase__Custom::__NEW_BEFROE___N_whType_whLine_whMarker($this, 1, -1, "(");
         $VAT = ccLB_Proc__Ticket::PARSE___VAT($Phrase_A1_B1->Value);
     }
     // 'x' === -1 / -2 --> Price x Volume
     $Phrase_B1_B2 = ccPhrase__Custom::__NEW_BEFROE___N_whLine($this, 0, 1, -1);
     if (strpos($Phrase_B1_B2->Value, "x") === false) {
         $Phrase_B1_B2 = ccPhrase__Custom::__NEW_BEFROE___N_whLine($this, 1, 0);
     }
     if (trim($Phrase_B1_B2->Value) === "x") {
         $this->Retained->Add__Phrases($Phrase_B1_B2->iPhrases);
     } else {
         if (strpos($Phrase_B1_B2->Value, "x") !== false) {
             $Price = ccLB_Proc__Ticket::PARSE___Price($Phrase_B1_B2->Value);
             $Volume = ccLB_Proc__Ticket::PARSE___Volume($Phrase_B1_B2->Value);
             if ($Price !== false) {
                 $this->Retained->ADD___Fact___FROM___Match_Action("Price", $Price, $Phrase_B1_B2, $Schema, $Table__Name);
             }
             if ($Volume !== false) {
                 $this->Retained->ADD___Fact___FROM___Match_Action("Volume", $Volume, $Phrase_B1_B2, $Schema, $Table__Name);
             }
         }
     }
     if ($VAT !== false) {
         $this->Retained->ADD___Fact___FROM___Match_Action("VAT", $VAT, $Phrase_A1_B1, $Schema, $Table__Name);
     }
     // CURRENCY === +1 --> Value
     $Phrase_A1 = ccPhrase__Custom::__NEW_AFTER___N_whLine($this, 1, 0);
     $Value__A1 = $Phrase_A1->GET___Value__CURRENCY();
     $this->Retained->ADD___Fact___FROM___Match_Action("Value", $Value__A1, $Phrase_A1, $Schema, $Table__Name);
     return $Schema;
 }
Beispiel #3
0
 public static function CREATE_NEW__Ticket($Inputs)
 {
     $Queries = array();
     $Queries['Ticket'] = ccTicket::GET__Query__Finalize($Inputs);
     if (array_key_exists('Ticket_Discount', $Inputs) === true) {
         $Queries['Ticket_Discount'] = ccLB_Proc::GET__Query__Finalize($Inputs, "Ticket_Discount");
     }
     if (array_key_exists('Ticket_Loyalty', $Inputs) === true) {
         $Queries['Ticket_Loyalty'] = ccLB_Proc::GET__Query__Finalize($Inputs, "Ticket_Loyalty");
     }
     $Queries['Ticket_Product'] = ccLB_Proc::GET__Query__Finalize($Inputs, "Ticket_Product");
     if (array_key_exists('Ticket_Product_Discount', $Inputs) === true) {
         $Queries['Ticket_Product_Discount'] = ccLB_Proc::GET__Query__Finalize($Inputs, "Ticket_Product_Discount");
     }
     $Queries['Ticket_Info'] = ccTicket_Info::GET__Query__Finalize($Inputs);
     global $PDO;
     $Query = null;
     try {
         $PDO->setAttribute(PDO::ATTR_AUTOCOMMIT, 0);
         $PDO->beginTransaction();
         foreach ($Queries as $Query) {
             $PDO->exec($Query);
         }
         $File__Names = array($Inputs['Ticket_Info']['File_Pic']);
         //        ccTicket_Info::MOVE__Ticket_Files($Inputs['Ticket_Info'][File_Name], "WIP", "Ready");
         if ($Inputs['DB_Host'] === "localhost") {
             $bSuccess = ccLB_Proc__Ticket::MOVE__Files($File__Names, "WIP", "Ready");
         } else {
             $bSuccess = ccLB_Proc__Ticket::MOVE__Files__FTP($File__Names, "WIP", "Ready");
         }
         if ($bSuccess === false) {
             $PDO->rollBack();
             throw new Exception();
         }
         //            $bSuccess = ccDB::RUN__Query__INSERT($Queries, $PDO);
         $PDO->commit();
     } catch (Exception $e) {
         $PDO->rollBack();
         echo "ERROR: An error occured while executing, please review.\r\n";
         echo $Query . "\r\n";
         ccGeneral::EXCEPTION___Process($e, debug_backtrace());
     }
     return $bSuccess;
 }