Esempio n. 1
0
</a></li>
											<?php 
    } else {
        global $current_user;
        ?>
											
												<li><a href="<?php 
        echo esc_url(get_author_posts_url($current_user->ID));
        ?>
" class="register-button"><i class="fa fa-user"></i> <?php 
        _e('Hi ', 'coupon');
        echo !empty($current_user->first_name) ? $current_user->first_name : $current_user->user_login;
        ?>
</a></li>
												<li><a href="<?php 
        echo esc_url(coupon_get_permalink_by_tpl('page-tpl_submit_code'));
        ?>
"><i class="fa fa-tags"></i> <?php 
        _e('Submit Coupon', 'coupon');
        ?>
</a></li>
												<li><a href="<?php 
        echo esc_url(wp_logout_url(home_url()));
        ?>
" class="login-button"><i class="fa fa-unlock-alt"></i> <?php 
        _e('Logout ', 'coupon');
        ?>
</a></li>
											<?php 
    }
    ?>
Esempio n. 2
0
    public function widget($args, $instance)
    {
        global $wpdb;
        extract($args);
        $title = empty($instance['title']) ? __('Search Coupons', 'coupon') : $instance['title'];
        $code_category = '';
        if (!empty($_GET['code_category'])) {
            $code_category = $_GET['code_category'];
        }
        $code_shop_id = '';
        if (!empty($_GET['code_shop_id'])) {
            $code_shop_id = $_GET['code_shop_id'];
        }
        $shops_list = '';
        $shops = get_posts(array('post_type' => 'shop', 'post_status' => 'publish', 'posts_per_page' => -1));
        if (!empty($shops)) {
            foreach ($shops as $shop) {
                $shops_list .= '<li><a href="#" data-value="' . $shop->ID . '" ' . ($shop->ID == $code_shop_id ? 'data-selected="selected"' : '') . '>' . $shop->post_title . '</a></li>';
            }
        }
        $category_list = '';
        $parents = get_terms('code_category', array('hide_empty' => 1, 'parent' => 0));
        if (!empty($parents)) {
            foreach ($parents as $parent) {
                $children = get_terms('code_category', array('hide_empty' => 1, 'parent' => $parent->term_id));
                if (!empty($children)) {
                    foreach ($children as $child) {
                        $term_meta = get_option("taxonomy_" . $child->term_id);
                        $icon = !empty($term_meta['category_icon']) ? $term_meta['category_icon'] : '';
                        $category_list .= '<li><a href="#" data-value="' . esc_attr($child->slug) . '" ' . ($child->slug == $code_category ? 'data-selected="selected"' : '') . '><i class="fa fa-' . esc_attr($icon) . '"></i> ' . $child->name . '</a></li>';
                    }
                }
            }
        }
        $result = $wpdb->get_results("SELECT MAX( postmeta.meta_value ) AS max_range FROM {$wpdb->prefix}posts as posts LEFT JOIN {$wpdb->prefix}postmeta as postmeta ON posts.ID = postmeta.post_id WHERE posts.post_status = 'publish' AND postmeta.meta_key='code_expire'");
        $result = array_shift($result);
        $secondsInAMinute = 60;
        $secondsInAnHour = 60 * $secondsInAMinute;
        $secondsInADay = 24 * $secondsInAnHour;
        /* extract days */
        $days = ceil(($result->max_range - time()) / $secondsInADay);
        if ($days < 0) {
            $days = 1;
        }
        $start_range = 0;
        if (!empty($_GET['start_range'])) {
            $start_range = $_GET['start_range'];
        }
        $end_range = $days;
        if (!empty($_GET['end_range'])) {
            $end_range = $_GET['end_range'];
        }
        $coupon_label = '';
        if (!empty($_GET['coupon_label'])) {
            $coupon_label = $_GET['coupon_label'];
        }
        echo $before_widget . $before_title . $title . $after_title . '<!-- widget-content -->
					<div class="widget-content">

						<!-- time-slider -->
						<div class="timeline">
							<p>' . __('Days Range:', 'coupon') . ' <span class="green">' . $start_range . '</span> - <span class="green">' . $end_range . '</span></p>
						</div>

						<div class="slider slider-horizontal">
							<input type="text" class="span2" value="" data-slider-min="0" data-slider-max="' . esc_attr($days) . '" data-slider-step="1" data-slider-value="[' . esc_attr($start_range) . ',' . esc_attr($end_range) . ']" id="time-slider">
						</div>
						<!-- .time-slider -->

						<!-- dropdown-categories -->
						<div class="dropdown dd-widget">
							<button type="button" class="btn btn-default dropdown-toggle form-control" data-toggle="dropdown">
								' . __('Categories', 'coupon') . '
								<span class="fa fa-angle-down pull-right"></span>
							</button>
							<ul class="dropdown-menu dd-custom dd-widget" role="menu" data-name="code_category">
								' . $category_list . '
							</ul>
						</div>
						<!-- .dropdown-categories -->

						<!-- dropdown-shops -->
						<div class="dropdown dd-widget">
							<button type="button" class="btn btn-default dropdown-toggle form-control" data-toggle="dropdown">
								' . __('Shops', 'coupon') . '
								<span class="fa fa-angle-down pull-right"></span>
							</button>
							<ul class="dropdown-menu dd-custom dd-widget" role="menu" data-name="code_shop_id">
								' . $shops_list . '
							</ul>
						</div>
						<!-- .dropdown-shops -->

						<!-- dropdown-type -->
						<div class="dropdown dd-widget">
							<button type="button" class="btn btn-default dropdown-toggle form-control" data-toggle="dropdown">
								' . __('Type', 'coupon') . '
								<span class="fa fa-angle-down pull-right"></span>
							</button>
							<ul class="dropdown-menu dd-custom dd-widget" role="menu" data-name="coupon_label">
								<li><a href="#" data-value="coupon" ' . ($coupon_label == 'coupon' ? 'data-selected="selected"' : '') . '>' . __('Coupon', 'coupon') . '</a>
								</li>
								<li><a href="#" data-value="discount" ' . ($coupon_label == 'discount' ? 'data-selected="selected"' : '') . '>' . __('Discount', 'coupon') . '</a>
								</li>
							</ul>
						</div>
						<!-- .dropdown-type -->

						<!-- search-button -->
						<form method="get" action="' . coupon_get_permalink_by_tpl('page-tpl_code_search') . '" class="search_widget">
							<input type="hidden" value="' . esc_attr($start_range) . '" name="start_range">
							<input type="hidden" value="' . esc_attr($end_range) . '" name="end_range">
							<input type="hidden" value="' . esc_attr($code_category) . '" name="code_category">
							<input type="hidden" value="' . esc_attr($code_shop_id) . '" name="code_shop_id">
							<input type="hidden" value="' . esc_attr($coupon_label) . '" name="coupon_label">						
							<button type="submit" class="btn btn-custom btn-full btn-default btn-lg">' . __('Search Coupons', 'coupon') . '</button>
						</form>
						<!-- .search-button -->

					</div>
					<!-- .widget-content -->' . $after_widget;
    }
Esempio n. 3
0
					<div class="special-box col-md-3">
						<div class="caption special-caption">
							<h2><?php 
        echo $category->name;
        ?>
</h2>
						</div>
						<div class="line-divider">
							<span class="line-mask green-bg"></span>
						</div>
						<p><?php 
        echo $category->description;
        ?>
</p>
						<a href="<?php 
        echo esc_url(coupon_get_permalink_by_tpl('page-tpl_categories'));
        ?>
" class="btn btn-custom btn-default btn-lg">
							<?php 
        _e('See All', 'coupon');
        ?>
						</a>
					</div>
					<!-- .title-column -->
					
					<div class="col-md-9">
						<?php 
        if (!empty($children)) {
            $counter = 0;
            ?>
						<div class="row category-row">
Esempio n. 4
0
										  </div>
										  
										  
										  <div class="form-group clearfix">
										   <div class="checkbox pull-left">
											 <label>
												<input type="checkbox" name="rememberme" value="1">
												<?php 
        _e('Remember me', 'coupon');
        ?>
 </label>
										   </div>
										  
										   <div class="form-group pull-right forgot">
											   <a href="<?php 
        echo esc_url(coupon_get_permalink_by_tpl('page-tpl_password_rec'));
        ?>
"><?php 
        _e('Forgot password?', 'coupon');
        ?>
</a>
										   </div>
										  </div>
								 
										  <div class="clearfix">
											<?php 
        wp_nonce_field('login', 'login_field');
        ?>
											<input type="hidden" name="action" value="login">
											<button type="submit" class="btn btn-custom btn-default login"><?php 
        _e('Login', 'coupon');
Esempio n. 5
0
function coupon_register_login_url()
{
    return coupon_get_permalink_by_tpl('page-tpl_register_login');
}
Esempio n. 6
0
    } else {
        ?>
								<!-- title -->
								<div class="caption contact-caption">
									<h2>
										<span class="green"><i class="fa fa-unlock"></i>
										</span><?php 
        _e('Register To Submit Code', 'coupon');
        ?>
</h2>
								</div>
								<!-- .title -->
							<!-- form -->
							<div class="form register-form">								
								<a href="<?php 
        echo esc_url(coupon_get_permalink_by_tpl('page-tpl_register_login'));
        ?>
" class="btn btn-custom btn-default"><?php 
        _e('Register Here', 'coupon');
        ?>
</a>
							</div>								
							<?php 
    }
    ?>
						</div>
					</div>

					<div class="col-md-6 main_content">
						<?php 
    the_content();