function definition() {
        global $USER, $CFG, $DB, $PAGE;
        $mform = $this->_form;
        $requestid = new requests();
        $schools = $requestid->school();
        foreach ($schools as $school) {
            $value = $school->fullname;
            $key = $school->id;
        }
        $programs = $requestid->program($key);
        foreach ($programs as $pro) {
            $pro_val = $pro->fullname;
            $pro_key = $pro->id;
        }
        $semester = $requestid->previoussemsofuser($key, $pro_key);
        $cur_semester = $requestid->current_sem($key, $pro_key);
        $list = array();
        $list[''] = get_string("select", "local_request");
        foreach ($semester as $ses) {
            $key1 = $ses->id;
            $list[$key1] = $ses->fullname;
        }
        foreach ($cur_semester as $cus_ses) {
            global $sesid;
            $sesid = $cus_ses->id;
        }
        unset($list[$sesid]);
        $mform->addElement('select', 'semester_name', get_string('semester', 'local_semesters'), $list);
        $mform->addRule('semester_name', get_string('missingsemester', 'local_semesters'), 'required', null, 'server');

        $mform->addElement('editor', 'reason', get_string("reason_id", "local_request"));
        $mform->addRule('reason', get_string('error_request_id', 'local_request'), 'required', null, 'client');
        $this->add_action_buttons(true, get_string('submitbutton', 'local_request'));
    }
Beispiel #2
0
    function definition() {
        global $USER, $CFG, $DB, $PAGE;
        $mform = $this->_form;
        $definitionoptions = $this->_customdata['definitionoptions'];
        $attachmentoptions = $this->_customdata['attachmentoptions'];
        $request = new requests();
        $PAGE->requires->yui_module('moodle-local_request-schoolchooser', 'M.local_request.init_schoolchooser', array(array('formid' => $mform->getAttribute('id'))));
        $schools = $request->school();
        $ass_school = $request->assigned_school();
        $count = count($schools);
        $mform->addElement('hidden', 'count', $count);
        $mform->setType('count', PARAM_RAW);
        // if on school assigned to a user condition
        if ($count == 1) {
            foreach ($schools as $school) {
                $value = $school->fullname;
                $key = $school->id;
            }
            $mform->addElement('static', 'school_name', get_string('schoolid', 'local_collegestructure'), $value);
            $mform->addElement('hidden', 'schoolid', $key);
            $mform->setType('schoolid', PARAM_INT);

            if ($semester = $request->currentsemester($key)) {
                $mform->addElement('static', 'semester_name', get_string('semester', 'local_semesters'), $semester->fullname);
                $mform->addElement('hidden', 'semesterid', $semester->id);
                $mform->setType('semesterid', PARAM_INT);
            }
        } else {
            //if user assigned to more than one school going to defination_after_data function
            $mform->addElement('select', 'schoolid', get_string('schoolid', 'local_collegestructure'), $ass_school);
            $mform->addRule('schoolid', get_string('missingschool', 'local_collegestructure'), 'required', null, 'client');
            $mform->addElement('hidden', 'addsemester');
            $mform->setType('addsemester', PARAM_RAW);
        }
        $mform->registerNoSubmitButton('chooseschool');
        $mform->addElement('submit', 'chooseschool', get_string('courseformatudpate'));

        $mform->addElement('hidden', 'addcourse');
        $mform->setType('addcourse', PARAM_RAW);
        $mform->addElement('editor', 'definition_editor', get_string('description'), null, $definitionoptions);
        $mform->setType('definition_editor', PARAM_RAW);
        $mform->addHelpButton('definition_editor', 'definition_editor', 'local_request');
        $mform->addElement('filemanager', 'attachment', get_string('attachment', 'local_request'), null, $attachmentoptions);
        $mform->addRule('attachment', get_string('required'), 'required', null, 'client');
        $mform->addHelpButton('attachment', 'attachment', 'local_request');

        $mform->addElement('hidden', 'id');
        $mform->setType('id', PARAM_INT);
        $this->add_action_buttons(true, get_string('submitbutton', 'local_request'));
    }
    function definition() {
        global $USER, $CFG, $DB, $PAGE;
        $mform = $this->_form;
        $requestid = new requests();
        $PAGE->requires->yui_module('moodle-local_request-schoolchooser', 'M.local_request.init_schoolchooser', array(array('formid' => $mform->getAttribute('id'))));
        $schools = $requestid->school();
        $ass_school = $requestid->assigned_school();
        $count = count($schools);
        $mform->addElement('hidden', 'count', $count);
        $mform->setType('count', PARAM_RAW);
        // if on school assigned to a user condition
        if ($count == 1) {
            foreach ($schools as $school) {
                $value = $school->fullname;
                $key = $school->id;
            }

            $users = $requestid->users($key);
            $mform->addElement('static', 'school_name', get_string('school_name', 'local_request'), $value);
            $mform->addElement('static', 'name', get_string('name', 'local_request'), $users->fullname);

            $mform->addElement('hidden', 'studentid', $USER->id);

            $mform->addElement('hidden', 'schoolid', $key);
            $mform->setType('schoolid', PARAM_RAW);
            $programs = $requestid->program($key);
            $count1 = count($programs);
            $mform->addElement('hidden', 'count_pros', $count1);
            $mform->setType('count_pros', PARAM_RAW);
            if ($count1 == 1) {
                foreach ($programs as $pro) {
                    $pro_val = $pro->fullname;
                    $pro_key = $pro->id;
                }
                $serviceid = $requestid->service($key, $pro_key);
                $mform->addElement('static', 'serviceid', get_string('student_id', 'local_request'), $serviceid->serviceid);
                $mform->addElement('static', 'program_name', get_string('program_name', 'local_request'), $pro_val);
                $mform->addElement('hidden', 'programid', $pro_key);
                $mform->setType('programid', PARAM_RAW);
                $semester = $requestid->semester($key, $pro_key);
                foreach ($semester as $ses) {
                    $value1 = $ses->fullname;
                    $key1 = $ses->id;
                }
                $mform->addElement('static', 'semester_name', get_string('semester_name', 'local_request'), $value1);
                $mform->addElement('hidden', 'semesterid', $key1);
                $mform->setType('semesterid', PARAM_RAW);
                $school_programs = $requestid->school_programs($key);
                $programs = array();
                $programs[''] = get_string("select", "local_request");
                foreach ($school_programs as $sch_pro) {
                    $programs[$sch_pro->id] = $sch_pro->fullname;
                }
                unset($programs[$pro_key]);
                $mform->addElement('select', 'toprogramid', get_string('to_program_name', 'local_request'), $programs);
                $mform->addRule('toprogramid', get_string('error_request_transfer', 'local_request'), 'required', null, 'server');
            } else {
                $pros = array();
                $pros[''] = get_string('selectprogram', 'local_programs');
                foreach ($programs as $pr) {
                    $pros[$pr->id] = $pr->fullname;
                }
                // single school  and more than one program 
                $mform->addElement('select', 'program_name1', get_string('program_name', 'local_request'), $pros);
            }
            //end of single assigned to user condition
        } else {
            //if user assigned to more than one school going to defination_after_data function
            $mform->addElement('select', 'school_name', get_string('school_name', 'local_request'), $ass_school);
            $mform->addRule('school_name', get_string('school_name_error', 'local_request'), 'required', null, 'client');
        }
        $mform->registerNoSubmitButton('chooseschool');
        $mform->addElement('submit', 'chooseschool', get_string('courseformatudpate'));
        $mform->addElement('hidden', 'addschool');
        $mform->setType('addschool', PARAM_RAW);
        $mform->addElement('textarea', 'reason', get_string("reason_id", "local_request"), ' rows="6" cols="80"');
        $mform->addRule('reason', get_string('error_request_id', 'local_request'), 'required', null, 'server');
        $mform->addElement('hidden', 'id');
        $mform->setType('id', PARAM_INT);
        $mform->addElement('hidden', 'studentid', $USER->id);
        $mform->setType('studentid', PARAM_RAW);
        $this->add_action_buttons(true, get_string('submitbutton', 'local_request'));
    }
    function definition() {
        global $USER, $CFG, $DB, $PAGE;
        $mform = $this->_form;
        $requestpro = new requests();
        $PAGE->requires->yui_module('moodle-local_request-schoolchooser', 'M.local_request.init_schoolchooser', array(array('formid' => $mform->getAttribute('id'))));
        $users = $requestpro->current_user();
        $mform->addElement('header', 'settingsheader', get_string('PresentProfileDetails', 'local_request'));
        $mform->addHelpButton('settingsheader', 'PresentProfileDetails', 'local_request');
        $mform->addElement('hidden', 'userid', $u->id);
        $mform->setType('userid', PARAM_RAW);

        $schools = $requestpro->school();
        $ass_school = $requestpro->assigned_school();
        $count = count($schools);
        $mform->addElement('hidden', 'count', $count);
        $mform->setType('count', PARAM_RAW);
        // if one school assigned to a user condition
        if ($count == 1) {
            foreach ($schools as $school) {
                $value = $school->fullname;
                $key = $school->id;
            }
            $mform->addElement('static', 'school_name', get_string('schoolid', 'local_collegestructure'), $value);

            $users = $requestpro->users($key);

            $mform->addElement('static', 'name', get_string('name', 'local_request'), $users->fullname);
            $mform->addElement('static', 'email_id', get_string('email_id', 'local_request'), $users->email);

            $mform->addElement('hidden', 'schoolid', $key);
            $mform->setType('schoolid', PARAM_RAW);
            $programs = $requestpro->program($key);
            $count1 = count($programs);
            $mform->addElement('hidden', 'count_pros', $count1);
            $mform->setType('count_pros', PARAM_RAW);
            if ($count1 == 1) {
                foreach ($programs as $pro) {
                    $pro_val = $pro->fullname;
                    $pro_key = $pro->id;
                }
                $serviceid = $requestpro->service($key, $pro_key);
                $mform->addElement('static', 'serviceid', get_string('student_id', 'local_request'), $serviceid->serviceid);
                $mform->addElement('static', 'program_name', get_string('program', 'local_programs'), $pro_val);
                $mform->addElement('hidden', 'programid', $pro_key);
                $mform->setType('programid', PARAM_RAW);

                $semester = $requestpro->semester($key, $pro_key);
                foreach ($semester as $ses) {
                    $value1 = $ses->fullname;
                    $key1 = $ses->id;
                }
                $mform->addElement('static', 'semester_name', get_string('semester', 'local_semesters'), $value1);
                $mform->addElement('hidden', 'semesterid', $key1);
                $mform->setType('semesterid', PARAM_RAW);
            } else {
                $pros = array();
                $pros[''] = get_string('selectprogram', 'local_programs');
                foreach ($programs as $pr) {
                    $pros[$pr->id] = $pr->fullname;
                }
                // single school  and more than one program 
                $mform->addElement('select', 'program_name1', get_string('program', 'local_programs'), $pros);
            }
            //end of single assigned to user condition
        } else {
            //if user assigned to more than one school going to defination_after_data function
            $mform->addElement('select', 'school_name', get_string('schoolid', 'local_collegestructure'), $ass_school);
            $mform->addRule('school_name', get_string('missingschool', 'local_collegestructure'), 'required', null, 'client');
        }
        $mform->registerNoSubmitButton('chooseschool');
        $mform->addElement('submit', 'chooseschool', get_string('courseformatudpate'));
        $mform->addElement('hidden', 'addschool');
        $mform->setType('addschool', PARAM_RAW);
        $mform->addElement('header', 'selectfields', get_string('selectfield', 'local_request'));
        $mform->addHelpButton('selectfields', 'selectfield', 'local_request');
        $fieldvalues = array();
        $fieldvalues[''] = get_string("select", "local_request");
        $fieldvalues[0] = get_string('name', 'local_request');
        $fieldvalues[1] = get_string('email_id', 'local_request');
        $mform->addElement('select', 'field_select', get_string('selectfield', 'local_request'), $fieldvalues);
        $mform->addRule('field_select', get_string('field_select', 'local_request'), 'required', null, 'client');
        $mform->registerNoSubmitButton('fieldset');
        $mform->addElement('submit', 'fieldset', get_string('field_select', 'local_request'));
        $mform->addElement('hidden', 'fields');
        $mform->setType('fields', PARAM_RAW);
        $this->add_action_buttons(true, get_string('submitbutton', 'local_request'));
    }
Beispiel #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;
 }
Beispiel #6
0
$mform = new requesttranscript_form();
$hierarchy = new hierarchy();
$nexturl = $CFG->wwwroot . '/local/request/request_transcript.php';
//Form processing and displaying is done here
$x = optional_param('schoolid', 0, PARAM_INT);
$requestid = new requests();
global $USER;

if ($mform->is_cancelled()) {
    /* if click on cancel it redirects us to request_id.php file */
    redirect($nexturl);
} else if ($fromform = $mform->get_data()) {
    /* presence of data */
    $check = $DB->get_record_sql("SELECT * FROM {local_request_transcript} WHERE studentid = {$USER->id} AND req_semester = {$fromform->semester_name}");
    $schools = $requestid->school();
    foreach ($schools as $school) {
        $value = $school->fullname;
        $key = $school->id;
    }
    $programs = $requestid->program($key);
    foreach ($programs as $pro) {
        $pro_val = $pro->fullname;
        $pro_key = $pro->id;
    }
    $cur_semester = $requestid->current_sem($key, $pro_key);
    foreach ($cur_semester as $cus_ses) {
        $sesid = $cus_ses->id;
        $fromform->semester = $sesid;
    }
    $fromform->studentid = $USER->id;
Beispiel #7
0
echo $OUTPUT->header();


echo '<br></br><div class="userprofilebox clearfix">';
echo "<span class='proheading'>" . $name->firstname . " " . $name->lastname . "</span>";
echo '<div class="profilepicture" >';
echo $OUTPUT->user_picture($user, array('size' => 50, 'class' => 'mypic'));
echo '</div><div class="myinfo" >';
echo "<table class='schoolinfo'  ><tr class='tableproheading'><td style='font-size:25px'>" . $name->firstname . " " . $name->lastname . "</td></tr>";
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) {