Esempio n. 1
0
 function get_user_events($userid)
 {
     global $eventon_rs;
     $rsvps = new WP_Query(array('posts_per_page' => -1, 'post_type' => 'evo-rsvp', 'meta_query' => array(array('key' => 'userid', 'value' => $userid)), 'meta_key' => 'last_name', 'orderby' => 'post_date'));
     $userRSVP = array();
     ob_start();
     if ($rsvps->have_posts()) {
         $datetime = new evo_datetime();
         $format = get_option('date_format');
         $currentTime = current_time('timestamp');
         while ($rsvps->have_posts()) {
             $rsvps->the_post();
             $_id = get_the_ID();
             $pmv = get_post_meta($_id);
             $checkin_status = !empty($pmv['status']) ? $pmv['status'][0] : 'check-in';
             // checkin status
             $e_id = !empty($pmv['e_id']) ? $pmv['e_id'][0] : false;
             if (!$e_id) {
                 continue;
             }
             $epmv = get_post_custom($e_id);
             $rsvp = !empty($pmv['rsvp']) ? $eventon_rs->frontend->get_rsvp_status($pmv['rsvp'][0]) : '';
             $RI = !empty($pmv['repeat_interval']) ? $pmv['repeat_interval'][0] : '';
             $time = $datetime->get_correct_event_repeat_time($epmv, $RI, $format);
             $link = get_permalink($e_id);
             $link = $link . (strpos($link, '?') ? '&ri=' . $RI : '?ri=' . $RI);
             $remaining_rsvp = $this->remaining_rsvp($epmv, $RI, $e_id);
             $p_classes = array();
             $p_classes[] = $time['start'] >= $currentTime ? '' : 'pastevent';
             echo "<p class='" . (count($p_classes) > 0 ? implode(' ', $p_classes) : '') . "'>RSVP ID: <b>#" . $_id . "</b> <span class='rsvpstatus'>{$rsvp}</span>\r\n\t\t\t\t\t\t<em class='checkin_status'>" . $checkin_status . "</em><br/>\r\n\t\t\t\t\t\t<em class='count'>" . (!empty($pmv['count']) ? $pmv['count'][0] : '-') . "</em>\r\n\t\t\t\t\t\t<em class='event_data'>EVENT: <a href='" . $link . "'>" . get_the_title($e_id) . "</a> <br/>TIME: " . date($format . ' h:i:a', $time['start']) . " - " . date($format . ' h:i:a', $time['end']) . "</em>\r\n\t\t\t\t\t\t";
             echo $time['start'] >= $currentTime ? "<span class='action' data-cap='" . (is_int($remaining_rsvp) ? $remaining_rsvp : 'na') . "' data-etitle='" . get_the_title($e_id) . "' data-precap='" . $this->is_per_rsvp_max_set($epmv) . "' data-uid='{$userid}' data-rsvpid='{$_id}' data-eid='{$e_id}' data-ri='{$RI}' ><a class='update_rsvp' data-val='chu'>UPDATE</a></span>" : '';
             echo "</p>";
         }
     }
     wp_reset_postdata();
     return ob_get_clean();
 }
Esempio n. 2
0
 function get_single_event_header($event_id, $repeat_interval = '')
 {
     $event_datetime = new evo_datetime();
     $pmv = get_post_custom($event_id);
     $adjusted_start_time = $event_datetime->get_int_correct_event_time($pmv, $repeat_interval);
     $formatted_time = eventon_get_formatted_time($adjusted_start_time);
     return get_eventon_cal_title_month($formatted_time['n'], $formatted_time['Y']);
 }
Esempio n. 3
0
    function ajde_evcal_show_box()
    {
        global $eventon, $ajde, $post;
        $evcal_opt1 = get_option('evcal_options_evcal_1');
        $evcal_opt2 = get_option('evcal_options_evcal_2');
        // Use nonce for verification
        wp_nonce_field(plugin_basename(__FILE__), 'evo_noncename');
        // The actual fields for data entry
        $p_id = get_the_ID();
        $ev_vals = get_post_custom($p_id);
        $evcal_allday = !empty($ev_vals["evcal_allday"]) ? $ev_vals["evcal_allday"][0] : null;
        $show_style_code = $evcal_allday == 'yes' ? "style='display:none'" : null;
        $select_a_arr = array('AM', 'PM');
        // array of all meta boxes
        $metabox_array = apply_filters('eventon_event_metaboxs', array(array('id' => 'ev_subtitle', 'name' => __('Event SubTitle', 'eventon'), 'variation' => 'customfield', 'hiddenVal' => '', 'iconURL' => 'fa-pencil', 'iconPOS' => '', 'type' => 'code', 'content' => '', 'slug' => 'ev_subtitle'), array('id' => 'ev_timedate', 'name' => __('Time and Date', 'eventon'), 'hiddenVal' => '', 'iconURL' => 'fa-clock-o', 'variation' => 'customfield', 'iconPOS' => '', 'type' => 'code', 'content' => '', 'slug' => 'ev_timedate'), array('id' => 'ev_location', 'name' => __('Location and Venue', 'eventon'), 'hiddenVal' => '', 'iconURL' => 'fa-map-marker', 'variation' => 'customfield', 'iconPOS' => '', 'type' => 'code', 'content' => '', 'slug' => 'ev_location', 'guide' => ''), array('id' => 'ev_organizer', 'name' => __('Organizer', 'eventon'), 'hiddenVal' => '', 'iconURL' => 'fa-microphone', 'variation' => 'customfield', 'iconPOS' => '', 'type' => 'code', 'content' => '', 'slug' => 'ev_organizer'), array('id' => 'ev_uint', 'name' => __('User Interaction for event click', 'eventon'), 'hiddenVal' => '', 'iconURL' => 'fa-street-view', 'variation' => 'customfield', 'iconPOS' => '', 'type' => 'code', 'content' => '', 'slug' => 'ev_uint', 'guide' => 'This define how you want the events to expand following a click on the eventTop by a user'), array('id' => 'ev_learnmore', 'name' => __('Learn more about event link', 'eventon'), 'hiddenVal' => '', 'iconURL' => 'fa-random', 'variation' => 'customfield', 'iconPOS' => '', 'type' => 'code', 'content' => '', 'slug' => 'ev_learnmore', 'guide' => 'This will create a learn more link in the event card. Make sure your links start with http://')));
        // Custom Meta fields for events
        $num = evo_calculate_cmd_count($evcal_opt1);
        for ($x = 1; $x <= $num; $x++) {
            if (!eventon_is_custom_meta_field_good($x)) {
                continue;
            }
            $fa_icon_class = $evcal_opt1['evcal__fai_00c' . $x];
            $visibility_type = !empty($evcal_opt1['evcal_ec_f' . $x . 'a4']) ? $evcal_opt1['evcal_ec_f' . $x . 'a4'] : 'all';
            $metabox_array[] = array('id' => 'evcal_ec_f' . $x . 'a1', 'variation' => 'customfield', 'name' => $evcal_opt1['evcal_ec_f' . $x . 'a1'], 'iconURL' => $fa_icon_class, 'iconPOS' => '', 'fieldtype' => 'custommetafield', 'x' => $x, 'visibility_type' => $visibility_type, 'type' => 'code', 'content' => '', 'slug' => 'evcal_ec_f' . $x . 'a1');
        }
        // combine array with custom fields
        // $metabox_array = (!empty($evMB_custom) && count($evMB_custom)>0)? array_merge($metabox_array , $evMB_custom): $metabox_array;
        $closedmeta = eventon_get_collapse_metaboxes($p_id);
        //print_r($closedmeta);
        ?>
	
		
		<div id='evo_mb' class='eventon_mb'>
			<input type='hidden' id='evo_collapse_meta_boxes' name='evo_collapse_meta_boxes' value=''/>
		<?php 
        // initial values
        $visibility_types = array('all' => __('Everyone', 'eventon'), 'admin' => __('Admin Only', 'eventon'), 'loggedin' => __('Loggedin Users Only', 'eventon'));
        // FOREACH metabox item
        foreach ($metabox_array as $mBOX) {
            // initials
            $icon_style = !empty($mBOX['iconURL']) ? 'background-image:url(' . $mBOX['iconURL'] . ')' : 'background-position:' . $mBOX['iconPOS'];
            $icon_class = !empty($mBOX['iconPOS']) ? 'evIcons' : 'evII';
            $guide = !empty($mBOX['guide']) ? $ajde->wp_admin->tooltips($mBOX['guide']) : null;
            $hiddenVal = !empty($mBOX['hiddenVal']) ? '<span class="hiddenVal">' . $mBOX['hiddenVal'] . '</span>' : null;
            // visibility type ONLY for custom meta fields
            $visibility_type = !empty($mBOX['visibility_type']) ? "<span class='visibility_type'>" . __('Visibility Type:', 'eventon') . ' ' . $visibility_types[$mBOX['visibility_type']] . '</span>' : false;
            $closed = !empty($closedmeta) && in_array($mBOX['id'], $closedmeta) ? 'closed' : null;
            ?>
			<div class='evomb_section' id='<?php 
            echo $mBOX['id'];
            ?>
'>			
				<div class='evomb_header'>
					<?php 
            // custom field with icons
            if (!empty($mBOX['variation']) && $mBOX['variation'] == 'customfield') {
                ?>
	
						<span class='evomb_icon <?php 
                echo $icon_class;
                ?>
'><i class='fa <?php 
                echo $mBOX['iconURL'];
                ?>
'></i></span>
						
					<?php 
            } else {
                ?>
						<span class='evomb_icon <?php 
                echo $icon_class;
                ?>
' style='<?php 
                echo $icon_style;
                ?>
'></span>
					<?php 
            }
            ?>
					<p><?php 
            echo $mBOX['name'];
            echo $hiddenVal;
            echo $guide;
            echo $visibility_type;
            ?>
</p>
				</div>
				<div class='evomb_body <?php 
            echo $closed;
            ?>
' box_id='<?php 
            echo $mBOX['id'];
            ?>
'>
				<?php 
            if (!empty($mBOX['content'])) {
                echo $mBOX['content'];
            } else {
                switch ($mBOX['id']) {
                    case 'ev_learnmore':
                        echo "<div class='evcal_data_block_style1'>\r\n\t\t\t\t\t\t\t<div class='evcal_db_data'>\r\n\t\t\t\t\t\t\t\t<input type='text' id='evcal_lmlink' name='evcal_lmlink' value='" . (!empty($ev_vals["evcal_lmlink"]) ? $ev_vals["evcal_lmlink"][0] : null) . "' style='width:100%'/><br/>";
                        ?>
								<span class='yesno_row evo'>
									<?php 
                        $openInNewWindow = !empty($ev_vals["evcal_lmlink_target"]) ? $ev_vals["evcal_lmlink_target"][0] : null;
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => 'evcal_lmlink_target', 'var' => $openInNewWindow, 'input' => true, 'label' => __('Open in New window', 'eventon')));
                        ?>
											
								</span>

							<?php 
                        echo "</div></div>";
                        break;
                    case 'ev_uint':
                        ?>
							<div class='evcal_data_block_style1'>
								<div class='evcal_db_data'>										
									<?php 
                        $exlink_option = !empty($ev_vals["_evcal_exlink_option"]) ? $ev_vals["_evcal_exlink_option"][0] : 1;
                        $exlink_target = !empty($ev_vals["_evcal_exlink_target"]) && $ev_vals["_evcal_exlink_target"][0] == 'yes' ? $ev_vals["_evcal_exlink_target"][0] : null;
                        ?>
										
									<input id='evcal_exlink_option' type='hidden' name='_evcal_exlink_option' value='<?php 
                        echo $exlink_option;
                        ?>
'/>
									
									<input id='evcal_exlink_target' type='hidden' name='_evcal_exlink_target' value='<?php 
                        echo $exlink_target;
                        ?>
'/>
									
									<?php 
                        $display_link_input = $exlink_option != '1' ? 'display:block' : 'display:none';
                        ?>
									<p <?php 
                        echo $exlink_option == '1' || $exlink_option == '3' ? "style='display:none'" : null;
                        ?>
 id='evo_new_window_io' class='<?php 
                        echo $exlink_target == 'yes' ? 'selected' : null;
                        ?>
'><span></span> <?php 
                        _e('Open in new window', 'eventon');
                        ?>
</p>
									
									<!-- external link field-->
									<input id='evcal_exlink' placeholder='<?php 
                        _e('Type the URL address', 'eventon');
                        ?>
' type='text' name='evcal_exlink' value='<?php 
                        echo !empty($ev_vals["evcal_exlink"]) ? $ev_vals["evcal_exlink"][0] : null;
                        ?>
' style='width:100%; <?php 
                        echo $display_link_input;
                        ?>
'/>
									
									<div class='evcal_db_uis'>
										<a link='no'  class='evcal_db_ui evcal_db_ui_0 <?php 
                        echo $exlink_option == 'X' ? 'selected' : null;
                        ?>
' title='<?php 
                        _e('Do nothing', 'eventon');
                        ?>
' value='X'></a>

										<a link='no'  class='evcal_db_ui evcal_db_ui_1 <?php 
                        echo $exlink_option == '1' ? 'selected' : null;
                        ?>
' title='<?php 
                        _e('Slide Down Event Card', 'eventon');
                        ?>
' value='1'></a>
										
										<!-- open as link-->
										<a link='yes' class='evcal_db_ui evcal_db_ui_2 <?php 
                        echo $exlink_option == '2' ? 'selected' : null;
                        ?>
' title='<?php 
                        _e('External Link', 'eventon');
                        ?>
' value='2'></a>	
										
										<!-- open as popup -->
										<a link='yes' class='evcal_db_ui evcal_db_ui_3 <?php 
                        echo $exlink_option == '3' ? ' selected' : null;
                        ?>
' title='<?php 
                        _e('Popup Window', 'eventon');
                        ?>
' value='3'></a>
										
										<!-- single event -->
										<a link='yes' linkval='<?php 
                        echo get_permalink($p_id);
                        ?>
' class='evcal_db_ui evcal_db_ui_4 <?php 
                        echo $exlink_option == '4' ? 'selected' : null;
                        ?>
' title='Open Event Page' value='4'></a>
										
										<?php 
                        // (-- addon --)
                        //if(has_action('evcal_ui_click_additions')){do_action('evcal_ui_click_additions');}
                        ?>
							
										<div class='clear'></div>
									</div>
								</div>
							</div>
							<?php 
                        break;
                    case 'ev_organizer':
                        ?>
							<div class='evcal_data_block_style1'>
								<p class='edb_icon evcal_edb_map'></p>
								<div class='evcal_db_data'>
									<div class='evcal_location_data_section'>		
									<p>
									<?php 
                        // organier terms for event post
                        $termMeta = $evo_organizer_tax_id = '';
                        $organizer_terms = wp_get_post_terms($p_id, 'event_organizer');
                        if ($organizer_terms && !is_wp_error($organizer_terms)) {
                            $evo_organizer_tax_id = $organizer_terms[0]->term_id;
                            $termMeta = evo_get_term_meta('event_organizer', $evo_organizer_tax_id, '', true);
                            //$termMeta = get_option( "taxonomy_$evo_organizer_tax_id");
                        }
                        // Get all available organizer terms
                        $terms = get_terms('event_organizer', array('hide_empty' => false));
                        if (count($terms) > 0) {
                            echo "<select id='evcal_organizer_field' name='evcal_organizer_name_select' class='evo_select_field' style='max-width:425px; margin-right:5px;'>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value='-'>" . __('Select a saved organizer', 'eventon') . "</option>";
                            foreach ($terms as $term) {
                                $ORG_imgid = $ORG_imgsrc = $data = '';
                                $t_id = $term->term_id;
                                //$term_meta = get_option( "taxonomy_$t_id" );
                                $term_meta = evo_get_term_meta('event_organizer', $t_id, '', true);
                                $__selected = $evo_organizer_tax_id == $t_id ? "selected='selected'" : null;
                                // organizer image
                                $ORG_imgid = !empty($term_meta['evo_org_img']) ? $term_meta['evo_org_img'] : null;
                                $img_src = !empty($ORG_imgid) ? wp_get_attachment_image_src($ORG_imgid, 'medium') : false;
                                $ORG_imgsrc = $img_src ? $img_src[0] : '';
                                // each term meta data for organizer taxonomy
                                foreach (array('tid' => $t_id, 'contact' => $this->termmeta($term_meta, 'evcal_org_contact'), 'img' => $this->termmeta($term_meta, 'evo_org_img'), 'imgsrc' => $ORG_imgsrc, 'exlink' => $this->termmeta($term_meta, 'evcal_org_exlink'), 'address' => $this->termmeta($term_meta, 'evcal_org_address'), 'exlinkopen' => $this->termmeta($term_meta, '_evocal_org_exlink_target')) as $key => $val) {
                                    $data .= 'data-' . $key . '="' . $val . '"';
                                }
                                echo "<option value='" . $term->name . "' {$data} {$__selected} >" . $term->name . "</option>";
                            }
                            echo "</select>";
                            echo "<span class='evoselectfield_data_view evo_btn' style='display:" . ($evo_organizer_tax_id ? 'inline-block' : 'none') . "'>" . __('Edit Organizer', 'eventon') . "</span>";
                            echo "<label for='evcal_organizer_field'>" . __('Choose already saved organizer or type new one below. NOTE: if you retype an existing organizer it will replace old information for that saved organizer', 'eventon') . "</label>";
                        }
                        ?>

									
									<input id='evo_organizer_tax_id' type='hidden' name='evo_organizer_tax_id' value='<?php 
                        echo $evo_organizer_tax_id;
                        ?>
'/>
									</p>
									
									<div class='evoselectfield_saved_data' style='display:<?php 
                        echo $evo_organizer_tax_id ? 'none' : '';
                        ?>
'>
										<p><input type='text' id='evcal_organizer_name' name='evcal_organizer' value="<?php 
                        echo !empty($organizer_terms[0]) ? $organizer_terms[0]->name : '';
                        ?>
" style='width:100%' placeholder='<?php 
                        _e('eg. Blue Light Band', 'eventon');
                        ?>
'/><label for='evcal_organizer'><?php 
                        _e('Event Organizer Name', 'eventon');
                        ?>
</label></p>
										<!-- organizer contact -->
										<p><input type='text' id='evcal_org_contact' name='evcal_org_contact' value="<?php 
                        echo $this->termmeta($termMeta, 'evcal_org_contact');
                        ?>
" style='width:100%' placeholder='<?php 
                        _e('eg. noone[at] thismail.com', 'eventon');
                        ?>
'/><label for='evcal_org_contact'><?php 
                        _e('(Optional) Organizer Contact Information', 'eventon');
                        ?>
</label></p>

										<!-- organizer address-->
										<p><input type='text' id='evcal_org_address' name='evcal_org_address' value="<?php 
                        echo $this->termmeta($termMeta, 'evcal_org_address');
                        ?>
" style='width:100%' placeholder='<?php 
                        _e('eg. 123 Everywhere St., Neverland AB', 'eventon');
                        ?>
'/><label for='evcal_org_address'><?php 
                        _e('(Optional) Organizer Address', 'eventon');
                        ?>
</label></p>

										<!-- organizer link -->
										<p><input type='text' id='evcal_org_exlink' name='evcal_org_exlink' value="<?php 
                        echo $this->termmeta($termMeta, 'evcal_org_exlink');
                        ?>
" style='width:100%' placeholder='<?php 
                        _e('eg. http://www.mysite.com/user', 'eventon');
                        ?>
'/>

											<span class='yesno_row evo'>
												<?php 
                        $_evocal_org_exlink_target = $this->termmeta($termMeta, '_evocal_org_exlink_target');
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => '_evocal_org_exlink_target', 'var' => $_evocal_org_exlink_target, 'input' => true, 'label' => __('Open organizer link in new window', 'eventon')));
                        ?>
											
											</span>

										<label for='evcal_org_exlink'><?php 
                        _e('Link to the organizers page', 'eventon');
                        ?>
</label></p>
										
										<!-- image -->
										<?php 
                        $org_img_id = $this->termmeta($termMeta, 'evo_org_img');
                        // image soruce array
                        $img_src = $org_img_id ? wp_get_attachment_image_src($org_img_id, 'medium') : null;
                        $org_img_src = !empty($img_src) ? $img_src[0] : null;
                        $__button_text = !empty($org_img_id) ? __('Remove Image', 'eventon') : __('Choose Image', 'eventon');
                        $__button_text_not = empty($org_img_id) ? __('Remove Image', 'eventon') : __('Choose Image', 'eventon');
                        $__button_class = !empty($org_img_id) ? 'removeimg' : 'chooseimg';
                        // /echo $loc_img_id.' '.$img_src.'66';
                        ?>
										<div class='evo_metafield_image' style='padding-top:10px'>
											<p>
												<input id='evo_org_img_id' class='evo_org_img custom_upload_image evo_meta_img' name="evo_org_img" type="hidden" value="<?php 
                        echo $org_img_id ? $org_img_id : null;
                        ?>
" /> 
					                    		<input class="custom_upload_image_button button <?php 
                        echo $__button_class;
                        ?>
" data-txt='<?php 
                        echo $__button_text_not;
                        ?>
' type="button" value="<?php 
                        echo $__button_text;
                        ?>
" /><br/>
					                    		<span class='evo_org_image_src image_src'>
					                    			<img src='<?php 
                        echo $org_img_src;
                        ?>
' style='<?php 
                        echo !empty($org_img_id) ? '' : 'display:none;';
                        ?>
 margin-top:8px'/>
					                    		</span>
					                    		<label><?php 
                        _e('Event Organizer Image', 'eventon');
                        ?>
 (<?php 
                        _e('Recommended Resolution 80x80px', 'eventon');
                        ?>
)</label>
					                    	</p>
					                    </div>

				                    </div> <!-- evoselectfield_saved_data-->

				                    </div><!--.evcal_location_data_section-->
									
									<!-- yea no field - hide organizer field from eventcard -->
									<p class='yesno_row evo'>
										<?php 
                        $evo_evcrd_field_org = !empty($ev_vals["evo_evcrd_field_org"]) ? $ev_vals["evo_evcrd_field_org"][0] : null;
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => 'evo_org_field_ec', 'var' => $evo_evcrd_field_org));
                        ?>
										
										<input type='hidden' name='evo_evcrd_field_org' value="<?php 
                        echo !empty($ev_vals["evo_evcrd_field_org"]) && $ev_vals["evo_evcrd_field_org"][0] == 'yes' ? 'yes' : 'no';
                        ?>
"/>
										<label for='evo_evcrd_field_org'><?php 
                        _e('Hide Organizer field from EventCard', 'eventon');
                        ?>
</label>
									</p>
									<p style='clear:both'></p>
								</div>
							</div>
							<?php 
                        break;
                    case 'ev_location':
                        // $opt = get_option( "evo_tax_meta");
                        // print_r($opt);
                        ?>
							<div class='evcal_data_block_style1'>
								<p class='edb_icon evcal_edb_map'></p>
								<div class='evcal_db_data'>
									<div class='evcal_location_data_section'>	
									<p>
									<?php 
                        //$opt = get_option( "evo_tax_meta");
                        //print_r($opt);
                        // location terms for event post
                        $evo_location_tax_id = $termMeta = $evoLocSlug = '';
                        $location_terms = wp_get_post_terms($p_id, 'event_location');
                        if ($location_terms && !is_wp_error($location_terms)) {
                            $evo_location_tax_id = $location_terms[0]->term_id;
                            $evoLocSlug = $location_terms[0]->slug;
                            $termMeta = evo_get_term_meta('event_location', $evo_location_tax_id, '', true);
                        }
                        // GET all available location terms
                        $terms = get_terms('event_location', array('hide_empty' => false));
                        if (count($terms) > 0) {
                            echo "<select id='evcal_location_field' name='evcal_location_name_select' class='evo_select_field' style='max-width:400px; margin-right:5px'>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value='-'>" . __('Select a saved location', 'eventon') . "</option>";
                            foreach ($terms as $term) {
                                $loc_img_src = $loc_img_id = $data = '';
                                $t_id = $term->term_id;
                                //$term_meta = get_option( "taxonomy_$t_id" );
                                $term_meta = evo_get_term_meta('event_location', $t_id, '', true);
                                $__selected = $evo_location_tax_id == $t_id ? "selected='selected'" : null;
                                // location image
                                $loc_img_id = $this->termmeta($term_meta, 'evo_loc_img');
                                $img_src = !empty($loc_img_id) ? wp_get_attachment_image_src($loc_img_id, 'medium') : false;
                                $loc_img_src = $img_src ? $img_src[0] : '';
                                $locationName = str_replace('"', "'", $term->name);
                                // option data fields
                                foreach (array('tid' => $t_id, 'address' => $this->termmeta($term_meta, 'location_address'), 'lat' => $this->termmeta($term_meta, 'location_lat'), 'lon' => $this->termmeta($term_meta, 'location_lon'), 'loc_img_id' => $loc_img_id, 'loc_img_src' => $loc_img_src, 'link' => $this->termmeta($term_meta, 'evcal_location_link')) as $key => $var) {
                                    $data .= 'data-' . $key . '="' . $var . '"';
                                }
                                echo "<option value='" . $locationName . "' {$data} {$__selected} >" . $term->name . "</option>";
                            }
                            echo "</select>";
                            echo "<span class='evoselectfield_data_view evo_btn' style='display:" . ($evo_location_tax_id ? '' : 'none') . "'>" . __('Edit Location', 'eventon') . "</span>";
                            echo "<label for='evcal_location_field'>" . __('Choose already saved location or type new one below', 'eventon') . "</label>";
                        }
                        ?>
									<input id='evo_location_tax' type='hidden' name='evo_location_tax_id' value='<?php 
                        echo $evo_location_tax_id;
                        ?>
'/>
									<input type='hidden' name='evo_location_tax_id_old' value='<?php 
                        echo $evo_location_tax_id;
                        ?>
'/>
									<input id='evo_location_slug' type='hidden' name='evo_location_tax_slug' value='<?php 
                        echo $evoLocSlug;
                        ?>
'/>
									</p>

									<div class='evoselectfield_saved_data' style='display:<?php 
                        echo $evo_location_tax_id ? 'none' : '';
                        ?>
'>
									<?php 
                        $locationNAME = !empty($location_terms[0]) ? $location_terms[0]->name : (!empty($ev_vals["evcal_location_name"]) ? $ev_vals["evcal_location_name"][0] : '');
                        ?>
									<p><input type='text' id='evcal_location_name' name='evcal_location_name' value="<?php 
                        echo $locationNAME;
                        ?>
" style='width:100%' placeholder='<?php 
                        _e('eg. Irving City Park', 'eventon');
                        ?>
'/><label for='evcal_location_name'><?php 
                        _e('Event Location Name', 'eventon');
                        ?>
</label></p>

									<?php 
                        $locationADD = !empty($termMeta['location_address']) ? stripslashes($termMeta['location_address']) : (!empty($ev_vals["evcal_location"]) ? $ev_vals["evcal_location"][0] : '');
                        ?>
									<p><input type='text' id='evcal_location' name='evcal_location' value="<?php 
                        echo $locationADD;
                        ?>
" style='width:100%' placeholder='<?php 
                        _e('eg. 12 Rue de Rivoli, Paris', 'eventon');
                        ?>
'/><label for='evcal_location'><?php 
                        _e('Event Location Address', 'eventon');
                        ?>
</label></p>
												
									<!-- location lat lon -->
									<p><input type='text' id='evcal_lat' class='evcal_latlon' name='evcal_lat' value='<?php 
                        echo $this->termmeta($termMeta, 'location_lat');
                        ?>
' placeholder='<?php 
                        _e('Latitude', 'eventon');
                        ?>
' title='<?php 
                        _e('Latitude', 'eventon');
                        ?>
'/>
									<input type='text' id='evcal_lon' class='evcal_latlon' name='evcal_lon' value='<?php 
                        echo $this->termmeta($termMeta, 'location_lon');
                        ?>
' placeholder='<?php 
                        _e('Longitude', 'eventon');
                        ?>
' title='<?php 
                        _e('Longitude', 'eventon');
                        ?>
'/></p>
									<p><i><?php 
                        _e('<b>NOTE:</b> LatLong will be auto generated for address provided for faster google map drawing. If location marker is not correct feel free to edit the LatLong values to correct location marker coordinates above. <br/>Location address field is <b>REQUIRED</b> for this to work.', 'eventon');
                        ?>
 <br/><a style='color:#B3DDEC' href='http://itouchmap.com/latlong.html' target='_blank'><?php 
                        _e('Find LanLat for address', 'eventon');
                        ?>
</a></i></p>

									<!-- Location link -->
									<p><input type='text' id='evcal_location_link' name='evcal_location_link' value="<?php 
                        echo $this->termmeta($termMeta, 'evcal_location_link');
                        ?>
" style='width:100%' placeholder='<?php 
                        _e('eg. http://www.locationlink.com', 'eventon');
                        ?>
'/><label for='evcal_location_link'><?php 
                        _e('Event Location Link', 'eventon');
                        ?>
</label></p>

									<!-- image -->
										<?php 
                        $loc_img_id = $this->termmeta($termMeta, 'evo_loc_img');
                        // image soruce array
                        $img_src = $loc_img_id ? wp_get_attachment_image_src($loc_img_id, 'medium') : null;
                        $loc_img_src = !empty($img_src) ? $img_src[0] : null;
                        $__button_text = !empty($loc_img_id) ? __('Remove Image', 'eventon') : __('Choose Image', 'eventon');
                        $__button_text_not = empty($loc_img_id) ? __('Remove Image', 'eventon') : __('Choose Image', 'eventon');
                        $__button_class = !empty($loc_img_id) ? 'removeimg' : 'chooseimg';
                        // /echo $loc_img_id.' '.$img_src.'66';
                        ?>
										<div class='evo_metafield_image' style='padding-top:10px'>					
											<p >
												<input id='evo_loc_img_id' class='evo_loc_img custom_upload_image evo_meta_img' name="evo_loc_img" type="hidden" value="<?php 
                        echo $loc_img_id ? $loc_img_id : null;
                        ?>
" /> 
					                    		<input class="custom_upload_image_button button <?php 
                        echo $__button_class;
                        ?>
" data-txt='<?php 
                        echo $__button_text_not;
                        ?>
' type="button" value="<?php 
                        echo $__button_text;
                        ?>
" /><br/>
					                    		<span class='evo_loc_image_src image_src'>
					                    			<img src='<?php 
                        echo $loc_img_src;
                        ?>
' style='<?php 
                        echo !empty($loc_img_id) ? '' : 'display:none';
                        ?>
'/>
					                    		</span>
					                    		<label><?php 
                        _e('Event Location Image', 'eventon');
                        ?>
</label>
					                    	</p>
					                    </div>
									</div><!--evoselectfield_saved_data-->
									</div><!--.evcal_location_data_section-->

									<!-- HIDE Location name from eventcard -->
										<p class='yesno_row evo'>
											<?php 
                        $locationNM_val = !empty($ev_vals["evcal_hide_locname"]) ? $ev_vals["evcal_hide_locname"][0] : 'no';
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => 'evo_locname', 'var' => $locationNM_val));
                        ?>
											
											<input type='hidden' name='evcal_hide_locname' value="<?php 
                        echo !empty($ev_vals["evcal_hide_locname"]) && $ev_vals["evcal_hide_locname"][0] == 'yes' ? 'yes' : 'no';
                        ?>
"/>
											<label for='evcal_hide_locname'><?php 
                        _e('Hide Location Name from Event Card', 'eventon');
                        ?>
</label>
										</p>
										<p style='clear:both'></p>

									<!-- HIDE google map option -->
										<p class='yesno_row evo'>
											<?php 
                        $location_val = !empty($ev_vals["evcal_gmap_gen"]) ? $ev_vals["evcal_gmap_gen"][0] : 'yes';
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => 'evo_genGmap', 'var' => $location_val));
                        ?>
											
											<input type='hidden' name='evcal_gmap_gen' value="<?php 
                        echo !empty($ev_vals["evcal_gmap_gen"]) && $ev_vals["evcal_gmap_gen"][0] == 'yes' ? 'yes' : (empty($ev_vals["evcal_gmap_gen"]) ? 'yes' : 'no');
                        ?>
"/>
											<label for='evcal_gmap_gen'><?php 
                        _e('Generate Google Map from the address', 'eventon');
                        ?>
</label>
										</p>
										<p style='clear:both'></p>

									<!-- Show location name over image -->
										<p class='yesno_row evo'>
											<?php 
                        $evcal_name_over_img = !empty($ev_vals["evcal_name_over_img"]) ? $ev_vals["evcal_name_over_img"][0] : 'no';
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => 'evcal_name_over_img', 'var' => $evcal_name_over_img));
                        ?>
											
											<input type='hidden' name='evcal_name_over_img' value="<?php 
                        echo !empty($ev_vals["evcal_name_over_img"]) && $ev_vals["evcal_name_over_img"][0] == 'yes' ? 'yes' : 'no';
                        ?>
"/>
											<label for='evcal_name_over_img'><?php 
                        _e('Show location name & address over location image (If location image exist)', 'eventon');
                        ?>
</label>
										</p><p style='clear:both'></p>
								</div>
							</div>
							<?php 
                        break;
                    case 'ev_timedate':
                        // Minute increment
                        $minIncre = !empty($evcal_opt1['evo_minute_increment']) ? (int) $evcal_opt1['evo_minute_increment'] : 60;
                        $minADJ = 60 / $minIncre;
                        // --- TIME variations
                        //$evcal_date_format = eventon_get_timeNdate_format($evcal_opt1);
                        $wp_time_format = get_option('time_format');
                        $hr24 = strpos($wp_time_format, 'H') !== false || strpos($wp_time_format, 'G') !== false ? true : false;
                        $evcal_date_format = array('yy/mm/dd', 'Y/m/d', $hr24);
                        $time_hour_span = $evcal_date_format[2] ? 25 : 13;
                        // GET DATE and TIME values
                        $_START = !empty($ev_vals['evcal_srow'][0]) ? eventon_get_editevent_kaalaya($ev_vals['evcal_srow'][0], $evcal_date_format[1], $evcal_date_format[2]) : false;
                        $_END = !empty($ev_vals['evcal_erow'][0]) ? eventon_get_editevent_kaalaya($ev_vals['evcal_erow'][0], $evcal_date_format[1], $evcal_date_format[2]) : false;
                        // date and time formats used in edit page
                        $used_js_dateFormat = $evcal_date_format[0];
                        $used_dateFormat = $evcal_date_format[1];
                        $used_timeFormat = $evcal_date_format[2] ? '24h' : '12h';
                        ob_start();
                        ?>
							<!-- date and time formats to use -->
							<input type='hidden' name='_evo_date_format' value='<?php 
                        echo $used_dateFormat;
                        ?>
'/>
							<input type='hidden' name='_evo_time_format' value='<?php 
                        echo $used_timeFormat;
                        ?>
'/>	
							<div id='evcal_dates' date_format='<?php 
                        echo $used_js_dateFormat;
                        ?>
'>	
								<p class='yesno_row evo fcw'>
									<?php 
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => 'evcal_allday_yn_btn', 'var' => $evcal_allday, 'attr' => array('allday_switch' => '1')));
                        ?>
			
									<input type='hidden' name='evcal_allday' value="<?php 
                        echo $evcal_allday == 'yes' ? 'yes' : 'no';
                        ?>
"/>
									<label for='evcal_allday_yn_btn'><?php 
                        _e('All Day Event', 'eventon');
                        ?>
</label>
								</p><p style='clear:both'></p>
								
								<!-- START TIME-->
								<div class='evo_start_event evo_datetimes'>
									<div class='evo_date'>
										<p id='evcal_start_date_label'><?php 
                        _e('Event Start Date', 'eventon');
                        ?>
</p>
										<input id='evo_dp_from' class='evcal_data_picker datapicker_on' type='text' id='evcal_start_date' name='evcal_start_date' value='<?php 
                        echo $_START ? $_START[0] : null;
                        ?>
' placeholder='<?php 
                        echo $used_dateFormat;
                        ?>
'/>					
										<span><?php 
                        _e('Select a Date', 'eventon');
                        ?>
</span>
									</div>					
									<div class='evcal_date_time switch_for_evsdate evcal_time_selector' <?php 
                        echo $show_style_code;
                        ?>
>
										<div class='evcal_select'>
											<select id='evcal_start_time_hour' class='evcal_date_select' name='evcal_start_time_hour'>
												<?php 
                        //echo "<option value=''>--</option>";
                        $start_time_h = $_START ? $_START[1] : null;
                        for ($x = 1; $x < $time_hour_span; $x++) {
                            $y = $time_hour_span == 25 ? sprintf("%02d", $x - 1) : $x;
                            echo "<option value='{$y}'" . ($start_time_h == $y ? 'selected="selected"' : '') . ">{$y}</option>";
                        }
                        ?>
											</select>
										</div><p style='display:inline; font-size:24px;padding:4px 2px'>:</p>
										<div class='evcal_select'>						
											<select id='evcal_start_time_min' class='evcal_date_select' name='evcal_start_time_min'>
												<?php 
                        //echo "<option value=''>--</option>";
                        $start_time_m = $_START ? $_START[2] : null;
                        for ($x = 0; $x < $minIncre; $x++) {
                            $min = $minADJ * $x;
                            $min = $min < 10 ? '0' . $min : $min;
                            echo "<option value='{$min}'" . ($start_time_m == $min ? 'selected="selected"' : '') . ">{$min}</option>";
                        }
                        ?>
											</select>
										</div>
										
										<?php 
                        if (!$evcal_date_format[2]) {
                            ?>
										<div class='evcal_select evcal_ampm_sel'>
											<select name='evcal_st_ampm' id='evcal_st_ampm' >
												<?php 
                            $evcal_st_ampm = $_START ? $_START[3] : null;
                            foreach ($select_a_arr as $sar) {
                                echo "<option value='" . $sar . "' " . ($evcal_st_ampm == $sar ? 'selected="selected"' : '') . ">" . $sar . "</option>";
                            }
                            ?>
								
											</select>
										</div>	
										<?php 
                        }
                        ?>
										<br/>
										<span><?php 
                        _e('Select a Time', 'eventon');
                        ?>
</span>
									</div><div class='clear'></div>
								</div>
								
								<!-- END TIME -->
								<?php 
                        $evo_hide_endtime = !empty($ev_vals["evo_hide_endtime"]) ? $ev_vals["evo_hide_endtime"][0] : null;
                        ?>
								<div class='evo_end_event evo_datetimes switch_for_evsdate'>
									<div class='evo_enddate_selection' style='<?php 
                        echo $evo_hide_endtime == 'yes' ? 'opacity:0.5' : null;
                        ?>
'>
									<div class='evo_date'>
										<p><?php 
                        _e('Event End Date', 'eventon');
                        ?>
</p>
										<input id='evo_dp_to' class='evcal_data_picker datapicker_on' type='text' id='evcal_end_date' name='evcal_end_date' value='<?php 
                        echo $_END ? $_END[0] : null;
                        ?>
' placeholder='<?php 
                        echo $used_dateFormat;
                        ?>
'/>					
										<span><?php 
                        _e('Select a Date', 'eventon');
                        ?>
</span>					
									</div>
									<div class='evcal_date_time evcal_time_selector' <?php 
                        echo $show_style_code;
                        ?>
>
										<div class='evcal_select'>
											<select class='evcal_date_select' name='evcal_end_time_hour'>
												<?php 
                        //echo "<option value=''>--</option>";
                        $end_time_h = $_END ? $_END[1] : null;
                        for ($x = 1; $x < $time_hour_span; $x++) {
                            $y = $time_hour_span == 25 ? sprintf("%02d", $x - 1) : $x;
                            echo "<option value='{$y}'" . ($end_time_h == $y ? 'selected="selected"' : '') . ">{$y}</option>";
                        }
                        ?>
											</select>
										</div><p style='display:inline; font-size:24px;padding:4px'>:</p>
										<div class='evcal_select'>
											<select class='evcal_date_select' name='evcal_end_time_min'>
												<?php 
                        //echo "<option value=''>--</option>";
                        $end_time_m = $_END[2] ? $_END[2] : null;
                        for ($x = 0; $x < $minIncre; $x++) {
                            $min = $minADJ * $x;
                            $min = $min < 10 ? '0' . $min : $min;
                            echo "<option value='{$min}'" . ($end_time_m == $min ? 'selected="selected"' : '') . ">{$min}</option>";
                        }
                        ?>
											</select>
										</div>					
										<?php 
                        if (!$evcal_date_format[2]) {
                            ?>
										<div class='evcal_select evcal_ampm_sel'>
											<select name='evcal_et_ampm'>
												<?php 
                            $evcal_et_ampm = $_END ? $_END[3] : null;
                            foreach ($select_a_arr as $sar) {
                                echo "<option value='" . $sar . "' " . ($evcal_et_ampm == $sar ? 'selected="selected"' : '') . ">" . $sar . "</option>";
                            }
                            ?>
								
											</select>
										</div>
										<?php 
                        }
                        ?>
										<br/>
										<span><?php 
                        _e('Select the Time', 'eventon');
                        ?>
</span>
									</div><div class='clear'></div>
								</div>
							</div>

							<!-- how time look on frontend -->
							<?php 
                        if (!empty($ev_vals['evcal_srow'])) {
                            $dtime = new evo_datetime();
                            $val = $dtime->get_formatted_smart_time_piece($ev_vals['evcal_srow'][0], $ev_vals);
                            echo "<p class='evo_datetime_frontendview' style='margin-top:10px'>" . __('Default Date/time format:', 'eventon') . ' ' . $val . "</p>";
                        }
                        ?>

								<!-- timezone value -->				
									<p style='padding-top:10px'><input type='text' name='evo_event_timezone' value='<?php 
                        echo !empty($ev_vals["evo_event_timezone"]) ? $ev_vals["evo_event_timezone"][0] : null;
                        ?>
' placeholder='<?php 
                        _e('Timezone text eg.PST', 'eventon');
                        ?>
'/><label for=""><?php 
                        _e('Event timezone', 'eventon');
                        $ajde->wp_admin->tooltips(__('Timezone text you type in here ex. PST will show next to event time on calendar.', 'eventon'), '', true);
                        ?>
</label></p>
									
									<!-- end time yes/no option -->					
									<p class='yesno_row evo '>
										<?php 
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => 'evo_endtime', 'var' => $evo_hide_endtime, 'attr' => array('afterstatement' => 'evo_span_hidden_end')));
                        ?>
										
										<input type='hidden' name='evo_hide_endtime' value="<?php 
                        echo $evo_hide_endtime == 'yes' ? 'yes' : 'no';
                        ?>
"/>
										<label for='evo_hide_endtime'><?php 
                        _e('Hide End Time from calendar', 'eventon');
                        ?>
</label>
									</p>
									<?php 
                        // span event to hidden end time
                        $evo_span_hidden_end = !empty($ev_vals["evo_span_hidden_end"]) ? $ev_vals["evo_span_hidden_end"][0] : null;
                        $evo_span_hidd_display = $evo_hide_endtime && $evo_hide_endtime == 'yes' ? 'block' : 'none';
                        ?>
									<p class='yesno_row evo ' id='evo_span_hidden_end' style='display:<?php 
                        echo $evo_span_hidd_display;
                        ?>
'>
										<?php 
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => 'evo_span_hidden_end', 'var' => $evo_span_hidden_end));
                        ?>
										
										<input type='hidden' name='evo_span_hidden_end' value="<?php 
                        echo $evo_span_hidden_end == 'yes' ? 'yes' : 'no';
                        ?>
"/>
										<label for='evo_span_hidden_end'><?php 
                        _e('Span the event until hidden end time', 'eventon');
                        $ajde->wp_admin->tooltips(__('If event end time goes beyond start time +  and you want the event to show in the calendar until end time expire, select this.', 'eventon'), '', true);
                        ?>
</label>
									</p>

									<?php 
                        // month long event
                        $_evo_month_long = !empty($ev_vals["_evo_month_long"]) ? $ev_vals["_evo_month_long"][0] : null;
                        $_event_month = !empty($ev_vals["_event_month"]) ? $ev_vals["_event_month"][0] : null;
                        ?>
									<p class='yesno_row evo ' id='_evo_month_long' >
										<?php 
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => '_evo_month_long', 'var' => $_evo_month_long));
                        ?>
										
										<input type='hidden' name='_evo_month_long' value="<?php 
                        echo $_evo_month_long == 'yes' ? 'yes' : 'no';
                        ?>
"/>					
										<label for='_evo_month_long'><?php 
                        _e('Show this event for the entire start event Month', 'eventon');
                        $ajde->wp_admin->tooltips(__('This will show this event for the entire month that the event start date is set to.', 'eventon'), '', true);
                        ?>
</label>
									</p>
									<input id='evo_event_month' type='hidden' name='_event_month' value="<?php 
                        echo $_event_month;
                        ?>
"/><p style='clear:both'></p>
									

									<?php 
                        // Year long event
                        $evo_year_long = !empty($ev_vals["evo_year_long"]) ? $ev_vals["evo_year_long"][0] : null;
                        $event_year = !empty($ev_vals["event_year"]) ? $ev_vals["event_year"][0] : null;
                        ?>
									<p class='yesno_row evo ' id='evo_year_long' >
										<?php 
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => 'evo_year_long', 'var' => $evo_year_long));
                        ?>
										
										<input type='hidden' name='evo_year_long' value="<?php 
                        echo $evo_year_long == 'yes' ? 'yes' : 'no';
                        ?>
"/>					
										<label for='evo_year_long'><?php 
                        _e('Show this event for the entire start event Year', 'eventon');
                        $ajde->wp_admin->tooltips(__('This will show this event on every month of the year. The year will be based off the start date you choose above. If year long is set, month long will be overridden.', 'eventon'), '', true);
                        ?>
</label>
									</p>
									<input id='evo_event_year' type='hidden' name='event_year' value="<?php 
                        echo $event_year;
                        ?>
"/><p style='clear:both'></p>

								</div>
								<div style='clear:both'></div>			
								<?php 
                        // Recurring events
                        $evcal_repeat = !empty($ev_vals["evcal_repeat"]) ? $ev_vals["evcal_repeat"][0] : null;
                        ?>
								<div id='evcal_rep' class='evd'>
									<div class='evcalr_1'>
										<p class='yesno_row evo '>
											<?php 
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => 'evd_repeat', 'var' => $evcal_repeat, 'attr' => array('afterstatement' => 'evo_editevent_repeatevents')));
                        ?>
						
											<input type='hidden' name='evcal_repeat' value="<?php 
                        echo $evcal_repeat == 'yes' ? 'yes' : 'no';
                        ?>
"/>
											<label for='evcal_repeat'><?php 
                        _e('Repeating event', 'eventon');
                        ?>
</label>
										</p><p style='clear:both'></p>
									</div>
									<p class='eventon_ev_post_set_line'></p>
									<?php 
                        // initial values
                        $display = !empty($ev_vals["evcal_repeat"]) && $evcal_repeat == 'yes' ? '' : 'none';
                        // repeat frequency array
                        $repeat_freq = apply_filters('evo_repeat_intervals', array('daily' => 'days', 'weekly' => 'weeks', 'monthly' => 'months', 'yearly' => 'years', 'custom' => 'custom'));
                        $evcal_rep_gap = !empty($ev_vals['evcal_rep_gap']) ? $ev_vals['evcal_rep_gap'][0] : 1;
                        $freq = !empty($ev_vals["evcal_rep_freq"]) ? $repeat_freq[$ev_vals["evcal_rep_freq"][0]] : null;
                        ?>
									<div id='evo_editevent_repeatevents' class='evcalr_2 evo_repeat_options' style='display:<?php 
                        echo $display;
                        ?>
'>
										
										<!-- REPEAT SERIES -->
										<div class='repeat_series'>
											<p class='yesno_row evo '>
												<?php 
                        $_evcal_rep_series = evo_meta($ev_vals, '_evcal_rep_series');
                        $display = evo_meta_yesno($ev_vals, '_evcal_rep_series', 'yes', '', 'none');
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => 'evo_repeat', 'var' => $_evcal_rep_series));
                        ?>
						
												<input type='hidden' name='_evcal_rep_series' value="<?php 
                        echo $_evcal_rep_series == 'yes' ? 'yes' : 'no';
                        ?>
"/>
												<label for='_evcal_rep_series'><?php 
                        _e('Show other future repeating instances of this event on event card', 'eventon');
                        ?>
</label>
											</p><p style='clear:both'></p>
										</div>

										<p class='repeat_type evcalr_2_freq evcalr_2_p'><span class='evo_form_label'><?php 
                        _e('Event Repeat Type', 'eventon');
                        ?>
:</span> <select id='evcal_rep_freq' name='evcal_rep_freq'>
										<?php 
                        $evcal_rep_freq = !empty($ev_vals['evcal_rep_freq']) ? $ev_vals['evcal_rep_freq'][0] : null;
                        foreach ($repeat_freq as $refv => $ref) {
                            echo "<option field='" . $ref . "' value='" . $refv . "' " . ($evcal_rep_freq == $refv ? 'selected="selected"' : '') . ">" . $refv . "</option>";
                        }
                        ?>
</select></p><!--.repeat_type-->
										
										<div class='evo_preset_repeat_settings' style='display:<?php 
                        echo !empty($ev_vals['evcal_rep_freq']) && $ev_vals['evcal_rep_freq'][0] == 'custom' ? 'none' : 'block';
                        ?>
'>		
											<p class='gap evcalr_2_rep evcalr_2_p'><span class='evo_form_label'><?php 
                        _e('Gap between repeats', 'eventon');
                        ?>
:</span>
											<input type='number' name='evcal_rep_gap' min='1' max='100' value='<?php 
                        echo $evcal_rep_gap;
                        ?>
' placeholder='1'/>	 <span id='evcal_re'><?php 
                        echo $freq;
                        ?>
</span></p>
										<?php 
                        // repeat number
                        $evcal_rep_num = !empty($ev_vals['evcal_rep_num']) ? $ev_vals['evcal_rep_num'][0] : 1;
                        // repeat by
                        $evp_repeat_rb = !empty($ev_vals['evp_repeat_rb']) ? $ev_vals['evp_repeat_rb'][0] : null;
                        $evo_rep_WK = !empty($ev_vals['evo_rep_WK']) ? unserialize($ev_vals['evo_rep_WK'][0]) : array();
                        $evo_repeat_wom = !empty($ev_vals['evo_repeat_wom']) ? $ev_vals['evo_repeat_wom'][0] : null;
                        // display none section
                        $__display_none_1 = !empty($ev_vals['evcal_rep_freq']) && $ev_vals['evcal_rep_freq'][0] == 'monthly' ? 'block' : 'none';
                        $__display_none_2 = $__display_none_1 == 'block' && !empty($ev_vals['evp_repeat_rb']) && $ev_vals['evp_repeat_rb'][0] == 'dow' ? 'block' : 'none';
                        ?>
										<?php 
                        // monthly only
                        ?>
											<p class='repeat_by evcalr_2_p evo_rep_month' style='display:<?php 
                        echo $__display_none_1;
                        ?>
'>
												<span class='evo_form_label'><?php 
                        _e('Repeat by', 'eventon');
                        ?>
:</span>
												<select id='evo_rep_by' name='evp_repeat_rb'>
													<option value='dom' <?php 
                        echo 'dom' == $evp_repeat_rb ? 'selected="selected"' : null;
                        ?>
><?php 
                        _e('Day of the month', 'eventon');
                        ?>
</option>
													<option value='dow' <?php 
                        echo 'dow' == $evp_repeat_rb ? 'selected="selected"' : null;
                        ?>
><?php 
                        _e('Day of the week', 'eventon');
                        ?>
</option>
												</select>
											</p>
											<p class='evo_days_list evo_rep_month_2'  style='display:<?php 
                        echo $__display_none_2;
                        ?>
'>
												<span class='evo_form_label'><?php 
                        _e('Repeat on selected days', 'eventon');
                        ?>
: </span>
												<?php 
                        $days = array('S', 'M', 'T', 'W', 'T', 'F', 'S');
                        for ($x = 0; $x < 7; $x++) {
                            echo "<em><input type='checkbox' name='evo_rep_WK[]' value='{$x}' " . (in_array($x, $evo_rep_WK) ? 'checked="checked"' : null) . "><label>" . $days[$x] . "</label></em>";
                        }
                        ?>
											</p>
											<p class='evcalr_2_p evo_rep_month_2'  style='display:<?php 
                        echo $__display_none_2;
                        ?>
'>
												<span class='evo_form_label'><?php 
                        _e('Week of month to repeat', 'eventon');
                        ?>
: </span>
												<select id='evo_wom' name='evo_repeat_wom'>
													<?php 
                        // week of the month for repeat
                        echo "<option value='1' " . ($evo_repeat_wom == 1 ? 'selected="selected"' : null) . ">" . __('First', 'eventon') . "</option>";
                        echo "<option value='2' " . ($evo_repeat_wom == 2 ? 'selected="selected"' : null) . ">" . __('Second', 'eventon') . "</option>";
                        echo "<option value='3' " . ($evo_repeat_wom == 3 ? 'selected="selected"' : null) . ">" . __('Third', 'eventon') . "</option>";
                        echo "<option value='4' " . ($evo_repeat_wom == 4 ? 'selected="selected"' : null) . ">" . __('Fourth', 'eventon') . "</option>";
                        echo "<option value='5' " . ($evo_repeat_wom == 5 ? 'selected="selected"' : null) . ">" . __('Fifth', 'eventon') . "</option>";
                        echo "<option value='-1' " . ($evo_repeat_wom == -1 ? 'selected="selected"' : null) . ">" . __('Last', 'eventon') . "</option>";
                        ?>
												</select>
											</p>										
											<p class='evo_month_rep_value evo_rep_month_2' style='display:none'></p>
											<p class='evcalr_2_numr evcalr_2_p'><span class='evo_form_label'><?php 
                        _e('Number of repeats', 'eventon');
                        ?>
:</span>
												<input type='number' name='evcal_rep_num' min='1' value='<?php 
                        echo $evcal_rep_num;
                        ?>
' placeholder='1'/>						
											</p>
										</div><!--evo_preset_repeat_settings-->
										
										<!-- Custom repeat -->
										<div class='repeat_information' style='display:<?php 
                        echo !empty($ev_vals['evcal_rep_freq']) && $ev_vals['evcal_rep_freq'][0] == 'custom' ? 'block' : 'none';
                        ?>
'>
											<p><?php 
                        _e('CUSTOM REPEAT TIMES', 'eventon');
                        ?>
<br/><i style='opacity:0.7'><?php 
                        _e('NOTE: Below repeat intervals are in addition to the above main event time.', 'eventon');
                        ?>
</i></p>
											<?php 
                        //print_r(unserialize($ev_vals['aaa'][0]));
                        date_default_timezone_set('UTC');
                        echo "<p id='no_repeats' style='display:none;opacity:0.7'>There are no additional custom repeats!</p>";
                        echo "<ul class='evo_custom_repeat_list'>";
                        $count = 0;
                        if (!empty($ev_vals['repeat_intervals'])) {
                            $repeat_times = unserialize($ev_vals['repeat_intervals'][0]);
                            //print_r($repeat_times);
                            // datre format sting to display for repeats
                            $date_format_string = $evcal_date_format[1] . ' ' . ($evcal_date_format[2] ? 'G:i' : 'h:ia');
                            foreach ($repeat_times as $rt) {
                                echo '<li style="display:' . ($count == 0 || $count > 3 ? 'none' : 'block') . '" class="' . ($count == 0 ? 'initial' : '') . ($count > 3 ? ' over' : '') . '"><span>' . __('from', 'eventon') . '</span> ' . date($date_format_string, $rt[0]) . ' <span class="e">End</span> ' . date($date_format_string, $rt[1]) . '<em alt="Delete">x</em>
														<input type="hidden" name="repeat_intervals[' . $count . '][0]" value="' . $rt[0] . '"/><input type="hidden" name="repeat_intervals[' . $count . '][1]" value="' . $rt[1] . '"/></li>';
                                $count++;
                            }
                        }
                        echo "</ul>";
                        echo $count > 3 && !empty($ev_vals['repeat_intervals']) ? "<p style='padding-bottom:20px'>There are " . ($count - 1) . " repeat intervals. <span class='evo_repeat_interval_view_all' data-show='no'>" . __('View All', 'eventon') . "</span></p>" : null;
                        ?>
											<div class='evo_repeat_interval_new' style='display:none'>
												<p><span><?php 
                        _e('FROM', 'eventon');
                        ?>
:</span><input class='ristD' name='repeat_date'/> <input class='ristT' name='repeat_time'/><br/><span><?php 
                        _e('TO', 'eventon');
                        ?>
:</span><input class='rietD' name='repeat_date'/> <input class='rietT' name='repeat_time'/></p>
											</div>
											<p class='evo_repeat_interval_button'><a id='evo_add_repeat_interval' class='button_evo'>+ <?php 
                        _e('Add New Repeat Interval', 'eventon');
                        ?>
</a><span></span></p>
										</div>	
									</div>
								</div>	
							<?php 
                        break;
                    case 'ev_subtitle':
                        echo "<div class='evcal_data_block_style1'>\r\n\t\t\t\t\t\t\t\t<div class='evcal_db_data'>\r\n\t\t\t\t\t\t\t\t\t<input type='text' id='evcal_subtitle' name='evcal_subtitle' value='" . evo_meta($ev_vals, 'evcal_subtitle', true) . "' style='width:100%'/>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>";
                        break;
                }
                // for custom meta field for evnet
                if (!empty($mBOX['fieldtype']) && $mBOX['fieldtype'] == 'custommetafield') {
                    $x = $mBOX['x'];
                    echo "<div class='evcal_data_block_style1'>\r\n\t\t\t\t\t\t\t\t<div class='evcal_db_data'>";
                    // FIELD
                    $__saved_field_value = !empty($ev_vals["_evcal_ec_f" . $x . "a1_cus"]) ? $ev_vals["_evcal_ec_f" . $x . "a1_cus"][0] : null;
                    $__field_id = '_evcal_ec_f' . $x . 'a1_cus';
                    // wysiwyg editor
                    if (!empty($evcal_opt1['evcal_ec_f' . $x . 'a2']) && $evcal_opt1['evcal_ec_f' . $x . 'a2'] == 'textarea') {
                        wp_editor($__saved_field_value, $__field_id);
                        // button
                    } elseif (!empty($evcal_opt1['evcal_ec_f' . $x . 'a2']) && $evcal_opt1['evcal_ec_f' . $x . 'a2'] == 'button') {
                        $__saved_field_link = !empty($ev_vals["_evcal_ec_f" . $x . "a1_cusL"]) ? $ev_vals["_evcal_ec_f" . $x . "a1_cusL"][0] : null;
                        echo "<input type='text' id='" . $__field_id . "' name='_evcal_ec_f" . $x . "a1_cus' ";
                        echo 'value="' . $__saved_field_value . '"';
                        echo "style='width:100%' placeholder='Button Text' title='Button Text'/>";
                        echo "<input type='text' id='" . $__field_id . "' name='_evcal_ec_f" . $x . "a1_cusL' ";
                        echo 'value="' . $__saved_field_link . '"';
                        echo "style='width:100%' placeholder='Button Link' title='Button Link'/>";
                        $onw = !empty($ev_vals["_evcal_ec_f" . $x . "_onw"]) ? $ev_vals["_evcal_ec_f" . $x . "_onw"][0] : null;
                        ?>

								<span class='yesno_row evo'>
									<?php 
                        $openInNewWindow = !empty($ev_vals['_evcal_ec_f' . $x . '_onw']) ? $ev_vals['_evcal_ec_f' . $x . '_onw'][0] : null;
                        echo $ajde->wp_admin->html_yesnobtn(array('id' => '_evcal_ec_f' . $x . '_onw', 'var' => $openInNewWindow, 'input' => true, 'label' => __('Open in New window', 'eventon')));
                        ?>
											
								</span>
								<?php 
                        // text
                    } else {
                        echo "<input type='text' id='" . $__field_id . "' name='_evcal_ec_f" . $x . "a1_cus' ";
                        echo 'value="' . $__saved_field_value . '"';
                        echo "style='width:100%'/>";
                    }
                    echo "</div></div>";
                }
            }
            ?>
					
				</div>
			</div>
		<?php 
        }
        ?>
				<div class='evomb_section' id='<?php 
        echo $mBOX['id'];
        ?>
'>			
					<div class='evomb_header'>
						<span class="evomb_icon evII"><i class="fa fa-plug"></i></span>
						<p>Additional Functionality</p>
					</div>
					<p style='padding:15px 25px; margin:0' class="evomb_body_additional">Looking for additional functionality including event tickets, frontend event submissions, RSVP to events, photo gallery and more? Check out <a href='http://www.myeventon.com/addons/' target='_blank'>eventON addons</a>.</p>
				</div>	
			<div class='evMB_end'></div>
		</div>
	<?php 
    }
Esempio n. 4
0
 function repeat_event_header($ri, $eventid)
 {
     $ev_vals = get_post_meta($eventid);
     if (empty($ev_vals['evcal_repeat']) || !empty($ev_vals['evcal_repeat']) && $ev_vals['evcal_repeat'][0] == 'no') {
         return false;
     }
     $repeat_intervals = !empty($ev_vals['repeat_intervals']) ? is_serialized($ev_vals['repeat_intervals'][0]) ? unserialize($ev_vals['repeat_intervals'][0]) : $ev_vals['repeat_intervals'][0] : false;
     // if there are no repeat intervals or only one interval
     if ($repeat_intervals && !is_array($repeat_intervals) && (is_array($repeat_intervals) && count($repeat_intervals) == 1)) {
         return false;
     }
     $repeat_count = count($repeat_intervals) - 1;
     $date = new evo_datetime();
     $event_permalink = get_permalink($eventid);
     echo "<div class='evose_repeat_header'><p><span class='title'>" . evo_lang('This is a repeating event') . "</span>";
     echo "<span class='ri_nav'>";
     // previous link
     if ($ri > 0) {
         $prev = $date->get_correct_formatted_event_repeat_time($ev_vals, $ri - 1);
         // /print_r($prev);
         $prev_link = $this->get_repeat_event_url($event_permalink, $ri - 1);
         echo "<a href='{$prev_link}' class='prev' title='{$prev['start_']}'><b class='fa fa-angle-left'></b><em>{$prev['start_']}</em></a>";
     }
     // next link
     if ($ri < $repeat_count) {
         $next = $date->get_correct_formatted_event_repeat_time($ev_vals, $ri + 1);
         //print_r($next);
         $next_link = $this->get_repeat_event_url($event_permalink, $ri + 1);
         echo "<a href='{$next_link}' class='next' title='{$next['start_']}'><em>{$next['start_']}</em><b class='fa fa-angle-right'></b></a>";
     }
     echo "</span><span class='clear'></span></p></div>";
 }
Esempio n. 5
0
function evors_metabox_content()
{
    global $post, $eventon_rs, $eventon;
    $optRS = $eventon_rs->evors_opt;
    $pmv = get_post_meta($post->ID);
    wp_nonce_field(plugin_basename(__FILE__), 'evors_nonce');
    ob_start();
    $evors_rsvp = !empty($pmv['evors_rsvp']) ? $pmv['evors_rsvp'][0] : null;
    $evors_show_rsvp = !empty($pmv['evors_show_rsvp']) ? $pmv['evors_show_rsvp'][0] : null;
    $evors_show_whos_coming = !empty($pmv['evors_show_whos_coming']) ? $pmv['evors_show_whos_coming'][0] : null;
    $evors_add_emails = !empty($pmv['evors_add_emails']) ? $pmv['evors_add_emails'][0] : null;
    ?>
	<div class='eventon_mb'>
	<div class="evors">
		<p class='yesno_leg_line ' style='padding:10px'>
			<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_rsvp, 'attr' => array('afterstatement' => 'evors_details')));
    ?>
			<input type='hidden' name='evors_rsvp' value="<?php 
    echo $evors_rsvp == 'yes' ? 'yes' : 'no';
    ?>
"/>
			<label for='evors_rsvp'><?php 
    _e('Allow visitors to RSVP to this event');
    ?>
</label>
		</p>
		<div id='evors_details' class='evors_details evomb_body ' <?php 
    echo $evors_rsvp == 'yes' ? null : 'style="display:none"';
    ?>
>		
			<div class="evors_stats" style='padding-top:5px'>			
			<?php 
    $yes_count = $eventon_rs->frontend->functions->get_event_rsvp_count($post->ID, 'yes', $pmv);
    $maybe_count = $eventon_rs->frontend->functions->get_event_rsvp_count($post->ID, 'maybe', $pmv);
    $no_count = $eventon_rs->frontend->functions->get_event_rsvp_count($post->ID, 'no', $pmv);
    ?>
				<p><b><?php 
    echo $yes_count;
    ?>
</b><span><?php 
    _e('YES', 'eventon');
    ?>
</span></p>
				<p><b><?php 
    echo $maybe_count;
    ?>
</b><span><?php 
    _e('Maybe', 'eventon');
    ?>
</span></p>
				<p><b><?php 
    echo $no_count;
    ?>
</b><span><?php 
    _e('No', 'eventon');
    ?>
</span></p>
				<div class='clear'></div>
			</div>
			<div class='evo_negative_25'>
			<table width='100%' class='eventon_settings_table'>
				<tr><td colspan='2'>
					<p class='yesno_leg_line '>
						<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_show_rsvp));
    ?>
					
						<input type='hidden' name='evors_show_rsvp' value="<?php 
    echo $evors_show_rsvp == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evors_show_rsvp'><?php 
    _e('Show current RSVP count for event');
    ?>
</label>
					</p>
				</td></tr>
				<tr><td colspan='2'>
					<p class='yesno_leg_line '>
						<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_show_whos_coming));
    ?>
						<input type='hidden' name='evors_show_whos_coming' value="<?php 
    echo $evors_show_whos_coming == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evors_show_whos_coming'><?php 
    _e("Show who's coming to event");
    ?>
</label>
					</p>
				</td></tr>
				
				<?php 
    // if notifications enabled show additional emails field
    if (!empty($optRS['evors_notif']) && $optRS['evors_notif'] == 'yes') {
        ?>
						<tr><td colspan='2'>
						<p style='padding:5px 0'>
							<label for='evors_add_emails'><i><?php 
        _e('Additional email addresses to receive email notifications', 'eventon');
        echo $eventon->throw_guide("Set additional email addresses seperated by commas to receive email notifications upon new RSVP reciept", '', false);
        ?>
</i></label>
							<input type='text' name='evors_add_emails' value="<?php 
        echo $evors_add_emails;
        ?>
" style='width:100%' placeholder='eg. you@domain.com'/>			
						</p>
						</td></tr>
					<?php 
    }
    ?>

				<tr><td colspan='2'>			
					<?php 
    $evors_max_active = !empty($pmv['evors_max_active']) ? $pmv['evors_max_active'][0] : null;
    $evors_max_count = !empty($pmv['evors_max_count']) ? $pmv['evors_max_count'][0] : null;
    ?>
					<p class='yesno_leg_line '>
						<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_max_active, 'attr' => array('afterstatement' => 'evors_max_count_row', 'as_type' => 'class')));
    ?>
						<input type='hidden' name='evors_max_active' value="<?php 
    echo $evors_max_active == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evors_max_active'><?php 
    _e('Limit maximum capacity count per RSVP', 'eventon');
    echo $eventon->throw_guide('This will allow you to limit each RSVP reservation count to a set max number, then the guests can not book more spaces than this limit.');
    ?>
</label>
					</p>
				</td></tr>
					<tr class='evors_max_count_row yesnosub' style='display:<?php 
    echo $evors_max_active == 'yes' ? '' : 'none';
    ?>
'>
						<td><?php 
    _e('Maximum count number', 'eventon');
    ?>
</td>
						<td><input type='text' id='evors_max_count' name='evors_max_count' value="<?php 
    echo $evors_max_count;
    ?>
"/></td>
					</tr>


				<tr><td colspan='2'>			
					<?php 
    $evors_capacity = !empty($pmv['evors_capacity']) ? $pmv['evors_capacity'][0] : null;
    ?>
					<p class='yesno_leg_line '>
						<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_capacity, 'attr' => array('afterstatement' => 'evors_capacity_row', 'as_type' => 'class')));
    ?>
						<input type='hidden' name='evors_capacity' value="<?php 
    echo $evors_capacity == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evors_capacity'><?php 
    _e('Set capacity limit for RSVP', 'eventon');
    echo $eventon->throw_guide('Activating this will allow you to add a limit to how many RSVPs you can receive. When the limit is reached RSVP will close.');
    ?>
</label>
					</p>
				</td></tr>
				<?php 
    $evors_capacity_count = !empty($pmv['evors_capacity_count']) ? $pmv['evors_capacity_count'][0] : null;
    $evors_capacity_show = !empty($pmv['evors_capacity_show']) ? $pmv['evors_capacity_show'][0] : null;
    ?>
				<tr class='evors_capacity_row yesnosub' style='display:<?php 
    echo $evors_capacity == 'yes' ? '' : 'none';
    ?>
'>
					<td><?php 
    _e('Total available RSVP capacity', 'eventon');
    ?>
</td>
					<td><input type='text' id='evors_capacity_count' name='evors_capacity_count' value="<?php 
    echo $evors_capacity_count;
    ?>
"/></td>
				</tr>

				<?php 
    // manange RSVP capacity separate for repeating events
    if (!empty($pmv['evcal_repeat']) && $pmv['evcal_repeat'][0] == 'yes') {
        $manage_repeat_cap = evo_meta_yesno($pmv, '_manage_repeat_cap_rs', 'yes', 'yes', 'no');
        ?>
				<tr class='evors_capacity_row yesnosub' style='display:<?php 
        echo $evors_capacity == 'yes' ? '' : 'none';
        ?>
'><td colspan='2'>
					<p class='yesno_leg_line ' >
						<?php 
        echo eventon_html_yesnobtn(array('id' => 'evors_mcap', 'var' => $manage_repeat_cap, 'attr' => array('afterstatement' => 'evors_ri_cap')));
        ?>
						<input type='hidden' name='_manage_repeat_cap_rs' value="<?php 
        echo $manage_repeat_cap;
        ?>
"/>

						<label for='_manage_repeat_cap_rs'><?php 
        _e('Manage available capacity separate for each repeating interval of this event');
        echo $eventon->throw_guide('Once repeating event capacities are set the total capacity for event will be overridden. If you just made event repeat, this event need to be updated for repeat options to show up.', '', false);
        ?>
</label>
					</p>
				<?php 
        $repeat_intervals = !empty($pmv['repeat_intervals']) ? unserialize($pmv['repeat_intervals'][0]) : false;
        ?>
					<div id='evors_ri_cap' class='evotx_repeat_capacity' style='padding-top:15px; padding-bottom:20px;display:<?php 
        echo evo_meta_yesno($pmv, '_manage_repeat_cap_rs', 'yes', '', 'none');
        ?>
'>
						<p><em style='opacity:0.6'><?php 
        _e('NOTE: The capacity above should match the total number of capacity for each repeat occurance below for this event.', 'eventon');
        ?>
</em></p>
						<?php 
        // if repeat intervals set
        if ($repeat_intervals && count($repeat_intervals) > 0) {
            $count = 0;
            // get saved capacities for repeats
            $ri_capacity_rs = !empty($pmv['ri_capacity_rs']) ? unserialize($pmv['ri_capacity_rs'][0]) : false;
            echo "<div class='evotx_ri_cap_inputs'>";
            // for each repeat interval
            $evcal_opt1 = get_option('evcal_options_evcal_1');
            foreach ($repeat_intervals as $interval) {
                $date_format = eventon_get_timeNdate_format($evcal_opt1);
                $TIME = eventon_get_editevent_kaalaya($interval[0], $date_format[1], $date_format[2]);
                $ri_open_count = $ri_capacity_rs && !empty($ri_capacity_rs[$count]) ? $ri_capacity_rs[$count] : '0';
                echo "<p class='" . ($count > 10 ? 'hidden' : '') . "'><input type='text' name='ri_capacity_rs[]' value='" . $ri_open_count . "'/><span>" . $TIME[0] . "<br/><em>Remaining: " . $eventon_rs->frontend->functions->get_ri_remaining_count('y', $count, $ri_open_count, $pmv) . "</em></span></p>";
                $count++;
            }
            echo "<div class='clear'></div>";
            echo $count > 10 ? "<p class='evors_repeats_showrest'>" . __('Show Rest', 'eventon') . "</p>" : '';
            echo "</div>";
            echo count($repeat_intervals) > 5 ? "<p class='evotx_ri_view_more'><a class='button_evo'>Click here</a> to view the rest of repeat occurances.</p>" : null;
        }
        ?>
					</div>
				</td></tr>
				<?php 
    }
    ?>

				<tr class='evors_capacity_row yesnosub' style='display:<?php 
    echo $evors_capacity == 'yes' ? '' : 'none';
    ?>
'><td colspan='2'>
					<p class='yesno_leg_line '>
						<?php 
    echo eventon_html_yesnobtn(array('var' => $evors_capacity_show));
    ?>
						<input type='hidden' name='evors_capacity_show' value="<?php 
    echo $evors_capacity_show == 'yes' ? 'yes' : 'no';
    ?>
"/>
						<label for='evors_capacity_show'><?php 
    _e('Show available spaces count on front-end');
    ?>
</label>
					</p>
				</td></tr>
				<?php 
    $evors_close_time = !empty($pmv['evors_close_time']) ? $pmv['evors_close_time'][0] : null;
    ?>
				<tr>
					<td><?php 
    _e('Close RSVP before time (in minutes)', 'eventon');
    echo $eventon->throw_guide('Set how many minutes before the event end time to close RSVP form. Time must be in minutes. Leave blank to not close RSVP before event time.');
    ?>
</td>
					<td><input type='text' id='evors_close_time' name='evors_close_time' value="<?php 
    echo $evors_close_time;
    ?>
" placeholder='eg. 45'/></td>
				</tr>
				<tr>
					<td colspan='2'><?php 
    _e('Additional Information only visible to loggedin RSVPed guests & in Confirmation Email', 'eventon');
    echo $eventon->throw_guide('Information entered in here will only be visible on front-end once user has RSVPed to the event.');
    ?>
					<br/><textarea style='width:100%; margin-top:10px' name='evors_additional_data'><?php 
    echo !empty($pmv['evors_additional_data']) ? $pmv['evors_additional_data'][0] : null;
    ?>
</textarea>
					</td>
				</tr>
			</table>
			</div>
			<?php 
    // INITIAL information for lightbox data section
    // @version 0.2
    // DOWNLOAD CSV link
    $exportURL = add_query_arg(array('action' => 'the_ajax_evors_a3', 'e_id' => $post->ID), admin_url('admin-ajax.php'));
    // repeat event interval data
    $ri_count_active = $eventon_rs->frontend->functions->is_ri_count_active($pmv);
    $repeatIntervals = !empty($pmv['repeat_intervals']) ? unserialize($pmv['repeat_intervals'][0]) : false;
    $datetime = new evo_datetime();
    $wp_date_format = get_option('date_format');
    ?>
			<div class='evcal_rep evors_info_actions'>				
				<div class='evcalr_1'>
				<p class='actions'>
					<a id='evors_VA' data-e_id='<?php 
    echo $post->ID;
    ?>
' data-riactive='<?php 
    echo $ri_count_active && $repeatIntervals ? 'yes' : 'no';
    ?>
' data-popc='evors_lightbox' class='button_evo attendees ajde_popup_trig' ><?php 
    _e('View Attendees', 'eventon');
    ?>
</a> 
					<a class='button_evo download' href="<?php 
    echo $exportURL;
    ?>
"><?php 
    _e('Download (CSV)', 'eventon');
    ?>
</a> 
					<a id='evors_SY' data-e_id='<?php 
    echo $post->ID;
    ?>
' class='button_evo sync' ><?php 
    _e('Sync Count', 'eventon');
    ?>
</a> 
					<a id='evors_EMAIL' data-e_id='<?php 
    echo $post->ID;
    ?>
' data-popc='evors_email_attendee' class='button_evo email ajde_popup_trig' ><?php 
    _e('Emailing', 'eventon');
    ?>
</a> 
				</p>
				
				<?php 
    // lightbox content for emailing section
    ob_start();
    ?>
				<div id='evors_emailing' style=''>
					<p><label><?php 
    _e('Select emailing option', 'eventon');
    ?>
</label>
						<select name="" id="evors_emailing_options">
							<option value="someone"><?php 
    _e('Email Attendees List to someone', 'eventon');
    ?>
</option>
							<option value="coming"><?php 
    _e('Email only attending guests', 'eventon');
    ?>
</option>
							<option value="notcoming"><?php 
    _e('Email guests not coming to event', 'eventon');
    ?>
</option>
							<option value="all"><?php 
    _e('Email all rsvped guests', 'eventon');
    ?>
</option>
						</select>
					</p>
					<?php 
    // if repeat interval count separatly
    if ($ri_count_active && $repeatIntervals) {
        if (count($repeatIntervals) > 0) {
            echo "<p><label>" . __('Select Event Repeat Instance', 'eventon') . "</label> ";
            echo "<select name='repeat_interval' id='evors_emailing_repeat_interval'>\r\n\t\t\t\t\t\t\t\t\t<option value='all'>" . __('All', 'eventon') . "</option>";
            $x = 0;
            foreach ($repeatIntervals as $interval) {
                $time = $datetime->get_correct_formatted_event_repeat_time($pmv, $x, $wp_date_format);
                echo "<option value='" . $x . "'>" . $time['start'] . "</option>";
                $x++;
            }
            echo "</select>";
            echo $eventon->throw_guide("Select which instance of repeating events of this event you want to use for this emailing action.", '', false);
            echo "</p>";
        }
    }
    ?>
					<p style='' class='text'><label for=""><?php 
    _e('Email Addresses (separated by commas)', 'eventon');
    ?>
</label><br/><input style='width:100%' type="text"></p>
					<p style='' class='subject'><label for=""><?php 
    _e('Subject for email', 'eventon');
    ?>
 *</label><br/><input style='width:100%' type="text"></p>
					<p style='' class='textarea'><label for=""><?php 
    _e('Message for the email', 'eventon');
    ?>
</label><br/>
						<textarea cols="30" rows="5" style='width:100%'></textarea></p>
					<p><a data-eid='<?php 
    echo $post->ID;
    ?>
' id="evors_email_submit" class='evo_admin_btn btn_prime'><?php 
    _e('Send Email', 'eventon');
    ?>
</a></p>
				</div>
				<?php 
    $emailing_content = ob_get_clean();
    ?>

				<?php 
    // lightbox content for view attendees
    if ($repeatIntervals && $ri_count_active && count($repeatIntervals) > 0) {
        ob_start();
        ?>
					<div id='evors_view_attendees'>
						<p style='text-align:center'><label><?php 
        _e('Select Repeating Instance of Event', 'eventon');
        ?>
</label> 
							<select name="" id="evors_event_repeatInstance">
								<option value="all"><?php 
        _e('All Repeating Instances', 'eventon');
        ?>
</option>
								<?php 
        $x = 0;
        foreach ($repeatIntervals as $interval) {
            $time = $datetime->get_correct_formatted_event_repeat_time($pmv, $x, $wp_date_format);
            echo "<option value='" . $x . "'>" . $time['start'] . "</option>";
            $x++;
        }
        ?>
							</select>
						</p>
						<p style='text-align:center'><a id='evors_VA_submit' data-e_id='<?php 
        echo $post->ID;
        ?>
' class='evo_admin_btn btn_prime' ><?php 
        _e('Submit', 'eventon');
        ?>
</a> </p>
					</div>
					<div id='evors_view_attendees_list'></div>
					<?php 
        $viewattendee_content = ob_get_clean();
    } else {
        $viewattendee_content = "<div id='evors_view_attendees'>LOADING...</div>";
    }
    ?>

				<p id='evors_message' style='display:none'></p>
				<?php 
    echo $eventon->output_eventon_pop_window(array('class' => 'evors_lightbox', 'content' => $viewattendee_content, 'title' => __('View Attendee List', 'eventon'), 'type' => 'padded', 'max_height' => 450));
    echo $eventon->output_eventon_pop_window(array('class' => 'evors_email_attendee', 'content' => $emailing_content, 'title' => __('Email Attendee List', 'eventon'), 'type' => 'padded', 'max_height' => 450));
    ?>
				</div>
			</div>
		</div>
	</div>
	</div>
	<?php 
    echo ob_get_clean();
}
Esempio n. 6
0
 * To Customize this template: copy and paste this file to .../wp-content/themes/--your-theme-name--/eventon/templates/email/rsvp/ folder and edit that file.
 */
global $eventon, $eventon_rs;
echo $eventon->get_email_part('header');
$args = $args;
$event_name = get_the_title($args['e_id']);
$e_pmv = get_post_meta($args['e_id']);
$rsvp_pmv = get_post_custom($args['rsvp_id']);
$evo_options = get_option('evcal_options_evcal_1');
$evo_options_2 = $eventon_rs->opt2;
$optRS = $eventon_rs->evors_opt;
$lang = !empty($args['lang']) ? $args['lang'] : 'L1';
// language version
//event time
$repeat_interval = !empty($args['repeat_interval']) ? $args['repeat_interval'][0] : 0;
$datetime = new evo_datetime();
$unix_start = $datetime->get_int_correct_event_time($e_pmv, $repeat_interval, 'start');
$unix_end = $datetime->get_int_correct_event_time($e_pmv, $repeat_interval, 'end');
$__date = $eventon_rs->frontend->_event_date($e_pmv, $unix_start, $unix_end);
// location data
$location = (!empty($e_pmv['evcal_location_name']) ? $e_pmv['evcal_location_name'][0] . ': ' : null) . (!empty($e_pmv['evcal_location']) ? $e_pmv['evcal_location'][0] : null);
//	styles
$__styles_date = "font-size:48px; color:#ABABAB; font-weight:bold; margin-top:5px";
$__styles_em = "font-size:14px; font-weight:bold; text-transform:uppercase; display:block;font-style:normal";
$__styles_button = "font-size:14px; background-color:#" . (!empty($evo_options['evcal_gen_btn_bgc']) ? $evo_options['evcal_gen_btn_bgc'] : "237ebd") . "; color:#" . (!empty($evo_options['evcal_gen_btn_fc']) ? $evo_options['evcal_gen_btn_fc'] : "ffffff") . "; padding: 5px 10px; text-decoration:none; border-radius:4px; ";
$__styles_01 = "font-size:30px; color:#303030; font-weight:bold; text-transform:uppercase; margin-bottom:0px;  margin-top:0;";
$__styles_02 = "font-size:18px; color:#303030; font-weight:normal; text-transform:uppercase; display:block; font-style:italic; margin: 4px 0; line-height:110%;";
$__sty_lh = "line-height:110%;";
$__styles_02a = "color:#afafaf; text-transform:none";
$__styles_03 = "color:#afafaf; font-style:italic;font-size:14px; margin:0 0 10px 0;";
$__styles_04 = "color:#303030; text-transform:uppercase; font-size:18px; font-style:italic; padding-bottom:0px; margin-bottom:0px; line-height:110%;";
Esempio n. 7
0
/**
 * event card content processed and output as html
 * @version 2.3.21
 */
function eventon_eventcard_print($array, $evOPT, $evoOPT2)
{
    global $eventon;
    $evoOPT2 = !empty($evoOPT2) ? $evoOPT2 : '';
    $OT = '';
    $count = 1;
    $items = count($array);
    // close button
    $close = "<div class='evcal_evdata_row evcal_close' title='" . eventon_get_custom_language($evoOPT2, 'evcal_lang_close', 'Close') . "'></div>";
    // additional fields array
    $_additions = apply_filters('evo_eventcard_adds', array());
    // FOR each
    foreach ($array as $box_f => $box) {
        $end = $count == $items ? $close : null;
        $end_row_class = $count == $items ? ' lastrow' : null;
        // convert to an object
        $object = new stdClass();
        foreach ($box as $key => $value) {
            $object->{$key} = $value;
        }
        $boxname = in_array($box_f, $_additions) ? $box_f : null;
        //echo($box_f.' ');
        //print_r($boxname);
        //$OT.="".$items.'-'.$count." ".$box_f;
        // each eventcard type
        switch ($box_f) {
            // addition
            case has_filter("eventon_eventCard_{$boxname}"):
                $helpers = array('evOPT' => $evOPT, 'evoOPT2' => $evoOPT2, 'end_row_class' => $end_row_class, 'end' => $end);
                $OT .= apply_filters("eventon_eventCard_{$boxname}", $object, $helpers);
                break;
                // Event Details
            // Event Details
            case 'eventdetails':
                // check if character length of description is longer than X size
                if (!empty($evOPT['evo_morelass']) && $evOPT['evo_morelass'] != 'yes' && strlen($object->fulltext) > 600) {
                    $more_code = "<div class='eventon_details_shading_bot'>\r\n\t\t\t\t\t\t\t\t<p class='eventon_shad_p' content='less'><span class='ev_more_text' data-txt='" . eventon_get_custom_language($evoOPT2, 'evcal_lang_less', 'less') . "'>" . eventon_get_custom_language($evoOPT2, 'evcal_lang_more', 'more') . "</span><span class='ev_more_arrow'></span></p>\r\n\t\t\t\t\t\t\t</div>";
                    $evo_more_active_class = 'shorter_desc';
                } else {
                    $more_code = '';
                    $evo_more_active_class = '';
                }
                $OT .= "<div class='evo_metarow_details evorow evcal_evdata_row bordb evcal_event_details" . $end_row_class . "'>\r\n\t\t\t\t\t\t\t" . $object->excerpt . "\r\n\t\t\t\t\t\t\t<span class='evcal_evdata_icons'><i class='fa " . get_eventON_icon('evcal__fai_001', 'fa-align-justify', $evOPT) . "'></i></span>\r\n\t\t\t\t\t\t\t<div class='evcal_evdata_cell " . $evo_more_active_class . "'>" . $more_code . "<div class='eventon_full_description'>\r\n\t\t\t\t\t\t\t\t\t<h3 class='padb5 evo_h3'>" . eventon_get_custom_language($evoOPT2, 'evcal_evcard_details', 'Event Details') . "</h3><div class='eventon_desc_in' itemprop='description'>\r\n\t\t\t\t\t\t\t\t\t" . $eventon->frontend->filter_evo_content($object->fulltext) . "</div>";
                // pluggable inside event details
                do_action('eventon_eventcard_event_details');
                $OT .= "<div class='clear'></div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t" . $end . "</div>";
                break;
                // TIME and LOCATION
            // TIME and LOCATION
            case 'timelocation':
                if ($object->address || $object->location_name) {
                    $timezone = !empty($object->timezone) ? ' <em class="evo_eventcard_tiemzone">' . $object->timezone . '</em>' : null;
                    $locationLink = !empty($object->location_link) ? '<a target="_blank" href="' . $object->location_link . '">' : false;
                    $OT .= "<div class='evo_metarow_time_location evorow bordb" . $end_row_class . " '>\r\n\t\t\t\t\t\t<div class='tb' >\r\n\t\t\t\t\t\t\t<div class='tbrow'>\r\n\t\t\t\t\t\t\t<div class='evcal_col50 bordr'>\r\n\t\t\t\t\t\t\t\t<div class='evcal_evdata_row evo_time'>\r\n\t\t\t\t\t\t\t\t\t<span class='evcal_evdata_icons'><i class='fa " . get_eventON_icon('evcal__fai_002', 'fa-clock-o', $evOPT) . "'></i></span>\r\n\t\t\t\t\t\t\t\t\t<div class='evcal_evdata_cell'>\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<h3 class='evo_h3'>" . eventon_get_custom_language($evoOPT2, 'evcal_lang_time', 'Time') . "</h3><p>" . $object->timetext . $timezone . "</p>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div><div class='evcal_col50'>\r\n\t\t\t\t\t\t\t\t<div class='evcal_evdata_row evo_location'>\r\n\t\t\t\t\t\t\t\t\t<span class='evcal_evdata_icons'><i class='fa " . get_eventON_icon('evcal__fai_003', 'fa-map-marker', $evOPT) . "'></i></span>\r\n\t\t\t\t\t\t\t\t\t<div class='evcal_evdata_cell' data-loc_tax_id='{$object->locTaxID}'>\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<h3 class='evo_h3'>" . ($locationLink ? $locationLink : '') . eventon_get_custom_language($evoOPT2, 'evcal_lang_location', 'Location') . ($locationLink ? '</a>' : '') . "</h3>" . (!empty($object->location_name) ? "<p class='evo_location_name'>" . stripslashes($object->location_name) . "</p>" : null) . "<p>" . (!empty($object->address) ? stripslashes($object->address) : null) . "</p>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div><div class='clear'></div>\r\n\t\t\t\t\t\t\t</div></div>\r\n\t\t\t\t\t\t" . $end . "</div>";
                } else {
                    // time only
                    $OT .= "<div class='evo_metarow_time evorow evcal_evdata_row bordb evcal_evrow_sm " . $end_row_class . "'>\r\n\t\t\t\t\t\t\t<span class='evcal_evdata_icons'><i class='fa " . get_eventON_icon('evcal__fai_002', 'fa-clock-o', $evOPT) . "'></i></span>\r\n\t\t\t\t\t\t\t<div class='evcal_evdata_cell'>\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<h3 class='evo_h3'>" . eventon_get_custom_language($evoOPT2, 'evcal_lang_time', 'Time') . "</h3><p>" . $object->timetext . "</p>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t" . $end . "</div>";
                }
                break;
                // REPEAT SERIES
            // REPEAT SERIES
            case 'repeats':
                $OT .= "<div class='evo_metarow_repeats evorow evcal_evdata_row bordb evcal_evrow_sm " . $end_row_class . "'>\r\n\t\t\t\t\t\t\t<span class='evcal_evdata_icons'><i class='fa " . get_eventON_icon('evcal__fai_repeats', 'fa-repeat', $evOPT) . "'></i></span>\r\n\t\t\t\t\t\t\t<div class='evcal_evdata_cell'>\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<h3 class='evo_h3'>" . eventon_get_custom_language($evoOPT2, 'evcal_lang_repeats', 'Future Event Times in this Repeating Event Series') . "</h3>\r\n\t\t\t\t\t\t\t\t<p class='evo_repeat_series_dates'>";
                foreach ($object->future_intervals as $interval) {
                    $OT .= "<span>" . date($object->date_format . ' ' . $object->time_format, $interval[0]) . "</span>";
                }
                $OT .= "</p></div>" . $end . "</div>";
                break;
                // Location Image
            // Location Image
            case 'locImg':
                $img_src = wp_get_attachment_image_src($object->id, 'full');
                $fullheight = (int) $object->fullheight;
                if (!empty($img_src)) {
                    // text over location image
                    $inside = '';
                    if (!empty($object->locName)) {
                        $inner = !empty($object->locAdd) ? '<span>' . $object->locAdd . '</span>' : null;
                        $inside = "<p class='evoLOCtxt'>{$object->locName}{$inner}</p>";
                    }
                    $OT .= "<div class='evo_metarow_locImg evorow bordb " . (!empty($inside) ? 'tvi' : null) . "' style='height:{$fullheight}px; background-image:url(" . $img_src[0] . ")' id='" . $object->id . "_locimg' >{$inside}</div>";
                }
                break;
                // GOOGLE map
            // GOOGLE map
            case 'gmap':
                $OT .= "<div class='evo_metarow_gmap evorow evcal_gmaps bordb ' id='" . $object->id . "_gmap' style='max-width:none'></div>";
                break;
                // Featured image
            // Featured image
            case 'ftimage':
                $__hoverclass = !empty($object->hovereffect) && $object->hovereffect != 'yes' ? ' evo_imghover' : null;
                $__noclickclass = !empty($object->clickeffect) && $object->clickeffect == 'yes' ? ' evo_noclick' : null;
                $__zoom_cursor = !empty($evOPT['evo_ftim_mag']) && $evOPT['evo_ftim_mag'] == 'yes' ? ' evo_imgCursor' : null;
                // if set to direct image
                if (!empty($evOPT['evo_ftimg_height_sty']) && $evOPT['evo_ftimg_height_sty'] == 'direct') {
                    $OT .= "<div class='evo_metarow_directimg'><img src='{$object->img[0]}'/></div>";
                } else {
                    $height = !empty($object->img[2]) ? $object->img[2] : '';
                    $width = !empty($object->img[1]) ? $object->img[1] : '';
                    $OT .= "<div class='evo_metarow_fimg evorow evcal_evdata_img " . $end_row_class . $__hoverclass . $__zoom_cursor . $__noclickclass . "' data-imgheight='" . $height . "' data-imgwidth='" . $width . "'  style='background-image: url(" . $object->img[0] . ")' data-imgstyle='" . $object->ftimg_sty . "' data-minheight='" . $object->min_height . "' data-status=''>" . $end . "</div>";
                }
                break;
                // event organizer
            // event organizer
            case 'organizer':
                $evcal_evcard_org = eventon_get_custom_language($evoOPT2, 'evcal_evcard_org', 'Organizer');
                $ORGMeta = evo_get_term_meta('event_organizer', $object->organizer_term_id, '', true);
                $img_src = !empty($ORGMeta['evo_org_img']) ? wp_get_attachment_image_src($ORGMeta['evo_org_img'], 'medium') : null;
                $newdinwow = !empty($ORGMeta['_evocal_org_exlink_target']) && $ORGMeta['_evocal_org_exlink_target'] == 'yes' ? 'target="_blank"' : '';
                // organizer name text openinnewwindow
                if (!empty($ORGMeta['evcal_org_exlink'])) {
                    $orgNAME = "<span class='evo_card_organizer_name_t'><a " . $newdinwow . " href='{$ORGMeta['evcal_org_exlink']}'>" . $object->organizer_name . "</a></span>";
                } else {
                    $orgNAME = "<span class='evo_card_organizer_name_t'>" . $object->organizer_name . "</span>";
                }
                $OT .= "<div class='evo_metarow_organizer evorow evcal_evdata_row bordb evcal_evrow_sm " . $end_row_class . "'>\r\n\t\t\t\t\t\t\t<span class='evcal_evdata_icons'><i class='fa " . get_eventON_icon('evcal__fai_004', 'fa-headphones', $evOPT) . "'></i></span>\r\n\t\t\t\t\t\t\t<div class='evcal_evdata_cell'>\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<h3 class='evo_h3'>" . $evcal_evcard_org . "</h3>\r\n\t\t\t\t\t\t\t\t" . (!empty($img_src) ? "<p class='evo_data_val evo_card_organizer_image'><img src='{$img_src[0]}'/></p>" : null) . "\r\n\t\t\t\t\t\t\t\t<div class='evo_card_organizer'><p class='evo_data_val evo_card_organizer_name'>\r\n\t\t\t\t\t\t\t\t\t" . $orgNAME . (!empty($ORGMeta['evcal_org_contact']) ? "<span class='evo_card_organizer_contact'>{$ORGMeta['evcal_org_contact']}</span>" : null) . "\r\n\t\t\t\t\t\t\t\t\t" . (!empty($ORGMeta['evcal_org_address']) ? "<span class='evo_card_organizer_address'>{$ORGMeta['evcal_org_address']}</span>" : null) . "\r\n\t\t\t\t\t\t\t\t\t</p></div>\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t" . $end . "</div>";
                break;
                // get directions
            // get directions
            case 'getdirection':
                $_lang_1 = eventon_get_custom_language($evoOPT2, 'evcalL_getdir_placeholder', 'Type your address to get directions');
                $_lang_2 = eventon_get_custom_language($evoOPT2, 'evcalL_getdir_title', 'Click here to get directions');
                $OT .= "<div class='evo_metarow_getDr evorow evcal_evdata_row bordb evcal_evrow_sm getdirections'>\r\n\t\t\t\t\t\t<form action='https://maps.google.com/maps' method='get' target='_blank'>\r\n\t\t\t\t\t\t<input type='hidden' name='daddr' value='{$object->fromaddress}'/> \r\n\t\t\t\t\t\t<p><input class='evoInput' type='text' name='saddr' placeholder='{$_lang_1}' value=''/>\r\n\t\t\t\t\t\t<button type='submit' class='evcal_evdata_icons evcalicon_9' title='{$_lang_2}'><i class='fa " . get_eventON_icon('evcal__fai_008a', 'fa-road', $evOPT) . "'></i></button>\r\n\t\t\t\t\t\t</p></form>\r\n\t\t\t\t\t</div>";
                break;
                // learnmore ICS and close button
            // learnmore ICS and close button
            case 'learnmoreICS':
                // Initial
                $__ics_url = admin_url('admin-ajax.php') . '?action=eventon_ics_download&amp;event_id=' . $object->event_id . '&amp;sunix=' . $object->estart . '&amp;eunix=' . $object->eend;
                $__googlecal_link = eventon_get_addgoogle_cal($object);
                // which options to show for add to calendar
                $addCaloptions = !empty($evOPT['evo_addtocal']) ? $evOPT['evo_addtocal'] : 'all';
                $addCalContent = '';
                // add to cal section
                switch ($addCaloptions) {
                    case 'ics':
                        $addCalContent = "<a href='{$__ics_url}' class='evo_ics_nCal' title='" . eventon_get_custom_language($evoOPT2, 'evcal_evcard_addics', 'Add to your calendar') . "'>" . eventon_get_custom_language($evoOPT2, 'evcal_evcard_calncal', 'Calendar') . "</a>";
                        break;
                    case 'gcal':
                        $addCalContent = "<a href='{$__googlecal_link}' target='_blank' class='evo_ics_gCal' title='" . eventon_get_custom_language($evoOPT2, 'evcal_evcard_addgcal', 'Add to google calendar') . "'>" . eventon_get_custom_language($evoOPT2, 'evcal_evcard_calgcal', 'GoogleCal') . "</a>";
                        break;
                    case 'all':
                        $addCalContent = "<a href='{$__ics_url}' class='evo_ics_nCal' title='" . eventon_get_custom_language($evoOPT2, 'evcal_evcard_addics', 'Add to your calendar') . "'>" . eventon_get_custom_language($evoOPT2, 'evcal_evcard_calncal', 'Calendar') . "</a>" . "<a href='{$__googlecal_link}' target='_blank' class='evo_ics_gCal' title='" . eventon_get_custom_language($evoOPT2, 'evcal_evcard_addgcal', 'Add to google calendar') . "'>" . eventon_get_custom_language($evoOPT2, 'evcal_evcard_calgcal', 'GoogleCal') . "</a>";
                        break;
                }
                // learn more and ICS
                if (!empty($object->learnmorelink) && $addCaloptions != 'none') {
                    ob_start();
                    ?>
						<div class='evo_metarow_learnMICS evorow bordb <?php 
                    echo $end_row_class;
                    ?>
'>
						<div class='tb'>
							<div class='tbrow'>
							<a class='evcal_col50 dark1 bordr evo_clik_row' href='<?php 
                    echo $object->learnmorelink;
                    ?>
' <?php 
                    echo $object->learnmore_target;
                    ?>
>
								<span class='evcal_evdata_row ' >
									<span class='evcal_evdata_icons'><i class='fa <?php 
                    echo get_eventON_icon('evcal__fai_006', 'fa-link', $evOPT);
                    ?>
'></i></span>
									<h3 class='evo_h3'><?php 
                    echo eventon_get_custom_language($evoOPT2, 'evcal_evcard_learnmore2', 'Learn More');
                    ?>
</h3>
								</span>
							</a>						
							<div class='evo_ics evcal_col50 dark1 evo_clik_row' >
								<div class='evcal_evdata_row'>
									<span class="evcal_evdata_icons"><i class="fa fa-calendar"></i></span>
									<div class='evcal_evdata_cell'>
										<p><?php 
                    echo $addCalContent;
                    ?>
</p>	
									</div>
								</div>
							</div></div></div>
						<?php 
                    echo $end;
                    ?>
</div>
						<?php 
                    $OT .= ob_get_clean();
                    // only learn more
                } else {
                    if (!empty($object->learnmorelink)) {
                        $OT .= "<div class='evo_metarow_learnM evorow bordb'>\r\n\t\t\t\t\t\t\t<a class='evcal_evdata_row evo_clik_row dark1 ' href='" . $object->learnmorelink . "' " . $object->learnmore_target . ">\r\n\t\t\t\t\t\t\t\t<span class='evcal_evdata_icons'><i class='fa " . get_eventON_icon('evcal__fai_006', 'fa-link', $evOPT) . "'></i></span>\r\n\t\t\t\t\t\t\t\t<h3 class='evo_h3'>" . eventon_get_custom_language($evoOPT2, 'evcal_evcard_learnmore2', 'Learn More') . "</h3>\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t" . $end . "</div>";
                        // only ICS
                    } else {
                        if ($addCaloptions != 'none') {
                            ob_start();
                            //echo get_option('gmt_offset', 0).'ttt';
                            ?>
						<div class='evo_metarow_ICS evorow bordb evcal_evdata_row'>
							<span class="evcal_evdata_icons"><i class="fa fa-calendar"></i></span>
							<div class='evcal_evdata_cell'>
								<p><?php 
                            echo $addCalContent;
                            ?>
</p>	
							</div><?php 
                            echo $end;
                            ?>
						</div>
						<?php 
                            $OT .= ob_get_clean();
                        }
                    }
                }
                break;
                // paypal link
            // paypal link
            case 'paypal':
                $text = !empty($object->text) ? $object->text : eventon_get_custom_language($evoOPT2, 'evcal_evcard_tix1', 'Buy ticket via Paypal');
                $email = $object->email;
                $currency = !empty($evOPT['evcal_pp_cur']) ? $evOPT['evcal_pp_cur'] : false;
                if ($currency && $email) {
                    // get proper time to append to event title
                    $evodate = new evo_datetime();
                    $eventtime = $evodate->evo_date($object->estart, $object->evvals);
                    ob_start();
                    ?>

						<div class='evo_metarow_paypal evorow evcal_evdata_row bordb evo_paypal'>
								<span class='evcal_evdata_icons'><i class='fa <?php 
                    echo get_eventON_icon('evcal__fai_007', 'fa-ticket', $evOPT);
                    ?>
'></i></span>
								<div class='evcal_evdata_cell'>
									<p><?php 
                    echo $text;
                    ?>
</p>
									<form target="_blank" name="_xclick" action="https://www.paypal.com/us/cgi-bin/webscr" method="post">
										<input type="hidden" name="cmd" value="_xclick">
										<input type="hidden" name="business" value="<?php 
                    echo $email;
                    ?>
">
										<input type="hidden" name="currency_code" value="<?php 
                    echo $currency;
                    ?>
">
										<input type="hidden" name="item_name" value="<?php 
                    echo $object->title . ' ' . $eventtime;
                    ?>
">
										<input type="hidden" name="amount" value="<?php 
                    echo $object->price;
                    ?>
">
										<input type='submit' class='evcal_btn' value='<?php 
                    echo eventon_get_custom_language($evoOPT2, 'evcal_evcard_btn1', 'Buy Now');
                    ?>
'/>
									</form>
									
								</div><?php 
                    echo $end;
                    ?>
</div>
						
						<?php 
                    $OT .= ob_get_clean();
                }
                break;
        }
        // end switch
        // for custom meta data fields
        if (!empty($object->x) && $box_f == 'customfield' . $object->x) {
            $i18n_name = eventon_get_custom_language($evoOPT2, 'evcal_cmd_' . $object->x, $evOPT['evcal_ec_f' . $object->x . 'a1']);
            if ($object->visibility_type == 'admin' && !current_user_can('manage_options') || $object->visibility_type == 'loggedin' && !is_user_logged_in()) {
                continue;
            }
            $OT .= "<div class='evo_metarow_cusF{$object->x} evorow evcal_evdata_row bordb evcal_evrow_sm '>\r\n\t\t\t\t\t\t<span class='evcal_evdata_custometa_icons'><i class='fa " . $object->imgurl . "'></i></span>\r\n\t\t\t\t\t\t<div class='evcal_evdata_cell'>\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<h3 class='evo_h3'>" . $i18n_name . "</h3>";
            if ($object->type == 'button') {
                $_target = !empty($object->_target) && $object->_target == 'yes' ? 'target="_blank"' : null;
                $OT .= "<a href='" . $object->valueL . "' {$_target} class='evcal_btn evo_cusmeta_btn'>" . $object->value . "</a>";
            } else {
                $OT .= "<div class='evo_custom_content evo_data_val'>" . $eventon->frontend->filter_evo_content($object->value) . "</div>";
            }
            $OT .= "</div>" . $end . "</div>";
        }
        $count++;
    }
    // end foreach
    return $OT;
}
Esempio n. 8
0
 function emailing_rsvp_admin()
 {
     global $eventon_rs, $eventon;
     $eid = $_POST['eid'];
     $type = $_POST['type'];
     $RI = !empty($_POST['repeat_interval']) ? $_POST['repeat_interval'] : 'all';
     // repeat interval
     $emails = $EMAILED = $_message_addition = false;
     // email attendees list to someone
     if ($type == 'someone') {
         $emails = explode(',', str_replace(' ', '', htmlspecialchars_decode($_POST['emails'])));
         $guests = $eventon_rs->frontend->functions->GET_rsvp_list($eid, $RI);
         if (is_array($guests) && isset($guests['y']) && count($guests['y']) > 0) {
             ob_start();
             $datetime = new evo_datetime();
             $epmv = get_post_custom($eid);
             $eventdate = $datetime->get_correct_formatted_event_repeat_time($epmv, $RI == 'all' ? '0' : $RI);
             echo "<p>Guests Attending to " . get_the_title($eid) . " on " . $eventdate['start'] . "</p>";
             echo "<table style='padding-top:15px; width:100%;text-align:left'><thead><tr><th>Last Name</th><th>First Name</th><th>Email</th><th>Count</th></tr></thead>\r\n\t\t\t\t\t<tbody>";
             foreach ($guests['y'] as $guest) {
                 echo "<tr><td>" . $guest['lname'] . "</td><td>" . $guest['fname'] . "</td><td>" . $guest['email'] . "</td><td>" . $guest['count'] . "</td></tr>";
             }
             echo "</tbody></table>";
             $_message_addition = ob_get_clean();
         }
     } elseif ($type == 'coming') {
         $guests = $eventon_rs->frontend->functions->GET_rsvp_list($eid, $RI);
         foreach (array('y', 'm') as $rsvp_status) {
             if (is_array($guests) && isset($guests[$rsvp_status]) && count($guests[$rsvp_status]) > 0) {
                 foreach ($guests[$rsvp_status] as $guest) {
                     $emails .= $guest['email'] . ',';
                 }
             }
         }
     } elseif ($type == 'notcoming') {
         $guests = $eventon_rs->frontend->functions->GET_rsvp_list($eid, $RI);
         if (is_array($guests) && isset($guests['n']) && count($guests['n']) > 0) {
             foreach ($guests['n'] as $guest) {
                 $emails .= $guest['email'] . ',';
             }
         }
     } elseif ($type == 'all') {
         $guests = $eventon_rs->frontend->functions->GET_rsvp_list($eid, $RI);
         foreach (array('y', 'm', 'n') as $rsvp_status) {
             if (is_array($guests) && isset($guests[$rsvp_status]) && count($guests[$rsvp_status]) > 0) {
                 foreach ($guests[$rsvp_status] as $guest) {
                     $emails .= $guest['email'] . ',';
                 }
             }
         }
     }
     // emaling
     if ($emails) {
         $messageBODY = "<div style='padding:15px'>" . (!empty($_POST['message']) ? strip_tags($_POST['message']) . '<br/><br/>' : '') . ($_message_addition ? $_message_addition : '') . "</div>";
         $messageBODY = $eventon_rs->frontend->get_evo_email_body($messageBODY);
         $from_email = $eventon_rs->frontend->get_from_email();
         $args = array('html' => 'yes', 'to' => $type == 'someone' ? $emails : $from_email, 'subject' => $_POST['subject'], 'from' => $from_email, 'message' => $messageBODY);
         $headers = 'From: ' . $from_email . "\r\n";
         $headers .= 'Reply-To: ' . $from_email . "\r\n";
         if ($type != 'someone') {
             $headers .= 'Bcc: ' . $emails . "\r\n";
         }
         $args['header'] = $headers;
         //print_r($args);
         $EMAILED = $eventon_rs->helper->send_email($args);
     }
     $return_content = array('status' => $EMAILED ? '0' : 'did not go', 'other' => $args);
     echo json_encode($return_content);
     exit;
 }
Esempio n. 9
0
 function get_correct_event_end_time($e_pmv, $__repeatInterval)
 {
     $datetime = new evo_datetime();
     return $datetime->get_int_correct_event_time($e_pmv, $__repeatInterval, 'end');
 }