Beispiel #1
0
<?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">
Beispiel #2
0
							<dd id="milestoneView" >
								<?php 
    $m->printOverview();
    ?>
								<a href="javascript:editIssueMilestone()" >&nbsp;<i class="icon-pencil" ></i>&nbsp;</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 
Beispiel #3
0
				</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 
Beispiel #4
0
<?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);
Beispiel #5
0
$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>
Beispiel #6
0
<?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;
Beispiel #7
0
										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>