示例#1
0
文件: order.php 项目: anton-kol/buelo
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;
}
示例#2
0
文件: cart.php 项目: anton-kol/buelo
    ?>
">
            <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;