item = intval($_GET["cal"]); $current_user = wp_get_current_user(); $current_user_access = current_user_can('edit_pages'); if ( !is_admin() || (!$current_user_access && !@in_array($current_user->ID, unserialize($this->get_option("cp_user_access",""))))) { echo 'Direct access not allowed.'; exit; } if ($this->item != 0) $myform = $wpdb->get_results( $wpdb->prepare('SELECT * FROM '.$wpdb->prefix.$this->table_items .' WHERE id=%d' ,$this->item) ); $default_from = date("Y-m-d",strtotime("today -10 days")); $default_to = date("Y-m-d",strtotime("today +30 days")); $dfrom = (@$_GET["dfrom"] ? date("Y-m-d", strtotime(@$_GET["dfrom"])) : $default_from); $dto = (@$_GET["dto"] ? date("Y-m-d", strtotime(@$_GET["dto"])) : $default_to); $dfrom_formatted = $this->format_date($dfrom); $dto_formatted = $this->format_date($dto); ?>