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

PHP SC类代码示例

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

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



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

示例1: __construct

 /**
  * @param Base $Base
  * @param string $table
  */
 public function __construct(SC $Base, $table)
 {
     $this->Base = $Base;
     $this->table = $table;
     $this->escapeChar = $Base->getEscapeQuote();
     $this->fkEnding = $Base->getFkEnding();
     $this->tableClause = "{$this->escapeChar}{$table}{$this->escapeChar}";
     $this->whereClause = '1';
 }
开发者ID:onesimus-systems,项目名称:seed-catalog,代码行数:13,代码来源:Collection.php


示例2: success

 public function success()
 {
     $this->view->title = 'Налаштування';
     $this->view->alert = 'Налаштування успішно збережено';
     $this->view->data = $this->model->getUserInfo(SC::getSession('id'));
     $this->view->render('userSettings/index');
 }
开发者ID:olehpitsun,项目名称:duplom.comv2.2.1,代码行数:7,代码来源:userSettingsController.php


示例3: checkPrivileges

	public function checkPrivileges($o)
	{
		$username=SC::get('userdata.username');
		if(in_array($username,array('dev1','dev2'))){
			return true;
			
		}
		
		$uid=SC::get('userdata.user_id');
		$dao=DaoFactory::create('user/admin');
		$dao->select('count(user_id) as count');
		$dao->byUserId($uid);
		$rs=$dao->execute();
		if(!$rs->isSuccess())
		{
			throw new CircuitDatabaseException('query admin users failed', $rs);
		}
		$count=$rs->fetchrow(DB_ASSOC);
        
		if($count['count']==0)
		{
	  		$message = "This page is not available under the current configuration, or ";
	      	$message .= "you are not authorized to view this page.";
	      	$o->set('error.message', $message);
	      	$o->set('error.code', GENERAL_MESSAGE);
	      	$o->set('error.title', 'Not Authorized');
	      	$o->set('error.line', __LINE__);
	      	$o->set('error.file', __FILE__);
			return false;
		}
		return true;
	}
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:32,代码来源:requiremsrpermissions.model.php


示例4: getAllUsers

 public function getAllUsers()
 {
     $user_id = SC::getCookie('id');
     $u = $this->db->select('tests', 'id,name,date', 'user_id=' . $user_id . '');
     if ($this->db->getCount() != 0) {
         $users = '<div class="table-responsive">';
         $users .= '<table class="table table-condensed table-bordered table-hover">';
         $users .= '<thead><tr class="caption">';
         $caption = array('#', 'Назва тесту', 'Дата створення');
         $cook = SC::getCookie('id');
         foreach ($caption as $k => $v) {
             $users .= '<th  style="text-align: center,width:200px; ">' . $v . '</th>';
         }
         $users .= '</tr></thead>';
         for ($i = 0; $i < sizeof($u); $i++) {
             // if ( $u[$i]['id'] != SC::getCookie ( 'id' ) ) {
             $users .= '<tr>';
             foreach ($u[$i] as $k => $v) {
                 //if ( $k != 'password' && $k != 'date' && $k != 'activateCode' && $k != 'hash' ) {
                 $users .= '<td><a href="' . URL . '?c=testsResult&f=showOne&p=' . $u[$i]['id'] . '">' . $v . '</a></td>';
                 //}
             }
             $users .= '</tr>';
             //}
         }
         $users .= '</table>';
         $users .= '</div>';
     }
     return $users;
 }
开发者ID:olehpitsun,项目名称:duplom.comv2.2.1,代码行数:30,代码来源:testsResultModel.php


示例5: checkUserData

 public function checkUserData($login, $password)
 {
     $user = $this->db->select('users', 'id, password, group, date, activate', "`login`='{$login}'");
     if ($this->db->getCount() == 1) {
         $user = $user[0];
     } else {
         return 0;
     }
     /*
      * Якщо користувач не активований, то повідомляємо про це
      */
     if ($user['activate'] == 0) {
         return 2;
     }
     if (Hash::checkHash($password, $user['password'])) {
         $randHash = Hash::getRandomHash();
         SC::setCookie('id', $user['id']);
         SC::setSession('id', $user['id']);
         SC::setCookie('login', $login);
         SC::setSession('login', $login);
         SC::setCookie('group', $user['group']);
         SC::setSession('group', $user['group']);
         SC::setCookie('userHash', $randHash);
         SC::setSession('userHash', $randHash);
         $this->db->update('users', array('hash' => $randHash), "`id`='{$user['id']}'");
         $this->getCountBYDay();
         return 1;
     } else {
         return 0;
     }
 }
开发者ID:olehpitsun,项目名称:duplom.comv2.2.1,代码行数:31,代码来源:loginModel.php


示例6: getAllUsers

 public function getAllUsers()
 {
     $u = $this->db->select_order('pages', 'id,title,url', 'id', 'DESC');
     if ($this->db->getCount() != 0) {
         $users = '<div class="table-responsive">';
         $users .= '<table class="table table-condensed table-bordered table-hover">';
         $users .= '<thead><tr class="caption">';
         $caption = array('#', 'Заголовок', 'URL', 'Дії');
         $cook = SC::getCookie('id');
         foreach ($caption as $k => $v) {
             $users .= '<th  style="text-align: center,width:200px; ">' . $v . '</th>';
         }
         $users .= '</tr></thead>';
         for ($i = 0; $i < sizeof($u); $i++) {
             // if ( $u[$i]['id'] != SC::getCookie ( 'id' ) ) {
             $users .= '<tr>';
             foreach ($u[$i] as $k => $v) {
                 //if ( $k != 'password' && $k != 'date' && $k != 'activateCode' && $k != 'hash' ) {
                 $users .= '<td>' . $v . '</td>';
                 //}
             }
             $users .= '<td>';
             $users .= '<a class="users-info-links" href="?c=managePages&f=edit&p=' . $u[$i]['id'] . '">Редагувати</a><br />';
             $users .= '<a class="users-info-links" href="?c=managePages&f=delete&p=' . $u[$i]['id'] . '">Видалити</a>';
             $users .= '</td>';
             $users .= '</tr>';
             //}
         }
         $users .= '</table>';
         $users .= '</div>';
     }
     return $users;
 }
开发者ID:olehpitsun,项目名称:duplom.comv2.2.1,代码行数:33,代码来源:managePagesModel.php


示例7: getAllInfo

 public function getAllInfo()
 {
     $u = $this->db->select_order('guestbook', '*', 'id', 'DESC');
     if ($this->db->getCount() != 0) {
         $data = '<div class="table-responsive">';
         $data .= '<table class="table table-condensed table-bordered table-hover">';
         $data .= '<thead><tr class="caption">';
         $caption = array('#', 'Автор', 'Email', 'Текст', 'Дата', 'Відповісти');
         $cook = SC::getCookie('id');
         foreach ($caption as $k => $v) {
             $data .= '<th  style="text-align: center,width:200px; ">' . $v . '</th>';
         }
         $data .= '</tr></thead>';
         for ($i = 0; $i < sizeof($u); $i++) {
             $data .= '<tr>';
             foreach ($u[$i] as $k => $v) {
                 $data .= '<td>' . $v . '</td>';
             }
             $data .= '<td>';
             $data .= '<a class="users-info-links" href="?c=manageGuestBook&f=answer&p=' . $u[$i]['id'] . '&email=' . $u[$i]['email'] . '"> Відповісти</a>';
             $data .= '</td>';
             $data .= '</tr>';
         }
         $data .= '</table>';
         $data .= '</div>';
     }
     return $data;
 }
开发者ID:olehpitsun,项目名称:duplom.comv2.2.1,代码行数:28,代码来源:manageGuestBookModel.php


示例8: getAllImagesById

 public function getAllImagesById($id)
 {
     $u = $this->db->select('images', 'id,title,img', "gallery_id='{$id}' ORDER BY id DESC");
     if ($this->db->getCount() != 0) {
         $data = '<div class="table-responsive">';
         $data .= '<table class="table table-condensed table-bordered table-hover">';
         $data .= '<thead><tr class="caption">';
         $caption = array('#', 'Назва', 'Титульне зображення', 'Дії');
         foreach ($caption as $k => $v) {
             $data .= '<th style="text-align: center">' . $v . '</th>';
         }
         $data .= '</tr></thead>';
         for ($i = 0; $i < sizeof($u); $i++) {
             if ($u[$i]['id'] != SC::getCookie('id')) {
                 $data .= '<tr>';
                 foreach ($u[$i] as $k => $v) {
                     if ($k == "img") {
                         $data .= '<td><img src="public/gal_img/' . $v . '" width="230px" height="180px"></td>';
                     } else {
                         $data .= '<td>' . $v . '</td>';
                     }
                 }
                 $data .= '<td>';
                 $data .= '<a class="users-info-links" href="?c=manageImages&f=edit&p=' . $u[$i]['id'] . '">Редагувати</a><br />';
                 $data .= '<a class="users-info-links" href="?c=manageImages&f=delete&p=' . $u[$i]['id'] . '">Видалити</a>';
                 $data .= '</td>';
                 $data .= '</tr>';
             }
         }
         $data .= '</table>';
         $data .= '</div>';
     }
     return $data;
 }
开发者ID:olehpitsun,项目名称:duplom.comv2.2.1,代码行数:34,代码来源:manageImagesModel.php


示例9: getTeachers

 public function getTeachers()
 {
     $u = $this->db->select('rozklad_teachers', '*');
     if ($this->db->getCount() != 0) {
         $users = '<div class="table-responsive">';
         $users .= '<table class="table table-condensed table-bordered table-hover">';
         $users .= '<thead><tr class="caption">';
         $caption = array('#', 'Прізвище', 'Ім\'я', 'По-батькові', 'Дії');
         $cook = SC::getCookie('id');
         foreach ($caption as $k => $v) {
             $users .= '<th  style="text-align: center,width:200px; ">' . $v . '</th>';
         }
         $users .= '</tr></thead>';
         for ($i = 0; $i < sizeof($u); $i++) {
             $users .= '<tr>';
             foreach ($u[$i] as $k => $v) {
                 $users .= '<td>' . $v . '</td>';
             }
             $users .= '<td>';
             $users .= '<a class="users-info-links" href="?c=manageRozkladsTeachers&f=edit&p=' . $u[$i]['id'] . '">Редагувати</a><br />';
             $users .= '<a class="users-info-links" href="?c=manageRozkladsTeachers&f=delete&p=' . $u[$i]['id'] . '">Видалити</a>';
             $users .= '</td>';
             $users .= '</tr>';
         }
         $users .= '</table>';
         $users .= '</div>';
     }
     return $users;
 }
开发者ID:olehpitsun,项目名称:duplom.comv2.2.1,代码行数:29,代码来源:manageRozkladsTeachersModel.php


示例10: execute

 /**
  * Execute
  */
  function execute(&$observer)
  {
      
      // MOD RJH
      // Modification Date: 11-18-2004
      // Add Tracking for all actions into a single consolidated Admin Log Table
      // using Sushi to store data
      // TRACKING
      // ID (pk), USER ID(ind), IP(ind), datetime, request page, POST/GET
      if( preg_match("/^10./",$_SERVER['REMOTE_ADDR']) )  return TRUE;
     
      $GAIALOG = serialize(array($_GET,$_POST));
      $dao_logging =& DaoFactory::create('admincpanellog.insert');
      $dao_logging->setUserId(SC::get('userdata.user_id'));
      $dao_logging->setUsername(SC::get('userdata.username'));
      $dao_logging->setUserIp($_SERVER['REMOTE_ADDR']);
      $dao_logging->setDatetime(SC::get('board_config.time_now'));
      $dao_logging->setRequestFilename($_SERVER['SCRIPT_NAME']);
      $dao_logging->setRequestData($GAIALOG);
      $rs =& $dao_logging->execute();
      if(!$rs->isSuccess()) 
      {
          $observer->set('error.message', "Unable to connect to the database, please try again later.");
          $observer->set('error.title', 'Database Error');
          $observer->set('error.code', GENERAL_ERROR);
          $observer->set('error.line', __LINE__);
          $observer->set('error.file', __FILE__);
          return FALSE;
      }
      
      return TRUE;
      
  }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:36,代码来源:adminaccesslog.model.php


示例11: delete

 public function delete()
 {
     $api = new SCApi();
     $arr = $api->usersessions_delete(true);
     if ($arr["loggedout"]) {
         SC::transfer();
     }
 }
开发者ID:jeffreytierney,项目名称:switchcomb,代码行数:8,代码来源:usersessions.php


示例12: jsonify

 public function jsonify($callback = null)
 {
     $fields = array("from", "author", "subject", "body", "to", "bcc", "header");
     $props = array();
     foreach ($fields as $id => $field) {
         $props[$field] = $this->{$field};
     }
     return SC::jsonify($props, $callback);
 }
开发者ID:jeffreytierney,项目名称:switchcomb,代码行数:9,代码来源:SCEmail.php


示例13: create

 public function create()
 {
     try {
         $api = new SCApi();
         $user = $api->users_create();
         SC::checkRedir(SCRoutes::set("users", "memberships_index", array("userid" => $user->userid)));
     } catch (Exception $ex) {
         SC::setFlashMessage($ex->getMessage(), "error");
         $this->_new();
     }
 }
开发者ID:jeffreytierney,项目名称:switchcomb,代码行数:11,代码来源:users.php


示例14: execute

 function execute(&$observer)
 {
     if (SC::isEmpty('userdata.user_id') || !require_level(USERLEVEL_ADMINISTRATION_TEAM)) {
         $observer->set('error.title', 'Permissions Error');
         $observer->set('error.message', 'You do not have permission to access this function.');
         $observer->set('error.line', __LINE__);
         $observer->set('error.file', __FILE__);
         return FALSE;
     }
     return TRUE;
 }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:11,代码来源:requireadminteampermissions.model.php


示例15: getNumNewDoc

 public function getNumNewDoc()
 {
     if (SC::getSession('group') == 'lector') {
         $current_date = date('Y-m-d');
         $e = $this->db->select('lab_documents', '*', ' date > ' . $current_date . '');
         $e = $this->db->getCount();
     } else {
         $e = null;
     }
     return $e;
 }
开发者ID:olehpitsun,项目名称:duplom.comv2.2.1,代码行数:11,代码来源:cabinetModel.php


示例16: execute

 /**
  * Execute the model
  * @param Container    The Observer object.
  * @return bool        TRUE if successful, else FALSE.
  * @access public
  */
 function execute(&$observer)
 {
     if (SC::isEmpty('board_config.inventory_disable')) {
         return TRUE;
     }
     $observer->set('error.code', GENERAL_MESSAGE);
     $observer->set('error.title', 'Profile Disabled');
     $observer->set('error.message', 'The profile section of the site is currently disabled.');
     $observer->set('error.line', __LINE__);
     $observer->set('error.file', __FILE__);
     $observer->set('error.debug', backtrace());
     return FALSE;
 }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:19,代码来源:inventoryenabled.model.php


示例17: execute

 function execute(&$observer)
 {
     if (SC::isEmpty('board_config.econ_disabled')) {
         return TRUE;
     }
     $observer->set('error.code', GENERAL_MESSAGE);
     $observer->set('error.title', 'Econ Disabled');
     $observer->set('error.message', 'The economy of gaia is currently disabled.');
     $observer->set('error.line', __LINE__);
     $observer->set('error.file', __FILE__);
     $observer->set('error.debug', backtrace());
     return FALSE;
 }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:13,代码来源:econenabled.model.php


示例18: execute

   /**
    * Execute
    */
    function execute(&$observer)
    {
        if( SC::isEmpty("board_config.forum_disabled")) return TRUE; 
       
        $message = "The Site Forum is currently disabled";
        $observer->set('error.code', GENERAL_MESSAGE);
        $observer->set('error.message', $message);
        $observer->set('error.title', 'No Access');
        $observer->set('error.line', __LINE__);
        $observer->set('error.file', __FILE__);
        return FALSE;

        
    }
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:17,代码来源:checkforumenabled.model.php


示例19: execute

	/** execute
	 * check the password the user provided against their userdata and set an error if it is not correct
	 * @param $password
	 * @return true/false on correct password
	 **/
    function execute($password){
        
        if ($this->encryptPassword($password) != SC::get('userdata.user_password')) {
            
			if( $this->messenger) {
				$this->messenger->addMessage("The password you entered does not match our records. Please try again.");
			}
			
            $this->set('nopassword', true);
            return false;
		}
        
        return true;
	}
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:19,代码来源:checkpassword.model.php


示例20: execute

	public function execute( $gold, $messenger = false){
                	                
	        $gold = intval($gold);	        
                
                if( SC::get("userdata.user_gold") < $gold)
                {
                        if( $messenger)
                        $messenger->addMessage('You do not have enough gold. <a href="/info/gold">Click here to find out more about getting gold</a>.');
                        return FALSE;     
                }
                                        
                        
                return TRUE;
	}
开发者ID:GeniusXalid,项目名称:php-mvc,代码行数:14,代码来源:enoughgold.model.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP SC_CheckError_Ex类代码示例发布时间:2022-05-23
下一篇:
PHP SAML2_Utils类代码示例发布时间: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