<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Edit Event</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="<?php echo base_url(); ?>admin">Home</a></li>
<li class="breadcrumb-item"><a href="<?php echo base_url(); ?>admin/events">Events</a></li>
<li class="breadcrumb-item active">Edit Event</li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<!-- Default box -->
<div class="card">
<div class="card-header">
<h3 class="card-title">Updating Event: <?php echo $event->event; ?></h3>
<div class="card-tools">
<a href="<?php echo base_url(); ?>admin/event/<?php echo $event->id; ?>" class="btn btn-sm btn-warning"><i class="fas fa-long-arrow-alt-left"></i> Go Back</a>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6 mx-auto">
<form id="" method="post" action="<?php echo base_url(); ?>admin/event_update_request" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="event_id" value="<?php echo $event->id; ?>" required />
<input type="hidden" name="old_event_image" value="<?php echo $event->image; ?>" required />
<input type="hidden" name="old_event_thumbnail" value="<?php echo $event->thumbnail; ?>" required />
<div class="form-group">
<label for="event">Enter event name: </label><br>
<input class="form-control" type="text" name="event" value="<?php echo $event->event; ?>" placeholder="Event" id="event" required />
</div>
<div class="form-group">
<label for="category">Select a category: </label>
<select class="form-control" id="category" name="category">
<option selected="true" value="<?php echo $event->category_id; ?>"><?php echo $event->category_name; ?></option>
<option disabled> ----------- </option>
<?php foreach ($categories as $category) { ?>
<option value="<?php echo $category['id']; ?>"><?php echo $category['category_name']; ?></option>
<?php } ?>
</select>
</div>
<div class="form-group">
<label for="city">Select city name: </label>
<input class="form-control" type="text" name="city" value="<?php echo $event->city; ?>" placeholder="City" id="cityname" required />
<input hidden type="text" name="state" id="state" value="" />
<input hidden type="text" name="country" id="country" value="" />
<input hidden type="text" name="currency_code" id="currency_code" value="<?php echo $event->currency_code; ?>" />
<div id="mce_js_create_citylist" class="mce_create_input_box"></div>
</div>
<div class="form-group">
<div id="pac-container">
<label for="pac-input">Enter full address: </label>
<div id="map"></div>
<input class="form-control" value="<?php echo $event->location; ?>" id="pac-input" name="location" class="controls" type="text" placeholder="Address" maxlength="auto" required autocomplete="off">
</div>
</div>
<div class="form-group">
<label for="start_date">Select event start date: </label>
<div class="input-group date" id="start_date" data-target-input="nearest">
<input type="text" class="form-control datetimepicker-input" data-target="#start_date" name="start_date" value="<?php echo $start_date; ?>" placeholder="DD-MM-YYYY" required />
<div class="input-group-append" data-target="#start_date" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
<div class="form-group">
<label for="start_date">Select event end date: </label>
<div class="input-group date" id="end_date" data-target-input="nearest">
<input type="text" class="form-control datetimepicker-input" data-target="#end_date" name="end_date" value="<?php echo $end_date; ?>" placeholder="DD-MM-YYYY" required />
<div class="input-group-append" data-target="#end_date" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
<div class="form-group">
<label for="start_time">Select event start time: </label>
<div class="input-group date" id="start_time" data-target-input="nearest">
<input type="text" class="form-control datetimepicker-input" data-target="#start_time" name="start_time" value="<?php echo $start_time; ?>" placeholder="HH-MM AM/PM" required />
<div class="input-group-append" data-target="#start_time" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-clock-o"></i></div>
</div>
</div>
</div>
<div class="form-group">
<label for="start_time">Select event end time: </label>
<div class="input-group date" id="end_time" data-target-input="nearest">
<input type="text" class="form-control datetimepicker-input" data-target="#end_time" name="end_time" value="<?php echo $end_time; ?>" placeholder="HH-MM AM/PM" required />
<div class="input-group-append" data-target="#end_time" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-clock-o"></i></div>
</div>
</div>
</div>
<div class="form-group">
<label for="image">Select an image: [File Size Limit: 5 MB] </label>
<input class="form-control" type="file" name="image" id="edit_image" />
<div class="note">Supported File Types : JPG, PNG, GIF, JPEG.</div>
</div>
<div class="form-group">
<label for="description">Describe your event: </label>
<div class="page-wrapper box-content">
<textarea required class="form-control content" name="description" id="description"><?php echo $event->description; ?></textarea>
</div>
</div>
<div class="mce_create_event_information">
Payment Details
</div>
<p>Is the event for free?</p>
<div class="form-check">
<input <?php if ($event->is_free == 1) echo 'checked';
else echo ''; ?> class="form-check-input" type="radio" name="is_free" id="mce_edit_is_free_yes" value="1">
<label class="form-check-label" for="yes">Yes</label>
</div>
<div class="form-check">
<input <?php if ($event->is_free == 0) echo 'checked';
else echo ''; ?> class="form-check-input" type="radio" name="is_free" id="mce_edit_is_free_no" value="0">
<label class="form-check-label" for="no">No</label>
</div>
<div class="edit-confirmation" style="display: <?php if ($event->is_free == 1) {
echo 'none';
}
if ($event->is_free == 0) echo 'block'; ?>;">
<p>Do you want to sell tickets through our platform?</p>
<div class="form-check">
<input <?php if ($event->is_paid == 0) echo 'checked';
else echo ''; ?> class="form-check-input" type="radio" name="is_paid" id="edit-yes-i-want" value="0" onclick="myCheckForPaidYes()">
<label class="form-check-label" for="yes-i-want">Yes</label>
</div>
<div class="form-check">
<input <?php if ($event->is_paid == 1) echo 'checked';
else echo ''; ?> class="form-check-input" type="radio" name="is_paid" id="edit-paid" value="1" onclick="myCheckForPaidNo()">
<label class="form-check-label" for="paid">No, I have an external payment link</label>
</div>
<div id="edit-paidevent" style="display: <?php if ($event->is_free == 1) {
echo 'none';
}
if ($event->is_free == 0) echo 'block'; ?>;">
<div class="form-group">
<label for="paidlink">Enter link for your event</label>
<input <?php if ($event->is_paid == 0) {
echo 'readonly';
}
if ($event->is_paid == 1) echo ''; ?> class="form-control" type="text" name="paidlink" id="paidlink" value="<?php echo $event->paidlink; ?>" placeholder="Ex: https://mycityevents.org/">
</div>
</div>
</div>
<hr>
<div id="old_tickets">
<?php
$tc = 1;
if (is_array($tickets) || is_object($tickets)) {
foreach ($tickets as $ticket) : ?>
<div class="update_ticket_div">
<p class="mce_ticket_count" id="mce_js_old_tickets_no">Ticket <?php echo $tc; ?></p>
<input hidden type="text" name="no_of_old_tickets" id="no_of_old_tickets" value="<?php echo $tc; ?>" />
<input value="<?php echo $ticket['id']; ?>" type="hidden" name="old_ticket_id[]" id="mce_js_old_ticket_id_<?php echo $tc; ?>">
<div class="form-group">
<label>Ticket Name</label>
<input class="form-control" value="<?php echo $ticket['title']; ?>" placeholder="What is this ticket for?" type="text" name="old_ticket_title[]" id="mce_js_old_ticket_title_<?php echo $tc; ?>">
</div>
<div class="form-group">
<label>Total Seats</label>
<input class="form-control" value="<?php echo $ticket['seats']; ?>" placeholder="Enter No of Seats" type="text" name="old_ticket_seats[]" id="mce_js_old_ticket_seats_<?php echo $tc; ?>">
</div>
<div class="form-group">
<label>Ticket Amount</label>
<input class="form-control" value="<?php echo $ticket['amount']; ?>" placeholder="Enter Ticket Amount" type="text" name="old_ticket_amount[]" id="mce_js_old_ticket_amount_<?php echo $tc; ?>">
</div>
<a href="/event/<?php echo $event->id; ?>/ticket/delete/<?php echo $ticket['id']; ?>" class="btn btn-danger btn-sm mb-3 remove_old_ticket">Remove</a>
<hr>
</div>
<?php $tc++;
endforeach;
} ?>
</div>
<div id="tickets" style="display: <?php if ($event->is_free == 1) {
echo 'none';
} elseif ($event->is_free == 0 && $event->is_paid == 0) {
echo 'block';
} elseif ($event->is_free == 0 && $event->is_paid == 1) {
echo 'none';
} ?>;">
<div id="mce_js_edit_add_tickets">
<p id="show_country" class="text-primary"></p>
<p id="show_currency_code" class="text-primary"></p>
</div>
<input hidden type="text" name="max_fields" id="max_fields" value="8" />
<input hidden type="text" name="ticket_no" id="ticket_no" value="<?php echo $tc; ?>" />
<input hidden type="text" name="no_of_tickets" id="no_of_tickets" value="0" />
<div class="mce_edit_event_input_fields_wrap">
</div>
<div class="mt-3">
<button class="btn btn-primary mce_js_add_field_button">Add Ticket</button>
</div>
<hr>
<input hidden type="text" name="old_ticket_data[]" id="old_ticket_data" />
<input hidden type="text" name="ticket_data[]" id="ticket_data" />
<div id="agreement" style="display: block;">
<p class="convenience-fee">Did you include 2% of convenience fees & 2% of payment gateway fees in your final ticket amount?</p>
<p>By Clicking Update Event you are agreeing to <a href="/pricing" target="_blank">Pricing</a> and <a href="/terms" target="_blank">Terms and Conditions</a>.</p>
</div>
<input type="submit" name="update-event" id="update-event" value="Update Event" class="btn btn-success" style="display: block;" onclick="textareaReplaceLineBreaks('#description');">
</form>
</div>
</div>
</div>
</div>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->