示例#1
0
 function edituser()
 {
     $model = new User();
     $tree = $model->getTree();
     $groups = $model->getGroupList();
     $user = $model->getEditUser();
     View::render('user/adduser', array('formpath' => 'actedituser', 'tree' => $tree, 'modules' => OneSSA::$modulesStandart, 'groups' => $groups, 'user' => $user));
 }
<?php

include_once "../class/Config.php";
include_once "../class/User.php";
$editUser = new User();
$dbss = new config();
$editId = $_GET["id"];
$arr = $editUser->getEditUser($editId);
$data_array = array();
$no = 1;
$stat = 0;
while ($res = $dbss->fetch_object($arr)) {
    $data_array[$res->id]['id'] = $res->id;
    $data_array[$res->id]['username'] = $res->username;
    $data_array[$res->id]['firstName'] = $res->firstName;
    $data_array[$res->id]['lastName'] = $res->lastName;
    $data_array[$res->id]['position'] = $res->position;
    if ($res->status == "Administrator") {
        $stat = 1;
        $data_array[$res->id]['status'] = $stat;
    } else {
        if ($res->status == "Officer") {
            $stat = 2;
            $data_array[$res->id]['status'] = $stat;
        } else {
            $stat = 0;
            $data_array[$res->id]['status'] = $stat;
        }
    }
    //$data_array[$res->id]['status'] = $res->status;
}
<?php

include_once "../class/Config.php";
include_once "../class/User.php";
$editUser = new User();
$dbss = new config();
$userId = $_GET["userId"];
$arr = $editUser->getEditUser($userId);
$data_array = array();
$no = 0;
$stat = 0;
while ($res = $dbss->fetch_object($arr)) {
    $data_array[$no]['userId'] = $res->userId;
    $data_array[$no]['username'] = $res->username;
    $data_array[$no]['firstName'] = $res->firstName;
    $data_array[$no]['lastName'] = $res->lastName;
    $data_array[$no]['position'] = $res->position;
    if ($res->userStatus == "Administrator") {
        $stat = 1;
        $data_array[$no]['userStatus'] = $stat;
    } else {
        if ($res->userStatus == "Officer") {
            $stat = 2;
            $data_array[$no]['userStatus'] = $stat;
        } else {
            $stat = 0;
            $data_array[$no]['userStatus'] = $stat;
        }
    }
    $no++;
}