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


PHP DataListCP::SetSource方法代码示例

本文整理汇总了PHP中DataListCP::SetSource方法的典型用法代码示例。如果您正苦于以下问题:PHP DataListCP::SetSource方法的具体用法?PHP DataListCP::SetSource怎么用?PHP DataListCP::SetSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataListCP的用法示例。


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

示例1: GetMemberName

}
$dsql->SetQuery("SELECT name FROM `#@__member_model`");
$dsql->Execute();
while ($row = $dsql->GetArray()) {
    $MemberModels[] = $row;
}
$sql = "SELECT * FROM `#@__member` {$whereSql} ORDER BY {$sortkey} DESC ";
$dlist = new DataListCP();
$dlist->SetParameter('sex', $sex);
$dlist->SetParameter('spacesta', $spacesta);
$dlist->SetParameter('matt', $matt);
$dlist->SetParameter('mtype', $mtype);
$dlist->SetParameter('sortkey', $sortkey);
$dlist->SetParameter('keyword', $keyword);
$dlist->SetTemplet(DEDEADMIN . "/templets/member_main.htm");
$dlist->SetSource($sql);
$dlist->display();
function GetMemberName($rank, $mt)
{
    global $MemberTypes;
    if (isset($MemberTypes[$rank])) {
        if ($mt == 'ut') {
            return " <font color='red'>待升级:" . $MemberTypes[$rank] . "</font>";
        } else {
            return $MemberTypes[$rank];
        }
    } else {
        if ($mt == 'ut') {
            return '';
        } else {
            return $mt;
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:member_main.php

示例2: VALUES

                            $row3 = "INSERT INTO\r\n                `#@__member_pms` (`floginid`,`fromid`,`toid`,`tologinid`,`folder`,`subject`,`sendtime`,`writetime`,`hasview`,`isadmin`,`message`)\r\n                VALUES ('admin','{$row['id']}','{$cfg_ml->M_ID}','{$cfg_ml->M_LoginID}','inbox','{$row['subject']}','{$row['sendtime']}','{$row['writetime']}','{$row['hasview']}','{$row['isadmin']}','{$row['message']}')";
                            $dsql->ExecuteNoneQuery($row3);
                        }
                    }
                    if ($state == "1") {
                        $wsql = " toid='{$cfg_ml->M_ID}' AND folder='inbox' AND writetime!='' and hasview=1";
                        $tname = "收件箱";
                    } else {
                        if ($state == "-1") {
                            $wsql = "toid='{$cfg_ml->M_ID}' AND folder='inbox' AND writetime!='' and hasview=0";
                            $tname = "收件箱";
                        } else {
                            $wsql = " toid='{$cfg_ml->M_ID}' AND folder='inbox' AND writetime!=''";
                            $tname = "收件箱";
                        }
                    }
                } else {
                    $wsql = " `fromid` ='{$cfg_ml->M_ID}' AND folder LIKE 'outbox'";
                    $tname = "已发信息";
                }
                $query = "SELECT * FROM `#@__member_pms` WHERE {$wsql} ORDER BY sendtime DESC";
                $dlist = new DataListCP();
                $dlist->pageSize = 20;
                $dlist->SetParameter("dopost", $dopost);
                $dlist->SetTemplate(DEDEMEMBER . '/templets/pm-main.htm');
                $dlist->SetSource($query);
                $dlist->Display();
            }
        }
    }
}
开发者ID:Miliup,项目名称:miliofficeweb,代码行数:31,代码来源:pm.php

示例3: addslashes

                if (empty($price)) {
                    $price = $row['price'];
                }
                if (empty($des)) {
                    $des = addslashes($row['des']);
                } else {
                    $des = cn_substrR($des, 255);
                }
                $dsql->ExecuteNoneQuery("UPDATE #@__shops_delivery SET dname='{$dname}',price='{$price}',des='{$des}' WHERE pid='{$id}'");
            }
            ShowMsg("成功修改配送方式!", "shops_delivery.php");
            exit;
        }
    }
}
$deliveryarr = array();
$dsql->SetQuery("SELECT pid,dname,price,des FROM #@__shops_delivery ORDER BY orders ASC");
$dsql->Execute();
while ($row = $dsql->GetArray()) {
    $deliveryarr[] = $row;
}
$dlist = new DataListCP();
$dlist->pageSize = 25;
//设定每页显示记录数(默认25条)
//这两句的顺序不能更换
$dlist->SetTemplate(DEDEADMIN . "/templets/shops_delivery.htm");
//载入模板
$dlist->SetSource("SELECT `pid`,`dname`,`price`,`des` FROM #@__shops_delivery ORDER BY `orders` ASC");
//设定查询SQL
$dlist->Display();
//显示
开发者ID:iabing,项目名称:mzzyc,代码行数:31,代码来源:shops_delivery.php

示例4: showmsg

                showmsg('发布成功', $goto);
            } else {
                showmsg('对不起,发布不成功', '-1');
            }
        }
    }
} else {
    if ($action == 'list') {
        include_once DEDEINC . '/datalistcp.class.php';
        $query = "SELECT * FROM {$diy->table} ORDER BY id DESC";
        $datalist = new DataListCP();
        $datalist->pageSize = 10;
        $datalist->SetParameter('action', 'list');
        $datalist->SetParameter('diyid', $diyid);
        $datalist->SetTemplate(DEDEADMIN . '/templets/diy_list.htm');
        $datalist->SetSource($query);
        $fieldlist = $diy->getFieldList();
        $datalist->Display();
    } else {
        if ($action == 'edit') {
            if (empty($do)) {
                $id = isset($id) && is_numeric($id) ? $id : 0;
                if (empty($id)) {
                    showMsg('非法操作!未指定id', 'javascript:;');
                    exit;
                }
                $query = "SELECT * FROM {$diy->table} WHERE id={$id}";
                $row = $dsql->GetOne($query);
                if (!is_array($row)) {
                    showmsg("你访问的记录不存在或未经审核", '-1');
                    exit;
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:diy_list.php

示例5: dirname

<?php

/**
 * @version        $Id: mygroup.php 1 12:11 2010年9月13日Z tianya $
 * @package        DedeCMS.Module.Group
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once dirname(__FILE__) . "/system/config.php";
require_once DEDEINC . "/datalistcp.class.php";
$menutype = 'mydede';
$sql = "SELECT * FROM #@__groups WHERE ishidden='0' AND uid='" . $cfg_ml->M_ID . "'  ORDER BY threads DESC,stime DESC";
$dl = new DataListCP();
$dl->pageSize = 20;
//这两句的顺序不能更换
$dl->SetTemplate(_SYSTEM_ . "/mygroup.htm");
//载入模板
$dl->SetSource($sql);
//设定查询SQL
$dl->Display();
//显示
开发者ID:healthguo,项目名称:PHP,代码行数:22,代码来源:mygroup.php

示例6: while

     //当前栏目下级分类
     $dsql->SetQuery("Select id,typename From `#@__arctype` where reid='{$id}' And channeltype=1 And ishidden=0 And ispart<>2 order by sortrank");
     $dsql->Execute();
     while ($row = $dsql->GetObject()) {
         $channellistnext .= "<a href='wap.php?action=list&amp;id={$row->id}'>" . ConvertStr($row->typename) . "</a> ";
     }
     //栏目内容(分页输出)
     $sids = GetSonIds($id, 1, true);
     $varlist = "cfg_webname,typename,channellist,channellistnext,cfg_templeturl";
     ConvertCharset($varlist);
     $dlist = new DataListCP();
     $dlist->SetTemplet($cfg_templets_dir . "/wap/list.wml");
     $dlist->pageSize = 10;
     $dlist->SetParameter("action", "list");
     $dlist->SetParameter("id", $id);
     $dlist->SetSource("Select id,title,pubdate,click From `#@__archives` where typeid in({$sids}) And arcrank=0 order by id desc");
     $dlist->Display();
     exit;
 } else {
     if ($action == 'article') {
         //文档信息
         $query = "\r\n\t  Select tp.typename,tp.ishidden,arc.typeid,arc.title,arc.arcrank,arc.pubdate,arc.writer,arc.click,addon.body From `#@__archives` arc \r\n\t  left join `#@__arctype` tp on tp.id=arc.typeid\r\n\t  left join `#@__addonarticle` addon on addon.aid=arc.id\r\n\t  where arc.id='{$id}'\r\n\t";
         $row = $dsql->GetOne($query, MYSQL_ASSOC);
         foreach ($row as $k => $v) {
             ${$k} = $v;
         }
         unset($row);
         $pubdate = strftime("%y-%m-%d %H:%M:%S", $pubdate);
         if ($arcrank != 0) {
             exit;
         }
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:wap.php

示例7: in

        exit;
    } else {
        if ($job == 'check') {
            $query = "Update `#@__feedback` set ischeck=1 where id in({$ids}) ";
            $dsql->ExecuteNoneQuery($query);
            ShowMsg("成功审核指定评论!", $_COOKIE['ENV_GOBACK_URL'], 0, 500);
            exit;
        } else {
            $bgcolor = '';
            $typeid = isset($typeid) && is_numeric($typeid) ? $typeid : 0;
            $aid = isset($aid) && is_numeric($aid) ? $aid : 0;
            $keyword = !isset($keyword) ? '' : $keyword;
            $ip = !isset($ip) ? '' : $ip;
            $tl = new TypeLink($typeid);
            $openarray = $tl->GetOptionArray($typeid, $admin_catalogs, 0);
            $addsql = $typeid != 0 ? " And typeid in (" . GetSonIds($typeid) . ")" : '';
            $addsql .= $aid != 0 ? " And aid={$aid} " : '';
            $addsql .= $ip != '' ? " And ip like '{$ip}' " : '';
            $querystring = "select * from `#@__feedback` where msg like '%{$keyword}%' {$addsql} order by dtime desc";
            $dlist = new DataListCP();
            $dlist->pageSize = 15;
            $dlist->SetParameter('aid', $aid);
            $dlist->SetParameter('ip', $ip);
            $dlist->SetParameter('typeid', $typeid);
            $dlist->SetParameter('keyword', $keyword);
            $dlist->SetTemplate(DEDEADMIN . '/templets/feedback_main.htm');
            $dlist->SetSource($querystring);
            $dlist->Display();
        }
    }
}
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:feedback_main.php

示例8: __article

	$dsql->Execute();
	while($row=$dsql->GetObject())
	{
		$channellistnext .= "<a href='wap.php?action=list&amp;id={$row->ID}'>".ConvertStr($row->typename)."</a> ";
	}
	//栏目内容(分页输出)
	$sids = GetSonIds($id,1,true);
	$varlist = "cfg_webname,typename,channellist,channellistnext,cfg_templeturl";
	ConvertCharset($varlist);
	require_once(dirname(__FILE__)."/include/datalistcp.class.php");
	$dlist = new DataListCP();
	$dlist->SetTemplet($cfg_templets_dir."/wap/list.wml");
	$dlist->pageSize = 10;
	$dlist->SetParameter("action","list");
	$dlist->SetParameter("id",$id);
	$dlist->SetSource("Select ID,title,pubdate,click From `#@__archives` where typeid in($sids) And arcrank=0 order by ID desc");
	$dlist->Display();
	exit();
}
//文档
/*------------
function __article();
------------*/
else if($action=='article')
{
	//文档信息
	$query = "
	  Select tp.typename,tp.ishidden,arc.typeid,arc.title,arc.arcrank,arc.pubdate,arc.writer,arc.click,addon.body From `#@__archives` arc 
	  left join `#@__arctype` tp on tp.ID=arc.typeid
	  left join `#@__addonarticle` addon on addon.aid=arc.ID
	  where arc.ID='$id'
开发者ID:pf5512,项目名称:phpstudy,代码行数:31,代码来源:wap.php


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