form.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. //
  3. // This page gets included from a couple of different forms.
  4. // It uses the following variables to lay things out correctly.
  5. // $form_app - an object containing the form properties (usually a result of mysql_fetch_object)
  6. // $form_url - what url to submit to.
  7. // $form_action - what the hidden field "action" should have its value set to.
  8. // $form_submit - what the submit button should say
  9. //
  10. print('The submission form has been turned off until we modify the form to prevent spammers.');
  11. /*
  12. ?>
  13. <script language='JavaScript'>
  14. <!--
  15. function checkForm(f) {
  16. if( f.submitter.value.length == 0 ) {
  17. alert("You must provide your name.");
  18. f.submitter.focus();
  19. f.submitter.select();
  20. return(false);
  21. }
  22. if( f.name.value.length == 0 ) {
  23. alert("You must provide an application name.");
  24. f.name.focus();
  25. f.name.select();
  26. return(false);
  27. }
  28. if( f.homepage_url.value.length == 0 ) {
  29. alert("You must provide a homepage url.");
  30. f.homepage_url.focus();
  31. f.homepage_url.select();
  32. return(false);
  33. }
  34. if( f.blurb.value.length == 0 ) {
  35. alert("You must provide a description.");
  36. f.blurb.focus();
  37. f.blurb.select();
  38. return(false);
  39. }
  40. return(true);
  41. }
  42. //-->
  43. </script>
  44. <form action='<?php print($form_url) ?>' method=post enctype='multipart/form-data' onsubmit='return checkForm(this)'>
  45. <input type=hidden name='action' value='<?php print($form_action) ?>'>
  46. <?php
  47. if( $form_action == "modify" ) {
  48. print("<input type=hidden name='app_id' value='$form_app->id'>");
  49. }
  50. ?>
  51. <table border=0 cellpadding=5 cellspacing=0 bgcolor='#e0e0e0'>
  52. <?php
  53. if( $MAGIC_COOKIE ) {
  54. print("<tr valign=top>");
  55. print("<td align=right nowrap>Status:</td>");
  56. print("<td>");
  57. $statusAry = array("A" => "Active", "P" => "Pending", "M" => "Modified");
  58. print("<select name='status'>");
  59. foreach( $statusAry as $k => $v ) {
  60. if( $form_app->status == $k ) {
  61. print("<option value='$k' selected>$v");
  62. }else {
  63. print("<option value='$k'>$v");
  64. }
  65. }
  66. print("</select>");
  67. print("</td>");
  68. print("</tr>");
  69. }
  70. ?>
  71. <tr valign=top>
  72. <td align=right nowrap><?php if( $MAGIC_COOKIE ) { print("Submitter"); }else { print("Your"); } ?> Email:</td>
  73. <td><input type=text name='submitter' value='<?php print($form_app->submitter) ?>' size=50></td>
  74. </tr>
  75. <tr valign=top>
  76. <td align=right nowrap>Application Name:</td>
  77. <td><input type=text name='name' value='<?php print($form_app->name) ?>' size=50></td>
  78. </tr>
  79. <tr valign=top>
  80. <td align=right nowrap>Homepage URL:</td>
  81. <td><input type=text name='homepage_url' value='<?php print($form_app->homepage_url) ?>' size=50></td>
  82. </tr>
  83. <tr valign=top>
  84. <td align=right nowrap>Category:</td>
  85. <td><select name='cat_id'><?php print makeAppSelectMenuOptions($form_app->cat_id); ?></select></td>
  86. </tr>
  87. <tr valign=top>
  88. <td align=right nowrap>Description:</td>
  89. <td><textarea name='blurb' rows=7 cols=40><?php print($form_app->blurb) ?></textarea></td>
  90. </tr>
  91. <?php if( $form_action == "modify" && $form_app->has_screenshot == "Y" ) { ?>
  92. <tr valign=top>
  93. <td align=right nowrap>Current<br>Screen Shot:</td>
  94. <td>
  95. <a href='screenshot.php/<?php print($form_app->id) ?>.jpg' target='apppop'><img src='screenshot.php/<?php print($form_app->id) ?>-thumb.jpg' alt='' border=0></a>
  96. <br>
  97. <input type=checkbox name='delete_screenshot' value='1'> Check to delete current screen shot.
  98. <input type=hidden name='had_screenshot' value='1'>
  99. </td>
  100. </tr>
  101. <tr valign=top>
  102. <td align=right nowrap>New Screen Shot:</td>
  103. <td><input type=file name='screenshot'><br><small>(JPEG or PNG only, please)</small></td>
  104. </tr>
  105. <?php }else { ?>
  106. <tr valign=top>
  107. <td align=right nowrap>Screen Shot:</td>
  108. <td><input type=file name='screenshot'><br><small>(JPEG or PNG only, please)</small></td>
  109. </tr>
  110. <?php } ?>
  111. <tr valign=top>
  112. <td align=right nowrap colspan=2>
  113. <input type=reset value='Reset'>
  114. <input type=submit value='<?php print($form_submit) ?>'>
  115. </td>
  116. </tr>
  117. </table>
  118. </form>
  119. <?
  120. /* */
  121. ?>