Пример #1
0
<?php

include_once '../nyro_header.php';
$ticketId = $_GET['ticketId'];
$ticketInfo = objectQuery($conexion, '*', $ticketExtendedTables, 'ticketId = ' . $ticketId);
?>
<script type="text/javascript">
function deleteSuccess() {
	closeNM();
}
</script>
<div id='actions' class="top-bar">
	<?php 
/*echo createEditIcon('editTicket','../nyros/editTicket.php',"ticketId=$ticketId", "Ticket");*/
?>
	<?php 
echo createDeleteIcon('deleteTicket', '../submit/deleteTicket.php', "ticketId={$ticketId}", "Ticket");
?>
</div>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>Ticket Information</th>
		</tr>
		<?php 
$flag = true;
$projectLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_PROJECT, createGenericNyroableAttributesSmall($ticketInfo['projectId'], 'project'));
$customerLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_CUSTOMER, createGenericNyroableAttributesSmall($ticketInfo['customerId'], 'customer'));
$itemLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_ITEM, createGenericNyroableAttributesSmall($ticketInfo['itemId'], 'item'));
Пример #2
0
<?php

include_once '../nyro_header.php';
$projectId = $_GET['projectId'];
$projectInfo = objectQuery($conexion, '*', $projectExtendedTables, 'projectId = ' . $projectId);
?>
<script type="text/javascript">
function deleteSuccess() {
	closeNM();
}
</script>
<div id='actions' class="top-bar">
	<?php 
echo createActionIcon(IMG_NEW_ITEM_PROPOSAL, 'addItemProposal', 'Add Item Proposal', '../nyros/newItemProposal.php', "projectId=" . $projectId . "&customerId=" . $projectInfo['customerId'], 'show');
?>
	<?php 
echo createActionIcon(IMG_NEW_ITEM, 'addItem', 'Add Item', '../nyros/newItem.php', "projectId=" . $projectId . "&customerId=" . $projectInfo['customerId'], 'show');
?>
	<?php 
echo createEditIcon('editProject', '../nyros/editProject.php', "projectId={$projectId}", "Project");
?>
	<?php 
echo createDeleteIcon('deleteProject', '../submit/deleteProject.php', "projectId={$projectId}", "Project");
?>
</div>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>Project Information</th>
Пример #3
0
<?php

include_once '../nyro_header.php';
$itemId = $_GET['proposalId'];
$itemInfo = objectQuery($conexion, $itemExtendedSelect, 'fakeitem JOIN fakeproject USING (fakeprojectId) JOIN supplier USING (supplierId) JOIN vendor USINg (vendorId) JOIN material USING (materialId)', 'fakeitemId = ' . $itemId);
?>
<script type="text/javascript">
function deleteSuccess() {
	closeNM();
}
</script>
<div id='actions' class="top-bar">
	<?php 
/*echo createEditIcon('editTruck','../nyros/editTruck.php',"truckId=$truckId", "Truck");*/
?>
	<?php 
echo createDeleteIcon('deleteProposal', '../submit/deleteProposal.php', "proposalId={$itemId}", "Proposal");
?>
</div>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>Item Information</th>
		</tr>
		<?php 
$flag = true;
$estimateLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_ESTIMATE, createGenericNyroableAttributesSmall($itemInfo['fakeprojectId'], 'estimate'));
$customerLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_CUSTOMER, createGenericNyroableAttributesSmall($itemInfo['customerId'], 'customer'));
$supplierLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_SUPPLIER, createGenericNyroableAttributesSmall($itemInfo['supplierId'], 'supplier'));
Пример #4
0
	<th width="5%" >L/T/H</th>
	<th width="6%" >Rate</th>
	<th width="8%" >Amount</th>
	<th width="5%" >%</th>
	<th width="8%" >Total</th>
</tr>

<?php 
$queryInvoice = "\nSELECT \n\t*\nFROM\n\tticket\n\tJOIN item using (itemId)\n\tJOIN material using (materialId)\n\tJOIN truck using (truckId)\n\tLEFT JOIN reportticket using (ticketId)\nWHERE\n\treportId IS NULL\n\tAND brokerId=" . $broker . " " . ($isDriver ? " AND driverId = " . $driver : "") . "\n\tAND ticketDate BETWEEN '" . $fromDate . "' AND '" . $toDate . "' \nORDER BY\n\tticketDate, ticketId\n";
$invoices = mysql_query($queryInvoice, $conexion);
mysql_close();
$total = 0;
$count = 0;
$subtotal = 0;
while ($ticket = mysql_fetch_assoc($invoices)) {
    $customerInfo = objectQuery($conexion, '*', 'project JOIN customer using (customerId)', "projectId = " . $ticket['projectId']);
    echo "<tr>";
    echo "<td>" . to_MDY($ticket['ticketDate']) . "</td>";
    echo "<td>" . $customerInfo['customerName'] . "</td>";
    echo "<td>" . $brokerInfo['brokerPid'] . "-" . $ticket['truckNumber'] . "</td>";
    echo "<td align=left >" . $ticket['ticketMfi'];
    if ($ticket['ticketNumber'] != "") {
        echo "/" . $ticket['ticketNumber'];
    }
    echo "</td>";
    echo "<td align=left>" . $ticket['itemDisplayFrom'] . "</td>";
    echo "<td align=left>" . $ticket['itemDisplayTo'] . "</td>";
    echo "<td >" . decimalPad($ticket['ticketBrokerAmount']);
    echo "</td>";
    echo "<td align=right >" . decimalPad($ticket['itemBrokerCost']);
    echo "</td>";
Пример #5
0
<?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);
Пример #6
0
<?php

include_once '../nyro_header.php';
$customerSuperCheckId = $_GET['customerSuperCheckId'];
$customerSuperCheckInfo = objectQuery($conexion, "*, COALESCE(customerCreditAmount, '0') as checkCredit", 'customer_super_check JOIN customer USING (customerId) LEFT JOIN customer_credit USING (customerSuperCheckId)', 'customerSuperCheckId = ' . $customerSuperCheckId);
$payments = mysql_query("SELECT * FROM receiptcheques WHERE customerSuperCheckId = '{$customerSuperCheckId}' ORDER BY invoiceId desc", $conexion);
?>
<script type="text/javascript">
function deleteSuccess() {
	closeNM();
}
</script>
<div id='actions' class="top-bar">
	<?php 
/*echo createEditIcon('editSupplier','../nyros/editCustomerSuperCheck.php',"customerSuperCheckId=$customerSuperCheckId", "Supplier");*/
?>
	<?php 
echo createDeleteIcon('deleteSupplier', '../submit/deleteCustomerSuperCheck.php', "customerSuperCheckId={$customerSuperCheckId}", "Supplier");
?>
</div>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>Customer Check Information</th>
		</tr>
		<?php 
$flag = true;
$customerLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_VENDOR, createGenericNyroableAttributesSmall($customerSuperCheckInfo['customerId'], 'customer'));
echo printTuple($flag ? '' : "class='bg'", 'Customer', $customerSuperCheckInfo['customerName'], $customerLink);
Пример #7
0
<?php

include_once '../nyro_header.php';
$supplierId = $_GET['supplierId'];
$supplierInfo = objectQuery($conexion, '*', 'supplier JOIN address ON (supplier.addressId = address.addressId) 
		JOIN vendor USING (vendorId)', 'supplierId = ' . $supplierId);
?>
<script type="text/javascript">
$(document).ready(function() {
	
	//$('#submitButton').click(function() {
	$(document).off('click', '#submitEditSupplierButton')
	$(document).on('click', '#submitEditSupplierButton', function() {
		//closeNM();
		submitEditSupplier();
	});
});

function submitEditSupplier() {
	disableButton()
	var data = getEditSupplierParams();
	var url = '../submit/submitEditSupplier.php';
	
	submitNewObject(url, data);
}

function disableButton() {
	$('#submitButton').attr('disabled','disabled');
}

function enableButton() {
Пример #8
0
<?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);
Пример #9
0
<?php

include_once '../function_header.php';
include '../common_server_functions.php';
//print_r($_REQUEST);
$response = array();
$report = $_REQUEST['reportId'];
if ($report == '') {
    die(wrapError(ERROR_CODE_FIVE, 'INTERNAL ERROR'));
}
$number = $_REQUEST['number'];
if ($number == '') {
    die(wrapError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Check Number'));
}
if ($number != 'cash') {
    $existingNumber = objectQuery($conexion, '*', 'suppliercheque', "supplierchequeNumber = '{$number}'");
    if ($existingNumber != null) {
        die(wrapError(ERROR_CODE_DUPLICATE, 'Number is used by a different check'));
    }
}
$date = $_REQUEST['date'];
$amount = $_REQUEST['amount'];
if ($amount <= 0) {
    die(wrapError(ERROR_CODE_INVALID_VALUE, 'The amount must be a value greater than "0".'));
}
//die(wrapError(-2,'Feature not ready'));
$checkId = saveSupplierCheck($conexion, $report, $number, $amount, $date);
if ($checkId != null && $checkId > 0) {
    echo wrapSubmitResponse(SUCCESS_CODE, $checkId);
} else {
    echo wrapError(ERROR_CODE_INTERNAL_ERROR, 'There was an error inserting the check. Please contact the administrator.');
Пример #10
0
<?php

include_once '../nyro_header.php';
$driverId = $_GET['driverId'];
$driverInfo = objectQuery($conexion, '*', $driverExtendedTables, 'driverId = ' . $driverId);
$brokerInfo = objectQuery($conexion, '*', 'broker', 'brokerId = ' . $driverInfo['brokerId']);
?>
<script type="text/javascript">
function deleteSuccess() {
	closeNM();
}
</script>
<div id='actions' class="top-bar">
	<?php 
echo createEditIcon('editDriver', '../nyros/editDriver.php', "driverId={$driverId}", "Driver");
?>
	<?php 
echo createDeleteIcon('deleteDriver', '../submit/deleteDriver.php', "driverId={$driverId}", "Driver");
?>
</div>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>Driver Information</th>
		</tr>
		<?php 
$flag = true;
$brokerLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_BROKER, createGenericNyroableAttributesSmall($driverInfo['brokerId'], 'broker'));
echo printTuple($flag ? '' : "class='bg'", 'Driver Name', $driverInfo['driverFirstName'] . " " . $driverInfo['driverLastName']);
Пример #11
0
$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, '*', 'fakeitem', "fakeprojectId = '{$project}' AND supplierId = '{$supplier}' AND materialId = '{$material}' AND itemType = '{$type}' AND itemMaterialPrice = '{$materialPrice}' AND itemBrokerCost = '{$brokerCost}' AND itemCustomerCost = '{$customerCost}'");
if ($existing != null) {
    die(wrapFormError(ERROR_CODE_DUPLICATE, "The proposal already exists"));
}
$number = "0";
$last = objectQuery($conexion, '*', 'fakeitem', "fakeprojectId = '{$project}' ORDER BY itemNumber desc limit 1");
if ($last != null) {
    $number = $last['itemNumber'] + 1;
} else {
    $number = "1";
}
//die(wrapError(-2,'Feature not ready'));
$itemId = saveNewProposal($conexion, $number, $project, $supplier, $material, 0, 0, $fromText, $toText, $materialPrice, $brokerCost, $customerCost, $type, $description);
echo wrapSubmitResponse(SUCCESS_CODE, $itemId);
Пример #12
0
<?php

include_once '../nyro_header.php';
$customerId = $_GET['customerId'];
$customerInfo = objectQuery($conexion, '*', $customerExtendedTables, 'customerId = ' . $customerId);
?>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>Customer Information</th>
		</tr>
		<?php 
$flag = true;
echo printTuple($flag ? '' : "class='bg'", 'Customer Id', $customerInfo['customerId']);
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Customer Name', $customerInfo['customerName']);
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Customer Telephone', showPhoneNumber($customerInfo['customerTel']));
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Customer Fax', showPhoneNumber($customerInfo['customerFax']));
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'WebSite', $customerInfo['customerWebsite']);
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Address', $customerInfo['addressLine1']);
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Address', $customerInfo['addressCity'] . ", " . $customerInfo['addressState'] . " " . $customerInfo['addressZip']);
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'P.O. Box', $customerInfo['addressPOBox']);
$flag = !$flag;
Пример #13
0
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>
					<td>".$ticket['itemDisplayTo']."</td>
					<td>".$ticket['ticketMfi']."</td>
					<td>".$ticket['ticketNumber']."</td>
				</tr>";
*/
echo json_encode($response);
Пример #14
0
include '../common_server_functions.php';
//print_r($_REQUEST);
$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'];
Пример #15
0
<?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);
Пример #16
0
<?php

include_once '../nyro_header.php';
$fuelLoadId = $_GET['fuelLoadId'];
$fuelLoadInfo = objectQuery($conexion, '*', 'fuel_load JOIN broker ON (broker.brokerId = fuel_load.brokerId) LEFT JOIN truck USING (truckId)', 'fuelLoadId = ' . $fuelLoadId);
?>
<script type="text/javascript">
function deleteSuccess() {
	closeNM();
}
</script>
<div id='actions' class="top-bar">
	<?php 
echo createEditIcon('editFuelLoad', '../nyros/editFuelLoad.php', "fuelLoadId={$fuelLoadId}", "FuelLoad");
?>
	<?php 
echo createDeleteIcon('deleteFuelLoad', '../submit/deleteFuelLoad.php', "fuelLoadId={$fuelLoadId}", "FuelLoad");
?>
</div>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>FuelLoad Information</th>
		</tr>
		<?php 
$flag = true;
$brokerLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_BROKER, createGenericNyroableAttributesSmall($fuelLoadInfo['brokerId'], 'broker'));
echo printTuple($flag ? '' : "class='bg'", 'Fuel Load Id', $fuelLoadInfo['fuelLoadId']);
$flag = !$flag;
Пример #17
0
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);
Пример #18
0
function getAddressInfo($handler, $addressId)
{
    return objectQuery($handler, '*', 'address', 'addressId = ' . $addressId);
}
Пример #19
0
<?php

include_once '../nyro_header.php';
$vendorId = $_GET['vendorId'];
$vendorInfo = objectQuery($conexion, '*', $vendorExtendedTables, 'vendorId = ' . $vendorId);
?>
<script type="text/javascript">
$(document).ready(function() {
	
	//$('#submitButton').click(function() {
	$(document).off('click', '#submitEditVendor');
	$(document).on('click', '#submitEditVendor', function() {
		//closeNM();
		submitEditVendor();
	});
});

function submitEditVendor() {
	disableButton()
	var data = getEditParams();
	var url = '../submit/submitEditVendor.php';
	
	submitNewObject(url, data);
}

function disableButton() {
	$('#submitButton').attr('disabled','disabled');
}

function enableButton() {
	$('#submitButton').removeAttr('disabled');
Пример #20
0
<?php

include_once '../function_header.php';
include '../common_server_functions.php';
//print_r($_REQUEST);
$response = array();
$report = $_REQUEST['reportId'];
if ($report == '') {
    die(wrapError(ERROR_CODE_FIVE, 'INTERNAL ERROR'));
}
$number = $_REQUEST['number'];
if ($number == '') {
    die(wrapError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Check Number'));
}
if ($number != 'cash') {
    $existingNumber = objectQuery($conexion, '*', 'paidcheques', "paidchequeNumber = '{$number}'");
    if ($existingNumber != null) {
        die(wrapError(ERROR_CODE_DUPLICATE, 'Number is used by a different check'));
    }
}
$date = $_REQUEST['date'];
$amount = $_REQUEST['amount'];
if ($amount <= 0) {
    die(wrapError(ERROR_CODE_INVALID_VALUE, 'The amount must be a value greater than "0".'));
}
//die(wrapError(-2,'Feature not ready'));
$checkId = saveBrokerCheck($conexion, $report, $number, $amount, $date);
if ($checkId != null && $checkId > 0) {
    echo wrapSubmitResponse(SUCCESS_CODE, $checkId);
} else {
    echo wrapError(ERROR_CODE_INTERNAL_ERROR, 'There was an error inserting the check. Please contact the administrator.');
Пример #21
0
<?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);
Пример #22
0
include '../common_server_functions.php';
//print_r($_REQUEST);
$responseCode = 0;
$pid = $_REQUEST['pid'];
if ($pid == '') {
    die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing PID', 'brokerPid'));
}
$existingBroker = objectQuery($conexion, '*', 'broker', "brokerPid = '{$pid}'");
if ($existingBroker != null) {
    die(wrapFormError(ERROR_CODE_DUPLICATE, "The PID '{$pid}' is already in use by another broker [" . $existingBroker['brokerName'] . "]", 'editBrokerPid'));
}
$name = $_REQUEST['name'];
if ($name == '') {
    die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Broker Name', 'brokerName'));
}
$existingBroker = objectQuery($conexion, '*', 'broker', "brokerName = '{$name}'");
if ($existingBroker != null) {
    die(wrapFormError(ERROR_CODE_DUPLICATE, "The name '{$name}' is already in use by another broker [" . $existingBroker['brokerName'] . "] with PID [" . $existingBroker['brokerPid'] . "]", 'editBrokerName'));
}
$contact = $_REQUEST['contact'];
$tax = $_REQUEST['tax'];
$tel = $_REQUEST['tel'];
$fax = $_REQUEST['fax'];
$radio = $_REQUEST['radio'];
$mobile = $_REQUEST['mobile'];
$carrier = $_REQUEST['carrier'];
$email = $_REQUEST['email'];
$line1 = $_REQUEST['line1'];
$line2 = $_REQUEST['line2'];
$city = $_REQUEST['city'];
$state = $_REQUEST['state'];
Пример #23
0
if ($driverId == 0 || $driverId == '') {
    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'));
}
$first = $_REQUEST['first'];
if ($first == '') {
    die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please type the driver first name', 'firstName'));
}
$last = $_REQUEST['last'];
if ($last == '') {
    die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please type the driver last name', 'lastName'));
}
$existingDriver = objectQuery($conexion, '*', 'driver', "driverFirstName like '{$first}' AND driverLastName like '{$last}' AND brokerId = '{$broker}' AND driverId<>'{$driverId}'");
if ($existingDriver != null) {
    die(wrapFormError(ERROR_CODE_DUPLICATE, "The driver name '{$first} {$last}' already exists with ID [" . $existingDriver['driverId'] . "]", 'firstName'));
}
$ssn = $_REQUEST['ssn'];
if ($ssn == '') {
    die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please type the driver SSN', 'ssn'));
}
$tel = $_REQUEST['tel'];
$mobile = $_REQUEST['mobile'];
$carrier = $_REQUEST['carrier'];
$email = $_REQUEST['email'];
$term = $_REQUEST['term'];
if ($term == 0) {
    die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Missing Driver Terms', 'termId'));
}
Пример #24
0
<?php

include_once '../nyro_header.php';
$itemId = $_GET['itemProposalId'];
$itemInfo = objectQuery($conexion, $itemProposalExtendedSelect, $itemProposalExtendedTables, 'itemProposalId = ' . $itemId);
?>
<script type="text/javascript">
function deleteSuccess() {
	closeNM();
}
</script>
<div id='actions' class="top-bar">
	<?php 
/*echo createEditIcon('editTruck','../nyros/editTruck.php',"truckId=$truckId", "Truck");*/
?>
	<?php 
echo createDeleteIcon('deleteItemProposal', '../submit/deleteItemProposal.php', "itemProposalId={$itemId}", "ItemProposal");
?>
</div>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>Item Information</th>
		</tr>
		<?php 
$flag = true;
$projectLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_PROJECT, createGenericNyroableAttributesSmall($itemInfo['projectId'], 'project'));
$customerLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_CUSTOMER, createGenericNyroableAttributesSmall($itemInfo['customerId'], 'customer'));
$supplierLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_SUPPLIER, createGenericNyroableAttributesSmall($itemInfo['supplierId'], 'supplier'));
Пример #25
0
<?php

include_once '../nyro_header.php';
$estimateId = $_GET['estimateId'];
$estimateInfo = objectQuery($conexion, '*', $estimateExtendedTables, 'fakeprojectId = ' . $estimateId);
?>
<script type="text/javascript">
function deleteSuccess() {
	closeNM();
}
</script>
<div id='actions' class="top-bar">
	<?php 
echo createActionIcon(IMG_NEW_ITEM_PROPOSAL, 'addProposal', 'Add Proposal', '../nyros/newProposal.php', "estimateId=" . $estimateId . "&customerId=" . $estimateInfo['customerId'], 'show');
?>
	<?php 
/*echo createEditIcon('editProject','../nyros/editProject.php',"projectId=$projectId", "Project");*/
?>
	<?php 
echo createDeleteIcon('deleteProject', '../submit/deleteEstimate.php', "estimateId={$estimateId}", "Estimate");
?>
</div>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>Estimate Information</th>
		</tr>
		<?php 
$flag = true;
Пример #26
0
<?php

include_once '../nyro_header.php';
$truckId = $_GET['truckId'];
$truckInfo = objectQuery($conexion, '*', 'truck JOIN address ON (truck.addressId = address.addressId) 
		JOIN broker USING (brokerId)', 'truckId = ' . $truckId);
?>
<script type="text/javascript">
function deleteSuccess() {
	closeNM();
}
</script>
<div id='actions' class="top-bar">
	<?php 
echo createEditIcon('editTruck', '../nyros/editTruck.php', "truckId={$truckId}", "Truck");
?>
	<?php 
echo createDeleteIcon('deleteTruck', '../submit/deleteTruck.php', "truckId={$truckId}", "Truck");
?>
</div>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>Driver Information</th>
		</tr>
		<?php 
$flag = true;
$brokerLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_BROKER, createGenericNyroableAttributesSmall($truckInfo['brokerId'], 'broker'));
echo printTuple($flag ? '' : "class='bg'", 'Truck Number', $truckInfo['brokerPid'] . " " . $truckInfo['truckNumber']);
Пример #27
0
<?php

include_once '../nyro_header.php';
$driverId = $_GET['driverId'];
$driverInfo = objectQuery($conexion, '*', 'driver JOIN address ON (driver.addressId = address.addressId) 
		JOIN broker USING (brokerId)', 'driverId = ' . $driverId);
?>
<script type="text/javascript">
$(document).ready(function() {
	
	//$('#submitButton').click(function() {
	$(document).one('click', '#submitEditDriverButton', function() {
		//closeNM();
		submitEditDriver();
	});
});

function submitEditDriver() {
	disableButton()
	var data = getEditDriverParams();
	var url = '../submit/submitEditDriver.php';
	
	submitNewObject(url, data);
}

function disableButton() {
	$('#submitButton').attr('disabled','disabled');
}

function enableButton() {
	$('#submitButton').removeAttr('disabled');
Пример #28
0
<?php

include_once '../nyro_header.php';
$brokerId = $_GET['brokerId'];
$brokerInfo = objectQuery($conexion, '*', $brokerExtendedTables, 'brokerId = ' . $brokerId);
?>
<script type="text/javascript">
function deleteSuccess() {
	closeNM();
}
</script>
<div id='actions' class="top-bar">
	<?php 
echo createEditIcon('editBroker', '../nyros/editBroker.php', "brokerId={$brokerId}", "Broker");
?>
	<?php 
echo createDeleteIcon('deleteBroker', '../submit/deleteBroker.php', "brokerId={$brokerId}", "Broker");
?>
</div>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='2'>Broker Information</th>
		</tr>
		<?php 
$flag = true;
echo printTuple($flag ? '' : "class='bg'", 'Broker Name', $brokerInfo['brokerName']);
$flag = !$flag;
echo printTuple($flag ? '' : "class='bg'", 'Broker PID', $brokerInfo['brokerPid']);
Пример #29
0
<?php

include_once '../nyro_header.php';
$supplierId = $_GET['supplierId'];
$supplierInfo = objectQuery($conexion, '*', $supplierExtendedTables, 'supplierId = ' . $supplierId);
?>
<script type="text/javascript">
var supplier = '<?php 
echo $supplierId;
?>
';
$(document).ready(function() {
	
	$('#saveNewPriceList').click(function() {
		saveNewPriceList();
	});
	
	$('#vendorId').change(function() {
		getSuppliersOptions('supplierId',$(this).val());
		$('#previewButton').removeAttr('disabled');
	});
});

function saveNewPriceList() {
	var data = getNewPriceParams();
	var url = '../submit/submitSupplierMaterial.php';
	submitNewPrice(url, data);
}

function getNewPriceParams() {
	var dataArray = new Array();
Пример #30
0
<?php

include_once '../nyro_header.php';
$fuelLoadId = $_GET['fuelLoadId'];
$fuelLoadInfo = objectQuery($conexion, '*', 'fuel_load', 'fuelLoadId = ' . $fuelLoadId);
?>
<script type="text/javascript">
$(document).ready(function() {
	
	//$('#submitButton').click(function() {
	$(document).one('click', '#submitEditFuelLoadButton', function() {
		console.log("algo");
		//closeNM();
		submitEditFuelLoad();
	});
});

function submitEditFuelLoad() {
	disableButton()
	var data = getEditFuelLoadParams();
	var url = '../submit/submitEditFuelLoad.php';
	
	submitNewObject(url, data);
}

function disableButton() {
	$('#submitButton').attr('disabled','disabled');
}

function enableButton() {
	$('#submitButton').removeAttr('disabled');