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


PHP at函数代码示例

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


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

示例1: actionLogout

 public function actionLogout()
 {
     alog(at("User logged out."));
     AdminUser::model()->deleteAll('userid=:id', array(':id' => Yii::app()->user->id));
     Yii::app()->user->logout();
     fok(at('Thank You! You are now logged out.'));
     $this->redirect(array('/login'));
 }
开发者ID:qhyabdoel,项目名称:hris_mujigae,代码行数:8,代码来源:LoginController.php

示例2: init

 public function init()
 {
     parent::init();
     // Add Breadcrumb
     $this->addBreadCrumb(at('Salary Slip'));
     $this->title[] = at('Salary Slip');
 }
开发者ID:qhyabdoel,项目名称:hris_mujigae,代码行数:7,代码来源:SlipController.php

示例3: init

function init($confFiles)
{
    addLibsDirToIncludePath();
    requireStandardLibs();
    $conf = readConfig($confFiles);
    $e = trim(at($conf, 'admin.email'));
    if (empty($e) && APPLICATION_ENV != 'development') {
        echo "Configuration parameter admin.email is not set! This is necessary to ensure " . "someone is notified of any errors that occur.";
        exit(-1);
    }
    error_reporting(E_ALL);
    ini_set('display_errors', APPLICATION_ENV == 'development');
    require_once 'spare-parts/error-handling.php';
    \SpareParts\ErrorHandling\initErrorHandling($e);
    require_once 'chipin/env/log.php';
    \Chipin\Log\configure();
    # To make PHP shut-up regarding a default time-zone not being set.
    date_default_timezone_set("America/New_York");
    $dbParam = function ($p) use($conf) {
        return $conf['resources.db.params.' . $p];
    };
    DB\setConnectionParams($driver = 'mysql', $dbName = $dbParam('dbname'), $username = $dbParam('username'), $password = $dbParam('password'), $host = $dbParam('host'));
    if (APPLICATION_ENV == 'development') {
        require_once 'chipin/debug.php';
    }
}
开发者ID:JustAHappyKid,项目名称:bitcoin-chipin,代码行数:26,代码来源:init.php

示例4: getFieldValueForDisplay

 public function getFieldValueForDisplay($field, $userId)
 {
     // Check to see if we have that field user combination
     $row = UserCustomFieldData::model()->find('field_id=:field AND user_id=:user', array(':field' => $field->id, ':user' => $userId));
     if ($row) {
         // Return the value
         $value = $row->value;
     } else {
         // Return default
         $value = $field->default_value;
     }
     if ($field->type == 'yesno') {
         $text = $value ? at('Yes') : at('No');
     } elseif ($field->type == 'checkbox') {
         $text = $value ? at('Checked') : at('Not Checked');
     } elseif ($field->type == 'dropdown') {
         $valueArray = UserCustomField::model()->convertExtraToArray($field->extra);
         $text = is_array($valueArray) && isset($valueArray[$value]) ? $valueArray[$value] : $value;
     } elseif ($field->type == 'multi') {
         $valueArray = UserCustomField::model()->convertExtraToArray($field->extra);
         $selectedValue = explode(',', $value);
         if (count($selectedValue)) {
             $arr = array();
             foreach ($selectedValue as $selectedVal) {
                 $arr[] = is_array($valueArray) && isset($valueArray[$selectedVal]) ? $valueArray[$selectedVal] : $selectedVal;
             }
             $text = implode(', ', $arr);
         } else {
             $text = is_array($valueArray) && isset($valueArray[$selectedValue]) ? $valueArray[$selectedValue] : $selectedValue;
         }
     } else {
         $text = $value;
     }
     return $text;
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:35,代码来源:UserCustomFieldData.php

示例5: init

 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_attendances_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Attendances'));
     $this->title[] = at('Attendances');
 }
开发者ID:qhyabdoel,项目名称:hris_mujigae,代码行数:9,代码来源:AttendancesController.php

示例6: init

 public function init()
 {
     parent::init();
     // Check Access
     checkAccessThrowException('op_payroll_payments_view');
     // Add Breadcrumb
     $this->addBreadCrumb(at('Employee\'s Salaries'));
     $this->title[] = at('Employee\'s Salaries');
 }
开发者ID:qhyabdoel,项目名称:hris_mujigae,代码行数:9,代码来源:PaymentsController.php

示例7: uploadFileDone

function uploadFileDone($cmd, $volumes, $result)
{
    // Get result
    if (isset($result['added'])) {
        foreach ($result['added'] as $dir) {
            alog(at("Media Manager: Upload Completed '{name}'", array('{name}' => $dir['name'])));
        }
    }
}
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:9,代码来源:connector.php

示例8: actionIndex

 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     $this->layout = 'content-home';
     $this->addBreadCrumb(at('Dashboard'));
     $this->title[] = at('Dashboard');
     // renders the view file 'protected/views/site/index.php'
     // using the default layout 'protected/views/layouts/main.php'
     $this->render('index');
 }
开发者ID:qhyabdoel,项目名称:hris_mujigae,代码行数:13,代码来源:SiteController.php

示例9: actionLogout

 /**
  * Logout action
  */
 public function actionLogout()
 {
     // Log Message
     alog(at("User logged out."));
     // Delete records for this users from admin logged in
     AdminUser::model()->deleteAll('userid=:id', array(':id' => Yii::app()->user->id));
     Yii::app()->user->logout();
     fok(at('Thank You! You are now logged out.'));
     $this->redirect(array('/admin/login'));
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:13,代码来源:LoginController.php

示例10: logEvent

 /**
  * @param $where
  * @param $project
  * @param $map
  * @param $coords
  * @param $action
  */
 public static function logEvent($where, $project, $map, $coords, $action)
 {
     $event = array('dt' => time(), 'who' => at($_COOKIE, 'lme_auth_currentuserid', 0), 'where' => $where, 'project' => $project, 'map' => $map, 'coords' => $coords, 'action' => $action);
     try {
         $query = "INSERT INTO lme_eventlog\r\n            (dt, who, where, project, map, coords, action)\r\n            VALUES\r\n            (:dt, :who, :where, :project, :map, :coords, :action)";
         $sth = Config::getconnection()->prepare($query);
         $sth->execute($event);
     } catch (\PDOException $e) {
         die($e->getMessage());
     }
 }
开发者ID:KarelWintersky,项目名称:kwLiveMap,代码行数:18,代码来源:lme.eventlog.class.php

示例11: checkName

 public function checkName()
 {
     if ($this->isNewRecord) {
         if (AuthItem::model()->exists('name=LOWER(:name)', array(':name' => strtolower($this->name)))) {
             $this->addError('name', at('Sorry, That name is already in use.'));
         }
     } else {
         if (AuthItem::model()->exists('name=LOWER(:name) AND id!=:id', array(':id' => $this->id, ':name' => strtolower($this->name)))) {
             $this->addError('name', at('Sorry, That name is already in use.'));
         }
     }
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:12,代码来源:AuthItem.php

示例12: moveDataToRecap

 public function moveDataToRecap()
 {
     try {
         $query = "\n\t\t\t\tINSERT INTO attendance_presences_recap (employee_id, date, shift_id, check_in, check_out, break_out, break_in, total_hours, is_late, created_at ) \n\t\t\t\tSELECT employee_id, date, shift_id\n\t\t\t\t\t, min(case type when 'CI' then presence_date else NULL end) as `CheckIn`\n\t\t\t\t\t, max(case type when 'CO' then presence_date else NULL end) as `CheckOut`\n\t\t\t\t\t, max(case type when 'BO' then presence_date else NULL end) as `BreakOut`\n\t\t\t\t\t, min(case type when 'BI' then presence_date else NULL end) as `BreakIn`\n\t\t\t\t\t, 0, 0, now()\n\t\t\t\tFROM (SELECT employee_id, date, case type when 'LV' then 2 else (case type when 'S' then 3 else (case when shift_id IS NULL then 1 else shift_id end) end) end AS `shift_id`, type, presence_date\n\t\t\t\t\t\tFROM `attendance_presences`\n\t\t\t\t\t\tWHERE date BETWEEN '" . $this->start_date . "' AND '" . $this->end_date . "') AS A\n\t\t\t\tGROUP BY employee_id, date, shift_id\n\t\t\t";
         $command = Yii::app()->db->createCommand($query);
         $command->execute();
         fok(at('Data recapitulation successfully Generated.'));
     } catch (Exception $e) {
         ferror(at('Failed to generate data recapitulation. \\n' . $e));
         exit;
         $transaction->rollBack();
     }
 }
开发者ID:qhyabdoel,项目名称:hris_mujigae,代码行数:13,代码来源:GenerateAttendanceForm.php

示例13: init

 /**
  * init
  */
 public function init()
 {
     // Check Access
     checkAccessThrowException('op_media_view');
     // Make sure uploads directory is set
     if (!getParam('uploads_dir')) {
         throw new CHttpException(500, Yii::t('media', 'Sorry, You must set the uploads directory first. From the top menu Go to Tools -> Settings -> Missing Settings.'));
     }
     parent::init();
     // Add Breadcrumb
     $this->addBreadCrumb(at('Media Manager'));
     $this->title[] = at('Media Manager');
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:16,代码来源:MediaController.php

示例14: getRevisionById

 /**
  * Возвращаем ревизию информации о гексе по айди
  * @param $revision_id
  * @return array
  */
 public function getRevisionById($revision_id)
 {
     try {
         $query = "SELECT title, content, editor, edit_reason\r\n            FROM lme_map_tiles_data\r\n            WHERE id = :revision_id ";
         $sth = $this->connection->prepare($query);
         $sth->execute(array('revision_id' => $revision_id));
         $row = $sth->fetch(\PDO::FETCH_ASSOC);
         $info = array('message' => 'Fork revision #' . $revision_id, 'text' => $row['content'], 'title' => $row['title'], 'edit_reason' => "" . $row['edit_reason'], 'editor_name' => at($_COOKIE, 'kw_trpg_lme_auth_editorname', ""));
     } catch (\PDOException $e) {
         die($e->getMessage());
     }
     return $info;
 }
开发者ID:KarelWintersky,项目名称:kwLiveMap,代码行数:18,代码来源:lme.pdo.class.php

示例15: init

 public function init()
 {
     // Login required
     if (Yii::app()->getController()->id != 'login') {
         $returnUrl = Yii::app()->request->getUrl();
         if (strpos($returnUrl, '/admin') === false) {
             $returnUrl = array('/admin');
         }
         Yii::app()->user->setReturnUrl($returnUrl);
     }
     // Make sure we have access
     if (!Yii::app()->user->id || !checkAccess('admin')) {
         // Do we need to login
         if (!Yii::app()->user->id && Yii::app()->getController()->id != 'login') {
             $this->redirect(array('/admin/login'));
         }
         // Make sure we are not in login page
         if (Yii::app()->getController()->id != 'login') {
             throw new CHttpException(at('Sorry, You are not allowed to enter this section.'));
         }
     }
     // Make sure we have a valid admin user record
     if (Yii::app()->getController()->id != 'login' && Yii::app()->user->id && !AdminUser::model()->exists('userid=:id', array(':id' => Yii::app()->user->id))) {
         Yii::app()->user->logout();
         ferror(at('Your session expired. Please login.'));
         $this->redirect(array('/admin/login'));
     }
     // Check if we haven't clicked more then X amount of time
     $maxIdleTime = 60 * 60 * getParam('admin_logged_in_time', 5);
     // 5 hour default
     // Were we using an old session
     if (Yii::app()->getController()->id != 'login' && time() - $maxIdleTime > Yii::app()->session['admin_clicked']) {
         // Loguser out and redirect to login
         AdminUser::model()->deleteAll('userid=:id', array(':id' => Yii::app()->user->id));
         Yii::app()->user->logout();
         ferror(at('Your session expired. Please login.'));
         $this->redirect(array('/admin/login'));
     }
     // Delete old records
     AdminUser::model()->deleteAll('lastclick_time < :time', array(':time' => time() - $maxIdleTime));
     // Update only if this is not an ajax request
     if (!request()->isAjaxRequest) {
         // Update record info
         Yii::app()->session['admin_clicked'] = time();
         AdminUser::model()->updateAll(array('lastclick_time' => time(), 'location' => Yii::app()->getController()->id), 'userid=:id', array(':id' => Yii::app()->user->id));
     }
     // Add Breadcrumb
     $this->addBreadCrumb(at('Dashboard'), array('index/index'));
     parent::init();
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:50,代码来源:AdminController.php


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