public function display() { /*CHART*/ $chart = new VerticalBarChart(4500, 350); $dataSet = new XYDataSet(); foreach ($this->data as $key => $datum) { $dataSet->addPoint(new Point($datum['client_ip'], $datum['frequency'])); } $chart->setDataSet($dataSet); $chart->getPlot()->setLogoFileName(""); //clear the image logo $chart->setTitle(""); //clear the image title $chart->render("front-end/images/client_request_vertical_bar_plot.png"); /*CHART*/ $session = SessionFactory::create(); $dom = DOMHandlerFactory::create(); $dom->setDocumentFromFile(STATISTICAL_LOG_ANALIZER_HTML)->whereIdIs('login-user')->insertNode($session->get('session-user-name')); $selectedDate = $session->get("selected-date"); $title = "<h3>Bar Graph IP requests for the day: " . $selectedDate . " </h3>"; $dom->whereIdIs("body-title")->insertNode($title); $graph = '<div style="text-align: center;"> <img src="front-end/images/client_request_vertical_bar_plot.png" alt="" border="0"> </div>'; $dom->whereIdIs("squidDataContainer")->insertNode($graph); $dom->display(); }
//liste des catégories croiser avec l'année $categorie, $year frequentation depuis année 0 //Categories $nbcategories = CountCategories(); //donnes du graphique $chartCat = new VerticalBarChart(425, 300); $dataSetCat = new XYDataSet(); $y = $year; if ($nbcategories > 0) { for ($n = 1; $n <= $nbcategories; $n++) { $categories = mysqli_fetch_array(statSessionCategory($n, $y, $epn)); //debug($categories); $particip = round($categories['presents'] / $categories['inscrits'] * 100, 2) . " %"; $dataSetCat->addPoint(new Point($categories['label_categorie'], $particip)); } //creation du graphique $chartCat->setDataSet($dataSetCat); $chartCat->setTitle("Participation par categories en %"); $chartCat->getPlot()->getPalette()->setBarColor(array(new Color(1, 105, 201))); $chartCat->render("img/chart/" . $year . "/categorieSession.png"); } ?> <!-- Mettre en evidence frequentation participation --> <div class="box box-primary"> <div class="box-header"><i class="fa fa-bar-chart-o"></i><h3 class="box-title">Fréquentation des sessions (année <?php echo $year; ?> )</h3></div> <div class="box-body"> <table class="table">
public function printTop10Urls() { $db_query = "SELECT url, COUNT(url) AS count\n FROM connections\n WHERE url <> ''\n GROUP BY url\n ORDER BY COUNT(url) DESC\n LIMIT 10"; $rows = R::getAll($db_query); if (count($rows)) { //We create a new vertical bar chart and initialize the dataset $chart = new VerticalBarChart(600, 300); $dataSet = new XYDataSet(); //We create a skeleton for the table $counter = 1; echo '<h3>Top 10 urls</h3>'; echo '<p>The following table displays the top 10 urls used by attackers.</p>'; echo '<p><a href="include/export.php?type=Urls">CSV of all urls</a><p>'; echo '<table><thead>'; echo '<tr class="dark">'; echo '<th>ID</th>'; echo '<th>Url</th>'; echo '<th>Count</th>'; echo '</tr></thead><tbody>'; //For every row returned from the database we add a new point to the dataset, //and create a new table row with the data as columns foreach ($rows as $row) { $dataSet->addPoint(new Point($row['url'], $row['count'])); echo '<tr class="light word-break">'; echo '<td>' . $counter . '</td>'; echo '<td>' . xss_clean($row['url']) . '</td>'; echo '<td>' . $row['count'] . '</td>'; echo '</tr>'; $counter++; } //Close tbody and table element, it's ready. echo '</tbody></table>'; //We set the bar chart's dataset and render the graph $chart->setDataSet($dataSet); $chart->setTitle(TOP_10_URLS); //For this particular graph we need to set the corrent padding $chart->getPlot()->setGraphPadding(new Padding(5, 40, 120, 50)); //top, right, bottom, left | defaults: 5, 30, 50, 50 $chart->render("generated-graphs/top10_urls.png"); echo '<p>This vertical bar chart visualizes the top 10 urls used by attackers.</p>'; echo '<img src="generated-graphs/top10_urls.png">'; echo '<hr /><br />'; } }
$chartC->setTitle("Nombre d'ateliers par categories sur l'annee"); $chartC->getPlot()->getPalette()->setBarColor(array(new Color(1, 105, 201))); $chartC->render("img/chart/" . $year . "/categorieAtelier.png"); } //GRAPHIQUE 2 : taux de presence par categorie sur l'année $chartC2 = new VerticalBarChart(449, 250); $dataSetC2 = new XYDataSet(); if ($nbcategories > 0) { for ($x = 1; $x <= $nbcategories; $x++) { $categorieT = mysqli_fetch_array(StatPresentsCat($year, $x, $epn)); //debug($categorieT); $tauxP = number_format($categorieT['NumP'] / $categorieT['NumI'] * 100, 2) . " %"; $dataSetC2->addPoint(new Point($categorieT['label_categorie'], $tauxP)); } //creation du graphique $chartC2->setDataSet($dataSetC2); $chartC2->setTitle("Taux de presence par categories sur l'annee"); $chartC2->getPlot()->getPalette()->setBarColor(array(new Color(1, 105, 201))); $chartC2->render("img/chart/" . $year . "/categorieB.png"); } ?> <img src="img/chart/<?php echo $year; ?> /categorieAtelier.png"> <img src="img/chart/<?php echo $year; ?> /categorieB.png"> </div></div>
private function roleMainShow() { $roleEname = get_role_ename($_SESSION[C('USER_AUTH_KEY')]); $employeeId = get_employeeid($_SESSION[C('USER_AUTH_KEY')]); $this->assign('roleEname', $roleEname); if ($roleEname == "customCenterWorker") { $OrderBase = D('OrderBase'); $List = array(); $postCodeNameList = $OrderBase->table(array('tb_order_base' => 'order_base'))->join('tb_magazine magazine on magazine.postCode = order_base.postCode')->join('tb_employee_newspaper employee_newspaper on employee_newspaper.postCode = order_base.postCode')->Distinct('order_base.postCode')->field('magazine.postCode, magazine.name')->where("employee_newspaper.personID = '" . get_employeeid($_SESSION[C('USER_AUTH_KEY')]) . "'")->order('employee_newspaper.operatingFrequency desc')->select(); foreach ($postCodeNameList as $key => $vo) { $List[$key]['postCodeName'] = $vo['name']; $map['postCode'] = $vo['postCode']; $List[$key]['orderNum'] = $OrderBase->where($map)->Distinct('contractID')->count('contractID'); unset($map); $map['postCode'] = $vo['postCode']; $map['isChecked'] = array('eq', '0'); $List[$key]['sumUnChecked'] = $OrderBase->where($map)->Distinct('contractID')->count('contractID'); unset($map); $map['postCode'] = $vo['postCode']; $map['isChecked'] = array('eq', '1'); $List[$key]['sumChecked'] = $OrderBase->where($map)->Distinct('contractID')->count('contractID'); unset($map); $map['postCode'] = $vo['postCode']; $map['isSend'] = array('eq', '0'); $List[$key]['sumUnSend'] = $OrderBase->where($map)->Distinct('contractID')->count('contractID'); unset($map); $map['postCode'] = $vo['postCode']; $map['isSend'] = array('eq', '1'); $List[$key]['sumSend'] = $OrderBase->where($map)->Distinct('contractID')->count('contractID'); unset($map); } $this->assign('List', $List); } else { if ($roleEname == 'logisticsAssigner') { $OrderBase = D('OrderBase'); $List = array(); $postCodeNameList = $OrderBase->table(array('tb_order_base' => 'order_base'))->join('tb_magazine magazine on magazine.postCode = order_base.postCode')->join('tb_employee_newspaper employee_newspaper on employee_newspaper.postCode = order_base.postCode')->Distinct('order_base.postCode')->field('magazine.postCode, magazine.name')->where("employee_newspaper.personID = '" . get_employeeid($_SESSION[C('USER_AUTH_KEY')]) . "'")->order('employee_newspaper.operatingFrequency desc')->select(); foreach ($postCodeNameList as $key => $vo) { $List[$key]['postCodeName'] = $vo['name']; $map['postCode'] = $vo['postCode']; $map['isReceive'] = array('eq', '1'); $List[$key]['sumReceive'] = $OrderBase->where($map)->Distinct('contractID')->count('contractID'); unset($map); $map['postCode'] = $vo['postCode']; $map['isReceive'] = array('eq', '0'); $List[$key]['sumUnReceive'] = $OrderBase->where($map)->Distinct('contractID')->count('contractID'); unset($map); $map['postCode'] = $vo['postCode']; $map['isTrans'] = array('eq', '1'); $List[$key]['sumTrans'] = $OrderBase->where($map)->Distinct('contractID')->count('contractID'); unset($map); $map['postCode'] = $vo['postCode']; $map['isTrans'] = array('eq', '0'); $List[$key]['sumUnTrans'] = $OrderBase->where($map)->Distinct('contractID')->count('contractID'); unset($map); $PostGoods = D("PostGoods"); $map['order_base.postCode'] = $vo['postCode']; $map['post_goods.isCheckOut'] = array('eq', '1'); $List[$key]['sumCheckOut'] = $PostGoods->table(array('tb_post_goods' => 'post_goods'))->join('tb_order_flow_details order_flow_details on order_flow_details.id = post_goods.orderFlowID')->join('tb_order_base order_base on order_base.id = order_flow_details.orderID')->where($map)->count('post_goods.id'); unset($map); $PostGoods = D("PostGoods"); $map['order_base.postCode'] = $vo['postCode']; $map['post_goods.isCheckOut'] = array('eq', '0'); $List[$key]['sumUnCheckOut'] = $PostGoods->table(array('tb_post_goods' => 'post_goods'))->join('tb_order_flow_details order_flow_details on order_flow_details.id = post_goods.orderFlowID')->join('tb_order_base order_base on order_base.id = order_flow_details.orderID')->where($map)->count('post_goods.id'); unset($map); unset($map); } $this->assign('List', $List); } else { if ($roleEname == 'businessManager') { import("LibChart"); $Magazine = D('Magazine'); $OrderBase = D('OrderBase'); $List = array(); $year = date('Y'); $month = date('m'); $map = array(); $MagazineList = $Magazine->getMagazineListByEmId($employeeId); $MagazineCount = 0; $monthAdd = $month + 1; if ($MagazineList) { foreach ($MagazineList as $key => $MagazineVo) { /* 单期订单的数量 */ $orderSingleNum = 0; /* 多期订单的数量 */ $orderMonthNum = 0; /** * 算法:通过查找判断单期中的订单是否在 本月内 统计其数量 某一报刊 某一个人 */ $map['postCode'] = $MagazineVo['postCode']; $map['employeeID'] = $employeeId; $map['isSingle'] = 1; $map['orderYear'] = $year; $map['orderTime'] = array('between', strtotime("{$year}-{$month}-1 00:00:00") . ',' . strtotime("{$year}-{$monthAdd}-1 00:00:00")); $orderSingleNum = $OrderBase->where($map)->sum('orderNum'); unset($map); if (empty($orderSingleNum)) { $orderSingleNum = 0; } $map['orderYear'] = $year; $map['orderTime'] = array('between', strtotime("{$year}-{$month}-1 00:00:00") . ',' . strtotime("{$year}-{$monthAdd}-1 00:00:00")); $map['postCode'] = $MagazineVo['postCode']; $map['employeeID'] = $employeeId; $orderNumList = $OrderBase->where($map)->field('beginOrderDate, endOrderDate, orderNum')->select(); unset($map); if ($orderNumList) { foreach ($orderNumList as $orderNumVo) { $intervalMonths = $orderNumVo['endOrderDate'] - $orderNumVo['beginOrderDate'] + 1; $orderMonthNum += $orderNumVo['orderNum'] * $intervalMonths; } } $MagazineNum = $orderMonthNum + $orderSingleNum; $MagazineName = $MagazineVo['name']; if (empty($MagazineNum) || $MagazineNum == 0) { continue; } else { $List[$MagazineCount]['MagazineName'] = $MagazineName; $List[$MagazineCount]['MagazineNum'] = $MagazineNum; $MagazineCount++; } } $chart = new VerticalBarChart(600, 300); $dataSet = new XYDataSet(); $index = 1; $picUrlPath = array(); foreach ($List as $key => $vo) { /* 每行显示10个报刊,多余10个报刊,显示下一个图片 */ if ($key % 10 == 0 && $key != 0) { $chart->setDataSet($dataSet); $chart->setTitle("当月报刊的销售情况:"); $chart->render("./Public/Generated/" . $roleEname . "_" . $EmployeeId . "_" . $index . ".png"); $picUrlPath[] = "__PUBLIC__/Generated/" . $roleEname . "_" . $EmployeeId . "_" . $index . ".png"; $dataSet = new XYDataSet(); $index++; } $dataSet->addPoint(new Point($vo['MagazineName'], $vo['MagazineNum'])); } $chart->setDataSet($dataSet); $chart->setTitle("当月报刊的销售情况:"); $chart->render("./Public/Generated/" . $roleEname . "_" . $EmployeeId . "_" . $index . ".png"); $picUrlPath[] = "__PUBLIC__/Generated/" . $roleEname . "_" . $EmployeeId . "_" . $index . ".png"; $this->assign('picUrlPath', $picUrlPath); /* 只保存没提交的订单的数量 */ unset($map); $map['isChecked'] = 2; $map['employeeID'] = $employeeId; $orderSaveNotCommitNum = $OrderBase->where($map)->sum('orderNum'); $this->assign('orderSaveNotCommitNum', $orderSaveNotCommitNum); } } } } }
function battles() { if ($this->Session->read('Policy') <= 2) { $this->redirect(array('controller' => 'users', 'action' => 'login')); return; } if (isset($_POST['date'])) { $date = $_POST['date']; } else { $date = date_default_timezone_get(); } $month = date("m", strtotime($date)); $year = date("Y", strtotime($date)); $sql = "select DAY(battles.time), count(*)\r\n from battles\r\n where YEAR(battles.time) = " . $year . "\r\n and MONTH(battles.time) = " . $month . "\r\n GROUP BY DAY(battles.time) "; $sqlYear = "select MONTH(battles.time), count(*)\r\n from battles\r\n where YEAR(battles.time) = " . $year . "\r\n GROUP BY MONTH(battles.time) "; $data = $this->query($sql); $dataYear = $this->query($sqlYear); $days = $this->createDays($month, $year); $days = $this->updateDate($days, $data); $months = $this->createMonth(); $months = $this->updateDate($months, $dataYear); $chart = new VerticalBarChart(800, 400); $dataSet = new XYDataSet(); for ($i = 1; $i < count($days); $i++) { $dataSet->addPoint(new Point($i, $days[$i])); } $chart->setDataSet($dataSet); $chart->setTitle("Battles create in " . $month . "/" . $year); $chart->render("../webroot/img/battlesmonth.png"); $chartYear = new VerticalBarChart(800, 400); $dataSetYear = new XYDataSet(); echo "Month : " . count($months); for ($i = 1; $i < count($months); $i++) { $dataSetYear->addPoint(new Point($i, $months[$i])); } $chartYear->setDataSet($dataSetYear); $chartYear->setTitle("Battles create in year " . $year); $chartYear->render("../webroot/img/battlesyear.png"); }
public function printShockpotGeoData() { $db_query = "SELECT source_ip, COUNT(source_ip) AS count\n FROM connections\n GROUP BY source_ip\n ORDER BY COUNT(source_ip) DESC\n LIMIT 10 "; $rows = R::getAll($db_query); if (count($rows)) { //We create a new vertical bar chart, a new pie chart and initialize the dataset $verticalChart = new VerticalBarChart(600, 300); $pieChart = new PieChart(600, 300); $dataSet = new XYDataSet(); //We create a "intensity" pie chart as well along with a dataset $intensityPieChart = new PieChart(600, 300); $intensityDataSet = new XYDataSet(); //We create a new Google Map and initialize its columns, //where the decoded geolocation data will be entered in the format //of Lat(number), Lon(number) and IP(string) $gMapTop10 = new QMapGoogleGraph(); $gMapTop10->addColumns(array(array('number', 'Lat'), array('number', 'Lon'), array('string', 'IP'))); //We create a new Intensity Map and initialize its columns, //where the decoded geolocation data will be entered in the format //of Country(2 letter string), #Probes(number) $intensityMap = new QIntensitymapGoogleGraph(); $intensityMap->addDrawProperties(array("title" => 'IntensityMap')); $intensityMap->addColumns(array(array('string', '', 'Country'), array('number', '#Probes', 'a'))); //We create a temporary table in the database where we will store the IPs along with their #probes //and the corresponding country code, otherwise the Intensity Map won't work, because we need to //GROUP BY country code and SUM the #Probers per country $temp_table = 'CREATE TEMPORARY TABLE temp_ip (ip TEXT, counter INTEGER, country TEXT)'; R::exec($temp_table); //We create a dummy counter to use for the markers' tooltip inside Google Map like: IP 3/10 //We use the same counter for the IP <table> as well $counter = 1; //We create a skeleton for the table echo '<p>The following table displays the top 10 IP addresses connected to the system (ordered by volume of connections).</p>'; echo '<table><thead>'; echo '<tr class="dark">'; echo '<th>ID</th>'; echo '<th>IP Address</th>'; echo '<th>Probes</th>'; echo '<th>City</th>'; echo '<th>Region</th>'; echo '<th>Country Name</th>'; echo '<th>Code</th>'; echo '<th>Latitude</th>'; echo '<th>Longitude</th>'; echo '<th>Hostname</th>'; echo '<th colspan="9">IP Lookup</th>'; echo '</tr></thead><tbody>'; //We need to add data on the correct Map columns. The columns are always 0 or 1 or 2 for every repetition //so we can hardcode it into our code, but we need a way to automatically increase the row index. So we //create a dummy index variable to be increased after every repetition (as many db results we have) $col = 0; //For every row returned from the database... foreach ($rows as $row) { //We create a new GeoDataObject which geolocates the IP address $geodata = new GeoDataObject($this, $row['source_ip']); //We prepare the label for our vertical bar chart and add the point $label = $row['source_ip'] . " - " . $geodata->countryCode; $dataSet->addPoint(new Point($label, $row['count'])); //We next prepare the marker's tooltip inside Google Map $tooltip = "<strong>TOP {$counter}/10:</strong> " . $row['source_ip'] . "<br />" . "<strong>Probes:</strong> " . $row['count'] . "<br />" . "<strong>City:</strong> " . $geodata->city . "<br />" . "<strong>Region:</strong> " . $geodata->region . "<br />" . "<strong>Country:</strong> " . $geodata->countryName . "<br />" . "<strong>Latitude:</strong> " . $geodata->latitude . "<br />" . "<strong>Longitude:</strong> " . $geodata->longitude . "<br />"; //And add the marker to the map $gMapTop10->setValues(array(array($col, 0, (double) $geodata->latitude), array($col, 1, (double) $geodata->longitude), array($col, 2, $tooltip))); //We prepare the data that will be inserted in our temporary table $ip = $row['source_ip']; $ip_count = $row['count']; $country_code = $geodata->countryCode; $country_query = "INSERT INTO temp_ip VALUES('{$ip}', '{$ip_count}', '{$country_code}')"; R::exec($country_query); //For every row returned from the database we create a new table row with the data as columns echo '<tr class="light">'; echo '<td>' . $counter . '</td>'; echo '<td>' . $row['source_ip'] . '</td>'; echo '<td>' . $row['count'] . '</td>'; echo '<td>' . $geodata->city . '</td>'; echo '<td>' . $geodata->region . '</td>'; echo '<td>' . $geodata->countryName . '</td>'; echo '<td>' . $geodata->countryCode . '</td>'; echo '<td>' . $geodata->latitude . '</td>'; echo '<td>' . $geodata->longitude . '</td>'; echo '<td>' . get_host($row['source_ip']) . '</td>'; echo '<td class="icon"><a href="http://www.dshield.org/ipinfo.html?ip=' . $row['source_ip'] . '" target="_blank"><img class="icon" src="images/dshield.ico"/></a></td>'; echo '<td class="icon"><a href="http://www.ipvoid.com/scan/' . $row['source_ip'] . '" target="_blank"><img class="icon" src="images/ipvoid.ico"/></a></td>'; echo '<td class="icon"><a href="http://www.robtex.com/ip/' . $row['source_ip'] . '.html" target="_blank"><img class="icon" src="images/robtex.ico"/></a></td>'; echo '<td class="icon"><a href="http://www.fortiguard.com/ip_rep/index.php?data=' . $row['source_ip'] . '&lookup=Lookup" target="_blank"><img class="icon" src="images/fortiguard.ico"/></a></td>'; echo '<td class="icon"><a href="http://labs.alienvault.com/labs/index.php/projects/open-source-ip-reputation-portal/information-about-ip/?ip=' . $row['source_ip'] . '" target="_blank"><img class="icon" src="images/alienvault.ico"/></a></td>'; echo '<td class="icon"><a href="http://www.reputationauthority.org/lookup.php?ip=' . $row['source_ip'] . '" target="_blank"><img class="icon" src="images/watchguard.ico"/></a></td>'; echo '<td class="icon"><a href="http://www.mcafee.com/threat-intelligence/ip/default.aspx?ip=' . $row['source_ip'] . '" target="_blank"><img class="icon" src="images/mcafee.ico"/></a></td>'; echo '<td class="icon"><a href="http://www.ip-adress.com/ip_tracer/' . $row['source_ip'] . '" target="_blank"><img class="icon" src="images/ip_tracer.png"/></a></td>'; echo '<td class="icon"><a href="https://www.virustotal.com/en/ip-address/' . $row['source_ip'] . '/information/" target="_blank"><img class="icon" src="images/virustotal.ico"/></a></td>'; echo '</tr>'; //Lastly, we increase the index used by maps to indicate the next row, //and the dummy counter that indicates the next IP index (out of 10) $col++; $counter++; } //Close tbody and table element, it's ready. echo '</tbody></table>'; echo '<hr /><br />'; //While still inside the if(count($rows)) clause (otherwise the dataSet will be empty), //we set the bar chart's dataset, render the graph and display it (we're inside html code!) $verticalChart->setDataSet($dataSet); $verticalChart->setTitle(NUMBER_OF_CONNECTIONS_PER_UNIQUE_IP_CC); //For this particular graph we need to set the corrent padding $verticalChart->getPlot()->setGraphPadding(new Padding(5, 50, 100, 50)); //top, right, bottom, left | defaults: 5, 30, 50, 50 $verticalChart->render("generated-graphs/connections_per_ip_geo.png"); echo '<p>The following vertical bar chart visualizes the top 10 IPs ordered by the number of connections to the system.' . '<br/>Notice the two-letter country code to after each IP get a quick view of the locations where the attacks are coming from.</p>'; echo '<img src="generated-graphs/connections_per_ip_geo.png">'; //We set the pie chart's dataset, render the graph and display it (we're inside html code!) $pieChart->setDataSet($dataSet); $pieChart->setTitle(NUMBER_OF_CONNECTIONS_PER_UNIQUE_IP_CC); $pieChart->render("generated-graphs/connections_per_ip_geo_pie.png"); echo '<p>The following pie chart visualizes the top 10 IPs ordered by the number of connections to the system.' . '<br/>Notice the two-letter country code to after each IP get a quick view of the locations where the attacks are coming from.</p>'; echo '<img src="generated-graphs/connections_per_ip_geo_pie.png">'; echo '<hr /><br />'; //Charts are ready, so is Google Map, let's render it below echo '<p>The following zoomable world map marks the geographic locations of the top 10 IPs according to their latitude and longitude values. ' . 'Click on them to get the full information available from the database.<p>'; //echo '<div align=center>'; echo $gMapTop10->render(); //echo '</div>'; echo '<br/><hr /><br />'; //Lastly, we prepare the data for the Intesity Map $db_query_map = "SELECT country, SUM(counter) AS sum\n FROM temp_ip\n GROUP BY country\n ORDER BY SUM(counter) DESC "; //LIMIT 10 "; $rows = R::getAll($db_query_map); if (count($rows)) { $col = 0; //Dummy row index //For every row returned from the database add the values to Intensity Map's table and intensityPieChart foreach ($rows as $row) { $countryProbes = $row['country'] . " - " . $row['sum']; $intensityDataSet->addPoint(new Point($countryProbes, $row['sum'])); $intensityMap->setValues(array(array($col, 0, (string) $row['country']), array($col, 1, (int) $row['sum']))); $col++; } } //Intensity Map is ready, render it echo '<p>The following Intensity Map shows the volume of attacks per country by summarising probes originating from the same nation, using the same IP or not.</p>'; echo $intensityMap->render(); echo '<br/>'; //We set the "intensity" pie chart's dataset, render the graph and display it (we're inside html code!) $intensityPieChart->setDataSet($intensityDataSet); $intensityPieChart->setTitle(NUMBER_OF_CONNECTIONS_PER_COUNTRY); $intensityPieChart->render("generated-graphs/connections_per_country_pie.png"); echo '<p>The following pie chart visualizes the volume of attacks per country by summarising probes originating from the same nation, using the same IP or not.</p>'; echo '<img src="generated-graphs/connections_per_country_pie.png">'; if (GEO_METHOD == 'LOCAL') { echo '<hr /><small><a href="http://www.maxmind.com">http://www.maxmind.com</a></small><br />'; } else { if (GEO_METHOD == 'GEOPLUGIN') { echo '<hr /><small><a href="http://www.geoplugin.com/geolocation/" target="_new">IP Geolocation</a> by <a href="http://www.geoplugin.com/" target="_new">geoPlugin</a></small><br />'; } else { //TODO } } } //END IF }
public function printTop10FailedInput() { $db_query = "SELECT input, COUNT(input)\n FROM input\n WHERE success = 0\n GROUP BY input\n ORDER BY COUNT(input) DESC\n LIMIT 10"; $rows = R::getAll($db_query); if (count($rows)) { //We create a new vertical bar chart and initialize the dataset $chart = new VerticalBarChart(600, 300); $dataSet = new XYDataSet(); //We create a skeleton for the table $counter = 1; echo '<h3>Top 10 failed input</h3>'; echo '<p>The following table displays the top 10 failed commands entered by attackers in the honeypot system.</p>'; echo '<p><a href="include/export.php?type=FailedInput">CSV of all failed commands</a><p>'; echo '<table><thead>'; echo '<tr class="dark">'; echo '<th>ID</th>'; echo '<th>Input (fail)</th>'; echo '<th>Count</th>'; echo '</tr></thead><tbody>'; //For every row returned from the database we add a new point to the dataset, //and create a new table row with the data as columns foreach ($rows as $row) { $dataSet->addPoint(new Point($row['input'], $row['COUNT(input)'])); echo '<tr class="light word-break">'; echo '<td>' . $counter . '</td>'; echo '<td>' . xss_clean($row['input']) . '</td>'; echo '<td>' . $row['COUNT(input)'] . '</td>'; echo '</tr>'; $counter++; } //Close tbody and table element, it's ready. echo '</tbody></table>'; //We set the bar chart's dataset and render the graph $chart->setDataSet($dataSet); $chart->setTitle(TOP_10_FAILED_INPUT); //For this particular graph we need to set the corrent padding $chart->getPlot()->setGraphPadding(new Padding(5, 40, 120, 50)); //top, right, bottom, left | defaults: 5, 30, 50, 50 $chart->render(DIR_ROOT . "/generated-graphs/top10_failed_input.png"); echo '<p>This vertical bar chart visualizes the top 10 failed commands entered by attackers in the honeypot system.</p>'; echo '<img src="generated-graphs/top10_failed_input.png">'; echo '<hr /><br />'; } }
$admin .= '<img alt="Statistik Browser" src="browser.png"/>'; $admin .= '<img alt="Statistik OS" src="os.png"/>'; $admin .= '<img alt="Sering di Kunjungi" src="mostvisited.png"/>'; $admin .= '<img alt="Berdasarkan Hari" src="hari.png"/>'; /*******************************/ $chart9 = new VerticalBarChart(1000, 300); $dataSet9 = new XYDataSet(); for ($a = 0; $a <= 23; $a++) { $query9 = "SELECT ip,jam,count(jam) as jumlahjam FROM `statistiksitus` WHERE dateflag BETWEEN '{$_POST['DariTanggal']}' AND '{$_POST['SampaiTanggal']}' and jam='{$a}'"; $hasil9 = mysql_query($query9); $data9 = mysql_fetch_assoc($hasil9); $jam = $data9['jam']; $jumlahjam = $data9['jumlahjam']; $dataSet9->addPoint(new Point("{$a}", $jumlahjam)); } $chart9->setDataSet($dataSet9); $chart9->setTitle("Most visited Hours"); $chart9->render("mosthours.png"); $admin .= '<img alt="Jumlah Kunjungan Jam" src="mosthours.png"/>'; /************************/ $dataSet5 = new XYSeriesDataSet(); $dataSet5->addSerie("Kunjungan", $serie1); $dataSet5->addSerie("Halaman", $serie2); $dataSet5->addSerie("Hits", $serie3); $chart5->setDataSet($dataSet5); $chart5->getPlot()->setGraphCaptionRatio(0.65); $chart5->setTitle("Statistik Kunjungan Tanggal"); $chart5->render("jumlahkunjungan.png"); $admin .= '<img alt="Jumlah Kunjungan" src="jumlahkunjungan.png"/>'; $query8 = "SELECT dateflag,count(distinct(ip)) AS kunjungan,count(distinct(filename)) AS filename,count(*) AS hits FROM statistiksitus WHERE dateflag BETWEEN '{$_POST['DariTanggal']}' AND '{$_POST['SampaiTanggal']}'group by dateflag asc"; $hasil8 = mysql_query($query8);
?> <div class="box box-primary"> <div class="box-header"><i class="fa fa-bar-chart-o"></i><h3 class="box-title">Nombre d'heures de réservation par jour pour le mois de <?php echo getMonth($month); ?> </h3></div> <div class="box-body"> <?php for ($i = 1; $i <= $nb_jour; ++$i) { $result = getStatResaByDay($year . '-' . $month . '-' . $i, $epn); //debug($result['duree']); $dataSet3->addPoint(new Point($i, $result['duree'])); $maxBound[$i] = $result['duree']; } $maxValue = ceil(max($maxBound) / 60); $chart3->setDataSet($dataSet3); $chart3->setTitle("Detail des heures pour " . getMonth($month) . " " . $year . " "); $chart3->getPlot()->getPalette()->setBarColor(array(new Color(128, 195, 28))); $chart3->getPlot()->setLabelGenerator(new TimeLabelGenerator()); // arrondir la valeur maximale supérieure $chart3->getBound()->setUpperBound($maxValue * 60); // $chart3->getTics()->quantizeTics(12); $chart3->render("img/chart/" . $year . "/" . $namepn . "_resa-Mensuelle-" . $month . ".png"); ?> <!-- rendu du graphique sous forme d'image--> <img src="img/chart/<?php echo $year; ?> /<?php echo $namepn; ?>
public function createShellshockAttacksFromSameIP() { $db_query = "SELECT source_ip, COUNT(source_ip) AS count\n FROM connections\n WHERE is_shellshock = 'true'\n GROUP BY source_ip\n ORDER BY COUNT(source_ip) DESC\n LIMIT 20 "; $rows = R::getAll($db_query); if (count($rows)) { //We create a new vertical bar chart and initialize the dataset $chart = new VerticalBarChart(600, 300); $dataSet = new XYDataSet(); //For every row returned from the database we add a new point to the dataset foreach ($rows as $row) { $dataSet->addPoint(new Point($row['source_ip'], $row['count'])); } //We set the bar chart's dataset and render the graph $chart->setDataSet($dataSet); $chart->setTitle(SHELLSHOCK_ATTACKS_FROM_SAME_IP); //For this particular graph we need to set the corrent padding $chart->getPlot()->setGraphPadding(new Padding(5, 45, 80, 50)); //top, right, bottom, left | defaults: 5, 30, 50, 50 $chart->render("generated-graphs/shellshocks_attacks_from_same_ip.png"); } }
function _simpleChart($proposals, $criterias, $reportType) { $countryDao =& DAORegistry::getDAO('CountryDAO'); $extraFieldDao =& DAORegistry::getDAO('ExtraFieldDAO'); $this->setupTemplate(); $journal =& Request::getJournal(); $measurement = Request::getUserVar('measurement'); $chartOptions = Request::getUserVar('chartOptions'); import('classes.lib.libchart.classes.libchart'); if ($reportType == 1) { $pieChart = new PieChart(); } elseif ($reportType == 2) { $pieChart = new VerticalBarChart(); } $dataSet = new XYDataSet(); $dataSetArray = array(); $keyNA = Locale::translate('editor.reports.notApplicable'); $keyN = Locale::translate('editor.reports.nationwide'); $keyWHS = Locale::translate('editor.reports.chart.withoutHumanSubjects'); if ($measurement == 0) { $endTitle = Locale::translate('common.bySomebody') . ' ' . Locale::translate('editor.reports.measurement.proposalNmbre'); } else { $endTitle = Locale::translate('common.bySomebody') . ' ' . Locale::translate('editor.reports.measurement.cumulatedBudget'); } foreach ($proposals as $proposal) { if ($measurement == 0) { $toSumUp = (int) 1; } else { $toSumUp = (int) $proposal->getTotalBudget(); } } switch ($chartOptions) { } foreach ($dataSetArray as $key => $value) { $dataSet->addPoint(new Point($key . ' (' . $value . ')', $value)); } $pieChart->setDataSet($dataSet); $pieChart->render("classes/lib/libchart/images/" . $journal->getLocalizedInitials() . '-' . Locale::translate('editor.reports.chart') . ".png"); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('chartLocation', "/classes/lib/libchart/images/" . $journal->getLocalizedInitials() . '-' . Locale::translate('editor.reports.chart') . ".png"); $templateMgr->assign('criterias', $criterias); $templateMgr->display('sectionEditor/reports/showChart.tpl'); }
public function createSuccessfulLoginsFromSameIP() { $db_query = "SELECT sessions.ip, COUNT(sessions.ip)\n FROM sessions INNER JOIN auth ON sessions.id = auth.session\n WHERE auth.success = 1\n GROUP BY sessions.ip\n ORDER BY COUNT(sessions.ip) DESC\n LIMIT 20 "; $rows = R::getAll($db_query); if (count($rows)) { //We create a new vertical bar chart and initialize the dataset $chart = new VerticalBarChart(600, 300); $dataSet = new XYDataSet(); //For every row returned from the database we add a new point to the dataset foreach ($rows as $row) { $dataSet->addPoint(new Point($row['ip'], $row['COUNT(sessions.ip)'])); } //We set the bar chart's dataset and render the graph $chart->setDataSet($dataSet); $chart->setTitle(SUCCESSFUL_LOGINS_FROM_SAME_IP); //For this particular graph we need to set the corrent padding $chart->getPlot()->setGraphPadding(new Padding(5, 45, 80, 50)); //top, right, bottom, left | defaults: 5, 30, 50, 50 $chart->render(DIR_ROOT . "/generated-graphs/logins_from_same_ip.png"); } }
function BugsOpenByUser() { G::LoadThirdParty("libchart/classes", "libchart"); $chart = new VerticalBarChart(430, 220); $dataSet = $this->getBugsOpenByUser(); $dataPostSet = new XYDataSet(); $dataTopicSet = new XYDataSet(); foreach ($dataSet['label'] as $key => $label) { $dataPostSet->addPoint(new Point($label, $dataSet['data'][$key])); } $chart->setDataSet($dataPostSet); //$chart->setTitle( " Posts by User" ); $chart->render(); }
$serie2->addPoint(new Point("{$month} 20, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "20", $year), 2))); $serie2->addPoint(new Point("{$month} 21, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "21", $year), 2))); $serie2->addPoint(new Point("{$month} 22, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "22", $year), 2))); $serie2->addPoint(new Point("{$month} 23, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "23", $year), 2))); $serie2->addPoint(new Point("{$month} 24, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "24", $year), 2))); $serie2->addPoint(new Point("{$month} 25, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "25", $year), 2))); $serie2->addPoint(new Point("{$month} 26, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "26", $year), 2))); $serie2->addPoint(new Point("{$month} 27, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "27", $year), 2))); $serie2->addPoint(new Point("{$month} 28, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "28", $year), 2))); $serie2->addPoint(new Point("{$month} 29, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "29", $year), 2))); $serie2->addPoint(new Point("{$month} 30, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "30", $year), 2))); $serie2->addPoint(new Point("{$month} 31, {$year}", number_format($ro->getPxRevenueDaily_ipd($month, "31", $year), 2))); $dataSet = new XYSeriesDataSet(); $dataSet->addSerie("OPD", $serie1); $dataSet->addSerie("IPD", $serie2); $chart->setDataSet($dataSet); $chart->getPlot()->setGraphCaptionRatio(0.35); $chart->setTitle("Registration Census for {$month} {$year}"); $chart->render("../../../COCONUT/graphicalReport/chartList/monthlyRegistration.png"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Registration Census for <?php echo $month; echo $year; ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" /> </head> <body>
/** * Función que genera las gráficas de ls intentos realizados * por los alumnos para pasar y no pasar los test. Se muestra * en el panel del profesor. * */ public function generarGraficaVerticalAlumnosIntentos() { $alumnos_tabla = TableRegistry::get("Alumnos"); $alumnos = $alumnos_tabla->find('all'); $intentos_pasa_test = false; $intentos_no_pasa_test = false; $chart_pasa_test = new \VerticalBarChart(800, 350); $dataSet_pasa_test = new \XYDataSet(); $this->__añadirIntervalosIntentosEjeX($dataSet_pasa_test); $chart_no_pasa_test = new \VerticalBarChart(800, 350); $dataSet_no_pasa_test = new \XYDataSet(); $this->__añadirIntervalosIntentosEjeX($dataSet_no_pasa_test); if (file_exists("img/" . $_SESSION["lti_idTarea"] . "-prof-intentos_noPasaTest.png")) { unlink("img/" . $_SESSION["lti_idTarea"] . "-prof-intentos_noPasaTest.png"); } foreach ($alumnos as $alumno) { $intentos_tabla = TableRegistry::get("Intentos"); $intentos_alumno = $intentos_tabla->find('all')->where(['tarea_id' => $_SESSION["lti_idTarea"], 'alumno_id' => $alumno->id]); if (!$intentos_alumno->isEmpty()) { $num_intentos_realizados = 0; $test_pasados = false; foreach ($intentos_alumno as $intento) { $num_intentos_realizados++; if ($intento->resultado == 1) { // Test pasados $intentos_pasa_test = true; $test_pasados = true; $intervalo = $this->__obtenerIntervaloIntento($num_intentos_realizados); $point = $dataSet_pasa_test->getPointWithX($intervalo); $point->setY($point->getY() + 1); break; } } if (!$test_pasados) { // Test no pasados $intentos_no_pasa_test = true; $intervalo = $this->__obtenerIntervaloIntento($num_intentos_realizados); $point = $dataSet_no_pasa_test->getPointWithX($intervalo); $point->setY($point->getY() + 1); } } } if ($intentos_pasa_test) { $chart_pasa_test->setDataSet($dataSet_pasa_test); $chart_pasa_test->setTitle("Número de alumnos que han realizado X intentos para pasar los test"); $chart_pasa_test->render("img/" . $_SESSION["lti_idTarea"] . "-prof-intentos_pasaTest_intervalos.png"); } if ($intentos_no_pasa_test) { $chart_no_pasa_test->setDataSet($dataSet_no_pasa_test); $chart_no_pasa_test->setTitle("Número de alumnos que han realizado X intentos sin conseguir pasar los test"); $chart_no_pasa_test->render("img/" . $_SESSION["lti_idTarea"] . "-prof-intentos_noPasaTest_intervalos.png"); } }
function _simpleChart($proposals, $criterias, $reportType) { $countryDao =& DAORegistry::getDAO('CountryDAO'); $extraFieldDao =& DAORegistry::getDAO('ExtraFieldDAO'); $this->setupTemplate(); $journal =& Request::getJournal(); $measurement = Request::getUserVar('measurement'); $chartOptions = Request::getUserVar('chartOptions'); import('classes.lib.libchart.classes.libchart'); if ($reportType == 1) { $pieChart = new PieChart(); } elseif ($reportType == 2) { $pieChart = new VerticalBarChart(); } $dataSet = new XYDataSet(); $dataSetArray = array(); $keyNA = Locale::translate('editor.reports.notApplicable'); $keyN = Locale::translate('editor.reports.nationwide'); $keyWHS = Locale::translate('editor.reports.chart.withoutHumanSubjects'); if ($measurement == 0) { $endTitle = Locale::translate('common.bySomebody') . ' ' . Locale::translate('editor.reports.measurement.proposalNmbre'); } else { $endTitle = Locale::translate('common.bySomebody') . ' ' . Locale::translate('editor.reports.measurement.cumulatedBudget'); } foreach ($proposals as $proposal) { if ($measurement == 0) { $toSumUp = (int) 1; } else { $toSumUp = (int) $proposal->getTotalBudget(); } $proposalDetails = $proposal->getProposalDetails(); $riskAssessment = $proposal->getRiskAssessment(); if ($chartOptions == 'studentResearch') { if ($proposalDetails->getStudentResearch() == PROPOSAL_DETAIL_YES) { $studentResearchInfo = $proposalDetails->getStudentResearchInfo(); $key = Locale::translate($studentResearchInfo->getDegreeKey()); if (array_key_exists($key, $dataSetArray)) { $dataSetArray[$key] = $dataSetArray[$key] + $toSumUp; } else { $dataSetArray[$key] = (int) $toSumUp; } unset($key); } else { if (array_key_exists($keyNA, $dataSetArray)) { $dataSetArray[$keyNA] = $dataSetArray[$keyNA] + $toSumUp; } else { $dataSetArray[$keyNA] = (int) $toSumUp; } } } elseif ($chartOptions == 'kii') { $key = $proposalDetails->getKeyImplInstitutionAcronym(); if (array_key_exists($key, $dataSetArray)) { $dataSetArray[$key] = $dataSetArray[$key] + $toSumUp; } else { $dataSetArray[$key] = (int) $toSumUp; } unset($key); } elseif ($chartOptions == 'multiCountry') { if ($proposalDetails->getMultiCountryResearch() == PROPOSAL_DETAIL_YES) { $countries = $proposalDetails->getCountries(); $countries = explode(',', $countries); foreach ($countries as $country) { $key = $countryDao->getCountry($country); if (array_key_exists($key, $dataSetArray)) { $dataSetArray[$key] = $dataSetArray[$key] + $toSumUp; } else { $dataSetArray[$key] = (int) $toSumUp; } unset($key); } } else { if (array_key_exists($keyNA, $dataSetArray)) { $dataSetArray[$keyNA] = $dataSetArray[$keyNA] + $toSumUp; } else { $dataSetArray[$keyNA] = (int) $toSumUp; } } } elseif ($chartOptions == 'nationwide') { if ($proposalDetails->getNationwide() != PROPOSAL_DETAIL_YES) { $geoAreas = $proposalDetails->getGeoAreasArray(); foreach ($geoAreas as $geoArea) { $extraField =& $extraFieldDao->getExtraField($geoArea); $key = isset($extraField) ? $extraField->getLocalizedExtraFieldName() : '-'; if (array_key_exists($key, $dataSetArray)) { $dataSetArray[$key] = $dataSetArray[$key] + $toSumUp; } else { $dataSetArray[$key] = (int) $toSumUp; } unset($key); unset($extraField); } } else { if (array_key_exists($keyN, $dataSetArray)) { $dataSetArray[$keyN] = $dataSetArray[$keyN] + $toSumUp; } else { $dataSetArray[$keyN] = (int) $toSumUp; } } } elseif ($chartOptions == 'proposalTypes') { if ($proposalDetails->getHumanSubjects() == PROPOSAL_DETAIL_YES) { $proposalTypes = $proposalDetails->getProposalTypesArray(); foreach ($proposalTypes as $proposalType) { $extraField =& $extraFieldDao->getExtraField($proposalType); $key = isset($extraField) ? $extraField->getLocalizedExtraFieldName() : '-'; if (array_key_exists($key, $dataSetArray)) { $dataSetArray[$key] = $dataSetArray[$key] + $toSumUp; } else { $dataSetArray[$key] = (int) $toSumUp; } unset($key); unset($extraField); } } else { if (array_key_exists($keyWHS, $dataSetArray)) { $dataSetArray[$keyWHS] = $dataSetArray[$keyWHS] + $toSumUp; } else { $dataSetArray[$keyWHS] = (int) $toSumUp; } } } elseif ($chartOptions == 'researchDomains') { $researchDomains = $proposalDetails->getResearchDomainsArray(); foreach ($researchDomains as $researchDomain) { $extraField =& $extraFieldDao->getExtraField($researchDomain); $key = isset($extraField) ? $extraField->getLocalizedExtraFieldName() : '-'; if (array_key_exists($key, $dataSetArray)) { $dataSetArray[$key] = $dataSetArray[$key] + $toSumUp; } else { $dataSetArray[$key] = (int) $toSumUp; } unset($key); unset($extraField); } } elseif ($chartOptions == 'researchFields') { $researchFields = $proposalDetails->getResearchFieldsArray(); foreach ($researchFields as $researchField) { $extraField =& $extraFieldDao->getExtraField($researchField); $key = isset($extraField) ? $extraField->getLocalizedExtraFieldName() : '-'; if (array_key_exists($key, $dataSetArray)) { $dataSetArray[$key] = $dataSetArray[$key] + $toSumUp; } else { $dataSetArray[$key] = (int) $toSumUp; } unset($key); unset($extraField); } } elseif ($chartOptions == 'dataCollection') { $key = Locale::translate($proposalDetails->getDataCollectionKey()); if (array_key_exists($key, $dataSetArray)) { $dataSetArray[$key] = $dataSetArray[$key] + $toSumUp; } else { $dataSetArray[$key] = (int) $toSumUp; } unset($key); } elseif ($chartOptions == 'exportHumanTissue') { if ($riskAssessment->getBioSamples() == RISK_ASSESSMENT_YES) { $key = Locale::translate($riskAssessment->getYesNoKey($riskAssessment->getExportHumanTissue())); if (array_key_exists($key, $dataSetArray)) { $dataSetArray[$key] = $dataSetArray[$key] + $toSumUp; } else { $dataSetArray[$key] = (int) $toSumUp; } unset($key); } else { if (array_key_exists($keyNA, $dataSetArray)) { $dataSetArray[$keyNA] = $dataSetArray[$keyNA] + $toSumUp; } else { $dataSetArray[$keyNA] = (int) $toSumUp; } } } elseif ($chartOptions == 'exportReason') { if ($riskAssessment->getBioSamples() == RISK_ASSESSMENT_YES && $riskAssessment->getExportHumanTissue() == RISK_ASSESSMENT_YES) { $key = Locale::translate($riskAssessment->getExportReasonKey()); if (array_key_exists($key, $dataSetArray)) { $dataSetArray[$key] = $dataSetArray[$key] + $toSumUp; } else { $dataSetArray[$key] = (int) $toSumUp; } unset($key); } else { if (array_key_exists($keyNA, $dataSetArray)) { $dataSetArray[$keyNA] = $dataSetArray[$keyNA] + $toSumUp; } else { $dataSetArray[$keyNA] = (int) $toSumUp; } } } else { $key = Locale::translate($riskAssessment->getYesNoKey($riskAssessment->{$chartOptions}())); if (array_key_exists($key, $dataSetArray)) { $dataSetArray[$key] = $dataSetArray[$key] + $toSumUp; } else { $dataSetArray[$key] = (int) $toSumUp; } unset($key); } } switch ($chartOptions) { case 'studentResearch': $pieChart->setTitle(Locale::translate('proposal.studentInitiatedResearch') . ' ' . $endTitle); break; case 'kii': $pieChart->setTitle(Locale::translate('proposal.keyImplInstitution') . ' ' . $endTitle); break; case 'multiCountry': $pieChart->setTitle(Locale::translate('proposal.multiCountryResearch') . ' ' . $endTitle); break; case 'nationwide': $pieChart->setTitle(Locale::translate('proposal.nationwide') . ' ' . $endTitle); break; case 'proposalTypes': $pieChart->setTitle(Locale::translate('proposal.proposalType') . ' ' . $endTitle); break; case 'researchDomains': $pieChart->setTitle(Locale::translate('proposal.researchDomains') . ' ' . $endTitle); break; case 'researchFields': $pieChart->setTitle(Locale::translate('proposal.researchField') . ' ' . $endTitle); break; case 'dataCollection': $pieChart->setTitle(Locale::translate('proposal.dataCollection') . ' ' . $endTitle); break; case 'getIdentityRevealed': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.subjects") . ' - ' . Locale::translate('proposal.identityRevealedAbb') . ' ' . $endTitle); break; case 'getUnableToConsent': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.subjects") . ' - ' . Locale::translate('proposal.unableToConsentAbb') . ' ' . $endTitle); break; case 'getUnder18': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.subjects") . ' - ' . Locale::translate('proposal.under18Abb') . ' ' . $endTitle); break; case 'getDependentRelationship': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.subjects") . ' - ' . Locale::translate('proposal.dependentRelationshipAbb') . ' ' . $endTitle); break; case 'getEthnicMinority': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.subjects") . ' - ' . Locale::translate('proposal.ethnicMinorityAbb') . ' ' . $endTitle); break; case 'getImpairment': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.subjects") . ' - ' . Locale::translate('proposal.impairmentAbb') . ' ' . $endTitle); break; case 'getPregnant': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.subjects") . ' - ' . Locale::translate('proposal.pregnantAbb') . ' ' . $endTitle); break; case 'getNewTreatment': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.newTreatmentAbb') . ' ' . $endTitle); break; case 'getBioSamples': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.bioSamplesAbb') . ' ' . $endTitle); break; case 'exportHumanTissue': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.exportHumanTissueAbb') . ' ' . $endTitle); break; case 'exportReason': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.exportReason') . ' ' . $endTitle); break; case 'getRadiation': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.radiationAbb') . ' ' . $endTitle); break; case 'getDistress': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.distressAbb') . ' ' . $endTitle); break; case 'getInducements': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.inducementsAbb') . ' ' . $endTitle); break; case 'getSensitiveInfo': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.sensitiveInfoAbb') . ' ' . $endTitle); break; case 'getReproTechnology': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.reproTechnologyAbb') . ' ' . $endTitle); break; case 'getGenetic': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.geneticsAbb') . ' ' . $endTitle); break; case 'getStemCell': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.stemCellAbb') . ' ' . $endTitle); break; case 'getBiosafety': $pieChart->setTitle(Locale::translate("editor.reports.riskAssessment.researchIncludes") . ' - ' . Locale::translate('proposal.biosafetyAbb') . ' ' . $endTitle); break; } foreach ($dataSetArray as $key => $value) { $dataSet->addPoint(new Point($key . ' (' . $value . ')', $value)); } $pieChart->setDataSet($dataSet); $pieChart->render("classes/lib/libchart/images/" . $journal->getLocalizedInitials() . '-' . Locale::translate('editor.reports.chart') . ".png"); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('chartLocation', "/classes/lib/libchart/images/" . $journal->getLocalizedInitials() . '-' . Locale::translate('editor.reports.chart') . ".png"); $templateMgr->assign('criterias', $criterias); $templateMgr->display('sectionEditor/reports/showChart.tpl'); }
echo '<td>' . $geoplugin->latitude . '</td>'; echo '<td>' . $geoplugin->longitude . '</td>'; echo '<td>' . get_host($row['source_ip']) . '</td>'; echo '<td><a href="http://www.dshield.org/ipinfo.html?ip=' . $row['source_ip'] . '" target="_blank"><img class="icon" src="images/dshield.ico"/></a>' . '<a href="http://www.ipvoid.com/scan/' . $row['source_ip'] . '" target="_blank"><img class="icon" src="images/ipvoid.png"/></a>' . '<a href="http://www.robtex.com/ip/' . $row['source_ip'] . '.html" target="_blank"><img class=icon" src="images/robtex.ico"/></a>' . '<a href="http://www.mcafee.com/threat-intelligence/ip/default.aspx?ip=' . $row['source_ip'] . '" target="_blank"><img class="icon" src="images/mcafee.ico"/></a>' . '<a href="http://www.ip-adress.com/ip_tracer/' . $row['source_ip'] . '" target="_blank"><img class="icon" src="images/ip_tracer.png"/></a>' . '<a href="https://www.virustotal.com/en/ip-address/' . $row['source_ip'] . '/information/" target="_blank"><img class="icon" src="images/virustotal.ico"/></a></td>'; echo '</td></tr>'; //Lastly, we increase the index used by maps to indicate the next row, //and the dummy counter that indicates the next IP index (out of 10) $col++; $counter++; } //Close tbody and table element, it's ready. echo '</tbody></table>'; echo '<hr /><br />'; //While still inside the if($result->num_rows > 0) clause (otherwise the dataSet will be empty), //we set the bar chart's dataset, render the graph and display it (we're inside html code!) $verticalChart->setDataSet($dataSet); $verticalChart->setTitle("Number of connections per unique IP (Top 10) + Country Codes"); //For this particular graph we need to set the corrent padding $verticalChart->getPlot()->setGraphPadding(new Padding(5, 50, 100, 50)); //top, right, bottom, left | defaults: 5, 30, 50, 50 $verticalChart->render("generated-graphs/connections_per_ip_geo.png"); echo '<p>The following vertical bar chart visualizes the top 10 IPs ordered by the number of connections to the system.' . '<br/>Notice the two-letter country code to after each IP get a quick view of the locations where the attacks are coming from.</p>'; echo '<img src="generated-graphs/connections_per_ip_geo.png">'; //We set the pie chart's dataset, render the graph and display it (we're inside html code!) $pieChart->setDataSet($dataSet); $pieChart->setTitle("Number of connections per unique IP (Top 10) + Country Codes"); $pieChart->render("generated-graphs/connections_per_ip_geo_pie.png"); echo '<p>The following pie chart visualizes the top 10 IPs ordered by the number of connections to the system.' . '<br/>Notice the two-letter country code to after each IP get a quick view of the locations where the attacks are coming from.</p>'; echo '<img src="generated-graphs/connections_per_ip_geo_pie.png">'; echo '<hr /><br />'; //Charts are ready, so is Google Map, let's render it below