function getLocation($status, $data) { $DB = new conn(); $DB->connect(); $location = ""; if ($status == 1) { // Get Office Location $sql = "select storagelocation_name from storagelocations where storagelocation_id = " . $data; $location = $DB->query_scalar($sql) . "<br /><br />"; } if ($status == 2) { // Get Employee Address $sql = "select Username from users where user_id = " . $data; $location = $DB->query_scalar($sql) . "<br /><br />"; } if ($status == 3) { $location = "Transferred<br/>"; } if ($status == 4 || $status == 5) { // Get customer address $sql = "select contacts.* from orders join contacts on orders.contact_id = contacts.contact_id where orders.order_id = " . $data; $result = $DB->query($sql); if ($result) { $row = mysql_fetch_assoc($result); $location = $row["contact_address"] . "<br />" . $row["contact_city"] . " " . $row["contact_state"] . ", " . $row["contact_zipcode"]; } } return $location; }
$ProductId = $DB->sanitize($_REQUEST["ProductId"]); $LocationId = $DB->sanitize($_REQUEST["LocationId"]); $Invoice = $DB->sanitize($_REQUEST["Invoice"]); $DateReceived = $DB->sanitize($_REQUEST["receivedDate"]); $serials = array(); foreach ($_REQUEST as $key => $value) { $pos = strpos($key, "Serial"); if ($pos !== false) { $serials[] = $DB->sanitize($value); } } foreach ($serials as $serial) { $sql = "INSERT INTO inventory (product_id, storagelocation_id, invoice, serial, status, status_data, AddedBy, DateReceived) VALUES (" . $ProductId . ", " . $LocationId . ", '" . $Invoice . "', '" . $serial . "', '1', " . $LocationId . ", " . $_SESSION["user_id"] . ", STR_TO_DATE('" . $DateReceived . "', '%m/%d/%Y') )"; $newId = $DB->insert($sql); $sql = "SELECT storagelocation_name from storagelocations where storagelocation_id = " . $LocationId; $locText = $DB->query_scalar($sql); $statusdate = date("m/d/y"); $sql = "UPDATE inventory set status_data_text = '" . $locText . "', status_date = STR_TO_DATE('" . $statusdate . "', '%m/%d/%Y') WHERE inventory_id = " . $newId; $DB->execute_nonquery($sql); } header("Location: ManageInventory.php"); } } } if ($_GET) { } } $DB->close(); ?> <form name="theForm" method="post" action="<?php echo $_SERVER['PHP_SELF'];
$DB->connect(); if (isset($_REQUEST["price"])) { $price = $DB->sanitize($_REQUEST["price"]); } else { $price = 0; } $templates = $DB->getCommissionTemplates($price); $output = $templates; } if ($id == "getTaxRate") { $DB = new conn(); $DB->connect(); $state = $DB->sanitize($_REQUEST["state"]); $county = $DB->sanitize($_REQUEST["county"]); $sql = "select rate from TaxRates where state = '" . $state . "' AND county = '" . $county . "'"; $result = $DB->query_scalar($sql); $output = $result; $DB->close(); } if ($id == "getTemplates") { if (!UserMay("Admin_ViewComm")) { AccessDenied(); } $DB = new conn(); $DB->connect(); $sql = <<<SQLEND \t\t\tselect * from commission_templates SQLEND; $result = mysql_query($sql); while ($row = mysql_fetch_assoc($result)) { $retArray[] = $row;
<?php include "./findconfig.php"; include $_SERVER['DOCUMENT_ROOT'] . "/" . $ROOTPATH . "/Includes/Top.php"; if (!UserMay("Admin")) { AccessDenied(); } $DB = new conn(); $DB->connect(); $sql = "select count(*) from users where status != 'deleted'"; $usercount = $DB->query_scalar($sql, 0); $sql = "select * from admin_history join users on admin_history.user_id = users.user_id WHERE table_name = 'users' ORDER BY datetime DESC LIMIT 1"; $result = $DB->query($sql); if ($result) { while ($row = mysql_fetch_assoc($result)) { $users_username = $row["Username"]; $users_firstname = $row["FirstName"]; $users_lastname = $row["LastName"]; $users_date = $row["datetime"]; } } $sql = "select count(*) from teams where status = 'Active'"; $teamcount = $DB->query_scalar($sql, 0); $sql = "select * from admin_history join users on admin_history.user_id = users.user_id WHERE table_name = 'teams' ORDER BY datetime DESC LIMIT 1"; $result = $DB->query($sql); if ($result) { while ($row = mysql_fetch_assoc($result)) { $teams_username = $row["Username"]; $teams_firstname = $row["FirstName"]; $teams_lastname = $row["LastName"]; $teams_date = $row["datetime"];
<?php include "findconfig.php"; include $DOCROOT . "/" . $ROOTPATH . "/Includes/Top.php"; ?> <?php $DB = new conn(); $DB->connect(); $sql = "select count(*) from orders"; $total_sales = $DB->query_scalar($sql); $DB->close(); ?> <?php /* Example1 : A simple line chart */ // Standard inclusions include $DOCROOT . $ROOTPATH . "/pChart/pChart/pData.class"; include $DOCROOT . "/" . $ROOTPATH . "/pChart/pChart/pChart.class"; // Dataset definition $DataSet = new pData(); $DataSet->AddPoint(array(9, 8, 3), "Serie1"); //$DataSet->AddPoint(array(9, 8, 3), "Serie2"); $DataSet->AddPoint(array("Kirby Sentria", "Shampooer", "Zipp Brush"), "Serie2"); $DataSet->AddAllSeries(); $DataSet->SetAbsciseLabelSerie("Serie2"); // Initialise the graph