Advertisement
tjromano

list cars

Aug 27th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.65 KB | None | 0 0
  1. <?php
  2. session_cache_limiter();
  3. session_start();
  4.      
  5. require('config.php');
  6. require('functions.php');
  7.      
  8. //check for administrative rights
  9. if (allow_access(Administrators) != "yes")
  10. {
  11.      include ('no_access.html');
  12.      exit;
  13. }
  14.      
  15. $cars = cars();
  16. adminheader('List Cars');    
  17. ?>
  18.             <div id="content">
  19.                     <h2>Cars List</h2>
  20.             <table border="1" cellspacing="2" cellpadding="2">
  21.         <tr>
  22.         <td><font face="Arial, Helvetica, sans-serif">Year</font></td>
  23.         <td><font face="Arial, Helvetica, sans-serif">Make/Model</font></td>
  24.         <td><font face="Arial, Helvetica, sans-serif">Color</font></td>
  25.         <td><font face="Arial, Helvetica, sans-serif">Plate Number</font></td>
  26.         <td><font face="Arial, Helvetica, sans-serif">Vin Number</font></td>
  27.         <td><font face="Arial, Helvetica, sans-serif">Type</font></td>
  28.         <td><font face="Arial, Helvetica, sans-serif">Active</font></td>
  29.         <td><font face="Arial, Helvetica, sans-serif">Notes</font></td>
  30.         <td><font face="Arial, Helvetica, sans-serif">Edit</font></td>
  31.         </tr>
  32.          
  33.         <?php
  34.         foreach ($cars as $row){
  35.             $num=count($cars);      
  36.             ?>
  37.          
  38.         <tr>
  39.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['car_year'];?></font></td>
  40.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['car_make_model'];?></font></td>
  41.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['car_color'];?></font></td>
  42.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['car_plate'];?></font></td>
  43.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['car_vin'];?></font></td>
  44.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['car_type'];?></font></td>
  45.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['car_active'];?></font></td>
  46.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['car_notes'];?></font></td>
  47.         <td><font face="Arial, Helvetica, sans-serif"><?php echo $row['authoriz_id_auth'];?></font></td>
  48.         <td><font face="Arial, Helvetica, sans-serif"><a href="edit_cars_form.php?id_cars=<?php echo $row['id_cars'];?>">Edit</a></font></td>
  49.         </tr>
  50.        
  51.         <?php
  52.          
  53.         }
  54.         ?>
  55.         </table>
  56.         <?php
  57.         echo "Total Records:  $num";
  58.         ?>
  59.         <form name="add Car" action="add_car_form.php">
  60. <input type="submit" class="button" value="Add A Car"/>
  61. </form>
  62.      
  63.     <!-- end .content --></div>
  64.     <!-- end content-container --></div>
  65. <?php include 'footer.php'; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement