[Weberp-svn] SF.net SVN: weberp:[5489] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-07-01 11:21:17
|
Revision: 5489 http://weberp.svn.sourceforge.net/weberp/?rev=5489&view=rev Author: tim_schofield Date: 2011-07-01 11:21:11 +0000 (Fri, 01 Jul 2011) Log Message: ----------- New field in Salesman table Modified Paths: -------------- trunk/SalesPeople.php trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/86.php Modified: trunk/SalesPeople.php =================================================================== --- trunk/SalesPeople.php 2011-07-01 11:20:55 UTC (rev 5488) +++ trunk/SalesPeople.php 2011-07-01 11:21:11 UTC (rev 5489) @@ -1,8 +1,6 @@ <?php -/* $Id$*/ +/* $Id: SalesPeople.php 4591 2011-06-09 10:33:38Z daintree $*/ -//$PageSecurity = 3; - include('includes/session.inc'); $title = _('Sales People Maintenance'); include('includes/header.inc'); @@ -78,6 +76,9 @@ if (!isset($_POST['Breakpoint'])){ $_POST['Breakpoint']=0; } + if (!isset($_POST['Current'])){ + $_POST['Current']=0; + } if (isset($SelectedSaleperson) AND $InputError !=1) { @@ -88,7 +89,8 @@ smantel='" . $_POST['SManTel'] . "', smanfax='" . $_POST['SManFax'] . "', breakpoint='" . $_POST['Breakpoint'] . "', - commissionrate2='" . $_POST['CommissionRate2'] . "' + commissionrate2='" . $_POST['CommissionRate2'] . "', + current='" . $_POST['Current'] . "' WHERE salesmancode = '".$SelectedSaleperson."'"; $msg = _('Salesperson record for') . ' ' . $_POST['SalesmanName'] . ' ' . _('has been updated'); @@ -102,14 +104,16 @@ commissionrate2, breakpoint, smantel, - smanfax) + smanfax, + current) VALUES ('" . $_POST['SalesmanCode'] . "', '" . $_POST['SalesmanName'] . "', '" . $_POST['CommissionRate1'] . "', '" . $_POST['CommissionRate2'] . "', '" . $_POST['Breakpoint'] . "', '" . $_POST['SManTel'] . "', - '" . $_POST['SManFax'] . "' + '" . $_POST['SManFax'] . "', + '" . $_POST['Current'] . "' )"; $msg = _('A new salesperson record has been added for') . ' ' . $_POST['SalesmanName']; @@ -130,6 +134,7 @@ unset($_POST['Breakpoint']); unset($_POST['SManFax']); unset($_POST['SManTel']); + unset($_POST['Current']); } } elseif (isset($_GET['delete'])) { @@ -176,7 +181,8 @@ smanfax, commissionrate1, breakpoint, - commissionrate2 + commissionrate2, + current FROM salesman"; $result = DB_query($sql,$db); @@ -187,7 +193,8 @@ <th>' . _('Facsimile') . '</th> <th>' . _('Comm Rate 1') . '</th> <th>' . _('Break') . '</th> - <th>' . _('Comm Rate 2') . '</th></tr>'; + <th>' . _('Comm Rate 2') . '</th> + <th>' . _('Current') . '</th></tr>'; $k=0; while ($myrow=DB_fetch_row($result)) { @@ -198,6 +205,7 @@ echo '<tr class="OddTableRows">'; $k++; } + if ($myrow[7] == 1) $ActiveText = _("Yes"); else $ActiveText = _("No"); printf(' <td>%s</td> @@ -207,6 +215,7 @@ <td class=number>%s</td> <td class=number>%s</td> <td class=number>%s</td> + <td>%s</td> <td><a href="%sSelectedSaleperson=%s">'. _('Edit') . '</a></td> <td><a href="%sSelectedSaleperson=%s&delete=1">' . _('Delete') . '</a></td> </tr>', @@ -217,6 +226,7 @@ $myrow[4], $myrow[5], $myrow[6], + $ActiveText, $_SERVER['PHP_SELF'] . '?' . SID . '&', $myrow[0], $_SERVER['PHP_SELF'] . '?' . SID . '&', @@ -244,7 +254,8 @@ smanfax, commissionrate1, breakpoint, - commissionrate2 + commissionrate2, + current FROM salesman WHERE salesmancode='".$SelectedSaleperson."'"; @@ -258,6 +269,7 @@ $_POST['CommissionRate1'] = $myrow['commissionrate1']; $_POST['Breakpoint'] = $myrow['breakpoint']; $_POST['CommissionRate2'] = $myrow['commissionrate2']; + $_POST['Current'] = $myrow['current']; echo '<input type=hidden name="SelectedSaleperson" value="' . $SelectedSaleperson . '">'; @@ -288,8 +300,10 @@ if (!isset($_POST['Breakpoint'])){ $_POST['Breakpoint']=0; } + if (!isset($_POST['Current'])){ + $_POST['Current']=0; + } - echo '<tr><td>' . _('Salesperson Name') . ':</td><td><input type="text" '. (in_array('SalesmanName',$Errors) ? 'class="inputerror"' : '' ) .' name="SalesmanName" size=30 maxlength=30 value="' . $_POST['SalesmanName'] . '"></td></tr>'; echo '<tr><td>' . _('Telephone No') . ':</td><td><input type="text" name="SManTel" size=20 maxlength=20 value="' . $_POST['SManTel'] . '"></td></tr>'; echo '<tr><td>' . _('Facsimile No') . ':</td><td><input type="text" name="SManFax" size=20 maxlength=20 value="' . $_POST['SManFax'] . '"></td></tr>'; @@ -297,6 +311,19 @@ echo '<tr><td>' . _('Breakpoint') . ':</td><td><input type="text" class=number name="Breakpoint" size=6 maxlength=6 value="' . $_POST['Breakpoint'] . '"></td></tr>'; echo '<tr><td>' . _('Commission Rate 2') . ':</td><td><input type="text" class=number name="CommissionRate2" size=5 maxlength=5 value="' . $_POST['CommissionRate2']. '"></td></tr>'; + echo '<tr><td>' . _('Current?') . ':</td><td><select name="Current">'; + if ($_POST['Current']==1){ + echo '<option selected value=1>' . _('Yes') . '</option>'; + } else { + echo '<option value=1>' . _('Yes') . '</option>'; + } + if ($_POST['Current']==0){ + echo '<option selected value=0>' . _('No') . '</option>'; + } else { + echo '<option value=0>' . _('No') . '</option>'; + } + echo '</select></td></tr>'; + echo '</table>'; echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-07-01 11:20:55 UTC (rev 5488) +++ trunk/includes/session.inc 2011-07-01 11:21:11 UTC (rev 5489) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=85; +$DBVersion=86; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/86.php =================================================================== --- trunk/sql/mysql/updates/86.php (rev 0) +++ trunk/sql/mysql/updates/86.php 2011-07-01 11:21:11 UTC (rev 5489) @@ -0,0 +1,7 @@ +<?php + +AddColumn('current', 'salesman', 'tinyint(4)', 'NOT NULL', '1', 'commissionrate2', $db); + +UpdateDBNo(86, $db); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |