/var/www/hkosl.com/b2b2c/webadmin/sys_cms_user_index.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php

    $page_settings 
= array(
        
'formid'     => 'Sys_cms_user'// for permission
        
'section'    => 'System Setting'// parent/page title
        
'subsection' => 'Admin Management'// page title
        
'domain'     => 'sys_cms_user'// table/model name
        
'access'     => 'GNr'// for permission
    
);


    require_once 
"check_login.php";

    
$sql         "select profile_id
            from `profile_user` as tb where user_id = ? and deleted = ? LIMIT 1"
;
    
$parameters  = array($_SESSION['cmsloginid'], 0);
    
$row_profile bind_pdo($sql$parameters"selectone");

    
$login_user_info SysCmsLogin::where('cmsloginid''=', (int)$_SESSION["cmsloginid"])->first();

    
$sql        "select * from sys_cms_login where cmsrole != ? and deleted = ?";
    
$parameters = array('user'0);
    
$rows       bind_pdo($sql$parameters"selectall");
?>
<!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="scroll_left_right_container">
                                <div class="scroll_left_right"><img src="../img/scroll_left_right.png"></div>
                            </div>

                            <div class="table-responsive">
                                <table id="example2" class="table table-bordered table-hover datatable-with-filter">
                                    <thead>
                                    <tr>
                                        <th style="min-width: 100px;"><? if ($_GET['type'] == 'user') { ?><?= _lang('Email'?><? } else { ?><?= _lang('User Name'?><? ?></th>
                                        <!--<th><?= _lang('Login Name'?></th>-->
                                        <th style="min-width: 100px;"><?= _lang('Role'?></th>
                                        <th style="min-width: 120px;" class="no-filter">
                                            <? if ($login_user_info['cmsrole'] != 'user' && $_GET['type'] == 'admin') { ?>
                                                <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(aes_crypt($row["cmsloginname"], 2)) ?></td>
                                            <td>
                                                <?= _h($row["cmsrole"]) ?></td>
                                            <td class="tr">
                                                <div class="btn-group">
                                                    <?php if ($row{'cmsloginid'} != $_SESSION["cmsloginid"] && $row['cmsrole'] != 'user') { ?>
                                                        <?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"] && $row['cmsrole'] != 'user') { ?>
                                                        <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>