Advertisement
tjromano

process 2

Sep 23rd, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.76 KB | None | 0 0
  1. <?php
  2. require_once('header.php');
  3. ?>
  4.  
  5. <?php if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form
  6. ?>
  7. <div id="content">
  8. <h2>Leads List Reports</h2>
  9.         <table width="276" border="0" cellpadding="0">
  10.   <form method="post" action="<?php $_SERVER['PHP_SELF'];?>">
  11.   <tr>
  12.     <td width="139">&nbsp;</td>
  13.     <td width="131">&nbsp;</td>
  14.   </tr>
  15.   <tr>
  16.     <td>Enter Start Date:</td>
  17.     <td><input name="date1" type="text" id="date1" size="10"/></td>
  18.   </tr>
  19.   <tr>
  20.     <td>Enter End Date:</td>
  21.     <td><input name="date2" type="text" id="date2" size="10"/></td>
  22.   </tr>
  23.      <td>&nbsp;</td>
  24.     <td><input type="submit" value="Submit" name="submit" /></td>
  25.   </tr>
  26. </table>
  27. </form>;
  28.       </div>
  29.     </div>
  30.   </div>
  31. <?php
  32. } else {
  33.    
  34. $date1 = $_POST['date1'];
  35. $date2= $_POST['date2'];
  36.  
  37. mysql_select_db("leads", $con);
  38. $sql = "SELECT * from `leads` WHERE (`sub_date` BETWEEN '$date1' AND '$date2')";
  39.  
  40. $result = mysql_query($sql);
  41.  
  42. $num=mysql_numrows($result);
  43. }?>
  44. <div id="content">
  45.         <h1>Leads List</h1>
  46.     <tr valign="baseline">
  47.     <td>
  48.  
  49.     </td></tr>
  50. <table border="1" cellspacing="2" cellpadding="2">
  51. <tr>
  52. <th><font face="Arial, Helvetica, sans-serif">Submission<br />Date</font></th>
  53. <th><font face="Arial, Helvetica, sans-serif">Name</font></th>
  54. <th><font face="Arial, Helvetica, sans-serif">Email</font></th>
  55. <th><font face="Arial, Helvetica, sans-serif">Phone</font></th>
  56. <th><font face="Arial, Helvetica, sans-serif">Loan Type</font></th>
  57. <th><font face="Arial, Helvetica, sans-serif">How Long</font></th>
  58. <th><font face="Arial, Helvetica, sans-serif">First<br />Time</font></th>
  59. <th><font face="Arial, Helvetica, sans-serif">Veteran</font></th>
  60. <th><font face="Arial, Helvetica, sans-serif">Property<br />Zip Code</font></th>
  61. <th><font face="Arial, Helvetica, sans-serif">Property<br />Type</font></th>
  62. <th><font face="Arial, Helvetica, sans-serif">Property<br />Use</font></th>
  63. <th><font face="Arial, Helvetica, sans-serif">When</font></th>
  64. <th><font face="Arial, Helvetica, sans-serif">Afford</font></th>
  65. <th><font face="Arial, Helvetica, sans-serif">Saved</font></th>
  66. <th><font face="Arial, Helvetica, sans-serif">Income</font></th>
  67. <th><font face="Arial, Helvetica, sans-serif">Credit<br />Score</font></th>
  68. <th><font face="Arial, Helvetica, sans-serif">On Time</font></th>
  69. <th><font face="Arial, Helvetica, sans-serif">Bank-<br />ruptcies</font></th>
  70. <th><font face="Arial, Helvetica, sans-serif">Fore-<br />closures</font></th>
  71. <th><font face="Arial, Helvetica, sans-serif">Judg-<br />ments</font></th>
  72. </tr>
  73. <?php
  74. while($row = mysql_fetch_array($result)) {
  75. ?>
  76. <tr>
  77.         <td width="150" align="center"><font face="Arial, Helvetica, sans-serif"><?php echo $row['sub_date'];?></font></td>
  78.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['salutation'];?><?php echo $row['f_name'];?> <?php echo $row['l_name'];?></font></td>
  79.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['email'];?></font></td>
  80.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['phone'];?></font></td>
  81.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['loan_type'];?></font></td>
  82.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['how_long'];?></font></td>
  83.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['first_time'];?></font></td>
  84.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['veteran'];?></font></td>
  85.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['p_zip'];?></font></td>
  86.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['p_type'];?></font></td>
  87.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['p_use'];?></font></td>
  88.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['when'];?></font></td>
  89.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['afford'];?></font></td>
  90.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['saved'];?></font></td>
  91.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['income'];?></font></td>
  92.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['credit_score'];?></font></td>
  93.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['on_time'];?></font></td>
  94.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['bankruptcies'];?></font></td>
  95.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['foreclosures'];?></font></td>
  96.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['judgments'];?></font></td>
  97. </tr>
  98. <?php
  99. }else{  
  100.   echo "Sorry, your search returned with no results";  
  101. }  
  102. ?>
  103. </table>
  104. <?php
  105. require_once('footer.php');
  106. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement