Exemplo n.º 1
0
function affwp_visits_admin()
{
    $visits_table = new AffWP_Visits_Table();
    $visits_table->prepare_items();
    $from = !empty($_REQUEST['filter_from']) ? $_REQUEST['filter_from'] : '';
    $to = !empty($_REQUEST['filter_to']) ? $_REQUEST['filter_to'] : '';
    ?>
	<div class="wrap">
		<h2><?php 
    _e('Visits', 'affiliate-wp');
    ?>
</h2>
		<?php 
    do_action('affwp_affiliates_page_top');
    ?>
		<form id="affwp-visits-filter" method="get" action="<?php 
    echo admin_url('admin.php?page=affiliate-wp');
    ?>
">
			<?php 
    $visits_table->search_box(__('Search', 'affiliate-wp'), 'affwp-affiliates');
    ?>
			<span class="affwp-ajax-search-wrap">
				<input type="text" name="user_name" id="user_name" class="affwp-user-search" autocomplete="off" placeholder="<?php 
    _e('Affiliate name', 'affiliate-wp');
    ?>
" />
				<img class="affwp-ajax waiting" src="<?php 
    echo admin_url('images/wpspin_light.gif');
    ?>
" style="display: none;"/>
			</span>
			<div id="affwp_user_search_results"></div>
			<input type="hidden" name="user_id" id="user_id" value=""/>
			<input type="hidden" name="page" value="affiliate-wp-visits" />
			<input type="text" class="affwp-datepicker" autocomplete="off" name="filter_from" placeholder="<?php 
    _e('From - mm/dd/yyyy', 'affiliate-wp');
    ?>
" value="<?php 
    echo $from;
    ?>
"/>
			<input type="text" class="affwp-datepicker" autocomplete="off" name="filter_to" placeholder="<?php 
    _e('To - mm/dd/yyyy', 'affiliate-wp');
    ?>
" value="<?php 
    echo $to;
    ?>
"/>&nbsp;

			<input type="submit" class="button" value="<?php 
    _e('Filter', 'affiliate-wp');
    ?>
"/>
			<?php 
    $visits_table->views();
    ?>
			<?php 
    $visits_table->display();
    ?>
		</form>
		<?php 
    do_action('affwp_affiliates_page_bottom');
    ?>
	</div>
<?php 
}
Exemplo n.º 2
0
function affwp_visits_admin()
{
    $visits_table = new AffWP_Visits_Table();
    $visits_table->prepare_items();
    $from = !empty($_REQUEST['filter_from']) ? $_REQUEST['filter_from'] : '';
    $to = !empty($_REQUEST['filter_to']) ? $_REQUEST['filter_to'] : '';
    $status = !empty($_REQUEST['filter_status']) ? $_REQUEST['filter_status'] : '';
    ?>
	<div class="wrap">

		<h2><?php 
    _e('Visits', 'affiliate-wp');
    ?>
</h2>
		<?php 
    do_action('affwp_affiliates_page_top');
    ?>
		<form id="affwp-visits-filter" method="get" action="<?php 
    echo admin_url('admin.php?page=affiliate-wp');
    ?>
">
			<?php 
    $visits_table->search_box(__('Search', 'affiliate-wp'), 'affwp-affiliates');
    ?>
			<span class="affwp-ajax-search-wrap">
				<input type="text" name="user_name" id="user_name" class="affwp-user-search" data-affwp-status="any" autocomplete="off" placeholder="<?php 
    _e('Affiliate name', 'affiliate-wp');
    ?>
" />
				<img class="affwp-ajax waiting" src="<?php 
    echo admin_url('images/wpspin_light.gif');
    ?>
" style="display: none;"/>
			</span>
			<div id="affwp_user_search_results"></div>
			<input type="hidden" name="user_id" id="user_id" value=""/>
			<input type="hidden" name="page" value="affiliate-wp-visits" />
			<input type="text" class="affwp-datepicker" autocomplete="off" name="filter_from" placeholder="<?php 
    esc_attr_e('From - mm/dd/yyyy', 'affiliate-wp');
    ?>
" value="<?php 
    echo esc_attr($from);
    ?>
"/>
			<input type="text" class="affwp-datepicker" autocomplete="off" name="filter_to" placeholder="<?php 
    esc_attr_e('To - mm/dd/yyyy', 'affiliate-wp');
    ?>
" value="<?php 
    echo esc_attr($to);
    ?>
"/>

			<label class="screen-reader-text" for="filter_status"><?php 
    _e('Filter by status', 'affiliate-wp');
    ?>
</label>
			<select id="filter_status" name="filter_status" class="postform" style="margin-top:-1px;">
				<option value=""<?php 
    selected('', $status);
    ?>
><?php 
    _e('All', 'affiliate-wp');
    ?>
</option>
				<option value="converted"<?php 
    selected('converted', $status);
    ?>
><?php 
    _e('Converted', 'affiliate-wp');
    ?>
</option>
				<option value="unconverted"<?php 
    selected('unconverted', $status);
    ?>
><?php 
    _e('Unconverted', 'affiliate-wp');
    ?>
</option>
			</select>
			<input type="submit" class="button" value="<?php 
    _e('Filter', 'affiliate-wp');
    ?>
"/>
			<?php 
    $visits_table->views();
    ?>
			<?php 
    $visits_table->display();
    ?>
		</form>
		<?php 
    do_action('affwp_affiliates_page_bottom');
    ?>
	</div>
<?php 
}