<?php
   if (!isset($CFG->attendance_dynsection)) {
       $CFG->attendance_dynsection = '';
   }
   if (!isset($CFG->attendance_default_hours)) {
       $CFG->attendance_default_hours = '';
   }
   if (!isset($CFG->attendance_tardies_per_absence)) {
       $CFG->attendance_tardies_per_absence = '';
   }
   if (!isset($CFG->attendance_hours_in_full_report)) {
       $CFG->attendance_hours_in_full_report = '';
   }
   if (!isset($CFG->attendance_default_student_status)) {
       $CFG->attendance_default_student_status = '';
   }
   if (!isset($CFG->attendance_autoattend)) {
       $CFG->attendance_autoattend = '';
   }
   if (!isset($CFG->attendance_grade)) {
       $CFG->attendance_grade = '';
   }
   if (!isset($CFG->attendance_maxgrade)) {
       $CFG->attendance_maxgrade = '';
   }
?>
<form method="post" action="module.php" name="form">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">

<table cellpadding=9 cellspacing=0 >
<tr valign=top>
	<td align=right>attendance_dynsection:</td>
	<td>
		<?php  $optds[0] = "No";$optds[1] = "Yes";
		choose_from_menu($optds, "attendance_dynsection", $CFG->attendance_dynsection, ""); ?>
  </td>
    <td>
		<?php  p(get_string("defaultdynamicsection","attendance")) ?>
	</td>
</tr>

<tr valign=top>
	<td align=right>attendance_default_hours:</td>
	<td>
		<?php  for ($i=1;$i<=24;$i++){ $opt[$i] = $i; }
		choose_from_menu($opt, "attendance_default_hours", $CFG->attendance_default_hours, ""); ?>
    </td>
    <td>
    	<?php p(get_string("defaulthoursinclass","attendance")) ?>
    </td>
</tr>

<tr valign=top>
	<td align=right>attendance_tardies_per_absence:</td>
	<td>
		<?php  for ($i=1;$i<=24;$i++){ $opt2[$i] = $i; }
		choose_from_menu($opt2, "attendance_tardies_per_absence", $CFG->attendance_tardies_per_absence, "none","","0"); ?>
    </td>
    <td>
    	<?php p(get_string("tardiesperabsence","attendance")) ?>
    </td>
</tr>

<tr valign=top>
	<td align=right>attendance_hours_in_full_report:</td>
	<td>
		<?php  for ($i=10;$i<=24;$i++){ $opt3[$i] = $i; }
		choose_from_menu($opt3, "attendance_hours_in_full_report", $CFG->attendance_tardies_per_absence, ""); ?>
    </td>
    <td>
    	<?php p(get_string("hoursinfullreport","attendance")) ?>
    </td>
</tr>

<tr valign=top>
	<td align=right>attendance_default_student_status:</td>
	<td>
		<?php
      $A = get_string("absentlong","attendance");
      $T = get_string("tardylong","attendance");
      $P = get_string("presentlong","attendance");  

			$r1c=$r2c=$r3c=" ";
	    if ($CFG->attendance_default_student_status == 1) {$r2c="checked";}
	    elseif ($CFG->attendance_default_student_status == 2) {$r3c="checked";}
	    else {$r1c="checked";}
      $radio1="<input type=\"radio\" name=\"attendance_default_student_status\" value=\"0\" ".$r1c." />";
 	    $radio2="<input type=\"radio\" name=\"attendance_default_student_status\" value=\"1\" ".$r2c." />";
      $radio3="<input type=\"radio\" name=\"attendance_default_student_status\" value=\"2\" ".$r3c." />";  	
      echo "<table><tr><td align=\"left\" nowrap class=\"generaltablecell\">".
        $radio1.$P."</td>\n";
      echo "<td align=\"left\" nowrap class=\"generaltablecell\">".
        $radio2.$T."</td>\n";
      echo "<td align=\"left\" nowrap class=\"generaltablecell\">".
        $radio3.$A."</td></tr></table>\n";
?>
    </td>
    <td>
    	<?php p(get_string("defaultstudentstatus","attendance")) ?>
    </td>
</tr>

<tr valign=top>
	<td align=right>attendance_autoattend:</td>
	<td>
		<?php  $optaa[0] = "No";$optaa[1] = "Yes";
		choose_from_menu($optaa, "attendance_autoattend", $CFG->attendance_autoattend, ""); ?>
    </td>
    <td>
		<?php  p(get_string("defaultautoattend","attendance")) ?>
	</td>
</tr>

<tr valign=top>
	<td align=right>attendance_grade:</td>
	<td>
		<?php  $optgr[0] = "No";$optgr[1] = "Yes";
		choose_from_menu($optgr, "attendance_grade", $CFG->attendance_grade, ""); ?>
    </td>
    <td>
		<?php  p(get_string("defaultgrade","attendance")) ?>
	</td>
</tr>

<tr valign=top>
	<td align=right>attendance_maxgrade:</td>
	<td>
		<?php  for ($i=0;$i<=100;$i++){ $opt4[$i] = $i; }
		choose_from_menu($opt4, "attendance_maxgrade", $CFG->attendance_maxgrade, ""); ?>
    </td>
    <td>
    	<?php p(get_string("defaultmaxgrade","attendance")) ?>
    </td>
</tr>


<tr>
    <td colspan=3 align=center>
	<input type="submit" value="<?php print_string("savechanges") ?>" /></td>
</tr>
</table>

</form>
