

<link rel="stylesheet" href="https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.dataTables.min.css">
<script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<div class="body-content">

                        <div class="row">

                            <div class="col-md-12 col-lg-12">

                                <div class="card mb-4">

                                    <div class="card-header">

                                        <div class="d-flex justify-content-between align-items-center">

                                            <div>

                                                <h6 class="fs-17 font-weight-600 mb-0">Client ID #<?php echo $user->id.' '.$user->first_name;?> Report</h6>

                                            </div>

                                            

                                        </div>

                                    </div>

                                    

                                    <div class="card-body">

      

								
                                    <table class="table display table-bordered table-striped table-hover enable-disable" id="example">



        	<thead>



												<tr>



													<th>S.No.</th>



                                                    <th>Date</th>



                                                    <th>Trans.Type</th>



                                                    <th>Limit</th>



                                                    <th>Stoploss</th>



                                                    <th>Target</th>



                                                    <th>Sq.Off</th>



                                                    <th>Amount</th>



                                                    <th>Credit/Debit</th>



                                                    <th>Balance</th>



													<th>Action</th>



												</tr>



											</thead>



			<tbody>



                                            <?php  $i=1;foreach($report as $r){?>



                                            <tr>



                                            	<td><?php echo $i;?></td>



                                            	<td><?php echo $r->tr_date;?></td>



                                            	<td><?php if($r->buysell_id!=""){echo $r->metal.' '.$r->type;}else{echo $r->tr_desc;}?></td>



                                            	<td><?php echo $r->setlimit;?></td>



                                                <td><?php echo $r->stoploss;?></td>



                                                <td><?php echo $r->target;?></td>



                                                <td><?php echo $r->last_live;?></td>



                                                <td><?php echo $r->tr_amt;?></td>



                                                



                                            	<td><?php if($r->tr_type=='Credit'){echo '<label class="badge badge-success">Credit</label>';}else{echo '<label class="badge badge-danger">Debit</label>';}?></td>



                                            	<td><?php echo $r->left_amt;?></td>



                                            	<td><a href="#" class="btn btn-danger btn-xs userdelete" id="<?php echo $r->trid;?>"><i class="fa fa-trash"></i></a></td>



                                            </tr>



                                            <?php $i++;}?>



                                            </tbody>



        </table>

      </div>

                    				</div>

                                </div>

                            

                            </div>

                        </div>

                    </div><!--/.body content-->

                </div><!--/.main content-->

                

            </div><!--/.wrapper-->

        </div>

        <!--Global script(used by all pages)-->

      



		
		<script>
		$(".userdelete").click(function(e){e.preventDefault();



		if (!confirm("Sure you want to delete?")){



				  return false;



				}



			var id=$(this).attr("id");



			$(this).closest("tr").remove();



			$.ajax({



							 type: "POST",



							 url: '<?php echo base_url();?>swadmin/report_delete',



							 data: {id:id},



							 success: function(response){



								 //alert(response);



							 }



							 });



		});
		</script>
        

        <script src="<?php echo base_url();?>adminassets/plugins/metisMenu/metisMenu.min.js"></script>

        <script src="<?php echo base_url();?>adminassets/plugins/perfect-scrollbar/dist/perfect-scrollbar.min.js"></script>

        <!-- Third Party Scripts(used by this page)-->

        <script src="<?php echo base_url();?>adminassets/plugins/sparkline/sparkline.min.js"></script>

        <!--Page Active Scripts(used by this page)-->

        <script src="<?php echo base_url();?>adminassets/dist/js/pages/dashboard.js"></script>

        
        <!--Page Scripts(used by all page)-->

        <script src="<?php echo base_url();?>adminassets/dist/js/sidebar.js"></script>
        <script>
		$(document).ready(function() {
    $('#example').DataTable( {
        dom: 'Bfrtip',
        buttons: [
            'copyHtml5',
            'excelHtml5',
            'csvHtml5',
            'pdfHtml5'
        ]
    } );
} );
		</script>

    </body>

</html>