• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP utility类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中utility的典型用法代码示例。如果您正苦于以下问题:PHP utility类的具体用法?PHP utility怎么用?PHP utility使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了utility类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _initialize

 protected function _initialize()
 {
     global $lC_Vqmod;
     $lC_DirectoryListing = new lC_DirectoryListing(DIR_FS_CATALOG . 'addons');
     $lC_DirectoryListing->setRecursive(true);
     $lC_DirectoryListing->setIncludeDirectories(false);
     $lC_DirectoryListing->setCheckExtension('php');
     $lC_DirectoryListing->setStats(true);
     $enabled = '';
     $lC_Addons_data = array();
     foreach ($lC_DirectoryListing->getFiles() as $addon) {
         $ao = utility::cleanArr($addon);
         if ($ao['name'] != 'controller.php') {
             continue;
         }
         $nameArr = explode('/', $ao['path']);
         $class = $nameArr[count($nameArr) - 2];
         if (file_exists($ao['path'])) {
             include_once $lC_Vqmod->modCheck($ao['path']);
             $aoData = new $class();
             $_SESSION['lC_Addons_data'][$class] = array('type' => $aoData->getAddonType(), 'title' => $aoData->getAddonTitle(), 'description' => $aoData->getAddonDescription(), 'rating' => $aoData->getAddonRating(), 'author' => $aoData->getAddonAuthor(), 'authorWWW' => $aoData->getAddonAuthorWWW(), 'thumbnail' => $aoData->getAddonThumbnail(), 'version' => $aoData->getAddonVersion(), 'compatibility' => $aoData->getCompatibility(), 'installed' => $aoData->isInstalled(), 'mobile' => $aoData->isMobileEnabled(), 'enabled' => $aoData->isEnabled());
             if ($aoData->isEnabled()) {
                 $enabled .= $addon['path'] . ';';
             }
         }
     }
     if ($enabled != '') {
         $enabled = substr($enabled, 0, -1);
     }
     if (!file_exists(DIR_FS_WORK . 'cache/addons.cache')) {
         file_put_contents(DIR_FS_WORK . 'cache/addons.cache', serialize($enabled));
     }
     $this->_data = $_SESSION['lC_Addons_data'];
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:34,代码来源:addons.php


示例2: logEvent

 private function logEvent($eventCatagory, $loanID, $itemID)
 {
     $timeNow = date('Y-m-d H:i:s');
     $DBH = utility::connectToDB();
     if ($DBH == \NULL) {
         echo "Error connecting to database";
         exit;
     }
     $sql = "\n\t\t\t\tINSERT INTO eventLog \n\t\t\t\t\t   ( \n\t\t\t\t\t\t  FK_ITEM_ID,\n\t\t\t\t\t\t  FK_LOAN_ID,\n\t\t\t\t\t\t  event,\n\t\t\t\t\t\t  eventDate\n\t\t\t\t\t   )\n\t\t\t\t    VALUES\n\t\t\t\t\t   (\n\t\t\t\t\t\t  :id,\n\t\t\t\t\t\t  :loanID,\n\t\t\t\t\t\t  :event,\n\t\t\t\t\t\t  :eventDate\n\t\t\t\t\t   )\n\t\t\t\t";
     try {
         $STH = $DBH->prepare($sql);
         $STH->bindParam(':id', $itemID);
         $STH->bindParam(':loanID', $loanID);
         $STH->bindParam(':event', $eventCatagory);
         $STH->bindParam(':eventDate', $timeNow);
         $DBH->beginTransaction();
         $sqlError = $STH->execute();
         if (!$sqlError) {
             echo 'Error: updating event log data';
             print_r($DBH->errorInfo());
             echo "<p>";
             print_r($STH->errorInfo());
             exit;
         }
         $DBH->commit();
     } catch (PDOException $e) {
         echo 'Error: ' . $e->getMessage();
         $DBH = \NULL;
         return \FALSE;
     }
     $DBH = \NULL;
     return \TRUE;
 }
开发者ID:JLBR,项目名称:School-Projects,代码行数:33,代码来源:eventlog.class.php


示例3: getByOwner

 public function getByOwner($ownerID)
 {
     $DBH = utility::connectToDB();
     if ($DBH == \NULL) {
         return \NULL;
     }
     $sql = "\n\t\t\t\t  SELECT \n\t\t\t\t\t     * \n\t\t\t\t  FROM \n\t\t\t\t      items\n\t\t\t\t  WHERE \n\t\t\t\t\t  owner = :id\n\t\t\t\t  ";
     try {
         $STH = $DBH->prepare($sql);
         $STH->bindParam(':id', $ownerID);
         if ($STH->execute()) {
             $results = $STH->fetchAll();
         } else {
             echo 'Error: retreaving data\\n';
             print_r($DBH->errorInfo());
             print_r($STH->errorInfo());
             return \NULL;
         }
         $count = $STH->rowCount();
     } catch (PDOException $e) {
         echo 'Error: ' . $e->getMessage();
         $DBH = \NULL;
         return \NULL;
     }
     $DBH = \NULL;
     return Items::newCollection($results, $count);
 }
开发者ID:JLBR,项目名称:School-Projects,代码行数:27,代码来源:items.class.php


示例4: _doRegister

 /**
  * Register the new install with the LC API
  *  
  * @access private      
  * @return string
  */
 private function _doRegister($data)
 {
     global $lC_Database, $lC_Cache;
     if (isset($data['activation_email']) && $data['activation_email'] != NULL) {
         $storeEmail = $data['activation_email'];
     } else {
         $storeEmail = STORE_OWNER_EMAIL_ADDRESS;
     }
     if (isset($data['activation_serial']) && $data['activation_serial'] != NULL) {
         $storeSerial = $data['activation_serial'];
     } else {
         $storeSerial = '';
     }
     // register the install with LC API
     $registerArr = array('serial' => $storeSerial, 'storeName' => STORE_NAME, 'storeEmail' => $storeEmail, 'storeWWW' => HTTP_SERVER . DIR_WS_HTTP_CATALOG, 'storeSSL' => HTTPS_SERVER . DIR_WS_HTTPS_CATALOG, 'systemMetaData' => base64_encode(json_encode(lc_get_system_information())), 'serverMetaData' => isset($_SERVER) && is_array($_SERVER) ? base64_encode(json_encode($_SERVER)) : NULL, 'envMetaData' => isset($_ENV) && is_array($_ENV) ? base64_encode(json_encode($_ENV)) : NULL);
     $checksum = hash('sha256', json_encode($registerArr));
     $registerArr['checksum'] = $checksum;
     $api_version = defined('API_VERSION') && API_VERSION != NULL ? API_VERSION : '1_0';
     $registerArr['ver'] = utility::getVersion();
     $request_type = getRequestType();
     $resultXML = transport::getResponse(array('url' => $request_type . '://api.loadedcommerce.com/' . $api_version . '/register/install/', 'method' => 'post', 'parameters' => $registerArr, 'timeout' => 10));
     $newInstallationID = preg_match("'<installationID[^>]*?>(.*?)</installationID>'i", $resultXML, $regs) == 1 ? $regs[1] : NULL;
     $products = preg_match("'<products[^>]*?>(.*?)</products>'i", $resultXML, $regs) == 1 ? $regs[1] : NULL;
     if (lC_Server_info_Admin::updateInstallID($newInstallationID)) {
         return utility::arr2xml(array('error' => FALSE, 'installationID' => $newInstallationID, 'products' => $products));
     } else {
         return utility::arr2xml(array('error' => TRUE, 'message' => 'error processing the request'));
     }
 }
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:35,代码来源:api.php


示例5: isInstalled

 public function isInstalled()
 {
     if (utility::isB2B() === false) {
         return false;
     }
     return (bool) defined('MODULE_ORDER_TOTAL_TERMS_HANDLING_STATUS');
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:7,代码来源:terms_handling.php


示例6: setFunction

 public function setFunction($value, $value2 = null)
 {
     global $lC_Language;
     if (utility::isPro() === false) {
         $string = '<span class="input large-margin-bottom">
                <span class="icon-calendar mid-margin-right"></span>
                ' . lc_draw_input_field('attributes[' . self::getID() . ']', $value, 'id="attributes_' . self::getID() . '" class="input-unstyled datepicker"') . '
              </span>
              <span class="input relative disabled date-available-ends margin-bottom">
                <span class="icon-calendar mid-margin-right"></span>
                <div class="strong upsellwrapper" style="position:absolute;top:-29px;left:0px;">
                  <span class="upsellinfo" upselltitle="' . $lC_Language->get('text_availability_ends') . '" upselldesc="' . $lC_Language->get('text_availability_ends_desc') . '">Ends</span> ' . lc_go_pro() . '
                </div>
                ' . lc_draw_input_field('availability_ends_go_pro', null, 'id="availability_ends_go_pro" class="input-unstyled" disabled') . '
              </span>
              ';
     } else {
         $string = '<div class="no-wrap"><span class="input large-margin-bottom" style="width:46%;">
                <span class="icon-calendar mid-margin-right"></span>
                ' . lc_draw_input_field('attributes[' . self::getID() . ']', $value, 'id="attributes_' . self::getID() . '" class="input-unstyled datepicker"') . '
              </span>
              <span class="input relative date-available-ends margin-bottom" style="width:46%;">
                <span class="icon-calendar mid-margin-right"></span>
                <div class="strong" style="position:absolute;top:-29px;left:0px;">
                  <span>Ends</span>
                </div>
                ' . lc_draw_input_field('attributes2[' . self::getID() . ']', $value2, 'id="attributes2_' . self::getID() . '" class="input-unstyled datepicker"') . '
              </span></div>
              ';
     }
     return $string;
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:32,代码来源:date_available.php


示例7: Ret

 public static function Ret()
 {
     if (!self::$SINGLETON) {
         self::$SINGLETON = new utility();
     }
     return self::$SINGLETON;
 }
开发者ID:kydreth,项目名称:BreathePHP,代码行数:7,代码来源:utility.php


示例8: setMediaType

 public static function setMediaType()
 {
     $_SESSION['mediaType'] = $_GET['type'];
     $_SESSION['mediaSize'] = $_GET['size'];
     $browserArr = utility::detectBrowser();
     $_SESSION['browserName'] = $browserArr['name'];
     $_SESSION['browserVersion'] = $browserArr['version'];
     $result['rpcStatus'] = '1';
     echo json_encode($result);
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:10,代码来源:rpc.php


示例9: __construct

 public function __construct()
 {
     global $lC_Language, $lC_Api, $ioncube_check;
     $this->_page_title = $lC_Language->get('heading_title');
     $this->_has_wrapper = false;
     $this->_has_header = false;
     $this->_has_footer = false;
     // added for ioncube check
     $ioncube_check = utility::ioncubeCheck();
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:10,代码来源:login.php


示例10: process

 function process()
 {
     global $lC_ShoppingCart, $lC_Currencies;
     // restrict to payment and confirmation pages
     if (strstr($_SERVER['REQUEST_URI'], 'shipping=process') || strstr($_SERVER['REQUEST_URI'], 'confirmation')) {
         if (utility::isB2B() === true) {
             $value = isset($_SESSION['this_handling']) && $_SESSION['this_handling'] > 0 ? $_SESSION['this_handling'] : 0;
             $this->output[] = array('title' => $this->_title . ':', 'text' => $lC_Currencies->getSessionSymbolLeft() . number_format($value, DECIMAL_PLACES) . $lC_Currencies->getSessionSymbolRight(), 'value' => $value);
         }
     }
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:11,代码来源:terms_handling.php


示例11: getMaxOfArray

 public static function getMaxOfArray($ArrayToCheck)
 {
     $maxValue = 0;
     foreach ($ArrayToCheck as $temp) {
         if (is_array($temp)) {
             $maxValue = max($maxValue, utility::getMaxOfArray($temp));
         } else {
             $maxValue = max($maxValue, $temp);
         }
     }
     return $maxValue;
 }
开发者ID:Adrielpin,项目名称:gchartphp,代码行数:12,代码来源:utility.php


示例12: resize

 public function resize($image, $group_id)
 {
     if (lc_empty(CFG_APP_IMAGEMAGICK_CONVERT) || !@file_exists(CFG_APP_IMAGEMAGICK_CONVERT) || utility::execEnabled() === false) {
         return $this->resizeWithGD($image, $group_id);
     }
     if (!file_exists(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'])) {
         mkdir(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code']);
         @chmod(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'], 0777);
     }
     exec(escapeshellarg(CFG_APP_IMAGEMAGICK_CONVERT) . ' -resize ' . (int) $this->_groups[$group_id]['size_width'] . 'x' . (int) $this->_groups[$group_id]['size_height'] . ($this->_groups[$group_id]['force_size'] == '1' ? '!' : '') . ' ' . escapeshellarg(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[1]['code'] . '/' . $image) . ' ' . escapeshellarg(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image));
     @chmod(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image, 0777);
 }
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:12,代码来源:image.php


示例13: __construct

 /**
  * Constructor; load the category structure relationship data from the database
  *
  * @access public
  */
 public function __construct()
 {
     global $lC_Database, $lC_Cache, $lC_Language, $lC_Customer;
     if (SERVICES_CATEGORY_PATH_CALCULATE_PRODUCT_COUNT == '1') {
         $this->_show_total_products = true;
     }
     if ($lC_Cache->isEnabled() && $lC_Cache->read('category_tree-' . $lC_Language->getCode(), 720)) {
         $this->_data = $lC_Cache->getCache();
     } else {
         $Qcategories = $lC_Database->query('select c.categories_id, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url, c.categories_status, c.categories_visibility_nav, c.categories_visibility_box, c.access_levels, cd.categories_name, cd.categories_menu_name from :table_categories c, :table_categories_description cd where c.categories_status = 1 and c.categories_id = cd.categories_id and cd.language_id = :language_id');
         $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);
         $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
         $Qcategories->bindInt(':language_id', $lC_Language->getID());
         $Qcategories->appendQuery('order by c.parent_id, c.sort_order, cd.categories_name, cd.categories_menu_name');
         $Qcategories->execute();
         while ($Qcategories->next()) {
             // added to grab permalink if exists
             $Qpermalink = $lC_Database->query('select item_id, query, permalink from :table_permalinks where item_id = :item_id and language_id = :language_id and type = 1 limit 1');
             $Qpermalink->bindTable(':table_permalinks', TABLE_PERMALINKS);
             $Qpermalink->bindInt(':item_id', $Qcategories->valueInt('categories_id'));
             $Qpermalink->bindInt(':language_id', $lC_Language->getID());
             $Qpermalink->execute();
             $this->_data[$Qcategories->valueInt('parent_id')][$Qcategories->valueInt('categories_id')] = array('item_id' => $Qpermalink->valueInt('item_id'), 'name' => $Qcategories->value('categories_name'), 'menu_name' => $Qcategories->value('categories_menu_name'), 'query' => $Qpermalink->value('query'), 'permalink' => $Qpermalink->value('permalink'), 'image' => $Qcategories->value('categories_image'), 'count' => 0, 'mode' => $Qcategories->value('categories_mode'), 'link_target' => $Qcategories->valueInt('categories_link_target'), 'custom_url' => $Qcategories->value('categories_custom_url'), 'status' => $Qcategories->valueInt('categories_status'), 'nav' => $Qcategories->valueInt('categories_visibility_nav'), 'box' => $Qcategories->valueInt('categories_visibility_box'), 'access_levels' => $Qcategories->value('access_levels'));
         }
         if ($this->_show_total_products === true) {
             $this->_calculateProductTotals();
         }
         if (utility::isB2B() && !isset($_SESSION['admin'])) {
             $catArr = array();
             $gAccess = explode(';', $lC_Customer->getCustomerGroupAccess());
             foreach ($this->_data as $parent_id => $data) {
                 foreach ($data as $categories_id => $cData) {
                     $cAccess = explode(';', $cData['access_levels']);
                     foreach ($gAccess as $key => $gLevel) {
                         if (in_array($gLevel, $cAccess)) {
                             $catArr[$parent_id][$categories_id] = $cData;
                             break;
                         }
                     }
                 }
             }
             $this->_data = $catArr;
         }
         if ($lC_Cache->isEnabled()) {
             $lC_Cache->write($this->_data);
         }
     }
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:53,代码来源:category_tree.php


示例14: visitOnLoan

function visitOnLoan($member_id)
{
    global $dbs;
    $now = date('Y-m-d');
    // check if already checkin
    $query = $dbs->query('SELECT visitor_id FROM visitor_count WHERE member_id=\'' . $member_id . '\' AND checkin_date LIKE \'' . $now . '%\'');
    if ($query->num_rows < 1) {
        // get data
        $mquery = $dbs->query('SELECT member_name, inst_name FROM member WHERE member_id=\'' . $member_id . '\'');
        $mdata = $mquery->fetch_row();
        $member_name = $mdata[0];
        $institution = $mdata[1];
        // insert visit
        $checkin_date = date('Y-m-d H:i:s');
        $insert = $dbs->query("INSERT INTO visitor_count (member_id, member_name, institution, checkin_date) VALUES ('{$member_id}', '{$member_name}', '{$institution}', '{$checkin_date}')");
        if (!$insert) {
            utility::jsAlert(__('ERROR! Can\'t insert visitor counter data'));
            return false;
        }
    }
    return true;
}
开发者ID:mucill,项目名称:slims8_akasia,代码行数:22,代码来源:circulation_action.php


示例15: define

 */
/* Reserve List */
// key to authenticate
define('INDEX_AUTH', '1');
// main system configuration
require '../../../../sysconfig.inc.php';
// IP based access limitation
require LIB_DIR . 'ip_based_access.inc.php';
do_checkIP('smc');
do_checkIP('smc-circulation');
// start the session
require SENAYAN_BASE_DIR . 'admin/default/session.inc.php';
require SENAYAN_BASE_DIR . 'admin/default/session_check.inc.php';
// privileges checking
$can_read = utility::havePrivilege('circulation', 'r');
$can_write = utility::havePrivilege('circulation', 'w');
if (!$can_read) {
    die('<div class="errorBox">' . __('You don\'t have enough privileges to access this area!') . '</div>');
}
require SIMBIO_BASE_DIR . 'simbio_GUI/table/simbio_table.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/paging/simbio_paging.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/form_maker/simbio_form_element.inc.php';
require SIMBIO_BASE_DIR . 'simbio_DB/datagrid/simbio_dbgrid.inc.php';
require MODULES_BASE_DIR . 'reporting/report_dbgrid.inc.php';
$page_title = 'Reservation List Report';
$reportView = false;
if (isset($_GET['reportView'])) {
    $reportView = true;
}
if (!$reportView) {
    ?>
开发者ID:indonesia,项目名称:slims5_meranti,代码行数:31,代码来源:reserve_list.php


示例16: makeOutput

 /**
  * Method to make an output of document records
  *
  * @return  string
  */
 protected function makeOutput()
 {
     global $sysconf;
     // init the result buffer
     $_buffer = '';
     // keywords from last search
     $_keywords = '';
     // loop data
     $_i = 0;
     if (!$this->resultset) {
         return '<div class="errorBox">Query error : ' . $this->query_error . '</div>';
     }
     if (isset($_GET['keywords'])) {
         $_keywords = urlencode(trim(urldecode($_GET['keywords'])));
     }
     // include biblio list HTML template callback
     include SB . $sysconf['template']['dir'] . '/' . $sysconf['template']['theme'] . '/biblio_list_template.php';
     $settings = '';
     $settings = get_object_vars($this);
     $settings['keywords'] = $_keywords;
     while ($_biblio_d = $this->resultset->fetch_assoc()) {
         $_buffer .= biblio_list_format($this->obj_db, $_biblio_d, $_i, $settings, $return_back);
         $_i++;
     }
     // free resultset memory
     $this->resultset->free_result();
     // paging
     if ($this->num_rows > $this->num2show) {
         $_paging = '<div class="biblioPaging">' . simbio_paging::paging($this->num_rows, $this->num2show, 5) . '</div>';
     } else {
         $_paging = '';
     }
     $_biblio_list = '';
     $_is_member_logged_in = utility::isMemberLogin() && $this->enable_mark;
     if ($_paging) {
         $_biblio_list .= $_paging;
     }
     if ($_is_member_logged_in) {
         $_submit = '<div class="biblioMarkFormAction"><input type="submit" name="markBiblio" value="' . __('Put marked selection into basket') . '" /></div>';
         $_biblio_list .= '<form class="biblioMarkForm" method="post" action="index.php?p=member#biblioBasket">';
         $_biblio_list .= $_submit;
     }
     $_biblio_list .= $_buffer;
     if ($_is_member_logged_in) {
         $_biblio_list .= $_submit;
         $_biblio_list .= '</form>';
     }
     if ($_paging) {
         $_biblio_list .= $_paging;
     }
     return $_biblio_list;
 }
开发者ID:slims,项目名称:slims8_akasia,代码行数:57,代码来源:biblio_list_model.inc.php


示例17: strtolower

                                $subject_type = strtolower(substr($subject['term_type'], 0, 1));
                            }
                        }
                    }
                    $subject_id = getSubjectID($subject['term'], $subject_type, $subject_cache);
                    @$dbs->query("INSERT IGNORE INTO biblio_topic (biblio_id, topic_id, level) VALUES ({$biblio_id}, {$subject_id}, 1)");
                }
            }
            if ($biblio_id) {
                // write to logs
                utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' insert bibliographic data from P2P service (server:' . $p2pserver . ') with (' . $biblio['title'] . ') and biblio_id (' . $biblio_id . ')');
                $r++;
            }
        }
    }
    utility::jsAlert($r . ' records inserted to database.');
    echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\');</script>';
    exit;
}
/* RECORD OPERATION END */
/* SEARCH OPERATION */
if (isset($_GET['keywords']) && $can_read && isset($_GET['p2pserver'])) {
    $max_fetch = 20;
    # get server information
    $serverid = (int) $_GET['p2pserver'];
    $p2pserver = $sysconf['p2pserver'][$serverid]['uri'];
    $p2pserver_name = $sysconf['p2pserver'][$serverid]['name'];
    # get keywords
    $keywords = urlencode($_GET['keywords']);
    # $p2pquery = $p2pserver.'index.php?resultXML=true&keywords='.$_GET['keywords'];
    $data = modsXMLsenayan($p2pserver . "/index.php?resultXML=true&search=Search&keywords=" . $keywords, 'uri');
开发者ID:banumelody,项目名称:slims7_cendana,代码行数:31,代码来源:p2p.php


示例18: array

 * Copyright (C) 2007,2008  Arie Nugraha ([email protected])
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
$menu[] = array('Header', __('Panel'));
$menu[] = array(__('Change User Profiles'), MODULES_WEB_ROOT_DIR . 'system/app_user.php?changecurrent=true&action=detail', __('Change Current User Profiles and Password'));
if (utility::havePrivilege('bibliography', 'r') and utility::havePrivilege('bibliography', 'w')) {
    $menu[] = array(__('Add New Bibliography'), MODULES_WEB_ROOT_DIR . 'bibliography/index.php?action=detail', __('Add New Bibliographic Data/Catalog'));
}
if (utility::havePrivilege('circulation', 'r') and utility::havePrivilege('circulation', 'w')) {
    $menu[] = array(__('Start Transaction'), MODULES_WEB_ROOT_DIR . 'circulation/index.php?action=start', __('Start Circulation Transaction Proccess'));
}
if (utility::havePrivilege('circulation', 'r') and utility::havePrivilege('circulation', 'w')) {
    $menu[] = array(__('Quick Return'), MODULES_WEB_ROOT_DIR . 'circulation/quick_return.php', __('Quick Return Collection'));
}
if (utility::havePrivilege('membership', 'r') and utility::havePrivilege('membership', 'w')) {
    $menu[] = array(__('Add New Member'), MODULES_WEB_ROOT_DIR . 'membership/index.php?action=detail', __('Add New Library Member Data'));
}
开发者ID:indonesia,项目名称:slims5_meranti,代码行数:31,代码来源:submenu.php


示例19: do_checkIP

require '../../../sysconfig.inc.php';
// IP based access limitation
require_once LIB_DIR . 'ip_based_access.inc.php';
do_checkIP('smc');
do_checkIP('smc-system');
// start the session
require SENAYAN_BASE_DIR . 'admin/default/session.inc.php';
require SENAYAN_BASE_DIR . 'admin/default/session_check.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/table/simbio_table.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/paging/simbio_paging.inc.php';
require SIMBIO_BASE_DIR . 'simbio_DB/datagrid/simbio_dbgrid.inc.php';
// create token in session
$_SESSION['token'] = utility::createRandomString(32);
// privileges checking
$can_read = utility::havePrivilege('system', 'r');
$can_write = utility::havePrivilege('system', 'w');
if (!($can_read and $can_write)) {
    die('<div class="errorBox">' . __('You don\'t have enough privileges to view this section') . '</div>');
}
/* search form */
?>
<fieldset class="menuBox">
<div class="menuBoxInner backupIcon">
	<div class="per_title">
	    <h2><?php 
echo __('Database Backup');
?>
</h2>
  </div>
	<div class="sub_section">
	  <div class="action_button">
开发者ID:indonesia,项目名称:slims5_meranti,代码行数:31,代码来源:backup.php


示例20: extendedEncodeData

 /**
  * @brief Encodes the data as Extended Text.
  *
  * This specifies integer values from 0-4095, inclusive, encoded by two alphanumeric characters.
  *
  * @todo Add support for missing values
  */
 private function extendedEncodeData($data)
 {
     $encode_string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.';
     $max = utility::getMaxOfArray($data);
     $encodedData = array();
     if ($max > 4095) {
         $rate = $max / 4095.0;
         foreach ($data as $array) {
             if (is_array($array)) {
                 $encodedData2 = array();
                 foreach ($array as $elem) {
                     $toEncode = (int) $elem / $rate;
                     $s = '';
                     for ($i = 0; $i < 2; ++$i) {
                         $m = $toEncode % 64;
                         $toEncode /= 64;
                         $s = $encode_string[$m] . $s;
                     }
                     array_push($encodedData2, $s);
                 }
                 array_push($encodedData, $encodedData2);
             } else {
                 $toEncode = (int) $array / $rate;
                 $s = '';
                 for ($i = 0; $i < 2; ++$i) {
                     $m = $toEncode % 64;
                     $toEncode /= 64;
                     $s = $encode_string[$m] . $s;
                 }
                 array_push($encodedData, $s);
             }
         }
     } else {
         foreach ($data as $array) {
             if (is_array($array)) {
                 $encodedData2 = array();
                 foreach ($array as $elem) {
                     $s = '';
                     $toEncode = $elem;
                     for ($i = 0; $i < 2; ++$i) {
                         $m = $toEncode % 64;
                         $toEncode /= 64;
                         $s = $encode_string[$m] . $s;
                     }
                     array_push($encodedData2, $s);
                 }
                 array_push($encodedData, $encodedData2);
             } else {
                 $s = '';
                 $toEncode = $array;
                 for ($i = 0; $i < 2; ++$i) {
                     $m = $toEncode % 64;
                     $toEncode /= 64;
                     $s = $encode_string[$m] . $s;
                 }
                 array_push($encodedData, $s);
             }
         }
     }
     return $encodedData;
 }
开发者ID:ryanomite,项目名称:zapi,代码行数:68,代码来源:GChart.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP utils类代码示例发布时间:2022-05-23
下一篇:
PHP util类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap