prefix . "ap_events"; $FindAllEvents = "SELECT * FROM `$EventTable` ORDER BY `start_date` DESC"; $AllEvents = $wpdb->get_results($FindAllEvents, OBJECT); $no = 1; if($AllEvents) { foreach($AllEvents as $Event) { ?>
name); ?> repeat == 'N') echo date("F jS Y", strtotime($Event->start_date)) ; else echo date("M. jS", strtotime($Event->start_date))." To ".date("M. jS Y", strtotime($Event->end_date)); ?> start_time))." To ".date("g:ia", strtotime($Event->end_time)); ?> repeat == 'N' && !$Event->allday) { echo _e("None", "appointzilla"); } if($Event->repeat == 'PD') { echo _e("Particular Date(s)", "appointzilla"); } if($Event->repeat == 'D') { echo _e("Daily", "appointzilla"); } if($Event->repeat == 'W') { echo _e("Weekly", "appointzilla"); } if($Event->repeat == 'BW') { echo _e("Bi-Weekly", "appointzilla"); } if($Event->repeat == 'M') { $diff = ( strtotime($Event->end_date) - strtotime($Event->start_date) ) /60/60/24/31; echo _e("Monthly", "appointzilla"); } if($Event->allday) { echo " "; echo _e("All Day", "appointzilla"); } ?> repeat != 'N') { if(strtotime("$Event->end_date") < strtotime(date('Y-m-d'))) { echo _e("Gone", "appointzilla"); } if( strtotime("$Event->start_date") <= strtotime(date('Y-m-d')) && strtotime("$Event->end_date") >= strtotime(date('Y-m-d'))) { echo _e("Running", "appointzilla"); } if(strtotime("$Event->start_date") > strtotime(date('Y-m-d'))) { echo _e("Up Coming", "appointzilla"); } } else if($Event->repeat == 'N') { if(strtotime("$Event->end_date") < strtotime(date('Y-m-d'))) { echo _e("Gone", "appointzilla"); } if( strtotime("$Event->start_date") <= strtotime(date('Y-m-d')) && strtotime("$Event->end_date") >= strtotime(date('Y-m-d'))) { echo _e("Running", "appointzilla"); } if(strtotime("$Event->start_date") > strtotime(date('Y-m-d'))) { echo _e("Up Coming", "appointzilla"); } } ?>  
         
alert("Sorry, your nonce did not verify.");'; return false; } // all day event if(isset($_POST['allday'])) { $allday = 1; $start_time = '12:00 AM'; $end_time = '11:59 PM'; } else { $allday = 0; $start_time = sanitize_text_field( $_POST['start_time'] ); $end_time = sanitize_text_field( $_POST['end_time'] ); } $name = sanitize_text_field( $_POST['name'] ); $repeat = sanitize_text_field( $_POST['repeat'] ); $start_date = sanitize_text_field($_POST['event_date'] ); $start_date = date("Y-m-d", strtotime($start_date)); //convert format //not repeat if($repeat == 'N') { $end_date = date("Y-m-d", strtotime($start_date)); //convert format } //particular day if($repeat == 'PD') { $end_date = sanitize_text_field( $_POST['end_date'] ); $end_date = date("Y-m-d", strtotime($end_date)); //convert format } //daily event will be 90 days if($repeat == 'D') { $repeat_days = intval( $_POST['re_days'] ); $repeat_days = $repeat_days - 1; $end_date = strtotime($start_date); $end_date = date("Y-m-d", strtotime("+$repeat_days days", $end_date)); //add entered days } //weekly event add 1 week if($repeat == 'W') { $repeat_weeks = intval( $_POST['re_weeks'] ); $end_date = strtotime($start_date); $end_date = date("Y-m-d", strtotime("+$repeat_weeks week", $end_date)); //add 1 week } //bi-weekly event add 1 week if($repeat == 'BW') { $repeat_weeks = intval( $_POST['re_biweeks'] ); $end_date = strtotime($start_date); $repeat_weeks = $repeat_weeks * 2; $end_date = date("Y-m-d", strtotime("+$repeat_weeks week", $end_date)); //add 1 week } //monthly event add 1 month if($repeat == 'M') { $repeat_months = intval( $_POST['re_months'] + 1 ); $end_date = strtotime($start_date); $end_date = date("Y-m-d", strtotime("+$repeat_months months", $end_date)); //add 1 month } $note = sanitize_text_field( $_POST['note'] ); $status = ""; global $wpdb; $EventTable = $wpdb->prefix."ap_events"; if($wpdb->query($wpdb->prepare("INSERT INTO `$EventTable` ( `id` , `name` , `allday` , `start_time` , `end_time` , `repeat` , `start_date` , `end_date` , `note` , `status` ) VALUES ( NULL , '$name', '$allday', '$start_time', '$end_time', '$repeat', '$start_date', '$end_date', '$note', %s);",$status))) { echo ""; echo ""; } } ?> prefix."ap_events"; $del_id = intval( $_GET['delete-timeoff'] ); if($wpdb->query($wpdb->prepare("delete from `$EventTable` where `id` = %s",$del_id))) { echo ""; echo ""; } else { echo ""; } } ?> prefix . "ap_events"; for($i=0; $i<=count($_POST['checkbox'])-1; $i++) { $res= intval( $_POST['checkbox'][$i] ); $deleteid= $res; $wpdb->query($wpdb->prepare("DELETE FROM `$table_name` WHERE `id` = %s;",$deleteid)); } if(count($_POST['checkbox'])) { echo ""; } else { echo ""; } echo ""; } ?>