示例#1
0
function wpsc_purchaselogs_displaylist()
{
    global $purchlogs;
    ?>
  	<form method='post' action=''>
  	  <div class='wpsc_purchaselogs_options'>
  		<select id='purchlog_multiple_status_change' name='purchlog_multiple_status_change' class='purchlog_multiple_status_change'>
  			<option value='-1'><?php 
    _e('Bulk Actions');
    ?>
</option>
  			<?php 
    while (wpsc_have_purch_items_statuses()) {
        wpsc_the_purch_status();
        ?>
 				<option value='<?php 
        echo wpsc_the_purch_status_id();
        ?>
' <?php 
        echo wpsc_is_checked_status();
        ?>
 >
 					<?php 
        echo wpsc_the_purch_status_name();
        ?>
 
 				</option>
 			<?php 
    }
    ?>
			<option value="delete"><?php 
    _e('Delete');
    ?>
</option>
  		</select>
  		<input type='hidden' value='purchlog_bulk_modify' name='wpsc_admin_action2' />
  		<input type="submit" value="<?php 
    _e('Apply');
    ?>
" name="doaction" id="doaction" class="button-secondary action" />
  		<?php 
    /* View functions for purchlogs */
    ?>
  		<label for='view_purchlogs_by'><?php 
    _e('View:');
    ?>
</label>

  		<select id='view_purchlogs_by' name='view_purchlogs_by'>
  		  <?php 
    $date_is_selected['3mnths'] = '';
    $date_is_selected['all'] = '';
    switch ($_GET['view_purchlogs_by']) {
        case '3mnths':
            $date_is_selected['3mnths'] = 'selected="selected"';
            break;
        case '':
        case 'all':
            $date_is_selected['all'] = 'selected="selected"';
            break;
    }
    ?>
  			<option value='all' <?php 
    echo $date_is_selected['all'];
    ?>
>All</option>
				<option value='3mnths' <?php 
    echo $date_is_selected['3mnths'];
    ?>
>Three Months</option>
  			<?php 
    echo wpsc_purchlogs_getfirstdates();
    ?>
  		</select>
  		<select id='view_purchlogs_by_status' name='view_purchlogs_by_status'>
  			<option value='-1'>Status: All</option>
  			<?php 
    while (wpsc_have_purch_items_statuses()) {
        wpsc_the_purch_status();
        ?>
  			<?php 
        $current_status = wpsc_the_purch_status_id();
        $is_selected = '';
        if ($_GET['view_purchlogs_by_status'] == $current_status) {
            $is_selected = 'selected="selected"';
        }
        ?>
 				<option value='<?php 
        echo $current_status;
        ?>
' <?php 
        echo $is_selected;
        ?>
 >
 					<?php 
        echo wpsc_the_purch_status_name();
        ?>
 
 				</option>
 			<?php 
    }
    ?>

  		</select>
  		<input type='hidden' value='purchlog_filter_by' name='wpsc_admin_action' />
  		<input type="submit" value="<?php 
    _e('Filter');
    ?>
" name="doaction2" id="doaction2" class="button-secondary action" />
  	</div>
  		<?php 
    if (wpsc_have_purch_items() == false) {
        ?>
  		<p style='color:red;'><?php 
        _e('Oops there are no purchase logs for your selection, please try again.');
        ?>
</p>
  		
  		<?php 
    }
    ?>
	 	<table class="widefat page fixed" cellspacing="0">
			<thead>
				<tr>
			<?php 
    print_column_headers('display-sales-list');
    ?>
				</tr>
			</thead>
		
			<tfoot>
				<tr>
			<?php 
    print_column_headers('display-sales-list', false);
    ?>
				</tr>
			</tfoot>
		
			<tbody>
			<?php 
    get_purchaselogs_content();
    ?>
			</tbody>
		</table>
		<p><strong style='float:left' ><?php 
    _e('Total:');
    ?>
</strong>  <?php 
    echo nzshpcrt_currency_display(wpsc_the_purch_total(), true);
    ?>
</p>
		<?php 
    if (!isset($purchlogs->current_start_timestamp) && !isset($purchlogs->current_end_timestamp)) {
        $purchlogs->current_start_timestamp = $purchlogs->earliest_timestamp;
        $purchlogs->current_end_timestamp = $purchlogs->current_timestamp;
    }
    $arr_params = array('wpsc_admin_action' => 'wpsc_downloadcsv', 'rss_key' => 'key', 'start_timestamp' => $purchlogs->current_start_timestamp, 'end_timestamp' => $purchlogs->current_end_timestamp);
    ?>
	
		<br />	
		<p><a class='admin_download' href='<?php 
    echo htmlentities(add_query_arg($arr_params));
    ?>
' ><img class='wpsc_pushdown_img' src='<?php 
    echo WPSC_URL;
    ?>
/images/download.gif' alt='' title='' /> <span> <?php 
    echo TXT_WPSC_DOWNLOAD_CSV;
    ?>
</span></a></p>
	</form>
	<br />
	<script type="text/javascript">
	/* <![CDATA[ */
	(function($){
		$(document).ready(function(){
			$('#doaction, #doaction2').click(function(){
				if ( $('select[name^="purchlog_multiple_status_change"]').val() == 'delete' ) {
					var m = '<?php 
    echo js_escape(__("You are about to delete the selected purchase logs.\n  'Cancel' to stop, 'OK' to delete."));
    ?>
';
					return showNotice.warn(m);
				}
			});
		});
	})(jQuery);
	//columns.init('edit');
	/* ]]> */
	</script>

<?php 
    unset($_SESSION['newlogs']);
}
示例#2
0
function wpsc_purchaselogs_displaylist()
{
    global $purchlogs;
    ?>
   <form method='post' action=''>
     <div class='wpsc_purchaselogs_options'>
      <select id='purchlog_multiple_status_change' name='purchlog_multiple_status_change' class='purchlog_multiple_status_change'>
         <option selected='selected' value='-1'><?php 
    _e('Bulk Actions', 'wpsc');
    ?>
</option>
         <?php 
    while (wpsc_have_purch_items_statuses()) {
        wpsc_the_purch_status();
        ?>
            <option value='<?php 
        echo wpsc_the_purch_status_id();
        ?>
' >
               <?php 
        echo wpsc_the_purch_status_name();
        ?>
            </option>
         <?php 
    }
    ?>
         <option value="delete"><?php 
    _e('Delete', 'wpsc');
    ?>
</option>
      </select>
      <input type='hidden' value='purchlog_bulk_modify' name='wpsc_admin_action2' />
      <input type="submit" value="<?php 
    _e('Apply', 'wpsc');
    ?>
" name="doaction" id="doaction" class="button-secondary action" />
      <?php 
    /* View functions for purchlogs */
    ?>
      <label for='view_purchlogs_by'><?php 
    _e('View:');
    ?>
</label>

      <select id='view_purchlogs_by' name='view_purchlogs_by'>
<?php 
    $date_is_selected['3mnths'] = '';
    $date_is_selected['all'] = '';
    if (!isset($_GET['view_purchlogs_by'])) {
        $_GET['view_purchlogs_by'] = '';
    }
    switch ($_GET['view_purchlogs_by']) {
        case 'all':
            $date_is_selected['all'] = 'selected="selected"';
            break;
        default:
        case '3mnths':
        case '':
            $date_is_selected['3mnths'] = 'selected="selected"';
            break;
    }
    ?>
         <option value='all' <?php 
    echo $date_is_selected['all'];
    ?>
><?php 
    echo _x('All', 'all sales', 'wpsc');
    ?>
</option>
            <option value='3mnths' <?php 
    echo $date_is_selected['3mnths'];
    ?>
><?php 
    _e('Three Months', 'wpsc');
    ?>
</option>
         <?php 
    echo wpsc_purchlogs_getfirstdates();
    ?>
      </select>
      <select id='view_purchlogs_by_status' name='view_purchlogs_by_status'>

         <?php 
    while (wpsc_have_purch_items_statuses()) {
        wpsc_the_purch_status();
        ?>

         <?php 
        $current_status = wpsc_the_purch_status_id();
        $is_selected = '';
        if (isset($_GET['view_purchlogs_by_status']) && $_GET['view_purchlogs_by_status'] == $current_status) {
            $is_selected = 'selected="selected"';
        }
        ?>
            <option value='<?php 
        echo $current_status;
        ?>
' <?php 
        echo $is_selected;
        ?>
 >
               <?php 
        echo wpsc_the_purch_status_name();
        ?>
            </option>
         <?php 
    }
    ?>
         <?php 
    if (empty($is_selected)) {
        $is_selected = 'selected="selected"';
    } else {
        $is_selected = '';
    }
    ?>
         <option <?php 
    echo $is_selected;
    ?>
 value='-1'><?php 
    _e('Status: All', 'wpsc');
    ?>
</option>
      </select>
      <input type='hidden' value='purchlog_filter_by' name='wpsc_admin_action' />
      <input type="submit" value="<?php 
    _e('Filter', 'wpsc');
    ?>
" name="doaction2" id="doaction2" class="button-secondary action" />
   </div>
      <?php 
    if (isset($_POST['purchlogs_searchbox']) && wpsc_have_purch_items() == false) {
        ?>
   <div class="updated settings-error"><p><?php 
        _e('There are no purchase logs for your selection, please try again.', 'wpsc');
        ?>
</p></div>
      <?php 
    }
    ?>
      <table class="widefat page fixed" cellspacing="0">
         <thead>
            <tr>
         <?php 
    print_column_headers('display-sales-list');
    ?>
            </tr>
         </thead>
         <tfoot>
            <tr>
         <?php 
    print_column_headers('display-sales-list', false);
    ?>
            </tr>
         </tfoot>
         <tbody>
         <?php 
    get_purchaselogs_content();
    ?>
         </tbody>
      </table>
      <p><strong><?php 
    _e('Total:', 'wpsc');
    ?>
</strong> <?php 
    echo wpsc_currency_display(wpsc_the_purch_total());
    ?>
</p>
<?php 
    if (!isset($purchlogs->current_start_timestamp) && !isset($purchlogs->current_end_timestamp)) {
        $purchlogs->current_start_timestamp = $purchlogs->earliest_timestamp;
        $purchlogs->current_end_timestamp = $purchlogs->current_timestamp;
    }
    $arr_params = array('wpsc_admin_action' => 'wpsc_downloadcsv', 'rss_key' => 'key', 'start_timestamp' => $purchlogs->current_start_timestamp, 'end_timestamp' => $purchlogs->current_end_timestamp);
    $piggy_url = 'http://www.bravenewcode.com/store/plugins/piggy/?utm_source=affiliate-6331&utm_medium=affiliates&utm_campaign=wpec#1';
    ?>
      <br />
      <p><a class='admin_download' href='<?php 
    echo htmlentities(add_query_arg($arr_params), ENT_QUOTES, 'UTF-8');
    ?>
' ><img class='wpsc_pushdown_img' src='<?php 
    echo WPSC_CORE_IMAGES_URL;
    ?>
/download.gif' alt='' title='' /> <span> <?php 
    _e('Download CSV', 'wpsc');
    ?>
</span></a>
       <a target="_blank" class='admin_download' href='<?php 
    echo htmlentities($piggy_url, ENT_QUOTES, 'UTF-8');
    ?>
'><img class='wpsc_pushdown_img' src='<?php 
    echo WPSC_CORE_IMAGES_URL;
    ?>
/mobile.png' alt='' title='' /> <span> <?php 
    _e('Mobile Sales App', 'wpsc');
    ?>
</span></a></p>
   </form>
   <br />
   <script type="text/javascript">
   /* <![CDATA[ */
   (function($){
      $(document).ready(function(){
         $('#doaction, #doaction2').click(function(){
            if ( $('select[name^="purchlog_multiple_status_change"]').val() == 'delete' ) {
               var m = '<?php 
    echo esc_js(__("You are about to delete the selected purchase logs.\n  'Cancel' to stop, 'OK' to delete.", "wpsc"));
    ?>
';
               return showNotice.warn(m);
            }
         });
      });
   })(jQuery);
   //columns.init('edit');
   /* ]]> */
   </script>

<?php 
    unset($_SESSION['newlogs']);
}