示例#1
0
文件: add.php 项目: Nvenom/Cellwiz
<?php

require "../../../frame/engine.php";
ENGINE::START();
$user = USER::VERIFY(0, TRUE);
$Fname = FORMAT::TEXT($_GET['Fname']);
$Lname = FORMAT::TEXT($_GET['Lname']);
$Phone = trim($_GET['phone']);
$Sec = trim($_GET['secondarymethod']);
$SecInfo = trim($_GET['secinfo']);
$Zip = trim($_GET['zip']);
$Market = trim($_GET['market']);
$Market_Location = trim($_GET['market_location']);
$Corporate_Account = trim($_GET['corpacc']);
$params = array("{$Fname} {$Lname}", $Zip, $Corporate_Account, $Phone, $Sec, $SecInfo, Date("Y-m-d H:i:s"));
$Main = MYSQL::QUERY('INSERT INTO core_customers (c_name,c_zip,c_acc,c_phone,c_contact_method,c_contact_info,c_join_date) VALUES (?,?,?,?,?,?,?)', $params);
USER::LOG("Customer Added [{$Fname} {$Lname}][{$Phone}]");
TRACKING::ADVERT($Market_Location, $user);
TRACKING::CUSTOMERS($user);
echo '<option value="' . str_pad($Main, 10, "0", STR_PAD_LEFT) . '">' . $Fname . ' ' . $Lname . '</option>';
示例#2
0
$ITEMS = EXPLODE('|', $CHECKOUT['items']);
$LIST = '';
$IT = 1;
$oldnontaxable = 0;
$nontaxable = 0;
$oldtaxable = 0;
$taxable = 0;
$oldtotaltax = 0;
$totaltax = 0;
foreach ($ITEMS as $I) {
    if ($I != '') {
        $I = EXPLODE('/', $I);
        $LIST .= '|' . $I[0] . '/' . $_GET['item' . $IT];
        $EX = EXPLODE('-', $I[0]);
        if ($EX[0] == 'ti') {
            MYSQL::QUERY('UPDATE core_tickets_processed SET t_checkout_created=?,t_checkout_price=? WHERE t_id=? LIMIT 1', array($_GET['date'], $_GET['item' . $IT], $EX[1]));
            $nontaxable = $nontaxable + ($_GET['item' . $IT] - 0);
            $oldnontaxable = $oldnontaxable + $I[1];
        } else {
            $taxable = $taxable + ($_GET['item' . $IT] - 0);
            $totaltax = $totaltax + ($_GET['item' . $IT] - 0) / 100 * $user['store_info']['s_taxrate'];
            $oldtaxable = $oldtaxable + $I[1];
            $oldtotaltax = $I[1] / 100 * $user['store_info']['s_taxrate'];
        }
    }
    $IT++;
}
MYSQL::QUERY('UPDATE core_checkout_sessions SET items=?,pm_1=?,pm_1_cost=?,pm_2=?,pm_2_cost=?,d_date=? WHERE qb_id=? LIMIT 1', array($LIST, $_GET['pm_1'], $_GET['pm_1_charge'], $_GET['pm_2'], $_GET['pm_2_charge'], $_GET['date'], $_GET['chid']));
TRACKING::CHECKOUTS($oldnontaxable, $oldtaxable, $oldtotaltax, $user, $CHECKOUT['pm_1'], $CHECKOUT['pm_1_cost'], $CHECKOUT['pm_2'], $CHECKOUT['pm_2_cost'], '-', $_GET['date']);
TRACKING::CHECKOUTS($nontaxable, $taxable, $totaltax, $user, $_GET['pm_1'], $_GET['pm_1_charge'], $_GET['pm_2'], $_GET['pm_2_charge'], '+', $_GET['date']);
示例#3
0
            $sof = 'None';
            $w = 0;
        }
        $content .= "<tr>\n\t\t\t\t\t\t\t\t<td>Ticket #" . $b[1] . "</td>\n\t\t\t\t\t\t\t    <td style='width:60px;'><center>{$phy}</center></td>\n\t\t\t\t\t\t\t\t<td style='width:60px;'><center>{$sof}</center></td>\n\t\t\t\t\t\t\t\t<td>\$" . $split[1] . "</td>\n\t\t\t\t\t\t\t</tr>";
        $nontaxable = $nontaxable + $split[1];
        MYSQL::QUERY("INSERT INTO core_tickets_processed (t_id, t_customer, t_manufacturer, t_model, t_imei, t_password, t_phy, t_liq, t_sof, t_created_by, t_store, t_session, t_created, t_estimate_created, t_estimate_price, t_estimate_items, t_estimate_time, t_repair_created, t_repair_price, t_repair_items, t_repair_time) SELECT * FROM core_tickets_checkout WHERE t_id = ? LIMIT 1", array($b[1]));
        MYSQL::QUERY("UPDATE core_tickets_processed SET t_warranty=?, t_checkout_created=?, t_checkout_price=?, t_checkout_time=? WHERE t_id = ? LIMIT 1", array($w, Date("Y-m-d H:i:s"), $split[1], $time, $b[1]));
        MYSQL::QUERY("UPDATE core_tickets_status SET t_status = ? WHERE t_id = ? LIMIT 1", array(4, $b[1]));
        MYSQL::QUERY("DELETE FROM core_tickets_checkout WHERE t_id = ? LIMIT 1", array($b[1]));
        USER::NOTE($b[1], "Processed This Ticket [ " . $split[1] . " ] [ {$time} ]", 2);
    } else {
        if ($b[0] == "ac") {
            $taxable = $taxable + $split[1];
            $ITEM = MYSQL::QUERY('SELECT * FROM device_accessories WHERE a_id = ? LIMIT 1', array($b[1]));
            $content .= "<tr>\n\t\t\t\t\t\t\t\t<td>" . $ITEM['a_name'] . "</td>\n\t\t\t\t\t\t\t    <td style='width:60px;'></td>\n\t\t\t\t\t\t\t\t<td style='width:60px;'></td>\n\t\t\t\t\t\t\t\t<td>\$" . $split[1] . "</td>\n\t\t\t\t\t\t\t</tr>";
        } else {
            if ($b[0] == "de") {
                $taxable = $taxable + $split[1];
                $DEVICE = MYSQL::QUERY('SELECT * FROM core_refurb_devices WHERE d_id = ? LIMIT 1', array($b[1]));
                $MODEL = MYSQL::QUERY('SELECT m_name FROM device_models WHERE m_id = ? LIMIT 1', array($DEVICE['d_model_id']));
                $content .= "<tr>\n\t\t\t\t\t\t\t    <td>" . $MODEL['m_name'] . "</td>\n\t\t\t\t\t\t\t\t<td style='width:60px;'>6 Month</td>\n\t\t\t\t\t\t\t\t<td style='width:60px;'>None</td>\n\t\t\t\t\t\t\t\t<td>\$" . $split[1] . "</td>\n\t\t\t\t\t\t\t</tr>";
                MYSQL::QUERY("UPDATE core_refurb_devices SET d_sold = ? WHERE d_id = ? LIMIT 1", array($T['c_id'] . "|" . $split[1], $b[1]));
            }
        }
    }
}
$content .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t    <td colspan='3'></td>\n\t\t\t\t\t    <td colspan='1'><center><b>Tax:</b> \${$totaltax}</center></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t    <td colspan='3'>{$paymentmethod}</td>\n\t\t\t\t\t    <td colspan='1'><center><b>Total:</b> \${$totalcost}</center></td>\n\t\t\t\t\t</tr>\n\t\t        </tbody>\n            </table>\n\t\t\t<table border='1' cellspacing='0' id='Disclaimer-Table' class='escca' style='border: 1px solid black;width: 98% !important;border-left: 0px;border-bottom:0px none !important;border-top: 0px none;'>\n\t            <tbody>\n\t\t            <tr style='text-align:center;'>\n\t\t\t            <td><b>Warranty Information</b></td>\n\t\t\t        </tr>\n\t\t\t        <tr>\n\t\t\t            <td><br/>\n\t\t\t\t\t\t    <b>Physical Warranty</b> - This warranty covers any parts replaced in the repair proccess. If the part we replaced proves to be defective in any way we will replace it at no extra charge.\n\t\t\t\t\t\t\tThis warranty is void if the part sustains any physical or liquid damage or if it is removed from the device. If your phone came in with liquid damage there will be no warranty offered on any\n\t\t\t\t\t\t\tpart that we install. Any aftermarket parts that are brought in by customers are not covered by any warranties.\n\t\t\t\t\t\t\t<br/><br/>\n\t\t\t\t\t\t\t<b>Software Warranty</b> - This warranty guarantees any software service we provide you. If for any reason the phone is updated, modified (ie. jailbreaking, unlocking, rooting) or sustains\n\t\t\t\t\t\t\tphysical or liquid damage the warranty becomes void.\n\t\t\t\t\t\t\t<br/><br/>\n\t\t\t\t\t\t\t<b>Liquid Damage</b> - We <b>do not</b> provide a warranty for any liquid damaged devices that we repair. This include any parts replaced or software services done on any device. Furthermore\n\t\t\t\t\t\t\tany device that we provide a service for that becomes liquid damaged will lose its warranty. No Exceptions.<br/><br/>\n\t\t\t\t        </td>\n\t\t\t        </tr>\n\t\t        </tbody>\n\t        </table>\n        </center>\t\t\n    ";
echo $content;
TRACKING::CHECKOUTS($nontaxable, $taxable, $totaltax, $user, $pm1, $pm1cost, $pm2, $pm2cost);
USER::STAT('checkouts');
USER::MEDAL('bronze', $itemscheckedout);
示例#4
0
require "../../../frame/engine.php";
ENGINE::START();
$user = USER::VERIFY(0, TRUE);
$tid = $_GET['tid'];
$note = $_GET['note'];
$Ticket = MYSQL::QUERY("SELECT * FROM core_tickets_status WHERE t_id = ? LIMIT 1", array($tid));
if ($Ticket['t_status'] == 1) {
    MYSQL::QUERY("INSERT INTO core_tickets_walkout (t_id, t_customer, t_manufacturer, t_model, t_imei, t_password, t_phy, t_liq, t_sof, t_created_by, t_store, t_session, t_created) SELECT * FROM core_tickets_estimate WHERE t_id = ? LIMIT 1", array($tid));
    MYSQL::QUERY("UPDATE core_tickets_status SET t_status = 97 WHERE t_id = ? LIMIT 1", array($tid));
    MYSQL::QUERY("DELETE FROM core_tickets_estimate WHERE t_id = ? LIMIT 1", array($tid));
} else {
    if ($Ticket['t_status'] == 2) {
        MYSQL::QUERY("INSERT INTO core_tickets_walkout (t_id, t_customer, t_manufacturer, t_model, t_imei, t_password, t_phy, t_liq, t_sof, t_created_by, t_store, t_session, t_created, t_estimate_created, t_estimate_price, t_estimate_items, t_estimate_time) SELECT * FROM core_tickets_repair WHERE t_id = ? LIMIT 1", array($tid));
        MYSQL::QUERY("UPDATE core_tickets_status SET t_status = 98 WHERE t_id = ? LIMIT 1", array($tid));
        MYSQL::QUERY("DELETE FROM core_tickets_repair WHERE t_id = ? LIMIT 1", array($tid));
    } else {
        if ($Ticket['t_status'] == 3) {
            MYSQL::QUERY("INSERT INTO core_tickets_walkout (t_id, t_customer, t_manufacturer, t_model, t_imei, t_password, t_phy, t_liq, t_sof, t_created_by, t_store, t_session, t_created, t_estimate_created, t_estimate_price, t_estimate_items, t_estimate_time, t_repair_created, t_repair_price, t_repair_items, t_repair_time) SELECT * FROM core_tickets_checkout WHERE t_id = ? LIMIT 1", array($tid));
            MYSQL::QUERY("UPDATE core_tickets_status SET t_status = 99 WHERE t_id = ? LIMIT 1", array($tid));
            MYSQL::QUERY("DELETE FROM core_tickets_checkout WHERE t_id = ? LIMIT 1", array($tid));
        }
    }
}
if (!$note == '') {
    USER::NOTE($tid, "Walkedout Ticket [{$note}]", 2);
} else {
    USER::NOTE($tid, "Walked this ticket out", 2);
}
TRACKING::WALKOUTS($user);
echo "Ticket Walked Out";
示例#5
0
<?php

require "../../../frame/engine.php";
ENGINE::START();
$user = USER::VERIFY(0, TRUE);
$ticket = $_GET['tid'];
$Main = MYSQL::QUERY("SELECT * FROM core_tickets_repair WHERE t_id = ? LIMIT 1", array($ticket));
$items = $Main['t_estimate_items'];
$items1 = explode("|", $items);
$ns = "";
foreach ($items1 as $i) {
    if (!empty($i)) {
        $i = explode("-", $i);
        if ($i[0] == "it") {
            MYSQL::QUERY("UPDATE inventory_stock SET quantity = quantity - 1 WHERE item=? AND store=? LIMIT 1", array($i[1], $user['store']));
            $Quan = MYSQL::QUERY("SELECT * FROM inventory_stock WHERE item=? AND store=? LIMIT 1", array($i[1], $user['store']));
            print_r($Quan);
            if ($Quan > 0) {
                $ns .= $i[1] . "|";
            }
        }
    }
}
if (!$ns == "") {
    MYSQL::QUERY("UPDATE core_tickets_status SET t_order = ? WHERE t_id = ? LIMIT 1;", array($ns, $ticket));
}
MYSQL::QUERY("UPDATE core_tickets_status SET t_reserved = 1 WHERE t_id = ? LIMIT 1", array($ticket));
TRACKING::ACCEPTS($user);
示例#6
0
    $v = explode("-", $v);
    if ($v[0] == "it") {
        MYSQL::QUERY("UPDATE inventory_stock SET quantity = quantity + 1 WHERE store = ? AND item = ? LIMIT 1", array($user['store'], $v[1]));
    }
}
foreach ($added as $k => $v) {
    $v = explode("-", $v);
    if ($v[0] == "it") {
        MYSQL::QUERY("UPDATE inventory_stock SET quantity = quantity - 1 WHERE store = ? AND item = ? LIMIT 1", array($user['store'], $v[1]));
    }
}
$status = array(3);
foreach ($_POST as $k => $v) {
    $key1 = "t_" . str_replace($ticket, "", $k);
    $key2 = explode(".", $Main[$key1]);
    $key3 = $key2[0] . "." . $v;
    array_push($status, $key3);
}
$reward = round($price / 50);
array_push($status, $ticket);
MYSQL::QUERY("INSERT INTO core_tickets_checkout (t_id, t_customer, t_manufacturer, t_model, t_imei, t_password, t_phy, t_liq, t_sof, t_created_by, t_store, t_session, t_created, t_estimate_created, t_estimate_price, t_estimate_items, t_estimate_time) SELECT * FROM core_tickets_repair WHERE t_id = ? LIMIT 1", array($ticket));
MYSQL::QUERY("UPDATE core_tickets_checkout SET t_repair_created = ?, t_repair_price = ?, t_repair_items = ?, t_repair_time = ? WHERE t_id = ?", array(Date("Y-m-d H:i:s"), $price, $items, $time, $ticket));
MYSQL::QUERY("UPDATE core_tickets_status SET t_status = ?,t_order = 0,t_simcard = ?,t_sdcard = ?,t_case = ?,t_charger = ?,t_power = ?,t_buttons = ?,t_inaudio = ?,t_exaudio = ?,t_touch = ?,t_housing = ?,t_charging = ?,t_service = ? WHERE t_id = ? LIMIT 1", $status);
MYSQL::QUERY("DELETE FROM core_tickets_repair WHERE t_id = ? LIMIT 1", array($ticket));
MYSQL::QUERY('INSERT INTO core_tickets_note (t_id, t_note, t_note_by, t_date) VALUES (?, ?, ?, ?)', array($ticket, "Device Repaired [{$time}]", $user['user_id'], Date("Y-m-d H:i:s")));
TRACKING::REPAIRS($itemsnew, $user);
USER::NOTE($ticket, "Device Repaired [ {$price} ] [ {$time} ]", 2);
USER::STAT('repairs');
USER::MEDAL('bronze', $reward);
?>
 
示例#7
0
                    }
                } else {
                    die("imei{$i}");
                }
            } else {
                die("model{$i}");
            }
        } else {
            die("manu{$i}");
        }
    }
}
if (!empty($params)) {
    if (!empty($query)) {
        $Main = MYSQL::QUERY($query, $params);
        TRACKING::TICKETS($modelsused, $user);
        $customer = MYSQL::QUERY("SELECT * FROM core_customers WHERE c_id = ? LIMIT 1", array($_POST["customerid"]));
        switch ($customer['c_contact_method']) {
            case 0:
                $contactm = FORMAT::PHONE($customer['c_contact_info']);
                break;
            case 1:
                $contactm = $customer['c_contact_info'];
                break;
            case 2:
                $contactm = 'Customer Will Contact Us';
                break;
            case 3:
                $contactm = FORMAT::PHONE($customer['c_phone']);
                break;
        }