MOON
Server: Apache
System: Linux vps.erhabenn.com.br 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User: machen (1008)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /disk001/machen/public_html/images/imagemdb2.php
<? 
header('Access-Control-Allow-Origin: *');
header("Pragma: no-cache");
header("Expires: -1");
header("Cache-Control: no-cache, must-revalidate"); 
header('Content-Type: text/html; charset=UTF-8');
setlocale(LC_ALL, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese');
date_default_timezone_set("America/Sao_Paulo");
include('data.php');

$Sel = $pdo->prepare("SELECT * FROM im_RealEstateFile WHERE status!='COPIED' ORDER BY id DESC LIMIT 110");
$Sel->execute();
$count=0;
$count2;
while($DD=$Sel->fetch(PDO::FETCH_OBJ)){
		$U=$pdo->prepare("UPDATE im_RealEstateFile SET status='COPIED' WHERE id='".$DD->id."'");
		$U->execute();
		$origem = "http://www.imovelemcamposdojordao.com.br/db/im/fot/".$DD->id.'.'.$DD->extension;
		$destino = "db/im/fotR/".$DD->id.'.'.$DD->extension;
		$orig = fopen($origem, "r");
		$dest = fopen($destino, "w");
		$line = fread ($orig, 1024);
		fwrite($dest, $line);
		fclose($orig);
		fclose($dest);
	   
	   
		/*//$info = pathinfo("db/im/fot/".$DD->id.'.'.$DD->extension);
		//$fp = fopen($info, 'rb'); // read binary
		$foto= "db/im/fot/".$DD->id.'.'.$DD->extension;
		$fp = fopen($foto, 'rb'); // read binary
		$UPD = $pdo->prepare("UPDATE im_RealEstateFile SET arquivo=:arquivo WHERE id='".$DD->id."'");
		$UPD->bindParam(':arquivo', $fp, PDO::PARAM_LOB);
		$UPD->execute();*/
		echo '/'.$DD->id.'--->OK('.$count2.')';
		$count++;
		$count2 ++;
		if($count>=100){
			$count=0;
			sleep(1);
			?>
            <script>
				window.location.reload();
			</script>
            <?
		}
}

?>