curl_close($ch); if ($errno == 0) { writeLine(" API server was located and responds. {$serverUrl} "); } else { writeError(" API server failed to respond (Error {$errno}). Validate the server url : {$serverUrl} "); writeLink("drop.php", "Drop Schema, Start Again"); return; } echo "<hr />"; writeLine("<h1>Step 5: Setting up initial data.</h1>"); $adminPassword = createRandomPassword(); $result = loadBasicData('ringside', $adminPassword, $database); if ($result == true) { writeLine(" Basic setup information and some sample data was written to the database."); // writeLine( " Admin user name is <b>admin</b> and password is <b>$adminPassword</b>" ); writeLine(" The following example users were created as well, all with password <b>ringside</b>"); echo "<table cellpadding='4' width='80%'> "; writeRow('*****@*****.**', '*****@*****.**', '*****@*****.**', 1); writeRow('*****@*****.**', '*****@*****.**', '*****@*****.**', 2); writeRow('*****@*****.**', '*****@*****.**', '*****@*****.**', 3); echo "</table>"; } else { writeError(" While everything seems to be setup we could not add the data to the database. <br />" . "<b>Maybe do some clean up of an old install/version first?</b>"); writeLink("drop.php", "Drop Schema, Start Again"); return; } $href = ""; if (isset($_SERVER['PATH_INFO'])) { $href = "../" . $href; } echo "<hr />";
writeLine(8, '$this->execute("' . $rowSql . '");'); } } if ($tableName != $lastTableName) { echo "\n"; } } if ($migrationDataType == 'full') { echo "\n"; foreach ($tableDefinitions as $tableName => $tableDefinition) { writeLine(8, "\$this->execute('DROP TABLE {$tableName}');"); if ($tableName != $lastTableName) { echo "\n"; } } } echo "\n"; } else { foreach (array_reverse($tableDefinitions) as $tableName => $tableDefinition) { writeLine(8, "\$this->execute('DROP TABLE {$tableName}');"); } } if (count($tableDefinitions) > 1) { echo "\n"; } writeLine(8, "\$this->execute('SET FOREIGN_KEY_CHECKS = 1');"); } ?> } }
$stmt = $dbh->query($sql); $res = $stmt->fetch(PDO::FETCH_ASSOC); if ((int) $res['count'] == 0) { writeLine("'forex' user NOT found! Adding.."); //add acount $sql = "GRANT USAGE ON *.* TO 'forex'@'localhost' IDENTIFIED BY PASSWORD '*A8946DC43650F3217043FCB748FAAFEDC65E81E5';\n\t\t\tGRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, LOCK TABLES, EXECUTE ON `forex`.* TO 'forex'@'localhost';"; $stmt = $dbh->query($sql); } else { writeLine("'forex' user found!"); } //Create database + tables writeLine("Installing 'forex' database"); $stmt = $dbh->query("CREATE DATABASE forex"); $cmd = "mysql -u {$username} -p{$password} -D forex < protected/db/forex.sql"; $result = exec($cmd); //print if we have error? if (!empty($result)) { writeLine($result); } //done writeLine("Done!"); // Exit correctly exit(0); function writeLine($msg) { fwrite(STDOUT, $msg . "\n"); } function read_line() { return trim(fgets(STDIN)); }
function wikiToHtml(&$session, $wiki_text) { $lines = explode("\n", $wiki_text); $session->trace(TC_Util1, 'wikiToHtml: ' . (0 + count($lines)) . ' Zeilen' . "({$lines['0']})"); $status = new LayoutStatus($session); foreach ($lines as $ii => $line) { if (($line_trimmed = trim($line)) == '') { writeParagraphEnd($status); } else { #$session->trace (TC_X, "Neue Zeile: '$line_trimmed' $line]"); if ($line_trimmed == '[code]') { $session->startCode(); } elseif ($line_trimmed == '[/code]') { $session->finishCode(); } elseif ($session->fPreformated) { echo htmlentities($line); } else { switch (substr($line, 0, 1)) { case '!': if (substr($line, 1, 1) == '|') { writeTableHeader($line, $status); } else { writeHeader($line, $status); } break; case ' ': writeLine($line, $status); break; # writeIndent ($line, $status); break; # writeIndent ($line, $status); break; case '*': writeUList($line, $status); break; case '#': writeOrderedList($line, $status); break; case '|': writeTable($line, $status); break; case '-': writeHoricontalLine($line, $status); break; default: writeLine($line, $status); break; } } } } // foreach $session->trace(TC_Util1, 'wikiToHtml-Ende'); }
} if ($_SESSION["yousaved"] > 0) { $receipt .= centerString("You Saved \$" . number_format($_SESSION["yousaved"]), 2) . "\n"; } if ($_SESSION["couldhavesaved"] > 0 && $_SESSION["yousaved"] > 0) { $receipt .= centerString("You could have saved an additional \$" . number_format($_SESSION["couldhavesaved"], 2)) . "\n"; } elseif ($_SESSION["couldhavesaved"] > 0) { $receipt .= centerString("You could have saved \$" . number_format($_SESSION["couldhavesaved"]), 2) . "\n"; } $receipt .= centerString($_SESSION["receiptFooter1"]) . "\n" . centerString($_SESSION["receiptFooter2"]) . "\n" . centerString($_SESSION["receiptFooter3"]) . "\n" . centerString($_SESSION["receiptFooter4"]) . "\n"; if ($_SESSION["chargetender"] != 0) { // apbw 03/10/05 Reprint patch $receipt = $receipt . printChargeFooterCust($dateTimeStamp, $ref); // apbw 03/10/05 Reprint patch $receipt = $receipt . printChargeFooterStore($dateTimeStamp, $ref); // apbw 03/10/05 Reprint patch } // apbw 03/10/05 Reprint patch $receipt = $receipt . "\n\n\n\n\n\n\n"; // apbw 03/10/05 Reprint patch writeLine($receipt . chr(27) . chr(105)); // apbw 03/10/05 Reprint patch $receipt = ""; // apbw 03/10/05 Reprint patch $_SESSION["memMsg"] = ""; $_SESSION["memberID"] = "0"; $_SESSION["memType"] = 0; $_SESSION["percentDiscount"] = 0; getsubtotals(); } gohome();
$filesArray[] = array($col_type => filetype($file), $col_name => $file, $col_href => $file, $col_mod => $mod, $col_size => $size, $col_desc => $desc); } closedir($dir_list); //sorting $sort_col = array(); foreach ($filesArray as $sub) { $sort_col[] = $sub[$category]; } if ($order == "A") { array_multisort($sort_col, SORT_ASC, $filesArray); } else { array_multisort($sort_col, SORT_DESC, $filesArray); } //display sorted filelist foreach ($filesArray as $index => $info) { writeLine($info[$col_type], $info[$col_name], $info[$col_href], $info[$col_mod], $info[$col_size], $info[$col_desc]); } } echo "</pre>"; echo "<hr>"; echo "<i>" . $_SERVER['SERVER_SOFTWARE'] . "</i><br><br>"; ?> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-5372478-1"); pageTracker._trackPageview();
function cutreceipt() { writeLine(chr(27) . chr(105)); }
function tenderReport() { $db_a = mDataConnect(); $blank = " "; $eosQ = "select max(tdate) from dlog where register_no = " . $_SESSION["laneno"] . " and upc = 'ENDOFSHIFT'"; $eosR = mysql_query($eosQ); $row = mysql_fetch_row($eosR); $EOS = $row[0]; // $EOS = '2007-08-01 12:00:00'; $query_ckq = "select * from cktenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"] . " order by emp_no, tdate"; $query_ccq = "select * from cctenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"] . " order by emp_no, tdate"; $query_dcq = "select * from dctenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"] . " order by emp_no, tdate"; $query_miq = "select * from mitenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"] . " order by emp_no, tdate"; $query_fsq = "select * from fstenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"] . " order by emp_no, tdate"; $query_bp = "select * from buspasstotals where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"] . " order by emp_no, tdate"; $fieldNames = " " . substr("Time" . $blank, 0, 10) . substr("Lane" . $blank, 0, 7) . substr("Trans #" . $blank, 0, 6) . substr("Emp #" . $blank, 0, 8) . substr("Change" . $blank, 0, 10) . substr("Amount" . $blank, 0, 10) . "\n"; $ref = centerString(trim($_SESSION["CashierNo"]) . "-" . trim($_SESSION['laneno']) . " " . trim($_SESSION["cashier"]) . " " . build_time(time())) . "\n"; // ---------------------------------------------------------------------------------------------------- $receipt .= chr(27) . chr(33) . chr(5) . centerString("T E N D E R R E P O R T") . "\n"; $receipt .= $ref; $receipt .= centerString("------------------------------------------------------"); $receipt .= str_repeat("\n", 2); // -------------------------------- // ccm-rle 10-12-2009 adding a total gross query that calculates the total gross sales // removed the sales tax from the gross total by removing IN (,'A') from trans_type $grossQ = "SELECT SUM(total) AS gross \r\n from dlog\r\n where tdate > '" . $EOS . "'\r\n and register_no = " . $_SESSION['laneno'] . "\r\n and trans_type IN('I','D')\r\n and trans_subtype NOT IN('IC','MC')\n and trans_status <> 'X'\r\n and UPC <> 'DISCOUNT'\r\n AND emp_no <> 9999"; // ccm-rle delete this /* $fp=fopen('cancel-log.txt','w'); fwrite($fp,$grossQ); fclose($fp); */ $grossR = mysql_query($grossQ); $row = mysql_fetch_row($grossR); $receipt .= " " . substr("Gross Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0], 2), -8) . "\n"; $receipt .= "\n"; // --- ccm-rle adding total discounts for tracking purposes to tenderReport $disc_tot = "SELECT ROUND(SUM(total),2) AS gross\r\n FROM dlog\r\n WHERE tdate > '" . $EOS . "'\r\n AND register_no = " . $_SESSION['laneno'] . " \r\n AND upc = 'DISCOUNT'\n\t\tAND emp_no <> 9999"; $results_tot = mysql_query($disc_tot); $row = mysql_fetch_row($results_tot); $receipt .= " " . substr("Discount Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0] * -1, 2), -8) . "\n"; // ccm-rle adding up all of the items that were taxable as sales - this number won't include items that were food stamp tendered... so I'm commenting it out. /* $taxablesalesQ = "SELECT SUM(total) AS gross from dlog where tdate > '" .$EOS. "' and register_no = " .$_SESSION['laneno']. " and trans_type IN('I','D') and trans_subtype <> 'IC' and tax = 1 and trans_status <> 'X' AND emp_no <> 9999"; $taxablesalesR = mysql_query($taxablesalesQ); $row = mysql_fetch_row($taxablesalesR); $receipt .= " ".substr("Taxable Sales Total: ".$blank.$blank,0,20); $receipt .= substr($blank.number_format(($row[0]),2),-8)."\n"; $receipt .= "\n"; */ // ccm-rle added total tax to tender tape as well $tax_tot = "SELECT ROUND(SUM(total),2) AS gross\r\n FROM dlog\r\n WHERE tdate > '" . $EOS . "'\r\n AND register_no = " . $_SESSION['laneno'] . " \n\t\tAND emp_no <> 9999\r\n AND trans_type = 'A'"; $results_tot = mysql_query($tax_tot); $row = mysql_fetch_row($results_tot); $receipt .= " " . substr("Sales Tax Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0], 2), -8) . "\n"; // ---------------------------------------------------------------------------------------------------- // ccm-rle 10-8-2009 added trans_status <> 'X' to below so that transactions that are cancelled are not counted in the register. This may not be the best idea. This is actually already done by dlog automatically. $netQ = "SELECT SUM(total) AS net\r\n\t\tfrom dlog\r\n\t\twhere tdate > '" . $EOS . "'\r\n\t\tand register_no = " . $_SESSION['laneno'] . "\r\n\t\tand trans_type IN('I','D','A')\r\n\t\tand trans_subtype NOT IN('IC','MC')\n\t\tAND emp_no <> 9999"; $netR = mysql_query($netQ); $row = mysql_fetch_row($netR); $receipt .= " " . substr("NET Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0], 2), -8) . "\n"; $receipt .= "\n"; // ccm-rle 4-20-2010 Coupons that are tendered vs. scanned don't show up under net, but do under tender totals. So in order to balance the register we need the unscanned coupon total added up. This is a work around but should balance the reports. $coupontenderQ = "SELECT SUM(total) AS coupontender\n from dlog\n where tdate > '" . $EOS . "'\n and register_no = " . $_SESSION['laneno'] . "\n and trans_type IN('T')\n and trans_subtype = 'MC'\n AND emp_no <> 9999"; $coupontenderR = mysql_query($coupontenderQ); $row = mysql_fetch_row($coupontenderR); $receipt .= " " . substr("Unscanned Coupon Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0], 2), -8) . "\n"; $receipt .= "\n"; // ccm-rle this is where the various tendered items are added to the receipt such as debit card and WIC, in order to remove unused tenders the database needs to be modified to remove them and also is4c needs to have the commented out as potential tender sources. For the purposes of CCM we will be removed debit cards, EBT cash, WIC, prehkeys.php is where the tenders are recognized by is4c. ignoring this for now to code in needed aspects. $tendertotalsQ = "SELECT t.TenderName as tender_type,ROUND(-sum(d.total),2) as total,COUNT(*) as count\r\n\t\tFROM dlog d RIGHT JOIN is4c_op.tenders t\r\n\t\tON d.trans_subtype = t.TenderCode\r\n\t\tAND tdate > '" . $EOS . "'\r\n\t\tAND register_no = " . $_SESSION['laneno'] . " \r\n\t\tAND d.emp_no <> 9999\r\n AND trans_status <> 'X'\r\n\t\tGROUP BY t.TenderName"; $results_ttq = mysql_query($tendertotalsQ); while ($row = mysql_fetch_row($results_ttq)) { if (!isset($row[0])) { $receipt .= "NULL"; } else { $receipt .= " " . substr($row[0] . $blank . $blank, 0, 20); } if (!isset($row[1])) { $receipt .= " 0.00"; } else { $receipt .= substr($blank . number_format($row[1], 2), -8); } if (!isset($row[2])) { $receipt .= "NULL"; } else { if (!isset($row[1])) { $row[2] = 0; } $receipt .= substr($blank . $row[2], -4, 4); } $receipt .= "\n"; } $receipt .= "\n"; $cack_tot = "SELECT ROUND(SUM(total),2) AS gross\r\n\t\tFROM dlog\r\n\t\tWHERE tdate > '" . $EOS . "'\r\n\t\tAND register_no = " . $_SESSION['laneno'] . "\r\n\t\tAND trans_subtype IN ('CA','CK')\n\t\tAND emp_no <> 9999"; $results_tot = mysql_query($cack_tot); $row = mysql_fetch_row($results_tot); $receipt .= " " . substr("CA & CK Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0] * -1, 2), -8) . "\n"; $card_tot = "SELECT ROUND(SUM(total),2) AS gross\r\n\t\tFROM dlog\r\n\t\tWHERE tdate > '" . $EOS . "'\r\n\t\tAND register_no = " . $_SESSION['laneno'] . "\n\t\tAND emp_no <> 9999\t\t\r\n\t\tAND trans_subtype IN ('DC','CC','FS','EC')"; $results_tot = mysql_query($card_tot); $row = mysql_fetch_row($results_tot); $receipt .= " " . substr("DC / CC / EBT Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0] * -1, 2), -8) . "\n"; $hchrg_tot = "SELECT ROUND(SUM(total),2) AS gross\r\n\t\tFROM dlog\r\n\t\tWHERE tdate > '" . $EOS . "'\r\n\t\tAND register_no = " . $_SESSION['laneno'] . "\r\n\t\tAND trans_subtype = 'MI'\n\t\tAND emp_no <> 9999\n\t\tAND card_no <> 9999"; $results_tot = mysql_query($hchrg_tot); $row = mysql_fetch_row($results_tot); // ccm-rle commenting out the House and Storage Charge totals as they are not used by ccm /* $receipt .= " ".substr("House Charge Total: ".$blank.$blank,0,20); $receipt .= substr($blank.number_format(($row[0] * -1),2),-8)."\n"; $schrg_tot = "SELECT ROUND(SUM(total),2) AS gross FROM dlog WHERE tdate > '" .$EOS. "' AND register_no = ".$_SESSION['laneno']." AND trans_subtype = 'MI' AND card_no = 9999"; $results_tot = mysql_query($schrg_tot); $row = mysql_fetch_row($results_tot); $receipt .= " ".substr("Store Charge Total: ".$blank.$blank,0,20); $receipt .= substr($blank.number_format(($row[0] * -1),2),-8)."\n"; */ $receipt .= str_repeat("\n", 5); // apbw/tt 3/16/05 Franking II // ccm-rle adding a place here to count the number of cancelled transactions, no sales & hanging suspended // This adds the number of cancelled transactions for this tender report $cancelledtranQ = "SELECT COUNT(DISTINCT trans_no, emp_no) \r\n from dtransactions \r\n where datetime > '" . $EOS . "'\r\n and register_no = " . $_SESSION['laneno'] . "\r\n and trans_status = 'X'\r\n AND emp_no <> 9999"; /* $fp=fopen('cancel-log.txt','w'); fwrite($fp,$cancelledtranQ); fclose($fp); */ $cancelledtranR = mysql_query($cancelledtranQ); $row = mysql_fetch_row($cancelledtranR); $receipt .= " " . substr("# of Cancelled Transactions: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0], 2), -8) . "\n"; $receipt .= "\n"; /* ccm-rle This code was used to ensure there were no suspended transactions $suspendedtranQ = "SELECT COUNT(DISTINCT trans_no) from suspendedtoday where datetime > '" .$EOS. "' and register_no = " .$_SESSION['laneno']. " and emp_no <> 9999"; $suspendedtranR = mysql_query($suspendedtranQ); $row = mysql_fetch_row($suspendedtranR); $receipt .= " ".substr("# of Suspended Transactions: ".$blank.$blank,0,20); $receipt .= substr($blank.number_format(($row[0]),2),-8)."\n"; $receipt .= "\n"; */ $tranQ = "SELECT COUNT(DISTINCT trans_no, emp_no) \r\n from dlog\r\n where tdate > '" . $EOS . "'\r\n and register_no = " . $_SESSION['laneno'] . "\r\n and trans_status <> 'X'\r\n AND emp_no <> 9999"; $tranR = mysql_query($tranQ); $row = mysql_fetch_row($tranR); $receipt .= " " . substr("Total Completed Transactions: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0], 2), -8) . "\n"; $receipt .= "\n"; $receipt .= str_repeat("\n", 5); // apbw/tt 3/16/05 Franking II // ccm-rle Next need to write code to look up number of suspended transactions that are left hanging. // ---------------------------------------------------------------------------------------------------- $receipt .= chr(27) . chr(33) . chr(5) . centerString("C H E C K T E N D E R S") . "\n"; $receipt .= centerString("------------------------------------------------------"); $result_ckq = sql_query($query_ckq, $db_a); $num_rows_ckq = sql_num_rows($result_ckq); if ($num_rows_ckq > 0) { $receipt .= $fieldNames; for ($i = 0; $i < $num_rows_ckq; $i++) { $row_ckq = sql_fetch_array($result_ckq); $timeStamp = timeStamp($row_ckq["tdate"]); $receipt .= " " . substr($timeStamp . $blank, 0, 10) . substr($row_ckq["register_no"] . $blank, 0, 7) . substr($row_ckq["trans_no"] . $blank, 0, 6) . substr($row_ckq["emp_no"] . $blank, 0, 6) . substr($blank . number_format($row_ckq["changeGiven"], 2), -10) . substr($blank . number_format($row_ckq["ckTender"], 2), -10) . "\n"; } $receipt .= centerString("------------------------------------------------------"); // $query_ckq = "select * from cktendertotal where register_no = ".$_SESSION["laneno"]; // $result_ckq = sql_query($query_ckq, $db_a); // $row_ckq = sql_fetch_array($result_ckq); $query_ckq = "select SUM(ckTender) from cktenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"]; $result_ckq = sql_query($query_ckq, $db_a); $row_ckq = sql_fetch_array($result_ckq); $receipt .= substr($blank . $blank . $blank . $blank . "Total: " . number_format($row_ckq[0], 2), -56) . "\n"; } else { $receipt .= "\n\n" . centerString(" * * * N O N E * * * ") . "\n\n" . centerString("------------------------------------------------------"); } $receipt .= str_repeat("\n", 3); // apbw/tt 3/16/05 Franking II //ccm-rle commented out debit card tenders because for ccm they are combined with credit card tenders $receipt .= chr(27) . chr(33) . chr(5) . centerString("D E B I T C A R D T E N D E R S") . "\n"; $receipt .= centerString("------------------------------------------------------"); $result_dcq = sql_query($query_dcq, $db_a); $num_rows_dcq = sql_num_rows($result_dcq); if ($num_rows_dcq > 0) { $receipt .= $fieldNames; for ($i = 0; $i < $num_rows_dcq; $i++) { $row_dcq = sql_fetch_array($result_dcq); $timeStamp = timeStamp($row_dcq["tdate"]); $receipt .= " " . substr($timeStamp . $blank, 0, 10) . substr($row_dcq["register_no"] . $blank, 0, 7) . substr($row_dcq["trans_no"] . $blank, 0, 6) . substr($row_dcq["emp_no"] . $blank, 0, 6) . substr($blank . number_format($row_dcq["changeGiven"], 2), -10) . substr($blank . number_format($row_dcq["dcTender"], 2), -10) . "\n"; } $receipt .= centerString("------------------------------------------------------"); // $query_dcq = "select * from dctendertotal where emp_no = ".$_SESSION["CashierNo"]; // $result_dcq = sql_query($query_dcq, $db_a); // $row_dcq = sql_fetch_array($result_dcq); $query_dcq = "select SUM(dcTender) from dctenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"]; $result_dcq = sql_query($query_dcq, $db_a); $row_dcq = sql_fetch_array($result_dcq); $receipt .= substr($blank . $blank . $blank . $blank . "Total: " . number_format($row_dcq[0], 2), -56) . "\n"; } else { $receipt .= "\n\n" . centerString(" * * * N O N E * * * ") . "\n\n" . centerString("------------------------------------------------------"); } $receipt .= str_repeat("\n", 3); // apbw/tt 3/16/05 Franking II $receipt .= chr(27) . chr(33) . chr(5) . centerString("C R E D I T C A R D T E N D E R S") . "\n"; $receipt .= centerString("------------------------------------------------------"); $result_ccq = sql_query($query_ccq, $db_a); $num_rows_ccq = sql_num_rows($result_ccq); if ($num_rows_ccq > 0) { $receipt .= $fieldNames; for ($i = 0; $i < $num_rows_ccq; $i++) { $row_ccq = sql_fetch_array($result_ccq); $timeStamp = timeStamp($row_ccq["tdate"]); $receipt .= " " . substr($timeStamp . $blank, 0, 10) . substr($row_ccq["register_no"] . $blank, 0, 7) . substr($row_ccq["trans_no"] . $blank, 0, 6) . substr($row_ccq["emp_no"] . $blank, 0, 6) . substr($blank . number_format($row_ccq["changeGiven"], 2), -10) . substr($blank . number_format($row_ccq["ccTender"], 2), -10) . "\n"; } $receipt .= centerString("------------------------------------------------------"); // $query_ccq = "select * from cctendertotal where register_no = ".$_SESSION["laneno"]; // $result_ccq = sql_query($query_ccq, $db_a); // $row_ccq = sql_fetch_array($result_ccq); $query_ccq = "select SUM(ccTender) from cctenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"]; $result_ccq = sql_query($query_ccq, $db_a); $row_ccq = sql_fetch_array($result_ccq); $receipt .= substr($blank . $blank . $blank . $blank . "Total: " . number_format($row_ccq[0], 2), -56) . "\n"; } else { $receipt .= "\n\n" . centerString(" * * * N O N E * * * ") . "\n\n" . centerString("------------------------------------------------------"); } $receipt .= str_repeat("\n", 3); // apbw/tt 3/16/05 Franking II //test $receipt .= chr(27) . chr(33) . chr(5) . centerString("E B T T E N D E R S") . "\n"; $receipt .= centerString("------------------------------------------------------"); $result_fsq = sql_query($query_fsq, $db_a); $num_rows_fsq = sql_num_rows($result_fsq); if ($num_rows_fsq > 0) { $receipt .= $fieldNames; for ($i = 0; $i < $num_rows_fsq; $i++) { $row_fsq = sql_fetch_array($result_fsq); $timeStamp = timeStamp($row_fsq["tdate"]); $receipt .= " " . substr($timeStamp . $blank, 0, 10) . substr($row_fsq["register_no"] . $blank, 0, 7) . substr($row_fsq["trans_no"] . $blank, 0, 6) . substr($row_fsq["emp_no"] . $blank, 0, 6) . substr($blank . number_format($row_fsq["changeGiven"], 2), -10) . substr($blank . number_format($row_fsq["FsTender"], 2), -10) . "\n"; } $receipt .= centerString("------------------------------------------------------"); // $query_fsq = "select * from fstendertotal where emp_no = ".$_SESSION["CashierNo"]; // $result_fsq = sql_query($query_fsq, $db_a); // $row_fsq = sql_fetch_array($result_fsq); $query_fsq = "select SUM(fsTender) from fstenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"]; $result_fsq = sql_query($query_fsq, $db_a); $row_fsq = sql_fetch_array($result_fsq); $receipt .= substr($blank . $blank . $blank . $blank . "Total: " . number_format($row_fsq[0], 2), -56) . "\n"; } else { $receipt .= "\n\n" . centerString(" * * * N O N E * * * ") . "\n\n" . centerString("------------------------------------------------------"); } $receipt .= str_repeat("\n", 3); // apbw/tt 3/16/05 Franking II //ccm-rle commented out house store charges because ccm doesn't currently use them /* $receipt .= centerString("H O U S E / S T O R E C H A R G E T E N D E R S")."\n"; $receipt .= centerString("------------------------------------------------------"); $result_miq = sql_query($query_miq, $db_a); $num_rows_miq = sql_num_rows($result_miq); if ($num_rows_miq > 0) { $chgFieldNames = " ".substr("Time".$blank, 0, 10) .substr("Lane".$blank, 0, 7) .substr("Trans #".$blank, 0, 6) .substr("Emp #".$blank, 0, 8) .substr("Member #".$blank, 0, 10) .substr("Amount".$blank, 0, 10)."\n"; $receipt .= $chgFieldNames; for ($i = 0; $i < $num_rows_miq; $i++) { $row_miq = sql_fetch_array($result_miq); $timeStamp = timeStamp($row_miq["tdate"]); $receipt .= " ".substr($timeStamp.$blank, 0, 10) .substr($row_miq["register_no"].$blank, 0, 7) .substr($row_miq["trans_no"].$blank, 0, 6) .substr($row_miq["emp_no"].$blank, 0, 6) .substr($row_miq["card_no"].$blank, 0, 6) .substr($blank.number_format($row_miq["MiTender"], 2), -10)."\n"; } $receipt.= centerString("------------------------------------------------------"); // $query_miq = "select * from mitendertotal where register_no = ".$_SESSION["laneno"]; // $result_miq = sql_query($query_miq, $db_a); // $row_miq = sql_fetch_array($result_miq); $query_miq = "select SUM(miTender) from mitenders where tdate > '".$EOS."' and register_no = ".$_SESSION["laneno"]; $result_miq = sql_query($query_miq, $db_a); $row_miq = sql_fetch_array($result_miq); $receipt .= substr($blank.$blank.$blank.$blank."Total: ".number_format($row_miq[0],2), -56)."\n"; } else { $receipt .= "\n\n".centerString(" * * * N O N E * * * ")."\n\n" .centerString("------------------------------------------------------"); } $receipt .= str_repeat("\n", 3); // apbw/tt 3/16/05 Franking II */ //-------------------------------------------------------------------- //ccm-rle commented out TRI MET passes because CCM doesn't use them /* $receipt .= chr(27).chr(33).chr(5).centerString("T R I - M E T P A S S E S S O L D")."\n"; $receipt .= centerString("------------------------------------------------------"); $result_bp = sql_query($query_bp, $db_a); $num_rows_bp = sql_num_rows($result_bp); if ($num_rows_bp > 0) { $receipt .= $fieldNames; for ($i = 0; $i < $num_rows_bp; $i++) { $row_bp = sql_fetch_array($result_bp); $timeStamp = timeStamp($row_bp["tdate"]); $receipt .= " ".substr($timeStamp.$blank, 0, 10) .substr($row_bp["register_no"].$blank, 0, 7) .substr($row_bp["trans_no"].$blank, 0, 6) .substr($row_bp["emp_no"].$blank, 0, 6) .substr($blank.($row_bp["upc"]), -10) .substr($blank.number_format($row_bp["total"], 2), -10)."\n"; } $receipt.= centerString("------------------------------------------------------"); } else { $receipt .= "\n\n".centerString(" * * * N O N E * * * ")."\n\n" .centerString("------------------------------------------------------"); } */ $receipt .= str_repeat("\n", 8); // apbw/tt 3/16/05 Franking II // ccm-rle - this creates a txt log on the IS4C computer of every tender report for logging purposes $tender_date = date('Y-m-d-H-i-s'); $tender_log_file = "/pos/logs/tenderlog_" . $tender_date . "_" . $_SESSION["laneno"] . ".txt"; $fp = fopen($tender_log_file, 'w'); fwrite($fp, $receipt . chr(27) . chr(105)); fclose($fp); writeLine($receipt . chr(27) . chr(105)); // apbw/tt 3/16/05 Franking II sql_close($db_a); $_SESSION["msgrepeat"] = 1; $_SESSION["strRemembered"] = "ES"; gohome(); }
foreach ($feature['replace'] as $replace) { $caption = str_replace(array_keys($replace), array_values($replace), $feature['caption']); if (isset($feature['symbol']) && $feature['symbol'] != null) { $payload = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">' . str_replace(array_keys($replace), array_values($replace), $feature['symbol']) . '</svg>'; } else { $payload = '<img src="../styles/' . str_replace(array_keys($replace), array_values($replace), $feature['icon']) . '" />'; } $output .= writeLine($payload, $caption); } } else { if (isset($feature['symbol']) && $feature['symbol'] != null) { $payload = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">' . $feature['symbol'] . '</svg>'; } else { $payload = '<img src="../styles/' . $feature['icon'] . '" />'; } $output .= writeLine($payload, $feature['caption']); } } } // if no features are rendered in this zoom level, show message if ($output == "") { $output = '<p>' . _('Nothing to see in this zoom level. Please zoom in.') . "</p>\n"; } else { $output = "\t\t<table>\n" . $output . "\t\t</table>\n"; } } else { $output = '<p>' . _('Legend not available for this style.') . "</p>\n"; } echo $output; ?> </body>
* * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. ******************************************************************************/ include_once 'utils.php'; include_once 'ringside/social/dsl/TagRegistry.php'; /** * Drop the SCHEMA from the database server. * * @author Richard Friedman */ writeDatabaseInformation(); writeLine("<b>Is your schema ready to be dropped!</b>"); dropSchema(); Social_Dsl_TagRegistry::removeCacheFile(); writeLine(); writeLine("<u>Other options</u>"); writeLink("index.php", "Start setup process."); writeLink("drop.php", "Drop Schema, Start Again");
function wikiToHtml(&$session, $wiki_text) { $lines = explode("\n", $wiki_text); $session->trace(TC_Util1, 'wikiToHtml: ' . (0 + count($lines)) . ' Zeilen' . "({$lines['0']})"); $status = new LayoutStatus($session); $last_linetype = ''; foreach ($lines as $ii => $line) { $start_code = false; if (!$status->fPreformatted && ($line_trimmed = trim($line)) == '') { $last_linetype = ''; $status->changeOfLineType($last_linetype, ''); } else { $linetype = $status->fPreformatted ? '[' : substr($line, 0, 1); switch ($linetype) { case '-': $count = countRepeats($line, '-'); if ($count < 4) { $linetype = 'x'; } break; case '[': if (strpos($line, 'code]') == 1) { $start_code = true; } elseif (strpos($line, '/code]') == 1) { $status->finishCode(); $last_linetype = 'x'; $line = $line_trimmed = substr($line, 7); $session->trace(TC_Util2, 'wikiToHtml: /code-Restzeile: ' . $line); } else { $linetype = 'x'; } break; case '!': case ';': case '*': case '#': case '|': break; default: $linetype = 'x'; break; } $last_linetype = $status->testChangeOfLineType($last_linetype, $linetype); switch ($linetype) { case '!': if (strpos($line, '|') != 1) { writeHeader($line, $status); } else { writeTableHeader($line, $status); $last_linetype = '|'; } break; case '[': if ($start_code) { $status->startCode(); } $line = substr($line_trimmed, 6); if (!empty($line)) { writeLine($line, $status); } break; case ';': writeIndent($line, $status); break; case '*': writeUList($line, $status); break; case '#': writeOrderedList($line, $status); break; case '|': writeTable($line, $status); break; case '-': guiLine($status->fSession, $count - 3); break; default: writeLine($line, $status); break; } } } // foreach if ($status->fPreformatted) { $session->trace(TC_Warning, PREFIX_Warning . '[/code] fehlt'); } $session->trace(TC_Util1, 'wikiToHtml-Ende'); }
function generateXMLarticle($article_number, $p) { global $sp_detail; global $products_stock, $hide_extreme_flag, $hide_hard_flag, $hide_nostock_flag; $actual_stock = $products_stock[$p['products_id'] . '-' . $p['articles_id']]; $stock_info = actualStockReport($sp_detail, $p['reported_stock'], $actual_stock, $p['delivery_days'], $p['is_bestselling'], $p['complexity'], $hide_extreme_flag, $hide_hard_flag, $hide_nostock_flag); $reported_stock = $p['active_status'] == '0' && $stock_info['stock_isreal'] == '0' ? '0' : $stock_info['stock']; //TODO: Remove 4 lines below to reactive bestselling in NM.DE // It is currently deactivate to wait final confirmation // on future partnership with NM.DE (sahat - 20.07.2012) //if($p['is_bestselling']=='1') { $reported_stock = '0'; $stock_info['delivery_time'] = '14'; //} //------------------------------------------------------------ $result = ''; //XML ARTICLES $result .= writeXMLopen('ARTICLEDATA', 1); $result .= writeLine(); //XML ARTICLE DETAIL $article_number_used = $article_number; if ($p['length'] != '' && $p['length'] != '0') { $plength = textLength($p['length'], false); $plength = intval($plength); if ($plength != 0) { $article_number_used .= '_' . $plength; } } if ($p['text'] != '' && $p['text_code'] != '') { $article_number_used .= '_' . $p['text_code']; } $result .= writeXMLline('A_SUP_ARTNO', $article_number_used, 2); $result .= writeXMLline('A_EAN', $p['products_ean'], 2); $valid_date = date('Y-m-d', strtotime($p['date_added'])); $result .= writeXMLline('A_VALID_DATE', $valid_date, 2); $result .= writeLine(); //XML ARTICLE STOCK //below additional stock is to handle neckermann error about hiding resourcable products when stock is 0 //if($p['reported_stock']>0) $p['reported_stock'] += 49; //thile line above should be deleted once this error is fixed $result .= writeXMLline('A_STOCK', $reported_stock, 2); $result .= writeLine(); //XML ARTICLE PRICING $result .= writeXMLopen('A_PRICE', 2); $result .= writeXMLline('PRICE_VK', $p['price'], 3); if ($p['price_old'] > 0 && $p['price_old'] > $p['price']) { $result .= writeXMLline('PRICE_VK_OLD', $p['price_old'], 3); } //$result .= writeXMLline('PRICE_TAX', '2', 3); $result .= writeXMLline('PRICE_PROVISION_TYPE', $sp_detail['provision'], 3); $result .= writeXMLclose('A_PRICE', 2); $result .= writeLine(); //XML DELIVERY //$delivery_time = ($p['delivery_days']==0) ? $sp_detail['delivery_time'] : $p['delivery_days']; $delivery_time = $stock_info['delivery_time']; if ($reported_stock == 0 || $p['reported_stock'] == 0) { $replacement = 'N'; $delivery_replacement_time = ''; } else { $replacement = 'J'; $delivery_replacement_time = $delivery_time + 2; } $result .= writeXMLopen('A_DELIVERY', 2); $result .= writeXMLline('DELIVERY_TIME', $delivery_time, 3); $result .= writeXMLline('DELIVERY_REPLACEMENT', $replacement, 3); $result .= writeXMLline('DELIVERY_REPLACEMENT_TIME', $delivery_replacement_time, 3); $result .= writeXMLclose('A_DELIVERY', 2); $result .= writeLine(); $result .= writeXMLclose('ARTICLEDATA', 1); $result .= writeLine(); return $result; }
define('GROUP_LENGTH', 30); define('OS_LENGTH', 20); define('VV_VERSION_LENGTH', 30); define('COUNTRY_LENGTH', 30); define('ARCHITECTURE_LENGTH', 10); define('ADRESSING_LENGTH', 10); define('COMPILATION_DATE_LENGTH', 30); function ensureString($var, $length) { $var = str_replace("\n", '', $var); $var = str_replace(TOKEN_CSV, '', $var); return substr($var, 0, $length); } function writeLine($file, $data) { fwrite($file, implode(TOKEN_CSV, $data) . ENTRY_SEPARATOR); } $data['name'] = ensureString($_GET['name'], NAME_LENGTH); $data['lastname'] = ensureString($_GET['lastName'], NAME_LENGTH); $data['email'] = ensureString($_GET['email'], EMAIL_LENGTH); $data['group'] = ensureString($_GET['group'], GROUP_LENGTH); $data['ip'] = $_SERVER['REMOTE_ADDR']; $data['os'] = ensureString($_GET['os'], OS_LENGTH); $data['vvVersion'] = ensureString($_GET['vvVersion'], VV_VERSION_LENGTH); $data['time'] = date("F j, Y, g:i a"); $data['geoloc'] = ensureString(file_get_contents('http://api.hostip.info/country.php?ip=' . $_SERVER['REMOTE_ADDR']), COUNTRY_LENGTH); $data['architecture'] = ensureString($_GET['architecture'], ARCHITECTURE_LENGTH); $data['adressing'] = ensureString($_GET['adressing'], ADRESSING_LENGTH); $data['compilationDate'] = ensureString($_GET['compilationDate'], COMPILATION_DATE_LENGTH); writeLine($file, $data); fclose();
$content .= '<h3 class="notice">' . $jng_sp_name . ': There is no new order to confirm</h3>'; } else { switch ($jng_sp_id) { ///////////////////// // Neckermann DE // ///////////////////// case '1': $export_date = time(); $total_orders = count($orders); $xml_filename = 'ORDRSP_' . date('Ymd_His', $export_date) . '.xml'; $xml_filename_encrypted = $xml_filename . '.gpg'; //XML STARTER $xml_content = '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n"; //$xml_content .= '<NECKERMANN_BDATA totalcount="'.$total_orders.'" xmlns="http://www.neckermann.de/Grossist/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neckermann.de/Grossist/XMLSchema http://www.neckermann.de/Grossist/XMLSchema/neckbdat_1_0_0.xsd">'; $xml_content .= '<NECKERMANN_BDATA totalcount="' . $total_orders . '" xmlns="http://www.neckermann.de/Grossist/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neckermann.de/Grossist/XMLSchema http://www.neckermann.de/Grossist/XMLSchema/neckbdat_3_0_1.xsd">'; $xml_content .= writeLine(); //XML PER ORDER $orders_confirmed = array(); foreach ($orders as $counter => $o) { $orders_confirmed[] = $o['jng_sp_orders_id']; //BDATA $xml_content .= writeXMLopen('BDATA', 1, 'counter="' . ($counter + 1) . '"'); //HEADER $xml_content .= writeXMLopen('HEADER', 2); //Tech Data $xml_content .= writeXMLopen('TECH_DATA', 3); $xml_content .= writeXMLline('KQ_CLIENT_ID', '001', 4); $xml_content .= writeXMLline('MSG_TYPE', 'ORDRSP_AUF', 4); $xml_content .= writeXMLline('CREATION_TIME', neckermannDateFormat(), 4); $xml_content .= writeXMLline('ILN_SUPPLIER', $o['iln_jng'], 4); $xml_content .= writeXMLline('ILN_AGENT', $o['iln_sp'], 4);
writeLine("Refunding order id " . $orderId); $refundOptions = new \JDI\TntAffiliate\Models\RefundOptions(); $refundOptions->type = 'sale'; $refundOptions->fullRefund = true; $refundOptions->reclaim = \JDI\TntAffiliate\Models\RefundOptions::RECLAIM_BOTH; $refundOptions->reason = 'fraudulent'; $refundOptions->amount = 5; $refunded = $api->refund($orderId, $refundOptions); if ($refunded) { writeLine("{$tick} Refunded order id " . $orderId); } else { writeLine("{$cross} Unable to refund order id " . $orderId); } writeLine(); /** * Get Pending Pixels */ writeLine("Looking for any pending pixels"); $pixels = $api->getPendingPixels($visitorId); if (empty($pixels)) { writeLine("No pending pixels located"); } else { writeLine("Found " . count($pixels) . " Pixels"); foreach ($pixels as $pixel) { writeLine($pixel->render()); } } writeLine(); writeLine("Test Complete"); writeLine();
if ($loginResult == LoginResult::NeedEmail) { $authCode = ask('Enter Steam Guard code from email: '); $steam->setEmailCode($authCode); $loginResult = $steam->doLogin(); } else { break; } } } if ($loginResult == LoginResult::LoginOkay) { writeLine('Logged in successfully.'); $tradeOffers = $steam->getTradeOffers(); /* $trade = $tradeOffers->createTrade(12345); $trade->addOtherItem(730, 2, "12345678"); var_dump($trade->send()); */ var_dump($steam->getMarket()->getWalletBalance()); var_dump($steam->getApiKey()); } else { writeLine("Failed to login: {$loginResult}."); } function writeLine($line) { echo $line . PHP_EOL; } function ask($prompt = '') { echo $prompt; return rtrim(fgets(STDIN), "\n"); }
function generateXMLarticle($article_number, $sp_detail, $p, $uselength = false) { global $component_length_id, $component_length_name; global $products_stock, $hide_extreme_flag, $hide_hard_flag, $hide_nostock_flag; $actual_stock = $products_stock[$p['products_id'] . '-' . $p['articles_id']]; $stock_info = actualStockReport($sp_detail, $p['reported_stock'], $actual_stock, $p['delivery_days'], $p['is_bestselling'], $p['complexity'], $hide_extreme_flag, $hide_hard_flag, $hide_nostock_flag); $reported_stock = $p['active_status'] == '0' && $stock_info['stock_isreal'] == '0' ? '0' : $stock_info['stock']; //TODO: Remove 4 lines below to reactive bestselling in NM.DE // It is currently deactivate to wait final confirmation // on future partnership with NM.DE (sahat - 20.07.2012) //if($p['is_bestselling']=='1') { $reported_stock = '0'; $stock_info['delivery_time'] = '14'; //} //------------------------------------------------------------ $result = ''; //XML ARTICLES $result .= writeXMLopen('ARTICLEDATA', 1); $result .= writeLine(); //XML ARTICLE DETAIL $article_number_used = $article_number; if ($p['length'] != '' && $p['length'] != '0') { $article_number_used .= '_' . textLength($p['length'], false); } if ($p['text'] != '' && $p['text_code'] != '') { $article_number_used .= '_' . $p['text_code']; } $billing_text = neckermannBillingText(15, $p['categories_id'], $p['name'], $p['length']); $result .= writeXMLline('A_SUP_ARTNO', $article_number_used, 2); $result .= writeXMLline('A_EAN', $p['products_ean'], 2); $result .= writeXMLline('A_BILLING_TEXT', $billing_text, 2); //XML ARTICLE COMPONENT if ($uselength) { // $length = textLength($p['length'], false); // if($p['categories_id']=='29') $length = ringSizeToDiameter($length); // if($length>0) { //TEMPORARILY USING OLD SIZE ATTRIBUTES UNTIL NM.DE BUG IS FIXED if ($p['length'] > 0) { $length = textLength($p['length']); $component_id = '8571220'; $component_name = 'Größe'; // if(isset($component_length_id[$p['categories_id']])) { // $component_id = $component_length_id[$p['categories_id']]; // $component_name = $component_length_name[$p['categories_id']]; // } else { // $component_id = '970981'; // $component_name = 'Länge (ca. cm)'; // } $result .= writeXMLopen('A_COMPONENT', 2); $result .= writeXMLopen('COMPONENT', 3); $result .= writeXMLline('COMPONENT_ID', $component_id, 4); $result .= writeXMLline('COMPONENT_NAME', $component_name, 4); $result .= writeXMLclose('COMPONENT', 3); $result .= writeXMLline('COMPONENT_VALUE', $length, 3); $result .= writeXMLclose('A_COMPONENT', 2); $result .= writeLine(); } } if ($p['text'] != '' && $p['text_code'] != '') { // $component_id = '4053'; // $component_name = 'Text'; $component_id = '976260'; $component_name = 'Variante'; $result .= writeXMLopen('A_COMPONENT', 2); $result .= writeXMLopen('COMPONENT', 3); $result .= writeXMLline('COMPONENT_ID', $component_id, 4); $result .= writeXMLline('COMPONENT_NAME', $component_name, 4); $result .= writeXMLclose('COMPONENT', 3); $text = $p['text']; $result .= writeXMLline('COMPONENT_VALUE', $text, 3); $result .= writeXMLclose('A_COMPONENT', 2); $result .= writeLine(); } $valid_date = date('Y-m-d', strtotime($p['date_added'])); $result .= writeXMLline('A_SEGMENT', '785', 2); $result .= writeXMLline('A_VALID_DATE', $valid_date, 2); $result .= writeLine(); //XML ARTICLE STOCK $result .= writeXMLline('A_UNIT', 'ST', 2); //below additional stock is to handle neckermann error about hiding resourcable products when stock is 0 //if($p['reported_stock']>0) $p['reported_stock'] += 49; //thile line above should be deleted once this error is fixed $result .= writeXMLline('A_STOCK', $reported_stock, 2); $result .= writeLine(); //XML ARTICLE PRICING $result .= writeXMLopen('A_PRICE', 2); $result .= writeXMLline('PRICE_VK', $p['price'], 3); if ($p['price_old'] > 0 && $p['price_old'] > $p['price']) { $result .= writeXMLline('PRICE_VK_OLD', $p['price_old'], 3); } $result .= writeXMLline('PRICE_TAX', '2', 3); $result .= writeXMLline('PRICE_PROVISION_TYPE', $sp_detail['provision'], 3); $result .= writeXMLclose('A_PRICE', 2); $result .= writeLine(); //XML ARTICLE ORDERING $result .= writeXMLopen('A_ORDER', 2); $result .= writeXMLline('ORDER_QUANTITY_MIN', '1', 3); $result .= writeXMLline('ORDER_QUANTITY_INTERVALL', '1', 3); $result .= writeXMLclose('A_ORDER', 2); $result .= writeLine(); //XML DELIVERY //$delivery_time = ($p['delivery_days']==0) ? $sp_detail['delivery_time'] : $p['delivery_days']; $delivery_time = $stock_info['delivery_time']; if ($reported_stock == 0 || $p['reported_stock'] == 0) { $replacement = 'N'; $delivery_replacement_time = ''; } else { $replacement = 'J'; $delivery_replacement_time = $delivery_time + 2; } $result .= writeXMLopen('A_DELIVERY', 2); $result .= writeXMLline('DELIVERY_TIME', $delivery_time, 3); $result .= writeXMLline('DELIVERY_REPLACEMENT', $replacement, 3); $result .= writeXMLline('DELIVERY_REPLACEMENT_TIME', $delivery_replacement_time, 3); $result .= writeXMLline('DELIVERY_PARCEL_TYPE', 'PAK', 3); $result .= writeXMLline('DELIVERY_CARRIER', '1', 3); $result .= writeXMLclose('A_DELIVERY', 2); $result .= writeLine(); $result .= writeXMLclose('ARTICLEDATA', 1); $result .= writeLine(); return $result; }
function printReceipt($arg1) { $receipt = ""; setDrawerKick(); if ($arg1 == "full" and $_SESSION["kick"] != 0) { // ---- apbw 03/29/05 Drawer Kick Patch writeLine(chr(27) . chr(112) . chr(0) . chr(48) . "0"); } /* -------------------------------------------------------------- turn off staff charge receipt printing if toggled - apbw 2/1/05 ---------------------------------------------------------------- */ if ($_SESSION["TenderType"] == "MI" and ($_SESSION["receiptToggle"] == 0 or $_SESSION["SCReceipt"] == 0)) { $_SESSION["noreceipt"] = 1; } // apbw 2/15/05 SCR $dateTimeStamp = time(); // moved by apbw 2/15/05 SCR // -- Our Reference number for the transaction. $ref = trim($_SESSION["CashierNo"]) . "-" . trim($_SESSION["laneno"]) . "-" . trim($_SESSION["transno"]); $_SESSION["noreceipt"] = ($_SESSION["receiptToggle"] + 1) % 2; if ($_SESSION["noreceipt"] != 1) { $receipt = printReceiptHeader($dateTimeStamp, $ref); // call to transLog, the body of the receipt comes from the view 'receipt' $query = "SELECT * from receipt"; $db = tDataConnect(); $result = sql_query($query, $db); $num_rows = sql_num_rows($result); // loop through the results to generate the items listing. for ($i = 0; $i < $num_rows; $i++) { $row = sql_fetch_array($result); $receipt .= $row[0] . "\n"; } // The Nitty Gritty: if ($arg1 == "full") { $member = "Member " . trim($_SESSION["memberID"]); $your_discount = $_SESSION["transDiscount"] + $_SESSION["memCouponTTL"]; if ($_SESSION["transDiscount"] + $_SESSION["memCouponTTL"] + $_SESSION["specials"] > 0) { $receipt .= "\n" . centerString("------------------ YOUR SAVINGS -------------------") . "\n"; if ($your_discount > 0) { $receipt .= " DISCOUNTS: \$" . number_format($your_discount, 2) . "\n"; } if ($_SESSION["specials"] > 0) { $receipt .= " SPECIALS: \$" . number_format($_SESSION["specials"], 2) . "\n"; } $receipt .= centerString("---------------------------------------------------") . "\n"; } $receipt .= "\n"; // ccm-rle - will need to modify this to equal whatever we choose for non-member I changed the code because we aren't currently using memberships if (trim($_SESSION["memberID"]) != 2) { // mem# 99999 = NON-MEMBER // $receipt .= centerString("Thank You - ".$member)."\n"; $receipt .= centerString("Thank You!") . "\n"; } else { $receipt .= centerString("Thank You!") . "\n"; } if ($_SESSION["yousaved"] > 0) { $receipt .= centerString("You Saved \$" . number_format($_SESSION["yousaved"], 2)) . "\n"; } if ($_SESSION["couldhavesaved"] > 0 && $_SESSION["yousaved"] > 0) { $receipt .= centerString("You could have saved an additional \$" . number_format($_SESSION["couldhavesaved"], 2)) . "\n"; } elseif ($_SESSION["couldhavesaved"] > 0) { $receipt .= centerString("You could have saved \$" . number_format($_SESSION["couldhavesaved"], 2)) . "\n"; } $receipt .= centerString($_SESSION["receiptFooter1"]) . "\n" . centerString($_SESSION["receiptFooter2"]) . "\n" . centerString($_SESSION["receiptFooter3"]) . "\n" . centerString($_SESSION["receiptFooter4"]) . "\n"; // --- apbw 2/15/05 SCR --- if ($_SESSION["chargetender"] == 1) { $receipt = $receipt . printChargeFooterCust($dateTimeStamp, $ref); } if ($_SESSION["ccTender"] == 1) { $receipt = $receipt . printCCFooter($dateTimeStamp, $ref); } if ($_SESSION["promoMsg"] == 1) { promoMsg(); } $_SESSION["headerprinted"] = 0; } else { $dashes = "\n" . centerString("----------------------------------------------") . "\n"; if ($arg1 == "partial") { $receipt .= $dashes . centerString("* P A R T I A L T R A N S A C T I O N *") . $dashes; } elseif ($arg1 == "cancelled") { $receipt .= $dashes . centerString("* T R A N S A C T I O N C A N C E L L E D *") . $dashes; } elseif ($arg1 == "resume") { $receipt .= $dashes . centerString("* T R A N S A C T I O N R E S U M E D *") . $dashes . centerString("A complete receipt will be printed\n") . centerString("at the end of the transaction"); } elseif ($arg1 == "suspended") { $receipt .= $dashes . centerString("* T R A N S A C T I O N S U S P E N D E D *") . $dashes . $option . centerString($ref); } } } /* -------------------------------------------------------------- print store copy of charge slip regardless of receipt print setting - apbw 2/14/05 ---------------------------------------------------------------- */ if ($_SESSION["chargetender"] == 1) { if ($_SESSION["noreceipt"] == 1) { $receipt = printChargeFooterStore($dateTimeStamp, $ref); } else { $receipt = $receipt . printChargeFooterStore($dateTimeStamp, $ref); } } //------------------------------------------------------------------- $receipt = $receipt . "\n\n\n\n\n\n\n"; if ($_SESSION["noreceipt"] == 0) { writeLine($receipt . chr(27) . chr(105)); } $receipt = ""; $_SESSION["noreceipt"] = 1; // apbw 2/15/05 SCR - 9/25/09 ccm-rle commented out and a variable with noreceipt = 0 set at top to see if it turns of receipt printing while still enabling manual receipt printing $_SESSION["kick"] = 1; // apbw 05/03/05 KickFix }
usleep(200000); clearstatcache(); $stat = @stat(CHANNEL_PATH . $channel); if (intval($stat['size']) > $lastsize) { $result = ''; $lines = file(CHANNEL_PATH . $channel); foreach ($lines as $line) { $result .= '<li>' . $line . '</li>'; } echo $result; die; } } break; case 'part': writeLine($channel, '<span><b>' . $nickname . '</b> has left the chatroom ' . $channel . '</span>'); break; default: break; } } /* * Add line to channel history * * */ function writeLine($room, $text) { //$time = gmdate("H:i:s",rcms_get_time()); $time = gmdate("Y-m-d H:i:s", rcms_get_time()); $fp = fopen(CHANNEL_PATH . $room, 'a');
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. ******************************************************************************/ include_once 'utils.php'; /** * Clean all the current data. * * @author Richard Friedman */ writeDatabaseInformation(); writeLine("<b>Cleaning up all the data.</b>"); $database = RingsideApiDbDatabase::getDatabaseConnection(); if ($database === false) { writeLine("No such database is currently available"); RingsideApiDbDatabase::closeConnection($database); } else { $schema = readSqlFile('RingsideDbCleanData.sql'); if ($schema === false) { writeError(' The SQL could not be loade from the application '); exit; } $result = RingsideApiDbDatabase::queryMultiLine($schema, $database); if ($result === false) { writeError('The database was not cleaned properly, check the error log.'); } else { writeLine("Database " . RingsideApiConfig::$db_name . " cleaned successfully "); } } writeLine(); writeLine("<b>Other options</b>"); writeLink("index.php", "Main Page"); writeLink("clean.php", "Clean Database");
function readSqlFile($file) { $result = false; $result = file_get_contents($file, true); if ($result === false) { $incFile = "ringside" . DIRECTORY_SEPARATOR . "sql" . DIRECTORY_SEPARATOR . $file; error_log("Could not find file, looking in {$incFile}"); $result = file_get_contents($incFile, true); if ($result === false) { writeLine("Could not locate the file ringside/config/{$file} , looking in PEAR"); error_log("Could not find file, looking in PEAR"); $hasPear = (include_once 'PEAR/Config.php'); if ($hasPear !== false) { $pear = new PEAR_Config(); $pearDataDir = $pear->get("data_dir"); if ($pearDataDir !== false) { $pearDataDir .= DIRECTORY_SEPARATOR . "ringside" . DIRECTORY_SEPARATOR . "config"; $result = file_get_contents($pearDataDir . DIRECTORY_SEPARATOR . $file); if ($result === false) { writeLine("Check your pear setting for data_dir : " . $pear->get("data_dir")); writeLine("From the command line 'pear config-set data_dir [data dir used during installation]'"); writeLine("To See your configuration settings 'pear config-show user"); error_log($package . '/' . $file . " not read into memory from include_path or " . $pearDataDir . DIRECTORY_SEPARATOR . $file); } } else { error_log($package . '/' . $file . " not read into memory and pear Data dir is empty"); } } else { error_log($package . '/' . $file . " not read into memory and pear not available "); } } } return $result; }
function tenderReport() { $db_a = mDataConnect(); $blank = " "; $eosQ = "select max(tdate) from dlog where register_no = " . $_SESSION["laneno"] . " and upc = 'ENDOFSHIFT'"; $eosR = mysql_query($eosQ); $num_rows = mysql_num_rows($eosR); if ($num_rows > 0) { $row = mysql_fetch_row($eosR); $EOS = $row[0]; } else { $EOS = '2007-08-01 12:00:00'; // probably could change... } $query_ckq = "select * from cktenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"] . " order by emp_no, tdate"; $query_ccq = "select * from cctenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"] . " order by emp_no, tdate"; $query_dcq = "select * from dctenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"] . " order by emp_no, tdate"; $query_miq = "select * from mitenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"] . " order by emp_no, tdate"; $query_bp = "select * from buspasstotals where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"] . " order by emp_no, tdate"; $fieldNames = " " . substr("Time" . $blank, 0, 10) . substr("Lane" . $blank, 0, 7) . substr("Trans #" . $blank, 0, 6) . substr("Emp #" . $blank, 0, 8) . substr("Change" . $blank, 0, 10) . substr("Amount" . $blank, 0, 10) . "\n"; $ref = centerString(trim($_SESSION["CashierNo"]) . "-" . trim($_SESSION['laneno']) . " " . trim($_SESSION["cashier"]) . " " . build_time(time())) . "\n"; $receipt .= chr(27) . chr(33) . chr(5) . centerString("T E N D E R R E P O R T") . "\n"; $receipt .= $ref; $receipt .= centerString("------------------------------------------------------"); $receipt .= str_repeat("\n", 2); $netQ = "SELECT SUM(total) AS net\r\n from dlog\r\n where tdate > '" . $EOS . "'\r\n and register_no = " . $_SESSION['laneno'] . "\r\n and trans_type IN('I','D')\r\n and trans_subtype <> 'IC'\r\n AND emp_no <> 9999"; $netR = mysql_query($netQ); $row = mysql_fetch_row($netR); $receipt .= " " . substr("NET Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0], 2), -8) . "\n"; $receipt .= "\n"; $tendertotalsQ = "SELECT t.TenderName as tender_type,ROUND(-sum(d.total),2) as total,COUNT(*) as count\r\n FROM dlog d RIGHT JOIN is4c_op.tenders t\r\n ON d.trans_subtype = t.TenderCode\r\n AND tdate > '" . $EOS . "'\r\n AND register_no = " . $_SESSION['laneno'] . " \r\n AND d.emp_no <> 9999\r\n GROUP BY t.TenderName"; $results_ttq = mysql_query($tendertotalsQ); while ($row = mysql_fetch_row($results_ttq)) { if (!isset($row[0])) { $receipt .= "NULL"; } else { $receipt .= " " . substr($row[0] . $blank . $blank, 0, 20); } if (!isset($row[1])) { $receipt .= " 0.00"; } else { $receipt .= substr($blank . number_format($row[1], 2), -8); } if (!isset($row[2])) { $receipt .= "NULL"; } else { if (!isset($row[1])) { $row[2] = 0; } $receipt .= substr($blank . $row[2], -4, 4); } $receipt .= "\n"; } $receipt .= "\n"; $cack_tot = "SELECT ROUND(SUM(total),2) AS gross\r\n FROM dlog\r\n WHERE tdate > '" . $EOS . "'\r\n AND register_no = " . $_SESSION['laneno'] . "\r\n AND trans_subtype IN ('CA','CK')"; $results_tot = mysql_query($cack_tot); $row = mysql_fetch_row($results_tot); $receipt .= " " . substr("CA & CK Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0] * -1, 2), -8) . "\n"; $card_tot = "SELECT ROUND(SUM(total),2) AS gross\r\n FROM dlog\r\n WHERE tdate > '" . $EOS . "'\r\n AND register_no = " . $_SESSION['laneno'] . "\r\n AND trans_subtype IN ('DC','CC','FS','EC')"; $results_tot = mysql_query($card_tot); $row = mysql_fetch_row($results_tot); $receipt .= " " . substr("DC / CC / EBT Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0] * -1, 2), -8) . "\n"; $hchrg_tot = "SELECT ROUND(SUM(total),2) AS gross\r\n FROM dlog\r\n WHERE tdate > '" . $EOS . "'\r\n AND register_no = " . $_SESSION['laneno'] . "\r\n AND trans_subtype = 'MI'\r\n AND card_no <> 9999"; $results_tot = mysql_query($hchrg_tot); $row = mysql_fetch_row($results_tot); $receipt .= " " . substr("House Charge Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0] * -1, 2), -8) . "\n"; $schrg_tot = "SELECT ROUND(SUM(total),2) AS gross\r\n FROM dlog\r\n WHERE tdate > '" . $EOS . "'\r\n AND register_no = " . $_SESSION['laneno'] . "\r\n AND trans_subtype = 'MI'\r\n AND card_no = 9999"; $results_tot = mysql_query($schrg_tot); $row = mysql_fetch_row($results_tot); $receipt .= " " . substr("Store Charge Total: " . $blank . $blank, 0, 20); $receipt .= substr($blank . number_format($row[0] * -1, 2), -8); $receipt .= str_repeat("\n", 5); // apbw/tt 3/16/05 Franking II $receipt .= chr(27) . chr(33) . chr(5) . centerString("C H E C K T E N D E R S") . "\n"; $receipt .= centerString("------------------------------------------------------"); $result_ckq = sql_query($query_ckq, $db_a); $num_rows_ckq = sql_num_rows($result_ckq); if ($num_rows_ckq > 0) { $receipt .= $fieldNames; for ($i = 0; $i < $num_rows_ckq; $i++) { $row_ckq = sql_fetch_array($result_ckq); $timeStamp = timeStamp($row_ckq["tdate"]); $receipt .= " " . substr($timeStamp . $blank, 0, 10) . substr($row_ckq["register_no"] . $blank, 0, 7) . substr($row_ckq["trans_no"] . $blank, 0, 6) . substr($row_ckq["emp_no"] . $blank, 0, 6) . substr($blank . number_format($row_ckq["changeGiven"], 2), -10) . substr($blank . number_format($row_ckq["ckTender"], 2), -10) . "\n"; } $receipt .= centerString("------------------------------------------------------"); $query_ckq = "select SUM(ckTender) from cktenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"]; $result_ckq = sql_query($query_ckq, $db_a); $row_ckq = sql_fetch_array($result_ckq); $receipt .= substr($blank . $blank . $blank . $blank . "Total: " . number_format($row_ckq[0], 2), -56) . "\n"; } else { $receipt .= "\n\n" . centerString(" * * * N O N E * * * ") . "\n\n" . centerString("------------------------------------------------------"); } $receipt .= str_repeat("\n", 3); // apbw/tt 3/16/05 Franking II $receipt .= chr(27) . chr(33) . chr(5) . centerString("D E B I T C A R D T E N D E R S") . "\n"; $receipt .= centerString("------------------------------------------------------"); $result_dcq = sql_query($query_dcq, $db_a); $num_rows_dcq = sql_num_rows($result_dcq); if ($num_rows_dcq > 0) { $receipt .= $fieldNames; for ($i = 0; $i < $num_rows_dcq; $i++) { $row_dcq = sql_fetch_array($result_dcq); $timeStamp = timeStamp($row_dcq["tdate"]); $receipt .= " " . substr($timeStamp . $blank, 0, 10) . substr($row_dcq["register_no"] . $blank, 0, 7) . substr($row_dcq["trans_no"] . $blank, 0, 6) . substr($row_dcq["emp_no"] . $blank, 0, 6) . substr($blank . number_format($row_dcq["changeGiven"], 2), -10) . substr($blank . number_format($row_dcq["dcTender"], 2), -10) . "\n"; } $receipt .= centerString("------------------------------------------------------"); $query_dcq = "select SUM(dcTender) from dctenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"]; $result_dcq = sql_query($query_dcq, $db_a); $row_dcq = sql_fetch_array($result_dcq); $receipt .= substr($blank . $blank . $blank . $blank . "Total: " . number_format($row_dcq[0], 2), -56) . "\n"; } else { $receipt .= "\n\n" . centerString(" * * * N O N E * * * ") . "\n\n" . centerString("------------------------------------------------------"); } $receipt .= str_repeat("\n", 3); // apbw/tt 3/16/05 Franking II $receipt .= chr(27) . chr(33) . chr(5) . centerString("C R E D I T C A R D T E N D E R S") . "\n"; $receipt .= centerString("------------------------------------------------------"); $result_ccq = sql_query($query_ccq, $db_a); $num_rows_ccq = sql_num_rows($result_ccq); if ($num_rows_ccq > 0) { $receipt .= $fieldNames; for ($i = 0; $i < $num_rows_ccq; $i++) { $row_ccq = sql_fetch_array($result_ccq); $timeStamp = timeStamp($row_ccq["tdate"]); $receipt .= " " . substr($timeStamp . $blank, 0, 10) . substr($row_ccq["register_no"] . $blank, 0, 7) . substr($row_ccq["trans_no"] . $blank, 0, 6) . substr($row_ccq["emp_no"] . $blank, 0, 6) . substr($blank . number_format($row_ccq["changeGiven"], 2), -10) . substr($blank . number_format($row_ccq["ccTender"], 2), -10) . "\n"; } $receipt .= centerString("------------------------------------------------------"); $query_ccq = "select SUM(ccTender) from cctenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"]; $result_ccq = sql_query($query_ccq, $db_a); $row_ccq = sql_fetch_array($result_ccq); $receipt .= substr($blank . $blank . $blank . $blank . "Total: " . number_format($row_ccq[0], 2), -56) . "\n"; } else { $receipt .= "\n\n" . centerString(" * * * N O N E * * * ") . "\n\n" . centerString("------------------------------------------------------"); } $receipt .= str_repeat("\n", 3); // apbw/tt 3/16/05 Franking II $receipt .= centerString("H O U S E / S T O R E C H A R G E T E N D E R S") . "\n"; $receipt .= centerString("------------------------------------------------------"); $result_miq = sql_query($query_miq, $db_a); $num_rows_miq = sql_num_rows($result_miq); if ($num_rows_miq > 0) { $chgFieldNames = " " . substr("Time" . $blank, 0, 10) . substr("Lane" . $blank, 0, 7) . substr("Trans #" . $blank, 0, 6) . substr("Emp #" . $blank, 0, 8) . substr("Member #" . $blank, 0, 10) . substr("Amount" . $blank, 0, 10) . "\n"; $receipt .= $chgFieldNames; for ($i = 0; $i < $num_rows_miq; $i++) { $row_miq = sql_fetch_array($result_miq); $timeStamp = timeStamp($row_miq["tdate"]); $receipt .= " " . substr($timeStamp . $blank, 0, 10) . substr($row_miq["register_no"] . $blank, 0, 7) . substr($row_miq["trans_no"] . $blank, 0, 6) . substr($row_miq["emp_no"] . $blank, 0, 6) . substr($row_miq["card_no"] . $blank, 0, 6) . substr($blank . number_format($row_miq["MiTender"], 2), -10) . "\n"; } $receipt .= centerString("------------------------------------------------------"); $query_miq = "select SUM(miTender) from mitenders where tdate > '" . $EOS . "' and register_no = " . $_SESSION["laneno"]; $result_miq = sql_query($query_miq, $db_a); $row_miq = sql_fetch_array($result_miq); $receipt .= substr($blank . $blank . $blank . $blank . "Total: " . number_format($row_miq[0], 2), -56) . "\n"; } else { $receipt .= "\n\n" . centerString(" * * * N O N E * * * ") . "\n\n" . centerString("------------------------------------------------------"); } $receipt .= str_repeat("\n", 3); // apbw/tt 3/16/05 Franking II $receipt .= chr(27) . chr(33) . chr(5) . centerString("T R I - M E T P A S S E S S O L D") . "\n"; $receipt .= centerString("------------------------------------------------------"); $result_bp = sql_query($query_bp, $db_a); $num_rows_bp = sql_num_rows($result_bp); if ($num_rows_bp > 0) { $receipt .= $fieldNames; for ($i = 0; $i < $num_rows_bp; $i++) { $row_bp = sql_fetch_array($result_bp); $timeStamp = timeStamp($row_bp["tdate"]); $receipt .= " " . substr($timeStamp . $blank, 0, 10) . substr($row_bp["register_no"] . $blank, 0, 7) . substr($row_bp["trans_no"] . $blank, 0, 6) . substr($row_bp["emp_no"] . $blank, 0, 6) . substr($blank . $row_bp["upc"], -10) . substr($blank . number_format($row_bp["total"], 2), -10) . "\n"; } $receipt .= centerString("------------------------------------------------------"); } else { $receipt .= "\n\n" . centerString(" * * * N O N E * * * ") . "\n\n" . centerString("------------------------------------------------------"); } $receipt .= str_repeat("\n", 8); // apbw/tt 3/16/05 Franking II writeLine($receipt . chr(27) . chr(105)); // apbw/tt 3/16/05 Franking II sql_close($db_a); $_SESSION["msgrepeat"] = 1; $_SESSION["strRemembered"] = "ES"; gohome(); }
function generateXMLarticle($article_number, $sp_detail, $p, $uselength = false) { $result = ''; //XML ARTICLES $result .= writeXMLopen('ARTICLEDATA', 1); $result .= writeLine(); //XML ARTICLE DETAIL if ($p['length'] != '' && $p['length'] != 0) { $length = textLength($p['length']); $length = ' ' . strtoupper(str_replace(' ', '', $length)); $len_pname = strlen($billing_text); $len_plength = strlen($length); $len_total = $len_pname + $len_plength; if ($len_total <= $billing_text_max) { $billing_text .= $length; } } $article_number_used = $article_number; if ($p['length'] != '' && $p['length'] != '0') { $article_number_used .= '_' . textLength($p['length'], false); } if ($p['text'] != '' && $p['text_code'] != '') { $article_number_used .= '_' . $p['text_code']; } $billing_text = neckermannBillingText(15, $p['categories_id'], $p['name'], $p['length']); $result .= writeXMLline('A_SUP_ARTNO', $article_number_used, 2); $result .= writeXMLline('A_EAN', $p['products_ean'], 2); $result .= writeXMLline('A_BILLING_TEXT', $billing_text, 2); //XML ARTICLE COMPONENT if ($uselength) { $result .= writeXMLopen('A_COMPONENT', 2); $result .= writeXMLopen('COMPONENT', 3); $result .= writeXMLline('COMPONENT_ID', '2', 4); $result .= writeXMLline('COMPONENT_NAME', 'Größe', 4); $result .= writeXMLclose('COMPONENT', 3); $length = textLength($p['length']); $result .= writeXMLline('COMPONENT_VALUE', $length, 3); $result .= writeXMLclose('A_COMPONENT', 2); $result .= writeLine(); } if ($p['text'] != '' && $p['text_code'] != '') { $result .= writeXMLopen('A_COMPONENT', 2); $result .= writeXMLopen('COMPONENT', 3); $result .= writeXMLline('COMPONENT_ID', '4053', 4); $result .= writeXMLline('COMPONENT_NAME', 'Text', 4); $result .= writeXMLclose('COMPONENT', 3); $text = $p['text']; $result .= writeXMLline('COMPONENT_VALUE', $text, 3); $result .= writeXMLclose('A_COMPONENT', 2); $result .= writeLine(); } $valid_date = date('Y-m-d', strtotime($p['date_added'])); $result .= writeXMLline('A_SEGMENT', '785', 2); $result .= writeXMLline('A_VALID_DATE', $valid_date, 2); $result .= writeLine(); //XML ARTICLE STOCK $result .= writeXMLline('A_UNIT', 'ST', 2); //below additional stock is to handle neckermann error about hiding resourcable products when stock is 0 //if ($p['reported_stock']>0) $p['reported_stock'] += 49; //thile line above should be deleted once this error is fixed //TODO: uncomment below line and delete the line below it to reactivate NM.AT //$result .= writeXMLline('A_STOCK', $p['reported_stock'], 2); $result .= writeXMLline('A_STOCK', '0', 2); $result .= writeLine(); //XML ARTICLE PRICING $result .= writeXMLopen('A_PRICE', 2); $result .= writeXMLline('PRICE_VK', $p['price'], 3); if ($p['price_old'] > 0 && $p['price_old'] > $p['price']) { $result .= writeXMLline('PRICE_VK_OLD', $p['price_old'], 3); } $result .= writeXMLline('PRICE_TAX', '2', 3); $result .= writeXMLline('PRICE_PROVISION_TYPE', $sp_detail['provision'], 3); $result .= writeXMLclose('A_PRICE', 2); $result .= writeLine(); //XML ARTICLE ORDERING $result .= writeXMLopen('A_ORDER', 2); $result .= writeXMLline('ORDER_QUANTITY_MIN', '1', 3); $result .= writeXMLline('ORDER_QUANTITY_INTERVALL', '1', 3); $result .= writeXMLclose('A_ORDER', 2); $result .= writeLine(); //XML DELIVERY $result .= writeXMLopen('A_DELIVERY', 2); $result .= writeXMLline('DELIVERY_TIME', $sp_detail['delivery_time'], 3); $result .= writeXMLline('DELIVERY_REPLACEMENT', 'N', 3); $result .= writeXMLline('DELIVERY_SCHEDULE', 'N', 3); $result .= writeXMLline('DELIVERY_SEPARATION', 'N', 3); $result .= writeXMLline('DELIVERY_PARCEL_TYPE', 'V99', 3); $result .= writeXMLline('DELIVERY_CARRIER', '6', 3); $result .= writeXMLclose('A_DELIVERY', 2); $result .= writeLine(); //XML CROSSDOCK PACKAGE $result .= writeXMLopen('A_CROSSDOCK', 2); $result .= writeXMLline('CROSSDOCK_PACKAGE_WIDTH', '5', 3); $result .= writeXMLline('CROSSDOCK_PACKAGE_HEIGHT', '5', 3); $result .= writeXMLline('CROSSDOCK_PACKAGE_LENGTH', '5', 3); $result .= writeXMLline('CROSSDOCK_GROSS_WEIGHT', '0.05', 3); //$result .= writeXMLline('CROSSDOCK_PACKAGE_PIECES', '', 3); //$result .= writeXMLline('CROSSDOCK_PACKAGE_KEY', '', 3); //$result .= writeXMLline('CROSSDOCK_PROPERTY_KEY', '', 3); $result .= writeXMLclose('A_CROSSDOCK', 2); $result .= writeLine(); //XML ELECTRIC APPLIANCE $result .= writeXMLopen('A_ELECTRIC_APPLIANCE', 2); $result .= writeXMLline('ELECTRIC_APPLIANCE_REGULATION', 'N', 3); $result .= writeXMLclose('A_ELECTRIC_APPLIANCE', 2); $result .= writeLine(); //XML TRADESTAT $result .= writeXMLopen('A_TRADESTAT', 2); $result .= writeXMLline('TRADESTAT_ORG_COUNTRY', 'DEU', 3); $result .= writeXMLline('TRADESTAT_LABEL', '71131100', 3); $result .= writeXMLline('TRADESTAT_AMOUNT', '1', 3); $result .= writeXMLline('TRADESTAT_GROSS_WEIGHT', '50', 3); $result .= writeXMLclose('A_TRADESTAT', 2); $result .= writeLine(); $result .= writeXMLclose('ARTICLEDATA', 1); $result .= writeLine(); return $result; }