Example #1
0
<?php

include './admin/config.php';
include './admin/db_connection.php';
$_SESSION['job'] = $_REQUEST['jobref'];
$_SESSION['qty'] = $_REQUEST['quantity'];
$user_id = $_SESSION['sohorepro_companyid'];
$id_user = $_SESSION['sohorepro_userid'];
$shipping_address = ShippingAddress($user_id);
$primary_shipping = PrimaryShipping($user_id);
$user_manager = CheckManager($id_user);
if ($_GET['redirect'] == 'serivce_recipient') {
    ?>
<script>setTimeout("location.href=\'add_recipients.php?address_ste=1\'", 1000);</script>
<?php 
}
if ($_GET['delete_id']) {
    $delete_id = $_GET['delete_id'];
    $sql = "DELETE FROM sohorepro_address WHERE id = " . $delete_id . " ";
    $sql_result = mysql_query($sql);
    if ($sql_result) {
        $result = "success";
    } else {
        $result = "failure";
    }
}
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
Example #2
0
<?php

include './admin/config.php';
include './admin/db_connection.php';


if (isset($_POST['product_id']) && $_POST['product_id'] != '') {
    $product_id         =       $_POST['product_id'];
    $user_id            =       $_POST['user_id'];
    $query = "DELETE FROM sohorepro_checkout WHERE product_id = '" . $product_id . "' AND user_id = '" . $user_id . "'";
    mysql_query($query);
    $checkout_product = checkOut($user_id);
    $company_id       = COMPID($user_id);
    $shipping_address = ShippingAddress($company_id);
    $primary_shipping = PrimaryShipping($company_id);
    $comp_name = companyName($company_id);
    $reference        = $checkout_product[0]['reference'];
    $shipping_size    = count($shipping_address);
    $address_shipp = ($shipping_size == 1) ? $shipping_address[0]['id'] : '0' ;
    echo 'Remove the product successfully~';
}

//if (isset($_POST['user_id_clear']) && $_POST['user_id_clear'] != '') {
//    $product_id         =       $_POST['product_id_clear'];
//    $user_id            =       $_POST['user_id_clear'];
//    $query = "DELETE FROM sohorepro_checkout WHERE user_id = '" . $user_id . "'";
//    mysql_query($query);
//    $checkout_product = checkOut($user_id);
//    echo 'Removed the all products successfully~';
//}
?>