Guest User

Untitled

a guest
Jun 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.05 KB | None | 0 0
  1. <?php include("includes/config.php"); ?>
  2. <?php include("includes/header.php"); ?>
  3. <table width="750" border="0" cellspacing="0" cellpadding="0">
  4. <tr>
  5. <td valign="top" bgcolor="#DDDDDD">&nbsp;</td>
  6. <td>&nbsp;</td>
  7. <td valign="top" class="txttitle">Property</td>
  8. </tr>
  9. <tr>
  10. <td height="10" valign="top" bgcolor="#DDDDDD"><img src="img/sp_trans.gif" width="1" height="1"></td>
  11. <td><img src="img/sp_trans.gif" width="1" height="1"></td>
  12. <td valign="top"><img src="img/sp_trans.gif" width="1" height="1"></td>
  13. </tr>
  14. <tr>
  15. <td width="150" valign="top" bgcolor="#DDDDDD"><?php include("includes/nav.php"); ?></td>
  16. <td width="10">&nbsp;</td>
  17. <td width="590" valign="top"> <p class="txtCat"> </p>
  18. <table width="590" border="0" cellspacing="0" cellpadding="0" bgcolor="#F7EBC3">
  19. <tr>
  20. <td width="5" height="25"><img src="img/sp_trans.gif" width="1" height="1"></td>
  21. <td width="585" class="txtn"><strong>Add a property</strong> -&nbsp;
  22. part 2 of 2</td>
  23. </tr>
  24. <tr>
  25. <td width="5"><img src="img/sp_trans.gif" width="1" height="1"></td>
  26. <td width="585">
  27.  
  28.  
  29. <?php if (!empty($_POST['submit'])) {
  30. $query = "INSERT INTO `cars` (`catid`)
  31. VALUES('".$_POST['frmPicCat']."')";
  32.  
  33.  
  34. mysql_query($query);
  35.  
  36.  
  37. header("Location: products.php");
  38.  
  39. }
  40.  
  41. ?>
  42.  
  43.  
  44. <br />
  45.  
  46.  
  47. <?php $query = ("SELECT * FROM cars WHERE id = {$_GET['id']} ");
  48. $result = mysql_query($query);
  49. while($field = mysql_fetch_array($result)) { ?>
  50.  
  51. <form action="" method="post" name="frmProd" id="frmProd">
  52. <SCRIPT LANGUAGE=javascript>
  53. <!--
  54. function hilite(field) {
  55. if (document.all) {
  56. document.frmProd.elements[field].style.backgroundColor="#eeeeee";
  57. }
  58. }
  59.  
  60. function testProd() {
  61.  
  62. if (document.frmProd.elements['frmName'].value == "") {
  63. alert ("\nPlease enter a car title.\t\n")
  64. hilite ('frmName');
  65. document.frmProd.elements['frmName'].focus();
  66. return false;
  67. }
  68.  
  69.  
  70. if (document.frmProd.elements['frmDesc'].value == "") {
  71. alert ("\nPlease enter a short car descriptiom.\t\n")
  72. hilite ('frmDesc');
  73. document.frmProd.elements['frmDesc'].focus();
  74. return false;
  75. }
  76.  
  77. if (document.frmProd.elements['frmDesc2'].value == "") {
  78. alert ("\nPlease enter a long car descriptiom.\t\n")
  79. hilite ('frmDesc2');
  80. document.frmProd.elements['frmDesc2'].focus();
  81. return false;
  82. }
  83.  
  84. if (document.frmProd.elements['frmPrice'].value == "") {
  85. alert ("\nPlease enter a car price.\t\n")
  86. hilite ('frmPrice');
  87. document.frmProd.elements['frmPrice'].focus();
  88. return false;
  89. }
  90.  
  91. if (document.frmProd.elements['frmPicCat'].value == -1) {
  92. alert ("\nPlease select a picture category.\t\n")
  93. hilite ('frmPicCat');
  94. document.frmProd.elements['frmPicCat'].focus();
  95. return false;
  96. }
  97.  
  98. }
  99.  
  100.  
  101. //-->
  102. </SCRIPT>
  103.  
  104.  
  105.  
  106.  
  107. <table width="583" border="0" cellspacing="0" cellpadding="0">
  108. <tr>
  109. <td width="145" height="5" valign="top" class="txtn">Title</td>
  110. <td height="5">&nbsp;</td>
  111. <td height="5">
  112. <?php echo $field['title']; ?>
  113. </td>
  114. </tr>
  115. <tr>
  116. <td width="145" height="5" valign="top"><img src="img/sp_trans.gif"></td>
  117. <td width="10" height="5"><img src="img/sp_trans.gif" width="1" height="1"></td>
  118. <td height="5"><img src="img/sp_trans.gif"></td>
  119. </tr>
  120. <tr>
  121. <td width="145" valign="top" class="txtn">Property Description
  122. 1 </td>
  123. <td>&nbsp;</td>
  124. <td> <?php echo $field['desc1']; ?>
  125. </td>
  126. </tr>
  127. <tr>
  128. <td height="5" valign="top"><img src="img/sp_trans.gif"></td>
  129. <td height="5"><img src="img/sp_trans.gif" width="1" height="1"></td>
  130. <td height="5"><img src="img/sp_trans.gif"></td>
  131. </tr>
  132. <tr>
  133. <td valign="top" class="txtn">Property Description 2</td>
  134. <td>&nbsp;</td>
  135. <td><?php echo $field['desc2']; ?>
  136. </td>
  137. </tr>
  138. <tr>
  139. <td height="10" valign="top"><img src="img/sp_trans.gif"></td>
  140. <td height="10"><img src="img/sp_trans.gif"></td>
  141. <td height="10"><img src="img/sp_trans.gif"></td>
  142. </tr>
  143. <!--
  144. <tr>
  145. <td width="145" height="10" valign="top" class="txtn">Price</td>
  146. <td height="10">&nbsp;</td>
  147. <td height="10" class='txt11'><span class="txtn">&pound;</span>
  148. <input name="frmPrice" type="text" class="boxad" id="frmPrice" size="10" maxlength="10">
  149. </td>
  150. </tr>
  151. -->
  152. <tr>
  153. <td width="145" height="10" valign="top" class="txtn">&nbsp;</td>
  154. <td height="10">&nbsp;</td>
  155. <td height="10" class='txt11'>&nbsp;</td>
  156. </tr>
  157. <tr>
  158. <td width="145" height="10" valign="top" class="txtn">Picture</td>
  159. <td height="10">&nbsp;</td>
  160. <td height="10" class='txt11'><span class="txt11">
  161.  
  162. <select name="frmPicCat" class="boxad" id="frmPicCat">
  163. <option selected>Select </option>
  164.  
  165. <?php $query = ("SELECT * FROM pic_category WHERE catid='".$_POST['frmPicCat']."'");
  166. $result = mysql_query($query);
  167. while($field = mysql_fetch_array($result)) { ?> <option value="<? echo $field['id']; ?>"><? echo $field['name']; ?></option>
  168.  
  169.  
  170. <?php } ?>
  171. </select>
  172.  
  173. </span> </td>
  174. </tr>
  175. <tr>
  176. <td width="145" height="10" valign="top">&nbsp;</td>
  177. <td height="10">&nbsp;</td>
  178. <td height="10">&nbsp;</td>
  179. </tr>
  180. <tr>
  181. <td width="145" valign="top"><a href="products.php" target="_self" class="navnorm"><
  182. back</a></td>
  183. <td>&nbsp;</td>
  184. <td><span class="txtSm">
  185.  
  186. <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 >" />
  187. </span></td>
  188. </tr>
  189. </table>
  190. </form>
  191.  
  192. <?php } ?>
  193.  
  194.  
  195. </td>
  196. </tr>
  197. </table>
  198. </td>
  199. </tr>
  200. </table>
  201. <?php include("includes/footer.php"); ?>
Add Comment
Please, Sign In to add comment