<?php include('opendb.php'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <title>PSN Telcon</title>
    <link type="text/css" href="menu.css" rel="stylesheet" />
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="menu.js"></script>
    <link type="text/css" href="css1/ssdf.css" rel="stylesheet" />
</head>
<body>
<?php include('top.php'); ?>
<CENTER>
<BR>
<FORM ACTION='<?print $PHP_SELF?>' METHOD='POST'>
<table cellspacing=1 cellpadding=1 bgcolor=green>
<tr bgColor='c1d7bb'><td align=center>
<table>
<tr bgColor='c1d7bb'><td colspan=2 align=center>SUPPLIER MASTER</TD></TR>
<tr style={background:yellow}><td>Supplier Name <BR>
 <FONT SIZE=1 color=red>(Non editable)</font></td>
  <td><input type=text name='supname' size=40 onKeyDown=chkey(this); style={color:red} title='As it will create A/c head, it cannot be edited'></td></tr>
<tr bgColor='c1d7bb'><td>Sup Type </td><td><select name='suptype'>
<option>Manufacturer</option>
<option>Dealer</option>
<option>Other</option>
</select>
</td></tr>

<tr bgColor='c1d7bb'><td>Address1 </td><td><input type=text name='addr1' size=40></td></tr>
<tr bgColor='c1d7bb'><td>Address2 </td><td><input type=text name='addr2' size=40></td></tr>
<tr bgColor='c1d7bb'><td>City </td><td><input type=text name='city' size=40></td></tr>
<tr bgColor='c1d7bb'><td>District </td><td><input type=text name='dist' size=40></td></tr>
<tr bgColor='c1d7bb'><td>State </td><td><input type=text name='stat' size=40></td></tr>
<tr bgColor='c1d7bb'><td>Pin No </td><td><input type=text name='pin' size=40></td></tr>
<tr bgColor='c1d7bb'><td>Phone1 </td><td><input type=text name='phone1' size=40></td></tr>
<tr bgColor='c1d7bb'><td>Phone2 </td><td><input type=text name='phone2' size=40></td></tr>
<tr bgColor='c1d7bb'><td>Tin NO </td><td><input type=text name='tin' size=40></td></tr>
<tr bgColor='c1d7bb'><td>CST No & Date </td><td><input type=text name='cst' size=40></td></tr>
<tr bgColor='c1d7bb'><td>Email_id </td><td><input type=text name='email' size=40></td></tr>
<tr bgColor='c1d7bb'><td>Web</td><td><input type=text name='web' size=40></td></tr>
<TR bgColor='c1d7bb'><TD COLSPAN=2 ALIGN=CENTER><INPUT TYPE=SUBMIT NAME= 'submit' VALUE='  SAVE  '></TD></TR>

</table>
</td></tr>
</table>
</FORM>

<?
$result=mysqli_query($db,"select * from sup_master where branch='$brcode' order by supname")or die(mysqli_error($db));
//print "<table cellspacing=1 cellpadding=1 border=1 width=1200>";
//print "<th>No.<th>Name <th>Addr1 <th>Addr 2 <th>City <th>Dist. <th>State <th>Pin <th>Phone1 <th>Phone 2 ";
//print "<th>Tin <th>CST No. <th>Email <th>Web<th>";
$i=1;
while($row=mysqli_fetch_row($result))
{
 print "\n<tr bgColor='c1d7bb' onMouseOver=bgColor='lightsteelblue' onMouseOut=bgColor='c1d7bb'><td>".$i++."</td><td>$row[1]</td><td>$row[2]</td><td>$row[3]</td>";
 print "<td>$row[4]</td><td>$row[5]</td><td>$row[6]</td><td>$row[7]</td><td>$row[8]</td>";
 print "<td>$row[9]</td><td>$row[10]</td><td>$row[11]</td><td>$row[12]</td><td>$row[13]</td>";
 print "\n<td align=center><a href='editsupp_mast.php?code=$row[0]' title='Edit Entry' onMouseOver='window.status=''; return true'><img src='../img/edit.gif' border=0></a></td></tr>";
}
?>
</table>

<?php include('footer.php'); ?>
<script>
function chkey(abc)
{
 yy=abc.value
 if(yy.indexOf('  ')>-1) 
  {
    alert('Multiple space is not allowed');
    abc.value='';
  }
 if(yy.indexOf("'")>-1) 
  {
    alert("\' is not allowed");
    abc.value='';
  }

}
</script>