????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/ |
Upload File : |
<?php
$link = mysql_connect ("localhost", "root", "root123");
mysql_select_db ("vpa");
$sql = "SELECT * FROM ICADFlush, ICADAccount where ICADFlush.CompanyId = ICADAccount.CustomerId ;";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)){
$NextFlush = date("Y-m-d", strtotime($row['NextFlushDate']));
$Today = date("Y-m-d");
$CompanyId = $row['CompanyId'];
$ICADTypeId = $row['ICADTypeId'];
if($Today > $NextFlush){
$sql = "SELECT * FROM ICADTime;";
$result2 = mysql_query($sql);
while ($row2 = mysql_fetch_assoc($result2)){
$ICADTimeId2 = $row2['ICADTimeId'];
$ProjectId2 = $row2['ProjectId'];
$CompanyId2 = $row2['CompanyId'];
$Hours2 = $row2['Hours'];
$TimeDate2 = $row2['TimeDate'];
$ICADType2 = $row2['ICADType'];
$AdditionalHours2 = $row2['AdditionalHours'];
$Billdate = date("Y-m-d", strtotime(substr($TimeDate2,10)));
if($Billdate > $NextFlush){
if( $CompanyId2 == $CompanyId){
mysql_query("INSERT INTO ICADTimeHistory Values(Null,$ProjectId2, $CompanyId2, $Hours2, '$TimeDate2', $ICADType2, $AdditionalHours2);");
mysql_query("DELETE FROM ICADTime WHERE ICADTime.ICADTimeId = $ICADTimeId2 and CompanyId = $CompanyId LIMIT 1");
}
}
}
if($ICADTypeId == 3 || $ICADTypeId == 6 || $ICADTypeId == 7 || $ICADTypeId == 8 || $ICADTypeId == 12){
$NextFlush = date("Y-m-d", strtotime($row['NextFlushDate']." +1 month") );
}else{
$NextFlush = date("Y-m-d", strtotime($row['NextFlushDate']." +14 days") );
}
mysql_query("update ICADFlush SET NextFlushDate = '".$NextFlush."' where CompanyId = $CompanyId");
}
}
?>