| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/hkosl.com/littleark/webadmin/ |
Upload File : |
<?php
$page_settings = array(
'formid' => 'Sys_cms_user', // for permission
'section' => 'System Setting', // parent/page title
'subsection' => 'User Management', // page title
'domain' => 'sys_cms_user', // table/model name
'access' => 'GNr', // for permission
);
require_once "check_login.php";
$login_user_info = SysCmsLogin::where('cmsloginid', '=', (int)$_SESSION["cmsloginid"])->first();
$query = SysCmsLogin::with('supplier')->whereDeleted(0);
// vdump(grant('SUr'), grant('SAr'));
if (grant('SUr')) {
if (!grant('SAr')) {
// admin can update users
$query->where('cmsrole', 'user');
} else {
// all permission no extra filter
}
} else {
// agent admin
if (grant('AGr')) {
// agent supplier
$suppliers = Supplier::whereDeleted(0)
->where('settlement_type', 'AGENT')
->where('agent_id', SysCmsLogin::agentId())
->where('agent_id', '>', '0')
->get();
foreach ($suppliers as $supplier) {
$supplier_ids[] = $supplier->id;
}
$query->whereIn('supplier_id', $supplier_ids);
} else {
// supplier admin
$query->where('supplier_id', SysCmsLogin::supplierId())
->where('supplier_id', '>', '0');
}
}
$rows = $query->orderBy('cmsusername', 'ASC')->get();
// dq(1);
?>
<!DOCTYPE html>
<html>
<head>
<?php require_once "_html_head.php"; ?>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<?php require_once "_header.php"; ?>
<?php require_once "_menu.php"; ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= _lang($page_settings['subsection']); ?>
<small><?= _lang("Index"); ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> <?= _lang($page_settings['section']); ?></a></li>
<li class="active">
<a href="<?= $page_settings['domain']; ?>_index.php"><?= _lang($page_settings['subsection']); ?></a>
</li>
</ol>
<div class="col-md-12 msg">
<?php if (isset($_GET["msg"])) {
echo $_GET['msg'];
}
?>
</div>
</section>
<!-- Main content -->
<section class="content">
<!-- Your Page Content Here -->
<!-- main table -->
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-body">
<div class="table-responsive">
<table id="example2" class="table table-bordered table-hover datatable-with-filter">
<thead>
<tr>
<th><?= _lang('Supplier'); ?></th>
<th><?= _lang('User Name'); ?></th>
<th><?= _lang('Login Name'); ?></th>
<th><?= _lang('Role'); ?></th>
<th class="no-filter">
<a href="<?= $page_settings['domain']; ?>_addform.php" class="btn btn-sm btn-primary pull-right">
<?= _lang('Create'); ?>
</a>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($rows as $row) { ?>
<tr>
<td><?= _h($row->supplier["name_{$wlangcode}"]); ?></td>
<td><?= _h($row["cmsusername"]); ?></td>
<td><?= _h($row["cmsloginname"]); ?></td>
<td><?= _h($row["cmsrole"]); ?></td>
<td class="tr width1px">
<div class="btn-group display_flex">
<?php if ($row{'cmsloginid'} != $_SESSION["cmsloginid"]) { ?>
<?php if (!$row['cmsstatus']) { ?>
<a href="<?= $page_settings['domain']; ?>_status.php?cmsloginid=<?= $row['cmsloginid']; ?>" class="btn btn-sm btn-warning">
<i class="fa fa-times" aria-hidden="true"></i> </a>
<?php } else { ?>
<a href="<?= $page_settings['domain']; ?>_status.php?cmsloginid=<?= $row['cmsloginid']; ?>" class="btn btn-sm btn-success">
<i class="fa fa-check" aria-hidden="true"></i> </a>
<?php } ?>
<?php } ?>
<a href="<?= $page_settings['domain']; ?>_modifyform.php?cmsloginid=<?= $row['cmsloginid']; ?>" class="btn btn-sm btn-primary">
<i class="fa fa-pencil" aria-hidden="true"></i> </a>
<?php if ($row{'cmsloginid'} != $_SESSION["cmsloginid"]) { ?>
<a href="<?= $page_settings['domain']; ?>_delete.php?cmsloginid=<?= $row['cmsloginid']; ?>" class="btn btn-sm btn-danger confirm-delete">
<i class="fa fa-trash" aria-hidden="true"></i> </a>
<?php } ?>
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<!-- End of Your Page Content Here -->
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<?php require_once "_footer.php"; ?>
<?php require_once "_aside.php"; ?>
</div><!-- ./wrapper -->
<!-- REQUIRED JS SCRIPTS -->
<?php require_once "_html_script.php"; ?>
</body>
</html>