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; }
<td align='right'>Retype Password:</td> <td><input name="password2" type="password"/></td> </tr> <tr> <td align=right>Signed Contract:</td> <td> <input name="signed_contract" type="checkbox" <?php echo $signed_contract ? 'checked' : ''; ?> /> </td> </tr> <tr> <td valign="top" align='right'>Availability:</td> <td> <?php availability_matrix(get_student_avail($student_id)); ?> </td> </tr> <tr> <td align='right'>Notes:</td> <td><textarea rows=4 cols=80 name="notes"><?php echo $notes; ?> </textarea></td> </tr> </table> <input type="submit" value="Submit"> </form>