<!-- manage purchases template -->
<script type="text/javascript" src="{$template}/scripts/js/functions.orders.js" />
<script type="text/javascript">
var orders = [
{ id: "001", txtOrderDate: "04/12/2010", txtOrderNum: "12345", txtOrderAccountNumber: "98765", txtOrderETA: "05/25/2010", txtVendorName: "a company", txtVendorContact: "whats his name", txtVendorAddress: "4456 s. fuckyou ave", txtVendorPhone: "801-543-1234", txtVendorEmail: "hide@address.com", txtDepartmentName: "a company", txtDepartmentContact: "whats his name", txtDepartmentAddress: "4456 s. fuckyou ave", txtDepartmentPhone: "801-543-1234", txtDepartmentEmail: "hide@address.com" },
{ id: "001", txtOrderDate: "04/12/2010", txtOrderNum: "12345", txtOrderAccountNumber: "98765", txtOrderETA: "05/25/2010", txtVendorName: "a company", txtVendorContact: "whats his name", txtVendorAddress: "4456 s. fuckyou ave", txtVendorPhone: "801-543-1234", txtVendorEmail: "hide@address.com", txtDepartmentName: "a company", txtDepartmentContact: "whats his name", txtDepartmentAddress: "4456 s. fuckyou ave", txtDepartmentPhone: "801-543-1234", txtDepartmentEmail: "hide@address.com" }
];
var products = [
{ id: "001", quantity: "3", description: "what", price: "98.65", number: "34567890", source: "where" },
{ id: "002", quantity: "3", description: "what", price: "98.65", number: "34567890", source: "where" },
{ id: "003", quantity: "3", description: "what", price: "98.65", number: "34567890", source: "where" },
{ id: "004", quantity: "3", description: "what", price: "98.65", number: "34567890", source: "where" },
{ id: "005", quantity: "3", description: "what", price: "98.65", number: "34567890", source: "where" },
{ id: "006", quantity: "3", description: "what", price: "98.65", number: "34567890", source: "where" },
{ id: "007", quantity: "3", description: "what", price: "98.65", number: "34567890", source: "where" },
{ id: "008", quantity: "3", description: "what", price: "98.65", number: "34567890", source: "where" },
{ id: "009", quantity: "3", description: "what", price: "98.65", number: "34567890", source: "where" },
{ id: "010", quantity: "3", description: "what", price: "98.65", number: "34567890", source: "where" }
];
var vendors = [
{ id: "001", txtVendorName: "a company", txtVendorContact: "whats his name", txtVendorAddress: "4456 s. fuckyou ave", txtVendorPhone: "801-543-1234", txtVendorEmail: "hide@address.com" },
{ id: "001", txtVendorName: "a company", txtVendorContact: "whats his name", txtVendorAddress: "4456 s. fuckyou ave", txtVendorPhone: "801-543-1234", txtVendorEmail: "hide@address.com" }
];
var departments = [
{ id: "001", txtDepartmentName: "a company", txtDepartmentContact: "whats his name", txtDepartmentAddress: "4456 s. fuckyou ave", txtDepartmentPhone: "801-543-1234", txtDepartmentEmail: "hide@address.com" },
{ id: "001", txtDepartmentName: "a company", txtDepartmentContact: "whats his name", txtDepartmentAddress: "4456 s. fuckyou ave", txtDepartmentPhone: "801-543-1234", txtDepartmentEmail: "hide@address.com" }
];
var $j = jQuery.noConflict();
var template = '{$template}';
$j(document).ready(function(){
/* perform autocomplete on our orders */
$j("#autoOrders").autocomplete(orders, {
minChars: 0,
width: 310,
matchContains: "word",
autoFill: true,
callBack: queryOrders,
formatItem: function(row, i, max) {
return i + "/" + max + ": " + row.txtOrderDate + " :: " + row.txtOrderNum + " :: " + row.txtOrderAccountNumber + " :: " + row.txtOrderETA + " :: " + row.txtVendorName + " :: " + row.txtVendorContact;
},
formatMatch: function(row, i, max) {
return row.txtOrderDate + " :: " + row.txtOrderNum + " :: " + row.txtOrderAccountNumber + " :: " + row.txtOrderETA + " :: " + row.txtVendorName + " :: " + row.txtVendorContact;
},
formatResult: function(row) {
return row.txtOrderDate + " :: " + row.txtOrderNum + " :: " + row.txtOrderAccountNumber + " :: " + row.txtOrderETA + " :: " + row.txtVendorName + " :: " + row.txtVendorContact;
}
});
/* auto-complete for products */
$j("#autoProducts").autocomplete(products, {
minChars: 0,
width: 310,
matchContains: "word",
autoFill: true,
callBack: queryProducts,
formatItem: function(row, i, max) {
return i + "/" + max + ": " + row.quantity + " :: " + row.description + " :: " + row.price + " :: " + row.number + " :: " + row.source;
},
formatMatch: function(row, i, max) {
return row.quantity + " " + row.description + " " + row.price + " " + row.number + " " + row.source;
},
formatResult: function(row) {
return row.to;
}
});
/* auto-complete for vendors */
$j("#autoVendors").autocomplete(vendors, {
minChars: 0,
width: 310,
matchContains: "word",
autoFill: true,
callBack: queryVendors,
formatItem: function(row, i, max) {
return i + "/" + max + ": " + row.name + " :: " + row.contact + " :: " + row.address + " :: " + row.phone + " :: " + row.email;
},
formatMatch: function(row, i, max) {
return row.name + " " + row.contact + " " + row.address + " " + row.phone + " " + row.email;
},
formatResult: function(row) {
return row.to;
}
});
/* auto-complete for departments */
$j("#autoDepartments").autocomplete(departments, {
minChars: 0,
width: 310,
matchContains: "word",
autoFill: true,
callBack: queryDepartments,
formatItem: function(row, i, max) {
return i + "/" + max + ": " + row.name + " :: " + row.contact + " :: " + row.address + " :: " + row.phone + " :: " + row.email;
},
formatMatch: function(row, i, max) {
return row.name + " " + row.contact + " " + row.address + " " + row.phone + " " + row.email;
},
formatResult: function(row) {
return row.to;
}
});
Date.format = 'yyyy/mm/dd';
$j("#txtOrderDate").datePicker().datePicker().val(new Date().asString()).trigger('change');
$j("#txtOrderETA").datePicker().val(new Date().asString()).trigger('change');
});
</script>
<form action="{$URL}" method="post" class="auth-form" id="purchase">
<fieldset>
<legend>Manage purchases
<a href="formPrint.php" class="windowPrint" id="windowPrint" title="Print purchasing order" onclick="Modalbox.show(this.href, {title: this.title, width: 936}); return false;"><img src="{$template}/images/icons/icon-print.png" title="Print purchasing order" alt="Print purchasing order"></a>
<a href="formPDF.php" class="windowPDF" id="windowPDF" title="Create & Download as PDF" onclick="Modalbox.show(this.href, {title: this.title, width: 936}); return false;"><img src="{$template}/images/icons/icon-pdf.png" title="Create & Download as PDF" alt="Create & Download as PDF"></a>
<a href="formEmail.php" class="windowEmail" id="windowEmail" title="Email purchasing order" onclick="Modalbox.show(this.href, {title: this.title, width: 600}); return false;"><img src="{$template}/images/icons/icon-mail.png" title="Email purchasing order" alt="Email purchasing order"></a>
<a href="javascript:popUp('help/help.html','800','800')" title="Need help?"><img src="{$template}/images/icons/icon-info.png" alt="{$TITLE} Help"></a>
</legend>
{$error}
<div title="Order details">
Order details
<input type="text" id="autoOrders" title="Search existing orders?" style="width: 30%" value="Search orders?" onclick="this.value=''" onblur="if(this.value==''){this.value='Search orders?'}">
<a href="formAdvOrderSearch.php" class="windowSearchOrders" id="windowSearchOrders" title="Search existing orders?" onclick="Modalbox.show(this.href, {title: this.title, width: 800}); return false;"><img src="{$template}/images/icons/icon-search.png" title="Search existing orders?" alt="Search existing orders?"></a><hr />
</div>
<div>
<table border="0" width="100%" class="auth-form txt" cellspacing="5">
<tr>
<td class="txt date-pick" nowrap title="Order date">Order date:</td>
<td><input type="text" id="txtOrderDate" name="txtOrderDate" value="{$txtOrderDate}" style="width: 80%" title="Order date" /></td>
<td class="copyright">{$txtOrderDateErr}</td>
<td class="txt" nowrap title="Order number">Order number:</td>
<td><input type="text" id="txtOrderNum" name="txtOrderNum" value="{$txtOrderNum}" style="width: 100%" title="Order number" /></td>
<td class="copyright">{$txtOrderNumErr}</td>
<td class="txt" nowrap title="Group membership">Group membership:</td>
<td><input type="text" id="txtOrderGroup" name="txtOrderGroup" value="{$txtOrderGroup}" style="width: 100%" title="Group membership" /></td>
<td class="copyright">{$txtOrderGroupErr}</td>
</tr>
</table>
</div>
<div>
<table border="0" width="100%" class="auth-form txt" cellspacing="5">
<tr>
<td class="txt" nowrap title="Account number(s)" nowrap>Account number(s):</td>
<td><input type="text" id="txtOrderAccountNumber" name="txtOrderAccountNumber" value="{$txtOrderAccountNumber}" style="width: 100%" title="Account number(s)" /></td>
<td class="copyright">{$txtOrderAccountNumberErr}</td>
<td class="txt" title="Order ETA" nowrap>Order ETA:</td>
<td><input type="text date-pick" id="txtOrderETA" name="txtOrderETA" value="{$txtOrderETA}" style="width: 80%" title="Order ETA" /></td>
<td class="copyright">{$txtOrderETAErr}</td>
</tr>
</table>
</div>
<div style="height: 30px"> </div>
<div title="Products">
Products
<input type="text" id="autoProducts" title="Search existing product information?" style="width: 30%" value="Search products?" onclick="this.value=''" onblur="if(this.value==''){this.value='Search products?'}">
<a href="formAdvProductSearch.php" class="windowSearchProducts" id="windowSearchProducts" title="Search existing product information?" onclick="Modalbox.show(this.href, {title: this.title, width: 800}); return false;"><img src="{$template}/images/icons/icon-search.png" title="Search existing products?" alt="Search existing products?"></a><hr />
</div>
<div>
<table border="0" width="100%" class="auth-form txt" cellspacing="5">
<tr align="center">
<td title="Add new product element?" align="left"><a href="#" title="Add new product row?"><img src="{$template}/images/icons/icon-add.png" alt="Add new product row?" title="Add new product row?"></a></td>
<td title="Product quantity"><strong>Quantity</strong></td>
<td title="Item description"><strong>Item description</strong></td>
<td title="Item price"><strong>Price</strong></td>
<td title="Part number"><strong>Part number</strong></td>
<td title="Part source"><strong>Part source</strong></td>
<td> </td>
</tr>
<tr id="default">
<td><a href="#" alt="Remove product?" title="Remove product?"><img src="{$template}/images/icons/icon-remove.png" title="Remove product?"></a></td>
<td><input type="text" name="txtParts[quantity]" value="{$txtParts[quantity]}" style="width: 100%" title="Part quantity" /></td>
<td><input type="text" name="txtParts[description]" value="{$txtParts[description]}" style="width: 100%" title="Part description" /></td>
<td><input type="text" name="txtParts[price]" value="{$txtParts[price]}" style="width: 100%" title="Part price" /></td>
<td><input type="text" name="txtParts[number]" value="{$txtParts[number]}" style="width: 100%" title="Part number" /></td>
<td><input type="text" name="txtParts[source]" value="{$txtParts[source]}" style="width: 100%" title="Part source" /></td>
<td>{$txtOrderPartsErr}</td>
</tr>
<tr>
<td colspan="7">
<table border="0" width="100%" class="auth-form txt" id="parts"></table>
</td>
<tr>
</table>
</div>
<div style="height: 30px"> </div>
<div title="Vendor & Department information">
Vendor & Deparment information<hr />
</div>
<div>
<table border="0" width="100%" class="auth-form txt">
<tr>
<td width="50%">
<table border="0" width="100%" class="auth-form txt" cellspacing="5">
<tr>
<td colspan="3" class="txt" nowrap title="Vendor information"><strong>Vendor information</strong>
<input type="text" id="autoVendors" title="Search existing vendor information?" style="width: 30%" value="Search vendors?" onclick="this.value=''" onblur="if(this.value==''){this.value='Search vendors?'}">
<a href="formAdvVendorSearch.php" class="windowSearchVendors" id="windowSearchVendors" title="Search existing vendors?" onclick="Modalbox.show(this.href, {title: this.title, width: 800}); return false;"><img src="{$template}/images/icons/icon-search.png" title="Search existing vendors?" alt="Search existing vendors?"></a>
</td>
</tr>
<tr>
<td class="txt" nowrap title="Vendor name">Name:</td>
<td><input type="text" id="txtVendorName" name="txtVendorName" value="{$txtVendorName}" style="width: 100%" title="Vendor name" /></td>
<td class="copyright">{$txtVendorNameErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Vendor contact">Contact:</td>
<td><input type="text" id="txtVendorContact" name="txtVendorContact" value="{$txtVendorContact}" style="width: 100%" title="Vendor contact" /></td>
<td class="copyright">{$txtVendorContactErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Vendor address">Address:</td>
<td><textarea id="txtVendorAddress" name="txtVendorAddress" title="Vendor address" style="width: 100%">{$txtVendorAddress}</textarea></td>
<td class="copyright">{$txtVendorAddressErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Vendor phone">Phone:</td>
<td><input type="text" id="txtVendorPhone" name="txtVendorPhone" value="{$txtVendorPhone}" style="width: 100%" title="Vendor phone" /></td>
<td class="copyright">{$txtVendorPhoneErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Vendor email">Email:</td>
<td><input type="text" id="txtVendorEmail" name="txtVendorEmail" value="{$txtVendorEmail}" style="width: 100%" title="Vendor email" /></td>
<td class="copyright">{$txtVendorEmailErr}</td>
</tr>
</table>
</td>
<td width="50%">
<table border="0" width="100%" class="auth-form txt" cellspacing="5">
<tr>
<td colspan="3" class="txt" nowrap title="Department information"><strong>Department information</strong>
<input type="text" id="autoDepartments" title="Search existing departments?" style="width: 30%" value="Search departments?" onclick="this.value=''" onblur="if(this.value==''){this.value='Search departments?'}">
<a href="formAdvDepartmentSearch.php" class="windowSearchDepartments" id="windowSearchDepartments" title="Search departments?" onclick="Modalbox.show(this.href, {title: this.title, width: 800}); return false;"><img src="{$template}/images/icons/icon-search.png" title="Search existing departments?" alt="Search existing departments?"></a>
</td>
</tr>
<tr>
<td class="txt" nowrap title="Department name">Name:</td>
<td><input type="text" id="txtDepartmentName" name="txtDepartmentName" value="{$txtDepartmentName}" style="width: 100%" title="Department name" /></td>
<td class="copyright">{$txtDepartmentNameErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Department contact">Contact:</td>
<td><input type="text" id="txtDepartmentContact" name="txtDepartmentContact" value="{$txtDepartmentContact}" style="width: 100%" title="Department contact" /></td>
<td class="copyright">{$txtDepartmentContactErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Department address">Address:</td>
<td><textarea id="txtDepartmentAddress" name="txtDepartmentAddress" title="Department address" style="width: 100%">{$txtDepartmentAddress}</textarea></td>
<td class="copyright">{$txtDepartmentAddressErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Department phone">Phone:</td>
<td><input type="text" id="txtDepartmentPhone" name="txtDepartmentPhone" value="{$txtDepartmentPhone}" style="width: 100%" title="Department phone" /></td>
<td class="copyright">{$txtDepartmentPhoneErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Department email">Email:</td>
<td><input type="text" id="txtDepartmentEmail" name="txtDepartmentEmail" value="{$txtDepartmentEmail}" style="width: 100%" title="Department email" /></td>
<td class="copyright">{$txtDepartmentEmailErr}</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div style="height: 35px"> </div>
<div title="Additional order information">
Additional order information<hr />
</div>
<div>
<table border="0" width="100%" class="auth-form txt" cellspacing="5">
<tr>
<td class="txt" nowrap title="Tracking number">Tracking number:</td>
<td><input type="text" id="txtOrderTrackingNumber" name="txtOrderTrackingNumber" value="{$txtOrderTrackingNumber}" style="width: 100%" title="Tracking number" /></td>
<td class="copyright">{$txtOrderTrackingNumberErr}</td>
</tr>
<tr>
<td class="txt" title="Order Notes">Order notes:</td>
<td><textarea id="txtOrderNotes" name="txtOrderNotes" title="Order Notes" style="width: 100%">{$txtOrderNotes}</textarea></td>
<td class="copyright">{$txtOrderTrackingNumberErr}</td>
</tr>
</table>
</div>
<div align="center">
<input type="hidden" id="cmd" name="cmd" />
<input type="submit" id="myForm" name="addPurchase" title="Add purchasing order" value="Add purchasing order" onclick="$j('#cmd').val($j(this).attr('name'))" />
<input type="submit" id="myForm" name="editPurchase" title="Edit purchasing order" value="Edit purchasing order" onclick="$j('#cmd').val($j(this).attr('name'))" />
<input type="submit" id="myForm" name="delPurchase" title="Delete purchasing order" value="Delete purchasing order" onclick="$j('#cmd').val($j(this).attr('name'))" />
</div>
</fieldset>
</form>
<!-- end manage purchases template -->