Exemplo n.º 1
0
$PAGE->set_title(get_string('pluginname', 'local_help_desk'));
$PAGE->navbar->add(get_string('pluginname', 'local_help_desk'));
$PAGE->navbar->add(get_string('accounts', 'local_help_desk'));
$PAGE->set_heading($SITE->fullname);
$renderer = $PAGE->get_renderer('local_help_desk');
$lib_help_desk = new help_desk();
$hierarchy = new hierarchy();
$ufiltering = new user_filtering_accounts();
//Tab tree (current tab)
$tab = 'accounts';
$serialkey_form = new accounts_serialkey_form(NULL, array('skid' => $skid));
echo $OUTPUT->header();
$lib_help_desk->createtabview($tab);
//Tab tree
$extracolumns = get_extra_user_fields($systemcontext);
$ufiltering = new user_filtering_accounts();
$allusernamefields = get_all_user_name_fields(false, null, null, null, true);
$columns = array_merge($allusernamefields, $extracolumns, array('city', 'country', 'lastaccess'));
foreach ($columns as $column) {
    $string[$column] = get_user_field_name($column);
    if ($sort != $column) {
        $columnicon = "";
        if ($column == "lastaccess") {
            $columndir = "DESC";
        } else {
            $columndir = "ASC";
        }
    } else {
        $columndir = $dir == "ASC" ? "DESC" : "ASC";
        if ($column == "lastaccess") {
            $columnicon = $dir == "ASC" ? "sort_desc" : "sort_asc";
Exemplo n.º 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;
 }