function admin_controller()
{
    require "Models/feed_model.php";
    global $session, $action, $format;
    $output['content'] = "";
    $output['message'] = "";
    //---------------------------------------------------------------------------------------------------------
    // Gets the user list and user memory use
    // http://yoursite/emoncms/admin/users
    //---------------------------------------------------------------------------------------------------------
    if ($action == '' && $session['write'] && $session['admin']) {
        $userlist = get_user_list();
        $total_memuse = 0;
        for ($i = 0; $i < count($userlist); $i++) {
            $user = $userlist[$i];
            $stats = get_statistics($user['userid']);
            $user['uphits'] = $stats['uphits'];
            $user['dnhits'] = $stats['dnhits'];
            $user['memuse'] = $stats['memory'];
            $total_memuse += $user['memuse'];
            $userlist[$i] = $user;
        }
        usort($userlist, 'user_sort');
        // sort by highest memory user first
        $output['content'] = view("admin/admin_view.php", array('userlist' => $userlist, 'total_memuse' => $total_memuse));
    }
    return $output;
}
Example #2
0
<?php

try {
    require "./db.php";
    $REQUEST = get_request_data();
    if (!array_key_exists('cohortid', $REQUEST)) {
        throw new Exception('Did not supply cohortid');
    }
    echo json_response('success', null, get_user_list($REQUEST['cohortid']));
} catch (Exception $e) {
    echo json_response('error', $e->getMessage(), null);
}
Example #3
0
		<th>&nbsp;</th>
	</tr>
	<tr>
		<td>
			<select name="device" onChange="this.form.submit()">
				<option>all</option>
			<?php 
get_device_list($db);
?>
			</select>
		</td>
		<td>
			<select name="user" onChange="this.form.submit()">
				<option>all</option>
			<?php 
get_user_list($db);
?>
			</select>
		</td>
		<td>
			<input onclick="ds_sh(this);" name="begin_date" style="cursor: text" value="<?php 
echo $begin_date;
?>
" />
		</td>
		<td>
			<input onclick="ds_sh(this);" name="end_date" style="cursor: text" value="<?php 
echo $end_date;
?>
" />
		</td>
function dashboard_controller()
{
    require "Models/dashboard_model.php";
    global $path, $session, $action, $subaction, $format;
    $output['content'] = "";
    $output['message'] = "";
    //----------------------------------------------------------------------------------------------------------------------
    // New dashboard
    //----------------------------------------------------------------------------------------------------------------------
    if ($action == 'new' && $session['write']) {
        $dashid = new_dashboard($session['userid']);
        $output['message'] = _("dashboards new");
        if ($format == 'html') {
            header("Location: ../dashboard/edit?id=" . $dashid);
        }
    } elseif ($action == 'delete' && $session['write']) {
        $output['message'] = delete_dashboard($session['userid'], intval($_POST["id"]));
    } elseif ($action == 'clone' && $session['write']) {
        $output['message'] = clone_dashboard($session['userid'], intval($_POST["id"]));
    } elseif ($action == 'list' && $session['read']) {
        $_SESSION['editmode'] = TRUE;
        if ($session['read']) {
            $apikey = get_apikey_read($session['userid']);
        }
        $dashboards = get_dashboard_list($session['userid'], 0, 0);
        $menu = build_dashboard_menu($session['userid'], "edit");
        $user = get_user($session['userid']);
        if ($format == 'html') {
            $output['content'] = view("dashboard/dashboard_list_view.php", array('apikey' => $apikey, 'dashboards' => $dashboards, 'menu' => $menu, 'user' => $user));
        }
    } elseif ($action == 'public') {
        $userlist = get_user_list();
        $dashboard_list = array();
        foreach ($userlist as $user) {
            $user_dash_list = get_dashboard_list($user['userid'], 1, 1);
            foreach ($user_dash_list as $user_dash) {
                $user_dash['username'] = $user['name'];
                $dashboard_list[] = $user_dash;
            }
        }
        if ($format == 'html') {
            $output['content'] = view("dashboard/dashboard_publiclist_view.php", array('dashboards' => $dashboard_list));
        }
    } elseif ($action == 'thumb' && $session['read']) {
        $_SESSION['editmode'] = TRUE;
        if ($session['read']) {
            $apikey = get_apikey_read($session['userid']);
        }
        $dashboards = get_dashboard_list($session['userid'], 0, 0);
        $menu = build_dashboard_menu($session['userid'], "edit");
        if ($format == 'html') {
            $output['content'] = view("dashboard/dashboard_thumb_view.php", array('apikey' => $apikey, 'dashboards' => $dashboards, 'menu' => $menu));
        }
    } elseif (($action == 'run' || $action == 'view') && $session['read']) {
        $id = intval($_GET['id']);
        $alias = preg_replace('/[^a-z]/', '', $subaction);
        if ($action == "run") {
            $public = !$session['write'];
            $published = 1;
        } else {
            $public = 0;
            $published = 0;
        }
        if ($id) {
            // If a dashboard id is given we get the coresponding dashboard
            $dashboard = get_dashboard_id($session['userid'], $id, $public, $published);
        } elseif ($alias) {
            $dashboard = get_dashboard_alias($session['userid'], $alias, $public, $published);
        } else {
            // Otherwise we get the main dashboard
            $dashboard = get_main_dashboard($session['userid']);
        }
        // URL ENCODE...
        if ($format == 'json') {
            $output['content'] = urlencode($dashboard['content']);
            return $output;
        }
        $menu = build_dashboard_menu($session['userid'], $action);
        if ($action == "run") {
            // In run mode dashboard menu becomes the main menu
            $_SESSION['editmode'] = FALSE;
            $output['runmenu'] = '<div class="nav-collapse collapse">';
            $output['runmenu'] .= '<ul class="nav">' . $menu . '</ul>';
            if ($session['write']) {
                $output['runmenu'] .= "<ul class='nav pull-right'><li><a href='" . $GLOBALS['path'] . "user/logout'>" . _("Logout") . "</a></li></ul>";
            }
            $output['runmenu'] .= "</div>";
        } else {
            // Otherwise in view mode the dashboard menu is an additional grey menu
            $_SESSION['editmode'] = TRUE;
            $output['submenu'] = view("dashboard/dashboard_menu.php", array('id' => $dashboard['id'], 'menu' => $menu, 'type' => "view"));
        }
        //if ($dashboard_arr)
        //{
        $apikey = get_apikey_read($session['userid']);
        $output['content'] = view("dashboard/dashboard_view.php", array('dashboard' => $dashboard, "apikey_read" => $apikey));
        // If run mode avoid include dashboard configuration (this makes dashboard page lighter)
        if ($action != "run") {
            $output['content'] .= view("dashboard/dashboard_config.php", array('dashboard' => $dashboard));
        }
        //}
        //else
        //{
        //  $output['content'] = view("dashboard_run_errornomain.php",array());
        //}
    } elseif ($action == 'edit' && $session['write']) {
        $id = intval($_GET['id']);
        $alias = preg_replace('/[^a-z]/', '', $subaction);
        if ($id) {
            // If a dashboard id is given we get the coresponding dashboard
            $dashboard = get_dashboard_id($session['userid'], $id, 0, 0);
        } elseif ($alias) {
            $dashboard = get_dashboard_alias($session['userid'], $alias, 0, 0);
        } else {
            // Otherwise we get the main dashboard
            $dashboard = get_main_dashboard($session['userid']);
        }
        $apikey = get_apikey_read($session['userid']);
        $menu = build_dashboard_menu($session['userid'], "edit");
        $output['content'] = view("dashboard/dashboard_edit_view.php", array('dashboard' => $dashboard, "apikey_read" => $apikey));
        $output['content'] .= view("dashboard/dashboard_config.php", array('dashboard' => $dashboard));
        $output['submenu'] = view("dashboard/dashboard_menu.php", array('id' => $dashboard['id'], 'menu' => $menu, 'type' => "edit"));
    } elseif ($action == 'ckeditor' && $session['write']) {
        $id = intval($_GET['id']);
        $alias = preg_replace('/[^a-z]/', '', $subaction);
        if ($id) {
            // If a dashboard id is given we get the coresponding dashboard
            $dashboard = get_dashboard_id($session['userid'], $id, 0, 0);
        } elseif ($alias) {
            $dashboard = get_dashboard_alias($session['userid'], $alias, 0, 0);
        } else {
            // Otherwise we get the main dashboard
            $dashboard = get_main_dashboard($session['userid']);
        }
        $menu = build_dashboard_menu($session['userid'], "ckeditor");
        $output['content'] = view("dashboard/dashboard_ckeditor_view.php", array('dashboard' => $dashboard, 'menu' => $menu));
        $output['submenu'] = view("dashboard/dashboard_menu.php", array('id' => $dashboard['id'], 'menu' => $menu, 'type' => "ckeditor"));
    }
    //----------------------------------------------------------------------------------------------------------------------
    // SET dashboard
    // dashboard/set?content=<h2>HelloWorld</h2>
    //----------------------------------------------------------------------------------------------------------------------
    if ($action == 'set' && $session['write']) {
        $content = $_POST['content'];
        if (!$content) {
            $content = $_GET['content'];
        }
        $id = intval($_POST['id']);
        if (!$id) {
            $id = intval($_GET['id']);
        }
        // IMPORTANT: if you get problems with characters being removed check this line:
        $content = preg_replace('/[^\\w\\s-.#<>?",;:=&\\/%]/', '', $content);
        // filter out all except characters usually used
        $content = db_real_escape_string($content);
        set_dashboard_content($session['userid'], $content, $id);
        if ($format == 'html') {
            $output['message'] = _("dashboard set");
        } else {
            $output['message'] = "ok";
        }
    } elseif ($action == 'setconf' && $session['write']) {
        $id = intval($_POST['id']);
        $name = preg_replace('/[^\\w\\s-]/', '', $_POST['name']);
        $alias = preg_replace('/[^a-z]/', '', $_POST['alias']);
        $description = preg_replace('/[^\\w\\s-]/', '', $_POST['description']);
        // Separated functions to allow set values in independent way
        if (isset($_POST['main'])) {
            set_dashboard_main($session['userid'], $id, intval($_POST['main']));
        }
        if (isset($_POST['published'])) {
            set_dashboard_publish($session['userid'], $id, intval($_POST['published']));
        }
        if (isset($_POST['public'])) {
            set_dashboard_public($session['userid'], $id, intval($_POST['public']));
        }
        if (isset($_POST['name'])) {
            set_dashboard_name($session['userid'], $id, $name);
        }
        if (isset($_POST['alias'])) {
            set_dashboard_alias($session['userid'], $id, $alias);
        }
        if (isset($_POST['description'])) {
            set_dashboard_description($session['userid'], $id, $description);
        }
        if (isset($_POST['showdescription'])) {
            set_dashboard_showdescription($session['userid'], $id, intval($_POST['showdescription']));
        }
        //set_dashboard_conf($session['userid'],$id,$name,$alias,$description,$main,$public,$published);
        $output['message'] = _("dashboard set configuration");
    }
    return $output;
}
Example #5
0
}
if (isset($org_code)) {
    $org_code = intval($org_code);
}
if ("{$style}" != "stripped") {
    echo "<form method=\"GET\" action=\"{$base_url}/form.php\" name=\"form\" id=\"form\">\n";
    echo "<input type=hidden value=\"timelist\" name=f>\n";
    echo "<table border=0 cellpadding=0 cellspacing=2 align=center class=row0 style=\"border: 1px dashed #aaaaaa;\"><tr><td><table border=0 cellpadding=0 cellspacing=0 width=100%><tr>\n";
    echo "<td class=smb>Find:</td>\n";
    printf("<td class=sml><input class=sml type=text size=\"10\" name=search_for value=\"%s\"></td>\n", htmlspecialchars($search_for));
    if (is_member_of('Admin', 'Support', 'Manage')) {
        $user_list = "<option value=\"\">--- Any Requester ---</option>" . get_user_list("", $user_org_code, "{$requested_by}");
        echo "<td class=smb>&nbsp;&nbsp;Request&nbsp;By:</td><td class=sml><select class=sml name=requested_by>{$user_list}</select></td>\n";
    }
    if (is_member_of('Admin', 'Support')) {
        $user_list = "<option value=\"\">--- All Users ---</option>" . get_user_list("Support,Contractor", "", $user_no);
    }
    echo "<td class=smb align=right>&nbsp;&nbsp;Work&nbsp;By:</td><td class=sml><select class=sml name=user_no>{$user_list}</select></td>\n";
    printf("<td align=right><input type=checkbox value=1 name=uncharged%s></td><td align=left class=smb><label for=uncharged>Uncharged</label></td>\n", "{$uncharged}" != "" ? " checked" : "");
    printf("<td align=right><input type=checkbox value=1 name=charge%s></td><td align=left class=smb><label for=charge>Charge</label></td>\n", "{$charge}" != "" ? " checked" : "");
    echo "</tr></table></td>\n<tr><td><table border=0 cellpadding=0 cellspacing=0 width=100%>\n";
    include "system-list.php";
    if (is_member_of('Admin', 'Support')) {
        $system_list = get_system_list("", "{$system_id}", 35);
    } else {
        $system_list = get_system_list("CES", "{$system_id}", 35);
    }
    echo "<td class=smb>System:</td><td class=sml><font size=1><select class=sml name=system_id><option value=\"\">--- All Systems ---</option>{$system_list}</select></font></td>\n";
    if (is_member_of('Admin', 'Support')) {
        include "organisation-list.php";
        $orglist = "<option value=\"\">--- All Organisations ---</option>\n" . get_organisation_list("{$org_code}", 35);
<?php

/*---------------------------------------------------------------
author:	alim karim
date:	April 18, 2007
file:	tng_manage_permissions_code.php

desc:	code behind permission manager.
---------------------------------------------------------------*/
include_once 'classes/class_login.php';
include_once 'classes/class_dbconn.php';
session_start();
$user_list =& get_user_list();
$obj_list = array();
$obj_disallowed_list = array();
// form is being loaded first time or
// it is being loaded through ajax
if (isset($_SESSION['obj_login'])) {
    global $user_list;
    global $obj_list;
    global $xslt_user;
    if (isset($_POST['ajax_action'])) {
        switch ($_POST['ajax_action']) {
            // the user wishes
            // to limit the list of layers that they see.
            case "search_uname":
                $xml = generate_object_list_xml($user_list, $_POST['ajax_uname']);
                //$html = generate_html($xml, $xslt_user);
                echo $xml;
                break;
                // the user has selected/changed selection
Example #7
0
     if ($sql_del) {
         return true;
     }
     return false;
 }
 #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### ####
 #### Поехали ->
 //Del
 if (@$_REQUEST['act'] == "del") {
     del_user($_REQUEST['id']);
 }
 //Ban
 if (@$_REQUEST['act'] == "ban") {
     ban_user($_REQUEST['id'], $_REQUEST['time'] * 3600 * 24);
 }
 $db = get_user_list();
 echo '<p class="mes">Пользователи</p>';
 //View
 if (@$_REQUEST['act'] == 'view') {
     echo '<table border="0" cellpadding=1 cellspacing=1 valign=top >';
     foreach (get_profile($_REQUEST['id']) as $key => $value) {
         if ($key !== "password") {
             echo '
             <tr>
                     <td><p>[' . $key . '] </p></td><td><p> ' . $value . '</p></td>
             </tr>';
         }
     }
     echo '</table>';
 }
 echo '<br><table border=1 cellpadding=0 cellspacing=0 valign=top style="direction:ltr; border-collapse:collapse;border-style:solid;border-color:#A3A3A3;border-width: 1pt">';
Example #8
0
$title = "{$system_name} Work Summary";
// Recommended way of limiting queries to not include sub-tables for 7.1
$result = awm_pgexec($dbconn, "SET SQL_Inheritance TO OFF;");
// Initialise variables.
if (!isset($from_date)) {
    $from_date = date('01/m/y', mktime(0, 0, 0, date("m"), 0, date("Y")));
}
if (!isset($to_date)) {
    $to_date = date('d/m/y', mktime(0, 0, 0, date("m"), 0, date("Y")));
}
if (!isset($break_columns)) {
    $break_columns = 2;
}
if (is_member_of('Admin', 'Accounts')) {
    $system_list = get_system_list("", $system_id);
    $user_list = get_user_list("Support", "", $users);
} else {
    $system_list = get_system_list("CES", $system_id);
    $users = array($session->user_no);
    $user_list = "<option value=\"" . $session->user_no . "\">" . substr($session->fullname, 0, 25) . " (" . $session->abbreviation . ")" . "</option>";
}
$organisation_list = get_organisation_list($organisation_code);
$request_types = get_code_list("request", "request_type", "{$request_type}");
$quote_types = get_code_list("request_quote", "quote_type", "{$quote_type}");
$period_total = "week";
$select_columns = array("" => "", "Organisation" => "o.org_name", "System" => "ws.system_desc", "WR#" => "r.request_id", "Work By" => "rtu.fullname", "Request Brief" => "r.brief", "Request Status" => "r.last_status");
// $select_columns=array(""=>"","Organisation"=>"o.org_name","System"=>"r.system_id","WR#"=>"r.request_id","Work By"=>"rtu.fullname","Request Brief"=>"r.brief","Request Status"=>"r.last_status");
function buildSelect($name, $key_values, $current)
{
    // global $select_columns;
    $select = "<select name=\"" . $name . "\" class=\"sml\" id=\"" . $name . "\">\n";
Example #9
0
/**
 * Created by PhpStorm.
 * User: macbook
 * Date: 3/2/16
 * Time: 9:30 AM
 */
require_once "../../util/main.php";
require_once __DIR__ . "/../../../shared/model/user_db.php";
require_once __DIR__ . "/../../../shared/model/database.php";
$action = strtolower(filter_input(INPUT_POST, 'action'));
if (empty($action)) {
    $action = 'show_users';
}
switch ($action) {
    case 'show_users':
        $user_list = get_user_list();
        include 'view.php';
        break;
    case 'login':
        $usr_id = filter_input(INPUT_POST, "usr_id");
        $_SESSION['prev_usr_id'] = $user->usr_id;
        $user = User::getUserByUsrId($usr_id);
        $_SESSION['user'] = $user;
        if ($user->usr_type_cde == 'TCH') {
            // The user is an teacher, so they are directed to teacher page
            header("Location: ../../teacher/index.php");
        } else {
            // The user is a student, they are directed to the student sign up page
            header("Location: ../../Student/index.php");
        }
        break;
Example #10
0
function show_user_list($data_list, $page = 1)
{
    $len = count($data_list);
    echo "\n        <table class=\"table table-striped user-list\">\n            <thead>\n                <tr>\n                    <th>ID</th>\n                    <th>用户名</th>\n                    <th>性别</th>\n                </tr>\n            </thead>\n            <tbody>";
    for ($index = 0; $index < $len; $index++) {
        $id = $data_list[$index][0];
        $name = $data_list[$index][1];
        $gender = $data_list[$index][2];
        $height = $data_list[$index][3];
        $weight = $data_list[$index][4];
        $birth = $data_list[$index][5];
        $country = $data_list[$index][6];
        $city = $data_list[$index][7];
        echo "\n            <tr>\n                <td>\n                    {$id}\n                </td>\n                <td>\n                    {$name}\n                    <button type='button' class='btn btn-info pull-right' title='用户资料'\n                        data-container='body' data-toggle='popover' data-placement='left''\n                        data-content='身高: {$height} 体重: {$weight} 生日: {$birth} 国家: {$country} 城市: {$city}'>资料</button>\n                </td>\n                <td>\n                    {$gender}<button class='btn btn-toolbar fa fa-plus-circle center-block pull-right'\n                                   data-toggle='modal' data-target='#advice' onclick='get_toUserId({$id})'></button>\n                </td>\n            </tr> ";
    }
    echo "\n            </tbody>\n        </table>";
    $total_len = get_user_len();
    echo "\n    <div class=\"row\">\n        <nav style=\"text-align: center\">\n            <ul class=\"pagination\">";
    for ($index = 1; $index < $total_len / 5 + 1; $index++) {
        echo "\n            <li><a href=\"?page={$index}\">{$index}</a></li>";
    }
    echo "\n            </ul>\n        </nav>\n    </div>";
}
if ($page == null) {
    $data_list = get_user_list(0);
    show_user_list($data_list);
} else {
    $num = ($page - 1) * 5;
    $data_list = get_user_list($num);
    show_user_list($data_list);
}
Example #11
0
 if (isset($conf_UAM['ADDLASTVISIT']) and $conf_UAM['ADDLASTVISIT'] == 'true') {
     // +-----------------------------------------------------------------------+
     // |                           initialization                              |
     // +-----------------------------------------------------------------------+
     if (!defined('PHPWG_ROOT_PATH')) {
         die('Hacking attempt!');
     }
     include_once PHPWG_ROOT_PATH . 'admin/include/functions.php';
     // +-----------------------------------------------------------------------+
     // | Check Access and exit when user status is not ok                      |
     // +-----------------------------------------------------------------------+
     check_status(ACCESS_ADMINISTRATOR);
     // +-----------------------------------------------------------------------+
     // |                               user list                               |
     // +-----------------------------------------------------------------------+
     $page['filtered_users'] = get_user_list();
     // +-----------------------------------------------------------------------+
     // |                               user list                               |
     // +-----------------------------------------------------------------------+
     $visible_user_list = array();
     foreach ($page['filtered_users'] as $num => $local_user) {
         $visible_user_list[] = $local_user;
     }
     foreach ($visible_user_list as $local_user) {
         // dates formating and compare
         // ---------------------------
         $today = date("d-m-Y");
         // Get today's date
         list($day, $month, $year) = explode('-', $today);
         // explode date of today
         $daytimestamp = mktime(0, 0, 0, $month, $day, $year);
    foreach ($title_objs as $title_obj) {
        if ($item_title != '') {
            $item_title .= ' ';
        }
        $item_title .= $title_obj->getVar('title', 's');
    }
    $item_type_id = $item_basic_obj->get('item_type_id');
    $item_type_obj =& $item_type_handler->get($item_type_id);
    $item_type = $item_type_obj->getVar('display_name', 's');
    $item_url = sprintf('%s/transfer_item.php?action=detail_item&item_id=%u', XOONIPS_URL, $item_id);
    $evenodd = $evenodd == 'even' ? 'odd' : 'even';
    $items[] = array('EVENODD' => $evenodd, 'ITEM_ID' => $item_id, 'ITEM_TYPE' => $item_type, 'ITEM_TITLE' => $item_title, 'ITEM_URL' => $item_url);
}
// get to user list
$to_uid = $formdata->getValue('get', 'tuid', 'i', false, 0);
$to_users = get_user_list('s');
foreach ($to_users as $key => $to_user) {
    if ($to_uid == 0) {
        $to_uid = $to_user['uid'];
    }
    $to_users[$key]['selected'] = $to_uid == $to_user['uid'];
}
if ($to_uid == 0 || count($to_users) == 0) {
    // to user not exists
    die('illegal request');
}
// get to index list
$to_urxid = get_user_root_index_id($to_uid);
$to_indexes = get_index_list($to_urxid, 0);
// override root index name
$to_indexes[0]['index_title'] = XNP_PRIVATE_INDEX_TITLE;
Example #13
0
if (!empty($_GET['action']) && !empty($_GET['user_id'])) {
    switch ($_GET['action']) {
        case 'tutorial_end':
            if ($_GET['user_id'] != $_SESSION['user_id']) {
                echo json_encode("error");
                exit;
            }
            update_user($_GET['user_id'], array('viewed_tutorial' => 1));
            echo json_encode("success");
            exit;
            break;
    }
}
admin_page();
include 'includes/overall/overall_header.php';
$users = get_user_list();
?>
<link rel="stylesheet" type="text/css" href="/javascript/datatables/media/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="/javascript/datatables/media/js/jquery.dataTables.js"></script>

<h1><a href="admin.php">Administration</a> - Manage Users</h1>
<div>
	<ul>
		<li>Search all users</li>
		<li>To edit a user, click on the username</li>
	</ul>
	<table id="users-table" class="hover stripe" style="cursor: pointer;">
		<thead>
			<tr>
				<th>Username</th>
				<th>Full Name</th>
Example #14
0
<?php

include 'function.php';
if (isset($_GET["action"])) {
    switch ($_GET["action"]) {
        case "get_user_list":
            $value = get_user_list();
            break;
        case "get_user_info":
            $value = get_user_info($_GET["id"]);
            break;
        case "upload_file":
            $value = upload_file();
            break;
    }
} else {
    if (isset($_POST["action"])) {
        switch ($_POST["action"]) {
            case "upload_file":
                $value = upload_file();
                break;
            case "create_user":
                $value = create_user();
                //$value = array("chad","*****@*****.**");
                break;
        }
    }
}
$value = create_user();
exit(json_encode($value));
function get_user_list()
Example #15
0
  <a data-toggle="modal" href="#myModal" id="modal-user_list"></a>

  <!-- Modal -->
  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title"><?php 
lang('User List');
?>
</h4>
        </div>
        <div class="modal-body">
			<?php 
get_user_list(array('display_name' => 'display_name', 'user_id' => 'user_id'));
?>
        </div>
        
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->


<form name="form_1" id="form_1" action="" method="POST" class="validation">

<div class="row">
<div class="col-md-8">

<?php 
$car['name'] = '';
                // the caller wishes to add a new
                // user to the db
            // the caller wishes to add a new
            // user to the db
            case "add_user":
                $uname = $_POST['ajax_uname'];
                $passwd = $_POST['ajax_passwd'];
                $fname = $_POST['ajax_fname'];
                $lname = $_POST['ajax_lname'];
                $email = $_POST['ajax_email'];
                $active = $_POST['ajax_active'];
                add_user($uname, $passwd, $fname, $lname, $email, $active);
                // regenerate the user list
                // and send back the new list
                // as xml
                get_user_list($user_list);
                $xml = generate_object_list_xml($user_list, "");
                echo $xml;
                break;
        }
    }
}
///
/// get_user_list()
/// get the user list from the
/// database
///
function get_user_list(&$user_list)
{
    $user_list = array();
    $sql_str = "SELECT " . "uid, " . "uname " . "FROM " . "tng_user ";
Example #17
0
      </ul>
  </span>
    </div>


  <?php 
if ($tab === 'users') {
    ?>
    <div id="users" class="table-responsive">
      <h3>Users</h3>
      <div class="text-center">
        <table class="table table-striped text-center">
          <?php 
    $link = connectDB();
    //output student table.
    $results = get_user_list();
    if (!$results) {
        echo "Database Error";
    } else {
        // table headers
        echo '<thead><tr>';
        echo '<th><div class="text-center"><a href="add-user-form.php">
                         <img class="table-icon" src="./res/image/add-user.png"></a></div></th>
                          <th><div class="text-center">Username</div></th>
                          <th><div class="text-center">Email</div></th>
                          <th><div class="text-center">Admin</div></th>
                          ';
        echo '</tr></thead>';
        echo '<tbody>';
        //fill in rows with data
        while ($row = mysql_fetch_assoc($results)) {