<?php global $wpdb, $signature; $prefix = $wpdb->base_prefix; $id = $_REQUEST['id']; $pack = templecalendar('', " and id='{$id}'"); $temple_id = $pack[0]->temple_id; $image = $pack[0]->image; $link = '&ho=listcalendar&temple_id=' . $temple_id; if (trim($image) != '' && file_exists('../wp-content/uploads/temples/calendar/' . $image)) { unlink('../wp-content/uploads/temples/calendar/' . $image); } $result = $wpdb->query("DELETE FROM `" . $prefix . "temple_calendar` where id='{$id}'"); $url = get_option('home') . '/wp-admin/admin.php?page=Temples&del=succ' . $link; echo "<script>window.location='" . $url . "'</script>";
while ($blank > 0) { echo "<td class='blank'></td>"; $blank = $blank - 1; $day_count++; } //sets the first day of the month to 1 $day_num = 1; //count up the days, untill we've done all of them in the month while ($day_num <= $days_in_month) { if ($day_num < 10) { $d_n = '0' . $day_num; } else { $d_n = $day_num; } $cdate = $year . '-' . $month . '-' . $d_n; $calendar = templecalendar($temple_id, " and cdate='{$cdate}'"); if (count($calendar) > 0) { $img = '<img src="' . get_option('home') . '/wp-content/themes/temple/images/calendar_default.jpg" alt="' . $calendar[0]->title . '" style="max-width:50px;" />'; if (trim($calendar[0]->image) != '' && file_exists('../../../wp-content/uploads/temples/calendar/' . $calendar[0]->image)) { $img = '<img src="' . get_option('home') . '/wp-content/uploads/temples/calendar/' . $calendar[0]->image . '" alt="' . $calendar[0]->title . '" style="max-width:50px;" />'; } echo '<td> <a href="javascript:;" class="showcaldetail" title="' . $calendar[0]->title . '">' . $day_num . '<br class="clr" />' . $img . '</a> <div class="calendardetail"> <div class="closebtns"><a href="javascript:;" class="closecalendar">Close</a> <a href="javascript:;" class="movecalendar">Move</a></div> <div class="calcontents"> <p>Special : <span>' . $calendar[0]->special . '</span></p> <p>Worship : <span>' . $calendar[0]->worship . '</span></p> </div> </div> </td>'; } else {