<?php
$PageSecurity = 15;
$title = _('Store Types');
if (isset($_POST['SelectedType'])){
	$SelectedType = strtoupper($_POST['SelectedType']);
} elseif (isset($_GET['SelectedType'])){
	$SelectedType = strtoupper($_GET['SelectedType']);
}

if (isset($Errors)) {
	unset($Errors);
}
$Errors = array();

?>
<link rel="stylesheet" href="css/new_mxerp.css">
<div class="body_contain">
<div class="tab_div">
<p align="left">
<a href="index.php?route=storetypenew&modid=<?php  echo $_REQUEST['modid']; ?>&frmid=<?php echo $_REQUEST['frmid']; ?>">
<input type="button" name="Add New Dealer" value="Add New Dealer" class="search"  /></a></p>

<?php  
if (!isset($SelectedType))
{
   	$sql = "SELECT * FROM dbl_dealer  ";
	$result = DB_query($sql,$db);
?>
	<table width="100%" border="1" cellpadding="2" cellspacing="2" class="inborder" style="background:#dce6f2; margin-top:20px;">
	<tr class="row1">
	    <td width="5%" class="tabledata"><strong>S.R.</strong></td>
		<td width="13%" class="tabledata"><strong>Dealer CODE </strong></td>
		<td width="16%" class="tabledata"><strong>Dealer NAME </strong></td>
		<td width="10%" class="tabledata"><strong>Area Name</strong></td>
		<td width="13%" class="tabledata"><strong>Engineer Code</strong></td>
		<td width="13%" class="tabledata"><strong>City </strong></td>
		<td width="13%" class="tabledata"><strong>State </strong></td>
		<td width="11%" class="tabledata"><strong>Country </strong></td>
		<td width="6%" colspan="2" class="tabledata"><strong>Action</strong></td>
		
	</tr><?php
	$i=1; //row colour counter
while ($myrow = DB_fetch_array($result))
 {?>
<tr class="row1">
<td><?php echo $i; ?></td>
<td><?php echo $myrow['dealer_code'];?></td>
<td><?php echo $myrow['dealer_name'];?></td>
<td><?php echo $s->getField('zone_master','id',$myrow['area_code'],'ZoneTitle');?></td>
<td><?php echo $myrow['engineer_code'];?></td>
<td><?php echo $s->getField('city_master','id',$myrow['pre_city'],'city');?></td>
<td><?php echo $s->getField('state_master','id',$myrow['pre_state'],'state');?></td>
<td><?php echo $s->getField('country_master','id',$myrow['pre_country'],'country');?></td>

<td colspan="2"><a href="index.php?route=storetypenew&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&id=<?php echo $myrow['id'];?>&action=Edit"><img src="images/icon-edit.png"  width="10" height="10"/></a>
<a href='index.php?route=storetypenew&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&id=<?php echo $myrow['id'];?>&action=delete' onclick="return confirm('This store will be deleted. Are you sure?')"><img src="images/delete.Gif"  width="10" height="10"/></a></td>
</tr>
<?php
	$i++;}?>
</table>
</div>
</div>


	<?php }
include('includes/footer.inc');
?>