2023-01-02 21:33:36 +05:00
|
|
|
|
<?php
|
2023-02-23 22:13:18 +05:00
|
|
|
|
|
|
|
|
|
$_SERVER['SERVER_NAME']='tk-ligat.ru';
|
|
|
|
|
require_once('/home/cloud/core/set/tk-ligat.ru.php');
|
2023-01-02 21:33:36 +05:00
|
|
|
|
require_once('/home/cloud/core/api/php/db.php');
|
2023-02-23 22:13:18 +05:00
|
|
|
|
require_once('/home/cloud/core/api/php/json.php');
|
|
|
|
|
|
2023-01-02 21:33:36 +05:00
|
|
|
|
|
2023-02-23 22:13:18 +05:00
|
|
|
|
$imgs=DB::getAll("SELECT * FROM `tovar_img` WHERE `md5` IS NULL");
|
2023-01-02 21:33:36 +05:00
|
|
|
|
for ($i=0; $i<count($imgs); $i++){
|
|
|
|
|
|
|
|
|
|
if (file_exists('/home/cloud/core/img/tk-ligat.ru/tovar/' . $imgs[$i]['filename'] . '.jpg')){
|
|
|
|
|
unset($md5);
|
|
|
|
|
$md5=md5_file('/home/cloud/core/img/tk-ligat.ru/tovar/' . $imgs[$i]['filename'] . '.jpg');
|
|
|
|
|
|
|
|
|
|
DB::set("UPDATE `tovar_img` SET `md5`=? WHERE `id`=?", array( $md5, $imgs[$i]['id'] ) );
|
|
|
|
|
echo "Существует";
|
|
|
|
|
}else{
|
|
|
|
|
// echo "Не Существует";
|
|
|
|
|
DB::set("DELETE FROM `tovar_img` WHERE `id`=?", $imgs[$i]['id']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|