[Weberp-svn] SF.net SVN: weberp:[9368] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2012-07-02 21:49:27
|
Revision: 9368 http://weberp.svn.sourceforge.net/weberp/?rev=9368&view=rev Author: tim_schofield Date: 2012-07-02 21:49:21 +0000 (Mon, 02 Jul 2012) Log Message: ----------- New dashboard functions Added Paths: ----------- trunk/dashboard/ trunk/dashboard/CompanyInfo.php trunk/dashboard/SalesGraph.php trunk/dashboard/StockBelowReorderLevel.php trunk/dashboard/UserInfo.php Added: trunk/dashboard/CompanyInfo.php =================================================================== --- trunk/dashboard/CompanyInfo.php (rev 0) +++ trunk/dashboard/CompanyInfo.php 2012-07-02 21:49:21 UTC (rev 9368) @@ -0,0 +1,68 @@ +<?php + +require_once('includes/session.inc'); + +$AppWidthPercent = 20; +$AppTitle = _('Company Information'); +$AppMaxRecords = 10; +$FontSize = 10; +$FontWeight = 'normal'; +$Background = '#BDC0E6'; + +$sql = "SELECT coyname, + regoffice1, + regoffice2, + regoffice3, + regoffice4, + regoffice5, + regoffice6, + telephone, + fax, + email, + gstno, + companynumber, + currencies.currency + FROM companies + LEFT JOIN currencies + ON companies.currencydefault=currencies.currabrev"; +$result = DB_query($sql, $db); + +echo '<table width="' . $AppWidthPercent . '%" class="AppWindow" style="background:'.$Background.'"> + <tr> + <th colspan="4" class="AppHeader">' . $AppTitle . '</th> + </tr>'; + +while ($myrow=DB_fetch_array($result)) { + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . $myrow['coyname'] . '</td></tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . $myrow['regoffice1'] . '</td>'; + echo '<td>Tel - ' . $myrow['telephone'] . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . $myrow['regoffice2'] . '</td>'; + echo '<td> Fax - ' . $myrow['fax'] . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . $myrow['regoffice3'] . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . $myrow['regoffice4'] . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . $myrow['regoffice5'] . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . $myrow['regoffice6'] . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . $myrow['regoffice6'] . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . $myrow['currency'] . '</td> + </tr>'; +} + +echo '</table>'; + +?> \ No newline at end of file Added: trunk/dashboard/SalesGraph.php =================================================================== --- trunk/dashboard/SalesGraph.php (rev 0) +++ trunk/dashboard/SalesGraph.php 2012-07-02 21:49:21 UTC (rev 9368) @@ -0,0 +1,43 @@ +<?php + +require_once('includes/session.inc'); + +$AppWidthPercent = 40; +$AppTitle = _('Sales By Value This Year'); +$AppMaxRecords = 10; +$FontSize = 10; +$FontWeight = 'normal'; +$Background = '#D4F1C0'; + +$sql = ""; + +echo '<table width="' . $AppWidthPercent . '%" class="AppWindow" style="background:'.$Background.';"> + <tr> + <th colspan="4" class="AppHeader">' . $AppTitle . '</th> + </tr>'; + +echo '<tr> + <td><canvas id="graph" width="300px" height="150px"></canvas></td> + </tr>'; + +echo '</table>'; +echo '<script> +var graphCanvas = document.getElementById(\'graph\'); +// Ensure that the element is available within the DOM +if (graphCanvas && graphCanvas.getContext) { + // Open a 2D context within the canvas + var context = graphCanvas.getContext(\'2d\'); + + // Bar chart data + var data = new Array(5); + data[0] = "apples,400"; + data[1] = "oranges,120"; + data[2] = "bananas,80"; + data[3] = "kiwis,230"; + data[4] = "tangarines,340"; + + // Draw the bar chart + drawBarChart(context, data, 50, 50, (graphCanvas.height - 20), 30); +} +</script>'; +?> \ No newline at end of file Added: trunk/dashboard/StockBelowReorderLevel.php =================================================================== --- trunk/dashboard/StockBelowReorderLevel.php (rev 0) +++ trunk/dashboard/StockBelowReorderLevel.php 2012-07-02 21:49:21 UTC (rev 9368) @@ -0,0 +1,45 @@ +<?php + +require_once('includes/session.inc'); + +$AppWidthPercent = 20; +$AppTitle = _('Items below Re-order Level'); +$AppMaxRecords = 10; +$FontSize = 10; +$FontWeight = 'normal'; +$Background = '#FFFE84'; + +$sql = "SELECT locations.locationname, + locstock.stockid, + stockmaster.description, + stockmaster.longdescription, + stockmaster.decimalplaces, + locstock.quantity, + locstock.reorderlevel + FROM locstock + LEFT JOIN stockmaster + ON locstock.stockid=stockmaster.stockid + LEFT JOIN locations + ON locstock.loccode=locations.loccode + WHERE locstock.quantity < locstock.reorderlevel + ORDER BY (locstock.quantity-locstock.reorderlevel) ASC + LIMIT " . $AppMaxRecords; +$result = DB_query($sql, $db); + +echo '<table width="' . $AppWidthPercent . '%" class="AppWindow" style="background:'.$Background.'"> + <tr> + <th colspan="4" class="AppHeader">' . $AppTitle . '</th> + </tr>'; + +while ($myrow=DB_fetch_array($result)) { + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';" title="' . $myrow['longdescription'] . '"> + <td>' . $myrow['locationname'] . '</td> + <td>' . InternalLink('', 'SelectProduct.php?StockID=' . $myrow['stockid'], $myrow['description'], 'AppLink') . '</td> + <td class="number">' . locale_number_format($myrow['quantity'], $myrow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($myrow['reorderlevel'], $myrow['decimalplaces']) . '</td> + </tr>'; +} + +echo '</table>'; + +?> \ No newline at end of file Added: trunk/dashboard/UserInfo.php =================================================================== --- trunk/dashboard/UserInfo.php (rev 0) +++ trunk/dashboard/UserInfo.php 2012-07-02 21:49:21 UTC (rev 9368) @@ -0,0 +1,55 @@ +<?php + +require_once('includes/session.inc'); + +$AppWidthPercent = 20; +$AppTitle = _('User Information'); +$AppMaxRecords = 10; +$FontSize = 10; +$FontWeight = 'normal'; +$Background = '#DEE1FF'; + +$sql = "SELECT userid, + realname, + phone, + email, + theme, + language + FROM www_users"; +$result = DB_query($sql, $db); + +echo '<table width="' . $AppWidthPercent . '%" class="AppWindow" style="background:'.$Background.'"> + <tr> + <th colspan="4" class="AppHeader">' . $AppTitle . '</th> + </tr>'; + +while ($myrow=DB_fetch_array($result)) { + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . _('User ID') . ':</td> + <td>' . InternalLink('', 'UserSettings.php', $myrow['userid'], 'AppLink') . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . _('Name') . ':</td> + <td>' . InternalLink('', 'UserSettings.php', $myrow['realname'], 'AppLink') . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . _('Telephone') . ':</td> + <td>' . InternalLink('', 'UserSettings.php', $myrow['phone'], 'AppLink') . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . _('Email') . ':</td> + <td>' . InternalLink('', 'UserSettings.php', $myrow['email'], 'AppLink') . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . _('Theme') . ':</td> + <td>' . InternalLink('', 'UserSettings.php', $myrow['theme'], 'AppLink') . '</td> + </tr>'; + echo '<tr style="font-size:' . $FontSize . 'px; font-weight:' . $FontWeight . ';"> + <td>' . _('Language') . ':</td> + <td>' . InternalLink('', 'UserSettings.php', $myrow['language'], 'AppLink') . '</td> + </tr>'; +} + +echo '</table>'; + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |