Humanitarian Open Source Software Development: Student K MySQL Source Code

[article] [edit page] [discussion] [history]

From Humanitarian-FOSS Project Development Site

(Difference between revisions)
(New page: [http://storage1.cs.trincoll.edu/vm_dev/jdamon/sahana-phase2/www/index.php?mod=hw&act=default Output]<br> [http://starbase.cs.trincoll.edu/~jdamon/mysql/ Documentation] =Source Code= <pre>...)
Current revision (21:25, 14 October 2008) (view source)
 
Line 12: Line 12:
  * @copyright  Copyright {@link http://www.opensource.lk Lanka Software Foundation} 2006
  * @copyright  Copyright {@link http://www.opensource.lk Lanka Software Foundation} 2006
  * @license    http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)  
  * @license    http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)  
-
  * @author    Jonathan Damon <jonathan.damon@trincoll.edu>
+
  * @author    Student K
  *
  *
  */
  */

Current revision

Output
Documentation

Source Code

<?php                             
/* $Id: home.inc,v 1.0 2007/01/31  */
/**
 *
 * Class List

 * @package    Hello_World_Module
 * @copyright  Copyright {@link http://www.opensource.lk Lanka Software Foundation} 2006
 * @license    http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL) 
 * @author     Student K
 *
 */

/** 
 * Retrieve information from the tables.
 * The query joins the 3 tables and selects only the fields I need.
 * After execute the information is stored in $result.
 * Then I break out of php and set up the table header.
 */
global $global;
$db=$global['db'];
$q = "select members.name, email, members.school, state, role, teams.name from members, teams, schools where members.team = teams.number and members.school = schools.name";
$result=$db->Execute($q);
?>
 <div id="home">
       <h2><?=_("Class List")?></h2>
       <table width="100%">
        <thead>
         <td><?=_("Member")?></td>
         <td><?=_("Email")?></td>
         <td><?=_("School")?></td>
         <td><?=_("State")?></td>
         <td><?=_("Role")?></td>
         <td><?=_("Team Name")?></td>
         </thead>
        <tbody>
<?php

/** 
 * Now I loop through result and pull out my fields.
 * Each time through, I break out of php, put the data in the table,
 * and enter php to advance $result at the end of the loop.
 * The end tags close the table.
 */
while(!$result==NULL && !$result->EOF){     
?>       
	 <tr>
          <td><?php echo $result->fields[0]?></td>
          <td><?php echo $result->fields[1]?></td>
          <td><?php echo $result->fields[2]?></td>
          <td><?php echo $result->fields[3]?></td>
          <td><?php echo $result->fields[4]?></td>
          <td><?php echo $result->fields[5]?></td>
         </tr>
<?php	
        $result->MoveNext();
    }   

?>

</tbody>
       </table>
     </div>
     <br />

Personal tools