Example #1
0
    if (!$current_user->have_role("admin")) {
        $_FORM["personID"] = $current_user->get_id();
    }
    $rows = invoice::get_list($_FORM);
    echo invoice::get_list_html($rows, $_FORM);
}
$client = new client();
$clientID = $_POST["clientID"] or $clientID = $_GET["clientID"];
if ($_POST["save"]) {
    if (!$_POST["clientName"]) {
        alloc_error("Please enter a Client Name.");
    }
    $client->read_globals();
    $client->set_value("clientModifiedTime", date("Y-m-d"));
    $clientID = $client->get_id();
    $client->set_values("client_");
    if (!$client->get_id()) {
        // New client.
        $client->set_value("clientCreatedTime", date("Y-m-d"));
        $new_client = true;
    }
    if (!$TPL["message"]) {
        $client->save();
        $clientID = $client->get_id();
        $client->set_values("client_");
    }
} else {
    if ($_POST["save_attachment"]) {
        move_attachment("client", $clientID);
        alloc_redirect($TPL["url_alloc_client"] . "clientID=" . $clientID . "&sbs_link=attachments");
    } else {