function updated
This commit is contained in:
parent
eaeaf6e515
commit
ae24709f3b
|
@ -1282,33 +1282,33 @@ function mep_get_all_tax_list($current_tax=null){
|
||||||
$date_format = get_option( 'date_format' );
|
$date_format = get_option( 'date_format' );
|
||||||
$time_format = get_option( 'time_format' );
|
$time_format = get_option( 'time_format' );
|
||||||
$wpdatesettings = $date_format.' '.$time_format;
|
$wpdatesettings = $date_format.' '.$time_format;
|
||||||
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec',12);
|
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec','wtss');
|
||||||
|
|
||||||
if($user_set_format==12){
|
if($user_set_format==12){
|
||||||
echo date_i18n('D, d M Y h:i A', strtotime($datetime));
|
echo wp_date('D, d M Y h:i A', strtotime($datetime));
|
||||||
}
|
}
|
||||||
if($user_set_format==24){
|
if($user_set_format==24){
|
||||||
echo date_i18n('D, d M Y H:i', strtotime($datetime));
|
echo wp_date('D, d M Y H:i', strtotime($datetime));
|
||||||
}
|
}
|
||||||
if($user_set_format=='wtss'){
|
if($user_set_format=='wtss'){
|
||||||
echo date_i18n($wpdatesettings, strtotime($datetime));
|
echo wp_date($wpdatesettings, strtotime($datetime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function mep_get_only_time($datetime){
|
function mep_get_only_time($datetime){
|
||||||
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec',12);
|
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec','wtss');
|
||||||
|
|
||||||
//echo $date_format = get_option( 'date_format' );
|
//echo $date_format = get_option( 'date_format' );
|
||||||
$time_format = get_option( 'time_format' );
|
$time_format = get_option( 'time_format' );
|
||||||
if($user_set_format==12){
|
if($user_set_format==12){
|
||||||
echo date_i18n('h:i A', strtotime($datetime));
|
echo wp_date('h:i A', strtotime($datetime));
|
||||||
}
|
}
|
||||||
if($user_set_format==24){
|
if($user_set_format==24){
|
||||||
echo date_i18n('H:i', strtotime($datetime));
|
echo wp_date('H:i', strtotime($datetime));
|
||||||
}
|
}
|
||||||
if($user_set_format=='wtss'){
|
if($user_set_format=='wtss'){
|
||||||
echo date_i18n($time_format, strtotime($datetime));
|
echo wp_date($time_format, strtotime($datetime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1968,37 +1968,27 @@ function mep_get_all_tax_list($current_tax=null){
|
||||||
|
|
||||||
|
|
||||||
function mep_ticket_sold($event_id){
|
function mep_ticket_sold($event_id){
|
||||||
|
$event_start_date = date('Y-m-d',strtotime(get_post_meta($event_id,'event_start_date',true)));
|
||||||
|
$get_ticket_type_list = get_post_meta($event_id,'mep_event_ticket_type',true);
|
||||||
|
|
||||||
$args = array(
|
$recurring = get_post_meta($event_id, 'mep_enable_recurring', true) ? get_post_meta($event_id, 'mep_enable_recurring', true) : 'no';
|
||||||
'post_type' => 'mep_events_attendees',
|
|
||||||
'posts_per_page' => -1,
|
|
||||||
|
|
||||||
'meta_query' => array(
|
|
||||||
'relation' => 'AND',
|
$sold = 0;
|
||||||
array(
|
foreach($get_ticket_type_list as $ticket_type){
|
||||||
'relation' => 'AND',
|
$sold = $sold + mep_ticket_type_sold($event_id,$ticket_type['option_name_t'],$event_start_date);
|
||||||
array(
|
}
|
||||||
'key' => 'ea_event_id',
|
|
||||||
'value' => $event_id,
|
if($recurring == 'yes'){
|
||||||
'compare' => '='
|
$mep_event_more_date = get_post_meta($event_id,'mep_event_more_date',true);
|
||||||
)
|
foreach ($mep_event_more_date as $md) {
|
||||||
),array(
|
foreach($get_ticket_type_list as $ticket_type){
|
||||||
'relation' => 'OR',
|
$sold = $sold + mep_ticket_type_sold($event_id,$ticket_type['option_name_t'],$md['event_more_start_date']);
|
||||||
array(
|
}
|
||||||
'key' => 'ea_order_status',
|
}
|
||||||
'value' => 'processing',
|
}
|
||||||
'compare' => '='
|
|
||||||
),
|
return $sold;
|
||||||
array(
|
|
||||||
'key' => 'ea_order_status',
|
|
||||||
'value' => 'completed',
|
|
||||||
'compare' => '='
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$loop = new WP_Query($args);
|
|
||||||
return $loop->post_count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2022,7 +2012,7 @@ function mep_get_all_tax_list($current_tax=null){
|
||||||
|
|
||||||
function get_mep_datetime($date,$type){
|
function get_mep_datetime($date,$type){
|
||||||
|
|
||||||
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec',12);
|
$user_set_format = mep_get_option( 'mep_event_time_format','general_setting_sec','wtss');
|
||||||
$date_format = get_option( 'date_format' );
|
$date_format = get_option( 'date_format' );
|
||||||
$time_format = get_option( 'time_format' );
|
$time_format = get_option( 'time_format' );
|
||||||
$wpdatesettings = $date_format.' '.$time_format;
|
$wpdatesettings = $date_format.' '.$time_format;
|
||||||
|
@ -2031,37 +2021,37 @@ function mep_get_all_tax_list($current_tax=null){
|
||||||
|
|
||||||
if($type == 'date'){
|
if($type == 'date'){
|
||||||
if($user_set_format == 'wtss'){
|
if($user_set_format == 'wtss'){
|
||||||
return date_i18n( $date_format, strtotime( $date ) );
|
return wp_date( $date_format, strtotime( $date ) );
|
||||||
}else{
|
}else{
|
||||||
return date_i18n( 'Y-m-d', strtotime( $date ) );
|
return wp_date( 'Y-m-d', strtotime( $date ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($type == 'date-time'){
|
if($type == 'date-time'){
|
||||||
if($user_set_format == 12){
|
if($user_set_format == 12){
|
||||||
return date_i18n( 'Y-m-d h:i A', strtotime( $date ) );
|
return wp_date( 'Y-m-d h:i A', strtotime( $date ) );
|
||||||
}elseif($user_set_format == 24){
|
}elseif($user_set_format == 24){
|
||||||
return date_i18n( 'Y-m-d H:i', strtotime( $date ) );
|
return wp_date( 'Y-m-d H:i', strtotime( $date ) );
|
||||||
}elseif($user_set_format == 'wtss'){
|
}elseif($user_set_format == 'wtss'){
|
||||||
return date_i18n( $wpdatesettings, strtotime( $date ) );
|
return wp_date( $wpdatesettings, strtotime( $date ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($type == 'date-text'){
|
if($type == 'date-text'){
|
||||||
if($user_set_format == 12){
|
if($user_set_format == 12){
|
||||||
return date_i18n( 'd,D M Y', strtotime( $date ) );
|
return wp_date( 'd,D M Y', strtotime( $date ) );
|
||||||
}elseif($user_set_format == 'wtss'){
|
}elseif($user_set_format == 'wtss'){
|
||||||
return date_i18n( $date_format, strtotime( $date ) );
|
return wp_date( $date_format, strtotime( $date ) );
|
||||||
}else{
|
}else{
|
||||||
return date_i18n( 'd, D M Y', strtotime( $date ) );
|
return wp_date( 'd, D M Y', strtotime( $date ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($type == 'date-time-text'){
|
if($type == 'date-time-text'){
|
||||||
if($user_set_format == 12){
|
if($user_set_format == 12){
|
||||||
return date_i18n( 'd, D M Y h:i A', strtotime( $date ) );
|
return wp_date( 'd, D M Y h:i A', strtotime( $date ) );
|
||||||
}elseif($user_set_format == 'wtss'){
|
}elseif($user_set_format == 'wtss'){
|
||||||
return date_i18n( $wpdatesettings, strtotime( $date ) );
|
return wp_date( $wpdatesettings, strtotime( $date ) );
|
||||||
}else{
|
}else{
|
||||||
return date_i18n( 'd, D M Y H:i', strtotime( $date ) );
|
return wp_date( 'd, D M Y H:i', strtotime( $date ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($type == 'time'){
|
if($type == 'time'){
|
||||||
|
@ -2349,10 +2339,8 @@ function mep_get_all_tax_list($current_tax=null){
|
||||||
|
|
||||||
|
|
||||||
function mage_array_strip($string, $allowed_tags = NULL){
|
function mage_array_strip($string, $allowed_tags = NULL){
|
||||||
if (is_array($string))
|
if (is_array($string)){
|
||||||
{
|
foreach ($string as $k => $v){
|
||||||
foreach ($string as $k => $v)
|
|
||||||
{
|
|
||||||
$string[$k] = mage_array_strip($v, $allowed_tags);
|
$string[$k] = mage_array_strip($v, $allowed_tags);
|
||||||
}
|
}
|
||||||
return $string;
|
return $string;
|
||||||
|
|
|
@ -230,12 +230,9 @@ function mep_ev_time()
|
||||||
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
|
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
|
||||||
$start_date = $event_meta['event_start_date'][0];
|
$start_date = $event_meta['event_start_date'][0];
|
||||||
$start_time = $event_meta['event_start_time'][0];
|
$start_time = $event_meta['event_start_time'][0];
|
||||||
|
|
||||||
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
|
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
|
||||||
|
|
||||||
$end_date = $event_meta['event_end_date'][0];
|
$end_date = $event_meta['event_end_date'][0];
|
||||||
$end_time = $event_meta['event_end_time'][0];
|
$end_time = $event_meta['event_end_time'][0];
|
||||||
|
|
||||||
$cn = 1;
|
$cn = 1;
|
||||||
$more_date = array($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
|
$more_date = array($event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0]);
|
||||||
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
|
$recurring = get_post_meta(get_the_id(), 'mep_enable_recurring', true) ? get_post_meta(get_the_id(), 'mep_enable_recurring', true) : 'no';
|
||||||
|
@ -276,9 +273,7 @@ function mep_ev_time_ticket($event_meta)
|
||||||
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
|
$start_datetime = $event_meta['event_start_date'][0] . ' ' . $event_meta['event_start_time'][0];
|
||||||
$start_date = $event_meta['event_start_date'][0];
|
$start_date = $event_meta['event_start_date'][0];
|
||||||
$start_time = $event_meta['event_start_time'][0];
|
$start_time = $event_meta['event_start_time'][0];
|
||||||
|
|
||||||
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
|
$end_datetime = $event_meta['event_end_date'][0] . ' ' . $event_meta['event_end_time'][0];
|
||||||
|
|
||||||
$end_date = $event_meta['event_end_date'][0];
|
$end_date = $event_meta['event_end_date'][0];
|
||||||
$end_time = $event_meta['event_end_time'][0];
|
$end_time = $event_meta['event_end_time'][0];
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ function mep_ev_ticket_type(){
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$("select[name='option_qty[]']").on('click', function () {
|
$("select[name='option_qty[]']").on('blur', function () {
|
||||||
mageErrorQty();
|
mageErrorQty();
|
||||||
});
|
});
|
||||||
function qtyPlace(target, value) {
|
function qtyPlace(target, value) {
|
||||||
|
@ -164,4 +164,3 @@ function mep_ev_ticket_type(){
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue