当前位置: 首页>>代码示例>>PHP>>正文


PHP connect::dbcon方法代码示例

本文整理汇总了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";
         }
     }
 }
开发者ID:sandakinhs,项目名称:iCRM3,代码行数:25,代码来源:check_privileges.php

示例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);
 }
开发者ID:sandakinhs,项目名称:iCRM3,代码行数:7,代码来源:UserController.php

示例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);
 }
开发者ID:sandakinhs,项目名称:iCRM3,代码行数:13,代码来源:GroupController.php

示例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'];
 }
开发者ID:sandakinhs,项目名称:iCRM3,代码行数:13,代码来源:pagesettings.php

示例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);
 }
开发者ID:sandakinhs,项目名称:iCRM3,代码行数:17,代码来源:Call.php


注:本文中的connect::dbcon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。