????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 18.216.196.208 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/timereport_india/ |
Upload File : |
<!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> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> <title>ASTACUS TIDRAPPORT</title> <link href="../sales/table.css" rel="stylesheet" type="text/css"> <style type="text/css"> .rubrik { font-family: Verdana, Geneva, sans-serif; text-align: left; } .text { font-family: Verdana, Geneva, sans-serif; } .text { font-size: 14px; } #form1 { } .bold { font-weight: bold; } .bold { font-family: Verdana, Geneva, sans-serif; } .bold { font-size: 14px; } </style> <script src="js/Chart.bundle.js"></script> <script src="js/utils.js"></script> <script> function MM_openBrWindow2(theURL,winName) { //v2.0 window.open(theURL,winName,'status=yes, resizable=yes','width='+screen.width,'height='+screen.height); } function MM_openBrWindow2(theURL,winName,extra) { //v2.0 window.open(theURL,winName,extra); } </script> </head> <?php $Username = $_GET['username']; if($_GET['year'] == ""){ $year = date("Y"); }else{ $year = $_GET['year']; } if($_GET['month'] == ""){ $month = intval( date("m")); }else{ $month = $_GET['month']; } if($month < 0){ $year = $_GET['year'] - 1; $month = 12; } if($month > 12){ $year = $_GET['year']+ 1; $month = 1; } if($month < 10){ $month = "0".$month; } ?> <body> <h1 class="rubrik">Time report for <?php echo($Username);?> (<?php echo($year ."-".$month);?>) <br /> <span class="rubrik"><br /> <a href="?month=<?php echo($month-1);?>&year=<?php echo($year);?>&username=<?php echo($Username);?>"><< Previously month</a> (Showing: <?php echo($year ."-".$month);?>) <a href="?month=<?php echo($month+1);?>&year=<?php echo($year);?>&username=<?php echo($Username);?>">Next month >></a></span> <br /> <br /> <div id="canvas-holder" style="width:40%"> <canvas id="chart-area"></canvas> </div> </h1> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-mc-light-blue"> <tr class="bold"> <td width="159">Date</td> <td width="260">ID</td> <td width="154">Time</td> <td width="368">Project</td> <td width="202"> </td> <td width="127"> </td> </tr> </table> <?php session_start(); $link = mysql_connect ("localhost", "root", "root123"); mysql_select_db ("vpa"); $X = 0; // $tothrs = 0; $totmin = 0; $day = 1; $cont = cal_days_in_month(CAL_GREGORIAN,$month,$year); $data = array(); $data_total = 0; while ($cont != 0){ if($day< 10){ $day = "0".$day; } $spec = ""; $ymd = $year."-".$month."-".$day; $sql = "SELECT * FROM ProjectTimeV2_India where WorkDate = '$ymd' and Username = '$Username'"; //echo($sql); $result = mysql_query($sql); $hrs = 0; $min = 0; $projectids = ""; while ($row = mysql_fetch_assoc($result)){ $hrs += $row['Hrs']; $min += $row['Min']; if(strpos($projectids,$row['ProjectId']) === FALSE) { $projectids = $projectids . "<a href='report_project.php?projectid=".$row['ProjectId']."'>".$row['ProjectId'] ."</a>, "; } $spec = $spec . $row['Activity']. " - " .$row['Intervall']."\\n"; if(array_key_exists("'".$row['Activity']."'", $data)){ $data["'".$row['Activity']."'"] = $data["'".$row['Activity']."'"] + ($row['Hrs']*60 + $row['Min']); }else{ $data["'".$row['Activity']."'"] = ($row['Hrs']*60 + $row['Min']); } $data_total = $data_total + ($row['Hrs']*60 + $row['Min']); } $projectids = substr($projectids,0,strlen($projectids)-2); $hours = ($min / 60); $rhours = floor($hours); $minutes = ($hours - $rhours) * 60; $rminutes = round($minutes); $hrs = $hrs + $rhours; $min = $rminutes; $tothrs = $tothrs + $hrs; $totmin = $totmin + $min; if($hrs< 10){ $hrs = "0".$hrs; } if($min< 10){ $min = "0".$min; } ?> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-mc-light-blue"> <tr class="text"> <td width="158"><?php echo($ymd);?></td> <td width="260"><?php echo($Username);?></td> <td width="154"><a href="#" onClick="javascript:alert('<?php echo($spec);?>');"><?php echo($hrs)?>:<?php echo($min)?> h</a></td> <td width="385"><?php echo($projectids);?></td> <td width="313"><?php if($projectids != ""){?><a href="addtime.php?date=<?php echo($ymd);?>&username=<?php echo($Username);?>">Change</a><?php }?></td> </tr> </table> <?php $cont--; $day ++; } /* data: [ randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), ] labels: [ 'Red', 'Orange', 'Yellow', 'Green', 'Blue' ] backgroundColor: [ window.chartColors.red, window.chartColors.orange, window.chartColors.yellow, window.chartColors.green, window.chartColors.blue, ], */ $json_data = "data : ["; $json_labels = "labels : ["; $json_backgroundColor = "backgroundColor : ["; foreach($data as $key => $value){ $json_data = $json_data . round(($value/$data_total)*100).","; $json_labels = $json_labels . $key.","; $json_backgroundColor = $json_backgroundColor ."window.chartColors.blue,"; } //$json_data = substr($json_data,0,strlen($json_data)-1); $json_data = $json_data . "]"; $json_labels = $json_labels . "]"; $json_backgroundColor = $json_backgroundColor . "]"; ?> <br /> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-mc-light-blue"> <tr class="text"> <td width="420"></td> <td width="141"><?php $hours = ($totmin / 60); $rhours = floor($hours); $minutes = ($hours - $rhours) * 60; $rminutes = round($minutes); $tothrs = $tothrs + $rhours; $totmin = $rminutes; if($tothrs< 10){ $tothrs = "0".$tothrs; } if($totmin< 10){ $totmin = "0".$totmin; } echo($tothrs);?>:<?php echo($totmin);?> h</td> <td width="709"> </td> </tr> </table> <br /> <h1 class="rubrik"><br /> <br /> </h1> <p> </p> <script> var randomScalingFactor = function() { return Math.round(Math.random() * 100); }; var config = { type: 'pie', data: { datasets: [{ <?php echo($json_data);?>, backgroundColor: [ window.chartColors.red, window.chartColors.orange, window.chartColors.yellow, window.chartColors.green, window.chartColors.blue, window.chartColors.gray, window.chartColors.purple, window.chartColors.red2, window.chartColors.blue2, window.chartColors.green2, window.chartColors.green2, window.chartColors.green2, window.chartColors.green2, window.chartColors.green2, window.chartColors.green2, window.chartColors.green2, window.chartColors.green2, ], label: 'Dataset 1' }], <?php echo($json_labels);?> }, options: { responsive: true } }; window.onload = function() { var ctx = document.getElementById('chart-area').getContext('2d'); window.myPie = new Chart(ctx, config); }; </script> </body> </html>