當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DedeSql類代碼示例

本文整理匯總了PHP中DedeSql的典型用法代碼示例。如果您正苦於以下問題:PHP DedeSql類的具體用法?PHP DedeSql怎麽用?PHP DedeSql使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了DedeSql類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: GetRankName

function GetRankName($arcrank)
{
	global $arcArray,$dsql;
	if(!is_array($arcArray)){
		$dsql = new DedeSql(false);
		$dsql->SetQuery("Select * from #@__arcrank");
		$dsql->Execute('rn1');
		while($row = $dsql->GetObject('rn1')){ $arcArray[$row->rank]=$row->membername; }
	}
	if(isset($arcArray[$arcrank])) return $arcArray[$arcrank];
	else return "不限";
}
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:12,代碼來源:inc_list_functions.php

示例2: GetOptionList

function GetOptionList($selid=0,$userCatalog=0,$channeltype=0)
{
    global $OptionArrayList,$channels,$dsql;
    
    if(!is_object($dsql)) $dsql = new DedeSql(false);
    
    $dsql->SetQuery("Select ID,typename From #@__channeltype ");
    $dsql->Execute();
    $channels = Array();
    while($row = $dsql->GetObject()) $channels[$row->ID] = $row->typename;
    
    $OptionArrayList = "";
    
    $query = "Select ID,typename,ispart,channeltype,issend From #@__arctype where ispart<>2 And reID=0 order by sortrank asc ";
      
    $dsql->SetQuery($query);
    $dsql->Execute();
    	
    while($row=$dsql->GetObject())
    {
        if($row->channeltype==$channeltype && $row->issend==1){
        	 if($row->ispart==0) $OptionArrayList .= "<option value='".$row->ID."' class='option3'>".$row->typename."</option>\r\n";
           else if($row->ispart==1) $OptionArrayList .= "<option value='".$row->ID."' class='option2'>".$row->typename."</option>\r\n";
        }
        LogicGetOptionArray($row->ID,"─",$channeltype,$dsql);
    }
     
    return $OptionArrayList; 
}
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:29,代碼來源:inc_catalog_options.php

示例3: require

<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('member_Edit');
if(!isset($_COOKIE['ENV_GOBACK_URL'])) $ENV_GOBACK_URL = "";
else $ENV_GOBACK_URL="member_main.php";
$ID = ereg_replace("[^0-9]","",$ID);
$dsql = new DedeSql(false);
$row=$dsql->GetOne("select  m.*, mc.* from #@__member m left join #@__member_cominfo mc on mc.id=m.ID where m.ID='$ID'");

	$sql = "select * from #@__sectors";
	$dsql->SetQuery($sql);
	$dsql->Execute();
	$topsectors = $subsectors = array();
	while($sector = $dsql->GetArray())
	{
		if($sector['reid'] == 0) {
			$topsectors[] = $sector;
		} else {
			$subsectors[] = $sector;
		}
	}
	$sectorcache = "<!--\ntopsectors=new Array();\n\n";
	$typeid1name = $typeid2name = '-不限-';
	foreach($topsectors as $topkey => $topsector)
	{
		if($topsector['id'] == $row['typeid1'])
		{
			$typeid1name = $topsector['name'];
		}
		$sectorcache .= "topsectors[$topkey]=".'"'.$topsector['id'].'~'.$topsector['name'].'";'."\n";
		$sectorcache .= "\t".'subsectors'.$topsector['id'].'=new Array();'."\n";
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:company_view.php

示例4: GetMkTime

//////////////////////////////////////////
if($dopost=="save")
{
	//$ismore,$votename
	$starttime = GetMkTime($starttime);
	$endtime = GetMkTime($endtime);
	$voteitems = "";
	$j=0;
	for($i=1;$i<=15;$i++)
	{
		if(!empty(${"voteitem".$i})){
			$j++;
			$voteitems .= "<v:note id=\\'$j\\' count=\\'0\\'>".${"voteitem".$i}."</v:note>\r\n";
		}
	}
	$dsql = new DedeSql(false);
	$inQuery = "
	insert into #@__vote(votename,starttime,endtime,totalcount,ismore,votenote) 
	Values('$votename','$starttime','$endtime','0','$ismore','$voteitems');
	";
	$dsql->SetQuery($inQuery);
	if(!$dsql->ExecuteNoneQuery())
	{
		$dsql->Close();
		ShowMsg("增加投票失敗,請檢查數據是否非法!","-1");
		exit();
	}
	$dsql->Close();
	ShowMsg("成功增加一組投票!","vote_main.php");
	exit();
}
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:vote_add.php

示例5: VALUES

    $row = $dsql->GetOne("SELECT * FROM #@__story_chapter WHERE bookid='{$bookid}' ORDER BY chapnum DESC");
    if (is_array($row)) {
        $nchapnum = $row['chapnum'] + 1;
    } else {
        $nchapnum = 1;
    }
    $query = "INSERT INTO `#@__story_chapter`(`bookid`,`catid`,`chapnum`,`mid`,`chaptername`,`bookname`)\n            VALUES ('{$bookid}', '{$catid}', '{$nchapnum}', '0', '{$chapternew}','{$bookname}');";
    $rs = $dsql->ExecuteNoneQuery($query);
    if ($rs) {
        $chapterid = $dsql->GetLastID();
    } else {
        ShowMsg("增加章節失敗,請檢查原因!", "-1");
        exit;
    }
} else {
    $dsql = new DedeSql();
}
//獲得父欄目
$nrow = $dsql->GetOne("SELECT * FROM #@__story_catalog WHERE id='{$catid}' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];
if (empty($bcatid)) {
    $bcatid = 0;
}
if (empty($booktype)) {
    $booktype = 0;
}
$addtime = time();
//處理上傳的縮略圖
if (!isset($isremote)) {
    $isremote = 0;
開發者ID:hensonvip,項目名稱:ymroad,代碼行數:31,代碼來源:story_edit_photo_action.php

示例6: OxWindow

		$wintitle = "文檔管理-移動文檔";
	  $wecome_info = "<a href='".$ENV_GOBACK_URL."'>文檔管理</a>::移動文檔";
	  $win = new OxWindow();
	  $win->Init("archives_do.php","js/blank.js","POST");
	  $win->AddHidden("fmdo","yes");
	  $win->AddHidden("dopost",$dopost);
	  $win->AddHidden("qstr",$qstr);
	  $win->AddHidden("aid",$aid);
	  $win->AddTitle("你目前的操作是移動文檔,請選擇目標欄目:");
	  $win->AddMsgItem($typeOptions,"30","1");
	  $win->AddMsgItem("你選中的文檔ID是: $qstr <br>移動的欄目必須和選定的文檔頻道類型一致,否則程序會自動勿略不符合的文檔。","30","1");
	  $winform = $win->GetWindow("ok");
	  $win->Display();
	}else{
		$targetTypeid = ereg_replace('[^0-9]','',$targetTypeid);
		$dsql = new DedeSql(false);
		$typeInfos = $dsql->GetOne(" Select * From #@__arctype where ID='$targetTypeid' ");
		if(!is_array($typeInfos)){
			ShowMsg("參數錯誤!","-1");
			$dsql->Close();
			exit();
		}
		if($typeInfos['ispart']!=0){
			ShowMsg("文檔保存的欄目必須為最終列表欄目!","-1");
			$dsql->Close();
			exit();
		}
		$arcids = explode('`',$qstr);
		$arc = "";
		$j = 0;
		$okids = Array();
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:archives_do.php

示例7: str_replace

	$templet = str_replace("{style}",$cfg_df_style,$templet);
	$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
	$pv->Display();
	$pv->Close();
}
else if($dopost=="make")
{
	header("Content-Type: text/html; charset={$cfg_ver_lang}");
	$homeFile = dirname(__FILE__)."/".$position;
	$homeFile = str_replace("\\","/",$homeFile);
	$homeFile = str_replace("//","/",$homeFile);
	$fp = fopen($homeFile,"w") or die("你指定的文件名有問題,無法創建文件");
	fclose($fp);
	if($saveset==1)
	{
		$dsql = new DedeSql(false);
		$dsql->SetQuery("update #@__homepageset set templet='$templet',position='$position' ");
		$dsql->ExecuteNoneQuery();
		$dsql->Close();
	}
	$templet = str_replace("{style}",$cfg_df_style,$templet);
	$pv = new PartView();
	$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet);
	$pv->SaveToHtml($homeFile);
	$pv->Close();
	echo "成功更新主頁HTML:".$homeFile;
	echo "<br/><br/><a href='$position' target='_blank'>瀏覽...</a>";
}
$t2 = ExecTime();
echo "<!-- ".($t2-$t1)." -->";
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:30,代碼來源:makehtml_homepage_action.php

示例8: DedeSql

		exit();
  }

  //嚴格檢查最終的文件名
  if(eregi("\.(php|asp|pl|shtml|jsp|cgi|aspx)",$fullfilename)){
		ShowMsg("你所上傳的文件類型被禁止,係統隻允許上傳<br>".$cfg_mb_mediatype." 類型附件!","-1");
		exit();
	}
	if(eregi("\.(php|asp|pl|shtml|jsp|cgi|aspx)",$full_litfilename)){
		ShowMsg("你所上傳的文件類型被禁止,係統隻允許上傳<br>".$cfg_mb_mediatype." 類型附件!","-1");
		exit();
	}

  @move_uploaded_file($imgfile,$fullfilename);

	$dsql = new DedeSql(false);
	if($dd=="yes")
	{
			copy($fullfilename,$full_litfilename);
			if(in_array($imgfile_type,$cfg_photo_typenames)) ImageResize($full_litfilename,$w,$h);
			$urlValue = $bfilename;
			$imgsrcValue = $litfilename;
			$info = "";
			$sizes = getimagesize($full_litfilename,$info);
			$imgwidthValue = $sizes[0];
	    $imgheightValue = $sizes[1];
	    $imgsize = filesize($full_litfilename);
	    $inquery = "
       INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,adminid,memberid)
       VALUES ('小圖{$dblitfile}','$imgsrcValue','1','$imgwidthValue','$imgheightValue','0','{$imgsize}','{$nowtme}','".$cuserLogin->getUserID()."','0');
     ";
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:image.php

示例9: require_once

<?php
//require_once(dirname(__FILE__)."./../include/config_base.php");
require_once(dirname(__FILE__)."./../member/config.php");

$dsql = new DedeSql(false);
$areas = $sectors = $topsectors = $subsectors = array();
$dsql->setquery("select id, name, reid from #@__sectors order by disorder desc,id asc");
$dsql->Execute();
while($row = $dsql->GetArray())
{
	if($row['reid'] == 0){
		$topsectors[] = $row;
	}else{
		$subsectors[] = $row;
	}
}

foreach($topsectors as $topsector){
	$sectors[] = $topsector;
	foreach($subsectors as $key => $subsector){
		if($subsector['reid'] == $topsector['id']){
			$sectors[] = $subsector;
			unset($subsectors[$key]);
		}
	}
}

//////////////////////地區數據處理s/////////////////////////////
$sql = "select * from #@__area order by disorder asc,id asc";
$dsql->SetQuery($sql);
$dsql->Execute();
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:index.php

示例10: require_once

<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_Keyword');
empty($_COOKIE['ENV_GOBACK_URL']) ? $ENV_GOBACK_URL = "article_keywords_main.php" : $ENV_GOBACK_URL=$_COOKIE['ENV_GOBACK_URL'];
if(!isset($aids)){
	ShowMsg("你沒有選擇要更改的東東!",$ENV_GOBACK_URL);
	exit();
}
$dsql = new DedeSql(false);
foreach($aids as $aid)
{
	$rpurl = ${'rpurl_'.$aid};
	$rpurlold = ${'rpurlold_'.$aid};
	$keyword = ${'keyword_'.$aid};
	//刪除項目
	if(!empty(${'isdel_'.$aid}))
	{
		 $query = "update #@__full_search set keywords = Replace(keywords,' $keyword ',' ')";
     $dsql->SetQuery($query);
	   $dsql->ExecuteNoneQuery();
	   $dsql->SetQuery("Delete From #@__keywords where aid='$aid'");
     $dsql->ExecuteNoneQuery();
     continue;
	}
	//禁用項目
	$staold = ${'staold_'.$aid};
	if(!empty(${'isnouse_'.$aid})) $sta = 0;
	else $sta = 1;
	if($staold!=$sta)
	{
		$query1 = "update #@__keywords set sta='$sta',rpurl='$rpurl' where aid='$aid' ";
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:article_keywords_saveall.php

示例11: trim

$cfg_ml->PutLoginInfo($cfg_ml->M_ID);
//該文件,網銀自動校單返回參數要到網很後台設設,地址指到該文件路徑.
$v_oid = trim($_POST['v_oid']);
$v_pmode = trim($_POST['v_pmode']);
$v_pstatus = trim($_POST['v_pstatus']);
$v_pstring = trim($_POST['v_pstring']);
$v_amount = trim($_POST['v_amount']);
$v_moneytype = trim($_POST['v_moneytype']);
$remark1 = trim($_POST['remark1']);
$remark2 = trim($_POST['remark2']);
$v_md5str = trim($_POST['v_md5str']);
$md5string = strtoupper(md5($v_oid . $v_pstatus . $v_amount . $v_moneytype . $key));
//拚湊加密串
if ($v_md5str == $md5string) {
    if ($v_pstatus == "20") {
        $dsql = new DedeSql(false);
        $buyid = $v_oid;
        //獲取訂單信息,檢查訂單的有效性
        $row = $dsql->GetOne("Select * From #@__member_operation where buyid='{$buyid}' ");
        if (!is_array($row) || $row['sta'] == 2) {
            $oldinfo = $row['oldinfo'];
        }
        $mid = $row['mid'];
        $pid = $row['pid'];
        //更新交易狀態為已付款
        $dsql->ExecuteNoneQuery("Update #@__member_operation set sta=1 where buyid='{$buyid}' ");
        //-------------------------------------------
        //會員產品
        //-------------------------------------------
        if ($row['product'] == 'member') {
            $row = $dsql->GetOne(" Select rank,exptime From #@__member_type where aid='{$row['pid']}' ");
開發者ID:klr2003,項目名稱:sourceread,代碼行數:31,代碼來源:autoreceive.php

示例12: require_once

require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_User');
require_once(dirname(__FILE__)."/../include/inc_typelink.php");

if(empty($dopost)) $dopost="";
if($dopost=="add")
{
	if(ereg("[^0-9a-zA-Z_@!\.-]",$pwd)){
		 ShowMsg("用戶密碼不合法!","-1",0,300);
		 exit();
	}
	if(ereg("[^0-9a-zA-Z_@!\.-]",$userid)){
		 ShowMsg("用戶名不合法!","-1",0,300);
		 exit();
	}
	$dsql = new DedeSql(false);
	$dsql->SetQuery("Select * from `#@__admin` where userid='$userid' Or uname='$uname'");
	$dsql->Execute();
	$ns = $dsql->GetTotalRow();
	if($ns>0){
		$dsql->Close();
		ShowMsg("用戶名或筆名已存在,不允許重複使用!","-1");
		exit();
	}
	$ks = Array();
	foreach($typeid as $v){
		$vs = explode('-',$v);
		if(isset($vs[1])) $t = $vs[1];
		else $t = $vs[0];
		if(!isset($ks[$vs[0]])) $ks[$t] = 1;
	}
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:sys_admin_user_add.php

示例13: require_once

<?php 
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_Edit');

$varname = $_POST['varname'];
if(!eregi('cfg_',$varname)){
	ShowMsg("變量名稱必須以 cfg_ 開頭","-1");
	exit();
}

if($vartype=='bool' && ($varvalue!='Y' && $varvalue!='N')){
	ShowMsg("布爾變量值必須為'Y'或'N'!","-1");
	exit();
}
$varvalue = htmlspecialchars($varvalue);
$dsql = new DedeSql(false);

$row = $dsql->GetOne("Select * From #@__sysconfig where varname like '$varname' ");
if(is_array($row)){
	 ShowMsg("該變量名稱已經存在!","-1");
	 $dsql->Close();
	 exit();
}

$row = $dsql->GetOne("Select * From #@__sysconfig order by aid desc ");
$aid = $row['aid']+1;

$inquery = "INSERT INTO `#@__sysconfig`(`aid`,`varname`,`info`,`value`,`type`,`group`) 
VALUES ('$aid','$varname','$varmsg','$varvalue','$vartype','$vargroup')";

$rs = $dsql->ExecuteNoneQuery($inquery);
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:sys_info_add.php

示例14: require_once

<?php 
require_once(dirname(__FILE__)."/config.php");
CheckPurview('member_Type');
if(empty($dopost)) $dopost = "";
$dsql = new DedeSql(false);
//保存更改
//--------------------
if($dopost=="save")
{
   $startID = 1;
   $endID = $idend;
   for(;$startID<=$endID;$startID++)
   {
   	  $query = "";
   	  $ID = ${"ID_".$startID};
   	  $name = ${"name_".$startID};
   	  $rank = ${"rank_".$startID};
   	  $money = ${"money_".$startID};
   	  if(isset(${"check_".$startID})){
   	  	if($rank>0) $query = "update #@__arcrank set membername='$name',money='$money',rank='$rank' where ID='$ID'";
   	  }
   	  else{
   	  	$query = "Delete From #@__arcrank where ID='$ID' And rank<>10";
   	  }
   	  
   	  if($query!=""){
   	  	$dsql->SetQuery($query);
   	  	$dsql->ExecuteNoneQuery();
   	  } 
   }
   if(isset($check_new))
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:member_rank.php

示例15: strtoupper

//訂單加密信息
$signMsg = $Digest;
//密匙
//接收新的md5加密認證
$newmd5info = $newmd5info;
$digest = strtoupper(md5($OrderInfo . $cfg_merpassword));
//本地的校對密鑰
$newtext = $m_id . $m_orderid . $m_oamount . $cfg_merpassword . $mState;
$myDigest = strtoupper(md5($newtext));
$mysign == md5($cfg_merchant . $buyid . $money . $success . $cfg_merpassword);
//--------------------------------------------------------
//簽名正確
if ($digest == $signMsg && $mState == 2) {
    $OrderInfo = HexToStr($OrderInfo);
    if ($newmd5info == $myDigest) {
        $dsql = new DedeSql(false);
        //獲取訂單信息,檢查訂單的有效性
        $row = $dsql->GetOne("Select state From #@__shops_orders where oid='{$buyid}' ");
        if ($row['state'] > 0) {
            $msg = "付款已經完成!,係統返回信息( {$buyid} ) <br><br> <a href='control.php'>返回主頁</a> ";
            ShowMsg($msg, "javascript:;");
            $dsql->Close();
            exit;
        }
        $sql = "UPDATE `#@__shops_orders` SET `state`='1' WHERE `oid`='{$buyid}' AND `userid`='" . $cfg_ml->M_ID . "';";
        if ($dsql->ExecuteNoneQuery($sql)) {
            $dsql->Close();
            ShowMsg("支付成功!", "javascript:;");
            exit;
        } else {
            $dsql->Close();
開發者ID:klr2003,項目名稱:sourceread,代碼行數:31,代碼來源:pay_back_nps.php


注:本文中的DedeSql類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。