$email = $_REQUEST['email']; $term = $_REQUEST['term']; if ($term == 0) { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Driver Terms', 'termId')); } $start = $_REQUEST['start']; $percentage = $_REQUEST['percentage']; if ($percentage == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Driver Percentage', 'percentage')); } $gender = $_REQUEST['gender']; if ($gender == "0") { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Driver Gender', 'gender')); } $ethnicId = $_REQUEST['ethnic']; if ($ethnicId == "0") { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Driver Ethnicity', 'ethnicId')); } $driverClass = $_REQUEST['class']; if ($driverClass == "0") { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Driver Class', 'driverClass')); } $line1 = $_REQUEST['line1']; $line2 = $_REQUEST['line2']; $city = $_REQUEST['city']; $state = $_REQUEST['state']; $zip = $_REQUEST['zip']; $box = $_REQUEST['box']; //die(wrapError(-2,'Feature not ready')); $driverId = saveEditDriver($conexion, $driverId, $broker, $first, $last, $ssn, $tel, $mobile, $carrier, $email, $start, $percentage, $term, $gender, $ethnicId, $driverClass, $line1, $line2, $city, $state, $zip, $box); echo wrapSubmitResponse(SUCCESS_CODE, $driverId);
<?php include_once '../function_header.php'; include '../common_server_functions.php'; //print_r($_REQUEST); $responseCode = 0; $name = $_REQUEST['name']; if ($name == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Vendor Name', 'newVendorName')); } $existingVendor = objectQuery($conexion, '*', 'vendor', "vendorName = '{$name}'"); if ($existingVendor != null) { die(wrapFormError(ERROR_CODE_DUPLICATE, "The name '{$name}' is already in use by another vendor [" . $existingVendor['vendorName'] . "] with ID [" . $existingVendor['vendorId'] . "]", 'newVendorName')); } $info = $_REQUEST['info']; $comment = $_REQUEST['comment']; $tel = $_REQUEST['tel']; $fax = $_REQUEST['fax']; $line1 = $_REQUEST['line1']; $line2 = $_REQUEST['line2']; $city = $_REQUEST['city']; $state = $_REQUEST['state']; $zip = $_REQUEST['zip']; $box = $_REQUEST['box']; //die(wrapError(-2,'Feature not ready')); $vendorId = saveNewVendor($conexion, $name, $info, $comment, $tel, $fax, $line1, $line2, $city, $state, $zip, $box); echo wrapSubmitResponse(SUCCESS_CODE, $vendorId);
$broker = $_REQUEST['broker']; if ($broker == '0' || $broker == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Broker', 'newFuelLoadBroker')); } $truck = $_REQUEST['truck']; if ($truck == '0' || $truck == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Truck', 'newFuelLoadTruck')); } $comment = $_REQUEST['driver']; if ($comment == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Driver', 'newFuelLoadDriver')); } $start = $_REQUEST['start']; if ($start == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Start Measure', 'newFuelLoadStart')); } $finish = $_REQUEST['finish']; if ($finish == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Finish Measure', 'newFuelLoadFinish')); } if ($start > $finish || $start < 0) { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Start and Finishing values are not valid', 'newFuelLoadFinish')); } $registered = $_REQUEST['registered']; $miles = $_REQUEST['miles']; if ($miles == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Miles Measure', 'newFuelLoadMileage')); } //die(wrapError(-2,'Feature not ready')); $fuel = saveNewFuelLoad($conexion, $broker, $truck, $date, $comment, $start, $finish, $registered, $miles); echo wrapSubmitResponse(SUCCESS_CODE, $vendorId);
<?php include_once '../function_header.php'; include '../common_server_functions.php'; //print_r($_REQUEST); $responseCode = 0; $customer = $_REQUEST['customer']; if ($customer == '0' || $customer == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Customer', 'newEstimateCustomer')); } $name = $_REQUEST['name']; if ($name == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Estimate Name', 'newEstimateName')); } $existingEstimate = objectQuery($conexion, '*', 'fakeproject', "customerId = '{$customer}' AND fakeprojectName = '{$name}'"); if ($existingEstimate != null) { die(wrapFormError(ERROR_CODE_DUPLICATE, "The name '{$name}' is already in use by another estimate [" . $existingEstimate['fakeprojectName'] . "] with ID [" . $existingEstimate['fakeprojectIdId'] . "]", 'newEstimateName')); } $line1 = $_REQUEST['line1']; $line2 = $_REQUEST['line2']; $city = $_REQUEST['city']; $state = $_REQUEST['state']; $zip = $_REQUEST['zip']; $box = $_REQUEST['box']; //die(wrapError(-2,'Feature not ready')); $estimateId = saveNewEstimate($conexion, $name, $customer, $line1, $line2, $city, $state, $zip, $box); echo wrapSubmitResponse(SUCCESS_CODE, $estimateId);
if ($material == 0 || $material == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a material', 'newItemMaterialId')); } $fromId = $_REQUEST['fromId']; $toId = $_REQUEST['toId']; $fromText = $_REQUEST['fromDisplay']; $toText = $_REQUEST['toDisplay']; $materialPrice = $_REQUEST['materialPrice']; if ($materialPrice == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a material price', 'newItemMaterialPrice')); } $brokerCost = $_REQUEST['brokerCost']; if ($brokerCost == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a broker cost', 'newItemBrokerCost')); } $customerCost = $_REQUEST['customerCost']; if ($customerCost == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a customer cost', 'newItemCustomerCost')); } $type = $_REQUEST['type']; if ($type == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a type', 'type')); } $description = $_REQUEST['description']; $existing = objectQuery($conexion, '*', 'item_proposal', "projectId = '{$project}' AND supplierId = '{$supplier}' AND materialId = '{$material}' AND itemProposalType = '{$type}' AND itemProposalMaterialPrice = '{$materialPrice}' AND itemProposalBrokerCost = '{$brokerCost}' AND itemProposalCustomerCost = '{$customerCost}'"); if ($existing != null) { die(wrapFormError(ERROR_CODE_DUPLICATE, "The proposal already exists")); } //die(wrapError(-2,'Feature not ready')); $itemProposalId = saveNewItemProposal($conexion, $project, $supplier, $material, $fromId, $toId, $fromText, $toText, $material, $broker, $customer, $type, $description); echo wrapSubmitResponse(SUCCESS_CODE, $itemProposalId);
<?php include_once '../function_header.php'; include '../common_server_functions.php'; //print_r($_REQUEST); $responseCode = 0; $customer = $_REQUEST['customer']; if ($customer == '0' || $customer == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a customer', '')); } $number = $_REQUEST['number']; if ($number == '0' || $number == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a number', '')); } $existing = mysql_fetch_assoc(mysql_query("SELECT * FROM customer_super_check WHERE customerId = '{$customer}' AND customerSuperCheckNumber = '{$number}'", $conexion)); if ($existing != null) { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, "The number '{$number}' is already used by the check with ID [" . $existing['customerSuperCheckId'] . "]", '')); } $amount = $_REQUEST['amount']; if ($amount == '0' || $amount == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a amount', '')); } $date = $_REQUEST['date']; if ($date == '0' || $date == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a date', '')); } $note = $_REQUEST['note']; $checkId = saveNewCustomerSuperCheck($conexion, $customer, $number, $amount, $date, $note); echo wrapSubmitResponse(SUCCESS_CODE, $checkId);
$number = $_REQUEST['number']; if ($number == '') { die(wrapFormError(ERROR_CODE_INVALID_VALUE, 'Internal Error', '')); } $date = $_REQUEST['date']; if ($date == '0') { die(wrapFormError(ERROR_CODE_INVALID_VALUE, 'The date si not in a correct format', '')); } $amount = $_REQUEST['amount']; if ($amount > $invoiceBalance) { die(wrapFormError(ERROR_CODE_INVALID_VALUE, "The amount you want to pay ({$amount}) is greater than the amount left to pay ({$invoiceBalance}). Please refresh your page. ", '')); } if ($check != '0') { $checkInfo = getCustomerSuperCheckInfo($conexion, $check); if ($checkInfo['customerCreditAmount'] == null || $checkInfo['customerCreditAmount'] < $amount) { die(wrapFormError(ERROR_CODE_INVALID_VALUE, 'The amount you want to pay is greater than the check credit. Please refresh your page.', '')); } } /* $customer = $_REQUEST['customer']; if($customer == '0' || $customer == '') die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS,'Please select a customer','')); $number = $_REQUEST['number']; if($number == '0' || $number == '') die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS,'Please select a number','')); $existing = mysql_fetch_assoc(mysql_query("SELECT * FROM customer_super_check WHERE customerId = '$customer' AND customerSuperCheckNumber = '$number'", $conexion)); if($existing!= null) die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS,"The number '$number' is already used by the check with ID [".$existing['customerSuperCheckId']."]",'')); $amount = $_REQUEST['amount']; if($amount == '0' || $amount == '') die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS,'Please select a amount','')); $date = $_REQUEST['date']; if($date == '0' || $date == '') die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS,'Please select a date','')); $note = $_REQUEST['note']; */ //die(wrapError(-2,'Feature not ready')); $checkId = saveCustomerCheck($conexion, $invoice, $number, $amount, $date, $check); $response['code'] = 0; $response['created'] = $checkId;
<?php include_once '../function_header.php'; include '../common_server_functions.php'; //print_r($_REQUEST); $responseCode = 0; $vendor = $_REQUEST['vendor']; if ($vendor == '' || $vendor == '0') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Vendor', 'newVendorId')); } $name = $_REQUEST['name']; if ($name == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Supplier Name', 'newSupplierName')); } $existingSupplier = objectQuery($conexion, '*', 'supplier', "supplierName = '{$name}' AND vendorId = '{$vendor}'"); if ($existingSupplier != null) { die(wrapFormError(ERROR_CODE_DUPLICATE, "The name '{$name}' is already in use by another supplier [" . $existingSupplier['supplierName'] . "] with ID [" . $existingSupplier['supplierId'] . "]", 'newSupplierName')); } $info = $_REQUEST['info']; $dumptime = $_REQUEST['dumptime']; $tel = $_REQUEST['tel']; $fax = $_REQUEST['fax']; $line1 = $_REQUEST['line1']; $line2 = $_REQUEST['line2']; $city = $_REQUEST['city']; $state = $_REQUEST['state']; $zip = $_REQUEST['zip']; $box = $_REQUEST['box']; //die(wrapError(-2,'Feature not ready')); $supplierId = saveNewSupplier($conexion, $vendor, $name, $tel, $fax, $info, $dumptime, $line1, $line2, $city, $state, $zip, $box); echo wrapSubmitResponse(SUCCESS_CODE, $supplierId);
include '../common_server_functions.php'; //print_r($_REQUEST); $responseCode = 0; if ($_REQUEST['tickets'] == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please insert tickets to create the invoice', '')); } $tickets = explode('~', $_REQUEST['tickets']); $supplier = $_REQUEST['supplierId']; if ($supplier == '0' || $supplier == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a supplier', 'supplierId')); } $invoice = $_REQUEST['invoice']; if ($invoice == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please type the invoice number', 'invoiceNumber')); } $date = $_REQUEST['date']; if ($date == '0') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please type a valid date', 'invoiceDate')); } $amount = $_REQUEST['amount']; if ($amount == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please type a valid amount', 'invoiceAmount')); } $current = $_REQUEST['current']; if ($current != $amount) { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'The current value is different to the amount typed', 'invoiceAmount')); } $comment = $_REQUEST['comment']; //die(wrapError(-2,'Feature not ready')); $invoiceId = saveNewVendorInvoice($conexion, $supplier, $invoice, $amount, $comment, $date, $tickets); echo wrapSubmitResponse(SUCCESS_CODE, $invoiceId);
} $wcexp = $_REQUEST['wcexp']; if ($wcexp == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Expirantion Date', 'brokerWcExpire')); } $inslb = $_REQUEST['inslb']; if ($inslb == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Insurance Liability', 'brokerInsLiability')); } $lbexp = $_REQUEST['lbexp']; if ($lbexp == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Expiration Date', 'brokerLbExpire')); } $genln = $_REQUEST['genln']; $glexp = $_REQUEST['glexp']; $start = $_REQUEST['start']; $percentage = $_REQUEST['percentage']; if ($percentage == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Broker Percentage', 'brokerPercentage')); } $gender = $_REQUEST['gender']; if ($gender == "0") { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Broker Gender', 'gender')); } $ethnicId = $_REQUEST['ethnic']; if ($ethnicId == "0") { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Broker Ethnicity', 'ethnicId')); } //die(wrapError(-2,'Feature not ready')); $brokerId = saveNewBroker($conexion, $pid, $name, $contact, $tax, $tel, $fax, $radio, $mobile, $carrier, $email, $icc, $wc, $wcexp, $inslb, $lbexp, $genln, $glexp, $start, $percentage, $term, $gender, $ethnicId, $line1, $line2, $city, $state, $zip, $box); echo wrapSubmitResponse(SUCCESS_CODE, $brokerId);
<?php include_once '../function_header.php'; include '../common_server_functions.php'; //print_r($_REQUEST); $responseCode = 0; $name = $_REQUEST['name']; if ($name == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Customer Name', 'newCustomerName')); } $existingCustomer = objectQuery($conexion, '*', 'customer', "customerName = '{$name}'"); if ($existingCustomer != null) { die(wrapFormError(ERROR_CODE_DUPLICATE, "The name '{$name}' is already in use by another customer [" . $existingCustomer['customerName'] . "] with ID [" . $existingCustomer['customerId'] . "]", 'newCustomerName')); } $term = $_REQUEST['term']; if ($term == '0') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Customer Pay Terms', 'newCustomerTerm')); } $web = $_REQUEST['web']; $tel = $_REQUEST['tel']; $fax = $_REQUEST['fax']; $line1 = $_REQUEST['line1']; $line2 = $_REQUEST['line2']; $city = $_REQUEST['city']; $state = $_REQUEST['state']; $zip = $_REQUEST['zip']; $box = $_REQUEST['box']; //die(wrapError(-2,'Feature not ready')); $customerId = saveNewCustomer($conexion, $name, $tel, $fax, $web, $term, $line1, $line2, $city, $state, $zip, $box); echo wrapSubmitResponse(SUCCESS_CODE, $customerId);
$mfi = $_REQUEST['mfi']; if ($mfi == '' || $mfi == '0') { die(wrapFormError(ERROR_CODE_DUPLICATE, "Please type a ticket number", 'newTicketMfi')); } $number = $_REQUEST['number']; $amount = $_REQUEST['amount']; if ($amount == '' || $amount == '0') { die(wrapFormError(ERROR_CODE_DUPLICATE, "Please type a valid amount", 'newTicketAmount')); } $brokerAmount = $_REQUEST['brokerAmount']; if ($brokerAmount == '' || $brokerAmount == '0') { die(wrapFormError(ERROR_CODE_DUPLICATE, "Please type a valid broker amount", 'newTicketBrokerAmount')); } $existing = objectQuery($conexion, '*', 'ticket', "ticketMfi = '{$mfi}' AND ticketNumber = '{$number}'"); if ($existing != null) { die(wrapFormError(ERROR_CODE_DUPLICATE, "The number '{$number}' with ticket '{$mfi}' is already in use by another ticket with ID [" . $existing['ticketId'] . "]", 'newTicketNumber')); } //die(wrapError(-2,'Feature not ready')); $ticketId = saveNewTicket($conexion, $item, $truck, $driver, $date, $amount, $brokerAmount, $number, $mfi); $response['code'] = 0; $response['created'] = $ticketId; $response['newMfi'] = $mfi + 1; $ticket = objectQuery($conexion, '*', 'ticket JOIN truck USING (truckId) JOIN broker USING (brokerId) JOIN item USING (itemId) JOIN material USING (materialId)', "ticketId = '{$ticketId}'"); $response['newLine'] = "<tr class='doubleClickable' ticketId='" . $ticket['ticketId'] . "'>\n\t\t<td>" . to_MDY($ticket['ticketDate']) . "</td>\n\t\t<td>" . $ticket['projectId'] . "</td>\n\t\t<td>" . $ticket['brokerPid'] . "-" . $ticket['truckNumber'] . "</td>\n\t\t<td>" . $ticket['materialName'] . "</td>\n\t\t<td>" . $ticket['itemDisplayFrom'] . "</td>\n\t\t<td>" . $ticket['itemDisplayTo'] . "</td>\n\t\t<td>" . $ticket['ticketMfi'] . "</td>\n\t\t<td>" . $ticket['ticketNumber'] . "</td>\n\t</tr>"; /* * echo "<tr class='doubleClickable' ticketId='".$ticket['ticketId']."'> <td>".to_MDY($ticket['ticketDate'])."</td> <td>".$ticket['projectId']."</td> <td>".$ticket['brokerPid']."-".$ticket['truckNumber']."</td> <td>".$ticket['materialName']."</td> <td>".$ticket['itemDisplayFrom']."</td>
$responseCode = 0; $truckId = $_REQUEST['truckId']; if ($truckId == 0 || $truckId == '') { die(wrapError(ERROR_CODE_FIVE, 'INTERNAL ERROR')); } $broker = $_REQUEST['broker']; if ($broker == 0 || $broker == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a broker', 'brokerId')); } $number = $_REQUEST['number']; if ($number == '') { die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please type the truck number', 'truckNumber')); } $existingTruck = objectQuery($conexion, '*', 'truck', "truckNumber = '{$number}' AND brokerId = '{$broker}' AND truckId <> '{$truckId}'"); if ($existingTruck != null) { die(wrapFormError(ERROR_CODE_DUPLICATE, "The number '{$number}' is already in use by another truck with ID [" . $existingTruck['truckId'] . "]", 'truckNumber')); } $driver = $_REQUEST['driver']; $plates = $_REQUEST['plates']; $info = $_REQUEST['addinfo']; $brand = $_REQUEST['brand']; $year = $_REQUEST['year']; $serial = $_REQUEST['serial']; $tire = $_REQUEST['tire']; $features = $_REQUEST['features']; $line1 = $_REQUEST['line1']; $line2 = $_REQUEST['line2']; $city = $_REQUEST['city']; $state = $_REQUEST['state']; $zip = $_REQUEST['zip']; $box = $_REQUEST['box'];