<!-- manage vendors template -->
<script type="text/javascript" src="{$template}/scripts/js/functions.vendors.js" />
<script type="text/javascript">
{$jsonvendors}
var $j = jQuery.noConflict();
$j(document).ready(function(){
var loading = '<img src="{$templates}/images/loading.gif" width="20" height="20" alt="Loading content..." title="Loading content..." />';
$j('.sub-form').live('submit', function(){
$j('#tabsConfig .ui-tabs-panel:visible').html(loading);
$j.ajax({
data: $j(this).serialize(),
type: $j(this).attr('method'),
url: $j(this).attr('action'),
success: function(response) {
$j('#tabsConfig .ui-tabs-panel:visible').html(response);
}
});
return false;
})
$j("#autoVendors").autocomplete(vendors, {
minChars: 0,
width: 310,
matchContains: "word",
autoFill: true,
callBack: queryVendors,
formatItem: function(row, i, max) {
return i + "/" + max + ": " + row.txtVendorName + " :: " + row.txtVendorManager + " :: " + row.txtVendorAddress + " :: " + row.txtVendorPhone + " :: " + row.txtVendorEmail;
},
formatMatch: function(row, i, max) {
return row.txtVendorName + " :: " + row.txtVendorManager + " :: " + row.txtVendorAddress + " :: " + row.txtVendorPhone + " :: " + row.txtVendorEmail;
},
formatResult: function(row) {
return row.txtVendorName + " :: " + row.txtVendorManager + " :: " + row.txtVendorAddress + " :: " + row.txtVendorPhone + " :: " + row.txtVendorEmail;
}
});
});
</script>
<form action="{$URL}" method="post" class="sub-form" name="vendors" id="vendors">
<fieldset>
<legend>Manage vendors
<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="Search existing vendors">
Existing vendors
<input type="text" id="autoVendors" title="Search existing vendors?" 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><hr />
</div>
<div>
<table border="0" width="100%" cellspacing="5">
<tr align="left">
<td class="txt" nowrap title="Vendor name" nowrap><b>Name:</b></td>
<td><input type="text" name="txtVendorName" id="txtVendorName" value="{$txtVendorName}" style="width: 100%"></td>
<td class="copywrite">{$txtVendorNameErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Vendor manager" nowrap><b>Manger:</b></td>
<td><input type="text" name="txtVendorManager" id="txtVendorManager" value="{$txtVendorManager}" style="width: 100%"></td>
<td class="copywrite">{$txtVendorManagerErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Vendor address" nowrap><b>Address:</b></td>
<td><textarea name="txtVendorAddress" id="txtVendorAddress" style="width: 100%">{$txtVendorAddress}</textarea></td>
<td class="copywrite">{$txtVendorManagerErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Vendor phone" nowrap><b>Phone:</b></td>
<td><input type="text" name="txtVendorPhone" id="txtVendorPhone" value="{$txtVendorPhone}" style="width: 100%"></td>
<td class="copywrite">{$txtVendorPhoneErr}</td>
</tr>
<tr>
<td class="txt" nowrap title="Vendor email" nowrap><b>Email:</b></td>
<td><input type="text" name="txtVendorEmail" id="txtVendorEmail" value="{$txtVendorEmail}" style="width: 100%"></td>
<td class="copywrite">{$txtVendorEmailErr}</td>
</tr>
</table>
</div>
<div align="center">
<input type="hidden" id="cmd" name="cmd" />
<input type="submit" id="myForm" name="addVendor" title="Add new Vendor" value="Add new Vendor" onclick="$j('#cmd').val($j(this).attr('name'))" />
<input type="submit" id="myForm" name="editVendor" title="Edit Vendor" value="Edit Vendor" onclick="$j('#cmd').val($j(this).attr('name'))" />
<input type="submit" id="myForm" name="delVendor" title="Delete Vendor" value="Delete Vendor" onclick="$j('#cmd').val($j(this).attr('name'));return confirm('Are you sure you wish to delete \''+$j('#txtVendorName').val()+'\'?\n\nThis will remove all users and resource object\npermissions associated with this vendor')" />
</div>
</fieldset>
</form>
<!-- end manage Vendor template -->