<?php

global $cfg;
require_once $cfg['Path']['shared_version'].'admin/cleaning.php';

$main_class = 'CleaningLocal';

class CleaningLocal extends Cleaning
{
    public $template = 'window/cleaning.tpl';

    // Photos
    public function getImagesUnused()
    {
        $SQL = sqlQuery('SELECT id
         FROM photos p
           LEFT JOIN photos_products_relation ppr ON p.id = ppr.id_photo
           LEFT JOIN photos_articles_relation ppa ON p.id = ppa.id_photo
           LEFT JOIN photos_menu_relation par ON p.id = par.id_photo
           LEFT JOIN abra_pictures abp ON p.id = abp.id_picture
          WHERE ppr.id_product IS NULL AND p.parent IS NULL AND ppa.id_art IS NULL AND par.id_page IS NULL AND abp.id_abra IS NULL;');
        $files = sqlFetchAll($SQL);

        return $files;
    }
}
