예제 #1
0
 public function post_id_handler()
 {
     global $FANNIE_OP_DB;
     $upcs = FormLib::get_form_value('upc', array());
     $descs = FormLib::get_form_value('desc', array());
     $prices = FormLib::get_form_value('price', array());
     $brands = FormLib::get_form_value('brand', array());
     $skus = FormLib::get_form_value('sku', array());
     $sizes = FormLib::get_form_value('size', array());
     $units = FormLib::get_form_value('units', array());
     $vendors = FormLib::get_form_value('vendor', array());
     $ppos = FormLib::get_form_value('ppo', array());
     $counts = FormLib::get_form_value('counts', array());
     $dbc = FannieDB::get($FANNIE_OP_DB);
     $tag = new ShelftagsModel($dbc);
     for ($i = 0; $i < count($upcs); $i++) {
         $upc = $upcs[$i];
         $desc = isset($descs[$i]) ? $descs[$i] : '';
         $price = isset($prices[$i]) ? $prices[$i] : 0;
         $brand = isset($brands[$i]) ? $brands[$i] : '';
         $size = isset($sizes[$i]) ? $sizes[$i] : '';
         $sku = isset($skus[$i]) ? $skus[$i] : '';
         $unit = isset($units[$i]) ? $units[$i] : 1;
         $vendor = isset($vendors[$i]) ? $vendors[$i] : '';
         $ppo = isset($ppos[$i]) ? $ppos[$i] : '';
         $count = isset($counts[$i]) ? $counts[$i] : 1;
         $tag->id($this->id);
         $tag->upc($upc);
         $tag->description($desc);
         $tag->normal_price($price);
         $tag->brand($brand);
         $tag->sku($sku);
         $tag->size($size);
         $tag->units($unit);
         $tag->vendor($vendor);
         $tag->pricePerUnit($ppo);
         $tag->count($count);
         $tag->save();
     }
     header("Location: ShelfTagIndex.php");
     return false;
 }
예제 #2
0
$sku = $_REQUEST['sku'];
$price = $_REQUEST['price'];
$id = $_REQUEST['subID'];
$count = FormLib::get('count', 1);
$shelftag = new ShelftagsModel($dbc);
$shelftag->id($id);
$shelftag->upc($upc);
$shelftag->normal_price($price);
$shelftag->pricePerUnit($ppo);
$shelftag->description($description);
$shelftag->brand($brand);
$shelftag->sku($sku);
$shelftag->size($size);
$shelftag->units($units);
$shelftag->vendor($vendor);
$shelftag->count($count);
$insR = $shelftag->save();
?>
<!doctype html>
<html>
    <head>
        <title>Add Shelf Tag</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="text/css" href="../src/javascript/bootstrap/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../src/javascript/bootstrap-default/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../src/javascript/bootstrap-default/css/bootstrap-theme.min.css">
        <script type="text/javascript" src="../src/javascript/jquery/jquery.min.js"></script>
        <script type="text/javascript" src="../src/javascript/bootstrap/js/bootstrap.min.js"></script>
    </head>
<body>
<?php