Created new ward directory viewing application.
authorAlan Jack Pippin <ajp@pippin.(none)>
Fri, 10 Feb 2006 03:46:00 +0000 (20:46 -0700)
committerAlan J. Pippin <ajp@pippins.net>
Fri, 10 Feb 2006 03:46:00 +0000 (20:46 -0700)
inc/class.eq.inc.php
templates/default/dir_view.tpl

index 8f62c1bb89068af5648d85407d2e2a16d3389ce0..f3d124f5db390ef4aeeabe07408c6d1e9e838ca4 100644 (file)
@@ -1727,9 +1727,35 @@ class eq
 
   function dir_view()
     {
-      $this->t->set_file(array('form' => 'dir_view.tpl'));
+      $this->t->set_file(array('dir_view_t' => 'dir_view.tpl'));
+      $this->t->set_block('dir_view_t','dir_list','list');
       
-      $this->t->pfp('out','form');
+      $sql = "SELECT * FROM eq_parent where valid=1 ORDER BY name ASC";
+      $this->db->query($sql,__LINE__,__FILE__);
+      $i=0;
+      while ($this->db->next_record())
+       {
+         $parent[$i]['id'] = $this->db->f('parent');
+         $parent[$i]['name'] = $this->db->f('name');
+         $parent[$i]['phone'] = $this->db->f('phone');
+         $parent[$i]['address'] = $this->db->f('address');
+         $i++;
+       }   
+      
+      for ($i=0; $i < count($parent); $i++) 
+      {
+        $name = $parent[$i]['name'];
+       $phone = $parent[$i]['phone'];
+       $address = $parent[$i]['address'];
+       $this->t->set_var('name', $name);
+       $this->t->set_var('address', $address);
+       $this->t->set_var('phone', $phone);
+        $tr_color = $this->nextmatchs->alternate_row_color($tr_color);
+        $this->t->set_var('tr_color',$tr_color);
+       $this->t->fp('list','dir_list',True);
+       //print "$phone $name $address<br>";
+      }
+      $this->t->pfp('out','dir_view_t');
       $this->save_sessiondata();   
     }
   
index ac4cb50b92e657cc62b5f7282644c06d1d3e216a..99b15435931535572a207cc490b63f5d4e96af05 100644 (file)
@@ -1,14 +1,24 @@
 <center>
-       <form action="{actionurl}" method="POST">
        <table border="0" width="80%" cellspacing="2" cellpadding="2">
-               <tr>
-                       <td align="center" bgcolor="#c9c9c9"><font face="{font}"><b>Online Ward Directory</b></font></td>
-               </tr>
+       <tr>
+         <td align="center" bgcolor="#c9c9c9"><font face="{font}"><b>Online Ward Directory</b></font></td>
+       </tr>
        </table>
-       <br><br>
-       <table border="0" width="{total_width}" cellspacing="2" cellpadding="2">
-       <tr bgcolor="#c9c9c9">
+       <br>
+       <table border="0" width=100% cellspacing="2" cellpadding="2">
+       <tr>
+         <td colspan="1" align="center" bgcolor="#c9c9c9"><font face="{font}"><b>Phone</b></font></td>
+         <td colspan="1" align="center" bgcolor="#c9c9c9"><font face="{font}"><b>Name</b></font></td>
+         <td colspan="1" align="center" bgcolor="#c9c9c9"><font face="{font}"><b>Address</b></font></td>
        </tr>
 
+<!-- BEGIN dir_list -->
+       <tr bgcolor="{tr_color}">
+          <td align="center" width=15%><font face="{font}">{phone}</font></td>
+          <td align="left" width=20%><font face="{font}">{name}</font></td>
+          <td align="left" width=65%><font face="{font}">{address}</font></td>
+        </tr>
+<!-- END dir_list -->
+
        </table>
 </center>