示例#1
0
$roles = ProductController::GetProductTypes();
for ($i = 0; $i < count($roles); $i++) {
    if ($roles[$i]['ID'] == $product["Type"]) {
        //select first option
        echo "<option  selected='selected' value='" . $roles[$i]["ID"] . "'>" . $roles[$i]["Type"] . "</option>";
    } else {
        echo "<option  value='" . $roles[$i]["ID"] . "'>" . $roles[$i]["Type"] . "</option>";
    }
}
?>
				</select>		
				<br />
				<label for="sub_type">Sub_Type : </label>	
				<select name="sub_type" id="sub_type">
					<?php 
$roles = ProductController::GetProductSubTypes();
for ($i = 0; $i < count($roles); $i++) {
    if ($roles[$i]['ID'] == $product["Sub_Type"]) {
        //select first option
        echo "<option  selected='selected' value='" . $roles[$i]["ID"] . "'>" . $roles[$i]["Name"] . "</option>";
    } else {
        echo "<option  value='" . $roles[$i]["ID"] . "'>" . $roles[$i]["Name"] . "</option>";
    }
}
?>
	
				</select>	
				<br/>
			
				<label for="promotion_id">Promotion_ID : </label>		
				<select name="promotion_id" id="promotion_id">