1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| public static function sizeAfterDelete()//$file
{
$size = '';
//$size_max = '';
$size1 = '';
$cookie = new Cookie('psAdmin');
$id_employee = $cookie->id_employee;
$id_shop = '';
$sql = 'SELECT *
FROM '._DB_PREFIX_.'employee_shop
WHERE id_employee = '.(int)$id_employee.'
';
if ($row = Db::getInstance()->getRow($sql))
$id_shop = $row['id_shop'];
// print_r($id_shop);
$sql1 = 'SELECT *
FROM recap
WHERE id_store = '.(int)$id_shop.'
';
if ($row1 = Db::getInstance()->getRow($sql1)){
$size = $row1['size'];
// $size_max = $row1['size_max'];
}
if ($id_shop != 1){
$size1 = $size - 100;//filesize(_PS_ROOT_DIR_.$file);
Db::getInstance()->update('recap', array('size' => (int)$size1),
$where = 'id_store = '.(int)$id_shop.'', $limit = 0, $null_values = false, $use_cache = true, $add_prefix = false);
}
return true;
} |
Partager