<?php
include_once('inc.function.php');
include_once('confdb.php');
include_once('header.php');
include_once('db.functions.php');
?>

   <!-- Begin page content -->
    <div class="container">
      <div class="page-header">
        <h1><img src='img/logo.jpg'/>&nbsp ONLINE BOOKING</h1>
      </div>
      <!-- CONTENT STARTS HERE -->
      <div class="stepwizard">
          <div class="stepwizard-row setup-panel">
              <div class="stepwizard-step">
                  <a href="index.php" type="button" class="btn btn-success btn-circle">1</a>
                  <p>Venue Search</p>
              </div>
              <div class="stepwizard-step">
                  <a href="booking.php" type="button" class="btn btn-success btn-circle">2</a>
                  <p>Venue Booking</p>
              </div>
              <div class="stepwizard-step">
                  <a href="#step-3" type="button" class="btn btn-warning btn-circle">3</a>
                  <p>Event Detail</p>
              </div>
              <div class="stepwizard-step">
                  <a href="#step-4" type="button" class="btn btn-danger btn-circle" disabled="disabled">4</a>
                  <p>Contact Info</p>
              </div>
              <div class="stepwizard-step">
                  <a href="#step-5" type="button" class="btn btn-danger btn-circle" disabled="disabled">5</a>
                  <p>Mailing Address</p>
              </div>
              <div class="stepwizard-step">
                  <a href="#step-6" type="button" class="btn btn-danger btn-circle" disabled="disabled">6</a>
                  <p>Booking Submission</p>
              </div>
          </div>
      </div>

      <div class="progress">
        <div class="progress-bar progress-bar-striped progress-bar-success active" role="progressbar"
        aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width:45%">
          60%
        </div>
      </div>

      <?php if(!empty($_SESSION['MESSAGE'])) { echo $_SESSION['MESSAGE'].'<br>';  unset($_SESSION['MESSAGE']); } ?>

        <div class="row setup-content" id="step-3">
            <div class="col-xs-12">
                <div class="col-md-12">
                    <h3> Step 3: Event Information</h3>
                    <p>

                    <form role="form" method="POST" action="booking_event_process.php"> 
                        <div class="form-group">
                          <label for="EVENT_NAME">Event Name:</label>
                          <input type="text" class="form-control" name="EVENT_NAME" id="EVENT_NAME" value="<?php echo $_SESSION['EVENT_NAME']; ?>" required>
                          <p class="text-danger"><small>* required.</small></p>
                        </div>
                        <div class="form-group">
                          <label for="EVENT_TYPE">Event Type:</label>
                          <select name="EVENT_TYPE" id="EVENT_TYPE" class="form-control">
                            <option value="0">Please Select</option>
                        <?php
                          //$result_events = mysqli_query($con,"SELECT * FROM config_events ORDER BY EVENT_TYPE");                      
                          //while($row_events = mysqli_fetch_array($result_events)) 
                          $result_events = DB::query("SELECT * FROM config_events ORDER BY EVENT_TYPE");
                          foreach ($result_events as $row_events)
                          { 
                        ?>
                          <option value="<?php echo $row_events['EVENT_ID']; ?>" <?php if ($_SESSION['EVENT_TYPE'] == $row_events['EVENT_ID']) { echo 'selected="selected"'; } ?>>
                            <?php echo $row_events['EVENT_TYPE']; ?>
                          </option>
                        <?php } ?>
                          </select>
                          <p class="text-danger"><small>* required.</small></p>
                        </div>
                        <div class="form-group">
                          <label for="EVENT_INDUSTRY">Event Industry:</label>
                          <select name="EVENT_INDUSTRY" id="EVENT_INDUSTRY" class="form-control">
                            <option value="0">Please Select</option>
                        <?php
                          //$result_industries = mysqli_query($con,"SELECT * FROM config_industries ORDER BY INDUSTRY_NAME");                      
                          //while($row_industries = mysqli_fetch_array($result_industries)) 
                          $result_industries = DB::query("SELECT * FROM config_industries ORDER BY INDUSTRY_NAME");
                          foreach ($result_industries as $row_industries)
                          { 
                        ?>
                          <option value="<?php echo $row_industries['INDUSTRY_CODE']; ?>" <?php if ($_SESSION['EVENT_INDUSTRY'] == $row_industries['INDUSTRY_CODE']) { echo 'selected="selected"'; } ?>>
                            <?php echo $row_industries['INDUSTRY_NAME']; ?>
                          </option>
                        <?php } ?>
                          </select>
                          <p class="text-danger"><small>* required.</small></p>
                        </div>
                        <!--<div class="form-group">
                          <label for="EVENT_REMARKS">Event Remark:</label>
                          <input type="text" class="form-control" name="EVENT_REMARKS" id="EVENT_REMARKS" value="<?php echo $_SESSION['EVENT_REMARKS']; ?>" required>
                          <p class="text-danger"><small>* not required.</small></p>
                        </div>-->
                        <div class="form-group">
                          <label for="EVENT_REMARKS">Event Arrangement:</label>
                          <textarea class="form-control" rows="5" name="EVENT_REMARKS" id="EVENT_REMARKS" placeholder="Example: Theme, Fully Served, Dome"><?php echo $_SESSION['EVENT_REMARKS']; ?></textarea>
                          <p class="text-danger"><small>* not required.</small></p>
                        </div>
                        <button type="submit" class="btn btn-primary btn-lg pull-right">Next</button>
                    </form>
                   
 
                </div>
            </div>
        </div>

      <!-- CONTENT ENDS HERE -->
    </div>

<?php include_once('footer.php'); ?>