示例#1
0
function db_deletePackageItem($id, $packageid)
{
    $sql = 'DELETE FROM module_vlabs_shoppingcart_package_summary ';
    $sql .= 'WHERE id = ' . $id;
    if (eF_executeQuery($sql)) {
        if (db_updatePackageTotal($packageid)) {
            return true;
        }
    } else {
        return false;
    }
    return false;
}
示例#2
0
     echo json_encode($result);
 } else {
     if ($action == "deletePkgItem") {
         if (isset($_POST['id'])) {
             $id = $_POST['id'];
         } else {
             $id = "";
         }
         if (isset($_POST['packageid'])) {
             $packageid = $_POST['packageid'];
         } else {
             $packageid = "";
         }
         if (!isPackageBeingUsed($packageid)) {
             if (db_deletePackageItem($id, $packageid)) {
                 if (db_updatePackageTotal($packageid)) {
                     $result = array('success' => true);
                 }
             } else {
                 $result = array('success' => false, 'message' => "Error executing database operation");
             }
         } else {
             $result = array('success' => false, 'message' => 'Package item cannot be deleted since package is being reference in existing orders');
         }
         echo json_encode($result);
     } else {
         if ($action == "isPkgBillable") {
             if (isset($_POST['packageid'])) {
                 $packageid = $_POST['packageid'];
             } else {
                 $packageid = 0;
示例#3
0
function db_deletePackageItem($id, $packageid)
{
    $sql = 'DELETE FROM mdl_shoppingcart_package_summary ';
    $sql .= 'WHERE id = ' . $id;
    if (execute_sql($sql, false)) {
        if (db_updatePackageTotal($packageid)) {
            return true;
        }
    } else {
        return false;
    }
    return false;
}