<?php
/**
 * Manage slide view
 *
 * @package wp-viral-click
 * @author InstaProduct
 * @link http://insta-product.com/
 */
?>
<div id="ipjck-manage-slide" class="wrap ipjck-wrap ipjck-admin ipjck-admin-slide">
  <div class="ipjck-inner">
    <?php
    if ( $this->slide ) {
        $this->title = $this->slide->post_title;
        $this->info  = '<i class="ipjck-fa ipjck-fa-calendar"></i> Created: ' .
            '<strong>' . mysql2date( 'd F Y, h:i', $this->slide->post_date ) . '</strong>';

        $this->view( 'admin/general/header' );
    } else {
        $this->title = __( 'Add Slide In', IPJCK_SLUG );
        $this->info  = 'Add new slide in';
        $this->view( 'admin/general/header' );
    }
    $form_action = admin_url( 'admin-ajax.php' ) . '?doajax=1&ipjck=1&action=update_slide';
    ?>
    <div class="ipjck-main">
      <div class="ipjck-main-info"></div>

      <div class="ipjck-primary">
        <div class="ipjck-manage-wrap ipjck-manage-sidebar">
          <form id="<?php echo $this->formId; ?>" class="ipjck-form-container ipjck-form" method="post" action="<?php echo $form_action; ?>" enctype="multipart/form-data">
            <input type="hidden" name="slide_id" id="ipjck-value-slideid" value="<?php echo $this->slideId; ?>" />

            <div class="container-fluid container">

              <div class="ipjck-clear ipjck-tab">
                <?php
                $this->view( 'admin/widget/nav' );
                ?>

                <div class="ipjck-manage-content">
                  <div class="ipjck-manage-info">
                    <div class="row">
                      <div class="col-md-8">
                        <div class="ipjck-tab-title">
                          <i class="ipjck-fa ipjck-fa-cogs"></i>
                          <div class="ipjck-title-text">
                            <h3> <?php _e( 'General', IPJCK_SLUG ); ?></h3>
                            <p> <?php _e( 'Basic settings and info of your slide in', IPJCK_SLUG ); ?></p>
                          </div>
                        </div>
                      </div>
                      <div class="col-md-4">
                        <div class="ipjck-top-submit">
                          <button type="submit" class="ipjck-form-submit ipjck-btn ipjck-btn-secondary ipjck-btn-lg <?php echo $this->submitId; ?>" id="do-update-top" name="update_top">
                            <i class="ipjck-fa ipjck-fa-<?php echo $this->submitIcon; ?>"></i>
                            <strong> <?php echo $this->submitLabel; ?></strong>
                          </button>
                          <?php
                          if ( $this->slide ) {
                            echo '<p class="ipjck-update-info">' .
                              __( 'Last Update', IPJCK_SLUG ) .
                              ': <strong>' . mysql2date( 'd F Y, h:i:s', $this->slide->post_date ) . '</strong>' .
                            '</p>';
                          }
                          ?>
                        </div>
                      </div>
                    </div>
                  </div>

                  <?php
                  $this->view( 'admin/slide/content' );
                  ?>

                  <div class="ipjck-manage-footer">
                    <div class="row">
                      <div class="col-md-6">
                        <div class="ipjck-bottom-submit">
                          <button type="submit" class="ipjck-form-submit ipjck-btn ipjck-btn-secondary ipjck-btn-lg <?php echo $this->submitId; ?>" id="do-update-bottom" name="update_bottom">
                            <i class="ipjck-fa ipjck-fa-<?php echo $this->submitIcon; ?>"></i>
                            <strong><?php echo $this->submitLabel; ?></strong>
                          </button>
                        </div>
                      </div>
                      <div class="col-md-6">
                        <div class="ipjck-bottom-action text-right">
                          <?php
                          if ( $this->slide ) :
                          ?>
                          <a href="#" class="ipjck-btn ipjck-btn-danger ipjck-btn-lg ipjck-item-slide-delete ipjck-delete-edit" data-id="<?php echo $this->slide->ID; ?>">
                              <i class="ipjck-fa ipjck-fa-trash"></i>
                              <?php _e( 'Delete', IPJCK_SLUG ); ?>
                          </a>
                          <?php
                          endif;
                          ?>
                        </div>
                      </div>
                    </div>

                  </div>
                </div>
              </div>

            </div>

          </form>
        </div>
      </div>
    </div>
  </div>
  <?php
  if ( isset( $_GET['edited'] )) :
  ?>
    <div class="ipjck-ui-modal-message ipjck-message-edited alert-success" style="top: -120%px;">
      <div class="ipjck-ui-modal-message-main">
        <div class="ipjck-ui-modal-message-content">
          <p><?php _e( 'Successfully saved slide in.', IPJCK_SLUG ); ?></p>
        </div>
      </div>
    </div>
  <?php
  endif;
  ?>
</div>
