
<body background="i.jpg">
<?php include("../../include/dbconnect.php");


// Get all _POST VALUES HERE..

  foreach($_POST as $p=>$t)
  {
     $_POST[$p] = trim($t);
  }

  $myArea = $_POST['Area'];
?>

<title>Daily Transaction</title>
<body background=blater01.gif  topmargin=0>
<center>
<table cellpadding=0 cellspacing=4 width=590>
<tr>
<td style="padding:3px;" colspan=2 bgcolor="#93BEE2"><font face="Verdana, Arial, Helvetica, sans-serif"><b><b>Select Area and Branches</b></font></td>
</tr><tr valign="top"><td colspan=2>
<font >&nbsp;</font>
</td>
</tr>
</table>
<table border=0 cellpadding=3 cellspacing=4 width="590">
       

      <tr > 
        <td width="139" height="31" align="right" ><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Area
          &nbsp;</font></b></font></td><td>

<?

// Pull all the data from Area master & populate it

$stQuery = mysql_query("select areacode,location from area order by location");

?>
  <form name='myForm01' method='POST' action='<?=$_SERVER[PHP_SELF]?>'>
  <SELECT name='Area' onChange="javascript:submit();">

<?
     echo "<option selected value=\" 0\"> Select Area";
    while($row = mysql_fetch_row($stQuery))
    {


        if(isset($myArea) && eregi("$myArea",$row[0]))
	    {
            echo "<option selected value=\"$row[0]\">$row[1]";
        }
        else{
            echo "<option value=\"$row[0]\">$row[1]";
        }
    }
?>
        </SELECT>
</td></tr>
</form>


      <tr > 
        <td width="139" height="31" align="right" ><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font color="#003366">Customer
          &nbsp;</font></b></font></td><td>
<?

// Pull all Customers from Customer  based on Selected Area id and populate it.


    $sBuyQuery = mysql_query("SELECT distinct bcode,name FROM buy WHERE (areacode ='$myArea') and buyertype = 'EXPORT'  order by name ");


// This form contain a hidden field AreaID which can be later used in next  page..
?>

  <form name='myForm02' method='POST' action='view_sup.php' >
  <input type="hidden" name="Area1" value=<?echo($myArea);?>>
  <SELECT name=bcode  size="5" >

<?
     while($row1 = mysql_fetch_row($sBuyQuery))
    {
         echo "<option value=\"$row1[0]\">$row1[1]";
    }

?>
  </SELECT>

</td></tr>

<tr > 
  <td width="139" height="31" align="right" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Company 
    &nbsp;</b></font></td><td>

<select name=compcode>
<?php $query=" select compcode,name from company  order by name";
      $query=stripslashes($query);
      $result=mysql_query($query) or
      die( mysql_error() );
      while ( $row= mysql_fetch_row($result))
      {
          echo "<option value='$row[0]'>";
          echo ($row[1]);
	  echo "\n";	  
      }
?>
</select>  
</td></tr>


<table cellpading=0 cellspacing=10 width= 50>
<tr><td>
 <blockquote>  <input type =submit name="submit" value = "Submit"></td></blockquote>
</table>
</table>
<br><br><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><center><a href="/wilson/prgmas/buyer/index.html">Add New Buyer</center></font>
<br><br><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><center><a href="/wilson/prgmas/terms/index.html">Add New Standard Term</center></font>

<br><br><font size=1><center><a href="../../index.html">Return to Index page</center></font>
</body>
</form>
