Пример #1
0
}
$data = array();
echo $OUTPUT->header();
$requests = $DB->get_records('local_request_transcript');

foreach ($requests as $request) {
    $list = array();
    $buttons = array();
    $details = $DB->get_record_sql("select lud.schoolid,luc.semesterid,lud.userid,lud.serviceid,lud.programid
        from {local_userdata} lud
        INNER JOIN {local_user_clclasses} luc 
        ON lud.userid = luc.userid AND lud.userid = {$request->studentid}
        AND luc.semesterid = {$request->req_semester} group by lud.schoolid");
    if ($vals = $DB->get_records_sql("SELECT * FROM {local_school_permissions} where userid = '" . $USER->id . "' and schoolid='" . $details->schoolid . "'")) {

        $serviceid = $requestpro->service($details->schoolid, $details->programid, $request->studentid);
        $user = $requestpro->users($details->schoolid, $request->studentid);
        $list[] = $serviceid->serviceid;
        $list[] = $user->fullname;
        $list[] = $DB->get_field('local_school', 'fullname', array('id' => $details->schoolid));
        $list[] = $DB->get_field('local_program', 'fullname', array('id' => $details->programid));
        $list[] = $DB->get_field('local_semester', 'fullname', array('id' => $request->req_semester));
        $list[] = date("Y-m-d", $request->requested_date);
        $reg_approval = $request->reg_approval;
        if ($reg_approval == 0) {
            $list[] = get_string('pending', 'local_request');
        }
        if ($reg_approval == 1) {
            $list[] = get_string('approvedc', 'local_request');
        }
        if ($reg_approval == 2) {
Пример #2
0
$PAGE->navbar->add($strheading);
$PAGE->set_title($strheading);
$requestpro = new requests();
$data = array();
global $USER;
$url = '../../local/request/requestprofile.php';
if ($var) {
    redirect($url);
}
$data = array();
echo $OUTPUT->header();
$requests = $DB->get_records('local_request_profile_change', array('reg_approval' => '0'));
foreach ($requests as $request) {
    $list = array();
    if ($vals = $DB->get_records_sql("SELECT * FROM {local_school_permissions} where userid = '" . $USER->id . "' and schoolid='" . $request->schoolid . "'")) {
        $serviceid = $requestpro->service($request->schoolid, $request->studentid);
        $list[] = $serviceid->serviceid;
        $list[] = $DB->get_field('local_school', 'fullname', array('id' => $request->schoolid));
        $list[] = $DB->get_field('local_program', 'fullname', array('id' => $request->programid));
        if ($request->subjectcode == 1) {
            $list[] = get_string('name', 'local_approval');
        }
        if ($request->subjectcode == 2) {
            $list[] = get_string('emailid', 'local_admission');
        }
        $list[] = "<a href='view.php?id=" . $request->id . "&flag=1'>" . $request->presentdata . "</a>";
        $list[] = $request->changeto;
        $list[] = date("Y-m-d", $request->requested_date);
        $reg_approval = $request->reg_approval;
        if ($reg_approval == 0) {
            $list[] = "<a href='../../local/profilechange/changeprofile.php?confirm=1&recid={$request->id}'>Confirm</a>";
Пример #3
0
    function definition_after_data() {
        global $USER, $CFG, $DB, $PAGE;
        $mform = $this->_form;
        $requestid = new requests();
        $id = $this->_customdata['id'];
        $school = $mform->getElementValue('school_name');
        $countvalue = $mform->getElementValue('count');
        $fid = $school[0];
        if ($countvalue == 1) {
            $pro_count = $mform->getElementValue('count_pros');
            if ($pro_count > 1) {
                // single school and more than one program assigned to a user
                $program1 = $mform->getElementValue('program_name1');
                $schoolid = $mform->getElementValue('schoolid');
                $pro_index = $program1[0];
                if ($pro_index > 0 && $pro_count > 1) {
                    $semesteres = $requestpro->semester($schoolid, $pro_index);
                    $semesteres = $requestid->semester($schoolid, $pro_index);
                    foreach ($semesteres as $s) {

                        $value2 = $s->fullname;
                    }
                    $ser_id = $mform->createElement('static', 'serviceid', get_string('student_id', 'local_request'), $serviceid->serviceid);
                    $mform->insertElementBefore($ser_id, 'program_name');
                    $sem_name = $mform->createElement('static', 'semester_name', get_string('semester_name', 'local_request'), $value2);
                    $mform->insertElementBefore($sem_name, 'addschool');
                }
            }
        }
        // more than one school assiged to a user
        if ($school[0] > 0 && isset($school) && $countvalue > 1) {
            $service = $requestid->service($fid);
            $users = $requestid->users($fid);
            $programses = $requestid->program($fid);
            $mypro = array();
            $mypro[''] = get_string('selectprogram', 'local_programs');
            foreach ($programses as $p) {
                $mypro[$p->id] = $p->fullname;
            }
            $ser_id = $mform->createElement('static', 'serviceid', get_string('student_id', 'local_request'), $service->serviceid);
            $mform->insertElementBefore($ser_id, 'addschool');
            $name = $mform->createElement('static', 'name', get_string('name', 'local_request'), $users->fullname);
            $mform->insertElementBefore($name, 'addschool');
            if (count($mypro) == 2) {
                // more than school and one program to user
                $pro_name = $mform->createElement('static', 'program_name', get_string('program_name', 'local_request'), $mypro[$p->id]);
                $mform->insertElementBefore($pro_name, 'addschool');
                $pro_id = $mform->createElement('hidden', 'programid', $p->id);
                $mform->insertElementBefore($pro_id, 'addschool');
                $semesteres = $requestid->semester($fid, $p->id);
                foreach ($semesteres as $s) {
                    $mysemvalue = $s->fullname;
                    $mysemid = $s->id;
                }
                $sems_name = $mform->createElement('static', 'semester_name', get_string('semester_name', 'local_request'), $mysemvalue);
                $mform->insertElementBefore($sems_name, 'addschool');
                $sem_id = $mform->createElement('hidden', 'semesterid', $mysemid);
                $mform->insertElementBefore($sem_id, 'addschool');
                $school_programs = $requestid->school_programs($fid);
                $programs = array();
                $programs[''] = get_string("select", "local_request");
                foreach ($school_programs as $sch_pro) {
                    $programs[$sch_pro->id] = $sch_pro->fullname;
                }
                $sch_pro = $mform->createElement('select', 'toprogramid', get_string('to_program_name', 'local_request'), $programs);
                $mform->insertElementBefore($sch_pro, 'addschool');
                $mform->addRule('toprogramid', get_string('error_request_transfer', 'local_request'), 'required', null, 'server');
            } else {
                // more than one program and school assined to user
                $pro_name = $mform->createElement('select', 'program_name', get_string('program_name', 'local_request'), $mypro);
                $mform->insertElementBefore($pro_name, 'addschool');
                $mform->addRule('program_name', get_string('programid', 'local_prefix'), 'required', null, 'client');
            }
            $formatvalue3 = $mform->getElementValue('program_name');
            if ($formatvalue3[0] > 0) {
                $semesteres = $requestid->semester($fid, $formatvalue3[0]);
                foreach ($semesteres as $s) {
                    $mysemvalue = $s->fullname;
                }
                $sem_name = $mform->createElement('static', 'semester_name', get_string('semester_name', 'local_request'), $mysemvalue);
                $mform->insertElementBefore($sem_name, 'addschool');
            }
        }
    }
Пример #4
0
    function definition_after_data() {
        global $USER, $CFG, $DB, $PAGE;
        $mform = $this->_form;
        $id = $this->_customdata['id'];
        $requestpro = new requests();
        $school = $mform->getElementValue('school_name');
        $countvalue = $mform->getElementValue('count');
        $fields = $mform->getElementValue('field_select');
        $fid = $school[0];
        if ($countvalue == 1) {
            $pro_count = $mform->getElementValue('count_pros');
            if ($pro_count > 1) {
                // single school and more than one program assigned to a user
                $program1 = $mform->getElementValue('program_name1');
                $schoolid = $mform->getElementValue('schoolid');

                echo $pro_index = $program1[0];
                if ($pro_index > 0 && $pro_count > 1) {
                    $semesteres = $requestpro->semester($schoolid, $pro_index);
                    $serviceid = $requestpro->service($schoolid, $pro_index);

                    foreach ($semesteres as $s) {
                        $value2 = $s->fullname;
                    }
                    $ser_id = $mform->createElement('static', 'serviceid', get_string('student_id', 'local_request'), $serviceid->serviceid);
                    $mform->insertElementBefore($ser_id, 'name');
                    $sem_name = $mform->createElement('static', 'semester_name', get_string('semester', 'local_semesters'), $value2);
                    $mform->insertElementBefore($sem_name, 'addschool');
                }
            }
        }
        // more than one school assiged to a user
        if ($school[0] > 0 && isset($school) && $countvalue > 1) {

            $users = $requestpro->users($fid);
            $programses = $requestpro->program($fid);
            $mypro = array();
            $mypro[''] = '--Select--';
            foreach ($programses as $p) {
                $mypro[$p->id] = $p->fullname;
            }
            $service = $requestpro->service($fid, $p->id);
            $username = $mform->createElement('static', 'name', get_string('name', 'local_request'), $users->fullname);
            $mform->insertElementBefore($username, 'addschool');
            $emailid = $mform->createElement('static', 'email_id', get_string('email_id', 'local_request'), $users->email);
            $mform->insertElementBefore($emailid, 'addschool');

            $ser_id = $mform->createElement('static', 'serviceid', get_string('student_id', 'local_request'), $service->serviceid);
            $mform->insertElementBefore($ser_id, 'addschool');
            if (count($mypro) == 2) {
                // more than school and one program to user
                $pro_name = $mform->createElement('static', 'program_name', get_string('program', 'local_programs'), $mypro[$p->id]);
                $mform->insertElementBefore($pro_name, 'addschool');
                $pro_id = $mform->createElement('hidden', 'programid', $p->id);
                $mform->insertElementBefore($pro_id, 'addschool');
                $semesteres = $requestpro->semester($fid, $p->id);
                foreach ($semesteres as $s) {
                    $mysemvalue = $s->fullname;
                }
                $sems_name = $mform->createElement('static', 'semester_name', get_string('semester', 'local_semesters'), $mysemvalue);
                $mform->insertElementBefore($sems_name, 'addschool');
                $sem_id = $mform->createElement('hidden', 'semesterid', $s->id);
                $mform->insertElementBefore($sem_id, 'addschool');
            } else {
                // more than one program and school assined to user
                $pro_name = $mform->createElement('select', 'program_name', get_string('program', 'local_programs'), $mypro);
                $mform->insertElementBefore($pro_name, 'addschool');
            }
            $formatvalue3 = $mform->getElementValue('program_name');
            if ($formatvalue3[0] > 0) {
                $semesteres = $requestpro->semester($fid, $formatvalue3[0]);
                foreach ($semesteres as $s) {
                    $mysemvalue = $s->fullname;
                }
                $se_name = $mform->createElement('static', 'semester_name', get_string('semester', 'local_semesters'), $mysemvalue);
                $mform->insertElementBefore($se_name, 'addschool');
            }
        }
        if (isset($fields[0]) && $fields[0] != null) {
            if ($fields[0] == 0) {
                $result = $DB->get_record('local_request_profile_change', array('reg_approval' => 0, 'subjectcode' => 1, 'studentid' => $USER->id));
            }if ($fields[0] == 1) {
                $result = $DB->get_record('local_request_profile_change', array('reg_approval' => 0, 'subjectcode' => 2, 'studentid' => $USER->id));
            }
            if (!empty($result)) {
                if ($fields[0] == 0) {
                    $errormsg = $mform->createElement('html', '<div class="alert alert-danger">' . get_string('noteforname', 'local_request') . '</div>');
                    $mform->insertElementBefore($errormsg, 'fields');
                }if ($fields[0] == 1) {
                    $errormsg = $mform->createElement('html', '<div class="alert alert-danger">' . get_string('noteforemail', 'local_request') . '</div>');
                    $mform->insertElementBefore($errormsg, 'fields');
                }
            } else {
                $editheader = $mform->createElement('header', 'settingsheader', get_string('edit_settings', 'local_request'));
                $mform->insertElementBefore($editheader, 'fields');
                $users = $requestpro->current_user();
                $fullname = $users->firstname . " " . $users->lastname;
                if ($fields[0] == 0 && $fields[0] != null) {
                    $username = $mform->createElement('static', 'fullname', get_string('present_data', 'local_request'), $fullname);
                    $mform->insertElementBefore($username, 'fields');
                }
                if ($fields[0] == 1 && $fields[0] != null) {
                    $email_id = $mform->createElement('static', 'email_id', get_string('present_data', 'local_request'), $users->email);
                    $mform->insertElementBefore($email_id, 'fields');
                }
                $changeto = $mform->createElement('text', 'changeto', get_string("request_to_chage", "local_request"));
                $mform->insertElementBefore($changeto, 'fields');
                $mform->addRule('changeto', get_string('error_change_to', 'local_request'), 'required', null, 'client');

                $reason = $mform->createElement('editor', 'reason', get_string("reason_id", "local_request"));
                $mform->setType('reason', PARAM_RAW);
                $mform->insertElementBefore($reason, 'fields');

                $mform->addRule('reason', get_string('error_request_id', 'local_request'), 'required', null, 'client');
            }
        }
    }
Пример #5
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;
 }
Пример #6
0
echo "<tr><td style='font-size:10px;color:#000;'><img src='" . $CFG->wwwroot . "/pix/emailpro.png' style='vertical-align:middle;' />&nbsp;<a href='mailto:" . $name->email . "'>" . $name->email . "</a>&nbsp;&nbsp;&nbsp;&nbsp;<img src='" . $CFG->wwwroot . "/pix/phonepro.png' style='vertical-align:middle;' />&nbsp;" . $name->phone1 . "</td></tr>";


$s1 = array();
$s3 = array();
$p = array();
if ($school = $requests->school($id)) {
    foreach ($school as $schools) {
        $schoolid = $schools->id;
        $schoolname = $schools->fullname;
        $s1[] = $schoolname;
        $programs = $requests->program($schoolid, $id);
        foreach ($programs as $program) {
            $proid = $program->id;
            $p[] = $DB->get_field('local_program', 'fullname', array('id' => $proid));
            if ($serviceid = $requests->service($schoolid, $proid, $id)) {
                $s3[] = $serviceid->serviceid;
            }
        }
    }

    if ($s1) {
        $s2 = implode(',&nbsp;', $s1);
        echo "<tr><td><b>School: </b>" . $s2 . "</td></tr>";
    }
    if ($p) {
        $pro = implode('&nbsp;', $p);
        echo "<tr><td><b>Program: </b>" . $pro . "</td></tr>";
    }
}
Пример #7
0
$PAGE->navbar->add(get_string('view', 'local_request'));
$PAGE->set_title($strheading);
$requestpro = new requests();
$data = array();
global $USER;
$url = '../../local/request/requestprofile.php';
if ($var) {
    redirect($url);
}
$data = array();
echo $OUTPUT->header();

if ($requests = $DB->get_records('local_request_profile_change', array('studentid' => $USER->id))) {
    foreach ($requests as $request) {
        $list = array();
        $serviceid = $requestpro->service($request->schoolid, $request->programid);
        $list[] = $serviceid->serviceid;
        $list[] = $DB->get_field('local_school', 'fullname', array('id' => $request->schoolid));
        $list[] = $DB->get_field('local_program', 'fullname', array('id' => $request->programid));
        if ($request->subjectcode == 1) {
            $list[] = get_string('name', 'local_request');
        }
        if ($request->subjectcode == 2) {
            $list[] = get_string('email_id', 'local_request');
        }
        $list[] = $request->presentdata;
        $list[] = $request->changeto;
        $list[] = strtoupper(date("d-M-Y", $request->requested_date));
        $reg_approval = $request->reg_approval;
        if ($reg_approval == 0) {
            $list[] = get_string('pending', 'local_request');