item = $_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 ( !is_admin() ) { 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) ); $current_page = intval($_GET["p"]); if (!$current_page) $current_page = 1; $records_per_page = 50; $date_start = ''; $date_end = ''; $cond = ''; if ($_GET["search"] != '') $cond .= " AND (data like '%".esc_sql($_GET["search"])."%' OR posted_data LIKE '%".esc_sql($_GET["search"])."%')"; if ($_GET["dfrom"] != '') { $cond .= " AND (`time` >= '".esc_sql($_GET["dfrom"])."')"; $date_start = $_GET["dfrom"]; } if ($_GET["dto"] != '') { $cond .= " AND (`time` <= '".esc_sql($_GET["dto"])." 23:59:59')"; $date_end = $_GET["dto"]; } if ($this->item != 0) $cond .= " AND formid=".$this->item; $events = $wpdb->get_results( "SELECT ipaddr,time,notifyto,posted_data FROM ".$wpdb->prefix.$this->table_messages." WHERE 1=1 ".$cond." ORDER BY `time` DESC" ); // general initialization $fields = array(); $fields["date"] = array(); $fields["ip"] = array(); $fields["notifyto"] = array(); foreach ($events as $item) { $fields["date"]["k".substr($item->time,0,10)]++; $fields["time"]["k".substr($item->time,11,2)]++; $fields["notifyto"]["k".$item->notifyto]++; $fields["ip"]["k".$item->ipaddr]++; $params = unserialize($item->posted_data); foreach ($params as $param => $value) if (strlen($value) < 100) $fields[$param]["k".$value]++; } // line graphs $hourly_messages = ''; for ($i=0;$i<=23;$i++) if (isset($fields['time']['k'.($i<10?'0':'').$i])) $hourly_messages .= $fields['time']['k'.($i<10?'0':'').$i].($i<23?',':''); else $hourly_messages .='0'.($i<23?',':''); if ($date_start == '') $date_start = substr(min(array_keys($fields["date"])),1); if ($date_end == '') $date_end = substr(max(array_keys($fields["date"])),1); $daily_messages = ''; $date = $date_start; while ($date <= $date_end) { if (isset($fields['date']['k'.$date])) $daily_messages .= ','.$fields['date']['k'.$date]; else $daily_messages .=',0'; $date = date("Y-m-d",strtotime($date." +1 day")); } $daily_messages = substr($daily_messages,1); if (!isset($_GET["field"])) $_GET["field"] = 'time'; $color_array = array('ffb3ba','ffdfba','ffffba', 'baffc9', 'bae1ff', 'a8e6cf', 'dcedc1', 'ffd3b6', 'ffaaa5', 'ff8b94', 'eea990', 'adcbe3', 'e2f4c7'); if ($this->item) { $form = json_decode($this->cleanJSON($this->get_option('form_structure', CP_APPBOOK_DEFAULT_form_structure))); $form = $form[0]; } else $form = array(); ?>

Stats - get_option("form_name"); ?>

" /> ">   " >   " >  

*
   to .

*
   .

" /> " /> " />

:

: get_form_field_label($_GET["field"],$form); ?>
$value) $total += $value; /* $max = max($arr); $totalsize = round(600 / ($max/$total) ); */ $count = 0; foreach ($arr as $item => $value) { echo $value.' times: '.(strlen($item)>50?substr($item,1,50).'...':substr($item,1)); echo '
'.round($value/$total*100,2).'%
'; $count++; if ($count >= count($color_array)) $count = count($color_array)-1; } ?>
  *
     .