Location: PHPKode > projects > PAT and Inventory Management System > m/a/changename.php
	Pat and Inventory Management System
	Version 2.0
	Created by Tom Dyer
	Last edited by Tom Dyer 16/1/10
	Main (a) Page
session_start();	// This connects an existing session	
include_once '../../config.php';
$_SESSION['docroot'] = $directory;
$_SESSION['servroot'] = $servroot;
$barcode = $_SESSION['barcode'];
$name = $_SESSION['description'];
<title>PIMS | Home Screen</title>
<body onLoad="document.input.barcode.focus()" LINK="0033CC" VLINK="0033CC">
<Head><link rel="shortcut icon" href="<?php echo "$servroot"; ?>/favicon.ico" type="image/x-icon"></Head>
	@mysql_select_db($database) or die( "Unable to select database");
	$query="SELECT * FROM names ORDER BY name ASC";
		<h3>This item does not have a standard description</h3>
        <h4>Please select a name from the list</h4>
		<table border="0">
		<form action="" method="post" name="input">
		<input type="hidden" name="cmd" value="done"</input>
        <tr><td>Barcode:</td><td><? echo "$barcode"; ?></td></tr>
        <tr><td>Description:</td><td><? echo "$name"; ?></td></tr>
		<td>Pick Description: </td><td><SELECT id="name" name="name"><option value=pick>Don't Change Description</option><?php
														while ($i < $num) {
														echo '<option value="'.$names.'">'.$names.'</option>';
		<input type="submit" value="Submit">
		<br />
        if ($_POST['cmd'] == 'done')
			$newname = $_POST['name'];
			if($newname == 'pick')
				mysql_query("INSERT INTO `namechanged` VALUES ('', '$barcode')");
				echo "No Change Made";
				mysql_query("UPDATE equipment SET name = '$newname' WHERE barcode = '$barcode'");
				echo "Changed Name";
			header('Location: index.php');
			echo '<script language="javascript">window.location="index.php";</script>';
Return current item: PAT and Inventory Management System