Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include("includes/config.php"); ?>
- <?php include("includes/header.php"); ?>
- <table width="750" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td valign="top" bgcolor="#DDDDDD"> </td>
- <td> </td>
- <td valign="top" class="txttitle">Property</td>
- </tr>
- <tr>
- <td height="10" valign="top" bgcolor="#DDDDDD"><img src="img/sp_trans.gif" width="1" height="1"></td>
- <td><img src="img/sp_trans.gif" width="1" height="1"></td>
- <td valign="top"><img src="img/sp_trans.gif" width="1" height="1"></td>
- </tr>
- <tr>
- <td width="150" valign="top" bgcolor="#DDDDDD"><?php include("includes/nav.php"); ?></td>
- <td width="10"> </td>
- <td width="590" valign="top"> <p class="txtCat"> </p>
- <table width="590" border="0" cellspacing="0" cellpadding="0" bgcolor="#F7EBC3">
- <tr>
- <td width="5" height="25"><img src="img/sp_trans.gif" width="1" height="1"></td>
- <td width="585" class="txtn"><strong>Add a property</strong> -
- part 2 of 2</td>
- </tr>
- <tr>
- <td width="5"><img src="img/sp_trans.gif" width="1" height="1"></td>
- <td width="585">
- <?php if (!empty($_POST['submit'])) {
- $query = "INSERT INTO `cars` (`catid`)
- VALUES('".$_POST['frmPicCat']."')";
- mysql_query($query);
- header("Location: products.php");
- }
- ?>
- <br />
- <?php $query = ("SELECT * FROM cars WHERE id = {$_GET['id']} ");
- $result = mysql_query($query);
- while($field = mysql_fetch_array($result)) { ?>
- <form action="" method="post" name="frmProd" id="frmProd">
- <SCRIPT LANGUAGE=javascript>
- <!--
- function hilite(field) {
- if (document.all) {
- document.frmProd.elements[field].style.backgroundColor="#eeeeee";
- }
- }
- function testProd() {
- if (document.frmProd.elements['frmName'].value == "") {
- alert ("\nPlease enter a car title.\t\n")
- hilite ('frmName');
- document.frmProd.elements['frmName'].focus();
- return false;
- }
- if (document.frmProd.elements['frmDesc'].value == "") {
- alert ("\nPlease enter a short car descriptiom.\t\n")
- hilite ('frmDesc');
- document.frmProd.elements['frmDesc'].focus();
- return false;
- }
- if (document.frmProd.elements['frmDesc2'].value == "") {
- alert ("\nPlease enter a long car descriptiom.\t\n")
- hilite ('frmDesc2');
- document.frmProd.elements['frmDesc2'].focus();
- return false;
- }
- if (document.frmProd.elements['frmPrice'].value == "") {
- alert ("\nPlease enter a car price.\t\n")
- hilite ('frmPrice');
- document.frmProd.elements['frmPrice'].focus();
- return false;
- }
- if (document.frmProd.elements['frmPicCat'].value == -1) {
- alert ("\nPlease select a picture category.\t\n")
- hilite ('frmPicCat');
- document.frmProd.elements['frmPicCat'].focus();
- return false;
- }
- }
- //-->
- </SCRIPT>
- <table width="583" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="145" height="5" valign="top" class="txtn">Title</td>
- <td height="5"> </td>
- <td height="5">
- <?php echo $field['title']; ?>
- </td>
- </tr>
- <tr>
- <td width="145" height="5" valign="top"><img src="img/sp_trans.gif"></td>
- <td width="10" height="5"><img src="img/sp_trans.gif" width="1" height="1"></td>
- <td height="5"><img src="img/sp_trans.gif"></td>
- </tr>
- <tr>
- <td width="145" valign="top" class="txtn">Property Description
- 1 </td>
- <td> </td>
- <td> <?php echo $field['desc1']; ?>
- </td>
- </tr>
- <tr>
- <td height="5" valign="top"><img src="img/sp_trans.gif"></td>
- <td height="5"><img src="img/sp_trans.gif" width="1" height="1"></td>
- <td height="5"><img src="img/sp_trans.gif"></td>
- </tr>
- <tr>
- <td valign="top" class="txtn">Property Description 2</td>
- <td> </td>
- <td><?php echo $field['desc2']; ?>
- </td>
- </tr>
- <tr>
- <td height="10" valign="top"><img src="img/sp_trans.gif"></td>
- <td height="10"><img src="img/sp_trans.gif"></td>
- <td height="10"><img src="img/sp_trans.gif"></td>
- </tr>
- <!--
- <tr>
- <td width="145" height="10" valign="top" class="txtn">Price</td>
- <td height="10"> </td>
- <td height="10" class='txt11'><span class="txtn">£</span>
- <input name="frmPrice" type="text" class="boxad" id="frmPrice" size="10" maxlength="10">
- </td>
- </tr>
- -->
- <tr>
- <td width="145" height="10" valign="top" class="txtn"> </td>
- <td height="10"> </td>
- <td height="10" class='txt11'> </td>
- </tr>
- <tr>
- <td width="145" height="10" valign="top" class="txtn">Picture</td>
- <td height="10"> </td>
- <td height="10" class='txt11'><span class="txt11">
- <select name="frmPicCat" class="boxad" id="frmPicCat">
- <option selected>Select </option>
- <?php $query = ("SELECT * FROM pic_category WHERE catid='".$_POST['frmPicCat']."'");
- $result = mysql_query($query);
- while($field = mysql_fetch_array($result)) { ?> <option value="<? echo $field['id']; ?>"><? echo $field['name']; ?></option>
- <?php } ?>
- </select>
- </span> </td>
- </tr>
- <tr>
- <td width="145" height="10" valign="top"> </td>
- <td height="10"> </td>
- <td height="10"> </td>
- </tr>
- <tr>
- <td width="145" valign="top"><a href="products.php" target="_self" class="navnorm"><
- back</a></td>
- <td> </td>
- <td><span class="txtSm">
- <input type="submit" name="submit" style='font:9pt Verdana, Arial, Helvetica, sans-serif; border:1 solid #333333; cursor:hand; background:#eeeeee; color: <%=butcol%>; ' onClick="return testProd()" value="Next >" />
- </span></td>
- </tr>
- </table>
- </form>
- <?php } ?>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <?php include("includes/footer.php"); ?>
Add Comment
Please, Sign In to add comment