예제 #1
0
파일: kosarica.php 프로젝트: zadnjipuki/ep
        <h2>Vsebina nakupovalne košarice</h2>

        <?php 
if (isset($_SESSION["cart"]) && count($_SESSION["cart"]) > 0) {
    ?>
            <table>
                <tr>
                    <td><b>Izdelek</b></td>
                    <td><b>Količina</b></td>
                    <td><b>Skupaj</b></td>
                </tr>
                <?php 
    $skupaj = 0;
    foreach ($_SESSION["cart"] as $id => $kolicina) {
        $izdelek = DBTrgovina::getPredmetKosarica($id);
        $skupaj += $izdelek->cena * $kolicina;
        ?>
                    <tr>
                        <td><?php 
        echo $izdelek;
        ?>
</td>
                        <td>
                            <form action="<?php 
        echo $url;
        ?>
" method="POST">
                                <input type="hidden" name="do" value="update_cart" />
                                <input type="hidden" name="id" value="<?php 
        echo $izdelek->id;