<?php
/*
OrderSys
Version: 1.7.2
Date: 12 September 2014
Copyright: Santosh Patnaik, MD, PhD
License: GPL 3+
URL: www.bioinformatics.org/phplabware
*/
$table = 'vendor';
// mysql table name
include(realpath(dirname(__FILE__) . '/header.php'));
$date = date("l, F j, Y");
echo '<span style="color:#dcdcdc;">', $log_status;
if(!($all_affect_items == "no") or ($all_affect_items == "no" and $client == "allowed")) {
echo '<a>Add </a><a href="', $site_url, 'index_short.php?function=show_insert_form&table_name=item" onclick="return popitup(\'', $site_url, 'index_short.php?function=show_insert_form&table_name=item\')">item</a> / <a href="', $site_url, 'index_short.php?function=show_insert_form&table_name=vendor" onclick="return popitup(\'', $site_url, 'index_short.php?function=show_insert_form&table_name=vendor\')">vendor</a> || <a href="orders.php">View/adjust past orders</a> / <a href="items.php">items</a> || ';
}
echo '<a href="help/help.htm" onclick="return popitup(\'help/help.htm\')">Help</a> || <a>', $date, '</a></span></p></div><div style="padding-left: 5px;">';
// array of options and values for use with search and sort forms below
$option_value = array('Name'=>'Name', 'Phone'=>'Phone number', 'Fax'=>'Fax number', 'Address'=>'Address', 'website'=>'Website', 'insert_date'=>'Date added', 'update_date'=>'Date modified');
/////////////////////// build DATA table
echo '<table width="750" summary="top" cellpadding="5" cellspacing="1" style="background-color:#efefef; border:0;">';
include(realpath(dirname(__FILE__). '/top_part.php'));
// MAIN form start
echo '<form method="post" action="vendors.php#order">';
// IF START ################################################
if($num_sat > 0) {
//////////////////// ROW for column headings
echo '
<colgroup>
<col valign="top" align="left" style="width:75px;"></col>
<col valign="top" align="left" style="width:180px;"></col>
<col valign="top" align="left"></col>
<col valign="top" align="left"></col>
<col valign="top" align="left"></col>
</colgroup>
<tr style="background-color:#ffffff;" valign="top"><td valign="top" colspan="5"><b>Vendors</b>:</td></tr>
<tr style="background-color:#ffffcc;" valign="top">
<td style="width:100px;" valign="top">Name</td>
<td style="width:180px;" valign="top">Phone and fax</td>
<td valign="top">Address</td>
<td valign="top">Website</td>
<td style="width:180px;" valign="top"></td>
</tr>';
////////////////////// ROWS for data
// start - alternate colors of table rows
// FOR start ============================================================
for($i = 0; $i < $numofrows; $i++) {
$row = database_fetch_array($result);
if($i % 2) {
echo "<tr style=\"background-color:#ffcc99;\" valign=\"top\">";
}
else {
echo "<tr style=\"background-color:#ffcccc;\" valign=\"top\">";
}
// end - alternate colors of table rows
// start - build table rows
echo '<td valign="top">';
if($row['Name'] != '') {
echo htmlspecialchars($row['Name']);
}
echo '</td>';
//---------------------------------------------------
echo '<td valign="top">';
if($row['Phone'] != '') {
echo 'Phone - ', htmlspecialchars($row['Phone']);
}
if($row['Fax'] != '') {
echo '<br />Fax - ', htmlspecialchars($row['Fax']);
}
echo '</td>';
//---------------------------------------------------
echo '<td valign="top">';
if($row['Address'] != '') {
echo htmlspecialchars($row['Address']), '<br />';
}
echo '</td>';
//---------------------------------------------------
echo '<td valign="top">';
if($row['website'] != '') {
echo '<a href="', htmlspecialchars($row['website']), '">Website</a>';
}
echo '</td>';
//---------------------------------------------------
echo '<td valign="top"><span style="color:#736F6E;">';
if($row["insert_date"] != '' and $row["insert_date"] != '0000-00-00') {
echo 'Added ', htmlspecialchars($row["insert_date"]), '<br />';
}
elseif($row["update_date"] != '' and $row["update_date"] != '0000-00-00') {
echo 'Modified ', htmlspecialchars($row["update_date"]), '<br />';
}
// start - edit, detail, copy, delete links
// detail link
echo '<a href="interface_creator/index_short.php?table_name=vendor&function=details&where_field=Vendor_ID&where_value=', rawurlencode($row['Vendor_ID']), '" onclick="return popitup(\'interface_creator/index_short.php?table_name=vendor&function=details&where_field=Vendor_ID&where_value=', rawurlencode($row['Vendor_ID']), '\')">Details</a>';
// edit, copy and delete link
if(!($all_affect_items == "no" and $client == "not_allowed")) {
echo ' | <a href="interface_creator/index_short.php?table_name=vendor&function=edit&where_field=Vendor_ID&where_value=', rawurlencode($row['Vendor_ID']), '" onclick="return popitup(\'interface_creator/index_short.php?table_name=vendor&function=edit&where_field=Vendor_ID&where_value=', rawurlencode($row['Vendor_ID']), '\')"> Modify</a> | <a href="interface_creator/index_short.php?table_name=vendor&function=delete&where_field=Vendor_ID&where_value=', rawurlencode($row['Vendor_ID']), '" onclick="return confipop(\'interface_creator/index_short.php?table_name=vendor&function=delete&where_field=Vendor_ID&where_value=', rawurlencode($row['Vendor_ID']), '\')"> Delete</a> | <a href="interface_creator/index_short.php?table_name=vendor&function=copy&where_field=Vendor_ID&where_value=', rawurlencode($row['Vendor_ID']), '" onclick="return popitup(\'interface_creator/index_short.php?table_name=vendor&function=copy&where_field=Vendor_ID&where_value=', rawurlencode($row['Vendor_ID']), '\')"> Copy</a>';
}
// end - edit, detail, copy, delete links
//---------------------------------------------------
echo '</span></td></tr>';
// end - build table's data rows
}
// FOR END ==================================================================
}
// END if num_sat>0 ################################################
$since_order = '<table width="750" summary="top" cellpadding="5" cellspacing="1" style="background-color:#efefef; border:0;"><tr style="background-color:#ffffff;" valign="top"><td valign="top" colspan="5"><b>Items set for ordering</b>:</td></tr></table>';
include(realpath(dirname(__FILE__) . '/bottom_part.php'));
include(realpath(dirname(__FILE__) . '/footer.php'));