<?php
/**
 * The template used for displaying page content in page.php
 *
 * @package _spx
 */
if (xs_get_option('theme_options', 'main_template_style') == 'color'):
    ?>

    <div id="event-slider" class="carousel slide" data-ride="carousel">
        <div class="carousel-inner"> 
            <!-- begin carousel-slide -->

            <?php
            $slides = xs_get_option('theme_options', 'main_slider');
            $active = 'active';
            foreach ($slides as $arr) {
                echo '<div class="item ' . $active . '"> <img src="' . $arr['img_src'] . '" alt="' . $arr['title'] . '" class="img-responsive" /> </div>';
                $active = '';
            }
            ?>

            <!-- end carousel-slide --> 
        </div>
        <!-- end carousel-inner --> 

        <!-- Controls --> 
        <a class="left carousel-control" href="#event-slider" data-slide="prev"> <i class="fa fa-chevron-left"></i></a>
        <a class="right carousel-control" href="#event-slider" data-slide="next"> <i class="fa fa-chevron-right"></i></a>
    </div>
    </section>
    <!-- end HEADER --> 

    <!--BEGIN-INTRO-BOX-->
    <section id="intro" class="page-block">
        <div class="container">
            <div class="section">
                <header class="page-head clearfix">
                    <div class="row">
                        <div class="col-md-10 col-sm-12 text-right">
                            <div class="venue text-left">
                                <h2><?php echo xs_get_option('theme_options', 'event_title'); ?></h2>
                                <p class="text-muted"><?php echo xs_get_option('theme_options', 'event_sub_title'); ?></p>
                            </div>
                            <div data-time="<?php echo xs_countdown_time(); ?>" class="countdown styled"></div>
                        </div>
                        <div class="col-md-2 col-sm-12 text-center">
                            <?php
                            if (xs_get_option('theme_options', 'link_only_register_button') == 'on') {
                                $url = xs_get_option('theme_options', 'register_link');
                                $klass = '';
                            } else {
                                $url = '#';
                                $klass = 'register-trigger';
                                ?>
                                <form id="register" method="post" action="" data-ajaxURL="<?php echo admin_url('admin-ajax.php'); ?>?action=xs_register">
                                    <div class="field-wrapper">
                                        <div class="form-row">
                                            <input type="text" class="form-control" id="name" name="name" placeholder="<?php echo __('Your Name', 'xs'); ?>" />
                                        </div>
                                        <div class="form-row">
                                            <input type="tel" class="form-control" id="phone" name="phone"  placeholder="<?php echo __('Your Phone', 'xs'); ?>" />
                                        </div>
                                        <div class="form-row">
                                            <input type="email" class="form-control" id="email" name="email" placeholder="<?php echo __('Your Email', 'xs'); ?>" />
                                        </div>
                                        <div class="dynamic-price-select"></div>

                                        <div class="form-row clearfix">
                                            <textarea cols="60" rows="3" id="comment" name="comment" class="form-control" placeholder="<?php echo __('Write your message here...', 'xs'); ?>"></textarea>
                                        </div>
                                        <input type="hidden" name="event_title" value="<?php echo xs_get_option('theme_options', 'event_slogan'); ?>" />
                                        <input type="submit" value="<?php echo __('Submit', 'xs'); ?>" class="btn btn-custom btn-lg" id="submit" name="submit" />
                                    </div>
                                </form>
                                <?php
                            }
                            echo '<a href="' . esc_url($url) . '" title="' . __('Register For This Event', 'xs') . '" class="btn ' . $klass . '"><i class="fa fa-plus-circle"></i> ' . xs_get_option('theme_options', 'register_button_text') . '</a>';
                            echo '<h3 class="regHeading">' . __('Register For This Event', 'xs') . '</h3>';
                            ?>

                        </div>
                    </div>
                    <!--end-row--> 
                </header>
                <article>
                    <?php
                    $title = get_post_meta($post->ID, 'xs_section_title', true);

                    if ($title) :
                        ?>
                        <h3><?php echo sprintf(__($title, 'xs'), '<span>', '</span>') ?></h3>
                    <?php else : ?>
                        <h3><?php echo sprintf(__('About %sEvent%s', 'xs'), '<span>', '</span>') ?></h3>
                    <?php endif;
                    ?>
                    <?php the_content(); ?>
                </article>
            </div>
            <!--end-section--> 
        </div>
    </section>
    <!--END-INTRO-BOX--> 
<?php else: ?>
    </section>
    <!-- end HEADER -->

    <!--BEGIN-INTRO-BOX-->
    <section id="main" class="page-block">
        <div class="container">
            <header class="clearfix">
                <div class="text-center">
                    <div class="venue">
                        <h1><?php echo xs_get_option('theme_options', 'event_slogan'); ?><br><small>On <?php echo xs_second_date(); ?></small></h1>
                        <h2><?php echo xs_get_option('theme_options', 'event_title'); ?></h2>
                        <p class="text-muted"><?php echo xs_get_option('theme_options', 'event_sub_title'); ?></p>
                    </div>
                    <div data-time="<?php echo xs_countdown_time(); ?>" class="countdown styled"></div>
                    <?php
                    if (xs_get_option('theme_options', 'link_only_register_button') == 'on') {
                        $url = xs_get_option('theme_options', 'register_link');
                        $klass = '';
                    } else {
                        $url = '#';
                        $klass = 'register-trigger';
                        ?>
                        <form id="register" method="post" data-ajaxURL="<?php echo admin_url('admin-ajax.php'); ?>?action=xs_register">
                            <div class="field-wrapper">
                                <div class="form-row">
                                    <input type="text" class="form-control" id="name" name="name" placeholder="<?php echo __('Your Name', 'xs'); ?>" />
                                </div>
                                <div class="form-row">
                                    <input type="tel" class="form-control" id="phone" name="phone" placeholder="<?php echo __('Your Phone', 'xs'); ?>" />
                                </div>
                                <div class="form-row">
                                    <input type="email" class="form-control" id="email" name="email" placeholder="<?php echo __('Your Email', 'xs'); ?>" />
                                </div>
                                <div class="form-row clearfix">
                                    <textarea cols="60" rows="3" id="comment" name="comment" class="form-control" placeholder="<?php echo __('Write your comment here...', 'xs'); ?>"></textarea>
                                </div>
                                <input type="text" id="security" name="security" class="form-control hide" value="" />
                                <input type="submit" value="<?php echo __('Submit', 'xs'); ?>" class="btn btn-custom btn-lg" id="submit" name="submit" />
                            </div>
                        </form>
                        <?php
                    }
                    echo '<a href="' . esc_url($url) . '" title="' . __('Register For This Event', 'xs') . '" class="btn ' . $klass . '"><i class="fa fa-plus-circle"></i> ' . xs_get_option('theme_options', 'register_button_text') . '</a>';
                    echo '<h3 class="regHeading">' . __('Register For This Event', 'xs') . '</h3>';
                    ?>

                </div>
            </header>
        </div>
    </section>

    <!--BEGIN-INTRO-BOX-->
    <section id="intro" class="page-block">
        <div class="container">
            <div class="section">
                <article>
                    <?php
                    $title = get_post_meta($post->ID, 'xs_section_title', true);

                    if ($title) :
                        ?>
                        <h3><?php echo sprintf(__($title, 'xs'), '<span>', '</span>') ?></h3>
                    <?php else : ?>
                        <h3><?php echo sprintf(__('About %sEvent%s', 'xs'), '<span>', '</span>') ?></h3>
                    <?php endif;
                    ?>

                    <?php the_content(); ?>
                </article>
            </div>
            <!--end-section--> 
        </div>
    </section>
    <!--END-INTRO-BOX--> 

<?php endif; ?>