</tr>
		
		<tr>
		
			<td colspan=2 class=\"centeredcellbold\">Checkout From</td>
			<td colspan=2 class=\"centeredcell\">".$users."</td>
			
		</tr>
		
		<tr>
		
			<td class=\"centeredcellbold\">Max Length (days)</td>
			<td class=\"centeredcell\"><input type=\"text\" size=4 name=\"max\"></td>
			<td class=\"centeredcell\"><b>Minimum User Level</b></td>
			<td class=\"centeredcell\">".getUserLevelDropDown("minuserlevel")."</td>
			
		</tr>
		
		<tr>
		
			<td colspan=2 class=\"centeredcellbold\">Image (250x250px)</td>
			<td colspan=2 class=\"centeredcell\"><input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"15000000\">
<input type=\"file\" name=\"image\"></td>
		
		</tr>
		
		<tr>
		
			<td colspan=4 class=\"header\">Equipment Description</td>
		
Exemplo n.º 2
0
}
$name = "";
if ($pageid == "finishaddequip") {
    $name = $_POST['name'];
    $type = $_POST['type'];
    $serial = $_POST['serial'];
    $description = $_POST['description'];
    $max = $_POST['max'];
    $minuserlevel = $_POST['minuserlevel'];
    $checkoutfrom = $_POST['checkoutfrom'];
}
$message = "";
if ($name != "" && $serial != "" && $description != "" && $max != "" && $minuserlevel != "") {
    $target_path = "./pics/";
    $new_name = $serial . "_" . basename($_FILES['image']['name']);
    $target_path = $target_path . $new_name;
    if (move_uploaded_file($_FILES['image']['tmp_name'], $target_path)) {
        $message = "<font color=\"#005500\"><b>Successfully added new equipment!</b><br><br></font>";
        require 'adminfunctions.php';
        addEquipment($name, $type, $serial, $description, $max, $new_name, $minuserlevel, $checkoutfrom);
    } else {
        $message = "There was an error creating the equipment. (" + handleFileError($_FILES['image']['error']) + ")";
    }
}
$users = "<select name=\"checkoutfrom\"><option value=\"-1\">None</option>";
$userresult = getAllUsersOrderByName();
while ($row = mysql_fetch_assoc($userresult)) {
    $users = $users . "<option value=\"" . $row['user_id'] . "\">" . $row['name'] . "</option>";
}
echo "\r\n\t<center><h3>Add New Equipment</h3>" . $message . "</center>\r\n\r\n\t<form enctype=\"multipart/form-data\" action=\"./index.php?pageid=finishaddequip\" method=\"post\">\r\n\t<table class=\"newequip\">\r\n\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=4 class=\"header\">Equipment Information</td>\r\n\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=2 class=\"centeredcellbold\">Name</td>\r\n\t\t\t<td colspan=2 class=\"centeredcell\"><input type=\"text\" size=30 name=\"name\"></td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=2 class=\"centeredcellbold\">Type</td>\r\n\t\t\t<td colspan=2 class=\"centeredcell\">" . getEquipmentTypesDropDown("type", 1) . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=2 class=\"centeredcellbold\">Primary Serial Number</td>\r\n\t\t\t<td colspan=2 class=\"centeredcell\"><input type=\"text\" size=30 name=\"serial\"></td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=2 class=\"centeredcellbold\">Checkout From</td>\r\n\t\t\t<td colspan=2 class=\"centeredcell\">" . $users . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td class=\"centeredcellbold\">Max Length (days)</td>\r\n\t\t\t<td class=\"centeredcell\"><input type=\"text\" size=4 name=\"max\"></td>\r\n\t\t\t<td class=\"centeredcell\"><b>Minimum User Level</b></td>\r\n\t\t\t<td class=\"centeredcell\">" . getUserLevelDropDown("minuserlevel") . "</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=2 class=\"centeredcellbold\">Image (250x250px)</td>\r\n\t\t\t<td colspan=2 class=\"centeredcell\"><input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"15000000\">\r\n<input type=\"file\" name=\"image\"></td>\r\n\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=4 class=\"header\">Equipment Description</td>\r\n\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=4 class=\"centeredcell\"><textarea cols=50 rows=10 name=\"description\"></textarea></td>\r\n\t\t\r\n\t\t</tr>\r\n\t\t\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=4 class=\"centeredcellbold\"><input type=\"submit\" value=\"Add\"></td>\r\n\t\t\r\n\t\t</tr>\r\n\t\r\n\t</table>\r\n\t\r\n\t</form>";
Exemplo n.º 3
0
<?php

$message = "";
if ($pageid == "finishnewuser") {
    $stu_id = $_POST['stu_id'];
    $name = $_POST['name'];
    $email = $_POST['email'];
    $user_level = $_POST['user_level'];
    if (mysql_num_rows(getUserByID($stu_id)) > 0) {
        $message = "User with username " + $stu_id + " already exists.";
    } else {
        $password = newUserNoPassword($stu_id, $name, $email, $user_level);
        if (getConfigVar("use_ldap")) {
            $message = "New User Created. Username: "******"New User Created. Username: "******" , Password: "******"<br><br>";
        }
    }
}
$page = "";
$page = $page = "<center><h3>Create New User</h3>" . $message . "</center>\r\n\t<form action=\"./index.php?pageid=finishnewuser\" method=\"POST\"><table class=\"newuser\">\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td colspan=4 class=\"header\">User Information</td>\r\n\t\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td class=\"centeredcellbold\">Username</td>\r\n\t\t\t<td class=\"centeredcell\"><input type=\"text\" name=\"stu_id\"></td>\r\n\t\t\t<td class=\"centeredcellbold\">Name</td>\r\n\t\t\t<td class=\"centeredcell\"><input type=\"text\" name=\"name\"></td>\r\n\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td class=\"centeredcellbold\">Email</td>\r\n\t\t\t<td colspan=3 class=\"centeredcell\"><input type=\"text\" size=\"45\" name=\"email\"></td>\r\n\t\t\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\r\n\t\t\t<td class=\"centeredcellbold\">User Level</td>\r\n\t\t\t<td class=\"centeredcell\">" . getUserLevelDropDown("user_level") . "</td>\r\n\t\t\t<td colspan=2 class=\"centeredcell\"><input type=\"submit\" value=\"Create!\"></td>\r\n\t\t\r\n\t\t</tr>\r\n\t</form></table>";
echo $page;