<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Pembayaran extends CI_Controller {
    public function index() {
        $data = $this -> app -> get_keranjang();
        if($data) {
            $cek  = $this -> app -> get_alamat('cek_primary');
            
            if($cek || $data['Digital']) {
                $conf = [
                    'title'        => 'Pembayaran | ' . app('app_name'),
                    'navtop'       => true,
                    'loading' 	   => true,
                    'data'         => $data,
                    'alamat'       => $cek,
                    'page_title'   => 'Pembayaran',
				    'backto'       => site_url('keranjang'),   
                ];
        
                $this -> load -> view('layout/head', $conf);
                $this -> load -> view('layout/header');
                $this -> load -> view('pembayaran/main');
                $this -> load -> view('layout/footer');
                
            } else {
                $conf = [
                    'title'  => 'Pilih Alamat | ' . app('app_name'),
                    'data'	 => $this -> app -> get_alamat(),
                    'aksi'   => 'primary-0',
                    'page_title'   => 'Pembayaran',
				    'backto'       => site_url('keranjang'),
                ];
        
                $this -> load -> view('layout/head', $conf);
                $this -> load -> view('layout/header');
                $this -> load -> view('akun/alamat');
                $this -> load -> view('layout/footer');
                
            }

        } else {
            redirect();
        }
    }   
   
}

// Controller Pembayaran
// Kode ini dibuat oleh codelingker