コード例 #1
0
                    $sql_obj->execute();
                }
            }
            // do we need to generate a setup fee?
            if ($data["price_setup"] != "0.00" && $data["active"] == 1) {
                $obj_customer_order = new customer_orders();
                $obj_customer_order->id = $obj_customer->id;
                $obj_customer_order->load_data();
                $obj_customer_order->data_orders["date_ordered"] = date("Y-m-d");
                $obj_customer_order->data_orders["type"] = "service";
                $obj_customer_order->data_orders["customid"] = $obj_customer->obj_service->id;
                $obj_customer_order->data_orders["quantity"] = "1";
                $obj_customer_order->data_orders["price"] = $data["price_setup"];
                $obj_customer_order->data_orders["discount"] = $data["discount_setup"];
                $obj_customer_order->data_orders["description"] = "Setup Fee: " . $data["name_service"] . "";
                if (!$obj_customer_order->action_update_orders()) {
                    log_write("error", "process", "An unexpected error occured whilst attempting to add an order item to the customer");
                } else {
                    log_write("notification", "process", "Added setup fee of " . format_money($obj_customer_order->data_orders["amount"]) . " to customer orders, this will then be billed automatically.");
                }
            }
        }
        // return to services page
        header("Location: ../index.php?page=customers/service-edit.php&id_customer=" . $obj_customer->id . "&id_service_customer=" . $obj_customer->id_service_customer . "");
        exit(0);
    }
    /////////////////////////
} else {
    // user does not have perms to view this page/isn't logged on
    error_render_noperms();
    header("Location: ../index.php?page=message.php");
コード例 #2
0
            $sql_service_obj->execute();
            if (!$sql_service_obj->num_rows()) {
                log_write("error", "process", "Unable to find the service with ID of " . $data["customid"] . "");
            }
            unset($sql_service_obj);
            break;
    }
    /*
    	Check for any errors
    */
    if (error_check()) {
        $_SESSION["error"]["form"]["orders_view"] = "failed";
        header("Location: ../index.php?page=customers/orders-view.php&id_customer=" . $obj_customer->id . "&id_order=" . $obj_customer->id_order);
        exit(0);
    } else {
        /*
        	Update the database
        */
        // update
        $obj_customer->data_orders = $data;
        $obj_customer->action_update_orders();
        // return to services page
        header("Location: ../index.php?page=customers/orders.php&id_customer=" . $obj_customer->id . "");
        exit(0);
    }
} else {
    // user does not have perms to view this page/isn't logged on
    error_render_noperms();
    header("Location: ../index.php?page=message.php");
    exit(0);
}