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


PHP FSS_Helper::dbPrefix方法代码示例

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


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

示例1: makeSQL

 function makeSQL($sql)
 {
     $db = JFactory::getDBO();
     $parser = new FSSParser();
     $parser->template = $sql;
     $user = JFactory::getUser();
     $parser->setVar('user_id', $user->id);
     $parser->setVar('username', $user->username);
     foreach ($this->filter as $filter) {
         if (isset($filter->type) && $filter->type == "daterange") {
             $replace = 1;
             $to = FSS_Input::getString("{$filter->name}_to", $this->getDateRangeTo($filter));
             $from = FSS_Input::getString("{$filter->name}_from", $this->getDateRangeFrom($filter));
             $find = "{" . $filter->name . "_from}";
             $replace = FSSJ3Helper::getEscaped($db, $from);
             //$sql = str_replace($find, $replace, $sql);
             $parser->SetVar($filter->name . "_from", $replace);
             $find = "{" . $filter->name . "_to}";
             $replace = FSSJ3Helper::getEscaped($db, $to);
             //$sql = str_replace($find, $replace, $sql);
             $parser->SetVar($filter->name . "_to", $replace);
             // need to filter the column by the date rand selected
         } elseif (isset($filter->type) && $filter->type == "date") {
             $replace = 1;
             $date = FSS_Input::getString("{$filter->name}", date("Y-m-d"));
             $find = "{" . $filter->name . "}";
             $replace = FSSJ3Helper::getEscaped($db, $date);
             $parser->SetVar($filter->name, $replace);
             // need to filter the column by the date rand selected
         } elseif (isset($filter->type) && $filter->type == "lookup") {
             $value = FSS_Input::getString('filter_' . $filter->name, '');
             $find = "{" . $filter->name . "}";
             if ($value == "") {
                 //$parser->SetVar($find, "1");
             } else {
                 $replace = " {$filter->field} = '" . FSSJ3Helper::getEscaped($db, $value) . "' ";
                 //$sql = str_replace($find, $replace, $sql);
                 $parser->SetVar($filter->name, $replace);
             }
         } else {
             $value = FSS_Input::getString('filter_' . $filter->name, $filter->default);
             if (!empty($filter->options) && array_key_exists($value, $filter->options)) {
                 $option = $filter->options[$value];
                 $find = "{" . $filter->name . "}";
                 $replace = $option->value;
             } else {
                 $replace = "";
             }
             //$sql = str_replace($find, $replace, $sql);
             $parser->SetVar($filter->name, $replace);
         }
     }
     foreach ($this->group as $group) {
         $find = "{" . $group->name . "}";
         $find_disp = "{" . $group->name . "_disp}";
         if ($group->type == "dategroup") {
             $value = FSS_Input::getString('group_' . $group->name, 'day');
             $replace = "DATE({$group->field})";
             $replace_disp = "DATE({$group->field})";
             switch ($value) {
                 case 'week':
                     $replace = "week";
                     $replace_disp = "CONCAT(YEAR({$group->field}), ' week ', WEEK({$group->field}))";
                     break;
                 case 'month':
                     $replace = "month";
                     $replace_disp = "CONCAT(MONTHNAME({$group->field}), ' ', YEAR({$group->field}))";
                     break;
                 case 'year':
                     $replace = "year";
                     $replace_disp = "YEAR({$group->field})";
                     break;
             }
         }
         //$sql = str_replace($find, $replace, $sql);
         //$sql = str_replace($find_disp, $replace_disp, $sql);
         $parser->SetVar($group->name, $replace);
         $parser->SetVar($group->name . "_disp", $replace_disp);
     }
     $final_sql = $parser->Parse();
     $final_sql = str_replace("#__", FSS_Helper::dbPrefix(), $final_sql);
     $this->vars = $parser->vars;
     return $final_sql;
 }
开发者ID:vstorm83,项目名称:propertease,代码行数:84,代码来源:view.html.php

示例2: RestoreData

 function RestoreData(&$data)
 {
     global $log;
     $db = JFactory::getDBO();
     /*echo "<pre>";
     		print_r($data);
     		echo "<pre>";  
     	
     		exit;*/
     foreach ($data as $table => $stuff) {
         $tabler = str_replace('jos_', FSS_Helper::dbPrefix(), $table);
         //$table =
         // auto import of lite module stuff
         if (strpos($tabler, "fsf") > 0) {
             $tabler = str_replace("fsf", "fss", $tabler);
         }
         if (strpos($tabler, "fst") > 0) {
             $tabler = str_replace("fst", "fss", $tabler);
         }
         if (array_key_exists('data', $stuff)) {
             $qry = "TRUNCATE `{$tabler}`";
             $log .= $qry . "\n";
             $db->setQuery($qry);
             $db->Query();
             $log .= "\n\nProcessing table " . $table . " as {$tabler}\n";
             $log .= $this->RestoreTableData($tabler, $stuff, true);
         }
     }
 }
开发者ID:vstorm83,项目名称:propertease,代码行数:29,代码来源:updatedb.php


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