示例#1
0
<?php

$editing = true;
if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) {
    // if (!in_array(__FILE__, get_included_files())) { // we are being displayed directly
    require_once 'inc.php';
    // header
    myInit(__FILE__);
}
#$code = '
require_once "html.php";
// para las funciones html
$sep = "|";
// separador para adm_add() y calcular_factura()
// hacer arrays aparecer como strings (para pasarlos en forms)
// añadir un value al final de un arraystring
function adm_add($as, $v)
{
    // array string, value
    global $sep;
    return strlen($as) > 0 ? "{$as}{$sep}{$v}" : $v;
}
// suponiendo los argumentos son arraystrings del mismo tamaño, devolver el HTML para la factura
function calcular_factura($articulos, $precios, $cantidades, $iva)
{
    //
    global $sep;
    $headings = ["articulo", "precio", "cantidad", "subtotal"];
    $datos = [];
    // array de arrays de datos para table()
    if (strlen($articulos) > 0) {
示例#2
0
    $day = $_GET['day'];
} else {
    if (isset($_POST['day'])) {
        $day = $_POST['day'];
    }
}
if (isset($_GET['net'])) {
    $net = $_GET['net'];
} else {
    if (isset($_POST['net'])) {
        $net = $_POST['net'];
    }
}
echo "<p>Net [" . $net . "]</p>\n";
echo "<p>Day [" . $day . "]</p>\n";
echo "<p>Call [" . $call . "]</p>\n";
if ($day == "#" || $net == "#") {
    header("Location: rep_edit1.php");
}
$db = myInit($aa0, $aa1, $aa2, $aa3);
if ($call == "") {
    $SQL = "UPDATE `rep_liaisons` SET `call`=NULL" . " WHERE `net`=" . $net . " AND `day_of_week`=" . $day;
} else {
    $SQL = "UPDATE `rep_liaisons` SET `call`='" . $call . "' WHERE `net`=" . $net . " AND `day_of_week`=" . $day;
}
$res = getResult($SQL, $db);
if (!$res) {
    echo "<p><b>Error!</p></b>\n";
} else {
    header("Location: rep_edit1.php");
}