banner.php
1 year ago
cp-feedback.php
1 year ago
cp_admin_int_edition.inc.php
1 year ago
cpabc_appointments_admin_addbk.inc.php
1 year ago
cpabc_appointments_admin_int.inc.php
1 year ago
cpabc_appointments_admin_int_bookings_list.inc.php
1 year ago
cpabc_appointments_admin_int_calendar_list.inc.php
1 year ago
cpabc_appointments_admin_int_edit_booking.inc.php
1 year ago
cpabc_apps_go.inc.php
1 year ago
cpabc_apps_on.inc.php
1 year ago
cpabc_publish_wizzard.inc.php
1 year ago
cpabc_scheduler.inc.php
1 year ago
index.html
1 year ago
cpabc_appointments_admin_int_bookings_list.inc.php
440 lines
| 1 | <?php |
| 2 | |
| 3 | if ( !is_admin() ) |
| 4 | { |
| 5 | echo 'Direct access not allowed.'; |
| 6 | exit; |
| 7 | } |
| 8 | |
| 9 | if (!defined('CP_CALENDAR_ID')) |
| 10 | define ('CP_CALENDAR_ID', 1); |
| 11 | |
| 12 | global $wpdb; |
| 13 | |
| 14 | $current_user = wp_get_current_user(); |
| 15 | |
| 16 | $format = cpabc_appointments_getDateFormat(); |
| 17 | |
| 18 | $message = ""; |
| 19 | |
| 20 | $records_per_page = 50; |
| 21 | |
| 22 | function cpabc_bklist_verify_nonce() { |
| 23 | if (isset($_GET['rsave']) && $_GET['rsave'] != '') |
| 24 | $nonce = sanitize_text_field($_GET['rsave']); |
| 25 | else |
| 26 | $nonce = sanitize_text_field($_POST['rsave']); |
| 27 | $verify_nonce = wp_verify_nonce( $nonce, 'uname_abc_bklist'); |
| 28 | if (!$verify_nonce) |
| 29 | { |
| 30 | echo 'Error: Form cannot be authenticated (nonce failed). Please contact our <a href="https://abc.dwbooster.com/contact-us">support service</a> for verification and solution. Thank you.'; |
| 31 | exit; |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | if (isset($_GET['delmark']) && $_GET['delmark'] != '') |
| 36 | { |
| 37 | cpabc_bklist_verify_nonce(); |
| 38 | for ($i=0; $i<=$records_per_page; $i++) |
| 39 | if (isset($_GET['c'.$i]) && $_GET['c'.$i] != '') |
| 40 | $wpdb->query( $wpdb->prepare('DELETE FROM `'.CPABC_APPOINTMENTS_CALENDARS_TABLE_NAME.'` WHERE id=%d', $_GET['c'.$i]) ); |
| 41 | $message = "Marked items deleted"; |
| 42 | } |
| 43 | else if (isset($_GET['ld']) && $_GET['ld'] != '') |
| 44 | { |
| 45 | cpabc_bklist_verify_nonce(); |
| 46 | $wpdb->query( $wpdb->prepare('DELETE FROM `'.CPABC_APPOINTMENTS_CALENDARS_TABLE_NAME.'` WHERE id=%d', $_GET['ld']) ); |
| 47 | $message = "Item deleted"; |
| 48 | } |
| 49 | else if (isset($_GET['del']) && $_GET['del'] == 'all') |
| 50 | { |
| 51 | cpabc_bklist_verify_nonce(); |
| 52 | $wpdb->query( $wpdb->prepare( 'DELETE FROM `'.CPABC_APPOINTMENTS_CALENDARS_TABLE_NAME.'` WHERE appointment_calendar_id=%d', CP_CALENDAR_ID ) ); |
| 53 | $message = "All items deleted"; |
| 54 | } |
| 55 | else if (isset($_GET['paid']) && intval($_GET['paid'])) |
| 56 | { |
| 57 | cpabc_bklist_verify_nonce(); |
| 58 | $item = $wpdb->get_row("SELECT * FROM ".CPABC_APPOINTMENTS_CALENDARS_TABLE_NAME." WHERE id=".intval($_GET['paid'])); |
| 59 | $itemdetails = $wpdb->get_row("SELECT * FROM ".CPABC_APPOINTMENTS_TABLE_NAME." WHERE id=".intval($item->reference)); |
| 60 | $data = unserialize($itemdetails->buffered_date); |
| 61 | if (intval($_GET['paidac'])) |
| 62 | { |
| 63 | $data["payment_type"] = 'Manually updated'; |
| 64 | } |
| 65 | else |
| 66 | { |
| 67 | unset($data["payment_type"]); |
| 68 | unset($data["txnid"]); |
| 69 | } |
| 70 | //print_r($data); |
| 71 | do_action( 'cpabc_update_paid_status', intval($item->reference), (intval($_GET['paidac'])?true:false) ); |
| 72 | $wpdb->query("UPDATE ".CPABC_APPOINTMENTS_TABLE_NAME." set buffered_date='".esc_sql(serialize($data))."' WHERE id=".intval($item->reference)); |
| 73 | $message = "Paid status updated."; |
| 74 | } |
| 75 | else if (isset($_GET['cancel']) && $_GET['cancel'] != '') |
| 76 | { |
| 77 | cpabc_bklist_verify_nonce(); |
| 78 | $cancelc = intval($_GET['cancel']); |
| 79 | $wpdb->query("UPDATE `".CPABC_APPOINTMENTS_CALENDARS_TABLE_NAME."` SET who_cancelled='".esc_sql($current_user->ID)."',is_cancelled='1',cancelled_reason='".esc_sql($_GET["reason"])."' WHERE id=".intval($cancelc)); |
| 80 | $message = "Item cancelled"; |
| 81 | // send email to customer |
| 82 | $item = $wpdb->get_row("SELECT * FROM ".CPABC_APPOINTMENTS_CALENDARS_TABLE_NAME." WHERE id=".intval($cancelc)); |
| 83 | |
| 84 | $app_source = $wpdb->get_row("SELECT * FROM ".CPABC_APPOINTMENTS_TABLE_NAME." WHERE id=".intval($item->reference)); |
| 85 | $params = unserialize($app_source->buffered_date); |
| 86 | if ('html' == cpabc_get_option('cncustomer_emailformat')) $content_type = "Content-Type: text/html; charset=utf-8\n"; else $content_type = "Content-Type: text/plain; charset=utf-8\n"; |
| 87 | $email_content = str_replace('%INFORMATION%',str_replace('<br />',"\n",$item->description_customer), cpabc_get_option('cemail_notification_to_customer') ); |
| 88 | $params['ITEMNUMBER'] = $cancelc; |
| 89 | foreach ($params as $itemr => $value) |
| 90 | { |
| 91 | $email_content = str_replace('<%'.$itemr.'%>',(is_array($value)?(implode(", ",$value)):($value)),$email_content); |
| 92 | $email_content = str_replace('%'.$itemr.'%',(is_array($value)?(implode(", ",$value)):($value)),$email_content); |
| 93 | } |
| 94 | $email_content = str_replace("%CALENDAR%", cpabc_get_option('uname'), $email_content); |
| 95 | $email_content = str_replace("%cancelreason%", sanitize_text_field($_GET["reason"]), $email_content); |
| 96 | |
| 97 | //wp_mail($item->title, cpabc_get_option('cemail_subject_notification_to_customer'), $email_content, |
| 98 | // "From: \"".cpabc_get_option('notification_from_email')."\" <".cpabc_get_option('notification_from_email').">\r\n". |
| 99 | // $content_type. |
| 100 | // "X-Mailer: PHP/" . phpversion()); |
| 101 | } |
| 102 | else if (isset($_GET['nocancel']) && $_GET['nocancel'] != '') |
| 103 | { |
| 104 | cpabc_bklist_verify_nonce(); |
| 105 | $wpdb->query("UPDATE `".CPABC_APPOINTMENTS_CALENDARS_TABLE_NAME."` SET who_edited='".esc_sql($current_user->ID)."',is_cancelled='0' WHERE id=".intval($_GET['nocancel'])); |
| 106 | $message = "Item un-cancelled"; |
| 107 | } |
| 108 | else if (isset($_GET['resend']) && $_GET['resend'] != '') |
| 109 | { |
| 110 | cpabc_bklist_verify_nonce(); |
| 111 | $events = $wpdb->get_results( "SELECT * FROM ".CPABC_APPOINTMENTS_CALENDARS_TABLE_NAME." WHERE id=".intval($_GET['resend']) ); |
| 112 | $events = $wpdb->get_results( "SELECT * FROM ".CPABC_APPOINTMENTS_TABLE_NAME." WHERE id=".intval($events[0]->reference) ); |
| 113 | define('CPABC_IS_RESEND', true); |
| 114 | cpabc_process_ready_to_go_appointment($events[0]->id,'',true); |
| 115 | $message = "Item re-sent"; |
| 116 | } |
| 117 | |
| 118 | |
| 119 | |
| 120 | $mycalendarrows = $wpdb->get_results( 'SELECT * FROM '.CPABC_APPOINTMENTS_CONFIG_TABLE_NAME .' WHERE `'.CPABC_TDEAPP_CONFIG_ID.'`='.CP_CALENDAR_ID); |
| 121 | |
| 122 | if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset( $_POST['cpabc_appointments_post_options'] ) ) |
| 123 | echo "<div id='setting-error-settings_updated' class='updated settings-error'> <p><strong>Settings saved.</strong></p></div>"; |
| 124 | |
| 125 | $current_user = wp_get_current_user(); |
| 126 | |
| 127 | if (cpabc_appointment_is_administrator() || $mycalendarrows[0]->conwer == $current_user->ID) { |
| 128 | |
| 129 | $current_page = intval(cpabc_get_get_param("p")); |
| 130 | if (!$current_page) $current_page = 1; |
| 131 | |
| 132 | $cond = ''; |
| 133 | if (cpabc_get_get_param("search") != '') |
| 134 | { |
| 135 | $search_text = sanitize_text_field($_GET["search"]); |
| 136 | $cond .= " AND (title like '%".esc_sql($search_text)."%' OR description LIKE '%".esc_sql($search_text)."%')"; |
| 137 | } |
| 138 | if (cpabc_get_get_param("dfrom") != '') $cond .= " AND (datatime >= '".esc_sql(sanitize_text_field($_GET["dfrom"]))."')"; |
| 139 | if (cpabc_get_get_param("dto") != '') $cond .= " AND (datatime <= '".esc_sql(sanitize_text_field($_GET["dto"]))." 23:59:59')"; |
| 140 | |
| 141 | |
| 142 | if (!empty($_GET["added_by"]) && $_GET["added_by"] != '') $cond .= " AND (who_added >= '".esc_sql(sanitize_text_field($_GET["added_by"]))."')"; |
| 143 | if (!empty($_GET["edited_by"]) && $_GET["edited_by"] != '') $cond .= " AND (who_edited >= '".esc_sql(sanitize_text_field($_GET["edited_by"]))."')"; |
| 144 | if (!empty($_GET["cancelled_by"]) && $_GET["cancelled_by"] != '') $cond .= " AND (is_cancelled='1' AND who_cancelled >= '".esc_sql(sanitize_text_field($_GET["cancelled_by"]))."')"; |
| 145 | if (!empty($_GET["cstatus"]) && $_GET["cstatus"] == 'cancelled') $cond .= " AND (is_cancelled='1')"; |
| 146 | if (!empty($_GET["cstatus"]) && $_GET["cstatus"] == 'approved') $cond .= " AND (is_cancelled<>'1')"; |
| 147 | |
| 148 | |
| 149 | $orderby = empty($_GET["orderby"]) ? 'datatime DESC' : sanitize_text_field($_GET["orderby"]); |
| 150 | if ($orderby != 'id DESC' && $orderby != 'id ASC' && $orderby != 'datatime DESC' && $orderby != 'datatime ASC') |
| 151 | $orderby = 'datatime DESC'; |
| 152 | |
| 153 | $events = $wpdb->get_results( "SELECT ".CPABC_APPOINTMENTS_CALENDARS_TABLE_NAME.".*,".CPABC_APPOINTMENTS_TABLE_NAME.".buffered_date,".CPABC_APPOINTMENTS_TABLE_NAME.".time FROM ".CPABC_APPOINTMENTS_CALENDARS_TABLE_NAME." LEFT JOIN ".CPABC_APPOINTMENTS_TABLE_NAME." ON ".CPABC_APPOINTMENTS_TABLE_NAME.".id=".CPABC_APPOINTMENTS_CALENDARS_TABLE_NAME.".reference WHERE appointment_calendar_id=".intval(CP_CALENDAR_ID).$cond." ORDER BY ".$orderby." " ); |
| 154 | $total_pages = ceil(count($events) / $records_per_page); |
| 155 | |
| 156 | $users_arr = array(); |
| 157 | $users_arr['id-1'] = 'CUSTOMER'; |
| 158 | $users = $wpdb->get_results( "SELECT user_login,ID FROM ".$wpdb->users." ORDER BY ID DESC" ); |
| 159 | foreach ($users as $user) |
| 160 | $users_arr["id".$user->ID] = $user; |
| 161 | |
| 162 | if ($message) echo "<div id='setting-error-settings_updated' class='updated settings-error'><p><strong>".esc_html($message)."</strong></p></div>"; |
| 163 | |
| 164 | $nonce_un = wp_create_nonce( 'uname_abc_bklist' ); |
| 165 | |
| 166 | ?> |
| 167 | <script type="text/javascript"> |
| 168 | function cp_deleteMessageItem(id) |
| 169 | { |
| 170 | if (confirm('Are you sure that you want to delete this item?')) |
| 171 | { |
| 172 | document.location = 'admin.php?page=cpabc_appointments.php&rsave=<?php echo esc_attr($nonce_un); ?>&cal=<?php echo intval($_GET["cal"]); ?>&list=1&ld='+id+'&r='+Math.random(); |
| 173 | } |
| 174 | } |
| 175 | function do_dexapp_deleteall() |
| 176 | { |
| 177 | if (confirm('Are you sure that you want to delete ALL bookings for this calendar? Note: This action cannot be undone.')) |
| 178 | { |
| 179 | document.location = 'admin.php?page=cpabc_appointments.php&rsave=<?php echo esc_attr($nonce_un); ?>&cal=<?php echo intval($_GET["cal"]); ?>&list=1&del=all&r='+Math.random(); |
| 180 | } |
| 181 | } |
| 182 | function cp_paidMessageItem(id,ac) |
| 183 | { |
| 184 | if (confirm('Are you sure that you want to change this paid status?')) |
| 185 | { |
| 186 | document.location = 'admin.php?page=cpabc_appointments.php&rsave=<?php echo esc_attr($nonce_un); ?>&cal=<?php echo intval($_GET["cal"]); ?>&list=1&paid='+id+'&paidac='+ac+'&r='+Math.random(); |
| 187 | } |
| 188 | } |
| 189 | function cp_editItem(id, cal) |
| 190 | { |
| 191 | document.location = 'admin.php?page=cpabc_appointments.php&rsave=<?php echo esc_attr($nonce_un); ?>&cal='+cal+'&edit='+id+'&r='+Math.random(); |
| 192 | } |
| 193 | function cp_uncancelItem(id) |
| 194 | { |
| 195 | if (confirm('Are you sure that you want to un-cancel this item?')) |
| 196 | { |
| 197 | document.location = 'admin.php?page=cpabc_appointments.php&rsave=<?php echo esc_attr($nonce_un); ?>&cal=<?php echo intval($_GET["cal"]); ?>&list=1&nocancel='+id+'&r='+Math.random(); |
| 198 | } |
| 199 | } |
| 200 | function cp_resendItem(id) |
| 201 | { |
| 202 | if (confirm('Are you sure that you want to resend this email?')) |
| 203 | { |
| 204 | document.location = 'admin.php?page=cpabc_appointments.php&rsave=<?php echo esc_attr($nonce_un); ?>&cal=<?php echo intval($_GET["cal"]); ?>&list=1&resend='+id+'&r='+Math.random(); |
| 205 | } |
| 206 | } |
| 207 | function cp_cancelItem(id) |
| 208 | { |
| 209 | var reason; |
| 210 | if (reason = prompt('Please enter cancellation reason:')) |
| 211 | { |
| 212 | document.location = 'admin.php?page=cpabc_appointments.php&rsave=<?php echo esc_attr($nonce_un); ?>&cal=<?php echo intval($_GET["cal"]); ?>&list=1&cancel='+id+'&reason='+reason; |
| 213 | } |
| 214 | } |
| 215 | </script> |
| 216 | <div class="wrap"> |
| 217 | <h1>Appointment Booking Calendar - Bookings List</h1> |
| 218 | |
| 219 | <input type="button" name="backbtn" value="Back to items list..." onclick="document.location='admin.php?page=cpabc_appointments.php';"> |
| 220 | |
| 221 | |
| 222 | <div id="normal-sortables" class="meta-box-sortables"> |
| 223 | <hr /> |
| 224 | <h3>This booking list applies only to: <?php echo esc_html($mycalendarrows[0]->uname); ?></h3> |
| 225 | </div> |
| 226 | |
| 227 | |
| 228 | <form action="admin.php" method="get"> |
| 229 | <input type="hidden" name="rsave" value="<?php echo esc_attr($nonce_un); ?>" /> |
| 230 | <input type="hidden" name="page" value="cpabc_appointments.php" /> |
| 231 | <input type="hidden" name="cal" value="<?php echo intval(CP_CALENDAR_ID); ?>" /> |
| 232 | <input type="hidden" name="list" value="1" /> |
| 233 | <table> |
| 234 | <tr> |
| 235 | <td align="right">Search for:</td> |
| 236 | <td><input type="text" name="search" value="<?php echo esc_attr(cpabc_get_get_param("search")); ?>" /></td> |
| 237 | <td align="right">From:</td> |
| 238 | <td><input autocomplete="off" type="text" id="dfrom" name="dfrom" value="<?php echo esc_attr(cpabc_get_get_param("dfrom")); ?>" /></td> |
| 239 | <td align="right">To:</td> |
| 240 | <td><input autocomplete="off" type="text" id="dto" name="dto" value="<?php echo esc_attr(cpabc_get_get_param("dto")); ?>" /></td> |
| 241 | </tr> |
| 242 | <?php if (cpabc_appointment_is_administrator()) { ?> |
| 243 | <tr> |
| 244 | <td align="right">Added by:</td> |
| 245 | <td><select name="added_by"><option value="">--- all users ---</option><?php foreach ($users as $user) echo '<option value="'.esc_attr($user->ID).'"'.($user->ID==cpabc_get_get_param("added_by")?' selected':'').'>'.esc_html($user->user_login).'</option>'; ?></select></td> |
| 246 | <td align="right">Edited by:</td> |
| 247 | <td><select name="edited_by"><option value="">--- all users ---</option><?php foreach ($users as $user) echo '<option value="'.esc_attr($user->ID).'"'.($user->ID==cpabc_get_get_param("edited_by")?' selected':'').'>'.esc_html($user->user_login).'</option>'; ?></select></td> |
| 248 | <td align="right">Cancelled by:</td> |
| 249 | <td><select name="cancelled_by"><option value="">--- all users ---</option><?php foreach ($users as $user) echo '<option value="'.esc_attr($user->ID).'"'.($user->ID==cpabc_get_get_param("cancelled_by")?' selected':'').'>'.esc_html($user->user_login).'</option>'; ?></select></td> |
| 250 | </tr> |
| 251 | <tr> |
| 252 | <td align="right">Status:</td> |
| 253 | <td><select name="cstatus"> |
| 254 | <option value="">--- all ---</option> |
| 255 | <option value="approved" <?php if (!empty($_GET["cstatus"]) && $_GET["cstatus"] == 'approved') echo ' selected '; ?>>active</option> |
| 256 | <option value="cancelled" <?php if (!empty($_GET["cstatus"]) && $_GET["cstatus"] == 'cancelled') echo ' selected '; ?>>cancelled</option> |
| 257 | </select></td> |
| 258 | <?php } ?> |
| 259 | <td align="right" nowrap>Order By</td> |
| 260 | <td colspan="2"> |
| 261 | <select name="orderby"> |
| 262 | <option value="id DESC" <?php if ($orderby == 'id DESC') echo ' selected'; ?>>Submission time - desc</option> |
| 263 | <option value="id ASC" <?php if ($orderby == 'id ASC') echo ' selected'; ?>>Submission time - asc</option> |
| 264 | <option value="datatime DESC" <?php if ($orderby == 'datatime DESC') echo ' selected'; ?>>Appointment time - desc</option> |
| 265 | <option value="datatime ASC" <?php if ($orderby == 'datatime ASC') echo ' selected'; ?>>Appointment time - asc</option> |
| 266 | </select> |
| 267 | </td> |
| 268 | </tr> |
| 269 | <tr> |
| 270 | <td> </td> |
| 271 | <td colspan="5"> |
| 272 | <span class="submit"><input type="submit" name="ds" value="Filter" /></span> |
| 273 | <nobr> |
| 274 | <span class="submit"><input type="submit" name="cpabc_appointments_csv" value="Export to CSV" /></span> |
| 275 | </nobr> |
| 276 | </td> |
| 277 | </tr> |
| 278 | </table> |
| 279 | |
| 280 | </form> |
| 281 | |
| 282 | <br /> |
| 283 | |
| 284 | <?php |
| 285 | |
| 286 | |
| 287 | echo paginate_links( array( |
| 288 | 'base' => 'admin.php?page=cpabc_appointments.php&cal='.CP_CALENDAR_ID.'&list=1%_%&dfrom='.urlencode(sanitize_text_field(cpabc_get_get_param("dfrom"))).'&dto='.urlencode(sanitize_text_field(cpabc_get_get_param("dto"))).'&search='.urlencode(sanitize_text_field(cpabc_get_get_param("search"))), |
| 289 | 'format' => '&p=%#%', |
| 290 | 'total' => $total_pages, |
| 291 | 'current' => $current_page, |
| 292 | 'show_all' => False, |
| 293 | 'end_size' => 1, |
| 294 | 'mid_size' => 2, |
| 295 | 'prev_next' => True, |
| 296 | 'prev_text' => '« '.__('Previous','appointment-booking-calendar'), |
| 297 | 'next_text' => __('Next','appointment-booking-calendar').' »', |
| 298 | 'type' => 'plain', |
| 299 | 'add_args' => False |
| 300 | ) ); |
| 301 | |
| 302 | ?> |
| 303 | |
| 304 | <div id="cpabc_printable_contents"> |
| 305 | <form name="dex_table_form" id="dex_table_form" action="admin.php" method="get"> |
| 306 | <input type="hidden" name="page" value="cpabc_appointments.php" /> |
| 307 | <input type="hidden" name="cal" value="<?php echo intval($_GET["cal"]); ?>" /> |
| 308 | <input type="hidden" name="list" value="1" /> |
| 309 | <input type="hidden" name="rsave" value="<?php echo esc_attr($nonce_un); ?>" /> |
| 310 | <input type="hidden" name="delmark" value="1" /> |
| 311 | <table class="wp-list-table widefat fixed pages" cellspacing="0" width="100%"> |
| 312 | <thead> |
| 313 | <tr> |
| 314 | <th width="30" class="cpnopr"></th> |
| 315 | <th style="padding-left:7px;font-weight:bold;">Date</th> |
| 316 | <th style="padding-left:7px;font-weight:bold;">Title</th> |
| 317 | <th style="padding-left:7px;font-weight:bold;">Description</th> |
| 318 | <th style="padding-left:7px;font-weight:bold;">Quantity</th> |
| 319 | <th class="cpnopr" style="padding-left:7px;font-weight:bold;">Options</th> |
| 320 | </tr> |
| 321 | </thead> |
| 322 | <tbody id="the-list"> |
| 323 | <?php for ($i=($current_page-1)*$records_per_page; $i<$current_page*$records_per_page; $i++) if (isset($events[$i])) { ?> |
| 324 | <tr class='<?php if (!($i%2)) { ?>alternate <?php } ?>author-self status-draft format-default iedit' valign="top"> |
| 325 | <td width="1%" class="cpnopr"><input type="checkbox" name="c<?php echo intval($i-($current_page-1)*$records_per_page); ?>" value="<?php echo intval($events[$i]->id); ?>" /></td> |
| 326 | <td><?php echo esc_html(substr($events[$i]->datatime,0,16)); ?></td> |
| 327 | <td><?php echo esc_html($events[$i]->title); ?></td> |
| 328 | <td><?php echo str_replace('--br />','<br />',str_replace('<','<',str_replace('<br />','--br />',$events[$i]->description))); ?></td> |
| 329 | <td><?php echo intval($events[$i]->quantity); ?></td> |
| 330 | <td <?php if ($events[$i]->is_cancelled == '1') { ?>style="color:#faabbb;"<?php } ?> class="cpnopr"> |
| 331 | <input type="button" name="caledit_<?php echo esc_attr($events[$i]->id); ?>" value="Edit" onclick="cp_editItem(<?php echo intval($events[$i]->id); ?>,<?php echo intval($events[$i]->appointment_calendar_id); ?>);" /> |
| 332 | <?php if ($events[$i]->is_cancelled == '1') { ?> |
| 333 | <input type="button" name="calcancel_<?php echo intval($events[$i]->id); ?>" value="Un-Cancel" onclick="cp_uncancelItem(<?php echo intval($events[$i]->id); ?>);" /> |
| 334 | <?php } else { ?> |
| 335 | <input type="button" name="calcancel_<?php echo intval($events[$i]->id); ?>" value="Cancel" onclick="cp_cancelItem(<?php echo intval($events[$i]->id); ?>);" /> |
| 336 | <?php } ?> |
| 337 | <input type="button" name="resend_<?php echo intval($events[$i]->id); ?>" value="Resend Email" onclick="cp_resendItem(<?php echo intval($events[$i]->id); ?>);" /> |
| 338 | <?php if (cpabc_appointment_is_administrator()) { ?><input type="button" name="caldelete_<?php echo intval($events[$i]->id); ?>" value="Delete" onclick="cp_deleteMessageItem(<?php echo intval($events[$i]->id); ?>);" /><?php } ?> |
| 339 | <span style="font-style:italic;font-size:11px;"> |
| 340 | <?php |
| 341 | if (isset($users_arr["id".$events[$i]->who_added])) |
| 342 | echo '<br />Added by: <strong>'. esc_html($users_arr["id".$events[$i]->who_added]->user_login).'</strong>'; |
| 343 | if (isset($users_arr["id".$events[$i]->who_edited])) |
| 344 | echo '<br />Edited by: <strong>'.esc_html($users_arr["id".$events[$i]->who_edited]->user_login).'</strong>'; |
| 345 | if (isset($users_arr["id".$events[$i]->who_cancelled]) && $events[$i]->is_cancelled == '1') |
| 346 | if ($events[$i]->who_cancelled == '-1') |
| 347 | echo '<br />Cancelled by: <strong><b>'.esc_html($users_arr["id".$events[$i]->who_cancelled]).'</b></strong>'; |
| 348 | else |
| 349 | echo '<br />Cancelled by: <strong>'.esc_html($users_arr["id".$events[$i]->who_cancelled]->user_login).'</strong>'; |
| 350 | |
| 351 | if ($events[$i]->cancelled_reason != '' && $events[$i]->is_cancelled == '1') |
| 352 | echo '<br />Cancelled reason: <strong>'.esc_html($events[$i]->cancelled_reason).'</strong>'; |
| 353 | |
| 354 | $params = unserialize($events[$i]->buffered_date); |
| 355 | |
| 356 | if (is_array($params) && (array_key_exists("txnid",$params) || (isset($params["payment_type"]) && ($params["payment_type"] != 'PayPal' || isset($params["txnid"]))))) |
| 357 | { |
| 358 | echo '<hr /><span class="abcpaid">'; |
| 359 | esc_html_e('Paid.','appointment-booking-calendar'); |
| 360 | if (isset($params["payment_type"]) && ($params["payment_type"] != 'PayPal' || isset($params["txnid"]))) echo esc_html($params["payment_type"])."."; |
| 361 | if (isset($params["txnid"])) { esc_html_e('Payment ID','appointment-booking-calendar'); echo ": ".esc_html($params["txn_id"]?$params["txn_id"]:' --- '); } |
| 362 | echo '</span>'; |
| 363 | ?><br /><input type="button" name="calpaide_<?php echo intval($events[$i]->id); ?>" value="Mark as unpaid" onclick="cp_paidMessageItem(<?php echo intval($events[$i]->id); ?>,0);" /><?php |
| 364 | } |
| 365 | else |
| 366 | { |
| 367 | echo '<hr /><span class="abcunpaid">'; |
| 368 | esc_html_e('Payment: not confirmed so far','appointment-booking-calendar'); |
| 369 | echo '</span>'; |
| 370 | ?><br /><input type="button" name="calpaide_<?php echo intval($events[$i]->id); ?>" value="Mark as paid" onclick="cp_paidMessageItem(<?php echo intval($events[$i]->id); ?>,1);" /><?php |
| 371 | } |
| 372 | echo '<hr /><span class="abcsubdate">'; |
| 373 | esc_html_e('Submission date:','appointment-booking-calendar'); |
| 374 | echo '</span><br /><strong>'. esc_html(date($format,strtotime($events[$i]->time))).'</strong>'; |
| 375 | ?> |
| 376 | </SPAN> |
| 377 | </td> |
| 378 | </tr> |
| 379 | <?php } ?> |
| 380 | </tbody> |
| 381 | </table> |
| 382 | </form> |
| 383 | </div> |
| 384 | |
| 385 | <br /><input type="button" name="pbutton" value="Print" onclick="do_dexapp_print();" /> |
| 386 | <div style="clear:both"></div> |
| 387 | <p class="submit" style="float:left;"><input type="button" name="pbutton" value="Delete marked items" onclick="do_dexapp_deletemarked();" /> </p> |
| 388 | |
| 389 | <p class="submit" style="float:left;"><input type="button" name="pbutton" value="Delete All Bookings" onclick="do_dexapp_deleteall();" /></p> |
| 390 | |
| 391 | |
| 392 | </div> |
| 393 | |
| 394 | |
| 395 | <script type="text/javascript"> |
| 396 | function do_dexapp_print() |
| 397 | { |
| 398 | w=window.open(); |
| 399 | w.document.write("<style>.cpnopr{display:none;};table{border:2px solid black;width:100%;}th{border-bottom:2px solid black;text-align:left}td{padding-left:10px;border-bottom:1px solid black;}</style>"+document.getElementById('cpabc_printable_contents').innerHTML); |
| 400 | w.print(); |
| 401 | } |
| 402 | function do_dexapp_deletemarked() |
| 403 | { |
| 404 | document.dex_table_form.submit(); |
| 405 | } |
| 406 | var $j = jQuery.noConflict(); |
| 407 | $j(function() { |
| 408 | $j("#dfrom").datepicker({ |
| 409 | dateFormat: 'yy-mm-dd' |
| 410 | }); |
| 411 | $j("#dto").datepicker({ |
| 412 | dateFormat: 'yy-mm-dd' |
| 413 | }); |
| 414 | }); |
| 415 | |
| 416 | </script> |
| 417 | <style> |
| 418 | .abcpaid { font-weight: bold; color: green; font-size: 110%; } |
| 419 | .abcunpaid { } |
| 420 | </style> |
| 421 | |
| 422 | |
| 423 | |
| 424 | <?php } else { ?> |
| 425 | <br /> |
| 426 | The current user logged in doesn't have enough permissions to edit this calendar. This user can edit only his/her own calendars. Please log in as administrator to get access to all calendars. |
| 427 | |
| 428 | <?php } ?> |
| 429 | |
| 430 | |
| 431 | |
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 |