Here is my code:
Code: Select all
<form method="post" action="manager.php?cmd=assign">
<table align="right" width="520" border="0" cellpadding="0" cellspacing="1">
<tr>
<td align="center" height="30" class="topBar"><b>ASSIGN</b></td>
<td align="center" height="30" class="topBar"><b>INSPT</b></td>
<td align="center" height="30" class="topBar"><b>CONTROL #</b></td>
<td align="center" height="30" class="topBar"><b>DATE ORD</b></td>
<td align="center" height="30" class="topBar"><b>CUST</b></td>
<td align="center" height="30" class="topBar"><b>INSURED</b></td>
<td align="center" height="30" class="topBar"><b>LOCATION</b></td>
<td align="center" height="30" class="topBar"><b>RT</b></td>
</tr>
<?php
$result = mysql_query("SELECT * FROM cases WHERE location_county='" . $_POST["location_county"] . "' AND assigned='false' ORDER BY control_number ASC");
$ids = array();
while($row = mysql_fetch_assoc($result)) {
array_push($ids, $row["id"]);
}
foreach($ids as $id) {
$result = mysql_query("SELECT * FROM cases WHERE location_county='" . $_POST["location_county"] . "' AND assigned='false' ORDER BY control_number ASC");
$row = mysql_fetch_array($result);
if($row1["rush"] == true) {
$class = "redBar";
} else {
$class = "greenBar";
}
?>
<tr>
<td align="center" height="30" class="<?php echo $class; ?>"><input type="checkbox" name="assign[<?php echo $id; ?>]" value="assigned" class="fields"></td>
<td align="center" class="<?php echo $class; ?>">
<select name="inspector[<?php echo $id; ?>]" class="fields">
<option value="">---</option>
<?php
$result1 = mysql_query("SELECT * FROM users WHERE account_type='Inspector' ORDER BY user_code ASC");
while($row1 = mysql_fetch_array($result1)) {
?>
<option value="<?php echo $row1["user_code"]; ?>"><?php echo $row1["user_code"]; ?></option>
<?php
}
?>
</select>
</td>
<td align="center" class="<?php echo $class; ?>"><?php echo $row["control_number"]; ?></td>
<td align="center" class="<?php echo $class; ?>"><?php echo $row["date_ordered"]; ?></td>
<td align="center" class="<?php echo $class; ?>"><?php echo $row["user_code"]; ?></td>
<td align="center" class="<?php echo $class; ?>"><?php echo substr($row["name_of_insured"], "0", "15"); ?></td>
<td align="center" class="<?php echo $class; ?>"><?php echo substr($row["location_city"], "0", "10"); ?></td>
<td align="center" class="<?php echo $class; ?>"><?php echo substr($row["survey_type"], "0", "2"); ?></td>
</tr>
<?php
}
?>
<tr>
<td align="right" height="35" colspan="8" class="topBar"><input type="submit" name="assign_cases" value="Assign Cases" class="buttons"> </td>
</tr>
</table>
</form>