<!DOCTYPE html>
<html lang="en">
<head>
	<!-- Main navbar -->
	<?php $this->load->view('admin/common_header');?>
	<!-- /main navbar -->

	<!-- select box theme JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/forms/selects/bootstrap_select.min.js"></script>

	<!-- Theme JS files -->
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/tables/datatables/datatables.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/tables/datatables/extensions/responsive.min.js">
	</script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/forms/selects/select2.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/core/app.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/pages/datatables_responsive.js"></script>
	<!-- /theme JS files -->

	<!-- notify JS files -->
    <script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/notifications/jgrowl.min.js"></script>
    <!-- Theme JS files -->

	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/notifications/bootbox.min.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/plugins/notifications/sweet_alert.min.js"></script>
    <!--<script type="text/javascript" src="<?php echo base_url();?>assets/js/pages/components_modals.js"></script>-->
    <style type="text/css">
	    .icons-list a[data-action="reload1"]:after {
		  content: '\e9fb';
		}
		.btns {
			padding: 5px;
		}
	</style>
</head>
<style>
.icons-list > li {
    display: inline-block;
    font-size: 26px;
    }
    .heading-elements .icons-list {
    margin-top: 5px;
}
</style>
<body class="navbar-top-md-md pace-done">
	<!-- Fixed navbars wrapper -->
	<div class="navbar-fixed-top">
		<!-- Main navbar -->
		<?php $this->load->view('admin/mainnav'); ?>
		<!-- /main navbar -->
		<!-- Second navbar -->
		<?php $this->load->view('admin/secondnav'); ?>
		<!-- /second navbar -->
	</div>
	<!-- /fixed navbars wrapper -->

	<!-- Page header -->
	<div class="page-header">
		<div class="page-header-content">
			<!-- <div class="page-title">
				<h4><i id="icon-bck" class="icon-arrow-left52 position-left"></i> <span class="text-semibold"><?php echo $this->lang->line('users_page_title'); ?></h4>

				<ul class="breadcrumb breadcrumb-caret position-right">
					<?php foreach ($breadcrumbs as $breadcrumb) { if(isset($breadcrumb['href'])){?>
					    <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
					<?php } else { ?> <li><?php echo $breadcrumb['text']; ?></li><?php } } ?>
				</ul>
			</div> -->
			<?php
			// echo $module_name;
			 $this->load->view('admin/'.$module_name.'_header'); ?>
		</div>
	</div>
	<!-- /page header -->


	<!-- Page container -->
	<div class="page-container">

		<!-- Page content -->
		<div class="page-content">

			<!-- Main content -->
			<div class="content-wrapper">


				<!-- Basic responsive configuration -->
				<div class="panel panel-flat">
					<div class="panel-heading">
						<h5 class="panel-title"><?php echo $this->lang->line('invest_history');?></h5>
						<div class="heading-elements">
							<ul class="icons-list">
								<li><a href="<?php echo base_url();?>admin/history/trade_history" class="icon-plus-circle2"></a></li>
		                		<li><a data-action="collapse"></a></li>
		                		<li><a data-action="reload1"></a></li>
		                		<li><a data-action="close"></a></li>
		                	</ul>
	                	</div>
					</div>
					<?php $currency_info = defaultcurrency();

					/*echo "<pre>";
					print_r($trade_history);
					echo "<pre>";
					exit();*/

					?>
					<!-- <div class="ajax-refresh">  -->
					<table class="table datatable-responsive-user table-hover">
						<colgroup>
						<col width="5%">
  						<col width="9%">
  						<col width="18%">
  						<col width="18%">
  						<col width="20%">
  						<col width="15%">
  						<col width="15%">
  						</colgroup>

						<thead>
							<tr>
								<th class="" style="display:none;"></th>	
								<th class="" style="display:none;"></th>
								<th class="" style="display:none;"></th>
								<th class="">S.No</th>
								<th class="">Invest Date</th>													
								<th class="">User Name</th>
								<th class="">Coin</th>
								<th class="">Strategy</th>
								<th class="">Account Name</th>
								<th class="">Amount</th>
								<th class="">End Date</th>
								
							</tr>
						</thead>
						<tbody>
						<?php 
						
							if($trade_history) {
								
								

								// $row_count = count($users);
								$this->load->library('MyEncrypt');
									$myencrypt = new MyEncrypt;
									$i=1;
								foreach ($trade_history as $row) {

									$co_id=$row->currency;
									$condition = "coid = '".$co_id."'";  
									$coin_info = $this->common_model->GetRow('coin_info',$condition);

									$uid=$row->usersid;
									$condition = "uusersid = '".$uid."'";  
									$usersid = $this->common_model->GetRow('uusers',$condition);

									$trade_cont="id ='".$row->trade_id."'";
									$trade_id=$this->common_model->GetRow('trader',$trade_cont);
									/*echo "<pre>";	
									print_r($trade_id);
									echo "<pre>";*/
									//exit();

							?>
							<tr>
							<td class="" style="display:none"></td>
							<td class="" style="display:none"></td>
							<td class="" style="display:none"></td>
							<td class=""><?php echo $i;?></td>
							<td class=""><?php echo $row->invest_date;?></td>
							<td class=""><?php echo $usersid->username;?></td>			
							    <td class=""><?php echo $coin_info->coin_name;?></td>
								<td class=""><?php echo ucwords($trade_id->stratgy);?></td>
								<td class=""><?php echo ucwords($trade_id->ac_name);?></td>
								<td class=""><?php echo $row->amount.' '.$coin_info->coin_symbol;?></td>
								<td class=""><?php echo $row->end_date;?></td>							                               
							</tr>
						<?php 
						$i++;
                         }
							}?>


					</table>
					<!-- </div> -->
				</div>
				<!-- /basic responsive configuration -->

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

		</div>
		<!-- /page content -->


		<!-- Footer -->
		<div class="footer text-muted">
			<?php echo site_footer();?>
		</div>
		<!-- /footer -->		
	</div>
	<!-- /page container -->

	<script type="text/javascript">
		
	(function($) {

	    $(document).ready(function() {



			$('#icon-bck').on('click',function() {
				window.history.back();
			});
			    
		});

	})(jQuery);
	

	
	</script>
</body>
</html>
