當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。