本文整理汇总了PHP中Role::getWhere方法的典型用法代码示例。如果您正苦于以下问题:PHP Role::getWhere方法的具体用法?PHP Role::getWhere怎么用?PHP Role::getWhere使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Role
的用法示例。
在下文中一共展示了Role::getWhere方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: overwriteForm
public function overwriteForm($return, $returnfull)
{
$return['admin_ip'] = new Leap\View\InputText("hidden", "admin_ip", "admin_ip", $this->admin_ip);
$return['admin_inbox'] = new Leap\View\InputText("hidden", "admin_inbox", "admin_inbox", $this->admin_inbox);
$return['admin_nama_depan'] = new Leap\View\InputText("text", "admin_nama_depan", "admin_nama_depan", $this->admin_nama_depan);
$return['admin_nama_belakang'] = new Leap\View\InputText("hidden", "admin_nama_belakang", "admin_nama_belakang", $this->admin_nama_belakang);
$return['admin_lastupdate'] = new Leap\View\InputText("hidden", "admin_lastupdate", "admin_lastupdate", $this->admin_lastupdate);
$return['admin_email'] = new Leap\View\InputText("email", "admin_email", "admin_email", $this->admin_email);
$return['admin_aktiv'] = new Leap\View\InputSelect($this->arrayYesNO, "admin_aktiv", "admin_aktiv", $this->admin_aktiv);
$return['admin_foto'] = new Leap\View\InputText("hidden", "admin_foto", "admin_foto", $this->admin_foto);
$return['admin_inbox'] = new Leap\View\InputText("hidden", "admin_inbox", "admin_inbox", $this->admin_inbox);
$role = new Role();
$arrroles = $role->getWhere("role_active =1");
foreach ($arrroles as $rr) {
$arrRole[$rr->role_id] = Lang::t($rr->role_id);
}
$return['admin_role'] = new Leap\View\InputSelect($arrRole, "admin_role", "admin_role", $this->admin_role);
$return['admin_inbox_update'] = new Leap\View\InputText("hidden", "admin_inbox_update", "admin_inbox_update", $this->admin_inbox_update);
$return['admin_inbox_timestamp'] = new Leap\View\InputText("hidden", "admin_inbox_timestamp", "admin_inbox_timestamp", $this->admin_inbox_timestamp);
$arrType = ['admin', 'user', 'store'];
$return['admin_type'] = new Leap\View\InputSelect($arrType, "admin_type", "admin_type", $this->admin_type);
return $return;
}
示例2: ShowRole2RoleLevel
public function ShowRole2RoleLevel()
{
//create the model object
$cal = new Role2Role();
$arr = $cal->findLevels();
$t = time();
//pr($arr);
$rr = new Role();
$arrRoles = $rr->getWhere("role_active = 1");
?>
<script>
var arrayOfRoles = [];
</script>
<?php
foreach ($arrRoles as $role) {
?>
<script>
var r = {id:'<?php
echo $role->role_id;
?>
',level:0};
arrayOfRoles.push(r);
</script>
<?php
foreach ($arr as $lvl => $arrRole) {
foreach ($arrRole as $role2) {
if ($role->role_id == $role2) {
$arrSudahAda[$role2] = $role2;
}
}
}
}
//pr($arrSudahAda);
foreach ($arrRoles as $role) {
if (!in_array($role->role_id, $arrSudahAda)) {
$arrBlmAda[$role->role_id] = $role->role_id;
}
}
//pr($arrBlmAda);
foreach ($arr as $lvl => $x) {
$arrSorts[] = "#sortable_{$lvl}";
}
$str = implode(",", $arrSorts);
?>
<style>
.droptrue li{
list-style-type: none;
margin:5px;
background-color: #dedede;
padding:5px;
border-radius: 5px;
}
</style>
<script>
$(function() {
$( "ul.droptrue" ).sortable({
connectWith: "ul",
receive: function(event, ui) {
var sem = this.id;
var exp = sem.split("_");
for(var key in arrayOfRoles){
if(arrayOfRoles[key].id == ui.item.html()){
arrayOfRoles[key].level = parseInt(exp[1]);
}
}
console.log("[" + this.id + "] received [" + ui.item.html() + "] from [" + ui.sender.attr("id") + "]");
console.log(arrayOfRoles);
}
});
console.log(arrayOfRoles);
/*$( "ul.dropfalse" ).sortable({
connectWith: "ul",
dropOnEmpty: false
});*/
$( "<?php
echo $str;
?>
" ).disableSelection();
});
</script>
<style>
.droptrue{
width: 150px;
border:1px solid #888;
padding: 10px;
}
.lvlcon{
float: left;
width: 150px;
margin-right: 10px;
background-color: #efefef;
}
.lvlcon h3{
text-align: center;
}
</style>
<h1><?php
echo Lang::t('Role Adjuster');
//.........这里部分代码省略.........
示例3: AccountManagement
public function AccountManagement()
{
/*
* process search
*/
$s = TextP::getP("word");
$page = TextP::getP("page", 1);
$new = TextP::getP("new", 0);
if ($new) {
$invert_new = 0;
} else {
$invert_new = 1;
}
$searchText = '';
if ($s != "") {
$searchText = "\r\n WHERE\r\n admin_username LIKE '%{$s}%' OR admin_nama_depan LIKE '%{$s}%'";
if ($new) {
$searchText = " AND (admin_username LIKE '%{$s}%' OR admin_nama_depan LIKE '%{$s}%') ";
}
}
/*
* sort
*/
$sort = TextP::getP("sort", "admin_nama_depan");
$ord = TextP::getP("order", "ASC");
$orderText = " {$sort} {$ord}";
/*define order and sort*/
$order = $_SESSION['account_man_order'];
if ($order == "") {
$order = "ASC";
} elseif ($order == "ASC") {
$order = "DESC";
} else {
$order = "ASC";
}
$_SESSION['account_man_order'] = $order;
/*
* Pagination
*/
$limit = 20;
$begin = ($page - 1) * $limit;
global $db;
$acc = new Account();
$rl = new RoleLevel();
$ro = new RoleOrganization();
$am = new AccountMeta();
if ($new) {
$q = "SELECT * FROM `core__admin_account` WHERE NOT EXISTS (SELECT * FROM core__admin_account__metadata WHERE core__admin_account.admin_id = core__admin_account__metadata.account_id) {$searchText} ORDER BY\r\n {$orderText} LIMIT {$begin},{$limit}";
$qjumlah = "SELECT count(*) as nr FROM `core__admin_account` WHERE NOT EXISTS (SELECT * FROM core__admin_account__metadata WHERE core__admin_account.admin_id = core__admin_account__metadata.account_id) ";
$nr = $db->query($qjumlah, 1);
$jml = $nr->nr;
} else {
//normal query
$q = "\r\nSELECT\r\n admin_id,admin_username,admin_nama_depan,admin_role,admin_email,\r\n org.meta_value as org,\r\n level.meta_value as level\r\nFROM {$acc->table_name}\r\n LEFT JOIN {$am->table_name} AS org ON org.account_id = admin_id\r\n AND org.meta_key='RoleOrganization'\r\n LEFT JOIN {$am->table_name} AS level ON level.account_id = admin_id\r\n AND level.meta_key='RoleLevel'\r\n {$searchText} \r\nORDER BY\r\n {$orderText} LIMIT {$begin},{$limit}";
$jml = $acc->getJumlah($searchText);
}
//echo $q;
$arrCal = $db->query($q, 2);
//pr($arr);
/*
* get All Active Department
*/
$dp = new RoleOrganization();
$arrOrg = $dp->getWhere("organization_active = 1 AND organization_parent_id != 0");
//simpan ke array yang mudah
$arrOrg2 = array();
foreach ($arrOrg as $or) {
$arrOrg2[$or->organization_id] = $or;
}
//pr($arrOrg2);
/*
* get All Active Level
*/
$dp = new RoleLevel();
$arrOrg = $dp->getWhere("level_active = 1");
//simpan ke array yang mudah
$arrLevel = array();
foreach ($arrOrg as $or) {
$arrLevel[$or->level_id] = $or;
}
/*
* get All Active Role
*/
$dp = new Role();
$arrOrg = $dp->getWhere("role_active = 1");
//simpan ke array yang mudah
$arrRoles = array();
foreach ($arrOrg as $or) {
$arrRoles[$or->role_id] = $or;
}
$t = time();
?>
<style>
.clickable{
cursor: pointer;
}
</style>
<h1><?php
echo Lang::t('Account Management');
?>
//.........这里部分代码省略.........
示例4: Role2Menu
public function Role2Menu()
{
$t = time();
//create matrix to adjust menu
$arrMenu = Registor::getAllAdminMenuFromSession();
?>
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<td><?php
echo Lang::t('Menu');
?>
</td>
<td><?php
echo Lang::t('Min-Role');
?>
</td>
</tr>
</thead>
<tbody>
<?php
$r = new Role();
$existingRoles = $r->getWhere("role_active = 1 ORDER BY role_id ASC");
foreach ($arrMenu as $menu) {
$role = Role2Menu::getRoleForMenu($menu);
?>
<tr>
<td><?php
echo $menu;
?>
</td>
<td>
<select id="role_select_<?php
echo $menu;
?>
_<?php
echo $t;
?>
">
<?php
foreach ($existingRoles as $ro) {
?>
<option value="<?php
echo $ro->role_id;
?>
" <?php
if ($ro->role_id == $role) {
echo "selected";
}
?>
><?php
echo $ro->role_id;
?>
</option>
<?php
}
?>
</select>
<script>
$("#role_select_<?php
echo $menu;
?>
_<?php
echo $t;
?>
").change(function(){
var slc = $("#role_select_<?php
echo $menu;
?>
_<?php
echo $t;
?>
").val();
$.get("<?php
echo _SPPATH;
?>
RoleWeb/ins?menu=<?php
echo base64_encode($menu);
?>
&role_id="+slc);
});
</script>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
}