<?php
define('IN_ECS', true);
require('./includes/init.php');

    $sql = 'SELECT distinct g.goods_id,g.goods_sn,g.goods_thumb,g.goods_img,g.original_img ' .
            'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g '.
            "WHERE g.is_on_sale=1";
	$res = $GLOBALS['db']->query($sql);
	$i=0;
    while ($row = $GLOBALS['db']->fetchRow($res))
    {
		if (!file_exists('./'.$row['original_img']))
		{
			echo "<br>Big img, not found!--------".$row['goods_sn'];
			$i++;
		}
		if (!file_exists('./'.$row['goods_img']))
		{
			echo "<br>Small img, not found!--------".$row['goods_sn'];
			$i++;
		}
	}

echo "<br><br><br><br>Total no image:".$i;
?>