<td><input name="password2" type="password"/></td>
</tr>
<tr>
    <td align=right>Signed Confidentiality Agreement:</td>
    <td>
        <input name="signed_confidentiality" type="checkbox" <?php 
echo $tutor_info['signed_confidentiality'] ? 'checked' : '';
?>
 />
    </td>
</tr>
<tr>
    <td valign="top" align='right'>Availability:</td>
    <td>
    <?php 
availability_matrix(get_tutor_avail($tutor_id));
?>
    </td>
</tr>
<tr>
    <td align='right'>Notes:</td>
    <td><textarea rows=4 cols=80 name="notes"><?php 
echo $tutor_info['notes'];
?>
</textarea></td>
</tr>
</table>
<?php 
question_table("tutor", get_answers(null, $tutor_id));
?>
<input type="submit" value="Submit">
示例#2
0
function get_common_times($tutor_id, $student_id)
{
    global $days, $periods;
    // get times for student
    $student_times = get_student_avail($student_id);
    $student_busy = get_student_busy($student_id);
    // get times for tutor
    $tutor_times = get_tutor_avail($tutor_id);
    $tutor_busy = get_tutor_busy($tutor_id);
    $result = array();
    // compare
    foreach ($days as $day) {
        foreach ($periods as $period) {
            if ($student_times[$day][$period] && $tutor_times[$day][$period] && $tutor_busy[$day][$period] != 1 && $student_busy[$day][$period] != 1) {
                array_push($result, array($day, $period));
            }
        }
    }
    // return common
    return $result;
}