Uname : Linux V-ShopU01 4.18.0-348.20.1.el8_5.x86_64 #1 SMP Thu Mar 10 20:59:28 UTC 2022 x86_64
Server : Apache/2.4.37 (rocky) OpenSSL/1.1.1k
Whoami : apache
Safe Mode : OFF
DOCUMENT ROOT : /var/www/html/site_shopudietDisable Function :
Path : /var/www/html/site_shopudiet/admin/
Server IP : 65.20.74.164
Client IP : 18.227.134.232
Current File : /var/www/html/site_shopudiet/admin/testimg.php |
<?php
include 'dbconnect.php';
include 'lib/ImageResize.php';
use \Gumlet\ImageResize;
/*$squery = "SELECT * FROM `packages`";
$result = mysqli_query($conn,$squery);
while( $row = mysqli_fetch_array($result))
{
if($row['image']!=''){
if(!file_exists('mobile/img/'.$row['image'])){ echo "ff";
if(file_exists('img/'.$row['image'])){ echo "g";
$image = new ImageResize('img/'.$row['image']);
$image->scale(50);
$image->save('mobile/img/'.$row['image']);
}
}
}
}
exit();*/
$squery = "select * from product where id=156";
$result = mysqli_query($conn,$squery);
$i=1;
while( $row = mysqli_fetch_array($result))
{
echo $i.'mobile/img/'.$row['file1']."<br>";
echo $i.'mobile/img/'.$row['file2']."<br>";
echo $i.'mobile/img/'.$row['file3']."<br>";
if($row['file1']!=''){
if(!file_exists('mobile/img/'.$row['file1'])){
if(file_exists('img/'.$row['file1'])){
$image = new ImageResize('img/'.$row['file1']);
$image->scale(50);
$image->save('mobile/img/'.$row['file1']);
}
}
}
if($row['file2']!=''){
if(!file_exists('mobile/img/'.$row['file2'])){
if(file_exists('img/'.$row['file2'])){
$image = new ImageResize('img/'.$row['file2']);
$image->scale(50);
$image->save('mobile/img/'.$row['file2']);
}
}
}
if($row['file3']!=''){
if(!file_exists('mobile/img/'.$row['file3'])){
if(file_exists('img/'.$row['file3'])){
$image = new ImageResize('img/'.$row['file3']);
$image->scale(50);
$image->save('mobile/img/'.$row['file3']);
}
}
}
if($row['file4']!=''){
if(!file_exists('mobile/img/'.$row['file4'])){
if(file_exists('img/'.$row['file4'])){
$image = new ImageResize('img/'.$row['file4']);
$image->scale(50);
$image->save('mobile/img/'.$row['file4']);
}
}
}
if($row['file5']!=''){
if(!file_exists('mobile/img/'.$row['file5'])){
if(file_exists('img/'.$row['file5'])){
$image = new ImageResize('img/'.$row['file5']);
$image->scale(50);
$image->save('mobile/img/'.$row['file5']);
}
}
}
if($row['doc1']!=''){
if(!file_exists('mobile/img/'.$row['doc1'])){
if(file_exists('img/'.$row['doc1'])){
$image = new ImageResize('img/'.$row['doc1']);
$image->scale(50);
$image->save('mobile/img/'.$row['doc1']);
}
}
}
if($row['doc2']!=''){
if(!file_exists('mobile/img/'.$row['doc2'])){
if(file_exists('img/'.$row['doc2'])){
$image = new ImageResize('img/'.$row['doc2']);
$image->scale(50);
$image->save('mobile/img/'.$row['doc2']);
}
}
}
if($row['doc3']!=''){
if(!file_exists('mobile/img/'.$row['doc3'])){
if(file_exists('img/'.$row['doc3'])){
$image = new ImageResize('img/'.$row['doc3']);
$image->scale(50);
$image->save('mobile/img/'.$row['doc3']);
}
}
}
if($row['doc4']!=''){
if(!file_exists('mobile/img/'.$row['doc4'])){
if(file_exists('img/'.$row['doc4'])){
$image = new ImageResize('img/'.$row['doc4']);
$image->scale(50);
$image->save('mobile/img/'.$row['doc4']);
}
}
}
if($row['doc5']!=''){
if(!file_exists('mobile/img/'.$row['doc5'])){
if(file_exists('img/'.$row['doc5'])){
$image = new ImageResize('img/'.$row['doc5']);
$image->scale(50);
$image->save('mobile/img/'.$row['doc5']);
}
}
}
$i++;
}
?>