????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.107 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 = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
function count_files($path) {
// (Ensure that the path contains an ending slash)
if(!is_dir($path)){
return 0;
}
$file_count = 0;
$dir_handle = opendir($path);
if (!$dir_handle) return -1;
while ($file = readdir($dir_handle)) {
if ($file == '.' || $file == '..') continue;
if (is_dir($path . $file)){
$file_count += count_files($path . $file . DIRECTORY_SEPARATOR);
}
else {
$file_count++; // increase file count
}
}
closedir($dir_handle);
return $file_count;
}
?>
<script src="sorttable.js"></script>
<link href="../main.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../customerzon/calendar.js"></script>
<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
<body onLoad="showClockSWE()">
<style type="text/css">
<!--
.style6 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
-->
</style>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="90"> </td>
<td width="820"><table width="923" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="923" colspan="5" valign="top"><span class="heading2">Dina uppgifter: </span><br>
<table width="871" border="0" cellpadding="0" cellspacing="0">
<tr >
<td width="76" class="text">Namn:</td>
<td width="197" class="textthin"><?php echo($_SESSION['ASTACUS_SSO_INFO'][1]);?> (<?php echo($_SESSION['ASTACUS_SSO_INFO'][10]);?>) </td>
<td width="148" class="text">Telefon:</td>
<td width="88" class="text"><span class="textthin"><?php echo($_SESSION['ASTACUS_SSO_INFO'][6]);?></span></td>
<td width="1" rowspan="4" bgcolor="#999999" class="textthin"></td>
<td width="361" rowspan="4" valign="top" class="textthin"><table width="228" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="text">
<td width="89">Svensk tid: </td>
<td width="71">Indisk tid: </td>
</tr>
<tr class="textthin">
<td width="89"><div id="showTextSWE"></div></td>
<td> <div id="showTextIND"></div></td>
</tr>
</table></td>
</tr>
<tr >
<td class="text">E-post:</td>
<td class="textthin"><?php echo($_SESSION['ASTACUS_SSO_INFO'][2]);?></td>
<td class="text">Adress:</td>
<td class="textthin"><?php echo($_SESSION['ASTACUS_SSO_INFO'][7]);?></td>
</tr>
<tr >
<td class="text">SkypeID:</td>
<td class="textthin"><a href="skype:<?php echo($_SESSION['ASTACUS_SSO_INFO'][11]);?>?call"><img src="http://mystatus.skype.com/smallicon/<?php echo($_SESSION['ASTACUS_SSO_INFO'][11]);?>" alt="My status" width="16" height="16" align="absmiddle" style="border: none;" /></a> <?php echo($_SESSION['ASTACUS_SSO_INFO'][11]);?></td>
<td class="text">Postadress:</td>
<td class="textthin"><?php echo($_SESSION['ASTACUS_SSO_INFO'][8]);?> <?php echo($_SESSION['ASTACUS_SSO_INFO'][9]);?></td>
</tr>
<tr class="text">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<hr width="820" size="1">
<span class="heading2"><br>
</span>
<table width="904" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="586" height="677" valign="top"><span class="heading2"> </span>
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="342" height="121" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="342" background="../images/platta1.jpg"><table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><span class="heading2">Skapa ny avtalskund </span>
<form name="form1" method="post" action="addcustomer.php">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="86" class="text">Kundnummer:</td>
<td width="67"><div align="left">
<input name="kundnummer" type="text" class="textthin" id="kundnummer" size="3">
</div></td>
<td width="24" class="text">Typ:</td>
<td width="123"><select name="type" id="type">
<?php
$sql = "SELECT * FROM ICADType";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
?>
<option value="<?php echo($row['ICADTypeId']);?>"><?php echo($row['Name']);?></option>
<?php } ?>
</select></td>
</tr>
<tr>
<td class="text">Startdatum:</td>
<td colspan="3"><div align="right" class="textthin">
<script>DateInput('orderdate', true, 'YYYY-MM-DD')</script>
</div></td>
</tr>
<tr>
<td class="text">Kontakt:</td>
<td><div align="left">
<select name="contact" id="contact">
<option value="293">Kiran</option>
<option value="286">KSR</option>
<option value="1689">Srinivas</option>
<option value="1236">Narender</option>
</select>
</div></td>
<td> </td>
<td align="right"><input name="Submit" type="submit" class="textthin" value="Skapa avtalskund"></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table></td>
<td><table width="342" height="121" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="342" background="../images/platta1.jpg"><table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><span class="heading2">Lägg till iCAD-typ till avtalskund</span>
<form name="form1" method="post" action="addcustomer.php">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="86" class="text">Kundnummer:</td>
<td width="67"><div align="left">
<input name="kundnummer" type="text" class="textthin" id="kundnummer" size="3">
</div></td>
<td width="24" class="text">Typ:</td>
<td width="123"><select name="type" id="type">
<?php
$sql = "SELECT * FROM ICADType";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
?>
<option value="<?php echo($row['ICADTypeId']);?>"><?php echo($row['Name']);?></option>
<?php } ?>
</select></td>
</tr>
<tr>
<td> </td>
<td><div align="left"></div></td>
<td> </td>
<td align="right"><input name="Submit2" type="submit" class="textthin" value="Lägg till"></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<br>
<span class="heading2">iCAD-avtal : </span><br>
<span class="style6">
</span>
<table width="850" border="0" cellspacing="0" cellpadding="0" class="sortable">
<tr class="text">
<td width="55" class="style6"><strong>KundID</strong></td>
<td width="255" class="style6"><strong>Företagsnamn</strong></td>
<td width="94" class="style6"><strong>Timmar </strong></td>
<td width="369" class="style6">Typ</td>
<td width="77" class="style6">Avtal</td>
</tr>
<?php
$sql = "SELECT sum(Hours) as Hours, NextFlushDate, Company.CompanyId, Company.Name, ICADAccountSigned FROM ICADType, ICADAccount, Company, ICADFlush where ICADFlush.CompanyId = Company.CompanyId and ICADAccount.ICADTypeId = ICADType.ICADTypeId and Company.CompanyId = ICADAccount.CustomerId group by CompanyId;";
$result = mysql_query($sql);
$cx = 0;
while ($row = mysql_fetch_assoc($result)){
if($cx % 2 == 0){
$color = "#CCCCCC";
}else{
$color = "#FFFFFF";
}
$cx++;
$CompanyId = $row['CompanyId'];
?>
<tr>
<td width="55" bgcolor="<?php echo($color);?>" class="style6"><strong><a href="?page=change&CompanyId=<?php echo($CompanyId);?>" class="textthin"><?php echo($row['CompanyId']);?></a></strong></td>
<td width="255" bgcolor="<?php echo($color);?>" class="style6"><strong><a href="?page=change&CompanyId=<?php echo($CompanyId);?>" class="textthin"><?php echo($row['Name']);?></a></strong></td>
<td width="93" bgcolor="<?php echo($color);?>" class="style6"><strong><a href="?page=change&CompanyId=<?php echo($CompanyId);?>" class="textthin"><?php
if($row['Hours'] == 0){
echo("Timbasis");
}else{
echo($row['Hours']*20);
}
?>
</a></strong></td>
<td width="369" bgcolor="<?php echo($color);?>" class="style6"><strong><a href="?page=change&CompanyId=<?php echo($CompanyId);?>" class="textthin">
<?php
$arkiv = false;
$sql = "SELECT count( ICADType.ICADTypeID ) as count, ICADType.ICADTypeID, Name FROM `ICADAccount` , ICADType WHERE ICADType.ICADTypeId = ICADAccount.ICADTypeID AND customerid ='".$row['CompanyId']."' GROUP BY ICADType.ICADTypeID";
$result2 = mysql_query($sql);
while ($row2 = mysql_fetch_assoc($result2)){
echo($row2['count'] ." ".$row2['Name'].", ");
if($row2['Name'] == "Arkiv"){
$arkiv = true;
}
}
?>
</a>
<?php
$view_count = count_files('/var/www/icad_files/'.$row['CompanyId'].'/archive/icad_viewer_files/');
$org_count = count_files('/var/www/icad_files/'.$row['CompanyId'].'/archive/') - $view_count;
if ($arkiv == true){ echo("<a href='arkiv_inloggning.php?companyId=".$CompanyId."' target='_NEW'> [Öppna arkiv]</a> (V: ".$view_count." O:".$org_count.")");}?>
</td>
<td width="78" bgcolor="<?php echo($color);?>" class="style6"><strong><a href="?page=change&CompanyId=<?php echo($CompanyId);?>" class="textthin"><?php if($row['ICADAccountSigned'] == "1" ){
echo("JA");
}?></a></strong></td>
</tr>
<?php } ?>
</table>
<br>
<br>
</span><br>
<br>
<br>
<span class="heading2"><?php echo($_GET['message']);?></span><span class="style6"> </span> <br>
<span class="style6"></span><span class="style6"><br>
<br>
<span class="heading2">Pågående månad (<?php
$d_diff = $_GET['d_diff'];
if($d_diff == ""){
$d_diff_a = "-0";
$d_diff_b = "-1";
}else{
$d_diff_a = $d_diff;
$d_diff_b = $d_diff - 1;
}
$d = date("Y-m",strtotime("$d_diff_a month"));
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);
}
echo(date("Y-m",strtotime("$d_diff_a month"))."-01 - ".date("Y-m",strtotime("$d_diff_a month"))."-".lastday(date("m",strtotime("$d_diff_a month")),date("Y")));
?>) </span><br>
</span>
<table width="441" border="0" cellspacing="0" cellpadding="0">
<tr class="text">
<td width="55" class="style6"><strong>KundID</strong></td>
<td width="130" class="style6"><strong>Företagsnamn</strong></td>
<td width="60" class="style6"><strong>Timmar </strong></td>
<td width="98" class="style6">Extra timmar </td>
<td width="98" class="style6"> </td>
</tr>
</table>
<span class="style6">
<?php
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
$sql ="SELECT SUM( Hours ) AS Hours, SUM(AdditionalHours) as AdditionalHours, CompanyId, Name FROM ((SELECT SUM( Hours ) AS Hours, SUM(AdditionalHours) as AdditionalHours, Company.CompanyId, Name FROM ICADTime, Company WHERE ICADTime.CompanyId = Company.CompanyId and TimeDate LIKE '".$d."%' GROUP BY Company.CompanyId) UNION ALL( SELECT SUM( Hours ) AS Hours, SUM(AdditionalHours) as AdditionalHours, Company.CompanyId, Name FROM ICADTimeHistory, Company WHERE ICADTimeHistory.CompanyId = Company.CompanyId and TimeDate LIKE '".$d."%' GROUP BY Company.CompanyId )) AS TMP GROUP BY CompanyId";
/*$sql ="SELECT SUM( Hours ) AS Hours, CompanyId, Name FROM ((SELECT SUM( Hours ) AS Hours, Company.CompanyId, Name FROM ICADTime, Company WHERE ICADTime.CompanyId = Company.CompanyId and TimeDate >= '".date("Y-m",strtotime("0 month"))."-01 00:00:00' and TimeDate <= '".date("Y-m",strtotime("0 month"))."-".lastday(date("m",strtotime("0 month")),date("Y"))." 24:00:00' GROUP BY Company.CompanyId) UNION ALL ( SELECT SUM( Hours ) AS Hours, Company.CompanyId, Name FROM ICADTimeHistory, Company WHERE ICADTimeHistory.CompanyId = Company.CompanyId and TimeDate >= '".date("Y-m",strtotime("0 month"))."-01 00:00:00' and TimeDate <= '".date("Y-m",strtotime("0 month"))."-".lastday(date("m",strtotime("0 month")),date("Y"))." 24:00:00' GROUP BY Company.CompanyId )) AS TMP GROUP BY CompanyId";*/
/* $sql = "SELECT sum( Hours ) AS Hours, Company.CompanyId, Name FROM ICADTime , Company WHERE ICADTime.CompanyId = Company.CompanyId and TimeDate > '".date("Y-m",strtotime("0 month"))."-01 00:00:00' and TimeDate < '".date("Y-m",strtotime("0 month"))."-".lastday(date("m",strtotime("-1 month")),date("Y"))." 00:00:00' GROUP BY Company.CompanyId";
*/
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
?>
</span>
<table width="441" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="55" class="textthin"><?php echo($row['CompanyId']);?></td>
<td width="130" class="textthin"><a href="?page=report&customerid=<?php echo($row['CompanyId']);?>&month=<?php echo($_GET['month']);?>"><?php echo($row['Name']);?></a></td>
<td width="60" class="textthin"><?php echo($row['Hours']);?></td>
<td width="98" class="textthin">
<?php
$sql = "SELECT sum(AdditionalHours) as AdditionalHours FROM ICADTime where TimeDate >= '".date("Y-m",strtotime("-0 month"))."-01 00:00:00' and TimeDate <= '".date("Y-m",strtotime("-0 month"))."-".lastday(date("m",strtotime("-0 month")),date("Y"))." 23:59:59' and CompanyId = ".$row['CompanyId']." group by CompanyId;";
$result2 = mysql_query($sql);
$AdditionalHours = 0;
while ($row2 = mysql_fetch_assoc($result2)){
$AdditionalHours = $row2['AdditionalHours'];
}
echo($AdditionalHours);
?>
</td>
<td width="98" class="style6"> </td>
</tr>
</table>
<span class="style6">
<?php }
$d = date("Y-m",strtotime("$d_diff_b month"));
?>
</span> <br>
<span class="style6"></span><span class="style6"></span><span class="style6"></span><span class="style6"></span><br> <span class="style6"> <br>
<span class="heading2">Faktureringsunderlag (<?php echo($d."-01 - ".$d."-".lastday(date("m",strtotime("$d_diff_b month")),date("Y")));?>) </span><br>
</span>
<table width="441" border="0" cellspacing="0" cellpadding="0">
<tr class="text">
<td width="55" class="style6"><strong>KundID</strong></td>
<td width="130" class="style6"><strong>Företagsnamn</strong></td>
<td width="60" class="style6"><strong>Timmar </strong></td>
<td width="98" class="style6">Extra timmar </td>
<td width="98" class="style6">SMS-kostnad</td>
</tr>
</table>
<span class="style6">
<?php
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
/* $sql ="SELECT SUM( Hours ) AS Hours, SUM(AdditionalHours) as AdditionalHours, CompanyId, Name FROM ((SELECT SUM( Hours ) AS Hours, SUM(AdditionalHours) as AdditionalHours, Company.CompanyId, Name FROM ICADTime, Company WHERE ICADTime.CompanyId = Company.CompanyId and TimeDate >= '".date("Y-m",strtotime("-1 month"))."-01 00:00:00' and TimeDate <= '".date("Y-m",strtotime("-1 month"))."-".lastday(date("m",strtotime("-1 month")),date("Y"))." 23:59:59' GROUP BY Company.CompanyId) UNION ALL( SELECT SUM( Hours ) AS Hours, SUM(AdditionalHours) as AdditionalHours, Company.CompanyId, Name FROM ICADTimeHistory, Company WHERE ICADTimeHistory.CompanyId = Company.CompanyId and TimeDate >= '".date("Y-m",strtotime("-1 month"))."-01 00:00:00' and TimeDate <= '".date("Y-m",strtotime("-1 month"))."-".lastday(date("m",strtotime("-1 month")),date("Y"))." 23:59:59' GROUP BY Company.CompanyId )) AS TMP GROUP BY CompanyId";*/
$sql ="SELECT SUM( Hours ) AS Hours, SUM(AdditionalHours) as AdditionalHours, CompanyId, Name FROM ((SELECT SUM( Hours ) AS Hours, SUM(AdditionalHours) as AdditionalHours, Company.CompanyId, Name FROM ICADTime, Company WHERE ICADTime.CompanyId = Company.CompanyId and TimeDate LIKE '".$d."%' GROUP BY Company.CompanyId) UNION ALL( SELECT SUM( Hours ) AS Hours, SUM(AdditionalHours) as AdditionalHours, Company.CompanyId, Name FROM ICADTimeHistory, Company WHERE ICADTimeHistory.CompanyId = Company.CompanyId and TimeDate LIKE '".$d."%' GROUP BY Company.CompanyId )) AS TMP GROUP BY CompanyId";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
?>
</span>
<table width="441" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="55" class="textthin"><?php echo($row['CompanyId']);?></td>
<td width="130" class="textthin"><a href="?page=report&customerid=<?php echo($row['CompanyId']);?>&month=<?php echo($_GET['month']-1);?>"><?php echo($row['Name']);?></a></td>
<td width="60" class="textthin"><?php echo($row['Hours']);?></td>
<td width="98" class="textthin"><?php
$sql = "SELECT sum(Hours) as Hours, NextFlushDate, Company.CompanyId, Company.Name, ICADType.ICADTypeId as ICADTypeId FROM ICADType, ICADAccount, Company, ICADFlush where ICADFlush.CompanyId = ".$row['CompanyId']." and Company.CompanyId = ".$row['CompanyId']." and ICADAccount.ICADTypeId = ICADType.ICADTypeId and ICADAccount.CustomerId = ".$row['CompanyId']." group by CompanyId;";
$result2 = mysql_query($sql);
while ($row2 = mysql_fetch_assoc($result2)){
$Type = $row2['ICADTypeId'];
}
if($Type == 7 || $Type == 8 || $Type == 13){
echo("Timbasis");
}else{
echo($row['AdditionalHours']);
}
?></td>
<td width="98" class="textthin"> <?php
$sql = "SELECT * FROM Project, ICADSMS, Company WHERE Project.ProjectId = ICADSMS.ProjectId and Company.CompanyId = Project.CompanyId and Company.CompanyId = ".$row['CompanyId']." and ICADSMS.TimeDate LIKE '".$d."%' ";
$result2 = mysql_query($sql);
$x = 0;
while ($row2 = mysql_fetch_assoc($result2)){
$x++;
}
echo($x*1.5." kr");
?></td>
</tr>
</table>
<p><span class="style6">
<?php } ?>
</span></p>
<p class="text"><a href="?d_diff=<?php echo($d_diff-1);?>"><< Tidigare månad</a> | <a href="?d_diff=<?php echo($d_diff+1);?>">Senare månad >></a></p></td>
</tr>
</table>
<span class="style6"><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>