Viewing file: client_form.php (3.97 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? include ("../include/settings");
if ($ID){ include ("../include/db_connect");
$query = "SELECT * from client WHERE ID = '$ID'";
$data = mysql_query($query, $db); $mclient = mysql_result($data, 0, 'client'); $title = mysql_result($data, 0, 'title'); $text = mysql_result($data, 0, 'text'); $picture1 = mysql_result($data, 0, 'picture1'); $picture2 = mysql_result($data, 0, 'picture2'); $picture3 = mysql_result($data, 0, 'picture3'); $picture4 = mysql_result($data, 0, 'picture4'); $picture5 = mysql_result($data, 0, 'picture5'); $picture6 = mysql_result($data, 0, 'picture6'); $modify = true; $do = "modify"; } else if ($mclient){ $do = "add_set"; $add_set = true; } else $new = true; $do = "new"; ?>
<!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 Client Page" : $client['name']." | Modify Client Page");?></title> <script language="JavaScript" type="text/javascript"> <!--hide from older browsers function checkIt(){ var clientname = document.client_form.mclient.value; var mtitle = document.client_form.title.value; if (clientname && mtitle)return; else{ alert("Please enter a client name and title before submitting. Thank you.") return false; } } //stop hiding--> </script> </head>
<form action="upload_client.php" method="post" enctype="multipart/form-data" name="client_form" onsubmit="return checkIt()"> <?print("<input type=\"hidden\" name=\"do_this\" value=\"$do\">");?> <center> <span class="title"><?print($client['name']);?>: <?print($new ? "New Client Page" : "");?> <?print($modify ? "Modify Client Page" : "");?> <?print($add_set ? "Add New Picture Set To Client Page: $mclient" : "");?> <span><br><br> </center> <?print($modify ? "<input type=\"hidden\" name=\"ID\" value=\"$ID\">" : "");?> <table border="2" bordercolor="#222244" cellpadding="0" cellspacing="0" align="center"><tr><td> <table align="center" border="0"cellpadding="0" cellspacing="0"> <tr> <td></td> <td align="right" valign="top"><br><b>Client: </b></td> <td valign="bottom"><?print($new ? "<input type=\"text\" name=\"mclient\">" : "<b>$mclient</b>\n<input type=\"hidden\" name=\"mclient\" value=\"$mclient\">");?> </td> </tr> <tr> <td></td> <td align="right" valign="top"><br><b>Title: </b></td> <td valign="bottom"><input type="text" name="title" size="40"<?print($modify ? " value=\"$title\">" : ">");?></td> </tr> <tr> <td colspan="3"><br><hr width="90%" size="1" noshade></td> </tr> <tr> <td></td> <td align="right">Text: </td> <td><textarea name="text" cols="50" rows="8"><?print($modify ? "$text" : "");?></textarea></td> </tr> <? for ($count = 1; $count <= 6; $count++){ print("\t\t<tr>\n"); if ($modify){ eval ("\$exists = \$picture$count;"); if ($exists) { $string = 'print("<td><img src=\"../client_pics/picture$count"."_$ID.jpg\" width=\"100\" border=\"0\"><br>picture # $count</td>\n");'; eval ($string); } else print ("<td></td>\n"); } 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=client_pic\">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"); } // end of for... ?> <tr> <td colspan="3"><br><hr width="90%" size="1" noshade><br></td> </tr> <tr> <td></td> <td colspan="2" align="center"><input type="submit" value="OK."> <input type="Reset"><br> </td> </tr> </table> </td></tr></table> </form> <br> <?print("<center><a href=\"upload_client.php?delete=yes&ID=$ID\">DELETE THIS SET OF PICTURES</a></center>");?> <br><br> </body> </html>
|