Advertisement
Guest User

submit_theme

a guest
Mar 5th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.60 KB | None | 0 0
  1. <?php
  2. /*---------------------------------------------------+
  3. | PHP-Fusion 7 Content Management System
  4. +----------------------------------------------------+
  5. | Copyright ?2002 - 2008 Nick Jones
  6. | http://www.php-fusion.co.uk/
  7. +----------------------------------------------------+
  8. | Released under the terms & conditions of v2 of the
  9. | GNU General Public License. For details refer to
  10. | the included gpl.txt file or visit http://gnu.org
  11. +----------------------------------------------------+
  12. | For PHP-Fusion 7.02.xx
  13. +----------------------------------------------------*/
  14.  
  15. require_once "maincore.php";
  16. require_once THEMES."templates/header.php";
  17.  
  18.         add_to_title(" - Skelbimo pateikimas");
  19.     if (!iGUEST) {
  20.   if(isset($_POST['siusti'])){
  21.    $error = "";
  22.    $title = stripslash($_POST['title']);
  23.    $descr = stripslash($_POST['descr']);
  24.    $auth = stripslash($_POST['auth']);
  25.    $price = stripslash($_POST['price']);
  26.    $work = stripslash($_POST['work']);
  27.    $skype = stripslash($_POST['skype']);
  28.    $email = stripslash($_POST['email']);
  29.    $file = stripslash($_POST['file']);
  30.    $cat = isnum($_POST['cat']) ? $_POST['cat'] : "0";
  31.    $keliam = dbquery("INSERT INTO ".$db_prefix."themes(title,descr,auth,price,work,skype,email,cat,file) VALUES ('".$title."', '".$descr."','".$auth."','".$price."','".$work."','".$skype."','".$email."','".$cat."','".$file."')");
  32.     if ($title == "") {
  33.   $error .= " <span class='alt'>Būtina užpildyti visus duotus laukelius!</span><br />\n";
  34.         }
  35.     if ($auth == "") {
  36.   $error .= " <span class='alt'>Būtina užpildyti visus duotus laukelius!</span><br />\n";
  37.         }
  38.     if ($price == "") {
  39.   $error .= " <span class='alt'>Būtina užpildyti visus duotus laukelius!</span><br />\n";
  40.         }  
  41.     if ($file == "") {
  42.   $error .= " <span class='alt'>Būtina užpildyti visus duotus laukelius!</span><br />\n";
  43.         }  
  44.         if ($error) {
  45.            opentable("Skelbimo pateikimas");
  46.         echo "<div style='text-align:center'>\n".$error."</div>\n";
  47.                 closetable();
  48.         } else {
  49.    opentable("Skelbimo pateikimas");
  50.    echo "<div style='text-align:center'><br />\nAčiū, kad pateikėte skelbimą<br /><br />\n";
  51.    echo "<a href='submit_theme.php'>Pateikti kitą skelbimą</a><br /><br />\n";
  52.    echo "<a href='index.php'>Grįžti į ".$settings['sitename']."</a><br /><br />\n</div>\n";
  53.    closetable();
  54.         }
  55. } else {
  56. $opts = "";
  57. $result = dbquery("SELECT themes_cat_id, themes_cat_name FROM ".$db_prefix."themes_cats WHERE ".groupaccess("themes_cat_access")." ORDER BY themes_cat_name");
  58.       if (dbrows($result) != 0) {
  59.          while ($data = dbarray($result)) {                    
  60.                  $opts .= "<option value='".$data['themes_cat_id']."'>".$data['themes_cat_name']."</option>\n";
  61.                  }
  62.          echo "<form method='post' action='upload_file.php' enctype='multipart/form-data'>\n";
  63.          echo "<table cellpadding='0' cellspacing='0' class='center' style='width:500px;'>\n<tr>\n";
  64.          echo "<td class='tbl'>Pavadinimas<span style='color:#ff0000'>*</span></td>\n";
  65.          echo "<td class='tbl'><input type='text' name='title' maxlength='100' class='textbox' style='width:300px;' /></td>\n";
  66.          echo "</tr>\n<tr>\n";
  67.          echo "<td class='tbl1' style='width:80px; vertical-align:top;'>Aprašymas</td>\n";
  68.          echo "<td class='tbl1'><textarea name='descr' cols='60' rows='5' class='textbox' style='width:380px;'></textarea></td>\n";
  69.          echo "</tr>\n<tr>\n";
  70.          echo "<tr>\n<td class='tbl1'>Kategorija<span style='color:#ff0000'>*</span></td>\n";
  71.          echo "<td class='tbl1'><select name='cat' class='textbox'>\n".$opts."</select></td>\n";
  72.          echo "</tr>\n<tr>\n";
  73.          echo "<td class='tbl1' style='width:80px;'>Autorius<span style='color:#ff0000'>*</span></td>\n";
  74.          echo "<td class='tbl1'><input type='text' name='auth' class='textbox' style='width:380px;' /></td>\n";
  75.          echo "</tr>\n<tr>\n";
  76.          echo "<td class='tbl1' style='width:80px;'>Kaina<span style='color:#ff0000'>*</span></td>\n";
  77.          echo "<td class='tbl1'><input type='text' name='price' class='textbox' style='width:380px;' /></td>\n";
  78.          echo "</tr>\n<tr>\n";
  79.          echo "<td class='tbl1' style='width:80px;'>Darbo rūšis<span style='color:#ff0000'>*</span></td>\n";
  80.          echo "<td class='tbl1'><input type='radio' name='work' class='' value='PSD' style='width:20px;' />.PSD";
  81.          echo "<input type='radio' name='work' class='' value='CODE' style='width:20px;' />KODAS</td>\n";
  82.          echo "</tr>\n<tr>\n";
  83.          echo "<td class='tbl1' style='width:80px;'>Kontaktai<span style='color:#ff0000'>*</span></td>\n";
  84.          echo "<td class='tbl1'>Skype <input type='text' name='skype' class='textbox' style='width:140px;' /><span style='padding-left: 20px;'></span>";
  85.          echo "El'paštas <input type='text' name='email' class='textbox' style='width:140px;' /></td>\n";
  86.          echo "</tr>\n<tr>\n";
  87.          echo "<form action='upload_file.php' enctype='multipart/form-data'>\n";
  88.      echo "<td class='tbl1' style='width:80px;'>Nuotrauka<span style='color:#ff0000'>*</span></td>\n";
  89.          echo "<td class='tbl1'><input type='file' name='file' id='file' style='width:380px;' /></td>\n";
  90.          echo "</tr>\n<tr>\n";
  91.          echo "</form>";
  92.          echo "<td align='center' colspan='2' class='tbl'><br />\n";
  93.          echo "<input type='submit' name='siusti' value='Pateikti' class='button' />\n</td>\n";
  94.          echo "</tr>\n</table>\n</form>\n";
  95.          } else {
  96.                  echo "MYSQL Error";
  97.                  }
  98. }
  99. }
  100.  
  101. require_once THEMES."templates/footer.php";
  102. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement