public function add($id)
 {
     $id = current($id);
     $dvd = (new Dvd())->getById($id);
     if (empty($dvd)) {
         return notfound();
     }
     if ($dvd->rented == 1) {
         return notfound();
     }
     basket()->add($id, band2price($dvd->price_band));
     session()->addSuccess('DVD successfully added to basket');
     return redirect(l('basket'));
 }
Beispiel #2
0
                        <th>Price</th>
                        <th>Delete</th>
                    </tr>
                    <?php 
    foreach ($dvds as $dvd) {
        ?>
                        <tr>
                            <td><a href="<?php 
        echo l('browse/dvd/' . $dvd->id);
        ?>
"><?php 
        echo e($dvd->title);
        ?>
</a></td>
                            <td>£<?php 
        echo band2price($dvd->price_band, true);
        ?>
</td>
                            <td><a href="<?php 
        echo l('basket/delete/' . $dvd->id);
        ?>
">Remove from basket &rarr;</a></td>
                        </tr>
                    <?php 
    }
    ?>
                </table>
            </div>

            <div class="col-md-3 col-md-offset-1">
                <h2>Checkout</h2>