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

   // Simple calendar generation
   //
   //  Set $cal_time to an array of the form returned by getdate()
   //  Set $cal_suf to a string of a suffix for form variables
   //  Set $cal_yp to true to render prior years
   //
   // Version: $Revision: 1.3 $
   // Date: $Date: 2008/06/20 01:51:09 $
   //
   // Copyright (c) 2006 - 2008 Benjamin Oshrin
   // License restrictions apply, see LICENSE for details.

?>
      <SELECT NAME="d<?PHP print $cal_suf;?>">
      <?PHP
       for($_i = 1;$_i <= 31;$_i++)
         print "<OPTION" . ($cal_time['mday']==$_i ? " SELECTED" : "") . ">" .
	  $_i . "</OPTION>\n";
      ?>
      </SELECT>
      <SELECT NAME="m<?PHP print $cal_suf;?>">
      <?PHP
       for($_i = 1;$_i <= 12;$_i++)
         print "<OPTION VALUE=" . $_i .
	  ($cal_time['mon']==$_i ? " SELECTED" : "") . ">" .
	  $tx['mon'][$_i-1] . "</OPTION>\n";
      ?>
      </SELECT>
      <SELECT NAME="y<?PHP print $cal_suf;?>">
      <?PHP
       for($_i = ($cal_yp ? $cal_time['year'] - 5 : $cal_time['year']);
	   $_i <= $cal_time['year'] + 5;
	   $_i++)
	 print "<OPTION" . ($cal_time['year']==$_i ? " SELECTED" : "") . ">" .
	   $_i . "</OPTION>\n";
      ?>
      </SELECT>
      <SELECT NAME="hm<?PHP print $cal_suf;?>">
      <?PHP
       for($_i = 0;$_i < 24;$_i++)
       {
         for($_j = 0;$_j < 60;$_j += $config['schedint'])
	 {
           print '<OPTION VALUE="' . $_i .'-'. $_j . '"' .
	          (($cal_time['hours']==$_i
		    && $cal_time['minutes'] >= $_j
		    && $cal_time['minutes'] < $_j + $config['schedint']) ?
		  " SELECTED" : "") .
		  ">" . render_time($_i, $_j) . "</OPTION>\n";
	 }
       }
      ?>
      </SELECT>

      <?PHP print strftime('%Z', time()); ?>
Return current item: Meeting Request Scheduling and Booking System