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

   // Select potential windows
   //
   // Version: $Revision: 1.4 $
   // Date: $Date: 2008/06/22 16:47:26 $
   //
   // Copyright (c) 2006 Benjamin Oshrin
   // License restrictions apply, see LICENSE for details.

$auth_required = 1;
include "../lib/mrsbs.inc";
$pgtitle = $tx['when.edit'];
$pgtype = "schedule";

if(!authorize("schedule", "when", $rvar_mtgid))
  mexit($tx['op.err.perm'], 1);
$mtg = get_meeting_info($rvar_mtgid);
if(!$mtg)
  mexit($tx['op.err.nomtg'], 1);

if(isset($rvar_next))
  $nexturi = $rvar_next;
else
  $nexturi = "when2.php?mtgid=" . $rvar_mtgid;
?>
<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="formheader">
      <?PHP print $tx['sd.mtgid'] . ' <A HREF="review.php?mtgid=' .
        hstr($rvar_mtgid) . '">' . hstr($rvar_mtgid) . "</A>";?>
     </TD>
    </TR>
    <FORM NAME="whennew" ACTION="schedule-op-handler.php" METHOD="post">
    <INPUT TYPE="hidden" NAME="op" VALUE="whennew">
    <INPUT TYPE="hidden" NAME="mtgid" VALUE="<?PHP print hstr($rvar_mtgid);?>">
    <INPUT TYPE="hidden" NAME="return" VALUE="when.php?mtgid=<?PHP print hstr($rvar_mtgid);?>">
    <TR>
     <TD CLASS="formheader2">
      <?PHP print $tx['sd.time.new'];?><BR>
      <FONT CLASS="note"><?PHP print $tx['sd.time.new.desc'];?></FONT>
     </TD>
    </TR>
    <TR>
     <TD CLASS="formfield2">
      <?PHP
       // From time
       
       if(isset($rvar_mf))
       {
         $cal_time = array();
	 $cal_time['mday'] = $rvar_df;
	 $cal_time['mon'] = $rvar_mf;
	 $cal_time['year'] = $rvar_yf;
	 $cal_time['hours'] = $rvar_hf;
	 $cal_time['minutes'] = $rvar_nf;
       }
       else
         $cal_time = getdate();

       print $tx['sd.from'];
       $cal_suf = "f";
       include "../lib/calendar.php";

       // Until time
       
       if(isset($rvar_mu))
       {
         $cal_time = array();
	 $cal_time['mday'] = $rvar_du;
	 $cal_time['mon'] = $rvar_mu;
	 $cal_time['year'] = $rvar_yu;
	 $cal_time['hours'] = $rvar_hu;
	 $cal_time['minutes'] = $rvar_nu;
       }
       else
         $cal_time = getdate();
	 
       print " " . $tx['sd.until'];
       $cal_suf = "u";
       include "../lib/calendar.php";
      ?>
      <BR />
      <FONT CLASS="note"><?PHP print $tx['op.add.desc.when'];?></FONT>
      <BR />
      <INPUT TYPE="submit" VALUE="<?PHP print $tx['op.add'];?>">
     </TD>
    </TR>
    </FORM>
    <?PHP
	 if($mtg['windows']['count'] > 0)
	   print '
    <FORM NAME="when" ACTION="schedule-op-handler.php" METHOD="post">
    <INPUT TYPE="hidden" NAME="op" VALUE="when">
    <INPUT TYPE="hidden" NAME="mtgid" VALUE="' . hstr($rvar_mtgid) . '">
    <INPUT TYPE="hidden" NAME="return" VALUE="when.php?mtgid=' . hstr($rvar_mtgid) . '">
    <TR>
     <TD CLASS="formheader2">
      ' . $tx['sd.times'] . '<BR>
      <FONT CLASS="note">' . $tx['sd.times.desc'] . '</FONT>
     </TD>
    </TR>
    <TR>
     <TD CLASS="formfield2">
      <TABLE>
       <TR>
        <TD CLASS="formheader">' . $tx['sd.pref'] . '</TD>
        <TD CLASS="formheader">' . $tx['sd.from'] . '</TD>
        <TD CLASS="formheader">' . $tx['sd.until'] . '</TD>
        <TD CLASS="formheader">' . $tx['op.remove'] . '</TD>
       </TR>
       ';

        for($i = 0;$i < $mtg['windows']['count'];$i++)
	{
	  print '
       <TR>
        <INPUT TYPE="hidden" NAME="windowid[]"
	 VALUE="' . $mtg['windows'][$i]['windowid'] . '">
        <INPUT TYPE="hidden" NAME="curpref[]"
	 VALUE="' . $mtg['windows'][$i]['pref'] . '">
        <INPUT TYPE="hidden" NAME="curfrom[]"
	 VALUE="' . $mtg['windows'][$i]['begin'] . '">
        <INPUT TYPE="hidden" NAME="curuntil[]"
	 VALUE="' . $mtg['windows'][$i]['end'] . '">
	<TD CLASS="formfield">
	 <SELECT NAME="pref[]">
	 ';

	  for($j = 1;$j <= $mtg['windows']['count'];$j++)
	    print "<OPTION" .
	     ($j == $mtg['windows'][$i]['pref'] ? " SELECTED" : "") .
	     ">" . $j . "</OPTION>\n";

	  print '
	 </SELECT>
        </TD>
	<TD CLASS="formfield">
	  ';

	  $cal_time = getdate($mtg['windows'][$i]['begin']);
	  $cal_suf = "f[]";
	  include "../lib/calendar.php";

	  print '
        </TD>
	<TD CLASS="formfield">
	  ';

	  $cal_time = getdate($mtg['windows'][$i]['end']);
	  $cal_suf = "u[]";
	  include "../lib/calendar.php";

	  print '
	</TD>
	<TD CLASS="formfield">
	 <INPUT TYPE="checkbox" NAME="remove[]" VALUE="' .
	  $mtg['windows'][$i]['windowid'] . '">
	</TD>
       </TR>';
       }

       if($mtg['windows']['count'] > 0)
         print '
      </TABLE>
      <BR />
      <FONT CLASS="note">' . $tx['op.update.desc.when'] . '</FONT>
      <BR />
      <INPUT TYPE="submit" VALUE="' . $tx['op.update'] . '">
      </FORM>
     </TD>
    </TR>
       ';
       ?>
    <TR>
     <TD CLASS="formfield2">
     <FORM NAME="whenc" ACTION="schedule-op-handler.php" METHOD="get">
     <INPUT TYPE="hidden" NAME="op" VALUE="null">
     <INPUT TYPE="hidden" NAME="mtgid" VALUE="<?PHP print hstr($rvar_mtgid);?>">
     <INPUT TYPE="hidden" NAME="return" VALUE="<?PHP print hstr($nexturi);?>">
     <FONT CLASS="note"><?PHP print $tx['op.continue.desc.when'];?></FONT>
     <BR />
     <INPUT TYPE="submit" VALUE="<?PHP print $tx['op.continue'];?>">
     </FORM>
     </TD>
    </TR>
   </TABLE>
  </TD>
 </TR>
</TABLE>
</BODY>
</HTML>
Return current item: Meeting Request Scheduling and Booking System