<?php require_once 'includes/main.php'; logged_in('user_id'); ?>
<?php require_once 'elements/head.php'; ?>

<!-- SEO -->
<title><?php echo $set['submit_title']; ?> - <?php echo $set['website_name']; ?></title>

</head>

<body>

<?php include_once 'elements/header.php'; ?>

<?php include_once 'elements/sidebar/dashboard.php'; ?>

<!-- CONTENT -->
<section class="Content R">

   <h2 class="GLOB-Title">Submit Listing: <span class="FR">Form</span></h2>

   <!-- FORM -->
   <form class="Form" onsubmit="exForm(event, this, 'ex/create.listing.php')" method="POST" enctype="multipart/form-data">

      <!-- FILE: IMAGE -->
      <div class="field">
         <div class="icon"><img src="images/icons/file.png" width="100%" height="100%"></div>
         <label for="input-image" class="textfield" onclick="fileName(this);">Select JPG Image: <span class="FR">250px by 250px</span></label>
         <input type="file" name="image" class="H" id="input-image" accept="image/jpeg">
      </div>

      <!-- TEXTFIELD: TEXT -->
      <div class="field">
         <div class="icon"><img src="images/icons/text.png" width="100%" height="100%"></div>
         <input type="text" name="name" class="textfield" maxlength="30" placeholder="Listing Name" value="">
      </div>

      <!-- SELECT MENU -->
      <div class="field">
         <div class="select">
            <input type="hidden" name="category" id="input-category">
            <div class="selectfield" onclick="selectMenu(this);">Select Category</div>
            <div class="options">
               <?php fetch_elements("SELECT name FROM categories ORDER BY name ASC", 'elements/options/main.php'); ?>
            </div>
         </div>
      </div>

      <!-- TEXTFIELD: TEXT -->
      <div class="field">
         <div class="icon"><img src="images/icons/text.png" width="100%" height="100%"></div>
         <input type="text" name="description" class="textfield" maxlength="255" placeholder="Short Description" value="">
      </div>

      <!-- TEXTAREA -->
      <div class="field">
         <textarea type="text" name="about" class="textarea" placeholder="Long Description"></textarea>
      </div>

      <!-- TEXTFIELD: URL -->
      <div class="field">
         <div class="icon"><img src="images/icons/link.png" width="100%" height="100%"></div>
         <input type="url" name="url" class="textfield" placeholder="URL" value="">
      </div>

      <!-- TEXTFIELD: NUMBER -->
      <div class="field">
         <div class="icon"><img src="images/icons/points.png" width="100%" height="100%"></div>
         <input type="number" name="points" class="textfield" maxlength="10" placeholder="Points" value="">
      </div>

      <div class="ERRORS"></div>

      <!-- SUBMIT -->
      <div class="submit">
         <input type="submit" value="Submit Listing">
      </div>

   </form>
   <!-- FORM -->

</section>
<!-- CONTENT -->

<?php include_once 'elements/footer.php'; ?>

</body>
</html>
