<?php
session_start();
if($_SESSION['dbName']==""){
header("location:../index.php");
}


include("config.inc.php");
include("Functions_Purchase.php");


$connection = mysql_connect($config['dbServer'],$config['dbUser'],$config['dbPass']) or die("Could not connect to DB");
mysql_select_db($_SESSION['dbName'],$connection) or die("Could not find DB");

$actionmode    = $_GET['actionmode'];
$salesman_code = $_GET['salesman_code'];

if($actionmode == "getSalesmanName")
{
	$query_salesman  = "select Ledger_name from salesmen where Ledger_number = '".$salesman_code."'";
	$result_salesman = mysql_query($query_salesman, $connection);
	$row_salesman    = mysql_fetch_array($result_salesman);
	extract($row_salesman);
	echo $Ledger_name;
	
	
	exit;
}
?>