예제 #1
0
파일: ajax-end.php 프로젝트: phpsmith/IS4C
 $PRINT_OBJ = new $print_class();
 $email = trim(CoreState::getCustomerPref('email_receipt'));
 $customerEmail = filter_var($email, FILTER_VALIDATE_EMAIL);
 $doEmail = $customerEmail !== false ? true : false;
 if ($receiptType != "none") {
     $receiptContent[] = ReceiptLib::printReceipt($receiptType, $receiptNum, false, $doEmail);
 }
 if ($receiptType == "ccSlip" || $receiptType == 'gcSlip') {
     // don't mess with reprints
 } elseif (CoreLocal::get("autoReprint") == 1) {
     CoreLocal::set("autoReprint", 0);
     $receiptContent[] = ReceiptLib::printReceipt($receiptType, $receiptNum, true);
 }
 // use same email class for sending the receipt
 // as was used to generate the receipt
 $email_class = ReceiptLib::emailReceiptMod();
 if ($transFinished) {
     CoreLocal::set("End", 0);
     $output = $yesSync;
     UdpComm::udpSend("termReset");
     $sd = MiscLib::scaleObject();
     if (is_object($sd)) {
         $sd->ReadReset();
     }
     CoreLocal::set('ccTermState', 'swipe');
     uploadAndReset($receiptType);
 }
 // close session so if printer hangs
 // this script won't lock the session file
 if (session_id() != '') {
     session_write_close();