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

PHP SQL类代码示例

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

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



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

示例1: view

 public function view()
 {
     RoutingEngine::setPage("runnDAILY View Route", "PV__300");
     RoutingEngine::getInstance()->registerParams("rid");
     if (!isset($_GET["rid"])) {
         Page::redirect("/routes");
     }
     $rid = $_GET["rid"];
     //$route = Route::fromRouteIdentifier($rid);
     $route = Route::sql()->select("routes.*, u_username, u_uid")->leftjoin("users", "u_uid", "r_uid", true)->where_eq("r_id", $rid)->execute(true, false);
     //get training types for create new training modal
     /*$stmt = Database::getDB()->prepare("
     			SELECT t_type_id, t_type_name
     			FROM training_types
     		");
     		$stmt->execute();
     		$stmt->store_result();
     		$types = array();
     		while($row = $stmt->fetch_assoc()){
     			$types[] = array("id"=>$row["t_type_id"], "name"=>$row["t_type_name"]);
     		}
     		$stmt->close();*/
     $types_sql = new SQL("training_types");
     $types = $types_sql->select("t_type_id, t_type_name")->execute(false, true);
     //$training_items = TrainingLog::getItemsForUserForRoute(User::$current_user->uid, $rid);
     $training_items = TrainingLog::sql()->select("r_name, t_rid, t_tid, t_time, t_distance, t_pace, t_date, t_comment")->leftjoin("routes", "r_id", "t_rid")->where_eq("t_uid", User::$current_user->uid)->where_eq("t_rid", $rid)->orderby("t_date")->execute(false, true);
     RoutingEngine::getSmarty()->assign("t_types", $types);
     RoutingEngine::getSmarty()->assign("route_view", $route);
     RoutingEngine::getSmarty()->assign("training_items", $training_items);
 }
开发者ID:byronwall,项目名称:runnDAILY,代码行数:30,代码来源:routes.php


示例2: fcpf_categories_select

/**
 * Get the categories list
 *
 * @param integer Parent category ID
 * @param integer Level
 * @return array Categories
 */
function fcpf_categories_select($parent_category_ID = -1, $level = 0)
{
    global $blog, $DB;
    $result_Array = array();
    $SQL = new SQL();
    $SQL->SELECT('cat_ID, cat_name');
    $SQL->FROM('T_categories');
    $SQL->WHERE('cat_blog_ID = ' . $DB->quote($blog));
    if ($parent_category_ID == -1) {
        $SQL->WHERE_and('cat_parent_ID IS NULL');
    } else {
        $SQL->WHERE('cat_parent_ID = ' . $DB->quote($parent_category_ID));
    }
    $SQL->ORDER_BY('cat_name');
    $categories = $DB->get_results($SQL->get());
    if (!empty($categories)) {
        foreach ($categories as $category) {
            $result_Array[] = array('value' => $category->cat_ID, 'label' => str_repeat('   ', $level) . $category->cat_name);
            $child_Categories_opts = fcpf_categories_select($category->cat_ID, $level + 1);
            if ($child_Categories_opts != '') {
                foreach ($child_Categories_opts as $cat) {
                    $result_Array[] = $cat;
                }
            }
        }
    }
    return $result_Array;
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:35,代码来源:_file_create_posts.form.php


示例3: _clean

 public static function _clean($max)
 {
     $db = new SQL(0);
     $conn = $db->Verbindungsnr(0);
     $max = mysql_real_escape_string(time() - $max, $conn);
     return mysql_query("DELETE FROM `user_sessions` WHERE `access` < '{$max}'", $conn);
 }
开发者ID:andreaskasper,项目名称:askbot_php,代码行数:7,代码来源:class.Session.php


示例4: smarty_function_init_language

function smarty_function_init_language($params, &$smarty)
{
    global $site, $leht;
    $content_template =& $leht->content_template;
    ##################
    # default values
    extract($params);
    if (!isset($name)) {
        $name = "language";
    }
    # / default values
    ###################
    $sql = $site->db->prepare("SELECT keel_id AS id, nimi AS name, extension FROM keel WHERE on_kasutusel");
    $sth = new SQL($sql);
    $sth->debug->msg($sth->debug->get_msgs());
    while ($result = $sth->fetch()) {
        // if not in editor and use aliases has been enabled
        if (!$site->in_editor && $site->CONF['use_aliases']) {
            $result['href'] = $site->CONF['wwwroot'] . '/' . $result['extension'];
        } else {
            $result['href'] = $site->CONF['wwwroot'] . ($site->in_editor ? '/editor' : '') . '/?lang=' . $result['extension'];
        }
        $result['home_id'] = $site->alias(array('key' => 'rub_home_id', 'keel' => $result['id']));
        $language[] = $result;
    }
    ##############
    # assign to template variables
    $smarty->assign(array($name => $language));
}
开发者ID:sauruscms,项目名称:Saurus-CMS-Community-Edition,代码行数:29,代码来源:function.init_language.php


示例5: test

 public function test()
 {
     $sql = new SQL();
     $doc = $sql->main();
     echo $doc;
     $this->assertNotEquals($doc, true);
 }
开发者ID:chetantarale,项目名称:sample_php_mysql,代码行数:7,代码来源:test.php


示例6: uninstall_b2evolution

/**
 * Uninstall b2evolution: Delete DB & Cache files
 */
function uninstall_b2evolution()
{
    global $DB;
    /* REMOVE PAGE CACHE */
    load_class('_core/model/_pagecache.class.php', 'PageCache');
    // Remove general page cache
    $PageCache = new PageCache(NULL);
    $PageCache->cache_delete();
    // Skip if T_blogs table is already deleted. Note that db_delete() will not throw any errors on missing tables.
    if ($DB->query('SHOW TABLES LIKE "T_blogs"')) {
        // Get all blogs
        $blogs_SQL = new SQL();
        $blogs_SQL->SELECT('blog_ID');
        $blogs_SQL->FROM('T_blogs');
        $blogs = $DB->get_col($blogs_SQL->get());
        $BlogCache =& get_BlogCache('blog_ID');
        foreach ($blogs as $blog_ID) {
            $Blog = $BlogCache->get_by_ID($blog_ID);
            // Remove page cache of current blog
            $PageCache = new PageCache($Blog);
            $PageCache->cache_delete();
        }
    }
    /* REMOVE DATABASE */
    db_delete();
    echo '<p>' . T_('Reset done!') . '</p>';
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:30,代码来源:_functions_delete.php


示例7: forum_do_edit_stick

function forum_do_edit_stick(&$sqlm)
{
    global $forum_lang, $user_lvl, $mmfpm_db;
    $sqlm = new SQL();
    $sqlm->connect($mmfpm_db['addr'], $mmfpm_db['user'], $mmfpm_db['pass'], $mmfpm_db['name']);
    if ($user_lvl == 0) {
        error($forum_lang['no_access']);
    }
    if (!isset($_GET['id'])) {
        error($forum_lang['no_such_topic']);
    } else {
        $id = $sqlm->quote_smart($_GET['id']);
    }
    if (!isset($_GET['state'])) {
        error('Bad request, please mail admin and describe what you did to get this error.');
    } else {
        $state = $sqlm->quote_smart($_GET['state']);
    }
    $sqlm->query('
		UPDATE mm_forum_posts
		SET sticked = ' . $state . '
		WHERE id = ' . $id . '');
    $sqlm->close();
    redirect('forum.php?action=view_topic&id=' . $id . '');
    // Queries : 1
}
开发者ID:BACKUPLIB,项目名称:Infinity_MaNGOS,代码行数:26,代码来源:forum_topic_edit.php


示例8: TreeSearch

 function TreeSearch($searches, $classes, $language_id = 0)
 {
     global $site;
     $this->classes = (array) $classes;
     foreach ($this->classes as $i => $class) {
         $this->classes[$i] = "'" . mysql_real_escape_string($class) . "'";
     }
     $sql = 'select tyyp_id from tyyp where klass in (' . implode(',', $this->classes) . ');';
     $result = new SQL($sql);
     $this->classes = array();
     while ($row = $result->fetch('ASSOC')) {
         $this->classes[] = $row['tyyp_id'];
     }
     $where = 'tyyp_id in (' . implode(',', $this->classes) . ') and keel = ' . mysql_real_escape_string($language_id) . ' ';
     foreach ($searches as $field => $keyword) {
         $where .= ' and ' . mysql_real_escape_string($field);
         if ($field == 'objekt_id' || $field == 'ttyyp_id' || $field == 'page_tyyp_id' || $field == 'kesk') {
             $where .= ' = ' . (int) $keyword;
         } else {
             $where .= " like '%" . mysql_real_escape_string($keyword) . "%' ";
         }
     }
     $sql = 'select objekt_id from objekt where ' . $where . ';';
     //printr($sql);
     $result = new SQL($sql);
     while ($row = $result->fetch('ASSOC')) {
         $this->found_object_ids[] = $row['objekt_id'];
     }
 }
开发者ID:sauruscms,项目名称:Saurus-CMS-Community-Edition,代码行数:29,代码来源:explorerHelpers.classes.php


示例9: html_header

function html_header()
{
    if (!defined('SITE_ROOT')) {
        define('SITE_ROOT', './');
    }
    require SITE_ROOT . 'portal_config.php';
    require_once SITE_ROOT . 'include/database.class.php';
    $currentUserID = $_SESSION['current_userID'];
    $db = new SQL(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME, false);
    $db->query("SELECT * FROM forum_users WHERE id='{$currentUserID}'");
    if ($row = $db->fetch_array()) {
        $username = $row['username'];
        $realname = $row['realname'];
    }
    $db->close();
    if ($realname !== null) {
        $displayname = $realname;
    } else {
        $displayname = $username;
    }
    echo '
<div id="wrap">
<div class="navbar navbar-top"><div class="navbar-inner"><div class="container">
<a class="brand" href="#index.php"><div class="logo-ip"></div></a>
<div class="btn-group pull-left">
<a href="../forum" class="btn btn-inverse"><i class="icon-rss"></i> Forum Ishare</a>
</div>

<div class="btn-group">
  <button class="btn dropdown-toggle" data-toggle="dropdown"><i class="icon-list muted"></i> KampusLinks <span class="caret"></span></button>
  <ul class="dropdown-menu">
    <li><a href="http://mpp.eng.usm.my/">MPPUSMKKj Official Blog</a></li>
    <li><a href="http://hepp.eng.usm.my/">BHEPP USMKKj</a></li>
    <li><a href="http://infodesk.eng.usm.my/">Infodesk PPKT USMKKj</a></li>
    <li><a href="http://www.eng.usm.my/php/blockedIP/">Blocked Port List</a></li>
    <li><a href="http://elearning.usm.my/">e-Learning Portal</a></li>
    <li><a href="http://campusonline.usm.my/">CampusOnline Portal</a></li>
    <li><a href="http://www.tcom.usm.my/">Sistem Direktori Telefon USM</a></li>
    <li><a href="http://www.facebook.com/ppkt.eng.usm">Facebook PPKT USMKKj</a></li>
    <li class="divider"></li>
    <li><a href="http://hik3.net/refcode"><i class="icon-bookmark"></i> RefCode (Snippets)</a></li>
  </ul>
</div>
            
<div class="btn-group pull-right">
<a href="index.php" class="btn btn-primary"><i class="icon-home icon-white"></i> Home</a>
<a href="profile.php?id=' . $currentUserID . '" class="btn btn-inverse"><i class="icon-user"></i> ' . $displayname . '</a>
<button class="btn btn-danger dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
  <ul class="dropdown-menu">
    <li><a href="edit_profile.php"><i class="icon-edit muted"></i> Edit Profile</a></li>
    <li><a href="edit_sharerlink.php"><i class="icon-hdd muted"></i> Edit Sharerlink</a></li>
    <li class="divider"></li>
    <li><a href="../forum/login.php?action=out&id=' . $currentUserID . '"><i class="icon-off muted"></i> Logout</a></li>
  </ul>
</div>
            
</div></div></div>
';
}
开发者ID:heiswayi,项目名称:ishareportal,代码行数:59,代码来源:html.php


示例10: test

 public function test()
 {
     $sql = new SQL();
     echo "Hello";
     $doc = $sql->main();
     //$doc = false;
     $this->assertNotEquals($doc, false);
 }
开发者ID:mohammedzee1000,项目名称:sample_php_mysql,代码行数:8,代码来源:test.php


示例11: _load

 private static function _load($id)
 {
     if (isset(self::$_cache[$id])) {
         return;
     }
     $db = new SQL(0);
     self::$_cache[$id + 0] = $db->cmdrow(0, 'SELECT * FROM user_list WHERE id={0} LIMIT 0,1', array($id + 0));
 }
开发者ID:andreaskasper,项目名称:askbot_php,代码行数:8,代码来源:UserProfile.php


示例12: smarty_function_init_folders

function smarty_function_init_folders($params, &$smarty)
{
    global $site, $leht, $class_path;
    include_once $class_path . 'adminpage.inc.php';
    ##############
    # default values
    extract($params);
    if (!isset($name)) {
        $name = 'folders';
    }
    if (!isset($parent) && !isset($parent_dir)) {
        # default parent for file (folder "public/"): get folder ID of "public/"
        $sql = $site->db->prepare("SELECT objekt_id, relative_path FROM obj_folder WHERE relative_path = ? LIMIT 1", $site->CONF['file_path']);
        $sth = new SQL($sql);
        $folder = $sth->fetch();
        $parent_dir = $folder['relative_path'];
        $parent = $folder['objekt_id'];
    } elseif (isset($parent)) {
        # get parent folder info
        $parent = (int) $parent;
        if ($parent) {
            $sql = $site->db->prepare("SELECT objekt_id, relative_path FROM obj_folder WHERE objekt_id = ?", $parent);
            $sth = new SQL($sql);
        } else {
            return;
        }
    } elseif (isset($parent_dir)) {
        $parent_dir = preg_replace('#^/#', '', $parent_dir);
        $parent_dir = preg_replace('#/$#', '', $parent_dir);
        $sql = $site->db->prepare("SELECT objekt_id, relative_path FROM obj_folder WHERE relative_path = ? LIMIT 1", '/' . $parent_dir);
        $sth = new SQL($sql);
        if ($sth->rows == 1) {
            $folder = $sth->fetch();
            $parent_dir = $folder['relative_path'];
            $parent = $folder['objekt_id'];
        }
    } else {
        return;
    }
    $folders = array();
    $folders_from_fm = get_subfolders($parent);
    foreach ($folders_from_fm as $folder) {
        $obj = new stdClass();
        # Bug #2318
        $obj->title = $folder['title'];
        $obj->path = $folder['relative_path'];
        $obj->id = $folder['objekt_id'];
        # current folder ID
        $obj->parent_id = $folder['parent_id'];
        ## parent folder ID??
        $obj->fullpath = $site->absolute_path . $folder['relative_path'];
        # absolute path of the folder
        $obj->file_count = $folder['file_count'];
        $folders[] = $obj;
    }
    $smarty->assign($name, $folders);
    return;
}
开发者ID:sauruscms,项目名称:Saurus-CMS-Community-Edition,代码行数:58,代码来源:function.init_folders.php


示例13: allread

 public static function allread($data)
 {
     if (!MyUser::isloggedin()) {
         throw new APIException("Nicht angemeldet...", 100);
     }
     $db = new SQL(0);
     $db->cmd(0, 'DELETE * FROM user_notification WHERE user = {0}', true, array(MyUser::id()));
     return true;
 }
开发者ID:andreaskasper,项目名称:askbot_php,代码行数:9,代码来源:notification.php


示例14: get_realm_name

function get_realm_name($realm_id)
{
    global $realm_db;
    $sqlr = new SQL();
    $sqlr->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    $result = $sqlr->query("SELECT name FROM `realmlist` WHERE id = '{$realm_id}'");
    $realm_name = $sqlr->result($result, 0);
    return $realm_name;
}
开发者ID:scamp,项目名称:minimanager,代码行数:9,代码来源:get_lib.php


示例15: deleteKategorien

 /**
  * Delete a Categorie in DB
  * parameters = POST: Categorie ID
  */
 public function deleteKategorien()
 {
     require 'classes/SQL.php';
     $sql = new SQL();
     $sql->connect();
     $id = mysql_real_escape_string($_POST['id']);
     if (is_numeric($id)) {
         $sql->doThat('DELETE FROM quizCategories WHERE id=' . $id);
     }
 }
开发者ID:roderm,项目名称:mkn151,代码行数:14,代码来源:AdminKategorie.php


示例16: deleteQuestion

 /**
  * Remove Question in DB
  * parameters = POST: QuestionID
  */
 public function deleteQuestion()
 {
     require 'classes/SQL.php';
     $sql = new SQL();
     $sql->connect();
     $id = mysql_real_escape_string($_POST['id']);
     if (is_numeric($gameID)) {
         $sql->doThat('DELETE FROM quizQuestions WHERE id=' . mysql_real_escape_string($id));
     }
 }
开发者ID:roderm,项目名称:mkn151,代码行数:14,代码来源:AdminQuestion.php


示例17: getData

 /**
  * Execute the query and fetch data in required format to be written to DBF file.
  */
 function getData()
 {
     $objSQL = new SQL();
     $resultSet = $objSQL->getQueryResults($this->sqlQuery);
     $this->schema = $resultSet["Header"];
     $this->result = $resultSet["Data"];
     if ($resultSet["Memo"]) {
         $this->memodata = $resultSet["Memo"];
     }
 }
开发者ID:Apoooorv,项目名称:DBFProject,代码行数:13,代码来源:DBFWriter.php


示例18: smarty_function_save_mailinglist

/**
 * This source file is is part of Saurus CMS content management software.
 * It is licensed under MPL 1.1 (http://www.opensource.org/licenses/mozilla1.1.php).
 * Copyright (C) 2000-2010 Saurused Ltd (http://www.saurus.info/).
 * Redistribution of this file must retain the above copyright notice.
 * 
 * Please note that the original authors never thought this would turn out
 * such a great piece of software when the work started using Perl in year 2000.
 * Due to organic growth, you may find parts of the software being
 * a bit (well maybe more than a bit) old fashioned and here's where you can help.
 * Good luck and keep your open source minds open!
 * 
 * @package		SaurusCMS
 * @copyright	2000-2010 Saurused Ltd (http://www.saurus.info/)
 * @license		Mozilla Public License 1.1 (http://www.opensource.org/licenses/mozilla1.1.php)
 * 
 */
function smarty_function_save_mailinglist($params, &$smarty)
{
    global $site;
    extract($params);
    $user_id = (int) $user;
    if (!$user_id) {
        $user_id = $site->user->user_id;
    }
    ###################
    # salvestame mailinglistide valik
    # muide, kui kasutaja e-mail salvestati tühjana, siis ei lisata ka ühtegi meili-listi ja kustutatakse vanadki
    if ($user_id) {
        // get user data
        $sql = $site->db->prepare('select * from users where user_id = ?', $user_id);
        $result = new SQL($sql);
        $user_data = $result->fetch('ASSOC');
        ###################
        # salvestame mailinglistide valik
        # ja lisada uued mailinglistid
        ###################
        # kustutada vanad mailinglistid
        $sql = $site->db->prepare("SELECT user_mailinglist.objekt_id FROM user_mailinglist LEFT JOIN objekt ON user_mailinglist.objekt_id = objekt.objekt_id WHERE user_mailinglist.user_id = ? AND objekt.keel=?", $user_id, $site->keel);
        $sth = new SQL($sql);
        $site->debug->msg($sth->debug->get_msgs());
        $del_obj = array();
        while ($del_obj_id = $sth->fetchsingle()) {
            $del_obj[] = $del_obj_id;
        }
        $sql = $site->db->prepare("DELETE FROM user_mailinglist WHERE user_id=? AND FIND_IN_SET(objekt_id,?)", $user_id, join(",", $del_obj));
        $sth = new SQL($sql);
        $site->debug->msg($sth->debug->get_msgs());
        # ja lisada uued (NB! aga ainult siis kui kasutaja e-mail ei ole tühi)
        if (trim($site->user->all['email'] != '') && is_array($fields)) {
            # rubrigide ID kontroll
            # kas on seal meilinglist, kas on rubriik avaldatud
            $sql = $site->db->prepare("SELECT obj_rubriik.objekt_id FROM obj_rubriik,objekt WHERE obj_rubriik.objekt_id=objekt.objekt_id AND objekt.on_avaldatud='1' AND obj_rubriik.on_meilinglist = '1' AND find_in_set(obj_rubriik.objekt_id, ?)", join(",", $fields));
            $sth = new SQL($sql);
            $site->debug->msg($sth->debug->get_msgs());
            $values = array();
            while ($objekt_id = $sth->fetchsingle()) {
                $values[] = $site->db->prepare("(?,?)", $user_id, $objekt_id);
            }
            if (sizeof($values)) {
                $sql = "INSERT INTO user_mailinglist (user_id, objekt_id) VALUES " . join(",", $values);
                $sth = new SQL($sql);
                $site->debug->msg($sth->debug->get_msgs());
            }
        }
        # if mõni meilinglist oli chekitud
    }
    # kui kasutaja lisati edukalt
    #  / salvestame mailinglistide valik
    ###################
}
开发者ID:sauruscms,项目名称:Saurus-CMS-Community-Edition,代码行数:71,代码来源:function.save_mailinglist.php


示例19: search

function search()
{
    global $lang_global, $lang_mail, $output, $itemperpage, $item_datasite, $mangos_db, $characters_db, $realm_id, $sql_search_limit;
    wowhead_tt();
    if (!isset($_GET['search_value']) || !isset($_GET['search_by'])) {
        redirect("mail_on.php?error=2");
    }
    $sql = new SQL();
    $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
    $search_value = $sql->quote_smart($_GET['search_value']);
    $search_by = $sql->quote_smart($_GET['search_by']);
    $search_menu = array('sender', 'receiver');
    // if (!array_key_exists($search_by, $search_menu)) $search_by = 'sender';
    $start = isset($_GET['start']) ? $sql->quote_smart($_GET['start']) : 0;
    $order_by = isset($_GET['order_by']) ? $sql->quote_smart($_GET['order_by']) : "id";
    $dir = isset($_GET['dir']) ? $sql->quote_smart($_GET['dir']) : 1;
    $order_dir = $dir ? "ASC" : "DESC";
    $dir = $dir ? 0 : 1;
    $temp = $sql->query("SELECT guid FROM `characters` WHERE name like '%{$search_value}%'");
    $search_value = $sql->result($temp, 0, 'guid');
    $query_1 = $sql->query("SELECT count(*) FROM `mail`");
    $query = $sql->query("SELECT a.id, a.messageType, a.sender, a.receiver, a.subject, a.itemTextId, a.has_items, a.money, a.cod, a.checked, b.item_template\r\n            FROM mail a\r\n            INNER JOIN mail_items b ON a.id = b.mail_id\r\n            WHERE {$search_by} = {$search_value}\r\n            ORDER BY {$order_by} {$order_dir} LIMIT {$start}, {$itemperpage}");
    $this_page = $sql->num_rows($query);
    $all_record = $sql->result($query_1, 0);
    $total_found = $sql->num_rows($query);
    //==========================top page navigation starts here========================
    $output .= "<center><table class=\"top_hidden\">\r\n    <tr><td>\r\n            <table class=\"hidden\">\r\n                <tr><td>\r\n            <form action=\"mail_on.php\" method=\"get\" name=\"form\">\r\n            <input type=\"hidden\" name=\"action\" value=\"search\" />\r\n            <input type=\"hidden\" name=\"error\" value=\"4\" />\r\n            <input type=\"text\" size=\"45\" name=\"search_value\" />\r\n            <select name=\"search_by\">\r\n                <option value=\"sender\">Sender</option>\r\n                <option value=\"receiver\">Receiver</option>\r\n            </select></form></td><td>";
    makebutton($lang_global['search'], "javascript:do_submit()", 80);
    $output .= "</td></tr></table>\r\n            <td align=\"right\">";
    $output .= generate_pagination("mail_on.php?action=search&amp;order_by={$order_by}&amp;dir=" . !$dir, $all_record, $itemperpage, $start);
    $output .= "</td></tr></table>";
    //==========================top page navigation ENDS here ========================
    $output .= "<table class=\"lined\">\r\n  <tr>\r\n    <th width=\"5%\">" . $lang_mail['id'] . "</th>\r\n    <th width=\"5%\">" . $lang_mail['mail_type'] . "</th>\r\n    <th width=\"10%\">" . $lang_mail['sender'] . "</th>\r\n    <th width=\"10%\">" . $lang_mail['receiver'] . "</th>\r\n    <th width=\"15%\">" . $lang_mail['subject'] . "</th>\r\n    <th width=\"5%\">" . $lang_mail['has_items'] . "</th>\r\n    <th width=\"25%\">" . $lang_mail['text'] . "</th>\r\n    <th width=\"20%\">" . $lang_mail['money'] . "</th>\r\n    <th width=\"5%\">" . $lang_mail['checked'] . "</th>\r\n  </tr>";
    while ($mail = $sql->fetch_array($query)) {
        $g = floor($mail[7] / 10000);
        $mail[7] -= $g * 10000;
        $s = floor($mail[7] / 100);
        $mail[7] -= $s * 100;
        $c = $mail[7];
        $money = "";
        if ($mail[7] > 0) {
            $money = $g . "<img src=\"./img/gold.gif\" /> " . $s . "<img src=\"./img/silver.gif\" /> " . $c . "<img src=\"./img/copper.gif\" /> ";
        }
        $output .= "<tr valign=top>\r\n                    <td>{$mail['0']}</td>\r\n                    <td>" . get_mail_source($mail[1]) . "</td>\r\n                    <td><a href=\"char.php?id={$mail['2']}\">" . get_char_name($mail[2]) . "</a></td>\r\n                    <td><a href=\"char.php?id={$mail['3']}\">" . get_char_name($mail[3]) . "</a></td>\r\n                    <td>{$mail['4']}</td>\r\n            ";
        $output .= "<td>";
        $output .= "\r\n                    <a style=\"padding:2px;\" href=\"{$item_datasite}{$mail[10]}\" target=\"_blank\">\r\n                      <img class=\"bag_icon\" src=\"" . get_item_icon($mail[10]) . "\" alt=\"\" />\r\n                  </a>";
        //maketooltip("<img src=\"./img/up.gif\" alt=\"\">", $item_datasite{$mail[10]}, $mail[10], "item_tooltip", "target=\"_blank\"");
        $output .= "</td>";
        $output .= "<td>" . get_mail_text($mail[5]) . "</td>\r\n                        <td>{$money}</td>\r\n        <td>" . get_check_state($mail[9]) . "</td>\r\n                   </tr>";
    }
    /*--------------------------------------------------*/
    $output .= "<tr><td colspan=\"6\" class=\"hidden\" align=\"right\">All Mails: {$all_record}</td></tr>\r\n </table></center>";
    $sql->close();
}
开发者ID:scamp,项目名称:minimanager,代码行数:54,代码来源:mail_on.php


示例20: smarty_resource_style_timestamp

function smarty_resource_style_timestamp($tpl_name, &$tpl_timestamp, &$smarty)
{
    // do database call here to populate $tpl_timestamp.
    $sql = new SQL();
    $sql->query("select tpl_timestamp\n                   from my_table\n                  where tpl_name='{$tpl_name}'");
    if ($sql->num_rows) {
        $tpl_timestamp = $sql->record['tpl_timestamp'];
        return true;
    } else {
        return false;
    }
}
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:12,代码来源:resource.style.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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