<?php $PageSecurity = 4;
include('includes/session.inc');
include('includes/function_lib.php');
  global $db;
  
?>
<div style="width:800px; overflow:auto">
<h2> <?php  echo  "(".$_REQUEST['type']." wise)"?></h2>

 
<?php $i=1;
 $getdata=DB_query("select * from crm_mst_daily_visit_entry where empid='".$_SESSION['UserID']."'",$db);
if(DB_num_rows($getdata)>0)
{
 while($rowRecord=DB_fetch_array($getdata))
	 {
	 ?>
	 
 
	 <?php 
 $getquery=DB_query("select *  from  crm_daily_visit_entry B ,crm_daily_visit_expense_entry C where B.mst_crm_entryid =C.mst_crm_entryid and B.mst_crm_entryid='".$rowRecord['id']."'",$db);
if(DB_num_rows($getquery)>0)
{

?>
	 <div align="left"><h3>
   Branch Vistied : <?php echo $s->GetFieldValue('empmaster',"mst_www_userid='".$_SESSION['UserID']."'",'emp_site');	 ?> &nbsp;Client:
    <?php 	echo 	$s->GetFieldValue('empmaster',"mst_www_userid='".$_SESSION['UserID']."'",'emp_name');?></h3>   </div>
     <table width="100%" border="0"  cellspacing="1" cellpadding="2">
   <tr> 
   <th>SNo</th>
     <th>Executive Name</th>
     <th>Contact Officer Tel. No.</th>
     <th><center>RESPONSE</center>
			 <table width="100%" border="0">
			  <tr>
				<td>Quote</td>
				<td>Sample</td>
				<td style="white-space:nowrap;">Call Again</td>
			  </tr>
			</table> 	 </th>
			
    <th>New Client</th>
	   <th>Total Expense</th>
	
     <th>Reamrk</th>
  </tr>
  <?php 
 //echo "select *  from  crm_daily_visit_entry B ,crm_daily_visit_expense_entry C where B.mst_crm_entryid =C.mst_crm_entryid and B.mst_crm_entryid='".$rowRecord['id']."'";


	 while($row_lead=DB_fetch_array($getquery))
	 {
	 ?>

    <tr bgcolor="#e3e3e3">
	  <td style="padding-left:10px;"><?php  echo $i++ ?></td>
	     
     <td style="white-space:nowrap; padding-right:10px;"><?php   
	echo  $s->GetFieldValue('clientmaster',"id='".$row_lead['client_id']."'" ,'c_name');
	 ?><?php 	echo 	$s->GetFieldValue('empmaster',"mst_www_userid='".$_SESSION['UserID']."'",'emp_name');?> </td>
	
    <td><?php  echo $row_lead['ClientContact']?></td>
      <td>
	  
	  <table width="100%" border="0">
			  <tr>
				<td><?php  echo ($row_lead['quotes']==1?'Y':'N')?> </td>
				<td><?php  echo ($row_lead['sample']==1?'Y':'N')?> </td>
				<td><?php  echo ($row_lead['callagain']==1?'Y':'N')?>  </td>
			  </tr>
		</table>	  </td>
       
	    <td><?php  echo ($row_lead['newclient']==1?'Y':'')?> </td>
		  <td><?php  echo $row_lead['total_amt']?></td>
	    <td style="white-space:nowrap; padding-right:10px;"><?php  echo $row_lead['remark']?></td>
   </tr>
   <?php }  ?>
</table>
   <?php }  ?>
   <?php }} ?>

</div>