From: <tim...@us...> - 2010-09-23 10:59:03
|
Revision: 3758 http://web-erp.svn.sourceforge.net/web-erp/?rev=3758&view=rev Author: tim_schofield Date: 2010-09-23 10:58:56 +0000 (Thu, 23 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/ReorderLevelLocation.php trunk/doc/Change.log.html trunk/index.php Modified: trunk/ReorderLevelLocation.php =================================================================== --- trunk/ReorderLevelLocation.php 2010-09-23 10:53:32 UTC (rev 3757) +++ trunk/ReorderLevelLocation.php 2010-09-23 10:58:56 UTC (rev 3758) @@ -11,7 +11,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="">' . ' ' . _('Inventory Reorder Level Location Report') . ''; - + if (isset($_POST['submit']) or isset($_POST['update'])) { if ($_POST['NumberOfDays']==""){ @@ -37,19 +37,19 @@ WHERE locstock.stockid = stockmaster.stockid AND stockmaster.categoryid = '" . $_POST['StockCat'] . "' AND locstock.loccode = '" . $_POST['StockLocation'] . "' - ORDER BY " . $order . " ASC"; + ORDER BY '" . $order . "' ASC"; $result = DB_query($sql,$db); - $sqlloc="SELECT locationname - FROM locations + $sqlloc="SELECT locationname + FROM locations WHERE loccode='".$_POST['StockLocation']."'"; - + $ResultLocation = DB_query($sqlloc,$db); $Location=DB_fetch_array($ResultLocation); - echo'<p class="page_title_text" align="center"><strong>' . _('Location : ') . '' . $Location['0'] . ' </strong></p>'; - echo'<p class="page_title_text" align="center"><strong>' . _('Number Of Days Sales : ') . '' . $_POST['NumberOfDays'] . '' . _(' Days ') . ' </strong></p>'; + echo'<p class="page_title_text" align="center"><strong>' . _('Location : ') . '' . $Location['0'] . ' </strong></p>'; + echo'<p class="page_title_text" align="center"><strong>' . _('Number Of Days Sales : ') . '' . $_POST['NumberOfDays'] . '' . _(' Days ') . ' </strong></p>'; echo "<table>"; echo '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -65,11 +65,11 @@ while ($myrow=DB_fetch_array($result)) { - //update database if update pressed + //update database if update pressed if ($_POST['submit']=='Update'){ - $SQLUpdate="UPDATE locstock SET reorderlevel = '" . $_POST[$myrow['0']] . "' - WHERE `locstock`.`loccode` = '" . $_POST['StockLocation'] . "' + $SQLUpdate="UPDATE locstock SET reorderlevel = '" . $_POST[$myrow['0']] . "' + WHERE `locstock`.`loccode` = '" . $_POST['StockLocation'] . "' AND `locstock`.`stockid` = '" . $myrow['0'] . "'"; $Resultup = DB_query($SQLUpdate,$db); @@ -77,7 +77,7 @@ } if (isset($_POST[$myrow['0']])){ - $reorder=$_POST[$myrow['0']]; + $reorder=$_POST[$myrow['0']]; }else{ $reorder=$myrow[2]; } @@ -92,7 +92,7 @@ //variable for update data - echo'<input type="hidden" value=' . $_POST['order'] . ' name='. _('order').' /> + echo'<input type="hidden" value=' . $_POST['order'] . ' name='. _('order').' /> <input type="hidden" value=' . $_POST['StockLocation'] . ' name='. _('StockLocation').' /> <input type="hidden" value=' . $_POST['StockCat'] . ' name='. _('StockCat').' /> <input type="hidden" value=' . $_POST['NumberOfDays'] . ' name='. _('NumberOfDays').' /> @@ -124,17 +124,17 @@ //get On Hand all //find the quantity onhand item - $sqloh="SELECT sum(quantity)as qty - FROM `locstock` + $sqloh="SELECT sum(quantity)as qty + FROM `locstock` WHERE stockid='" . $myrow['0'] . "'"; $oh = db_query($sqloh,$db); $ohRow = db_fetch_row($oh); $ohRow[0]; - //get On Hand in Location - $sqlohin="SELECT SUM(quantity) AS qty - FROM `locstock` + //get On Hand in Location + $sqlohin="SELECT SUM(quantity) AS qty + FROM `locstock` WHERE stockid='" . $myrow['0'] . "' AND locstock.loccode = '" . $_POST['StockLocation'] . "'"; $ohin = db_query($sqlohin,$db); @@ -152,7 +152,7 @@ } //end of looping echo'<tr> - <td style="text-align:center" colspan=7><input type=submit name=submit value=' . _("Update") . '></td> + <td style="text-align:center" colspan=7><input type=submit name=submit value=' . _("Update") . '></td> </tr></form>'; @@ -165,8 +165,8 @@ $sql = "SELECT loccode, locationname FROM locations"; - $resultStkLocs = DB_query($sql,$db); - echo '<table> + $resultStkLocs = DB_query($sql,$db); + echo '<table class=selection> <tr> <td>' . _('Location') . ':</td> <td><select name="StockLocation"> '; @@ -175,19 +175,19 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; - } + } echo '</select></td></tr>'; - $SQL='SELECT categoryid, categorydescription - FROM stockcategory - ORDER BY categorydescription'; - - $result1 = DB_query($SQL,$db); + $SQL="SELECT categoryid, categorydescription + FROM stockcategory + ORDER BY categorydescription"; + $result1 = DB_query($SQL,$db); + echo '<tr><td>' . _('Category') . ':</td> <td><select name="StockCat">'; - while ($myrow1 = DB_fetch_array($result1)) { + while ($myrow1 = DB_fetch_array($result1)) { echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-23 10:53:32 UTC (rev 3757) +++ trunk/doc/Change.log.html 2010-09-23 10:58:56 UTC (rev 3758) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>23/09/10 Tim: ReorderLevelLocation.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: ReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> <p>23/09/10 Tim: RecurringSalesOrdersProcess.php - SQL quoting corrections</p> <p>23/09/10 Tim: RecurringSalesOrders.php - SQL quoting corrections and layout changes and improvements</p> Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-09-23 10:53:32 UTC (rev 3757) +++ trunk/index.php 2010-09-23 10:58:56 UTC (rev 3758) @@ -637,6 +637,11 @@ </tr> <tr> <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?' . SID . '">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> + </td> + </tr> + <tr> + <td class="menu_group_item"> <?php echo '<p>• <a href="' . $rootpath . '/StockDispatch.php?' . SID . '">' . _('Stock Dispatch') . '</a></p>'; ?> </td> </tr> @@ -730,11 +735,6 @@ <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php?' . SID . '">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> </td> </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?' . SID . '">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> - </td> - </tr> </table> </td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |