Exemplo n.º 1
0
    }
    $scale_array['label'] = $s_label;
    $scale_array['excpetionprice'] = 0.0;
    $scale_array['class'] = "''";
    $chk = $dbc->query("SELECT * FROM scaleItems WHERE plu='{$upc}'");
    $action = "ChangeOneItem";
    if ($dbc->num_rows($chk) == 0) {
        $dbc->smart_insert('scaleItems', $scale_array);
        $action = "WriteOneItem";
    } else {
        unset($scale_array['plu']);
        $dbc->smart_update('scaleItems', $scale_array, "plu='{$upc}'");
        $action = "ChangeOneItem";
    }
    include 'hobartcsv/parse.php';
    parseitem($action, $s_plu, trim($scale_array["itemdesc"], "'"), $scale_array['tare'], $scale_array['shelflife'], $scale_array['price'], $scale_array['bycount'], $s_type, 0.0, trim($scale_array['text'], "'"), $scale_array['label'], $scale_array['graphics'] == 1 ? 121 : 0);
}
/* 10. Delete and re-add to product-related tables on the lanes.  */
/* push updates to the lanes */
include 'laneUpdates_WEFC_Toronto.php';
updateAllLanes($upc, array("products", "productUser"));
// $dbc is looking at lane db now, so change it back.
// What is the DB function to do this? FannieDB::get()?
//   We're not in the right environment for that.
$dbc = new SQLManager($FANNIE_SERVER, $FANNIE_SERVER_DBMS, $FANNIE_OP_DB, $FANNIE_SERVER_USER, $FANNIE_SERVER_PW);
/* 'i9el. Update likecodes */
/* update the item's likecode if specified
   also update other items in the likecode
   if the appropriate box isn't checked */
if (isset($_REQUEST['likeCode']) && $_REQUEST['likeCode'] != -1) {
    $dbc->query("DELETE FROM upcLike WHERE upc='{$upc}'");
Exemplo n.º 2
0
function parsearbre($arr)
{
    global $rechlevel;
    if ($rechlevel == 0) {
        $result = str_pad('', $rechlevel, ' ', STR_PAD_LEFT) . '<ul class="arbre">' . "\n";
    } else {
        $result = str_pad('', $rechlevel, ' ', STR_PAD_LEFT) . '<ul>' . "\n";
    }
    $currrech = array();
    $hasentry = false;
    foreach ($arr as $v) {
        if (is_array($v)) {
            if ($hasentry) {
                $result .= parseitem($currrech);
            }
            $hasentry = false;
            $currrech = array();
            $rechlevel++;
            $result .= parsearbre($v);
            $rechlevel--;
        } else {
            array_push($currrech, $v);
            if (count($currrech) == 2) {
                $hasentry = true;
            }
        }
    }
    if ($hasentry) {
        $result .= parseitem($currrech);
    }
    return $result . '' . str_pad('', $rechlevel, ' ', STR_PAD_LEFT) . '</ul>' . "\n";
}
Exemplo n.º 3
0
        $graphics[$count] = false;
    } else {
        $graphics[$count] = $row[11];
    }
    $count++;
}
echo "Items sent to the scale: <br />";
echo "<table cellspacing=2 cellpadding=2 border=1>";
echo "<tr>";
echo "<td>upc</td><td>price</td><td>description</td><td>exception price</td><td>weight</td><td>by count</td><td>tare</td><td>shelf life</td><td>text</td>";
echo "</tr>";
for ($i = 0; $i < count($plu); $i++) {
    echo "<tr>";
    echo "<td>{$plu[$i]}</td>";
    echo "<td>{$price[$i]}</td>";
    echo "<td>{$itemdesc[$i]}</td>";
    echo "<td>{$exceptionprice[$i]}</td>";
    echo "<td>{$weight[$i]}</td>";
    echo "<td>{$bycount[$i]}</td>";
    echo "<td>{$tare[$i]}</td>";
    echo "<td>{$shelflife[$i]}</td>";
    echo "<td>{$text[$i]}</td>";
    echo "</tr>";
    //parseitem('ChangeOneItem',$plu[$i],$itemdesc[$i],$tare[$i],$shelflife[$i],$price[$i],$bycount[$i],$weight[$i],$exceptionprice[$i],$text[$i],$label[$i],$graphics[$i]);
}
echo "</table>";
if (isset($_GET['asnew'])) {
    parseitem('WriteOneItem', $plu, $itemdesc, $tare, $shelflife, $price, $bycount, $weight, $exceptionprice, $text, $label, $graphics);
} else {
    parseitem('ChangeOneItem', $plu, $itemdesc, $tare, $shelflife, $price, $bycount, $weight, $exceptionprice, $text, $label, $graphics);
}