本文整理汇总了PHP中DbHelper::selectRows方法的典型用法代码示例。如果您正苦于以下问题:PHP DbHelper::selectRows方法的具体用法?PHP DbHelper::selectRows怎么用?PHP DbHelper::selectRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbHelper
的用法示例。
在下文中一共展示了DbHelper::selectRows方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defined
<?php
defined('DIRECT_ACCESS_CHECK') or die('DIRECT ACCESS NOT ALLOWED');
/**
* Copyright (c) 2013 EIRL DEVAUX J. - Medialoha.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* EIRL DEVAUX J. - Medialoha - initial API and implementation
*/
// get reports preferences
$cfg = CfgHelper::getInstance();
$mAppArr = DbHelper::selectRows(TBL_APPLICATIONS, null, APP_NAME . ' ASC', '*', null, null, false);
$mSelectedAppId = $mNavCtl->getParam('app', '-1');
$mSelectedAppName = "All Applications";
$mSelectedAppPackage = null;
// build applications dropdown items array
$mDropdownItems = array('<li><a href="#" onclick="setSelectedAppId(this, -1)" >All Applications</a></li>');
foreach ($mAppArr as $app) {
$mDropdownItems[] = '<li><a href="#" onclick="setSelectedAppId(this, ' . $app[APP_ID] . ')" >' . $app[APP_NAME] . '</a></li>';
if ($mSelectedAppId == $app[APP_ID]) {
$mSelectedAppName = $app[APP_NAME];
$mSelectedAppPackage = $app[APP_PACKAGE];
}
}
?>
<div class="navbar">
<div class="navbar-inner">
示例2: foreach
<dd id="milestoneView" >
<?php
$m->printOverview();
?>
<a href="javascript:editIssueMilestone()" > <i class="icon-pencil" ></i> </a>
</dd>
<?php
}
?>
<dd id="milestoneEdit" style="<?php
echo !is_null($m) ? 'display:none' : '';
?>
" >
<?php
$arr = DbHelper::selectRows(TBL_MILESTONES, MILE_APP_ID . '=' . $issue->issue_app_id, MILE_DUEDATE . ' ASC', MILE_ID . ', ' . MILE_NAME);
if (empty($arr)) {
echo '<span class="muted text-i" >No milestone found</span>';
} else {
echo '<select name="new_milestone" ><option value="null" >No milestone</option>';
foreach ($arr as $mile) {
?>
<option value="<?php
echo $mile->mile_id;
?>
" <?php
if ($mile->mile_id == $issue->issue_milestone_id) {
echo 'selected="selected"';
}
?>
><?php
示例3: intval
</select>
</div>
</div>
<div class="control-group" >
<label class="control-label" >Android version</label>
<div class="controls" >
<select id="androidVersion" >
<option value="-1" >-----------</option>
<?php
$versionWhere = null;
$reporsJoin = " JOIN " . TBL_ISSUES . " ON " . TBL_ISSUES . "." . ISSUE_ID . " = " . TBL_REPORTS . "." . REPORT_ISSUE;
if (isset($mSelectedAppId) && intval($mSelectedAppId) > 0) {
$reporsJoin .= " AND " . TBL_ISSUES . "." . ISSUE_APP_ID . " = " . intval($mSelectedAppId);
}
$versionArr = DbHelper::selectRows(TBL_REPORTS . $reporsJoin, $versionWhere, TBL_REPORTS . '.' . REPORT_ANDROID_VERSION . ' DESC', TBL_REPORTS . '.' . REPORT_ANDROID_VERSION, TBL_REPORTS . '.' . REPORT_ANDROID_VERSION, 100, false);
if (is_array($versionArr)) {
foreach ($versionArr as $ver) {
?>
<option value="<?php
echo $ver['android_version'];
?>
" <?php
if ($filterOpts['androidVersion'] == $ver[REPORT_ANDROID_VERSION]) {
echo 'selected="selected"';
}
?>
><?php
echo $ver[REPORT_ANDROID_VERSION];
?>
</option><?php
示例4: define
<?php
define('DIRECT_ACCESS_CHECK', true);
define('BASE_PATH', '../../');
require_once '../updatehelper.php';
require_once BASE_PATH . 'includes/reporthelper.class.php';
$mUpdateHelper = new UpdateHelper();
$mUpdateHelper->begin();
$mUpdateHelper->applySQLUpdateFile();
$mUpdateHelper->exitOnError();
$mUpdateHelper->printStartNextStepMsg("Start updating issues table");
$succeeded = true;
$packages = DbHelper::selectRows(TBL_REPORTS, null, REPORT_PACKAGE_NAME, REPORT_ISSUE . ', ' . REPORT_PACKAGE_NAME, REPORT_ISSUE, null, false);
foreach ($packages as $package) {
$issueId = $package[0];
$packageName = $package[1];
// skip empty package name
if (strlen($packageName) == 0) {
$mUpdateHelper->printStepMsg("Found empty package name !", true, false);
continue;
}
$appId = DbHelper::fetchOrInsertApplication($packageName, ReportHelper::formatPackageName($packageName, true));
if ($appId == -1) {
$succeeded = false;
}
$mUpdateHelper->printStepMsg("Inserted application " . $packageName . ", id is " . $appId, $appId == -1, false);
$mUpdateHelper->printStepMsg('Update issued #' . $issueId . ' with application id #' . $appId, false, false);
DbHelper::exec('UPDATE ' . TBL_ISSUES . ' SET ' . ISSUE_APP_ID . '=' . $appId . ' WHERE ' . ISSUE_ID . '=' . $issueId, false);
}
$mUpdateHelper->printEndStepMsg($succeeded, null, false);
$mUpdateHelper->printEndStepMsg(true, null, true);
示例5: isset
$order = isset($_POST['order']) ? $_POST['order'] : 1;
$periodEnd = isset($_POST['periodEnd']) ? $_POST['periodEnd'] : '';
if (!isset($_POST['periodStart'])) {
$periodStart = date('Y-m-d', strtotime((empty($periodEnd) ? '' : $periodEnd) . ' -90 days'));
} else {
$periodStart = $_POST['periodStart'];
}
$where = array();
if ($mSelectedAppId > 0) {
$where[] = SALE_APP_ID . '=' . $mSelectedAppId;
}
$where[] = SALE_ORDER_CHARGED_TIMESTAMP . '>=' . strtotime($periodStart);
if (!empty($periodEnd)) {
$where[] = SALE_ORDER_CHARGED_TIMESTAMP . '<=' . strtotime($periodEnd);
}
$sales = DbHelper::selectRows(TBL_SALES . ' LEFT JOIN ' . TBL_APPLICATIONS . ' ON ' . APP_ID . '=' . SALE_APP_ID, implode(' AND ', $where), $orderOpts[$order][1], TBL_SALES . '.*, ' . APP_NAME, null, null, false);
?>
<div class="well" >
<form class="form-inline" action="<?php
echo $mNavCtl->getURL();
?>
" method="post" style="margin-bottom:0px;" >
<strong style="padding-left:15px; padding-right:15px;" >Period</strong>
<div id="periodStart" class="input-append" >
<input name="periodStart" data-format="yyyy-MM-dd" type="text" class="input-small" value="<?php
echo $periodStart;
?>
" />
<span class="add-on"><i data-time-icon="icon-time" data-date-icon="icon-calendar" ></i></span>
</div>
示例6: defined
<?php
defined('DIRECT_ACCESS_CHECK') or die('DIRECT ACCESS NOT ALLOWED');
/**
* Copyright (c) 2013 EIRL DEVAUX J. - Medialoha.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* EIRL DEVAUX J. - Medialoha - initial API and implementation
*/
require_once 'includes/currency.class.php';
$apps = DbHelper::selectRows(TBL_APPLICATIONS, null, APP_NAME . ' ASC', '*, (SELECT COUNT(*) FROM ' . TBL_ISSUES . ' WHERE ' . ISSUE_APP_ID . '=' . APP_ID . ') issues', null, null, false);
?>
<fieldset><legend><img src="assets/images/ic_application.png" class="fieldset-icon" />Applications</legend>
<table id="appsTbl" class="table table-condensed apps-tbl" >
<thead>
<tr>
<th class="app-id" >ID</th>
<th style="width:300px;" >Application Name</th>
<th>Package</th>
<th class="app-issues" style="width:30px;" ><i class="icon-tag" /></th>
<th style="" ></th>
</tr>
</thead>
<tbody>
<?php
foreach ($apps as $app) {
$canEditPackage = $app['issues'] == 0;
示例7: COUNT
legend: { show:true, container:'#salesEvolutionLegend' },
grid:{ show:true, color:"#666666", backgroundColor:"#ffffff", borderColor:"#666666", borderWidth:{top:0, right:0, bottom:1, left:1} }
});
});
</script>
<?php
}
?>
</div>
<!-- ////// SALES PER APPLICATION ////// -->
<div class="span4 app-stat-box" >
<h4>Sales per Application</h4>
<div id="salesPerApp" style="width:400px; height:200px;" ></div>
<?php
$salesPerApp = DbHelper::selectRows(TBL_SALES . ' LEFT JOIN ' . TBL_APPLICATIONS . ' ON ' . APP_ID . '=' . SALE_APP_ID, null, SALE_ORDER_CHARGED_TIMESTAMP . ' ASC', APP_NAME . ', COUNT(*) count', SALE_APP_ID, null, false);
?>
<script type="text/javascript" >$(function() { drawPieChart('#salesPerApp', <?php
echo ChartHelper::convertMySQLArrToPieChartJSON($salesPerApp, false);
?>
, false); });</script>
</div>
</div>
<div class="row" >
<div id="salesEvolutionLegend" class="span4" style="" ></div>
</div>
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="libs/flot/excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="libs/flot/jquery.flot.min.js"></script>