Exemplo n.º 1
0
    foreach ($_SESSION['alloc']->allocs as $allocn_item) {
        if ($allocn_item->current_allocated > 0) {
            add_cust_allocation($allocn_item->current_allocated, $_SESSION['alloc']->type, $_SESSION['alloc']->trans_no, $allocn_item->type, $allocn_item->type_no, $_SESSION['alloc']->date_);
            update_debtor_trans_allocation($allocn_item->type, $allocn_item->type_no, $allocn_item->current_allocated);
            $total_allocated += $allocn_item->current_allocated;
        }
    }
    /*end of the loop through the array of allocations made */
    update_debtor_trans_allocation($_SESSION['alloc']->type, $_SESSION['alloc']->trans_no, $total_allocated);
    commit_transaction();
    clear_allocations();
}
//--------------------------------------------------------------------------------
if (isset($_POST['Process'])) {
    if (check_data()) {
        handle_process();
        $_POST['Cancel'] = 1;
    }
}
//--------------------------------------------------------------------------------
if (isset($_POST['Cancel'])) {
    clear_allocations();
    meta_forward($path_to_root . "/sales/allocations/customer_allocation_main.php");
    exit;
}
//--------------------------------------------------------------------------------
function get_allocations_for_transaction($type, $trans_no)
{
    clear_allocations();
    $debtor = get_customer_trans($trans_no, $type);
    $_SESSION['alloc'] = new allocation($trans_no, $type, $debtor["debtor_no"], $debtor["DebtorName"], $debtor["Total"], sql2date($debtor["tran_date"]));
Exemplo n.º 2
0
        term_echo("error opening output buffer file for writing");
        return;
    }
    stream_set_blocking($out_buffer, 0);
}
init();
$socket = initialize_socket();
initialize_irc_connection();
$antiflog = True;
# main program loop
while (True) {
    for ($i = 0; $i < count($handles); $i++) {
        if (isset($handles[$i]) == False) {
            continue;
        }
        if (handle_process($handles[$i]) == False) {
            unset($handles[$i]);
        }
    }
    $handles = array_values($handles);
    handle_socket($socket);
    handle_direct_stdin();
    if ($antiflog == True) {
        usleep(50000.0);
        # 0.05 second to prevent cpu flogging
    }
    $antiflog = True;
    process_timed_execs();
}
#####################################################################################################
function term_echo($msg)