include_once 'config.php'; try { if (isset($_GET['movID']) && $_GET['movID'] !== '') { $movID = $_GET['movID']; $link = new PDO($db_url, $user, $password, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); // En la condición solo se toma en cuenta el Mov y MovID. Se omitió la empresa porque actualmente el MovID es diferente en cada empresa. $handle = $link->prepare('SELECT id, movID, almacenDestino office, estatus status FROM ' . $table_inventory . ' WHERE Mov = :mov AND MovID = :movID'); /*$handle = $link->prepare('SELECT '.$table_inventory.'.id, '.$table_inventory.'.mov, '.$table_inventory.'.movID, '.$table_article.'.fabricante, '.$table_inventory_detail.'.articulo code, '.$table_inventory_detail.'.cantidad requestQuantity, '.$table_inventory_existence.'.inventario inventoryQuantity, '.$table_inventory.'.empresa company, '.$table_inventory.'.almacen warehouse, '.$table_inventory.'.almacenDestino office, '.$table_inventory_detail.'.renglon row FROM '.$table_inventory.' JOIN '.$table_inventory_detail.' ON '.$table_inventory.'.ID = '.$table_inventory_detail.'.ID JOIN '.$table_article.' ON '.$table_inventory_detail.'.Articulo = '.$table_article.'.Articulo JOIN '.$table_inventory_existence.' ON '.$table_inventory_detail.'.Articulo = '.$table_inventory_existence.'.Articulo AND '.$table_inventory_existence.'.Almacen = '.$table_inventory_detail.'.Almacen WHERE '.$table_inventory_detail.'.SECCION IS NULL AND '.$table_inventory_existence.'.Inventario > 0 AND '.$table_inventory.'.Mov = :mov AND '.$table_inventory.'.MovID = :movID ORDER BY '.$table_article.'.Fabricante, '.$table_inventory_detail.'.Articulo, '.$table_inventory_detail.'.ID');*/ $mov = 'Orden Traspaso'; $handle->bindParam(':mov', $mov); $handle->bindParam(':movID', $movID); $handle->execute(); if ($order = $handle->fetchObject()) { $order->products = getOrderDetail($link, $order); $order->totalProducts = getTotalProducts($link, $order); echo json_encode($order); } else { echo json_encode(false); } } } catch (PDOException $ex) { error_log($ex->getMessage()); print $ex->getMessage(); } //@return: false. Fallo en la consulta. function getOrderDetail($link, $order) { include 'config.php'; $handle = $link->prepare('SELECT invD.articulo code, invD.cantidad requestQuantity, invD.renglon row, invExistence.inventario inventoryQuantity FROM ' . $table_inventory_detail . ' invD JOIN ' . $table_article . ' art ON invD.articulo = art.articulo JOIN ' . $table_inventory_existence . ' invExistence ON invD.Articulo=invExistence.Articulo AND invExistence.Almacen=invD.Almacen WHERE invD.id = :id AND invD.seccion IS NULL AND invExistence.inventario > 0 ORDER BY art.fabricante, invD.articulo'); $handle->bindParam(':id', $order->id);
<?php include_once "./header.php"; include_once './commonlib.php'; $conn = getConnection('ibabymall'); $ary = getBrandCounts($conn); $ary3 = getBrandKeywordCounts($conn); $ary2 = getKeywordCounts($conn); $prodCNT = getTotalProducts($conn); ?> <link href="./assets/c3.css" rel="stylesheet" type="text/css"> <script src="./assets/d3.min.js" charset="utf-8"></script> <script src="./assets/c3.min.js"></script> <div class="row"> <div class="col-sm-2"></div> <div class="col-sm-4"> <table class="table table-striped table-bordered table-hover"> <thead> <tr class="info"> <th>品牌</th> <th>類型</th> <th>數量</th> </tr> </thead> <tbody> <?php for ($i = 0; $i < sizeof($ary3); $i += 3) { echo '<tr class="success">'; echo "<td> " . $ary3[$i] . " </td><td>" . $ary3[$i + 1] . "</td><td>" . $ary3[$i + 2] . "</td> \n"; echo '</tr>';
insertProduct($data); } } } if (isset($_GET["sub_id"])) { $sub_id = $_GET["sub_id"]; } else { $sub_id = null; $subs = getMenuSubs($menu_id); } $res = getMenuProducts($menu_id, $sub_id); if (isset($_GET["prID"])) { $pr = getProductByID($_GET["prID"]); } } else { $res = getTotalProducts(); } if ($res != 0) { $products = $res; } ?> <div id="content" class="large-8 large-push-2 columns"> <div class="title"> <div class="inlineDiv clickAble" data-type="gourl" data-url="<?php echo HTTP_PATH . 'redeem/'; ?> "> Shop </div> <i class="icon-icons_thickrightarrow smalli"></i>
} else { $sort = 'brand'; } if (isset($_GET['order'])) { $order = $_GET['order']; } else { $order = 'ASC'; } if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; } $numrows = 20; $data = array('sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $numrows, 'limit' => $numrows); $total_product = getTotalProducts(); $products = getProducts($data); $pagination = new Pagination(); $pagination->total = $total_product; $pagination->page = $page; $pagination->limit = $numrows; $pagination->url = "product/page{page}.html"; $pagination = $pagination->render(); $url = ''; if ($order == 'ASC') { $url .= '/DESC'; } else { $url .= '/ASC'; } if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['selected'])) { foreach ($_POST['selected'] as $product_id) {