????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.134.253.192 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/appsrv.astacus.se/energicontrol/strandis/ |
Upload File : |
<?php $link = mysql_connect ("localhost", "root", "root123"); mysql_select_db ("energicontrol"); $date_from30 = date('Y-m-d',strtotime("-7 days")); $sql = "SELECT * FROM tblNordpool WHERE startTime >= '$date_from30' and area = 'SE3' order by startTime"; $result = mysql_query($sql); $sum = 0; $x = 0; while ($row = mysql_fetch_assoc($result)){ $price = $row['value']/(1000*1.25); $sum += $price; $x++; } $medel = $sum/$x; echo("MEDEL:".($medel)."<br>"); $sql = "SELECT * FROM tblNordpool WHERE startTime >= '$date_from30' and area = 'SE3' and value <= '".($medel*(1000*1.25)*1)."' order by startTime"; $result = mysql_query($sql); $y = 0; while ($row = mysql_fetch_assoc($result)){ $y++; } echo("KVOT:".(round(($y/$x)*100))."%<br>"); ?><style type="text/css"> .rubrik {font-family: Verdana, Geneva, sans-serif; text-align: left; } .rubrik { font-family: Verdana, Geneva, sans-serif; text-align: left; } </style> <script src="js/Chart.bundle.js"></script> <script src="js/utils.js"></script> <table width="100%" border="0" cellspacing="0" cellpadding="0" id="box3"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td width="14%">Periodisering: </td> <td width="86%"> </td> </tr> </tbody> </table> <br> <br> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td><div id="canvas-holder4" style="width:100%"></div> <div style="width:100%;"> <canvas id="canvas4"></canvas> </div> <br> <br> <?php $sql = "SELECT * FROM tblNordpool WHERE startTime >= '$date_from30' and area = 'SE3' order by startTime"; $result = mysql_query($sql); $json_labels_t1 = "labels : ["; while ($row = mysql_fetch_assoc($result)){ $json_labels_t1 = $json_labels_t1 . "'".$row['startTime']."',"; } $json_labels_t1 = $json_labels_t1 . "]"; $sql = "SELECT * FROM tblNordpool WHERE startTime >= '$date_from30' and area = 'SE3' order by startTime"; $result = mysql_query($sql); $json_data_t24 = "data : ["; $json_data_t25 = "data : ["; $json_data_t26 = "data : ["; while ($row = mysql_fetch_assoc($result)){ $json_data_t24 = $json_data_t24 .($row['value']/1000)*1.25.","; $json_data_t25 = $json_data_t25 .$medel.","; $json_data_t26 = $json_data_t26 .$medel*0.7.","; } $json_data_t24 = $json_data_t24 . "]"; $json_data_t25 = $json_data_t25 . "]"; $json_data_t26 = $json_data_t26 . "]"; ?> <script> var config4 = { type: 'line', data: { <?php echo($json_labels_t1);?>, datasets: [{ label: 'ELPRIS', backgroundColor: window.chartColors.color4, borderColor: window.chartColors.color4, <?php echo($json_data_t24);?>, fill: false, },{ label: 'MEDEL', backgroundColor: window.chartColors.color6, borderColor: window.chartColors.color6, <?php echo($json_data_t25);?>, fill: false, },{ label: 'MEDEL 70%', backgroundColor: window.chartColors.color7, borderColor: window.chartColors.color7, <?php echo($json_data_t26);?>, fill: false, }] }, options: { responsive: true, title: { display: true, text: 'Historik' }, tooltips: { mode: 'index', intersect: false, }, hover: { mode: 'nearest', intersect: true }, scales: { xAxes: [{ display: true, scaleLabel: { display: true, labelString: 'Datum' } }], yAxes: [{ display: true, scaleLabel: { display: true, labelString: 'Mätvärden' } }] } } }; </script></td> </tr> </tbody> </table> <br> <h1 class="rubrik"></h1> <p></p></td> </tr> </table> <script> var ctx4 = document.getElementById('canvas4').getContext('2d'); var chart4 = new Chart(ctx4, config4); window.myLine = chart4; </script> <p></p>