<aside class="right-side">
    <section class="content-header">
        <div class="title_bar">
            <h1 class="major_txt_color"><a href="<?php echo get_bill_list_url(); ?>" class="list-btn"><i class="fa fa-list" title="Go to Listing"></i></a><?php echo $title; ?> - View</h1>
            <div class="breadcrumb_container"><?php echo breadcrumb_links();?></div>
        </div>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                
                <div class="box box-danger">
                    <div class="box-body row" style="padding: 10px 15px 0px 15px;">
                        <div class="col-xs-12 tabs">
                            <div class="col-md-4 active autoload"><i class="fa fa-paper-plane-o"></i>Membership Card Registration<div id="curve"></div><div id="padder"></div></div>
                            <div class="col-md-4" data-target="#tab-2"><i class="fa fa-paper-plane-o"></i> Payments</div>
                        </div>     

                        <div class="col-xs-12 tab view-form">

                            <div class="col-xs-12 blck">
                                <div class="sub-title err-target"><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Naivedyam Details</h4><i class="ctrl opener opened fa fa-chevron-up" style="float: right; margin-top: -25px;"></i></div>
                                <div class="blck-content col-xs-12">
                                    <div class="col-md-6">        
                                        <div class="form-group float-clear">
                                            <label>Card No</label><div class="lbl-value"><?php echo text($member->card_no); ?></div>
                                        </div>

                                        <div class="form-group float-clear">
                                            <label>Name</label><div class="lbl-value"><?php echo text($member->name); ?></div>
                                        </div>

                                        <div class="form-group float-clear">
                                            <label>Star</label><div class="lbl-value"><?php echo (!empty($member->star_name)) ? $member->star_name . ' / ' . $member->star_tamil_name : 'N/A';?></div>
                                        </div>

                                        <div class="form-group">
                                            <label>Email Id</label><div class="lbl-value"><?php echo text($member->email); ?></div>
                                        </div>
                                    </div>

                                    <div class="col-md-6">                                    
                                        <div class="form-group">
                                            <label>Amount</label><div class="lbl-value"><?php echo text($member->amount); ?></div>
                                        </div>

                                        <div class="form-group float-clear">
                                            <label>Name (T)</label><div class="lbl-value">
                                            <?php echo (!empty($member->tamil_name)) ? '<span class="lang-tamil">' . $member->tamil_name . '</span>' : 'N/A';?>
                                            </div>
                                        </div>

                                        <div class="form-group float-clear">
                                            <label>Contact No</label><div class="lbl-value"><?php echo text(nl2br($member->contact_no)); ?></div>
                                        </div>

                                        <div class="form-group">
                                            <label>Address</label><div class="lbl-value"><?php echo text(nl2br($member->address)); ?></div>
                                        </div>

                                        

                                    </div>

                                </div> <!-- blck-content -->    
                            </div> <!-- blck -->

                            <div class="col-xs-12 blck innr-table">
                                <div class="sub-title err-target" ><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Add Members</h4><i class="ctrl opener fa fa-chevron-up opened" style="float: right; margin-top: -25px;"></i></div>
                                <div class="blck-content col-xs-12">
                                    <div class="col-xs-12">                                    
                                        <div class="col-md-4"> 
                                            <label>Name</label>
                                        </div>
                                        
                                        <div class="col-md-4"> 
                                            <label>Star</label>
                                        </div>
                                        
                                        <div class="col-md-4"> 
                                            <label>Name (T)</label>
                                        </div>
                                        
                                    </div>     

                                    <?php foreach($member_list as $k=> $items){?>
                                       
                                        <div class="col-xs-12 row-details">
                                            <input type="hidden" name="mem_id[]" class="db-id" value="<?php echo $items->id; ?>" />
                                            <div class="col-md-4">
                                                <input type="text" class="form-control low-width req" style="min-width: 60px;" value="<?php echo $items->name;?>" disabled />
                                            </div>

                                            <div class="col-md-4">
                                                <input type="text" class="form-control low-width req" style="min-width: 60px;" value="<?php echo $items->star_name . ' / ' . $items->star_tamil_name ;?>" disabled />
                                            </div>
                                            
                                            <div class="col-md-4"> 
                                                <?php if(!empty($items->tamil_name)) { ?>
                                                    <input type="text" class="form-control low-width multi lang-tamil input-tamil" value="<?php echo $items->tamil_name;?>" disabled />
                                                <?php } else { ?>
                                                    <input type="text" class="form-control low-width" value="N/A" disabled />
                                                <?php } ?>
                                            </div>
                                        </div> 
                                    <?php } ?>

                                </div> <!-- blck-content -->
                            </div>

                            <!-- blck -->

                            <div class="col-xs-12 blck">
                                <div class="sub-title err-target" ><h4><i class="fa fa-fire" style="font-size: 14px;"></i> Amount</h4><i class="ctrl opener fa fa-chevron-up opened" style="float: right; margin-top: -25px;"></i></div>
                                <div class="blck-content col-xs-12">
                                    <div class="col-md-6">     
                                        <div class="form-group float-clear">
                                            <label>Amount</label><div class="lbl-value"><?php echo $member->amount; ?></div>
                                        </div>

                                    </div>
                                </div> <!-- blck-content -->    
                            </div> <!-- blck -->

                        </div> <!--  Tab-1 -->

                        <!-- Tab 2 -->
                        <div class="col-xs-12 tab" id="tab-2">
                            <div class="resp-table tab-wrapper">

                                <div style="margin-top: 10px; border-top: 1px dotted #1ba; padding: 20px 0px;">
                                    <div class="row">
                                        <?php
                                            $step = 4; $style = 'padding: 0px 2px;';
                                            foreach( $ptypes as $k => $ptype ) :
                                               
                                                echo '<div class="col-md-'. floor( 12 / $step ) .'">';
                                                ?>
                                                    <div class="form-group float-clear blck-content ptype-box">
                                                        <label style="width: 100%; padding: 5px; margin-bottom: 30px; border-bottom: 1px dotted #1ba;"><?php echo $ptype->name; ?></label>
                                                        <div style="width: 60px; height: 60px; margin-top: 45px; position: absolute; left: 20px;"><img src="<?php echo base_url() . DIR_PAY_TYPE . $ptype->img_url; ?>"></div>
                                                        <div class="lbl-value" style="border-bottom: none; text-align: right;"><?php echo $ptype->pay_amount; ?></div>
                                                    </div>
                                                <?php
                                                echo '</div>';

                                                if( ($k+1) % $step == 0 ) :
                                                    echo '</div><div class="row">';
                                                endif;

                                            endforeach;
                                        ?>
                                    </div>
                                </div>
                                
                                <?php $paid_amount = $this->membership_card_model->total_paid_amount(12,$member->id); ?>
                                <div class="col-xs-12">
                                    <div class="col-md-6" style="<?php echo $style; ?>">                                    
                                        <div class="form-group">
                                            <div style="color: #999; text-align: right;">&nbsp;</div>
                                        </div>
                                    </div>
                                    <div class="col-md-3" style="<?php echo $style; ?>">                                    
                                        <div class="form-group">
                                            <div style="color: #999; text-align: right;">Total Paid Amount :</div>
                                        </div>
                                    </div>    
                                    <div class="col-md-3" style="<?php echo $style; ?>">                                    
                                        <div class="form-group" style="padding-left: 15%;">
                                            <div class="lbl-value"  style="width: 100%; color: #1ba; text-align: right;"><?php echo $paid_amount->paidAmount; ?></div>
                                        </div>
                                    </div>    
                                </div>
                                
                                <!--<div class="col-xs-12">
                                    <div class="col-md-9" style="<?php echo $style; ?>">                                    
                                        <div class="form-group">
                                            <div style="color: #999; text-align: right;"><i class="fa fa-rubee"></i>Recharge Amount(in Archanai) :</div>
                                        </div>
                                    </div>    
                                    <div class="col-md-3" style="<?php echo $style; ?>">                                    
                                        <div class="form-group" style="padding-left: 15%;">
                                            <div class="lbl-value"  style="width: 100%; color: #1ba; text-align: right;"><?php echo (!empty($paid_amount->paidAmount)) ? number_format(($paid_amount->paidAmount - $member->amount),2,'.','') : $member->amount; ?></div>
                                        </div>
                                    </div>    
                                </div>

                                <div class="col-xs-12">
                                    <div class="col-md-9" style="<?php echo $style; ?>">                                    
                                        <div class="form-group">
                                            <div style="color: #999; text-align: right;"><i class="fa fa-rubee"></i>Final Amount :</div>
                                        </div>
                                    </div>    
                                    <div class="col-md-3" style="<?php echo $style; ?>">                                    
                                        <div class="form-group" style="padding-left: 15%;">
                                            <div class="lbl-value"  style="width: 100%; color: #1ba; text-align: right;"><?php echo inr_format($member->amount); ?></div>
                                        </div>
                                    </div>    
                                </div>-->

                            </div> <!-- Tab - wrapper -->
                        </div> <!-- Tab 2 Payment types -->    

                    </div> <!-- box-body -->
                </div> <!-- box-danger -->
                    
                
            </div><!-- /.col-xs-12 -->
        </div><!-- /.row -->
    </section><!-- /.content -->
</aside>


