Viewing file: feature_form.php (7.44 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? //BUILD INPUT FORM based on parameters set in GLOBAL
include ("../include/settings"); if ($ID){ include ("../include/db_connect"); include ("../include/get_feature"); $modify = true; }else{ $new = true; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <title><?print($new ? $client['name']." | New Feature Article" : $client['name']." | Modify Feature Article");?></title> <script language="JavaScript" type="text/javascript"> <!--hide from older browsers function checkIt(){ var title = document.uploader_form.title.value; if (title) return; else alert("Please give this property a Title before submitting. Thank you.") return false; } //stop hiding--> </script> </head> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <br><br><br> <form action="upload_feature.php" method="post" enctype="multipart/form-data" name="uploader_form" id="uploader_form"> <?print($new ? "<input type=\"hidden\" name=\"new\" value=\"yes\">" : "");?> <?print($modify ? "<input type=\"hidden\" name=\"ID\" value=\"$ID\">" : "");?> <center> <span class="title"><?print($client['name']);?>: <?print($new ? "New Feature" : "Modify Feature");?><span><br><br> </center> <table border="2" bordercolor="#222244" cellpadding="0" cellspacing="0" align="center"><tr><td> <table align="center" border="0" cellpadding="10"> <tr> <td colspan="2" align="center"><br><b>Title: </b> <input type="text" name="title" size="40"<?print($modify ? " value=\"$title\"" : "");?>></td> </tr> <tr> <td colspan="2" align="center"><input type="radio" name="active" value="yes"<?print((($modify && ($active == "yes")) || $new) ? " checked" : "");?>>Show This Feature <input type="radio" name="active" value="no"<?print(($active == "no") ? " checked" : "");?>>Hide This Feature<br><hr width="50%" size="1" noshade></td> </tr> <? // START DATE if ($feature['start'] == 1){ if ($start_date){ // break apart timestamp $start_year = substr($start_date, 0, 4); $start_month = substr($start_date, 4,2); $start_day = substr($start_date, 6, 2); } else{ $start_year = date(Y); $start_month = date(m); ($start_month < 10) ? $start_month = "0"."$start_month" : $start_month = $start_month; $start_day = date(d); } print(" <tr>\n"); print(" <td colspan=\"3\" align=\"center\"><b>Start date</b>: \n"); print(" <select name=\"start_month\">\n"); $month_name = array("01"=> "January", "02"=> "February", "03"=> "March", "04"=> "April", "05"=> "May", "06"=> "June", "07"=> "July", "08"=> "August", "09"=> "September", "10"=> "October", "11"=> "November", "12"=> "December"); while ($nextMonth = each($month_name)){ print("\t\t\t<option value=\"$nextMonth[0]\""); print(($start_month == $nextMonth[0]) ? " selected" : ""); print(">$nextMonth[1]</option>\n"); } print("\t</select>\n"); print("\t <select name=\"start_day\">\n"); for ($count = 1; $count <= 31; $count++){ if ($count < 10) $count_2digits = "0"."$count"; else $count_2digits = $count; print("\t\t\t<option value=\"$count_2digits\""); print(($start_day == "$count") ? " selected>$count</option>\n" : ">$count</option>\n"); } print("\t</select>\n"); print(" <select name=\"start_year\">"); for ($i = 2000; $i <= 2006; $i++){ print("\t\t<option"); print(($i == $start_year) ? " selected" : ""); print(">$i</option>\n"); } print("</td><br></tr>\n"); } //END DATE if ($feature['end'] == 1){ if ($end_date){ // break apart timestamp $end_year = substr($end_date, 0, 4); $end_month = substr($end_date, 4,2); $end_day = substr($end_date, 6, 2); } else{ $end_year = date(Y); $end_month = date(m); ($end_month < 10) ? $end_month = "0"."$end_month" : $end_month = $end_month; $end_day = date(d); } print(" <tr>\n"); print(" <td colspan=\"3\" align=\"center\"><b>End date</b>: \n"); print(" <select name=\"end_month\">\n"); $month_name = array("01"=> "January", "02"=> "February", "03"=> "March", "04"=> "April", "05"=> "May", "06"=> "June", "07"=> "July", "08"=> "August", "09"=> "September", "10"=> "October", "11"=> "November", "12"=> "December"); while ($nextMonth = each($month_name)){ print("\t\t\t<option value=\"$nextMonth[0]\""); print(($end_month == $nextMonth[0]) ? " selected" : ""); print(">$nextMonth[1]</option>\n"); } print("\t</select>\n"); print("\t <select name=\"end_day\">\n"); for ($count = 1; $count <= 31; $count++){ if ($count < 10) $count_2digits = "0"."$count"; else $count_2digits = $count; print("\t\t\t<option value=\"$count_2digits\""); print(($end_day == "$count") ? " selected>$count</option>\n" : ">$count</option>\n"); } print("\t</select>\n"); print(" <select name=\"end_year\">"); for ($i = 2000; $i <= 2006; $i++){ print("\t\t<option"); print(($i == $end_year) ? " selected" : ""); print(">$i</option>\n"); } print("</td><br></tr>\n"); } // THUMBNAIL if ($feature['thumb'] == 1) { print(" <tr>\n"); print($thumb ? "<td><img src=\"../feature_pics/$thumb\" width=\"100\" border=\"0\">" : "<td>"); print(" </td>\n<td><br> Thumbnail Picture:<br>\n"); print(" <input type=\"file\" name=\"thumb\" size=\"60\"></td>\n"); print(" </tr>\n"); } // PICTURES if ($feature['pictures'] > 0) { for ($count = 1; $count <= $feature['pictures']; $count++) { { print("\t\t<tr>\n"); eval ("\$exists = \$picture$count;"); if ($exists) { $string = 'print("<td><img src=\"../feature_pics/picture$count"."_$ID.jpg\" width=\"100\" border=\"0\"><br>picture #$count</td>\n");'; eval ($string); } else print ("<td></td>\n"); } print("\t\t\t<td colspan=\"2\"><br> Picture #$count: <a href=\"remove.php?ID=$ID&picture=picture$count&table=feature\">Remove this picture</a><br>\n"); print("\t\t\t <input type=\"file\" name=\"picture$count\" size=\"60\"></td>\n"); print("\t\t</tr>\n"); } } // intro if ($feature['short'] == 1){ print("\t\t<tr>\n"); print("\t\t\t<td align=\"right\">Short intro: </td>\n"); print("\t\t\t<td><textarea name=\"short\" cols=\"50\" rows=\"8\">"); print($modify? "$intro" : ""); print("</textarea></td>\n"); print("\t\t\t\t</tr>\n"); } // content if ($feature['content'] == 1){ print("\t\t<tr>\n"); print("\t\t\t<td align=\"right\">Full article: </td>\n"); print("\t\t\t<td><textarea name=\"content\" cols=\"50\" rows=\"8\">"); print($modify ? "$content" : ""); print("</textarea></td>\n"); print("\t\t\t\t</tr>\n"); } ?>
<tr> <td colspan="2" align="center"><br><input type="submit" value="Submit"> <input type="Reset"><br><br> </td> </tr> </table> </td></tr></table> <br><br> <center> <a href="upload_feature.php?delete=yes&ID=<?print("$ID");?>">DELETE THIS FEATURE</a> </center> </form> <br><br>
</body> </html>
|