Beispiel #1
0
$tools = $DB->get_recordset_sql($sql);

$data = array();
foreach ($tools as $tool) {
    $line = array();
    $buttons = array();
    $instructor = array();
    $mentorStatus = $tool->mentorapproval;
    $approveStatus = $tool->studentapproval;
    $registratStatus = $tool->registrarapproval;
    $username = get_userdetails($tool->userid);
    $line[] = html_writer::tag('a', $username, array('href' => '' . $CFG->wwwroot . '/local/mentor/student.php?id=' . $tool->userid . '', 'title' => get_string('view_academicdetail', 'local_courseregistration')));
    $line[] = $tool->shortname;
    $line[] = $tool->coursename;
    $instrctor = array();
    $instructor[] = get_classinst($tool->ids);
    $line[] = implode(' ', $instructor[0]);
    $line[] = $tool->semestername;
    if ($mentorStatus == 0 && $registratStatus == 0) {
        $buttons[] = html_writer::link(new moodle_url('/local/courseregistration/mentor.php', array('userid' => $tool->userid, 'classid' => $tool->classid, 'page' => $page, 'current' => $current, 'unapprove' => 1, 'sesskey' => sesskey())), html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/delete'), 'title' => get_string('reject', 'local_courseregistration'), 'alt' => get_string('reject', 'local_courseregistration'), 'class' => 'iconsmall')));
        $buttons[] = html_writer::link(new moodle_url('/local/courseregistration/mentor.php', array('userid' => $tool->userid, 'classid' => $tool->classid, 'page' => $page, 'current' => $current, 'approve' => 1, 'sesskey' => sesskey())), html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/check'), 'title' => get_string('approve', 'local_courseregistration'), 'alt' => get_string('approve', 'local_courseregistration'), 'class' => 'iconsmall')));
    }
    if ($current == "pending") {
        $line[] = implode(' ', $buttons);
    }
    $line[] = get_courseregistrationstatus($approveStatus, $mentorStatus, $registratStatus);
    $data[] = $line;
}

$PAGE->requires->js('/local/courseregistration/js/coursereg_mentor.js');
/* ---View Part starts--- */
Beispiel #2
0
        $str .="Can not Enroll";
    else
        $str .='<a href="' . $CFG->wwwroot . '//local/courseregistration/registration.php?id=' . $list->id . '&semid=' . $semid . '&courseid=' . $cid . '&addenroll=1&sesskey=' . sesskey() . '&schoolid=' . $list->schoolid . '" >  <button value="39543" title="Enroll to class." class="enrollme" type="button" id="enroll"  style="height: 30px;" ><span class="enroll-text">' . get_string('enroll', 'local_cobaltcourses') . '</span></button> </a>';

    $str.='</td></tr></tbody></table></td> </tr>';

    $str .=' <tr>
                 <td valign="top" align="right" style="width:310px;padding-left:20px;">';
    $str .='<table cellpadding="1" border="0">
                      <tbody>
                            <tr id="instucttr">
				<td><b>' . get_string('instructor', 'local_cobaltcourses') . ':&nbsp;</b></td>
				<td>';
                    
    $instructor = array();
    $instructor[] = get_classinst($list->id);

    $str .=implode(' ', $instructor[0]);

    $str .='</td>
		            </tr>
				
                              <tr>
                                  <td style="text-align:right">
                                      <b>' . get_string('date', 'local_courseregistration') . 's:&nbsp;</b>
                                      </td><td>';
    if (empty($list->dates))
        $str .=get_string('not_scheduled', 'local_courseregistration');
    else
        $str .=$list->dates;
    $str .='</td>
Beispiel #3
0
    /**
     * @method view_classes
     * @param int $id ClassID
     * @todo To display the table for classes
     */
    public function view_classes($id) {        
        global $DB, $CFG;
        
        
        //   (SELECT MAX(CONCAT(b.shortname,'/',f.shortname,'/',cls.shortname)) as classroom FROM {local_scheduleclass} cs JOIN {local_classroom} cls ON cls.id=cs.classroomid JOIN {local_floor} f ON f.id=cls.floorid JOIN {local_building} b ON b.id=cls.buildingid WHERE cs.classid = lc.id) AS classroom,
        //     (select Max(concat(FROM_UNIXTIME(lsc.startdate, '%d-%b-%Y'),'&nbsp; - &nbsp;',FROM_UNIXTIME(lsc.enddate, '%d-%b-%Y'))) FROM {local_scheduleclass} as lsc where lsc.classid=lc.id AND lsc.startdate>0 AND enddate>0 ) AS scheduledate,
         //    (select lsc.availableweekdays FROM {local_scheduleclass} as lsc where lsc.classid=lc.id AND lsc.startdate>0 AND enddate>0) as availableweekdays ,
          //s   (select Max(concat(lsc.starttime,'&nbsp;-&nbsp;',lsc.endtime)) FROM {local_scheduleclass} as lsc where lsc.classid=lc.id AND lsc.startdate>0 AND enddate>0 ) AS scheduletime
        $sql = "SELECT lc.*,
             cc.fullname AS coursename,
             ls.fullname AS semestername,ls.id AS semesterid,
             s.fullname AS schoolname,s.id AS schoolid,
             (select oc.fullname from {course} oc where oc.id=lc.onlinecourseid) AS onlinecoursename         

       FROM {local_clclasses} lc JOIN {local_semester} ls 
       ON lc.semesterid=ls.id JOIN {local_school} s 
       ON lc.schoolid=s.id JOIN {local_cobaltcourses} cc 
       ON lc.cobaltcourseid=cc.id where lc.id={$id}";
        $classes = $DB->get_record_sql($sql);


        $table = new html_table();
        $table->align = array('right', 'left', 'right', 'left');
        $table->size = array('15%', '35%', '15%', '35%');
        $table->width = '100%';

        $clas = new html_table_cell();
        $clas->text = $classes->description;
        $clas->colspan = 3;
        $classmode = ($classes->type == 1) ? get_string('clsmode_1', 'local_clclasses') : get_string('clsmode_2', 'local_clclasses');
        $classtype = ($classes->online == 1) ? get_string('online', 'local_clclasses') : get_string('offline', 'local_clclasses');
        $instructor = array();
        $exams = array();
        $evaluations = array();
        $clastype = array();
        $instructor[] = get_classinst($id);
        $exams[] = $this->get_classexams($id);

        $onlineexams = array();
        $onlineexams[] = $this->get_onlineexams($id);
        $evaluations[] = $this->get_evaluations($id);
        $evaluation = implode('', $evaluations[0]);
        $instruct = implode('', $instructor[0]);
        !empty($classes->availableweekdays) ? $classes->scheduledate = $classes->scheduledate . '(' . $classes->availableweekdays . ')' : null;

        $exams = implode(' ', $exams[0]);
        $onlineexams = implode(' ', $onlineexams[0]);
        $table->data[] = array('<b>' . get_string('classesshortname', 'local_clclasses') . '</b>', $classes->shortname, '<b>' . get_string('semestername', 'local_semesters') . ':</b>', $classes->semestername);
        $table->data[] = array('<b>' . get_string('course', 'local_cobaltcourses') . ':</b>', $classes->coursename, '<b>' . get_string('classmode', 'local_clclasses') . ':</b>', $classmode);
        $table->data[] = array('<b>' . get_string('classlimit', 'local_clclasses') . ':</b>', $classes->classlimit, '<b>' . get_string('instructor', 'local_clclasses') . ':</b>', $instruct);
        $clstype[] = '<b>' . get_string('classtype', 'local_cobaltcourses') . ':</b>';
        $clstype[] = $classtype;
        /*
         * ###Bugreport #184- Class details page
         * @author Naveen Kumar<*****@*****.**>
         * (Resolved) If class is offline not showing onlinecoursename replaced with(--)
         */
        $classes->online == 1 ? $clstype[] = '<b>' . get_string('onlinecourse', 'local_clclasses') . ':</b>' : $clstype[] = '--';
        $classes->online == 1 ? $clstype[] = $classes->onlinecoursename : $clstype[] = '--';
        $table->data[] = $clstype;      
        $table->data[] = array('<b>'.  get_string('schoolid', 'local_collegestructure') . ':</b>', $classes->schoolname,'','','');
        $table->data[] = array('<b>' . get_string('exam', 'local_clclasses') . ':</b>', $exams . $onlineexams, '<b>' . get_string('evaluation', 'local_clclasses') . ':</b>', $evaluation);

        $table->data[] = array('<b>' . get_string('description', 'local_clclasses') . ':</b>', $clas);
        $optionrow = new html_table_row();                 
        $optioncell = new html_table_cell(table_multiplescheduled_view($id));
        $optioncell->colspan = 3;
        $optionrow->cells[] ='<b>'.get_string('scheduledinformation','local_clclasses').'</b>';
        $optionrow->cells[] = $optioncell;
           $table->data[] =  $optionrow->cells;

        echo html_writer::table($table);
    }
Beispiel #4
0
//print_object($userclclasses);

$data = array();
foreach ($userclclasses as $userclass) {

    $line = array();
    $buttons = array();
    $instructor = array();
    $mentorStatus = $userclass->mapproval;
    $approveStatus = $userclass->sapproval;
    $registratStatus = $userclass->rapproval;
    $username = get_userdetails($userclass->userid);
    $line[] = $username;
    $line[] = $userclass->shortname;
    $line[] = $userclass->coursename;
    $instructor[] = get_classinst($userclass->id);

    if ($registratStatus == 0) {

        $buttons[] = html_writer::link(new moodle_url('/local/courseregistration/registrar.php', array('userid' => $userclass->userid, 'classid' => $userclass->classid, 'page' => $page, 'current' => 'pending', 'unapprove' => 1, 'sesskey' => sesskey())), html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/delete'), 'title' => get_string('reject', 'local_courseregistration'), 'alt' => get_string('reject', 'local_courseregistration'), 'class' => 'iconsmall')));
        $buttons[] = '&nbsp;';
        $buttons[] = html_writer::link(new moodle_url('/local/courseregistration/registrar.php', array('userid' => $userclass->userid, 'classid' => $userclass->classid, 'page' => $page, 'current' => 'pending', 'approve' => 1, 'sesskey' => sesskey())), html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/check'), 'title' => get_string('approve', 'local_courseregistration'), 'alt' => get_string('approve', 'local_courseregistration'), 'class' => 'iconsmall')));
        // checking for mentor status when registrar status is pending
        // edited by hemalatha c arun
        // checking, is student requesting for adding course or dropping course   
        if ($approveStatus == 1)
            $actionstring = get_string('addd', 'local_adddrop');
        else
            $actionstring = get_string('dropp', 'local_adddrop');

        if ($mentorStatus == 0)
Beispiel #5
0
/**
 * @method get_student_class
 * @todo to get class list of a semester and course, student with status
 * @param int $courseid course id, int $semid semester id,string $status
 * @return-- it print class it
 */
function get_student_class($courseid, $semid, $status) {
    global $CFG, $DB, $USER;
    $str = '';

    $precourses = prerequisite_courses($courseid);
    $equcourses = equivalent_courses($courseid);
    /* Bug report #315  -  Student>Curriculum- Credit Hours
     * @author hemalatha c arun <*****@*****.**>
     * Resolved - overided class crdithours with cobaltcourse credithours
     */

    if (strip_tags($status) == 'Enrolled (Inprogress)') {
        $clsqry = "SELECT luc.id,luc.*, lc.*,lcc.fullname as fname,lcc.shortname as sname, lcc.credithours as credithours FROM {local_cobaltcourses} lcc,
         {local_clclasses} lc,
		 {local_user_clclasses} luc 
		 WHERE lcc.id=lc.cobaltcourseid AND 
		 lc.id=classid AND  
		 lc.semesterid={$semid} AND 
		 lc.cobaltcourseid={$courseid} AND 
		 luc.userid={$USER->id} AND luc.registrarapproval = 1";
    } else {
        $clsqry = "SELECT luc.*,lc.*,lcc.fullname as fname,lcc.shortname as sname, lcc.credithours as credithours FROM {local_cobaltcourses} lcc,
         {local_clclasses} lc,
		 {local_user_clclasses} luc 
		 WHERE lcc.id=lc.cobaltcourseid AND 
		 lc.id=classid AND  
		 
		 lc.cobaltcourseid={$courseid} AND 
		 luc.userid={$USER->id} AND luc.registrarapproval = 1";
    }
    /* Bug report #323  -  Student>Course Registration>Enroll>Reject- Status
     * @author hemalatha c arun <*****@*****.**>
     * Resolved- added valid condition to change the status in course registration page and curriculum page
     */


    if (strip_tags($status) == 'Rejected' || strip_tags($status) == 'Waiting') {
        if (strip_tags($status) == 'Rejected')
            $registrar_status = 2;
        else
            $registrar_status = 0;
        $clases = $DB->get_records_sql($clsqry);
        if (empty($clases)) {
            $clsqry = "SELECT lc.*,lcc.fullname as fname,lcc.shortname as sname, lcc.credithours as credithours,luc.* FROM {local_cobaltcourses} lcc,
         {local_clclasses} lc,
		 {local_course_adddrop} luc 
		 WHERE lcc.id=lc.cobaltcourseid AND 
		 lc.id=classid AND  
		  lc.semesterid={$semid} AND 
		 lc.cobaltcourseid={$courseid} AND 
		 luc.userid={$USER->id} AND luc.registrarapproval= $registrar_status AND luc.registrarapproval = 1";
        }
    }// end of if 
    $clases = $DB->get_records_sql($clsqry);   
    //print_object($clases);
    foreach ($clases as $class) {
        $classtype = $class->online == 1 ? 'Online' : 'Offline';
        if (strip_tags($status) == 'Enrolled (Inprogress)') {
            $enrollcount = $DB->count_records('local_user_clclasses', array('classid' => $class->id, 'semesterid' => $semid, 'registrarapproval' => 1));
            $existingseats = $class->classlimit - $enrollcount;
          //  $schedule = $DB->get_record('local_scheduleclass', array('classid' => $class->id, 'semesterid' => $semid));
        } else {
            $enrollcount = $DB->count_records('local_user_clclasses', array('classid' => $class->id, 'semesterid' => $class->semesterid, 'registrarapproval' => 1));
            $existingseats = $class->classlimit - $enrollcount;
         //   $schedule = $DB->get_record('local_scheduleclass', array('classid' => $class->id, 'semesterid' => $class->semesterid));
        }
        if ($status != 'Completed') {

            if ($class->registrarapproval == 1)
                $status = '<span class="inprogress_color" style="color:green;">Enrolled (Inprogress)</span>';
            elseif ($class->registrarapproval == 2)
                $status = '<span class="notenrolled_color" style="color:red;">Rejected</span>';
            elseif ($class->registrarapproval == 5)
                $status = '<span class="notenrolled_color" style="color:red;">'.get_string('unenolled','local_adddrop').'</span>';
            else {
                if ($class->registrarapproval == 0)
                    $status = '<span class="inprogress_color" style="color:orange;">Waiting</span>';
            }
        }


        $str.='<table id="classenroll" cellspacing="0" cellpadding="3" border="0" style="font-size:12px;border:1px solid #cccccc;line-height:24px">
        <tbody><tr>';
        $str .= '<td align="left" style="font-size:12px;background:#dddddd !important;" colspan="1">
                         <b><span style="color:#0088CC;text-decoration:none;cursor:pointer;">' . $class->shortname . ':&nbsp;</span></b> <b>' . $class->fullname . '</b>
                             <span style="color:#333333;" id="spanhonors"></span> 
             </td>';
        $str .='<td align="right" style="font-size:12px;background:#dddddd !important;">';
        $str .= '</td></tr>';
        //$str .='<table id="inner_curtable" cellspacing="0" cellpadding="0" >
        //            <tbody>
        //<tr>
        //    <td align="left"> </td>
        //    <td align="right"> <span style="font-weight:bold;color:black;">' . strtoupper(get_string('class', 'local_clclasses')) . ':</span><span style="font-weight:bold;margin-right:20px;color:#0088CC;">&nbsp;' . $class->fullname . '</span>';
        //$str .= $status;
        //$str.='</td></tr></tbody></table></td> </tr>';

        $str .=' <tr>
                 <td valign="top" align="right" style="padding-left:20px;">';
        $str .='<table cellpadding="1" border="0">
                      <tbody>
                            <tr id="instucttr">
				<td><b>' . get_string('instructor', 'local_cobaltcourses') . ':&nbsp;</b></td>
				<td>';
        $instructor = array();
        $instructor[] = get_classinst($class->id);
        $str .=implode(' ', $instructor[0]);
        $str .='</td> </tr>
                              <tr id="tr1">
					<td><b>' . get_string('credithours', 'local_cobaltcourses') . ':&nbsp;</b></td>
					<td>' . $class->credithours . '</td>
				    </tr>
				
                                                
                              
                              
                               </tbody></table>';
        $str .='</td>';
                                       

        $str .=' <td valign="top" align="right">
                                            <div>';
                                              $str .= table_multiplescheduled_view( $class->id);

		$str .='</div>
                                        </td>
                                    </tr>';

        $str .=' </tbody></table></br>';
    }
    return $str;
}