}
     }
 case 4:
     if (isset($_REQUEST['q'])) {
         include_once 'tasks.php';
         $obj = new tasks();
         $sort = intval($_REQUEST['q']);
         if ($isadmin == 1) {
             if ($sort == 1) {
                 $obj->sortByDueDate();
             } elseif ($sort == 2) {
                 $obj->sortByPriority();
             }
         } elseif ($isadmin == 0) {
             if ($sort == 1) {
                 $obj->sortByDueDate2($user_id);
             } elseif ($sort == 2) {
                 $obj->sortByPriority2($user_id);
             }
         }
         $row = $obj->fetch();
         $tid = $row['task_id'];
         if ($tid != 0) {
             echo '<div id="divContent">';
             echo '<table id="tableExample" class="reportTable">';
             echo "<tr><th>Task</th><th>Assigned To </th><th>Due Date</th>\n                                <th>Priority</th><th>Task Status </th><th> </th></tr>";
             $i = 0;
             while ($row) {
                 $fn = $row['nurse_fname'];
                 $sn = $row['nurse_sname'];
                 $description = $row['description'];