Location: PHPKode > projects > Meeting Request Scheduling and Booking System > mrsbs/php/admin/locations.php
<?PHP

   // Locations list 
   //
   // Version: $Revision: 1.2 $
   // Date: $Date: 2007/09/17 03:16:40 $
   //
   // Copyright (c) 2006 - 2007 Benjamin Oshrin
   // License restrictions apply, see LICENSE for details.
   
$auth_required = 1;
include "../lib/mrsbs.inc";
$pgtitle = $tx['lc.locs.edit'];
$pgtype = "admin";
if(!authorize("admin", "locations", -1))
  mexit($tx['op.err.perm'], 1);
?>
<HTML>
<HEAD>
<TITLE><?PHP print $pgtitle;?></TITLE>
</HEAD>

<BODY>
<TABLE CLASS="main">
 <?PHP include "../lib/titlebar.php";?>
 <TR>
  <TD CLASS="main">
   <TABLE CLASS="form">
    <TR>
     <TD CLASS="infofield">
      <?PHP
       $locs = get_locations();

       if($locs)
       {
	 // Build list of locations to be rendered

	 $l = array();
	 $l['column']['count'] = 3;
	 $l['column'][0]['title'] = $tx['lc.lcid'];
	 $l['column'][0]['sortable'] = 'A';
	 $l['column'][1]['title'] = $tx['lc.desc'];
	 $l['column'][1]['sortable'] = 'A';
	 $l['column'][2]['title'] = $tx['lc.capacity'];
	 $l['column'][2]['sortable'] = 'A';
	 $l['row']['count'] = $locs['count'];

         for($i = 0;$i < $locs['count'];$i++)
	 {
	   $l['row'][$i][0]['value'] = $locs[$i]['locationid'];
	   $l['row'][$i][0]['sortval'] = $locs[$i]['locationid'];
	   
	   $l['row'][$i][1]['value'] = '<A HREF="location.php?locationid=' .
	     $locs[$i]['locationid'] . '">' . $locs[$i]['description'] . '</A>';
	   $l['row'][$i][1]['sortval'] = $locs[$i]['description'];
	   
	   $l['row'][$i][2]['value'] = $locs[$i]['capacity'];
	   $l['row'][$i][2]['sortval'] = $locs[$i]['capacity'];
	 }

	 // Prep standard values to render the list

	 $sortkey = 1;
	 $sortorder = 'asc';
	 $showpage = 1;
	 $perpage = -1;

	 if(isset($rvar_sortkey) && $rvar_sortkey > -1)
	 {
	   $sortkey = $rvar_sortkey;
	   $sortorder = $rvar_sortorder;
	 }
	 
	 if(isset($rvar_showpage) && $rvar_showpage > -1)
	   $showpage = $rvar_showpage;

	 if(isset($rvar_perpage) && $rvar_perpage > -1)
	   $perpage = $rvar_perpage;

	 render_list($l, $tx['lc.locs.none'], $sortkey, $sortorder, $showpage,
		     $perpage);
        }
      ?>

      <P>
      <A HREF="location.php?locationid=new">[+]
       <?PHP print $tx['lc.loc.new'];?></A>
      </P>
     </TD>
    </TR>
   </TABLE>
  </TD>
 </TR>
</TABLE>
</BODY>
</HTML>
Return current item: Meeting Request Scheduling and Booking System