[Weberp-svn] SF.net SVN: weberp:[8277] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-10-13 17:52:52
|
Revision: 8277 http://weberp.svn.sourceforge.net/weberp/?rev=8277&view=rev Author: tim_schofield Date: 2011-10-13 17:52:45 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Add in field for authoriser of requests Modified Paths: -------------- trunk/Departments.php trunk/sql/mysql/updates/95.php Modified: trunk/Departments.php =================================================================== --- trunk/Departments.php 2011-10-13 17:52:28 UTC (rev 8276) +++ trunk/Departments.php 2011-10-13 17:52:45 UTC (rev 8277) @@ -60,7 +60,8 @@ $OldDepartmentName = $myrow[0]; $sql = array(); $sql[] = "UPDATE departments - SET description='" . $_POST['DepartmentName'] . "' + SET description='" . $_POST['DepartmentName'] . "', + authoriser='" . $_POST['Authoriser'] . "' WHERE description ".LIKE." '".$OldDepartmentName."'"; } else { $InputError = 1; @@ -79,9 +80,11 @@ prnMsg( _('There is already a Department with the specified name.'),'error'); } else { $sql = "INSERT INTO departments ( - description ) + description, + authoriser ) VALUES ( - '" . $_POST['DepartmentName'] ."' + '" . $_POST['DepartmentName'] ."', + '" . $_POST['Authoriser'] ."' )"; } $msg = _('The new department has been created'); @@ -158,7 +161,8 @@ or deletion of the records*/ $sql = "SELECT departmentid, - description + description, + authoriser FROM departments ORDER BY departmentid"; @@ -167,11 +171,12 @@ echo '<table class="selection"> <tr> - <th>' . _('Departments') . '</th> + <th>' . _('Department Name') . '</th> + <th>' . _('Authoriser') . '</th> </tr>'; $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -181,9 +186,10 @@ $k++; } - echo '<td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedDepartmentID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedDepartmentID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td>' . $myrow['description'] . '</td>'; + echo '<td>' . $myrow['authoriser'] . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedDepartmentID=' . $myrow['departmentid'] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedDepartmentID=' . $myrow['departmentid'] . '&delete=1">' . _('Delete') .'</a></td>'; echo '</tr>'; } //END WHILE LIST LOOP @@ -192,7 +198,7 @@ if (isset($SelectedDepartmentID)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Verify Departments') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('View all Departments') . '</a></div>'; } echo '<br />'; @@ -230,8 +236,19 @@ } echo '<tr> <td>' . _('Department Name') . ':' . '</td> - <td><input type="text" name="DepartmentName" size="30" maxlength="30" value="' . $_POST['DepartmentName'] . '"></td> + <td><input type="text" name="DepartmentName" size="50" maxlength="100" value="' . $_POST['DepartmentName'] . '"></td> </tr>'; + echo '<tr><td>'._('Authoriser').'</td><td><select name="Authoriser">'; + $usersql="SELECT userid FROM www_users"; + $userresult=DB_query($usersql,$db); + while ($myrow=DB_fetch_array($userresult)) { + if ($myrow['userid']==$UserID) { + echo '<option selected="True" value="'.$myrow['userid'].'">'.$myrow['userid'].'</option>'; + } else { + echo '<option value="'.$myrow['userid'].'">'.$myrow['userid'].'</option>'; + } + } + echo '</select></td></tr>'; echo '</table><br />'; echo '<div class="centre"><input type="submit" name="Submit" value=' . _('Enter Information') . '></div>'; Modified: trunk/sql/mysql/updates/95.php =================================================================== --- trunk/sql/mysql/updates/95.php 2011-10-13 17:52:28 UTC (rev 8276) +++ trunk/sql/mysql/updates/95.php 2011-10-13 17:52:45 UTC (rev 8277) @@ -9,7 +9,8 @@ CreateTable('departments', "CREATE TABLE departments ( `departmentid` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, -`description` VARCHAR (100) NOT NULL DEFAULT '' +`description` VARCHAR (100) NOT NULL DEFAULT '', +`authoriser` varchar (20) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db); CreateTable('dispatch', "CREATE TABLE dispatch ( @@ -23,7 +24,7 @@ CreateTable('dispatchitems', "CREATE TABLE dispatchitems ( `dispatchitemsid` INT NOT NULL DEFAULT 0, `dispatchid` INT NOT NULL DEFAULT 0, -`itemid` VARCHAR (30) NOT NULL DEFAULT '', +`stockid` VARCHAR (20) NOT NULL DEFAULT '', `quantity` DOUBLE NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8", $db); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |