<?php $PageSecurity = 11;
include('includes/session.inc');
//include('includes/header.inc');
include('includes/function_lib.php');

include('includes/SQL_CommonFunctions.inc');
//echo $country;
  global $db;
 
if($_REQUEST['type']=='client')
{
$sid=$s->GetFieldValue('city_master',"id='".$_GET['q']."'" ,'state');
$cid=$s->GetFieldValue('city_master',"id='".$_GET['q']."'" ,'country');
?>	 <table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>
	  <td width="137" align="left">State</td>
    <td width="199" align="left">
        <select name="pre_state" id="pre_state" style="width:150px;" onchange="search_city(this.value)">
          <?php 
	    $sql = "select * from state_master where id = '".$sid."' ";
		$result=DB_query($sql,$db);
		while($myrow=DB_fetch_array($result))
		{ 
			$p='';
			if($myrow['id'] == $_POST['pre_state'])
			$p="selected";
		?>
          <option value="<?php echo $myrow['id'];?>" <?php echo ($row['pre_state']==$myrow['id']?"selected":"") ?>><?php echo $myrow['state']; ?></option>
          <?php }
	   ?>
          </select>
   </td>
     <td width="135" align="left">Country</td>
    <td align="left" >
	 
  <select name="country" id="country" style="width:150px;" >
         <?php 
			$c_sql = "select * from country_master where id='".$cid."'";
			$c_result = DB_query($c_sql,$db);
			while($c_row=DB_fetch_array($c_result))
			{
				$p='';
				if($c_row['id']==$pre_country)
				$p= "selected";
			?>
				<option value="<?php echo $c_row['id']; ?>"<?php echo ($pre_country==$c_row['id']?"selected":"") ?>><?php echo $c_row['country']; ?></option>
	  <?php }
		?>
    </select>		</td>
 
	</tr>
	</table>

	
<?php 

} ?>




	 
	 
	 
	 
	 