
            <!--<div class="loader"></div>-->
            <!-- BEGIN DASHBOARD STATS -->
            <div class="row">
                <div class="col-md-12">
                    <h4>DXB Account Details</h4>
                    <hr>
                </div>
                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                    <a href="<?php echo base_url().'view_stock_balance?stock=DXB Cash'; ?>">
                        <div class="dashboard-stat red-intense">
                            <div class="visual">
                                <i class="fa fa-dollar"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo 'Rs '.number_format($stock_details->cash_in_hand,2,'.',',');?>
                                </div>
                                <div class="desc">
                                    Cash In Hand
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'view_stock_balance?stock=DXB Cash'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                    <a href="<?php echo base_url().'bank_accounts'; ?>">
                        <div class="dashboard-stat green-haze">
                            <div class="visual">
                                <i class="fa fa-bank"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo 'Rs '.number_format($dxb_bank_balances->cash_at_bank,2,'.',',');?>
                                </div>
                                <div class="desc">
                                    Cash At Bank
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'bank_accounts'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
                <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                    <a href="<?php echo base_url().'view_stock_balance?stock=DXB 22K Gold'; ?>">
                        <div class="dashboard-stat purple-plum">
                            <div class="visual">
                                <i class="fa fa-globe"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo number_format($stock_details->tt_gold_in_hand,3,'.',',').' g';?>
                                </div>
                                <div class="desc">
                                    22K Gold
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'view_stock_balance?stock=DXB 22K Gold'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
                <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                    <a href="<?php echo base_url().'view_stock_balance?stock=DXB 24K Gold'; ?>">
                        <div class="dashboard-stat green-jungle">
                            <div class="visual">
                                <i class="fa fa-globe"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo number_format($stock_details->tf_gold_in_hand,3,'.',',').' g';?>
                                </div>
                                <div class="desc">
                                    24K Gold
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'view_stock_balance?stock=DXB 24K Gold'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
                <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                    <a href="<?php echo base_url().'view_rate?rate_id=1'; ?>">
                        <div class="dashboard-stat blue-steel">
                            <div class="visual">
                                <i class="fa fa-bar-chart-o"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo 'Rs '.number_format($rate_details[0]['item_rate'],2,'.',',');?>
                                </div>
                                <div class="desc">
                                    <?php echo $rate_details[0]['item_name']; ?>
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'view_rate?rate_id=1'; ?>">
                            Last Updated On : <?php echo $rate_details[0]['updated_on']; ?> <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <h4>BOX Account Details</h4>
                    <hr>
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
                    <a href="<?php echo base_url().'view_stock_balance?stock=BOX Cash'; ?>">
                        <div class="dashboard-stat red-intense">
                            <div class="visual">
                                <i class="fa fa-dollar"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo 'Rs '.number_format($stock_details->box_cash_in_hand,2,'.',',');?>
                                </div>
                                <div class="desc">
                                    Cash In Hand
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'view_stock_balance?stock=BOX Cash'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
                    <a href="<?php echo base_url().'bank_accounts'; ?>">
                        <div class="dashboard-stat green-haze">
                            <div class="visual">
                                <i class="fa fa-bank"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo 'Rs '.number_format($box_bank_balances->cash_at_bank,2,'.',',');?>
                                </div>
                                <div class="desc">
                                    Cash At Bank
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'bank_accounts'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
                    <a href="<?php echo base_url().'view_stock_balance?stock=BOX 22K Gold'; ?>">
                        <div class="dashboard-stat purple-plum">
                            <div class="visual">
                                <i class="fa fa-globe"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo number_format($stock_details->box_tt_gold_in_hand,3,'.',',').' g';?>
                                </div>
                                <div class="desc">
                                    22K Gold
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'view_stock_balance?stock=BOX 22K Gold'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
                    <a href="<?php echo base_url().'view_stock_balance?stock=BOX 24K Gold'; ?>">
                        <div class="dashboard-stat green-jungle">
                            <div class="visual">
                                <i class="fa fa-globe"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo number_format($stock_details->box_tf_gold_in_hand,3,'.',',').' g';?>
                                </div>
                                <div class="desc">
                                    24K Gold
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'view_stock_balance?stock=BOX 24K Gold'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <h4>Pending Cheques</h4>
                    <hr>
                </div>                      
                <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
                    <a href="<?php echo base_url().'cheques'; ?>">
                        <div class="dashboard-stat blue-madison">
                            <div class="visual">
                                <i class="fa fa-dollar"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo 'Rs '.number_format($one_week_cheques->tot_amount ,2,'.',',');?>
                                </div>
                                <div class="desc">
                                    Within One Week - <?php echo $one_week_cheques->no_of_cheques; ?> Cheque(s)
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'cheques'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
                    <a href="<?php echo base_url().'cheques'; ?>">
                        <div class="dashboard-stat blue-madison">
                            <div class="visual">
                                <i class="fa fa-dollar"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo 'Rs '.number_format($two_week_cheques->tot_amount,2,'.',',');?>
                                </div>
                                <div class="desc">
                                    Within Two Week - <?php echo $two_week_cheques->no_of_cheques; ?> Cheque(s)
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'cheques'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
                    <a href="<?php echo base_url().'cheques'; ?>">
                        <div class="dashboard-stat blue-madison">
                            <div class="visual">
                                <i class="fa fa-dollar"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo 'Rs '.number_format($four_week_cheques->tot_amount,2,'.',',');?>
                                </div>
                                <div class="desc">
                                    Within Four Week - <?php echo $four_week_cheques->no_of_cheques; ?> Cheque(s)
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'cheques'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
                    <a href="<?php echo base_url().'cheques'; ?>">
                        <div class="dashboard-stat blue-madison">
                            <div class="visual">
                                <i class="fa fa-dollar"></i>
                            </div>
                            <div class="details">
                                <div class="number">
                                    <?php echo 'Rs '.number_format($more_than_four_week_cheques->tot_amount,2,'.',',');?>
                                </div>
                                <div class="desc">
                                    More Than Four Week - <?php echo $more_than_four_week_cheques->no_of_cheques; ?> Cheque(s)
                                </div>
                            </div>
                            <a class="more" href="<?php echo base_url().'cheques'; ?>">
                            View more <i class="m-icon-swapright m-icon-white"></i>
                            </a>
                        </div>
                    </a>
                </div>
            </div>
            <!-- END DASHBOARD STATS -->
            <div class="row hidden">
                <div class="col-md-6">
                    <!-- Begin: life time stats -->
                    <div class="portlet box blue-steel">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-thumb-tack"></i>Overview
                            </div>
                        </div>
                            <div class="portlet-body">
                                <ul class="nav nav-tabs">
                                    <li class="dropdown active">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                            Sales <i class="fa fa-angle-down"></i>
                                        </a>
                                        <ul class="dropdown-menu" role="menu">
                                            <li class="active">
                                                    <a href="#overview_3" tabindex="-1" data-toggle="tab">
                                                    Latest 10 Sales </a>
                                            </li>
                                            <li>
                                                    <a href="#overview_4" tabindex="-1" data-toggle="tab">
                                                    Pending Payments </a>
                                            </li>
                                            <li>
                                                    <a href="#overview_5" tabindex="-1" data-toggle="tab">
                                                    Incomplete Payments </a>
                                            </li>
                                            <li>
                                                    <a href="#overview_6" tabindex="-1" data-toggle="tab">
                                                    Completed Payments </a>
                                            </li>
                                        </ul>
                                    </li>
                                    <li>
                                        <a href="#overview_1" data-toggle="tab">
                                            New Customers 
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#overview_2" data-toggle="tab">
                                            Debtors
                                        </a>
                                    </li>
                                </ul>
                                <div class="tab-content">
                                    <div class="tab-pane active" id="overview_3">
                                        <div class="table-responsive">
                                            <table class="table table-hover table-bordered">
                                                <thead>
                                                    <tr>
                                                        <th>
                                                            Customer Name
                                                        </th>
                                                        <th>
                                                            Payment Status
                                                        </th>
                                                        <th>
                                                            Credit Duration
                                                        </th>
                                                        <th>
                                                            Balance Amount
                                                        </th>
                                                        <th></th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php 
                                                    if($all_sales){ 
                                                        foreach ($all_sales as $x => $all_sale) {
                                                        if($all_sale['sale_status'] != '1'){
                                                            $invoice_date = date("Y-m-d", strtotime($all_sale['invoiced_on']));
                                                            $date1=date_create($invoice_date);
                                                            $date2=date_create($system_date);
                                                            $diff=date_diff($date1,$date2); 
                                                            $no_of_days = $diff->format("%a");
                                                            if($no_of_days >= 7){
                                                                $pulse_effect = "style='background-color: #ff00003d;'";
                                                            }else{
                                                                $pulse_effect = '';
                                                            }
                                                            $credit_days = $diff->format("%a Days");
                                                        }else{
                                                            $pulse_effect = '';
                                                            $credit_days = '-';
                                                        }
                                                    ?>
                                                        <tr <?php echo $pulse_effect; ?>>
                                                            <td>
                                                                <a href="<?php echo base_url().'view_customer?customer_id='.$all_sale['customer_id'];?>"><?php echo $all_sale['customer_name']; ?></a>
                                                            </td>
                                                            <td>
                                                                <?php
                                                                if($all_sale['sale_status'] == 1){
                                                                    echo '<span class="label label-success">Completed</span>';
                                                                }else if($all_sale['sale_status'] == 2){
                                                                    echo '<span class="label label-warning">Incomplete</span>';
                                                                }else if($all_sale['sale_status'] == 3){
                                                                    echo '<span class="label label-danger">Pending</span>';
                                                                }
                                                                ?>
                                                            </td>
                                                            <td>
                                                                <?php echo $credit_days; ?>
                                                            </td>
                                                            <td>
                                                                <div class="pull-right">
                                                                <?php 
                                                                if($all_sale['sale_type'] == 'Credit Sale'){
                                                                    echo 'Rs. '.number_format($all_sale['balance_amount'],2,'.',',');
                                                                }else if($all_sale['sale_type'] == 'Gold Sale'){
                                                                    echo $all_sale['balance_amount'].' g';
                                                                }
                                                                ?>
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <a data-toggle="tooltip" title="View Sale" class="btn default btn-xs blue-stripe" href="<?php echo base_url().'view_sale?sale_id='.$all_sale['sale_id'];?>"> View </a>
                                                            </td>
                                                        </tr>
                                                    <?php }} ?>                                                    
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="tab-pane" id="overview_4">
                                        <div class="table-responsive">
                                            <table class="table table-striped table-hover table-bordered">
                                                <thead>
                                                    <tr>
                                                        <th>
                                                            Customer Name
                                                        </th>
                                                        <th>
                                                            Payment Status
                                                        </th>
                                                        <th>
                                                            Credit Duration
                                                        </th>
                                                        <th>
                                                            Balance Amount
                                                        </th>
                                                        <th></th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php 
                                                    if($pending_sales){ 
                                                        foreach ($pending_sales as $pending_sale) {
                                                        if($pending_sale['sale_status'] != '1'){
                                                            $invoice_date = date("Y-m-d", strtotime($pending_sale['invoiced_on']));
                                                            $date1=date_create($invoice_date);
                                                            $date2=date_create($system_date);
                                                            $diff=date_diff($date1,$date2); 
                                                            $no_of_days = $diff->format("%a");
                                                            if($no_of_days >= 7){
                                                                $pulse_effect = "style='background-color: #ff00003d;'";
                                                            }else{
                                                                $pulse_effect = '';
                                                            }
                                                            $credit_days = $diff->format("%a Days");
                                                        }else{
                                                            $pulse_effect = '';
                                                            $credit_days = '-';
                                                        }
                                                    ?>
                                                        <tr <?php echo $pulse_effect; ?>>
                                                            <td>
                                                                <a href="<?php echo base_url().'view_customer?customer_id='.$pending_sale['customer_id'];?>"><?php echo $pending_sale['customer_name']; ?></a>
                                                            </td>
                                                            <td>
                                                                <?php
                                                                if($pending_sale['sale_status'] == 1){
                                                                    echo '<span class="label label-success">Completed</span>';
                                                                }else if($pending_sale['sale_status'] == 2){
                                                                    echo '<span class="label label-warning">Incomplete</span>';
                                                                }else if($pending_sale['sale_status'] == 3){
                                                                    echo '<span class="label label-danger">Pending</span>';
                                                                }
                                                                ?>
                                                            </td>
                                                            <td>
                                                                <?php echo $credit_days; ?>
                                                            </td>
                                                            <td>
                                                                <div class="pull-right">
                                                                <?php 
                                                                if($pending_sale['sale_type'] == 'Credit Sale'){
                                                                    echo 'Rs. '.number_format($pending_sale['balance_amount'],2,'.',',');
                                                                }else if($pending_sale['sale_type'] == 'Gold Sale'){
                                                                    echo $pending_sale['balance_amount'].' g';
                                                                }
                                                                ?>
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <a data-toggle="tooltip" title="View Sale" class="btn default btn-xs blue-stripe" href="<?php echo base_url().'view_sale?sale_id='.$pending_sale['sale_id'];?>"> View </a>
                                                            </td>
                                                        </tr>
                                                    <?php }} ?>                                                    
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="tab-pane" id="overview_5">
                                        <div class="table-responsive">
                                            <table class="table table-striped table-hover table-bordered">
                                                <thead>
                                                    <tr>
                                                        <th>
                                                            Customer Name
                                                        </th>
                                                        <th>
                                                            Payment Status
                                                        </th>
                                                        <th>
                                                            Credit Duration
                                                        </th>
                                                        <th>
                                                            Balance Amount
                                                        </th>
                                                        <th></th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php 
                                                    if($incomplete_sales){ 
                                                        foreach ($incomplete_sales as $incomplete_sale) {
                                                        if($incomplete_sale['sale_status'] != '1'){
                                                            $invoice_date = date("Y-m-d", strtotime($incomplete_sale['invoiced_on']));
                                                            $date1=date_create($invoice_date);
                                                            $date2=date_create($system_date);
                                                            $diff=date_diff($date1,$date2); 
                                                            $no_of_days = $diff->format("%a");
                                                            if($no_of_days >= 7){
                                                                $pulse_effect = "style='background-color: #ff00003d;'";
                                                            }else{
                                                                $pulse_effect = '';
                                                            }
                                                            $credit_days = $diff->format("%a Days");
                                                        }else{
                                                            $pulse_effect = '';
                                                            $credit_days = '-';
                                                        }
                                                    ?>
                                                        <tr <?php echo $pulse_effect; ?>>
                                                            <td>
                                                                <a href="<?php echo base_url().'view_customer?customer_id='.$incomplete_sale['customer_id'];?>"><?php echo $incomplete_sale['customer_name']; ?></a>
                                                            </td>
                                                            <td>
                                                                <?php
                                                                if($incomplete_sale['sale_status'] == 1){
                                                                    echo '<span class="label label-success">Completed</span>';
                                                                }else if($incomplete_sale['sale_status'] == 2){
                                                                    echo '<span class="label label-warning">Incomplete</span>';
                                                                }else if($incomplete_sale['sale_status'] == 3){
                                                                    echo '<span class="label label-danger">Pending</span>';
                                                                }
                                                                ?>
                                                            </td>
                                                            <td>
                                                                <?php echo $credit_days; ?>
                                                            </td>
                                                            <td>
                                                                <div class="pull-right">
                                                                <?php 
                                                                if($incomplete_sale['sale_type'] == 'Credit Sale'){
                                                                    echo 'Rs. '.number_format($incomplete_sale['balance_amount'],2,'.',',');
                                                                }else if($incomplete_sale['sale_type'] == 'Gold Sale'){
                                                                    echo $incomplete_sale['balance_amount'].' g';
                                                                }
                                                                ?>
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <a data-toggle="tooltip" title="View Sale" class="btn default btn-xs blue-stripe" href="<?php echo base_url().'view_sale?sale_id='.$incomplete_sale['sale_id'];?>"> View </a>
                                                            </td>
                                                        </tr>
                                                    <?php }} ?>                                                    
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="tab-pane" id="overview_6">
                                        <div class="table-responsive">
                                            <table class="table table-striped table-hover table-bordered">
                                                <thead>
                                                    <tr>
                                                        <th style="width: 12%;">
                                                            Date
                                                        </th>
                                                        <th>
                                                            Customer Name
                                                        </th>
                                                        <th>
                                                            Payment Status
                                                        </th>
                                                        <th>
                                                            Total Amount
                                                        </th>
                                                        <th></th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php 
                                                    if($completed_sales){ 
                                                        foreach ($completed_sales as $completed_sale) {
                                                    ?>
                                                        <tr>
                                                            <td>
                                                                <?php echo date("d-m-Y", strtotime($completed_sale['invoiced_on'])); ?>
                                                            </td>
                                                            <td>
                                                                <a href="<?php echo base_url().'view_customer?customer_id='.$completed_sale['customer_id'];?>"><?php echo $completed_sale['customer_name']; ?></a>
                                                            </td>
                                                            <td>
                                                                <?php
                                                                if($completed_sale['sale_status'] == 1){
                                                                    echo '<span class="label label-success">Completed</span>';
                                                                }else if($completed_sale['sale_status'] == 2){
                                                                    echo '<span class="label label-warning">Incomplete</span>';
                                                                }else if($completed_sale['sale_status'] == 3){
                                                                    echo '<span class="label label-danger">Pending</span>';
                                                                }
                                                                ?>
                                                            </td>
                                                            <td>
                                                                <div class="pull-right">
                                                                <?php 
                                                                if($completed_sale['sale_type'] == 'Credit Sale'){
                                                                    echo 'Rs. '.number_format($completed_sale['total_amount'],2,'.',',');
                                                                }else if($completed_sale['sale_type'] == 'Gold Sale'){
                                                                    echo $completed_sale['total_amount'].' g';
                                                                }
                                                                ?>
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <a data-toggle="tooltip" title="View Sale" class="btn default btn-xs blue-stripe" href="<?php echo base_url().'view_sale?sale_id='.$completed_sale['sale_id'];?>"> View </a>
                                                            </td>
                                                        </tr>
                                                    <?php }} ?>                                                    
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="tab-pane" id="overview_1">
                                        <div class="table-responsive">
                                            <table class="table table-striped table-hover table-bordered">
                                                <thead>
                                                    <tr>
                                                        <th>
                                                            Customer Name
                                                        </th>
                                                        <th>
                                                            Contact Number
                                                        </th>
                                                        <th>
                                                            Customer Type
                                                        </th>
                                                        <th>
                                                            Customer Status
                                                        </th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php 
                                                    if($new_customers){ 
                                                        foreach ($new_customers as $new_customer) {
                                                    ?>
                                                        <tr>
                                                            <td>
                                                                <a href="<?php echo base_url().'view_customer?customer_id='.$new_customer['id'];?>"><?php echo $new_customer['customer_name']; ?></a>
                                                            </td>
                                                            <td> 
                                                                <?php echo $new_customer['contact_number'] ?>
                                                            </td>
                                                            <td>
                                                                <?php echo $new_customer['customer_type'] ?>
                                                            </td>
                                                            <td>
                                                                <?php
                                                                    if($new_customer['status'] == 1){
                                                                        echo '<span class="label label-success">Active</span>';
                                                                    }else if($new_customer['status'] == 2){
                                                                        echo '<span class="label label-warning">Inactive</span>';
                                                                    }else if($new_customer['status'] == 3){
                                                                        echo '<span class="label label-danger">Deleted</span>';
                                                                    }else if($new_customer['status'] == 4){
                                                                        echo '<span class="label label-info">Hold-On</span>';
                                                                    }
                                                                ?>
                                                            </td>
                                                        </tr>
                                                    <?php }} ?>                                                    
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="tab-pane" id="overview_2">
                                        <div class="table-responsive">
                                            <table class="table table-striped table-hover table-bordered">
                                                <thead>
                                                    <tr>
                                                        <th>
                                                            Customer Name
                                                        </th>
                                                        <th>
                                                            Customer Type
                                                        </th>
                                                        <th>
                                                            Cash
                                                        </th>
                                                        <th>
                                                            Gold
                                                        </th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php 
                                                    if($new_debtors){ 
                                                        foreach ($new_debtors as $new_debtor) {
                                                    ?>
                                                        <tr>
                                                            <td>
                                                                <a href="<?php echo base_url().'view_debtor?customer_id='.$new_debtor['id'];?>"><?php echo $new_debtor['customer_name']; ?></a>
                                                            </td>
                                                            <td>
                                                                <?php echo $new_debtor['customer_type']; ?>
                                                            </td>
                                                            <td>
                                                                <div class="pull-right">
                                                                <?php 
                                                                    echo 'Rs. '.number_format($new_debtor['debt_amount_cash'],2,'.',',');
                                                                ?> 
                                                                </div>
                                                            </td>
                                                            <td>
                                                                <div class="pull-right">
                                                                <?php 
                                                                    echo number_format($new_debtor['debt_amount_gold'],3,'.',',').' g';
                                                                ?> 
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    <?php }} ?>                                                    
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                    </div>
                    <!-- End: life time stats -->
                </div>
                <div class="col-md-6">
                    <!-- Begin: life time stats -->
                    <div class="portlet box red-sunglo tabbable">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-bar-chart-o"></i>Monthly Credit Collection 
                            </div>
                        </div>
                        <div class="portlet-body">
                            <div class="portlet-tabs">
                                <div class="tab-content">
                                    <div class="tab-pane active" id="portlet_tab1">
                                        <div id="statistics_1" class="chart">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="well no-margin no-border hidden">
                                        <div class="row">
                                                <div class="col-md-3 col-sm-3 col-xs-6 text-stat">
                                                        <span class="label label-success">
                                                        Revenue: </span>
                                                        <h3>$1,234,112.20</h3>
                                                </div>
                                                <div class="col-md-3 col-sm-3 col-xs-6 text-stat">
                                                        <span class="label label-info">
                                                        Tax: </span>
                                                        <h3>$134,90.10</h3>
                                                </div>
                                                <div class="col-md-3 col-sm-3 col-xs-6 text-stat">
                                                        <span class="label label-danger">
                                                        Shipment: </span>
                                                        <h3>$1,134,90.10</h3>
                                                </div>
                                                <div class="col-md-3 col-sm-3 col-xs-6 text-stat">
                                                        <span class="label label-warning">
                                                        Orders: </span>
                                                        <h3>235090</h3>
                                                </div>
                                        </div>
                                </div>
                        </div>
                    </div>
                    <!-- End: life time stats -->
            </div>
                
            </div>
        </div>
    </div>
    <!-- END CONTENT -->
</div>
<!-- END CONTAINER -->