<?php global $db, $messages, $home_dir; require_once $home_dir . 'models/delivery_type.m.php'; $delivery_types = DeliveryType::all($db); $selected_delivery = DeliveryType::getDefault($delivery_types); ?> <div class="delivery-types list-group"> <?php foreach ($delivery_types as $delivery) { ?> <a class="list-group-item delivery-type-item <?php echo $selected_delivery === $delivery ? 'active' : ''; ?> " data-id="<?php echo $delivery->val('delivery_type_id'); ?> "> <?php if ($delivery->val('delivery_type_price') > 0) { ?> <span class="badge"><?php echo formatPrice($delivery->val('delivery_type_price')); ?> </span> <?php } ?> <span class="radio-checkbox"> <input type="radio" aria-label="Select type of delivery." <?php
<?php global $db, $messages, $home_dir, $globals, $path, $custAuth; require_once $home_dir . 'models/cart.m.php'; require_once $home_dir . 'models/delivery_type.m.php'; require_once $home_dir . 'models/payment_type.m.php'; require_once $home_dir . 'models/currency.m.php'; $page_title = t('Order'); $products = Cart::loadCart($db, $custAuth->customer->val('customer_id')); $totals = Cart::loadCartTotals($db, $custAuth->customer->val('customer_id')); $total_cart_value = $totals['p']; $delivery_types = DeliveryType::all($db); $delivery_type = DeliveryType::find($delivery_types, 'delivery_type_id', _g('delivery_type_id')); if (!isset($delivery_type)) { $delivery_type = DeliveryType::getDefault($delivery_types); } $payment_types = PaymentType::all($db); $payment_type = PaymentType::find($payment_types, 'payment_type_id', _g('payment_type_id')); if (!isset($payment_type)) { $payment_type = PaymentType::getDefault($payment_types); } $currency = Currency::getSelectedCurrency($db); $total_order_value = $total_cart_value + $currency->convert($delivery_type->fval('delivery_type_price')) + $currency->convert($delivery_type->fval('payment_type_price'));
<?php require_once $home_dir . 'models/delivery_type.m.php'; require_once $home_dir . 'classes/forms.php'; $form = new AdminForm('delivery_type'); $page = 'admin/form'; $form->add([['name' => 'delivery_type_name', 'label' => 'Name', 'type' => 'text', 'validations' => [['type' => 'length', 'param' => 1]]], ['name' => 'delivery_type_price', 'label' => 'Price', 'type' => 'text', 'validations' => [['type' => 'price']]], ['name' => 'delivery_type_min_order_cost', 'label' => 'Min. order cost', 'type' => 'text', 'validations' => [['type' => 'price']]]]); DeliveryType::process($db, $form);
?> <p>Your shopping cart is empty.</p> <?php } } ?> </div> </form> <script> var payment_types = [], delivery_types = []; <?php echo Currency::jsFormatPrice($db); $delivery_types = DeliveryType::all($db); foreach ($delivery_types as $d) { echo 'delivery_types[' . $d->val('delivery_type_id') . '] = ' . json_encode($d->data) . ';'; echo 'delivery_types[' . $d->val('delivery_type_id') . '].allowed = [];'; } $allowed = PaymentType::getAllowedPT($db); foreach ($allowed as $a) { echo 'delivery_types[' . $a->val('allowed_payment_type_delivery_type_id') . '].allowed.push(' . $a->val('allowed_payment_type_payment_type_id') . ');'; } $payment_types = PaymentType::all($db); foreach ($payment_types as $pt) { echo 'payment_types[' . $pt->val('payment_type_id') . '] = ' . json_encode($pt->data) . ';'; } ?> </script>
<tr> <th>Item Description</th> <th>Cost ( ₦ )</th> </tr> </thead> <tbody> <?php # Transcript Form Charges $charge1 = "Processing Fee"; $charge2 = "Postage Charge"; $charge3 = "Transaction Charge"; $payment_breakdown = array(); $total_amount = 0; # Display Delivery Type And Charge if (isset($_POST['dt_id'])) { $deliveryType = DeliveryType::find_by_id($_POST['dt_id']); if (isset($deliveryType->dt_name)) { echo ' <tr> <td>' . $charge1 . '</td> <td>₦' . $deliveryType->dt_amount . '</td> </tr> '; $total_amount += $deliveryType->dt_amount; $payment_breakdown[$charge1] = $deliveryType->dt_amount; } } # Display Delivery Mode And Charge if (isset($_POST['dm_id'])) { $deliveryMode = DeliveryMode::find_by_id($_POST['dm_id']); $post_amount;
</div><!--/span--> <div class="span9"> <div class="hero-unit"> <h4> <p class="label label-info">Application Details </p> </h4> <table class="table table-hover table-striped table-bordered"> <tbody> <tr> <td><i class="iconic-hash"> </i> Application Number : </td> <td colspan="2"><span class="label label-success"><?php echo $label; ?> </span></td> </tr> <tr> <?php $type = DeliveryType::find_by_id($myapp->type_id); ?> <td><i class="icon-tasks"> </i> Service Type : </td> <td colspan="2"><span class="label label-success"><?php echo $type->dt_name; ?> </span></td> </tr> <tr> <?php $mode = DeliveryMode::find_by_id($myapp->mode_id); ?> <td><i class="icon-road"></i> Delivery Mode : </td> <td colspan="2"><span class="label label-success"><?php echo $mode->dm_type; ?>