本文整理汇总了PHP中connect::dbcon方法的典型用法代码示例。如果您正苦于以下问题:PHP connect::dbcon方法的具体用法?PHP connect::dbcon怎么用?PHP connect::dbcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类connect
的用法示例。
在下文中一共展示了connect::dbcon方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connect
function edit_privilege_one($table, $id)
{
if ($_SESSION['user_type'] == 1) {
return "1";
}
$ob1 = new connect();
if ($table == "users") {
$sql = mysqli_query($ob1->dbcon(), "SELECT * FROM `{$table}` WHERE `user_id` = '{$id}'");
} else {
$sql = mysqli_query($ob1->dbcon(), "SELECT * FROM `{$table}` WHERE `id` = '{$id}'");
}
if ($row = mysqli_fetch_array($sql)) {
if ($table != "accounts") {
//check if this assigned to this user
if ($row['assignedto'] == $_SESSION['user_id']) {
return "1";
}
}
if ($_SESSION['_' . $row['group']][$table] == 2 || $_SESSION['_' . $row['group']][$table] == 3 || $_SESSION['_' . $row['group']][$table] == 6 || $_SESSION['_' . $row['group']][$table] == 7) {
return "1";
} else {
return "0";
}
}
}
示例2: connect
function user_privilage($pri)
{
// to check peivilages using privilage id
$ob1 = new connect();
$sql = "SELECT * FROM user_group WHERE id='{$pri}' ";
return mysqli_query($ob1->dbcon(), $sql);
}
示例3: connect
function user_can_delete_groups($table)
{
$loguser = $_SESSION['user_id'];
$ob1 = new connect();
// $sql=" SELECT * FROM `user_group` WHERE `user_id` = '$loguser' AND ($table > '2' OR $table > '3' OR $table > '6' OR $table > '7' )";
if ($_SESSION['user_type'] == '1') {
$sql = "SELECT * FROM groups WHERE deleted = '0' ";
} else {
$sql = "SELECT user_group.*,groups.group_name FROM user_group\n LEFT OUTER JOIN groups ON user_group.group_id = groups.group_id\n WHERE user_group.user_id = '{$loguser}' AND (user_group.{$table} ='1' OR user_group.{$table} = '3' OR user_group.{$table} = '5' OR user_group.{$table} = '7' )";
}
// echo $sql;
return mysqli_query($ob1->dbcon(), $sql);
}
示例4: connect
function countrows1($tablename, $field, $value)
{
$ob1 = new connect();
$ids = join(',', $_SESSION['user_groups']);
$sql = mysqli_query($ob1->dbcon(), "SELECT COUNT(id) AS `count` FROM `{$tablename}` WHERE `deleted` = '0' AND `{$field}`='{$value}' AND `group` IN ({$ids})");
// this use for users
if ($_SESSION['user_type'] == '1') {
$sql = mysqli_query($ob1->dbcon(), "SELECT COUNT(id) AS `count` FROM `{$tablename}` WHERE `deleted` = '0' AND `{$field}`='{$value}' ");
// this use for admin
}
$row = mysqli_fetch_assoc($sql);
return $row['count'];
}
示例5: connect
function viewdatalimit_contact($limit, $offset, $contact)
{
$ob1 = new connect();
$ids = join(',', $_SESSION['user_groups']);
// user groups
$sql = "SELECT call_log.* , users.user_name AS owner, modi.user_name AS modified, assi.user_name AS assigned, contacts.contact_firstname, groups.group_name, accounts.account_name\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM call_log INNER JOIN users ON\n\t\t call_log.call_owner=users.user_id\n\t\t INNER JOIN contacts ON\n\t\t \t\t call_log.contact_id=contacts.id\n\t\t LEFT OUTER JOIN users AS modi ON\n\t\t \t\t call_log.call_modified_by=modi.user_id\n\t\t LEFT OUTER JOIN users AS assi ON\n\t\t \t\t call_log.assignedto=assi.user_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN groups ON\n\t\t\t\t\t\t\t\t call_log.group_id=groups.group_id\n\t\t\t\t\t\t\t\t LEFT OUTER JOIN accounts ON\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t contacts.contact_account = accounts.id\n\t\t \t\t WHERE call_log.deleted = '0' AND call_log.cli = '{$contact}' ";
if ($_SESSION['user_type'] != 1) {
$sql .= "AND call_log.group IN ({$ids}) ";
}
// if($_SESSION['user_type']!='1'){ // view call log filter with group
// $sql.=" AND groups.group_id='$_SESSION[user_group]' ";
// }
$sql .= "ORDER BY `id` DESC LIMIT {$limit} OFFSET {$offset}";
//set lime and offset
// echo $sql;
return mysqli_query($ob1->dbcon(), $sql);
}