| @@ -1,135 +1,191 @@ | ||
| 1 | -<script type="text/javascript">jQuery(function($){uscesInformation.getinfo2();});</script> | |
| 2 | -<?php | |
| 3 | - | |
| 4 | -$display_mode = $this->options['display_mode']; | |
| 5 | -$stocs = usces_get_stocs(); | |
| 6 | -$items_num = $this->get_items_num(); | |
| 7 | -?> | |
| 8 | -<div class="wrap"> | |
| 9 | -<div class="usces_admin"> | |
| 10 | - | |
| 11 | -<h2>Welcart Shop <?php _e('Home','usces'); ?></h2> | |
| 12 | -<p class="version_info">Version <?php echo USCES_VERSION; ?></p> | |
| 13 | - | |
| 14 | -<div class="usces_admin_right"> | |
| 15 | - | |
| 16 | -<div class="usces_side_box"> | |
| 17 | -<h5><?php _e('Display Modes','usces'); ?>:</h5> | |
| 18 | -<div class="dispmode <?php echo $display_mode; ?>"><?php echo esc_html($this->display_mode[$display_mode]); ?></div> | |
| 19 | -<?php if ( $display_mode == 'Promotionsale' ) : ?> | |
| 20 | -<span><?php _e('Special Benefits', 'usces'); ?>:</span><?php echo esc_html($this->options["campaign_privilege"]); ?> (<?php if($this->options["campaign_privilege"] == 'discount'){echo esc_html($this->options["privilege_discount"]).__('% Discount', 'usces');}elseif($this->options["campaign_privilege"] == 'point'){echo esc_html($this->options["privilege_point"]).__(" times (limited to members)", 'usces');} ?>) <br /> | |
| 21 | -<span><?php _e('applied material', 'usces'); ?>:</span><?php echo esc_html(get_cat_name($this->options["campaign_category"])); ?><br /> | |
| 22 | -<span><?php _e('Period', 'usces'); ?>:</span><?php echo $this->options["campaign_schedule"]['start']['year']; ?>/<?php echo $this->options["campaign_schedule"]['start']['month']; ?>/<?php echo esc_html($this->options["campaign_schedule"]['start']['day']); ?><?php _e(' - ', 'usces'); ?><?php echo esc_html($this->options["campaign_schedule"]['end']['year']); ?>/<?php echo esc_html($this->options["campaign_schedule"]['end']['month']); ?>/<?php echo esc_html($this->options["campaign_schedule"]['end']['day']); ?> | |
| 23 | -<?php endif; ?> | |
| 24 | -</div> | |
| 25 | - | |
| 26 | -<?php if( !(defined('USCES_ADMIN_INFO') && !USCES_ADMIN_INFO) ) : ?> | |
| 27 | -<div id= "wc_information" class="chui"></div> | |
| 28 | -<?php endif; ?> | |
| 29 | -<?php do_action( 'usces_action_admin_top_sidebar' ); ?> | |
| 30 | - | |
| 31 | -</div><!--usces_admin_right--> | |
| 32 | - | |
| 33 | -<div class="usces_admin_left"> | |
| 34 | -<h4><?php _e('number & amount of order', 'usces'); ?></h4> | |
| 35 | -<div class="usces_box"> | |
| 36 | -<table class="dashboard"> | |
| 37 | -<tr> | |
| 38 | -<th><?php _e('Currency','usces'); ?> : <?php usces_crcode(); ?></th><th><?php _e('number of order', 'usces'); ?></th><th><?php _e('amount of order', 'usces'); ?></th> | |
| 39 | -</tr> | |
| 40 | -<tr> | |
| 41 | -<td><?php _e('today', 'usces'); ?> : </td><td class="bignum"><?php echo number_format($this->get_order_num('today')); ?></td><td class="bignum"><?php usces_crform( $this->get_order_amount('today'), true, false ); ?></td> | |
| 42 | -</tr> | |
| 43 | -<tr> | |
| 44 | -<td><?php _e('This month', 'usces'); ?> : </td><td class="bignum"><?php echo number_format($this->get_order_num('thismonth')); ?></td><td class="bignum"><?php usces_crform( $this->get_order_amount('thismonth'), true, false ); ?></td> | |
| 45 | -</tr> | |
| 46 | -<tr> | |
| 47 | -<td><?php _e('Same date in last year', 'usces'); ?> : </td><td class="bignum"><?php echo number_format($this->get_order_num('lastyear')); ?></td><td class="bignum"><?php usces_crform( $this->get_order_amount('lastyear'), true, false ); ?></td> | |
| 48 | -</tr> | |
| 49 | -</table> | |
| 50 | -</div> | |
| 51 | - | |
| 52 | -<?php do_action( 'usces_action_admintop_box1' ); ?> | |
| 53 | - | |
| 54 | -<h4><?php _e('information for registration of items', 'usces'); ?></h4> | |
| 55 | -<div class="usces_box"> | |
| 56 | -<table class="dashboard"> | |
| 57 | -<tr> | |
| 58 | -<th><?php _e('number of item', 'usces'); ?></th><th colspan="5"><?php _e('SKU total number', 'usces'); ?></th> | |
| 59 | -</tr> | |
| 60 | -<tr> | |
| 61 | -<td rowspan="3" class="bignum"><?php echo number_format($items_num); ?></td><td colspan="5" class="bignum"><?php echo number_format(array_sum($stocs)); ?></td> | |
| 62 | -</tr> | |
| 63 | -<tr> | |
| 64 | -<?php | |
| 65 | -foreach($this->zaiko_status as $value): | |
| 66 | -?> | |
| 67 | -<th><?php if($value == __('OK', 'usces')) {echo __('In Stock', 'usces');}else{echo $value;} ?></th> | |
| 68 | -<?php | |
| 69 | -endforeach; | |
| 70 | -?> | |
| 71 | -</tr> | |
| 72 | -<tr> | |
| 73 | -<?php | |
| 74 | -foreach($this->zaiko_status as $stock_key => $value): $count = isset($stocs[$stock_key]) ? $stocs[$stock_key] : 0; ?> | |
| 75 | -<td class="bignum"><?php echo number_format($count); ?></td> | |
| 76 | -<?php | |
| 77 | -endforeach; | |
| 78 | -unset($stocs); | |
| 79 | -?> | |
| 80 | -</tr> | |
| 81 | -<tr> | |
| 82 | -<th colspan="6"><?php _e('List of items without stock', 'usces'); ?></th> | |
| 83 | -</tr> | |
| 84 | -<?php | |
| 85 | -$zerostoc_items = usces_get_non_zerostoc_items(); | |
| 86 | -foreach((array)$zerostoc_items as $item): ?> | |
| 87 | -<tr> | |
| 88 | -<td colspan="6"><a href="<?php echo site_url() . '/wp-admin/admin.php?page=usces_itemedit&action=edit&post=' . $item['ID']; ?>"><?php echo esc_html($item['name']), ' ', esc_html($item['code']); ?></a></td> | |
| 89 | -</tr> | |
| 90 | -<?php | |
| 91 | -endforeach; | |
| 92 | -unset($non_stoc_skus); | |
| 93 | -?> | |
| 94 | -</table> | |
| 95 | -</div> | |
| 96 | - | |
| 97 | -<?php do_action( 'usces_action_admintop_box2' ); ?> | |
| 98 | - | |
| 99 | -<h4><?php _e('Your environment', 'usces'); ?></h4> | |
| 100 | -<div class="usces_box"> | |
| 101 | -<table class="dashboard"> | |
| 102 | -<tr> | |
| 103 | -<th> </th><th colspan="2"><?php _e('Software Version', 'usces'); ?></th> | |
| 104 | -</tr> | |
| 105 | -<tr> | |
| 106 | -<td><?php _e('Server', 'usces'); ?></td><td colspan="2"><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td> | |
| 107 | -</tr> | |
| 108 | -<tr> | |
| 109 | -<td>MySQL</td><td colspan="2"><?php echo mysql_get_server_info(); ?></td> | |
| 110 | -</tr> | |
| 111 | -<tr> | |
| 112 | -<?php | |
| 113 | -$get_ini = ini_get_all(); | |
| 114 | -$essential_extentions = array('simplexml', 'curl', 'gd', 'json', 'mbstring', 'mysql', 'openssl'); | |
| 115 | -?> | |
| 116 | -<td>PHP</td><td colspan="2"><?php echo phpversion(); ?><?php if(ini_get('safe_mode')) echo "(".__('Safe mode', 'usces').")"; ?> memoly[global]:<?php echo $get_ini['memory_limit']['global_value']; ?> [locale]:<?php echo $get_ini['memory_limit']['local_value']; ?> [usage]:<?php echo (int)(memory_get_peak_usage()/1048576); ?>M<br /> | |
| 117 | -<?php | |
| 118 | -foreach($essential_extentions as $key => $esext){ | |
| 119 | - if (extension_loaded($esext)) { | |
| 120 | - if($key){ | |
| 121 | - echo ', '.$esext; | |
| 122 | - }else{ | |
| 123 | - echo $esext; | |
| 124 | - } | |
| 125 | - } | |
| 126 | -} | |
| 127 | -?> | |
| 128 | -</td> | |
| 129 | -</tr> | |
| 130 | -</table> | |
| 131 | -</div> | |
| 132 | -</div> | |
| 133 | -<!--usces_admin_left--> | |
| 134 | -</div><!--usces_admin--> | |
| 135 | -</div><!--wrap--> | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Admin - Welcart Home Page. | |
| 4 | + * | |
| 5 | + * @package Welcart | |
| 6 | + */ | |
| 7 | + | |
| 8 | +global $wpdb; | |
| 9 | +$display_mode = ( ! empty( $this->options['display_mode'] ) ) ? $this->options['display_mode'] : ''; | |
| 10 | +$display_mode_label = ( isset( $this->display_mode[ $display_mode ] ) ) ? $this->display_mode[ $display_mode ] : $display_mode; | |
| 11 | +$stocs = usces_get_stocs(); | |
| 12 | +$items_num = $this->get_items_num(); | |
| 13 | +$zaiko_status_cols = count( $this->zaiko_status ); | |
| 14 | +?> | |
| 15 | +<script type="text/javascript">jQuery(function($){uscesInformation.getinfo2();});</script> | |
| 16 | +<div class="wrap"> | |
| 17 | +<div class="usces_admin"> | |
| 18 | + | |
| 19 | +<h1>Welcart Shop <?php esc_html_e( 'Home', 'usces' ); ?></h1> | |
| 20 | +<p class="version_info">Version <?php echo esc_html( USCES_VERSION ); ?></p> | |
| 21 | + | |
| 22 | +<div class="usces_admin_right"> | |
| 23 | + | |
| 24 | +<div class="usces_side_box"> | |
| 25 | +<h5><?php esc_html_e( 'Display Modes', 'usces' ); ?>:</h5> | |
| 26 | +<div class="dispmode <?php echo esc_attr( $display_mode ); ?>"><?php echo esc_html( $display_mode_label ); ?></div> | |
| 27 | +<?php | |
| 28 | +if ( 'Promotionsale' == $display_mode ) : | |
| 29 | + $campaign = ''; | |
| 30 | + if ( 'discount' == $this->options['campaign_privilege'] ) { | |
| 31 | + $campaign = ' (' . $this->options['privilege_discount'] . __( '% Discount', 'usces' ) . ') '; | |
| 32 | + } elseif ( 'point' == $this->options['campaign_privilege'] ) { | |
| 33 | + $campaign = ' (' . $this->options['privilege_point'] . __( ' times (limited to members)', 'usces' ) . ') '; | |
| 34 | + } | |
| 35 | + $campaign_schedule = $this->options['campaign_schedule']['start']['year'] . '/' . $this->options['campaign_schedule']['start']['month'] . '/' . $this->options['campaign_schedule']['start']['day'] | |
| 36 | + . __( ' - ', 'usces' ) . $this->options['campaign_schedule']['end']['year'] . '/' . $this->options['campaign_schedule']['end']['month'] . '/' . $this->options['campaign_schedule']['end']['day']; | |
| 37 | + ?> | |
| 38 | +<span><?php esc_html_e( 'Special Benefits', 'usces' ); ?>:</span><?php echo esc_html( $this->options['campaign_privilege'] ); ?><?php echo esc_html( $campaign ); ?><br /> | |
| 39 | +<span><?php esc_html_e( 'applied material', 'usces' ); ?>:</span><?php echo esc_html( get_cat_name( $this->options['campaign_category'] ) ); ?><br /> | |
| 40 | +<span><?php esc_html_e( 'Period', 'usces' ); ?>:</span><?php echo esc_html( $campaign_schedule ); ?> | |
| 41 | +<?php endif; ?> | |
| 42 | +</div> | |
| 43 | + | |
| 44 | +<?php if ( ! ( defined( 'USCES_ADMIN_INFO' ) && ! USCES_ADMIN_INFO ) && 7 < $this->user_level ) : ?> | |
| 45 | +<div id= "wc_information" class="chui"></div> | |
| 46 | +<?php endif; ?> | |
| 47 | +<?php | |
| 48 | +$payment_method = usces_get_system_option( 'usces_payment_method', 'settlement' ); | |
| 49 | +$deactivate = array(); | |
| 50 | +foreach ( $payment_method as $settlement => $payment ) { | |
| 51 | + if ( 'deactivate' == $payment['use'] ) { | |
| 52 | + $deactivate[] = $payment['name']; | |
| 53 | + } | |
| 54 | +} | |
| 55 | +if ( 0 < count( $deactivate ) ) : | |
| 56 | + ?> | |
| 57 | +<div id="wc_payment_method_info" class="info"> | |
| 58 | +<div><?php esc_html_e( 'Stopped payment method', 'usces' ); ?></div> | |
| 59 | + <?php | |
| 60 | + $c = ''; | |
| 61 | + foreach ( $deactivate as $payment ) { | |
| 62 | + echo esc_html( $c . $payment ); | |
| 63 | + $c = ','; | |
| 64 | + } | |
| 65 | + ?> | |
| 66 | +</div> | |
| 67 | + <?php | |
| 68 | +endif; | |
| 69 | +?> | |
| 70 | +<?php do_action( 'usces_action_admin_top_sidebar' ); ?> | |
| 71 | + | |
| 72 | +</div><!--usces_admin_right--> | |
| 73 | + | |
| 74 | +<div class="usces_admin_left"> | |
| 75 | + | |
| 76 | +<?php if ( 4 < $this->user_level ) : ?> | |
| 77 | +<h4><?php esc_html_e( 'number & amount of order', 'usces' ); ?></h4> | |
| 78 | +<div class="usces_box"> | |
| 79 | +<table class="dashboard"> | |
| 80 | +<tr> | |
| 81 | + <th><?php esc_html_e( 'Currency', 'usces' ); ?> : <?php usces_crcode(); ?></th><th><?php esc_html_e( 'number of order', 'usces' ); ?></th><th><?php esc_html_e( 'amount of order', 'usces' ); ?></th> | |
| 82 | +</tr> | |
| 83 | +<tr> | |
| 84 | + <td><?php esc_html_e( 'today', 'usces' ); ?> : </td><td class="bignum"><?php echo number_format( $this->get_order_num( 'today' ) ); ?></td><td class="bignum"><?php usces_crform( $this->get_order_amount( 'today' ), true, false ); ?></td> | |
| 85 | +</tr> | |
| 86 | +<tr> | |
| 87 | + <td><?php esc_html_e( 'This month', 'usces' ); ?> : </td><td class="bignum"><?php echo number_format( $this->get_order_num( 'thismonth' ) ); ?></td><td class="bignum"><?php usces_crform( $this->get_order_amount( 'thismonth' ), true, false ); ?></td> | |
| 88 | +</tr> | |
| 89 | +<tr> | |
| 90 | + <td><?php esc_html_e( 'Same date in last year', 'usces' ); ?> : </td><td class="bignum"><?php echo number_format( $this->get_order_num( 'lastyear' ) ); ?></td><td class="bignum"><?php usces_crform( $this->get_order_amount( 'lastyear' ), true, false ); ?></td> | |
| 91 | +</tr> | |
| 92 | +</table> | |
| 93 | +</div><!--usces_box--> | |
| 94 | +<?php endif; ?> | |
| 95 | +<?php do_action( 'usces_action_admintop_box1' ); ?> | |
| 96 | + | |
| 97 | +<h4><?php esc_html_e( 'information for registration of items', 'usces' ); ?></h4> | |
| 98 | +<div class="usces_box"> | |
| 99 | +<table class="dashboard"> | |
| 100 | +<tr> | |
| 101 | + <th><?php esc_html_e( 'number of item', 'usces' ); ?></th><th colspan="<?php echo esc_attr( $zaiko_status_cols ); ?>"><?php esc_html_e( 'SKU total number', 'usces' ); ?></th> | |
| 102 | +</tr> | |
| 103 | +<tr> | |
| 104 | + <td rowspan="3" class="bignum"><?php echo number_format( $items_num ); ?></td><td colspan="<?php echo esc_attr( $zaiko_status_cols ); ?>" class="bignum"><?php echo number_format( array_sum( $stocs ) ); ?></td> | |
| 105 | +</tr> | |
| 106 | +<tr> | |
| 107 | + <?php | |
| 108 | + foreach ( $this->zaiko_status as $value ) : | |
| 109 | + ?> | |
| 110 | + <th> | |
| 111 | + <?php | |
| 112 | + if ( __( 'OK', 'usces' ) == $value ) { | |
| 113 | + esc_html_e( 'In Stock', 'usces' ); | |
| 114 | + } else { | |
| 115 | + echo esc_html( $value ); | |
| 116 | + } | |
| 117 | + ?> | |
| 118 | + </th> | |
| 119 | + <?php | |
| 120 | + endforeach; | |
| 121 | + ?> | |
| 122 | +</tr> | |
| 123 | +<tr> | |
| 124 | + <?php | |
| 125 | + foreach ( $this->zaiko_status as $stock_key => $value ) : | |
| 126 | + $count = isset( $stocs[ $stock_key ] ) ? $stocs[ $stock_key ] : 0; | |
| 127 | + ?> | |
| 128 | + <td class="bignum"><?php echo number_format( $count ); ?></td> | |
| 129 | + <?php | |
| 130 | + endforeach; | |
| 131 | + unset( $stocs ); | |
| 132 | + ?> | |
| 133 | +</tr> | |
| 134 | +<tr> | |
| 135 | + <th colspan="<?php echo esc_attr( $zaiko_status_cols + 1 ); ?>"><?php esc_html_e( 'List of items without stock', 'usces' ); ?></th> | |
| 136 | +</tr> | |
| 137 | + <?php | |
| 138 | + $zerostoc_items = usces_get_non_zerostoc_items(); | |
| 139 | + foreach ( (array) $zerostoc_items as $item ) : | |
| 140 | + ?> | |
| 141 | +<tr> | |
| 142 | + <td colspan="<?php echo esc_attr( $zaiko_status_cols + 1 ); ?>"><a href="<?php echo esc_url( site_url() . '/wp-admin/admin.php?page=usces_itemedit&action=edit&post=' . $item['ID'] ); ?>"><?php echo ( esc_html( $item['name'] ) . ' ' . esc_html( $item['code'] ) ); ?></a></td> | |
| 143 | +</tr> | |
| 144 | + <?php | |
| 145 | + endforeach; | |
| 146 | + unset( $non_stoc_skus ); | |
| 147 | + ?> | |
| 148 | +</table> | |
| 149 | +</div><!--usces_box--> | |
| 150 | +<?php do_action( 'usces_action_admintop_box2' ); ?> | |
| 151 | + | |
| 152 | +<?php if ( 2 < $this->user_level ) : ?> | |
| 153 | +<h4><?php esc_html_e( 'Your environment', 'usces' ); ?></h4> | |
| 154 | +<div class="usces_box"> | |
| 155 | +<table class="dashboard"> | |
| 156 | +<tr> | |
| 157 | + <th> </th><th colspan="2"><?php esc_html_e( 'Software Version', 'usces' ); ?></th> | |
| 158 | +</tr> | |
| 159 | +<tr> | |
| 160 | + <td><?php esc_html_e( 'Server', 'usces' ); ?></td><td colspan="2"><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td> | |
| 161 | +</tr> | |
| 162 | +<tr> | |
| 163 | + <td>MySQL</td><td colspan="2"><?php echo esc_html( $wpdb->dbh->server_info ); ?></td> | |
| 164 | +</tr> | |
| 165 | +<tr> | |
| 166 | + <?php | |
| 167 | + $get_ini = ini_get_all(); | |
| 168 | + $essential_extentions = array( 'simplexml', 'curl', 'gd', 'json', 'mbstring', 'mysql', 'openssl' ); | |
| 169 | + ?> | |
| 170 | + <td>PHP</td><td colspan="2"><?php echo esc_html( phpversion() ); ?> memory [global]:<?php echo esc_html( $get_ini['memory_limit']['global_value'] ); ?> [locale]:<?php echo esc_html( $get_ini['memory_limit']['local_value'] ); ?> [usage]:<?php echo esc_html( (int) ( memory_get_peak_usage() / 1048576 ) ); ?>M<br /> | |
| 171 | + <?php | |
| 172 | + foreach ( $essential_extentions as $key => $esext ) { | |
| 173 | + if ( extension_loaded( $esext ) ) { | |
| 174 | + if ( $key ) { | |
| 175 | + echo ', ' . esc_html( $esext ); | |
| 176 | + } else { | |
| 177 | + echo esc_html( $esext ); | |
| 178 | + } | |
| 179 | + } | |
| 180 | + } | |
| 181 | + ?> | |
| 182 | + </td> | |
| 183 | +</tr> | |
| 184 | +</table> | |
| 185 | +</div><!--usces_box--> | |
| 186 | +<?php endif; ?> | |
| 187 | +<?php do_action( 'usces_action_admintop_box3' ); ?> | |
| 188 | + | |
| 189 | +</div><!--usces_admin_left--> | |
| 190 | +</div><!--usces_admin--> | |
| 191 | +</div><!--wrap--> | |