<?php ob_start();
$PageSecurity = 4;
$PageName = 'Add Items';
include('includes/DefinePOClass.php');
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/DefineSuppTransClass.php');
include('includes/header.inc');
include('includes/function_lib.php');
//$Sql = "SELECT StockID,it.item_name,it.unit,a.manufacture,a.color,a.grade,a.gsm FROM item_master it JOIN item_specification a ON it.StockID = a.proc_id  GROUP BY it.StockID";
 $Sql = "Select * from accountledger where ledgertype IN('vendor','client','leads')";
$Result = DB_query($Sql,$db,$ErrMsg);
?>

<link rel="stylesheet" href="css/jquery.ui.all.css">
<script src="js/jquery-1.5.1.js"> </script>
<script src="ui/jquery.ui.core.js"> </script>
<script src="ui/jquery.ui.widget.js"></script>



<h2 align="center">ADD Account</h2><br /><br />


<div align="center">
<div style="overflow:auto; width:600px; height:300px">
<form  action="" method="post">
<table width="100%" border="0" cellspacing="3" cellpadding="2" align="center">
  <tr>
        
        <th><strong>Account Name </strong></th>
</tr>
  <?php   
	  $counter = $_REQUEST['rowcount'];
	  $ct = explode("_",$counter);
	  while($myrow =DB_fetch_array($Result))
	  {  
	 // $_SESSION['product_id'] =$myrow['stockid'];
		
		
	  ?>
	  <tr bgcolor="#FFFFFF">
      <td><a href="javascript:loadValue('<?php echo $myrow['AccountsID'];?>,<?php echo $myrow['AccountName'];?>')"><?php echo $myrow['AccountName'];?></a></td>
        
		
		
      </tr>
	  <?php } ?>
<input type="hidden" name="row_count" id="row_count" value="<?php echo $i;?>">
</table></form>
</div></div>

<script>
function loadValue(str,ct)
{

	var spl = str.split(",");
	
	var code = spl[0];
	var name = spl[1];
	
	
	
	
	window.opener.document.getElementById('accountid').value =code ;
	window.opener.document.getElementById('accountname').value = name;
		window.close();
}
</script>
