You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.5 KiB
63 lines
1.5 KiB
<?php
|
|
include("header.php");
|
|
|
|
// display only if admin
|
|
if($_SESSION['suser_level'] >= 2) {
|
|
|
|
// check for submit
|
|
if ($_SERVER['REQUEST_METHOD']=="POST" ) {
|
|
$assetclass_name = $_POST['assetclass_name'];
|
|
$assetclassgroup_id = $_POST['assetclassgroup_id'];
|
|
mysql_query("INSERT INTO assetclass (assetclass_name, assetclassgroup_id) VALUE ('$assetclass_name', '$assetclassgroup_id')") or die(mysql_error());
|
|
$assetclass_id = mysql_insert_id();
|
|
|
|
header_location("assetclassview.php?assetclass_id=" . $assetclass_id);
|
|
}
|
|
?>
|
|
|
|
<form method="POST" action="assetclassadd.php">
|
|
<table border="0">
|
|
<tr>
|
|
<td colspan="2">
|
|
<b>Add new assetclass:</b><br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
Assetclass name:
|
|
</td>
|
|
<td>
|
|
<input type="text" name="assetclass_name">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
Assetclass Group:<br>
|
|
</td>
|
|
<td>
|
|
<select name="assetclassgroup_id">
|
|
|
|
<?php
|
|
$result = mysql_query("SELECT assetclassgroup_id, assetclassgroup_name FROM assetclassgroup ORDER BY assetclassgroup_id");
|
|
while ($row = mysql_fetch_object($result)) {
|
|
echo '<option value="' . $row->assetclassgroup_id . '">' . $row->assetclassgroup_name. '</option>';
|
|
}
|
|
?>
|
|
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" align="right">
|
|
<input type="submit" value="Submit"><input type="reset" value="Reset">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
|
|
<?php
|
|
// end display only if admin
|
|
}
|
|
|
|
include("footer.php");
|
|
?>
|