function addToCart() { global $user; $managerID = getManagerID($user['id']); $order = getAgentOrder($user['id']); $query = mysql_query("SELECT COUNT(id) FROM agent_cart WHERE order_id = '" . $order->id . "' AND product_id = '" . $_POST['id'] . "' "); $res = mysql_fetch_array($query); if ($res[0] > 0) { mysql_query("UPDATE agent_cart SET quantity = '" . $_POST['q'] . "' WHERE order_id = '" . $order->id . "' AND quantity = '" . $_POST['id'] . "' "); } else { mysql_query("INSERT INTO agent_cart (order_id, product_id, quantity) VALUES ('" . $order->id . "', '" . $_POST['id'] . "', '" . $_POST['q'] . "' ) "); } $incart = getAgentCartCount(); echo $incart; }
?> "> <span class="incart"><?php echo $item['quantity']; ?> </span> <?php echo $item['product']; ?> </li> <?php } ?> </ul> <?php $ccount = getAgentCartCount(); if ($ccount > 0) { ?> <div class="bottompanel"> <input type="button" value="Отправить заказ" id="confirmorder"> </div> <?php } ?> <script> var map;