} else { if (count($exp) == 1) { unset($exp); } else { if (($pos = array_search($pid, $exp)) > -1) { unset($exp[$pos]); } } } $_SESSION['exp'] = $exp; case 'delete': case 'buy': case 'buy_all': switch ($task) { case 'delete': if ((int) $pro->delete_product($_POST['id']) == $pro->in_order_detail) { alert(sprintf($sc_CannotDeleteProduct, $_POST['txt_name'])); } break; case 'buy': $_SESSION['cart']->addcalc($_POST['id'], 1); break; case 'buy_all': $buy_id = $_POST['buy_id']; for ($i = 0; $i < count($buy_id); $i++) { $_SESSION['cart']->addcalc($buy_id[$i], 1); } break; } default: if ($task == 'apply') {