
<link href="css/form.css" type="text/css" rel="stylesheet" media="screen"  />
<html>
<body >

<?
session_start();
include("opendb.php");
include("test.php");

if($sv)
{
if(!checkdate($m1,$d1,$y1))
{
 print "<script>alert('Invalid Inq. Date'); history.back(1);</script>";
 return;
}

if(!checkdate($m2,$d2,$y2))
{
 print "<script>alert('Invalid Nxt Obj. Date'); history.back(1);</script>";
 return;
}

}
?>
<head>
<style>
tr{font-family:arial;font-size:13;}
</style>
<link rel="stylesheet" href="style1.css" type="text/css" />
<center>
<table border="0" cellpadding="2" cellspacing="1" bgcolor='#B0C4DE'>
    <tr>
      <td  height=25  colspan="9" bgcolor="steelblue">
        <p align="center"><B><font color=white>F O L L O W U P &nbsp; L I S T</td>
    </tr>
<tr><td colspan=10 bgcolor=white>
<fieldset><legend>Today</legend>
<table bgcolor='lightsteelblue' cellspacing=1 cellpadding=1 width=100%>
    <tr bgcolor='lightsteelblue'>
            	<td  align=center>SNo</td>
	<td  align=center>Name</td>
	<td  align=center>Inqno</td>

	<td  align=center>Mobile</td>

      	<td  align=center>Vehicle Model</td>
	<td  align=center>Next Obj Date</td>
	<td  align=center>Next objective</td>
	
	<td  align=center>Discussion</td>
	<td  align=center>Action to take</td>
	<td  align=center>Platform</td>
	<td  align=center>Executive</td>

</tr>

	<?php
$dt=date("Y-m-d");
	$empres=mysqli_query($db,"select * from followup where nxtobjdt='$dt' and phead='$user' and done='n'");
$i=1;
 	while($emprow=mysqli_fetch_array($empres))
 	{
 		echo "<tr bgColor='WHITE'>";
      			
			echo "<td>"; echo $i++; echo"</td>";
    			
		$empres2=mysqli_query($db,"select * from prospmaster where pcode='$emprow[prospect]'");
 		
		while($emprow2=mysqli_fetch_array($empres2))
 		{
			echo "<td> $emprow2[pname]</td>";
			echo "<td> $emprow[1]</td>";
			echo "<td> $emprow2[mob]</td>";
			
		}	
		
		$iqres=mysqli_query($db,"select model from inquiry where prospect='$emprow[prospect]'");
 	$iqrow=mysqli_fetch_array($iqres);
			echo "<td>"; echo $iqrow["model"]; echo"</td>";
    			
			echo "<td bgcolor=white> ".datetohtml($emprow[nxtobjdt])."&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["nxtobj"]; echo"&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["discus"]; echo"&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["atake"]; echo"&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["platf"]; echo"&nbsp;</td>";
		
	echo "</tr>";
 	}

	?>		
</tr></td>
</table>

</fieldset>
<?
//***********************************past*******************
?>

<tr><td colspan=10 bgcolor=white>
<fieldset><legend>Past</legend>
<table bgcolor='lightsteelblue' cellspacing=1 cellpadding=1 width=100%>
    <tr bgcolor='lightsteelblue'>
      	<td  align=center>SNo</td>
	<td  align=center>Name</td>
	<td  align=center>Inqno</td>

	<td  align=center>Mobile</td>

      	<td  align=center>Vehicle Model</td>
	<td  align=center>Next Obj Date</td>
	<td  align=center>Next objective</td>
	
	<td  align=center>Discussion</td>
	<td  align=center>Action to take</td>
	<td  align=center>Platform</td>
	<td  align=center>Executive</td>

</tr>

	<?php
$dt=date("Y-m-d");
$sq="select * from followup where nxtobjdt<'$dt' and nxtobjdt!='$dt' and phead='$user' and done='n' order by nxtobjdt";
	$empres=mysqli_query($db,$sq);
$i=1;
 	while($emprow=mysqli_fetch_array($empres))
 	{
 		echo "<tr bgColor='WHITE'>";
      			
			echo "<td>"; echo $i++; echo"</td>";
    			
		$empres2=mysqli_query($db,"select * from prospmaster where pcode='$emprow[prospect]'");
 		
		while($emprow2=mysqli_fetch_array($empres2))
 		{
			echo "<td>$emprow2[pname]</td>";
			echo "<td> $emprow[1]</td>";
			echo "<td> $emprow2[mob]</td>";			
		}	
		
$iqres=mysqli_query($db,"select model from inquiry where prospect='$emprow[prospect]'");
 	$iqrow=mysqli_fetch_array($iqres);
			echo "<td>"; echo $iqrow["model"]; echo"</td>";    			
			echo "<td bgcolor=white> ".datetohtml($emprow[nxtobjdt])."&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["nxtobj"]; echo"&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["discus"]; echo"&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["atake"]; echo"&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["platf"]; echo"&nbsp;</td>";
		
	echo "</tr>";
 	}

	?>		
</tr></td>
</table>
</fieldset>
<?
//***********************************future*******************
?>

<tr><td colspan=10 bgcolor=white>
<fieldset><legend>Future</legend>
<table bgcolor='lightsteelblue' cellspacing=1 cellpadding=1 width=100%>
    <tr bgcolor='lightsteelblue'>
      	<td  align=center>SNo</td>
	<td  align=center>Name</td>
	<td  align=center>Inqno</td>
	<td  align=center>Mobile</td>
      	<td  align=center>Vehicle Model</td>
	<td  align=center>Next Obj Date</td>
	<td  align=center>Next objective</td>
	<td  align=center>Discussion</td>
	<td  align=center>Action to take</td>
	<td  align=center>Platform</td>
	<td  align=center>Executive</td>

</tr>

	<?php
$dt=date("Y-m-d");
	$empres=mysqli_query($db,"select * from followup where nxtobjdt>'$dt' and phead='$user' and done='n' order by nxtobjdt");
$i=1;
 	while($emprow=mysqli_fetch_array($empres))
 	{
 		echo "<tr bgColor='WHITE'>";
      			
			echo "<td>"; echo $i++; echo"</td>";
    			
		$empres2=mysqli_query($db,"select * from prospmaster where pcode='$emprow[prospect]'");
 		
		while($emprow2=mysqli_fetch_array($empres2))
 		{
			echo "<td> $emprow2[pname]</td>";
			echo "<td> $emprow[1]</td>";
			echo "<td> $emprow2[mob]</td>";
			
		}	
		
$iqres=mysqli_query($db,"select model from inquiry where prospect='$emprow[prospect]'");
 	$iqrow=mysqli_fetch_array($iqres);
			echo "<td>"; echo $iqrow["model"]; echo"</td>";    			
			echo "<td bgcolor=white> ".datetohtml($emprow[nxtobjdt])."&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["nxtobj"]; echo"&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["discus"]; echo"&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["atake"]; echo"&nbsp;</td>";
			echo "<td bgcolor=white>"; echo $emprow["platf"]; echo"&nbsp;</td>";
				echo "<td bgcolor=white>"; echo $emprow["platcrite"]; echo"&nbsp;</td>";	
	echo "</tr>";
 	}

	?>		
</tr></td>
</table>

</fieldset>

</TABLE>

	



