HTTP_HOST: ".$_SERVER['HTTP_HOST']."
";
include_once 'struct.php';
if(registerPass("Age Settings")){
if(isSean()){
include 'connect.php';
processAgeForm();
$mode = "unset"; // do the unset items
if($mode == "unset"){
print "
Displaying all media with unset age values.
\n";
$mediaTypes = getMediaTypes();
foreach($mediaTypes as $mediaType){
$queryString = "SELECT * FROM $mediaType WHERE lowestAge=19";
if($result = mysql_query($queryString,$db)){
if(($numRows = mysql_num_rows($result)) && ($numRows > 0)){
print "($numRows items)
\n";
for($cnt=0; $cnt<$numRows; $cnt++){
$id = mysql_result($result, $cnt, "id");
$lowestAge = mysql_result($result, $cnt, "lowestAge");
snapshot($mediaType, $id);
ageForm($mediaType, $id, $lowestAge);
}
}
}
}
}
} else {
print "This page is only for Sean! Get... scram! Go to ".randomMotive()."!!!";
}
}
bottom();
////
// Creates a simple drop-down to set the lowest age that this item is appropriate for.
////
function ageForm($mediaType, $id, $lowestAge=""){
$PHP_SELF = $_SERVER['PHP_SELF'];
print "\n";
print "
\n";
} // end ageForm(...)
////
// Processes form posts that then set the lowest age that should be viewing the specified media.
////
function processAgeForm(){
if(isset($_POST['formName']) && ($_POST['formName']=="setAge")){
include 'connect.php';
$mediaType = $_POST['mediaType'];
$id = $_POST['id'];
$lowestAge = $_POST['lowestAge'];
$queryString = "UPDATE $mediaType SET lowestAge=$lowestAge WHERE id=$id";
if(false === mysql_query($queryString,$db)){
dispError(mysql_error()."
$queryString");
} else {
dispSuccess("Updated Successfully.");
}
}
} // end processAgeForm()
?>