}
// $sql_lessons = 	"SELECT st.first_name AS student_first_name, st.last_name AS student_last_name, te.first_name, te.last_name, el.tuition_due, el.tuition_paid, el.tuition_owed, el.instrument, el.duration FROM lessons el " .
// 				"JOIN students st ON el.student = st.student_key JOIN teachers te ON el.teacher = te.teacher_key WHERE te.teacher_key = $teacher";
?>



<div class="mainbox col-md-12" >
	
	<!-- <input type="button" class="btn btn-lg btn-primary" onclick="history.back();" value="Back"> -->

	<div id="timesheet" class="table-responsive">  
		<h3>Timesheet</h3>
		<h4>
		<?php 
$temp = get_teacher_name($teacher);
$temp = mysql_fetch_assoc($temp);
echo $temp['first_name'], " ", $temp['last_name'];
?>
</h4>
		<table class="table table-striped">

			<?php 
if ($results = get_teacher_timesheet($teacher)) {
} else {
    echo mysql_error();
    die;
}
$columns = array(1 => "Student", 2 => "Total Lessons", 4 => "Payout Now", 5 => "Total");
$fields = array(1 => "student_name", 2 => "total_lessons_formatted");
$pay_fields = array(1 => "student_first_name", 2 => "student_last_name", 8 => "amount_paid");
         <th><div class="text-center">Semester</div></th>
         <th><div class="text-center">Year</div></th>
         <th><div class="text-center">Instrument</div></th>
         <th><div class="text-center">Number of Lessons</div></th>
         <th><div class="text-center">Tuition Due</div></th>
         <th><div class="text-center">Tuition Paid</div></th>
         <th><div class="text-center">Tuition Owed</div></th>
         ';
 echo '</tr></thead>';
 echo '<tbody>';
 //fill in rows with data
 while ($row = mysql_fetch_assoc($results)) {
     $tmp_student_name = get_student_name($row['student']);
     // call to get student names
     $student_name = mysql_fetch_assoc($tmp_student_name);
     $tmp_teacher_name = get_teacher_name($row['teacher']);
     // call to get teacher names
     $teacher_name = mysql_fetch_assoc($tmp_teacher_name);
     $tmp_payment = get_payment(0, $row['lesson_key']);
     $payment = 0;
     while ($rows = mysql_fetch_assoc($tmp_payment)) {
         $payment = $payment + $rows['amount_paid'];
     }
     $payment_due = $row['tuition_due'] - $payment;
     echo '<tr>
          <td><div class="text-center"><a href="#" onclick="Confirm.render(\'Delete Lesson?\',\'delete_lesson\',\'', $row['lesson_key'], '\')">
          <img class="table-icon" src="./res/image/rm-record.png">
          </a></div></td>
          <td><div class="text-center"><a href="edit-lessons-form.php?lesson=', $row['lesson_key'], '">
          <img class="table-icon" src="./res/image/edit.png"></a></div></td>
          <td><div class="text-center">', $student_name['last_name'], '</div></td>
Example #3
0
<?php

require_once '../model/database.php';
require_once '../model/parents_db.php';
require_once '../model/students_db.php';
require_once '../model/teachers_db.php';
date_default_timezone_set('America/New_York');
$time_zone = date_default_timezone_get();
$formatting = 'Y';
$current_date_object = new DateTime();
$current_date_f = $current_date_object->format($formatting);
if ($_SESSION['type'] == "student") {
    $userName = get_student_name($user);
} else {
    if ($_SESSION['type'] == "teacher") {
        $userName = get_teacher_name($user);
    } else {
        if ($_SESSION['type'] == "parent") {
            $userName = get_parent_name($user);
        } else {
            if ($_SESSION['type'] == "admin") {
                $userName = "******";
            }
        }
    }
}
?>

	<footer>
		<br/><br/>