Example #1
0
        //
        //local_fill_groupid($formdata, $sessions, $sess);
    }
    //   print_object($sessions);
    if (empty($sessions))
        $sessions = 0;
    return $sessions;
}

$context = context_user::instance($USER->id);
$systemcontext = context_system::instance();
// only for student
if (has_capability('local/clclasses:enrollclass', $context) && !is_siteadmin()) {
// function student_semesters($userid, $from = null) {
    require_once($CFG->dirroot . '/local/courseregistration/lib.php');
    $semester = student_semesters($USER->id, 'courseregistration');
    // print_object($semester);
    foreach ($semester as $key => $value) {
        $current_semid = $key;
    }
    if (empty($current_semid))
        print_error(get_string('noactivesem', 'local_timetable'));

    $sessionsinfo = $DB->get_records_sql("select sd.* FROM {local_user_clclasses} as cl
                       JOIN {local_scheduleclass} as sd ON sd.classid= cl.classid and sd.visible=1
                       WHERE cl.semesterid=$current_semid and cl.userid=$USER->id  and from_unixtime('%Y',sd.startdate) > 2014 and sd.visible=1   ");
}
// only for registrar
else if (has_capability('local/collegestructure:manage', $systemcontext) && !is_siteadmin()) {
    $hier = new hierarchy();
    $schoolist = $hier->get_assignedschools();
Example #2
0
 public function get_userdetails_accounts($userid)
 {
     global $DB, $OUTPUT;
     $hierarchy = new hierarchy();
     $requests = new requests();
     $help_desk_lib = new user_filtering_accounts();
     $user = $DB->get_record('user', array('id' => $userid));
     $local_user = $DB->get_record('local_users', array('userid' => $userid));
     $local_user_data = $DB->get_record('local_userdata', array('userid' => $userid));
     $fullname = $user->firstname . ' ' . $user->lastname;
     $out = '<div class="userprofilebox clearfix"><div class="profilepicture">';
     $out .= $OUTPUT->user_picture($user, array('size' => 50));
     $out .= '</div>';
     $table = new html_table();
     $table->id = 'accounts_viewmore';
     $table->size = array('20%', '80%');
     $table->align = array('right', 'left');
     $get_alldepartments = $hierarchy->get_alldepartments($user->id);
     $get_allmyactivesemester = $hierarchy->get_allmyactivesemester($user->id);
     $student_semesters = student_semesters($user->id);
     //School with department
     if ($school = $requests->school($user->id)) {
         foreach ($school as $schools) {
             $schoolid = $schools->id;
             $schoolname = $schools->fullname;
             $s1[] = $schoolname;
             $programs = $requests->program($schoolid, $user->id);
             foreach ($programs as $program) {
                 $proid = $program->id;
                 $p[] = $DB->get_field('local_program', 'fullname', array('id' => $proid));
                 if ($serviceid = $requests->service($schoolid, $proid, $user->id)) {
                     $s3[] = $serviceid->serviceid;
                 }
             }
         }
         if ($s1) {
             $s2 = implode(',&nbsp;', $s1);
             $myschools = "<p><b>School: </b>" . $s2 . "</p>";
         }
         if ($p) {
             $pro = implode('&nbsp;', $p);
             $myschools .= "<span style='margin-left: 6%;'><b>Program: </b>" . $pro . "</span>";
         }
     }
     //End of school
     print_object($help_desk_lib->user_enrolled_courses($userid));
     $table->data = array(array(get_string('username'), $user->username), array(get_string('fullname'), $fullname), array(get_string('firstname'), $user->firstname), array(get_string('lastname'), $user->lastname), array(get_string('email'), $user->email), array(get_string('phone'), $user->phone1), array(get_string('phone2'), $user->phone2), array(get_string('dob', 'local_admission'), date('Y-m-d', $local_user->dob)), array(get_string('doj', 'local_users'), date('Y-m-d', $local_user->timecreated)), array(get_string('genderheading', 'local_admission'), $local_user->gender), array(get_string('serviceid', 'local_users'), implode(',&nbsp;', $s3)), array(get_string('idnumber'), $user->idnumber), array(get_string('hschool', 'local_users'), $local_user->primaryschoolname), array(get_string('primaryyear', 'local_admission'), $local_user->primaryyear), array(get_string('score', 'local_admission'), $local_user->primaryscore), array(get_string('pcountry', 'local_admission'), $local_user->primaryplace), array(get_string('contactname', 'local_admission'), $local_user->fathername), array(get_string('hno', 'local_admission'), $local_user->currenthno), array(get_string('pob', 'local_admission'), $local_user->pob), array(get_string('city'), $local_user->region), array(get_string('state'), $local_user->state), array(get_string('icqnumber'), $user->icq), array(get_string('skypeid'), $user->skype), array(get_string('yahooid'), $user->yahoo), array(get_string('aimid'), $user->aim), array(get_string('msnid'), $user->msn), array(get_string('language'), $user->lang), array(get_string('timezone'), usertimezone($user->timezone)), array(get_string('departments', 'local_help_desk'), $hierarchy->get_alldepartments($user->id)), array(get_string('activesemister', 'local_help_desk'), $hierarchy->get_allmyactivesemester($user->id)), array(get_string('studentsemister', 'local_help_desk'), student_semesters($user->id)), array(get_string('myschools', 'local_help_desk'), $myschools));
     //get_string('dob', 'local_admission') . "</b></;" . date("Y-m-d", $local_users->dob) . "
     //get_string('doj', 'local_users') . "</b></td>< date("Y-m-d", $local_users->timecreated)
     //get_string('genderheading', 'local_admission')nbsp;&nbsp;" . $local_users->gender . "</
     //print_object($get_alldepartments);
     //print_object($get_allmyactivesemester);
     //print_object($student_semesters);
     //print_object(date('D M Y', $user->dob));
     $edit_url = new moodle_url('/user/edit.php', array('id' => $userid));
     $out .= html_writer::tag('a', 'EDIT', array('href' => $edit_url, 'id' => 'EDIT'));
     $out .= html_writer::table($table);
     return $out;
 }
Example #3
0
$PAGE->set_heading($SITE->fullname);
$PAGE->navbar->add(get_string('manageadddrop', 'local_adddrop'));
echo $OUTPUT->header();
/* ---Heading of the page--- */
echo $OUTPUT->heading(get_string('manageadddrop', 'local_adddrop'));
/* ---Moodle 2.2 and onwards--- */
$currenttab = 'adddropperiod';
/* ---adding tabs--- */
print_adddroptabs($currenttab, 'student');
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
    echo $OUTPUT->box(get_string('allowframembedding', 'local_adddrop'));
}

$context = context_user::instance($USER->id);
if (has_capability('local/clclasses:enrollclass', $context)) {
    $semester = student_semesters($USER->id);
    $query = "SELECT distinct(e.semesterid) as semesterid,
			   e.programid 
			   FROM {user} u,
			   {local_event_activities} e,
			   {local_event_types} le 
			   WHERE e.eventtypeid=le.id AND e.eventtypeid=3 AND e.publish=1 AND '{$today}' BETWEEN from_unixtime( e.startdate,'%Y-%m-%d' ) AND from_unixtime( e.enddate,'%Y-%m-%d' ) ";

    $tools = $DB->get_records_sql($query);
    // enable buttin only when add/drop event opened
    if ($tools) {
        echo '<div id="createbutton" style="text-align:right">';
        echo $OUTPUT->single_button(new moodle_url('/local/courseregistration/index.php'), get_string('courseregistration', 'local_adddrop'));
        echo '</div>';
    }
Example #4
0
/* ---Header and the navigation bar--- */
$PAGE->set_heading($SITE->fullname);
$PAGE->navbar->add(get_string('drop', 'local_adddrop'));
echo $OUTPUT->header();
/* ---Heading of the page--- */
echo $OUTPUT->heading(get_string('drop', 'local_adddrop'));
/* ---Moodle 2.2 and onwards--- */
$currenttab = 'myadddropstatus';
/* ---adding tabs--- */
print_adddroptabs($currenttab, 'student');
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
    echo $OUTPUT->box(get_string('myclasstabdes', 'local_courseregistration'));
}
$context =context_user::instance($USER->id);
if (has_capability('local/clclasses:enrollclass', $context)) {
    $semester = student_semesters($USER->id,'adddrop');
    if(empty($semester))
        print_cobalterror('notenrolledanyclass','local_adddrop');
    echo '<div class="selfilterposition" style="text-align:center;margin:20px;">';
    $select = new single_select(new moodle_url('/local/adddrop/approvestatus.php'), 'semesterid', $semester, $semid, null);
    $select->set_label(get_string('semester', 'local_semesters'));
    echo $OUTPUT->render($select);
    echo '</div>';
    $today = date('Y-m-d');
    if ($semid) {
        $query = "SELECT lc.*,cc.id AS courseid,
                     cc.fullname AS coursename,
                     c.registrarapproval AS rapproval,
                     c.mentorapproval AS mapproval,
                     c.studentapproval AS sapproval,
                     cc.credithours AS credithours