<?php $profile_id = $this->session->userdata('profile_id'); ?>
<div class="col-sm-8">
    <div class="row ">
        <div class="col-sm-12 ">
            <span class="col-sm-6 text-left">

            </span>
            <span class="col-sm-6 text-right"> 
                <a class="form-group btn btn-success" href="<?php echo base_url('user/payment-method') ?>">Payment Method</a>
                <a class="form-group btn btn-success" href="<?php echo base_url() ?>user/total-earning">Total Earning</a>
            </span>
        </div>
        <div class="col-sm-12">
            <hr><br>
        </div>



        <div class="col-sm-12">
            <br>
        </div>

        <div class="col-sm-12">
            <div class="col-sm-12  text-left  "style="margin-bottom: 5px;font-weight: bold;border-bottom: 2px solid limegreen">
                <div class="col-sm-4">Course Title</div>
                <div class="col-sm-2">Type</div>
                <div class="col-sm-2">Price</div>
                <div class="col-sm-2 text-center">Student</div>
                <div class="col-sm-2 text-center">Earning</div>
            </div>

            <?php
            if (!empty($course_id)) {
                foreach ($earning_info as $value) {
                    ?>
                    <div class="col-sm-12 text-left " style="padding: 10px;background-color:#F2F9EA;border: 1px solid #ededed">
                        <div class="col-sm-4"><a href="<?php echo base_url() . $url[$value->payment_type_id]->url ?>"><?php echo $course_data[$value->payment_type_id]->course_name ?></a></div>
                        <div class="col-sm-2"><?php
                            if ($value->payment_type == 1) {
                                echo 'Course';
                            } else {
                                echo 'Video Course';
                            }
                            ?></div>
                        <div class="col-sm-2"><?php
                            echo $course_price[$value->payment_type_id] . $currency_sign[$value->payment_type_id];
                            ?></div>
                        <div class="col-sm-2 text-center"><a href="<?php echo base_url('user/view-student-invoice/' . $url[$value->payment_type_id]->url); ?>"><?php echo $total_student[$value->payment_type_id] ?></a></div>
                        <div class="col-sm-2 text-center">
                            <a href="<?php echo base_url('user/view-course-earning/' . $url[$value->payment_type_id]->url); ?>">
                                <i class="fa fa-money" title="Invoice"></i>
                            </a>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group"></div>
                    <?php
                }
            } else { ?>
               <p>Create course to start earning! <a href="<?php echo base_url().'user/add-course'?>" target="_blank">Create Course</a></p>
            <?php            
            }
            ?>
        </div>
    </div>
</div>