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

PHP CDatabase类代码示例

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

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



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

示例1: ConvertFromDB

 public static function ConvertFromDB($arProperty, $value)
 {
     if (strlen($value["VALUE"]) > 0) {
         $value["VALUE"] = CDatabase::FormatDate($value["VALUE"], "YYYY-MM-DD", CLang::GetDateFormat("SHORT"));
     }
     return $value;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:7,代码来源:prop_date.php


示例2: executeStatements

 public function executeStatements()
 {
     $CDatabase = new CDatabase();
     $execSql = $CDatabase->prepare(implode($this->sql));
     $execSql->execute();
     $stmt = $CDatabase->prepare(implode($this->result));
     $stmt->execute();
     $res = $stmt->fetchAll(PDO::FETCH_ASSOC);
     return $this->generateHTMLTableResult($res);
 }
开发者ID:Bildoor,项目名称:Uppdrag5,代码行数:10,代码来源:CSQLFile.php


示例3: addBloggsAndPagesToNavbar

function addBloggsAndPagesToNavbar()
{
    //connnect to database
    global $urbax;
    $db = new CDatabase($urbax['database']);
    //defalut navigaion items
    $arr = array(new CMenuItem('CTextFilter', '?p=ctextfilter'), new CMenuItem('CContent ->', '?p=contentreset'), array(new CMenuItem('Återställ', '?p=contentreset'), new CMenuItem('Nytt innehåll', '?p=contentadd'), new CMenuItem('Editera innehåll', '?p=contentedit'), new CMenuItem('Radera', '?p=contentdelete')), new CMenuItem('CPage', '?p=contentpage'), new CMenuItem('CBlogg', '?p=contentblogg'));
    //fetch pages
    $pages = $db->ExecuteSelectQueryAndFetchAll("SELECT title, url FROM Content WHERE type='page' AND deleted IS NULL");
    //add pages to navigation
    if (count($pages) > 0) {
        $pagesNavItem = new CMenuItem('Webbsidor ->', '?p=contentpage');
        $subPages = null;
        foreach ($pages as $navItem) {
            //get text
            $text = ucfirst($navItem->title);
            //and shorten it if needed...
            if (strlen($text) > 20) {
                $text = substr($text, 0, 17) . '...';
            }
            //get url
            $url = $navItem->url;
            //add to array
            $subPages[] = new CMenuItem($text, '?p=contentpage&url=' . $url);
        }
        //add 'headline'
        $arr[] = $pagesNavItem;
        //add subpages
        $arr[] = $subPages;
    }
    //fetch blogposts
    $posts = $db->ExecuteSelectQueryAndFetchAll("SELECT title, slug FROM Content WHERE type='post' AND deleted IS NULL");
    //add pages to navigation
    if (count($posts) > 0) {
        $postsNavItem = new CMenuItem('Bloggposter ->', '?p=contentblogg');
        $subPages = null;
        foreach ($posts as $navItem) {
            //get text
            $text = ucfirst($navItem->title);
            //and shorten it if needed...
            if (strlen($text) > 20) {
                $text = substr($text, 0, 17) . '...';
            }
            //get slug
            $slug = $navItem->slug;
            //add to array
            $subPages[] = new CMenuItem($text, '?p=contentblogg&slug=' . $slug);
        }
        //add 'headline'
        $arr[] = $postsNavItem;
        //add subpages
        $arr[] = $subPages;
    }
    return $arr;
}
开发者ID:bthurvi,项目名称:oophp,代码行数:55,代码来源:navigation.php


示例4: Lookup

 public function Lookup()
 {
     $DB = CDatabase::GetModuleConnection('statistic');
     if ($this->city_avail && $this->ip_number) {
         $rs = $DB->Query("\n\t\t\t\tSELECT *\n\t\t\t\tFROM b_stat_city_ip\n\t\t\t\tWHERE START_IP = (\n\t\t\t\t\tSELECT MAX(START_IP)\n\t\t\t\t\tFROM b_stat_city_ip\n\t\t\t\t\tWHERE START_IP <= " . $this->ip_number . "\n\t\t\t\t)\n\t\t\t\tAND END_IP >= " . $this->ip_number . "\n\t\t\t", true);
         if ($rs) {
             $ar = $rs->Fetch();
             if ($ar) {
                 $this->country_code = $ar["COUNTRY_ID"];
                 $this->city_id = $ar["CITY_ID"];
             }
         } else {
             //Here is mysql 4.0 version which does not supports subqueries
             //and not smart to optimeze query
             $rs = $DB->Query("\n\t\t\t\t\tSELECT START_IP\n\t\t\t\t\tFROM b_stat_city_ip\n\t\t\t\t\tWHERE START_IP <= " . $this->ip_number . "\n\t\t\t\t\tORDER BY START_IP DESC\n\t\t\t\t\tLIMIT 1\n\t\t\t\t");
             $ar = $rs->Fetch();
             if ($ar && strlen($ar["START_IP"]) > 0) {
                 $rs = $DB->Query("\n\t\t\t\t\t\tSELECT *\n\t\t\t\t\t\tFROM b_stat_city_ip\n\t\t\t\t\t\tWHERE START_IP = " . $ar["START_IP"] . "\n\t\t\t\t\t\tAND END_IP >= " . $this->ip_number . "\n\t\t\t\t\t");
                 $ar = $rs->Fetch();
                 if ($ar) {
                     $this->country_code = $ar["COUNTRY_ID"];
                     $this->city_id = $ar["CITY_ID"];
                 }
             }
         }
     }
     if (!$this->country_code && $this->country_avail) {
         $this->country_code = i2c_get_country();
     }
 }
开发者ID:rasuldev,项目名称:torino,代码行数:30,代码来源:stat_table.php


示例5: InitStep

 function InitStep()
 {
     global $DB;
     $wizard =& $this->GetWizard();
     $node_id = intval($wizard->GetVar('node_id'));
     if (!CModule::IncludeModule('cluster')) {
         $this->SetError(GetMessage('CLUWIZ_NO_MODULE_ERROR'));
     } elseif ($DB->type != "MYSQL") {
         $this->SetError(GetMessage('CLUWIZ_DATABASE_NOT_SUPPORTED'));
     } elseif ($node_id <= 1) {
         $this->SetError(GetMessage('CLUWIZ_NO_NODE_ERROR'));
     } else {
         $this->arNode = CClusterDBNode::GetByID($node_id);
         if (!is_array($this->arNode)) {
             $this->SetError(GetMessage('CLUWIZ_NO_NODE_ERROR'));
         } else {
             // $arNode["ROLE_ID"] == "SLAVE"
             // $arNode["STATUS"] == "READY"
             $this->nodeDB = CDatabase::GetDBNodeConnection($this->arNode["ID"], true, false);
             if (!is_object($this->nodeDB)) {
                 $this->SetError(GetMessage('CLUWIZ_NO_CONN_ERROR'));
             }
         }
     }
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:25,代码来源:wizard.php


示例6: DelayedStemIndex

 function DelayedStemIndex()
 {
     $DB = CDatabase::GetModuleConnection('search');
     $etime = time() + intval(COption::GetOptionString("search", "agent_duration"));
     do {
         $stemQueue = $DB->Query($DB->TopSql("\n\t\t\t\tSELECT SEARCH_CONTENT_ID ID\n\t\t\t\tFROM b_search_content_stem\n\t\t\t\tWHERE SEARCH_CONTENT_ID < 0\n\t\t\t", 1));
         if ($stemTask = $stemQueue->Fetch()) {
             $ID = -$stemTask["ID"];
             $sites = array();
             $rsSite = $DB->Query("\n\t\t\t\t\tSELECT SITE_ID, URL\n\t\t\t\t\tFROM b_search_content_site\n\t\t\t\t\tWHERE SEARCH_CONTENT_ID = " . $ID . "\n\t\t\t\t");
             while ($arSite = $rsSite->Fetch()) {
                 $sites[$arSite["SITE_ID"]] = $arSite["URL"];
             }
             if (BX_SEARCH_VERSION > 1) {
                 $sql = "SELECT SEARCHABLE_CONTENT from b_search_content_text WHERE SEARCH_CONTENT_ID = {$ID}";
             } else {
                 $sql = "SELECT SEARCHABLE_CONTENT from b_search_content WHERE ID = {$ID}";
             }
             $rsContent = $DB->Query($sql);
             if ($arContent = $rsContent->Fetch()) {
                 $DB->Query("DELETE FROM b_search_content_stem WHERE SEARCH_CONTENT_ID = " . $ID);
                 CSearch::StemIndex($sites, $ID, $arContent["SEARCHABLE_CONTENT"]);
             }
             $DB->Query("DELETE FROM b_search_content_stem WHERE SEARCH_CONTENT_ID = " . $stemTask["ID"]);
         } else {
             //Cancel the agent
             return "";
         }
     } while ($etime >= time());
     return "CSearchStemTable::DelayedStemIndex();";
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:stemtable.php


示例7: GetLastByID

	public static function GetLastByID($ID)
	{
		$DB = CDatabase::GetModuleConnection('statistic');
		$ID = intval($ID);
		if($ID>0)
		{
			$strSql = "
				SELECT
					G.ID,
					G.FAVORITES,
					G.LAST_USER_ID,
					A.ID as LAST_ADV_ID,
					if(to_days(curdate())=to_days(G.LAST_DATE), 'Y', 'N') LAST
				FROM b_stat_guest G
				LEFT JOIN b_stat_adv A ON A.ID = G.LAST_ADV_ID
				WHERE G.ID='$ID'
				";
			$res = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
		}
		else
		{
			$res = new CDBResult;
			$res->InitFromArray(array());
		}
		return $res;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:26,代码来源:guest.php


示例8: GetList

 function GetList(&$by, &$order, $arFilter = array(), &$is_filtered)
 {
     $err_mess = "File: " . __FILE__ . "<br>Line: ";
     $DB = CDatabase::GetModuleConnection('statistic');
     $arSqlSearch = array();
     $strSqlSearch = "";
     if (is_array($arFilter)) {
         foreach ($arFilter as $key => $val) {
             if (is_array($val)) {
                 if (count($val) <= 0) {
                     continue;
                 }
             } else {
                 if (strlen($val) <= 0 || $val === "NOT_REF") {
                     continue;
                 }
             }
             $match_value_set = array_key_exists($key . "_EXACT_MATCH", $arFilter);
             $key = strtoupper($key);
             switch ($key) {
                 case "LAST":
                     $arSqlSearch[] = $val == "Y" ? "S.DATE_STAT = curdate()" : "S.DATE_STAT<>curdate()";
                     break;
                 case "USER_AGENT":
                     $match = $arFilter[$key . "_EXACT_MATCH"] == "Y" && $match_value_set ? "N" : "Y";
                     $arSqlSearch[] = GetFilterQuery("S.USER_AGENT", $val, $match);
                     break;
                 case "COUNTER1":
                     $arSqlSearch_h[] = "COUNTER>=" . intval($val);
                     break;
                 case "COUNTER2":
                     $arSqlSearch_h[] = "COUNTER<=" . intval($val);
                     break;
             }
         }
         for ($i = 0; $i < count($arSqlSearch_h); $i++) {
             $strSqlSearch_h .= " and (" . $arSqlSearch_h[$i] . ") ";
         }
     }
     if ($by == "s_user_agent") {
         $strSqlOrder = "ORDER BY S.USER_AGENT";
     } elseif ($by == "s_counter") {
         $strSqlOrder = "ORDER BY COUNTER";
     } else {
         $by = "s_counter";
         $strSqlOrder = "ORDER BY COUNTER";
     }
     if ($order != "asc") {
         $strSqlOrder .= " desc ";
         $order = "desc";
     }
     $strSqlSearch = GetFilterSqlSearch($arSqlSearch);
     $strSql = "SET OPTION SQL_BIG_SELECTS=1";
     $res = $DB->Query($strSql, false, $err_mess . __LINE__);
     $strSql = "\n\t\t\tSELECT\n\t\t\t\tS.USER_AGENT,\n\t\t\t\tcount(S.ID) COUNTER\n\t\t\tFROM\n\t\t\t\tb_stat_session S\n\t\t\tLEFT JOIN b_stat_browser B ON (\n\t\t\t\tlength(B.USER_AGENT)>0\n\t\t\tand B.USER_AGENT is not null\n\t\t\tand\tupper(S.USER_AGENT) like upper(B.USER_AGENT)\n\t\t\t)\n\t\t\tLEFT JOIN b_stat_searcher R ON (\n\t\t\t\tlength(R.USER_AGENT)>0\n\t\t\tand\tR.USER_AGENT is not null\n\t\t\tand\tupper(S.USER_AGENT) like upper(concat('%',R.USER_AGENT,'%'))\n\t\t\t)\n\t\t\tWHERE\n\t\t\t{$strSqlSearch}\n\t\t\tand S.USER_AGENT is not null\n\t\t\tand S.USER_AGENT<>''\n\t\t\tand S.NEW_GUEST<>'N'\n\t\t\tand B.ID is null\n\t\t\tand R.ID is null\n\t\t\tGROUP BY S.USER_AGENT\n\t\t\tHAVING '1'='1' {$strSqlSearch_h}\n\t\t\t{$strSqlOrder}\n\t\t\t";
     $res = $DB->Query($strSql, false, $err_mess . __LINE__);
     $is_filtered = IsFiltered($strSqlSearch) || strlen($strSqlSearch_h) > 0;
     return $res;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:59,代码来源:autodetect.php


示例9: mark_order_as_error

	protected function mark_order_as_error($order, array $data) {
		CSaleOrder::Update($order['ID'], array(
			'PS_STATUS' => 'N',
			'PS_SUM' => $data['amount'],
			'PS_CURRENCY' => $data['currency'],
			'PS_STATUS_MESSAGE' => $data['message'],
			'PS_RESPONSE_DATE' => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat('FULL', LANG))),
		));
	}
开发者ID:ASDAFF,项目名称:bitrix-futupayments,代码行数:9,代码来源:result_rec.php


示例10: Search

	function Search($phrase = "", $nTopCount = 5, $arParams = array(), $bNotFilter = false, $order = "")
	{
		$DB = CDatabase::GetModuleConnection('search');
		$this->_arPhrase = stemming_split($phrase, LANGUAGE_ID);
		if(!empty($this->_arPhrase))
		{
			$nTopCount = intval($nTopCount);
			if($nTopCount <= 0)
				$nTopCount = 5;

			$arId = CSearchFullText::GetInstance()->searchTitle($phrase, $this->_arPhrase, $nTopCount, $arParams, $bNotFilter, $order);
			if (!is_array($arId))
			{
				return $this->searchTitle($phrase, $nTopCount, $arParams, $bNotFilter, $order);
			}
			elseif (!empty($arId))
			{
				$strSql = "
					SELECT
						sc.ID
						,sc.MODULE_ID
						,sc.ITEM_ID
						,sc.TITLE
						,sc.PARAM1
						,sc.PARAM2
						,sc.DATE_CHANGE
						,L.DIR
						,L.SERVER_NAME
						,sc.URL as URL
						,scsite.URL as SITE_URL
						,scsite.SITE_ID
						,if(locate('".$DB->ForSQL(ToUpper($phrase))."', upper(sc.TITLE)) > 0, 1, 0) RANK1
					FROM
						b_search_content sc
						INNER JOIN b_search_content_site scsite ON sc.ID = scsite.SEARCH_CONTENT_ID
						INNER JOIN b_lang L ON scsite.SITE_ID = L.LID
					WHERE
						sc.ID in (".implode(",", $arId).")
						and scsite.SITE_ID = '".SITE_ID."'
					ORDER BY ".(
						$bOrderByRank?
							"RANK1 DESC, TITLE":
							"DATE_CHANGE DESC, RANK1 DESC, TITLE"
					)."
				";

				$r = $DB->Query($DB->TopSql($strSql, $nTopCount+1));
				parent::CDBResult($r);
				return true;
			}
		}
		else
		{
			return false;
		}
	}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:56,代码来源:title.php


示例11: GetURLs

 public static function GetURLs($site_id, $ID, $limit = 0)
 {
     $DB = CDatabase::GetModuleConnection('search');
     $strSql = "\n\t\tSELECT\n\t\t\tsc.ID\n\t\t\t,sc.MODULE_ID\n\t\t\t,sc.ITEM_ID\n\t\t\t,sc.TITLE\n\t\t\t,sc.PARAM1\n\t\t\t,sc.PARAM2\n\t\t\t,sc.UPD\n\t\t\t,sc.DATE_FROM\n\t\t\t,sc.DATE_TO\n\t\t\t,L.DIR\n\t\t\t,L.SERVER_NAME\n\t\t\t,sc.URL as URL\n\t\t\t,scsite.URL as SITE_URL\n\t\t\t,scsite.SITE_ID\n\t\t\t," . $DB->DateToCharFunction("sc.DATE_CHANGE") . " as FULL_DATE_CHANGE\n\t\t\t," . $DB->DateToCharFunction("sc.DATE_CHANGE", "SHORT") . " as DATE_CHANGE\n\t\tFROM\tb_search_content sc\n\t\t\tINNER JOIN b_search_content_site scsite ON sc.ID=scsite.SEARCH_CONTENT_ID\n\t\t\tINNER JOIN b_lang L ON scsite.SITE_ID=L.LID\n\t\t\tINNER JOIN b_search_content_right scg ON sc.ID=scg.SEARCH_CONTENT_ID\n\t\tWHERE\n\t\t\tscg.GROUP_CODE='G2'\n\t\t\tAND scsite.SITE_ID='" . $DB->ForSQL($site_id, 2) . "'\n\t\t\tAND (sc.DATE_FROM is null OR sc.DATE_FROM <= " . $DB->CurrentTimeFunction() . ")\n\t\t\tAND (sc.DATE_TO is null OR sc.DATE_TO >= " . $DB->CurrentTimeFunction() . ")\n\t\t\tAND sc.ID > " . intval($ID) . "\n\t\tORDER BY\n\t\t\tsc.ID\n\t\t";
     if (intval($limit) > 0) {
         $strSql .= "LIMIT " . intval($limit);
     }
     $r = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     parent::CDBResult($r->result);
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:10,代码来源:sitemap.php


示例12: setPayed

 public function setPayed($value)
 {
     $value = (bool) $value ? 'Y' : 'N';
     if ($value == 'Y') {
         \CSaleOrder::PayOrder($this['ID'], 'Y');
     } else {
         $data = array('PAYED' => (bool) $value ? 'Y' : 'N', 'DATE_PAYED' => Date(\CDatabase::DateFormatToPHP(\CLang::GetDateFormat('FULL', LANG))), 'USER_ID' => $this['USER_ID']);
         return \CSaleOrder::Update($this['ID'], $data);
     }
 }
开发者ID:AlexSmerw,项目名称:domino,代码行数:10,代码来源:Order.class.php


示例13: addAsSearcher

function addAsSearcher($mask)
{
    $statDB = CDatabase::GetModuleConnection('statistic');
    if (!checkIfBrowser($mask) && !checkIfSearcher($mask)) {
        $arFields = array("ACTIVE" => "'Y'", "SAVE_STATISTIC" => "'Y'", "NAME" => "'" . $statDB->ForSql($mask, 255) . "'", "USER_AGENT" => "'" . $statDB->ForSql($mask, 255) . "'");
        $statDB->Insert("b_stat_searcher", $arFields);
        return 1;
    } else {
        return 0;
    }
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:11,代码来源:autodetect_list.php


示例14: SetGroups

 function SetGroups($arGroups)
 {
     $DB = CDatabase::GetModuleConnection('search');
     $dbCodes = $DB->Query("\n\t\t\tSELECT GROUP_CODE\n\t\t\tFROM b_search_user_right\n\t\t\tWHERE USER_ID = " . $this->_user_id . "\n\t\t", false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     while ($dbCode = $dbCodes->Fetch()) {
         if (!in_array($dbCode["GROUP_CODE"], $arGroups)) {
             $DB->Query("\n\t\t\t\t\tDELETE FROM b_search_user_right\n\t\t\t\t\tWHERE USER_ID = " . $this->_user_id . "\n\t\t\t\t\tAND GROUP_CODE = '" . $DB->ForSQL($dbCode["GROUP_CODE"]) . "'\n\t\t\t\t", false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         }
     }
     $this->AddGroups($arGroups);
 }
开发者ID:spas-viktor,项目名称:books,代码行数:11,代码来源:user.php


示例15: AddGroups

 function AddGroups($arGroups)
 {
     $DB = CDatabase::GetModuleConnection('search');
     $arToInsert = array();
     foreach ($arGroups as $group_code) {
         if (strlen($group_code)) {
             $arToInsert[$group_code] = $group_code;
         }
     }
     foreach ($arToInsert as $group_code) {
         $DB->Query("\n\t\t\t\tINSERT INTO b_search_user_right\n\t\t\t\t(USER_ID, GROUP_CODE)\n\t\t\t\tVALUES\n\t\t\t\t(" . $this->_user_id . ", '" . $DB->ForSQL($group_code, 100) . "')\n\t\t\t", true, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:13,代码来源:user.php


示例16: learning_log_exception

 protected function learning_log_exception($message, $code, $line, $file, $backtrace)
 {
     if (!method_exists('CDatabase', 'Query')) {
         return;
     }
     global $DB;
     if (!(is_object($DB) && method_exists($DB, 'Query'))) {
         return;
     }
     if (!$DB->TableExists('b_learn_exceptions_log')) {
         return;
     }
     $DB->Query("INSERT INTO b_learn_exceptions_log\n\t\t\t\t\t(DATE_REGISTERED, CODE, MESSAGE, FFILE, LINE, BACKTRACE)\n\t\t\t\t\tVALUES (" . CDatabase::GetNowFunction() . ", " . (int) $code . ", '" . CDatabase::ForSQL($message) . "', '" . CDatabase::ForSQL($file) . "', " . (int) $line . ",'" . CDatabase::ForSQL(base64_encode(serialize($backtrace))) . "')\n\t\t\t\t\t", true);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:14,代码来源:learnexception.php


示例17: __construct

    public function __construct($options, $url, $urlSql)
    {
        $dbh = new CDatabase($options);
        $textfilter = new CTextFilter();
        // Get content
        $sql = "SELECT * FROM Content WHERE type = 'page' AND {$urlSql} AND published <= NOW() AND deleted IS NULL;";
        $res = $dbh->ExecuteSelectQueryAndFetchAll($sql, array($url));
        if ($urlSql == 1) {
            $data = '';
            foreach ($res as $row) {
                $title = "Alla sidor:";
                // Sanitize content before using it.
                $data .= "<a href='?p=contentpage&amp;url={$row->url}'>" . htmlentities($row->title, null, 'UTF-8') . "</a><br/>";
            }
            $html = <<<PAGECONT
          <article>
          <h2>{$title}</h2> 
          <p>{$data}</p>
          </article>
PAGECONT;
            $this->html = $html;
        } else {
            $data = $res[0];
            // Sanitize content before using it.
            $title = htmlentities($data->title, null, 'UTF-8');
            $data = $textfilter->doFilter(htmlentities($data->data, null, 'UTF-8'), $data->filter);
            $data .= "<p>&nbsp;</p><hr style='margin-bottom:10px;'><p><a href='?p=contentpage' class='aButton'>Visa alla</a></p>";
            $html = <<<PAGECONT
          <article>
          <h2>{$title}</h2> 
          {$data}
          </article>
PAGECONT;
            $this->html = $html;
        }
    }
开发者ID:bthurvi,项目名称:oophp,代码行数:36,代码来源:CPage.php


示例18: GetUpTime

 function GetUpTime($node_id)
 {
     if ($node_id > 1) {
         ob_start();
         $DB = CDatabase::GetDBNodeConnection($node_id, true, false);
         ob_end_clean();
     } else {
         $DB = $GLOBALS["DB"];
     }
     if (is_object($DB)) {
         $rs = $DB->Query("show status like 'Uptime'", false, '', array('fixed_connection' => true));
         if ($ar = $rs->Fetch()) {
             return $ar["Value"];
         }
     }
     return false;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:17,代码来源:dbnode.php


示例19: GetEditFormHTML

 function GetEditFormHTML($arUserField, $arHtmlControl)
 {
     $arHtmlControl["VALIGN"] = "middle";
     if ($arUserField["EDIT_IN_LIST"] == "Y") {
         if ($arUserField["ENTITY_VALUE_ID"] < 1 && $arUserField["SETTINGS"]["DEFAULT_VALUE"]["TYPE"] != "NONE") {
             if ($arUserField["SETTINGS"]["DEFAULT_VALUE"]["TYPE"] == "NOW") {
                 $arHtmlControl["VALUE"] = ConvertTimeStamp(time(), "SHORT");
             } else {
                 $arHtmlControl["VALUE"] = CDatabase::FormatDate($arUserField["SETTINGS"]["DEFAULT_VALUE"]["VALUE"], "YYYY-MM-DD", CLang::GetDateFormat("SHORT"));
             }
         }
         return CAdminCalendar::CalendarDate($arHtmlControl["NAME"], $arHtmlControl["VALUE"]);
     } elseif (strlen($arHtmlControl["VALUE"]) > 0) {
         return $arHtmlControl["VALUE"];
     } else {
         return '&nbsp;';
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:18,代码来源:usertypedate.php


示例20: GetEditFormHTML

 function GetEditFormHTML($arUserField, $arHtmlControl)
 {
     $arHtmlControl["VALIGN"] = "middle";
     if ($arUserField["EDIT_IN_LIST"] == "Y") {
         if ($arUserField["ENTITY_VALUE_ID"] < 1 && $arUserField["SETTINGS"]["DEFAULT_VALUE"]["TYPE"] != "NONE") {
             if ($arUserField["SETTINGS"]["DEFAULT_VALUE"]["TYPE"] == "NOW") {
                 $arHtmlControl["VALUE"] = ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL");
             } else {
                 $arHtmlControl["VALUE"] = str_replace(" 00:00:00", "", CDatabase::FormatDate($arUserField["SETTINGS"]["DEFAULT_VALUE"]["VALUE"], "YYYY-MM-DD HH:MI:SS", CLang::GetDateFormat("FULL")));
             }
         }
         return CAdminCalendar::CalendarDate($arHtmlControl["NAME"], $arHtmlControl["VALUE"], 20, true);
     } elseif (strlen($arHtmlControl["VALUE"]) > 0) {
         return $arHtmlControl["VALUE"];
     } else {
         return '&nbsp;';
     }
 }
开发者ID:spas-viktor,项目名称:books,代码行数:18,代码来源:usertypetime.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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