From: <tim...@us...> - 2010-07-19 20:49:56
|
Revision: 3647 http://web-erp.svn.sourceforge.net/web-erp/?rev=3647&view=rev Author: tim_schofield Date: 2010-07-19 20:49:50 +0000 (Mon, 19 Jul 2010) Log Message: ----------- Layout changes and sql quoting, use javascript to change location Modified Paths: -------------- trunk/FixedAssetTransfer.php trunk/doc/Change.log.html Modified: trunk/FixedAssetTransfer.php =================================================================== --- trunk/FixedAssetTransfer.php 2010-07-19 20:49:25 UTC (rev 3646) +++ trunk/FixedAssetTransfer.php 2010-07-19 20:49:50 UTC (rev 3647) @@ -1,6 +1,5 @@ <?php -/* $Id$*/ $PageSecurity = 11; include('includes/session.inc'); @@ -13,7 +12,7 @@ if (substr($key,0,4)=='move') { $id=substr($key,4); $location=$_POST['location'.$id]; - $sql='UPDATE assetmanager + $sql='UPDATE assetmanager SET location="'.$location.'" WHERE id='.$id; $result=DB_query($sql, $db); @@ -28,10 +27,9 @@ $sql='SELECT categoryid, categorydescription FROM stockcategory WHERE stocktype="'.'A'.'"'; $result=DB_query($sql, $db); echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID .'" method=post>'; - echo '<b>' . $msg . '</b>'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . - '" alt="">' . ' ' . _('Search for a Fixed Asset'); - echo '<table><tr>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . + '" alt="">' . ' ' . $title . '</p>'; + echo '<table class=selection><tr>'; echo '<td>'. _('In Asset Category') . ': '; echo '<select name="StockCat">'; @@ -39,12 +37,6 @@ $_POST['StockCat'] = ""; } - if ($_POST['StockCat'] == "All") { - echo '<option selected value="All">' . _('All'); - } else { - echo '<option value="All">' . _('All'); - } - while ($myrow = DB_fetch_array($result)) { if ($myrow['categoryid'] == $_POST['StockCat']) { echo '<option selected VALUE="' . $myrow['categoryid'] . '">' . $myrow['categorydescription']; @@ -58,7 +50,7 @@ if (isset($_POST['Keywords'])) { - echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size=20 maxlength=25>'; + echo '<input type="text" name="Keywords" value="' . trim($_POST['Keywords'],'%') . '" size=20 maxlength=25>'; } else { echo '<input type="text" name="Keywords" size=20 maxlength=25>'; } @@ -69,7 +61,7 @@ echo '<td>'; if (isset($_POST['StockCode'])) { - echo '<input type="text" name="StockCode" value="'. $_POST['StockCode'] . '" size=15 maxlength=18>'; + echo '<input type="text" name="StockCode" value="'. trim($_POST['StockCode'],'%') . '" size=15 maxlength=18>'; } else { echo '<input type="text" name="StockCode" size=15 maxlength=18>'; } @@ -80,14 +72,14 @@ echo '<td>'; if (isset($_POST['StockCode'])) { - echo '<input type="text" name="SerialNumber" value="'. $_POST['SerialNumber'] . '" size=15 maxlength=18>'; + echo '<input type="text" name="SerialNumber" value="'. trim($_POST['SerialNumber'],'%') . '" size=15 maxlength=18>'; } else { echo '<input type="text" name="SerialNumber" size=15 maxlength=18>'; } - + echo '</td></tr></table><br>'; - echo '<div class="centre"><input type=submit name="Search" value="'. _('Search Now') . '"></div><hr></form>'; + echo '<div class="centre"><input type=submit name="Search" value="'. _('Search Now') . '"></div></form><br>'; } if (isset($_POST['Search'])) { if ($_POST['StockCat']=='All') { @@ -108,7 +100,7 @@ } else { $_POST['SerialNumber']='%'; } - $sql= 'SELECT assetmanager.*,stockmaster.description, fixedassetlocations.locationdescription + $sql= 'SELECT assetmanager.*,stockmaster.description, fixedassetlocations.locationdescription FROM assetmanager LEFT JOIN stockmaster ON assetmanager.stockid=stockmaster.stockid @@ -116,10 +108,10 @@ ON assetmanager.location=fixedassetlocations.locationid WHERE stockmaster.categoryid like "'.$_POST['StockCat'].'" AND stockmaster.description like "'.$_POST['Keywords'].'" - AND assetmanager.stockid like "'.$_POST['StockCode'].'" + AND assetmanager.stockid like "'.$_POST['StockCode'].'" AND assetmanager.serialno like "'.$_POST['SerialNumber'].'"'; $result=DB_query($sql, $db); - echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID .'" method=post><table>'; + echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID .'" method=post><table class=selection>'; echo '<tr><th>'._('Asset ID').'</th> <th>'._('Stock Code').'</th> <th>'._('Description').'</th> @@ -139,7 +131,7 @@ echo '<td class=number>'.number_format($myrow['cost'],2).'</td>'; echo '<td class=number>'.number_format($myrow['depn'],2).'</td>'; echo '<td>'.$myrow['locationdescription'].'</td>'; - echo '<td><select name="location'.$myrow['id'].'">'; + echo '<td><select name="location'.$myrow['id'].'" onChange="ReloadForm(move'.$myrow['id'].')">'; echo '<option></option>'; while ($locationrow=DB_fetch_array($locationresult)) { if ($locationrow['locationid']==$myrow['location']) { @@ -150,13 +142,18 @@ } } echo '</select></td>'; + echo '<input type=hidden name=StockCat value="' . $_POST['StockCat'].'"'; + echo '<input type=hidden name=Keywords value="' . $_POST['Keywords'].'"'; + echo '<input type=hidden name=StockCode value="' . $_POST['StockCode'].'"'; + echo '<input type=hidden name=SerialNumber value="' . $_POST['SerialNumber'].'"'; + echo '<input type=hidden name=Search value="' . $_POST['Search'].'"'; echo '<td><input type=submit name="move'.$myrow['id'].'" value=Move></td>'; echo '</tr>'; } echo '</table></form>'; } //} - + include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-19 20:49:25 UTC (rev 3646) +++ trunk/doc/Change.log.html 2010-07-19 20:49:50 UTC (rev 3647) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>19/07/10 Tim: FixedassetTransfer.php - Layout changes and sql quoting, use javascript to change location</p> <p>19/07/10 Tim: FixedassetLocations.php - Layout changes and sql quoting, proper checks for deletion of location</p> <p>19/07/10 Tim: PO_SelectOSPurchOrder.php - Remove order values when security token 12 is not set</p> <p>19/07/10 Tim: SelectProduct.php - Change prices security to token 12</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |