<!DOCTYPE html>
<html lang="en">
<head>
	<!-- Main navbar -->
		<?php 
		$this->session = session();
		helper('inflector');
		$this->finance_model = model('finance_model');

		echo view('admin/common_header'); ?>
	<!-- /main navbar -->

    <!-- 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>


	<!-- Theme JS files -->
	<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/plugins/forms/styling/uniform.min.js');?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/plugins/ui/moment/moment.min.js');?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/plugins/ui/fullcalendar/fullcalendar.min.js');?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/plugins/visualization/echarts/echarts.js');?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/plugins/visualization/echarts/chart/bar.js');?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/plugins/visualization/echarts/chart/line.js');?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/plugins/visualization/echarts/theme/limitless.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 -->

	<!-- bootsrap switch checkbox JS files -->
    <script src="<?php echo base_url('assets/boots/js/bootstrap-switch.js');?>"></script>
    <link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/boots/css/select2.css');?>">

    <!-- 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>


</head>

<body class="navbar-top-md-md pace-done">

	<!-- Fixed navbars wrapper -->
	<div class="navbar-fixed-top">

		<!-- Main navbar -->
		<?php echo view('admin/mainnav'); ?>
		<!-- /main navbar -->


		<!-- Second navbar -->
		<?php echo view('admin/secondnav'); ?>
		<!-- /second navbar -->

	</div>

	<!-- /fixed navbars wrapper -->
	<?php $currency_info = defaultcurrency();?>
	<?php 
	use App\Libraries\MyEncrypt;
		// $this->load->library('MyEncrypt');
		$myencrypt = new MyEncrypt; 
	?>

	<!-- Page header -->


	<!-- 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 lang('language_lang.users_page_title'); ?></h4>

				<ul class="breadcrumb breadcrumb-caret position-right">
					<?php foreach ($breadcrumbs as $breadcrumb) { ?>

					    <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
					<?php } ?>
				</ul>
			</div>
			<?php echo 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">

				<!-- Toolbar -->
				<div class="navbar navbar-default navbar-component navbar-xs">
					<ul class="nav navbar-nav visible-xs-block">
						<li class="full-width text-center"><a data-toggle="collapse" data-target="#navbar-filter"><i class="icon-menu7"></i></a></li>
					</ul>

					<div class="navbar-collapse collapse" id="navbar-filter">
						<ul class="nav navbar-nav element-active-slate-400">
							<li class="active"><a href="#schedule" data-toggle="tab"><i class="icon-calendar3 position-left"></i> <?php echo lang('language_lang.admin_user_acti_lbl'); ?> </a></li> <!-- <li><a href="#schedule" data-toggle="tab"><i class="icon-calendar3 position-left"></i> Schedule <span class="badge badge-success badge-inline position-right">32</span></a></li> -->
							<li><a href="#settings" data-toggle="tab"><i class="icon-cog3 position-left"></i> <?php echo lang('language_lang.text_settings'); ?></a></li>
						</ul>

						<div class="navbar-right">
							<ul class="nav navbar-nav">
							</ul>
						</div>
					</div>
				</div>
				<!-- /toolbar -->


				<!-- User profile -->
				<div class="row">
					<div class="col-lg-9">
						<div class="tabbable">
							<div class="tab-content">
								

								<?php 

								if($mon_earnings->earnamt!='')
								{
								  $mon_ern = round($mon_earnings->earnamt); 
								}
								else{
									$mon_ern = '0';
								}

								if($tues_earnings->earnamt!='')
								{
								$tues_ern =  round($tues_earnings->earnamt); 
								}
								else{
									$tues_ern = '0';
								}
								if($wed_earnings->earnamt!='')
								{
								 $wed_ern = round($wed_earnings->earnamt); 
								}
								else{
									$wed_ern = '0';
								}
								if($thur_earnings->earnamt!='')
								{
								 $thur_ern = round($thur_earnings->earnamt); 
								}
								else{
									$thur_ern = '0';
								}
								if($fri_earnings->earnamt!='')
								{
								 $fri_ern = round($fri_earnings->earnamt); 
								}
								else{
									$fri_ern = '0';
								}
								if($sat_earnings->earnamt!='')
								{
								 $sat_ern = round($sat_earnings->earnamt); 
								}
								else{
									$sat_ern = '0';
								}
								if($sun_earnings->earnamt!='')
								{
								 $sun_ern = round($sun_earnings->earnamt); 
								}
								else{
									$sun_ern = '0';
								}


								if($mon_expenses->earnamt!='')
								{
								  $mon_exp = round($mon_expenses->earnamt); 
								}
								else{
									$mon_exp = '0';
								}

								if($tues_expenses->earnamt!='')
								{
								$tues_exp =  round($tues_expenses->earnamt); 
								}
								else{
									$tues_exp = '0';
								}
								if($wed_expenses->earnamt!='')
								{
								 $wed_exp = round($wed_expenses->earnamt); 
								}
								else{
									$wed_exp = '0';
								}
								if($thur_expenses->earnamt!='')
								{
								 $thur_exp = round($thur_expenses->earnamt); 
								}
								else{
									$thur_exp = '0';
								}
								if($fri_expenses->earnamt!='')
								{
								 $fri_exp = round($fri_expenses->earnamt); 
								}
								else{
									$fri_exp = '0';
								}
								if($sat_expenses->earnamt!='')
								{
								 $sat_exp = round($sat_expenses->earnamt); 
								}
								else{
									$sat_exp = '0';
								}
								if($sun_expenses->earnamt!='')
								{
								 $sun_exp = round($sun_expenses->earnamt); 
								}
								else{
									$sun_exp = '0';
								}

								// $myencrypt = new MyEncrypt;
								$user_id = $myencrypt->encode($user->uusersid);



								?>
								<div class="tab-pane fade in active" id="schedule">

									<!-- Available hours -->
									<div class="panel panel-flat">
										<div class="panel-heading">
											<h6 class="panel-title"><?php echo lang('language_lang.admin_user_dailystats'); ?></h6>
											<div class="heading-elements">
												<ul class="icons-list">
							                		<li><a data-action="collapse"></a></li>
							                		<li><a data-action="reload"></a></li>
							                		<li><a data-action="close"></a></li>
							                	</ul>
						                	</div>
										</div>

										<div class="panel-body">
											<div class="chart-container" >
												<div class="chart has-fixed-height" id="plans"></div>
											</div>
										</div>
									</div>

	                               	<div class="row">
										
	                                    <?php if($all_lasttransaction) { ?>
	                                    <h3 style="margin-left:8px;">Transactions</h3>
	                                    <?php
	                                      	$i=1; foreach ($all_lasttransaction as $row) {
	                                       	$condition = "payment_key in('status') AND payment_id = '".$row->payment_id."'";
										   	$payment = $this->finance_model->PaymentName($condition);
	                                    ?>
	                                      
										<div class="col-lg-6">
											<?php if($i % 2 == 0) { ?>
												<div class="panel border-left-lg border-left-success invoice-grid timeline-content">
											<?php } else { ?>
												<div class="panel border-left-lg border-left-danger invoice-grid timeline-content">
											<?php } ?>
													<div class="panel-body">
														<div class="row">
															<div class="col-sm-6">
																<h6 class="text-semibold no-margin-top"><?php echo lang('language_lang.lbl_amount'). ' (<b>'.strtoupper($currency_info->currency_unit).'</b>)';?></h6>
																<ul class="list list-unstyled">
																	<li><?php echo lang('language_lang.lbl_date');?>: <span class="text-semibold"><?php echo date('Y-m-d H:i:s', strtotime($row->date));?></span></li>
																</ul>
															</div>

															<div class="col-sm-6">
																<h6 class="text-semibold text-right no-margin-top"><?php echo $currency_info->currency_symbol."".number_format($row->amount, $currency_info->deimal_point, '.', '').' '.strtoupper($currency_info->currency_unit);?></h6>
																<ul class="list list-unstyled text-right">
																	<li><?php echo lang('language_lang.lbl_payment_gateway');?>: <span class="text-semibold"><?php echo (isset($payment->payment_name)) ? ucfirst($payment->payment_name) : '----';?></span></li>
																	<li class="dropdown">
																		<?php echo lang('language_lang.lbl_type');?>: &nbsp;
																		<?php if($i % 2 == 0) { ?>
																		<a style="cursor: default;" class="label bg-success-400 dropdown-toggle" data-toggle="dropdown"><?php echo humanize($row->type);?></a>
																		<?php } else {?>
																		<a style="cursor: default;" class="label bg-danger-400 dropdown-toggle" data-toggle="dropdown"><?php echo humanize($row->type);?></a>
																		<?php } ?>
																	</li>
																</ul>
															</div>
														</div>
													</div>

													<div class="panel-footer">
														<ul>
														<?php if($i % 2 == 0) { ?>
															<li><span class="status-mark border-success position-left"></span> <?php echo lang('language_lang.lbl_transaction_id');?>: <span class="text-semibold"><?php echo $row->transactionid;?></span></li>
														<?php } else {?>
														<li><span class="status-mark border-danger position-left"></span> <?php echo lang('language_lang.lbl_transaction_id');?>: <span class="text-semibold"><?php echo $row->transactionid;?></span></li>
														<?php } ?>
														</ul>

														<ul class="pull-right">
															<li><a href="#alltrans" data-toggle="tab" ><i class="icon-eye8"></i></a></li>
															
														</ul>
													</div>
													</div>
												</div>
											<?php $i++; } }?>
	                                	</div>
									
	                               

										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.admin_user_log'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<ul class="media-list chat-list content-group">
													<li class="media date-step">
														<span><?php echo lang('language_lang.admin_user_today'); ?></span>
													</li>
	                                               <?php if($lastaccess) { 
	                                               	$i = 1;
	                                                           foreach ($lastaccess as $row) {

	                                                           	if($i % 2 != 0) {
	                                               	?>


													<li class="media reversed">
														<div class="media-body">
															<div class="media-content"><?php echo $row->uusers_ip; ?></div>
															<span class="media-annotation display-block mt-10"><?php echo $row->lastaccess; ?> <i class="icon-pin-alt position-right text-muted"></i></span>
														</div>

														<div class="media-right">
															<a href="<?php echo base_url();?>styles/img/usr.png">
																<img src="<?php echo base_url();?>styles/img/usr.png" class="img-circle" alt="">
															</a>
														</div>
													</li>

													<?php } else { ?>

													<li class="media">
													<div class="media-left">
															<a href="<?php echo base_url();?>styles/img/usr.png">
																<img src="<?php echo base_url();?>styles/img/usr.png" class="img-circle" alt="">
															</a>
														</div>
														<div class="media-body">
															<div class="media-content"><?php echo $row->uusers_ip; ?></div>
															<span class="media-annotation display-block mt-10"><?php echo $row->lastaccess; ?> <i class="icon-pin-alt position-right text-muted"></i></span>
														</div>
													</li>
													<?php } $i++; } } ?>

													
												</ul>
						                    	
											</div>
										</div>								

									</div>


									<div class="tab-pane fade" id="settings">

										<!-- Profile info -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.admin_profile_title'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<form action="#">
													<div class="form-group">
														<div class="row">
															<div class="col-md-6">
																<label><?php echo lang('language_lang.place_username'); ?></label>
																<input type="text" value="<?php echo $user->username; ?>" class="form-control" readonly="readonly">
															</div>
															<div class="col-md-6">
																<label><?php echo lang('language_lang.lbl_user_fullname'); ?></label>
																<input type="text" value="<?php echo $user->fullname; ?>" class="form-control" readonly="readonly">
															</div>
														</div>
													</div>

													<div class="form-group">
														<div class="row">
															<div class="col-md-6">
																<label><?php echo lang('language_lang.lbl_user_email'); ?></label>
																<input type="text" value="<?php echo $user->email; ?>" class="form-control" readonly="readonly">
															</div>
															<div class="col-md-6">
																<label><?php echo lang('language_lang.lbl_user_address'); ?></label>
																<input type="text" value="<?php echo $user->address; ?>" class="form-control" readonly="readonly">
															</div>
														</div>
													</div>

													<div class="form-group">
														<div class="row">
															<div class="col-md-4">
																<label><?php echo lang('language_lang.lbl_user_city'); ?></label>
																<input type="text" value="<?php echo $user->city; ?>" class="form-control" readonly="readonly">
															</div>
															<div class="col-md-4">
																<label><?php echo lang('language_lang.lbl_user_state'); ?></label>
																<input type="text" value="<?php echo $user->state; ?>" class="form-control" readonly="readonly">
															</div>
															<div class="col-md-4">
																<label><?php echo lang('language_lang.lbl_user_zip'); ?></label>
																<input type="text" value="<?php echo $user->zip; ?>" class="form-control" readonly="readonly">
															</div>
														</div>
													</div>

													<div class="form-group">
														<div class="row">
															<div class="col-md-6">
																<label><?php echo lang('language_lang.lbl_user_phone'); ?></label>
																<input type="text" readonly="readonly" value="<?php echo $user->phone; ?>" class="form-control">
															</div>
															<div class="col-md-6">
									                            <label><?php echo lang('language_lang.lbl_user_country'); ?></label>

									                            <select id="simg" class="select form-control">
									                                <option value="<?php if($countries) { echo $countries->iso_2;} ?>" selected="selected"><?php if($countries) { echo $countries->Country; } ?></option>
									                            </select>
															</div>
														</div>
													</div>

														<div class="row">
															<?php
															foreach ($payment_list as $pay_field) { ?>
																<div class="col-md-6">
																	<div class="form-group">
																		<label><?php echo lang('language_lang.lbl_'.$pay_field->payment_name);?> : </label>
										                                <input type="text" name="gateway[]" 
										                                value="<?php if(isset($payment_data[$pay_field->payment_id])) { echo $payment_data[$pay_field->payment_id];} else { echo ""; } ?>" placeholder="" class="form-control" readonly>
									                                </div>
									                            </div>

								                            <?php } ?>
														</div>
												</form>
											</div>
										</div>
										<!-- /profile info -->
                                    </div>

                                    <div class="tab-pane fade" id="acc_settings">

										<!-- Account settings -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.admin_account_sett_title'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<form action="#">
													<div class="form-group">
														<div class="row">
															<div class="col-md-6">
																<label><?php echo lang('language_lang.lbl_security_question');?></label>
																<input type="text" value="<?php echo $user->security_question; ?>" readonly="readonly" class="form-control">
															</div>

															<div class="col-md-6">
																<label><?php echo lang('language_lang.lbl_security_answer');?></label>
																<input type="text" value="<?php echo $user->security_answer; ?>" readonly="readonly" class="form-control">
															</div>
														</div>
													</div>
					                               <?php if(isset($user->changeip)) {
														$changeip = $user->changeip;
													} else {
														$changeip = '';
													}
													?>
													<div class="form-group">
														<div class="row">
															<div class="col-md-6">
																<label><?php echo lang('language_lang.lbl_change_ip');?></label>

																<div class="radio">
																	<label>
																		<input type="radio" name="visibility" class="styled" <?php if($changeip=='disabled') { echo 'checked';} else { echo 'disabled'; } ?>>
																		<?php echo lang('language_lang.lbl_disabled');?>
																	</label>
																</div>

																<div class="radio">
																	<label>
																		<input type="radio" name="visibility" class="styled" <?php if($changeip=='medium') { echo 'checked'; } else { echo 'disabled'; } ?>>
																		<?php echo lang('language_lang.lbl_medium');?>
																	</label>
																</div>

																<div class="radio">
																	<label>
																		<input type="radio" name="visibility" class="styled" <?php if($changeip=='high') { echo 'checked'; } else { echo 'disabled'; }?>>
																		<?php echo lang('language_lang.lbl_heigh');?>
																	</label>
																</div>

																<div class="radio">
																	<label>
																		<input type="radio" name="visibility" class="styled" <?php if($changeip=='paranoic'){ echo 'checked'; } else { echo 'disabled'; }?> >
																		<?php echo lang('language_lang.lbl_paranoic');?>
																	</label>
																</div>
															</div>

															<div class="col-md-6">
																<label><?php echo lang('language_lang.lbl_changebrowser'); ?></label>
                                                              	<?php 
																	if(isset($user->status)){
																		$browser_status = $user->change_browser;
																	} else {
																		$browser_status = '';
																	}
																?>
																<div class="checkbox checkbox-switch">
																	<label>
																		<input type="checkbox" <?php if($browser_status=='enabled') { echo "checked"; } ?> name="changebrowser" data-on-color="success" data-off-color="danger" data-on-text="<?php echo lang('language_lang.On'); ?>" data-off-text="<?php echo lang('language_lang.Off'); ?>" class="switchery" readonly>
																	</label>
																</div>
															</div>
														</div>
													</div>

							                        
						                        </form>
											</div>
										</div>
										<!-- /account settings -->
									</div>


									<div class="tab-pane fade" id="sendbonus">

										<!-- Account settings -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.menu_sendbonus'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<form action="<?php echo base_url();?>admin/users/bonus" id="frm_sendbonus" method="post">

													<div class="form-group">
														<div class="row form-group">
															<div class="col-md-12">
																<label class="col-md-6"><?php echo lang('language_lang.bonus_amount');?></label>
																
																<div class="input-group col-md-6">
															    	<span class="input-group-addon" style="font-size: 18px;"><strong><?php echo $currency_info->currency_symbol;?></strong></span>										
							                                    	<input type="text" id="amount" name="amount" class="form-control"  placeholder="<?php echo lang('language_lang.plac_amount'); ?>" value="" pattern="[0-9]+([,\.][0-9]+)?" required>
														        	<span class="input-group-addon"><?php echo strtoupper($currency_info->currency_unit);?></span>
														        </div>
															</div>
														</div>

														<div class="row form-group">
															<div class="col-md-12">
																<label class="col-md-6"><?php echo lang('language_lang.bonus_description');?></label>
																<div class="input-group col-md-6">
							                                    	<input type="text" id="description" name="description" class="form-control"  placeholder="<?php echo lang('language_lang.plac_memo_value'); ?>" value="" pattern="[a-zA-Z][a-zA-Z ]{4,}" required>
														        </div>
															</div>
														</div>
														<input type="hidden" name="id" value="<?php echo $user_id;?>"/>

														<div class="row form-group">
															<div class="col-md-12">
																<div class="input-group input-group col-md-12 text-right">
							                                    	<button type="submit" class="btn btn-primary">Send <i class="icon-arrow-right14 position-right"></i></button>
														        </div>
															</div>
														</div>
														
													</div>
							                        
						                        </form>
											</div>
										</div>
										<!-- /account settings -->
									</div>

									<div class="tab-pane fade" id="sendpenality">

										<!-- Account settings -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.menu_sendpenality'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<form action="<?php echo base_url();?>admin/users/penalty" id="frm_sendpenalty" method="post">

													<div class="form-group">
														<div class="row form-group">
															<div class="col-md-12">
																<label class="col-md-6"><?php echo lang('language_lang.bonus_amount');?></label>
																
																<div class="input-group col-md-6">
															    	<span class="input-group-addon" style="font-size: 18px;"><strong><?php echo $currency_info->currency_symbol;?></strong></span>										
							                                    	<input type="text" id="amount" name="amount" class="form-control"  placeholder="<?php echo lang('language_lang.plac_penalty_amount'); ?>" value="" pattern="[0-9]+([,\.][0-9]+)?" required>
														        	<span class="input-group-addon"><?php echo strtoupper($currency_info->currency_unit);?></span>
														        </div>
															</div>
														</div>

														<div class="row form-group">
															<div class="col-md-12">
																<label class="col-md-6"><?php echo lang('language_lang.bonus_description');?></label>
																<div class="input-group col-md-6">
							                                    	<input type="text" id="description" name="description" class="form-control"  placeholder="<?php echo lang('language_lang.plac_penalty_memo_value'); ?>" value="" pattern="[a-zA-Z][a-zA-Z ]{4,}" required>
														        </div>
															</div>
														</div>
														<input type="hidden" name="id" value="<?php echo $user_id;?>"/>

														<div class="row form-group">
															<div class="col-md-12">
																<div class="input-group input-group col-md-12 text-right">
							                                    	<button type="submit" class="btn btn-primary">Send <i class="icon-arrow-right14 position-right"></i></button>
														        </div>
															</div>
														</div>
														
													</div>
							                        
						                        </form>
												
											</div>
										</div>
										<!-- /account settings -->
									</div>
								

	                                <div class="tab-pane fade" id="acc_info">

										<!-- Available hours -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.account_info_menu'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<div class="form-group">
												<div class="row">
													<div class="col-md-6">
													<label class="label border-left-primary label-striped"><?php echo lang('language_lang.account_since'); ?>: </label>
													<label style="margin-left:180px;" class="badge badge-primary"><?php echo $user->createdate; ?></label>
												</div>
												<div class="col-md-6">
												<label class="label border-left-warning label-striped"><?php echo lang('language_lang.account_tot_earnings'); ?>: </label>
													    <label style="margin-left:180px;" class="badge badge-warning"><?php echo $currency_info->currency_symbol.''.number_format($tot_earn,$currency_info->deimal_point, '.', '');?></label>
												    </div>
												</div>
												</div>
												<div class="form-group">
												<div class="row">
													<div class="col-md-6">
													<label class="label border-left-primary label-striped"><?php echo lang('language_lang.account_tot_deposit'); ?>: </label>
													    <label style="margin-left:148px;" class="badge badge-primary"><?php echo $currency_info->currency_symbol.''.number_format($total_deposit,$currency_info->deimal_point, '.', '');?></label>
												    </div>
												    <div class="col-md-6">
												    <label class="label border-left-warning label-striped"><?php echo lang('language_lang.account_tot_interet'); ?>: </label>
													    <label style="margin-left:138px;"  class="badge badge-warning"><?php echo $currency_info->currency_symbol.''.number_format($tot_interest,$currency_info->deimal_point, '.', '');?></label>
											       </div>
											    </div>
											    </div>
												<div class="form-group">
												<div class="row">
													<div class="col-md-6">
													<label class="label border-left-primary label-striped"><?php echo lang('language_lang.account_withdrawn'); ?>: </label>
													    <label style="margin-left:160px;" class="badge badge-primary"><?php echo $currency_info->currency_symbol.''.number_format($total_payouts,$currency_info->deimal_point, '.', '');?></label>
												    </div>
		                                            <div class="col-md-6">
													<label class="label border-left-warning label-striped"><?php echo lang('language_lang.account_pen_withdrawal'); ?>: </label>
													    <label style="margin-left:145px;" class="badge badge-warning"><?php echo $currency_info->currency_symbol.''.number_format($total_pending_payouts,$currency_info->deimal_point, '.', '');?></label>
												    </div>
												    </div>
												    </div>
												<div class="form-group">
												<div class="row">
												<div class="col-md-6">
													<label class="label border-left-primary label-striped"><?php echo lang('language_lang.account_pen_withdrawal'); ?>: </label>
													    <label style="margin-left:135px;" class="badge badge-primary"><?php echo $currency_info->currency_symbol.''.number_format($total_pending_payouts,$currency_info->deimal_point, '.', '');?></label>
												</div>
												<div class="col-md-6">
												     <label class="label border-left-warning label-striped"><?php echo lang('language_lang.account_fund_Send'); ?>: </label>
											         <label style="margin-left:175px;" class="badge badge-warning"><?php echo $currency_info->currency_symbol.''.number_format($total_fund_send,$currency_info->deimal_point, '.', '');?></label>
												</div>
												</div>
												</div>
												<div class="form-group">
												<div class="row">
												<div class="col-md-6">
													<label class="label border-left-primary label-striped"><?php echo lang('language_lang.account_fund_received'); ?>: </label>
													    <label style="margin-left:142px;" class="badge badge-primary"><?php echo $currency_info->currency_symbol.''.number_format($total_fund_received,$currency_info->deimal_point, '.', '');?></label>
												</div>
												<div class="col-md-6">
												<label class="label border-left-warning label-striped"><?php echo lang('language_lang.account_tot_bonus'); ?>: </label>
													    <label style="margin-left:198px;" class="badge badge-warning"><?php echo $currency_info->currency_symbol.''.number_format($total_bonus,$currency_info->deimal_point, '.', '');?></label>
											    </div>
											    </div>
											    </div>
												<div class="form-group">
												<div class="row">
												<div class="col-md-6">
													<label class="label border-left-primary label-striped"><?php echo lang('language_lang.account_tot_penaly'); ?>: </label>
													    <label style="margin-left:185px;" class="badge badge-primary"><?php echo $currency_info->currency_symbol.''.number_format($total_penalty,$currency_info->deimal_point, '.', '');?></label>
												</div>
												<div class="col-md-6">
												<label class="label border-left-warning label-striped"><?php echo lang('language_lang.account_no_ref_withdrawal'); ?>: </label>
													    <label style="margin-left:148px;" class="badge badge-warning"><?php echo $total_sponser;?></label>
												</div>
												</div>
												</div>
												<div class="form-group">
												<div class="row">
												<div class="col-md-6">
													<label class="label border-left-primary label-striped"><?php echo lang('language_lang.account_tot_com_withdrawal'); ?>: </label>
													    <label style="margin-left:55px;" class="badge badge-primary"><?php echo $currency_info->currency_symbol.''.number_format($total_ref_comm,$currency_info->deimal_point, '.', '');?></label>
												</div>
												<div class="col-md-6">
												<label class="label border-left-warning label-striped"><?php echo lang('language_lang.account_bal_withdrawal'); ?>: </label>
													    <label style="margin-left:165px;" class="badge badge-warning"><?php echo $currency_info->currency_symbol.''.number_format($balance,$currency_info->deimal_point, '.', '');?></label>
												</div>
												</div>
												</div>
											
												
											</div>

	                                        

										</div>
										<!-- /available hours -->
									</div>


									<div class="tab-pane fade" id="depositrequest">

										<!-- Available hours -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.lbl_deposit_history'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<table class="table datatable-responsive table-hover">
													<col width="20%">
							  						<col width="17%">
							  						<col width="15%">
							  						<col width="13%">
							  						<col width="18%">
							  						<col width="9%">
							  						<col width="8%">
													<thead>
														<tr>
															<th class=""><?php echo lang('language_lang.lbl_trans_date');?></th>
															<th class=""><?php echo lang('language_lang.lbl_transaction_id');?></th>
															<th class=""><?php echo lang('language_lang.lbl_description');?></th>
															<th class=""><?php echo lang('language_lang.lbl_type');?></th>
															<th class=""><?php echo lang('language_lang.lbl_amount');?></th>
															<th class=""><?php echo lang('language_lang.lbl_payment_gateway');?></th>
															<th class=""><?php echo lang('language_lang.lbl_options');?></th>
														</tr>
													</thead>
													<tbody>
													<?php 
														if($request_deposit) {
															
															$row_count = count($request_deposit);
															
															foreach ($request_deposit as $row) {

																$condition = "payment_key in('status') AND payment_id = '".$row->payment_id."'";
																$payment = $this->finance_model->PaymentName($condition);
																
														?>
														<tr>
															<td class=""><?php echo date('Y-m-d H:i:s', strtotime($row->date));?></td>
															<td class=""><?php echo $row->transactionid;?></td>
															<td class=""><?php echo ucfirst($row->description);?></td>
															<!-- <td class=""><?php echo ucwords(str_replace('_', ' ', $row->type));?></td> -->
															<td class=""><?php echo humanize($row->type);?></td>

															<td class=""><?php echo $currency_info->currency_symbol."".number_format($row->amount, $currency_info->deimal_point, '.', '').' '.strtoupper($currency_info->currency_unit);?></td>
															<td class=""><?php echo (isset($payment->payment_name)) ? ucfirst($payment->payment_name) : '----';?></td>
															<td class="text-center">
							                                	<a class="btns" data-popup="tooltip" title="<?php echo lang('language_lang.lbl_approve_withdraw');?>"  href="javascript:void(0)" onClick="approvedeposit('<?php echo $myencrypt->encode($row->historyid);?>')" ><i class="fa fa-thumbs-up"></i></a>
							                                	<a class="btns" data-popup="tooltip" title="<?php echo lang('language_lang.lbl_cancel_withdraw');?>"  href="javascript:void(0)" onClick="cancelreqdeposit('<?php echo $myencrypt->encode($row->historyid);?>')" ><i class="fa fa-thumbs-down"></i></a>
							                                </td>
														</tr>
													<?php 

															}
														}  else { 

													?>
														<?php } ?>
													</tbody>
												</table>
											</div>
										</div>
									</div>

									<div class="tab-pane fade" id="canceldeposit">

										<!-- Available hours -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.lbl_cancel_deposit_history'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<table class="table datatable-responsive table-hover">
													<col width="20%">
							  						<col width="17%">
							  						<col width="15%">
							  						<col width="13%">
							  						<col width="18%">
							  						<col width="9%">
							  						
													<thead>
														<tr>
															
															<th class=""><?php echo lang('language_lang.lbl_trans_date');?></th>
															<th class=""><?php echo lang('language_lang.lbl_transaction_id');?></th>
															<th class=""><?php echo lang('language_lang.lbl_description');?></th>
															<th class=""><?php echo lang('language_lang.lbl_type');?></th>
															<th class=""><?php echo lang('language_lang.lbl_amount');?></th>
															<th class=""><?php echo lang('language_lang.lbl_payment_gateway');?></th>
															
														</tr>
													</thead>
													<tbody>
													<?php 
														if($cancel_deposit) {
															
															$row_count = count($cancel_deposit);
															
															foreach ($cancel_deposit as $row) {

																$condition = "payment_key in('status') AND payment_id = '".$row->payment_id."'";
																$payment = $this->finance_model->PaymentName($condition);
																
														?>
														<tr>
														   	
															<td class=""><?php echo date('Y-m-d H:i:s', strtotime($row->date));?></td>
															<td class=""><?php echo $row->transactionid;?></td>
															<td class=""><?php echo ucfirst($row->description);?></td>
															<!-- <td class=""><?php echo ucwords(str_replace('_', ' ', $row->type));?></td> -->
															<td class=""><?php echo humanize($row->type);?></td>

															<td class=""><?php echo $currency_info->currency_symbol."".number_format($row->amount, $currency_info->deimal_point, '.', '').' '.strtoupper($currency_info->currency_unit);?></td>
															<td class=""><?php echo (isset($payment->payment_name)) ? ucfirst($payment->payment_name) : '----';?></td>
															
															
														</tr>
													<?php 

															}
														}  else { 

													?>
														<?php } ?>
													</tbody>
												</table>
											</div>
										</div>
									</div>

									<div class="tab-pane fade" id="maturedeposit">

										<!-- Available hours -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.lbl_deposit_history'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<table class="table datatable-responsive table-hover">
													<col width="20%">
							  						<col width="17%">
							  						<col width="15%">
							  						<col width="13%">
							  						<col width="18%">
							  						<col width="9%">
													<thead>
														<tr>
														
															<th class=""><?php echo lang('language_lang.lbl_trans_date');?></th>
															<th class=""><?php echo lang('language_lang.lbl_transaction_id');?></th>
															<th class=""><?php echo lang('language_lang.lbl_description');?></th>
															<th class=""><?php echo lang('language_lang.lbl_type');?></th>
															<th class=""><?php echo lang('language_lang.lbl_amount');?></th>
															<th class=""><?php echo lang('language_lang.lbl_payment_gateway');?></th>
															
														</tr>
													</thead>
													<tbody>
													<?php 
														if($mature_deposit) {
															
															$row_count = count($mature_deposit);
															
															foreach ($mature_deposit as $row) {

																$condition = "payment_key in('status') AND payment_id = '".$row->payment_id."'";
																$payment = $this->finance_model->PaymentName($condition);
																
														?>
														<tr>
														   
														   
															<td class=""><?php echo date('Y-m-d H:i:s', strtotime($row->date));?></td>
															<td class=""><?php echo $row->transactionid;?></td>
															<td class=""><?php echo ucfirst($row->description);?></td>
															<!-- <td class=""><?php echo ucwords(str_replace('_', ' ', $row->type));?></td> -->
															<td class=""><?php echo humanize($row->type);?></td>

															<td class=""><?php echo $currency_info->currency_symbol."".number_format($row->amount, $currency_info->deimal_point, '.', '').' '.strtoupper($currency_info->currency_unit);?></td>
															<td class=""><?php echo (isset($payment->payment_name)) ? ucfirst($payment->payment_name) : '----';?></td>
															
															
														</tr>
													<?php 

															}
														}  else { 

													?>
														<?php } ?>
													</tbody>
												</table>
											</div>
										</div>
									</div>

									<div class="tab-pane fade" id="deposit">

										<!-- Available hours -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.lbl_deposit_history'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<table class="table datatable-responsive table-hover">
													<col width="20%">
							  						<col width="17%">
							  						<col width="15%">
							  						<col width="13%">
							  						<col width="18%">
							  						<col width="9%">
							  						<col width="8%">
													<thead>
														<tr>
														
															<th class=""><?php echo lang('language_lang.lbl_trans_date');?></th>
															<th class=""><?php echo lang('language_lang.lbl_transaction_id');?></th>
															<th class=""><?php echo lang('language_lang.lbl_description');?></th>
															<th class=""><?php echo lang('language_lang.lbl_type');?></th>
															<th class=""><?php echo lang('language_lang.lbl_amount');?></th>
															<th class=""><?php echo lang('language_lang.lbl_payment_gateway');?></th>
															<th class=""><?php echo lang('language_lang.lbl_options');?></th>
															
														</tr>
													</thead>
													<tbody>
													<?php 
														if($deposit) {
															
															$row_count = count($deposit);
															
															foreach ($deposit as $row) {

																$condition = "payment_key in('status') AND payment_id = '".$row->payment_id."'";
																$payment = $this->finance_model->PaymentName($condition);
																
														?>
														<tr>
															<td class=""><?php echo date('Y-m-d H:i:s', strtotime($row->date));?></td>
															<td class=""><?php echo $row->transactionid;?></td>
															<td class=""><?php echo ucfirst($row->description);?></td>
															<!-- <td class=""><?php echo ucwords(str_replace('_', ' ', $row->type));?></td> -->
															<td class=""><?php echo humanize($row->type);?></td>

															<td class=""><?php echo $currency_info->currency_symbol."".number_format($row->amount, $currency_info->deimal_point, '.', '').' '.strtoupper($currency_info->currency_unit);?></td>
															<td class=""><?php echo (isset($payment->payment_name)) ? ucfirst($payment->payment_name) : '----';?></td>
															<td><button type="button" class="btn btn-danger" onclick="closedeposit('<?php echo $myencrypt->encode($row->historyid);?>')" data-popup="tooltip" title="<?php echo lang('language_lang.lbl_cancel_deposit');?>"><i class="fa fa-thumbs-down"></i></button></td>
														</tr>
													<?php 

															}
														}  else { 

													?>
														<?php } ?>
													</tbody>
												</table>
											</div>
										</div>
									</div>

						
									<div class="tab-pane fade" id="alltrans">

										<!-- Available hours -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.transaction_page_title'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<table class="table datatable-responsive table-hover">
													<col width="20%">
							  						<col width="17%">
							  						<col width="23%">
							  						<col width="13%">
							  						<col width="18%">
							  						<col width="9%">
													<thead>
														<tr>
															<th class=""><?php echo lang('language_lang.lbl_trans_date');?></th>
															<th class=""><?php echo lang('language_lang.lbl_transaction_id');?></th>
															<th class=""><?php echo lang('language_lang.lbl_description');?></th>
															<th class=""><?php echo lang('language_lang.lbl_type');?></th>
															<th class=""><?php echo lang('language_lang.lbl_amount');?></th>
															<th class=""><?php echo lang('language_lang.lbl_payment_gateway');?></th>
														</tr>
													</thead>
													<tbody>
													<?php 
														if($all_transaction) {
															
															$row_count = count($all_transaction);
															
															foreach ($all_transaction as $row) {

																$condition = "payment_key in('status') AND payment_id = '".$row->payment_id."'";
																$payment = $this->finance_model->PaymentName($condition);
																
														?>
														<tr>
															<td class=""><?php echo date('Y-m-d H:i:s', strtotime($row->date));?></td>
															<td class=""><?php echo $row->transactionid;?></td>
															<td class=""><?php echo ucfirst($row->description);?></td>
															<td class=""><?php echo humanize($row->type);?></td>
															<td class=""><?php echo $currency_info->currency_symbol."".number_format($row->amount, $currency_info->deimal_point, '.', '').' '.strtoupper($currency_info->currency_unit);?></td>
															<td class=""><?php echo (isset($payment->payment_name)) ? ucfirst($payment->payment_name) : '----';?></td>
															
														</tr>
													<?php 

															}
														}  else { 

													?>
														<?php } ?>
													</tbody>
												</table>

											</div>
										</div>
									</div>


									<div class="tab-pane fade" id="payout">

										<!-- Available hours -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.lbl_payouts_history'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<table class="table datatable-responsive table-hover">
													<col width="20%">
							  						<col width="17%">
							  						<col width="23%">
							  						<col width="13%">
							  						<col width="18%">
							  						<col width="9%">
													<thead>
														<tr>
															<th class=""><?php echo lang('language_lang.lbl_trans_date');?></th>
															<th class=""><?php echo lang('language_lang.lbl_transaction_id');?></th>
															<th class=""><?php echo lang('language_lang.lbl_description');?></th>
															<th class=""><?php echo lang('language_lang.lbl_type');?></th>
															<th class=""><?php echo lang('language_lang.lbl_amount');?></th>
															<th class=""><?php echo lang('language_lang.lbl_payment_gateway');?></th>
														</tr>
													</thead>
													<tbody>
													<?php 
														if($payout) {
															
															$row_count = count($payout);
															
															foreach ($payout as $row) {

																$condition = "payment_key in('status') AND payment_id = '".$row->payment_id."'";
																$payment = $this->finance_model->PaymentName($condition);
																
														?>
														<tr>
														    
															<td class=""><?php echo date('Y-m-d H:i:s', strtotime($row->date));?></td>
															<td class=""><?php echo $row->transactionid;?></td>
															<td class=""><?php echo ucfirst($row->description);?></td>
															<td class=""><?php echo humanize($row->type);?></td>
															<td class=""><?php echo $currency_info->currency_symbol."".number_format($row->amount, $currency_info->deimal_point, '.', '').' '.strtoupper($currency_info->currency_unit);?></td>
															<td class=""><?php echo (isset($payment->payment_name)) ? ucfirst($payment->payment_name) : '----';?></td>
															
														</tr>
													<?php 

															}
														}  else { 

													?>
														<?php } ?>
													</tbody>
												</table>

											</div>
										</div>
									</div>

									<div class="tab-pane fade" id="pendingpayout">

										<!-- Available hours -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.lbl_payouts_history'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<table class="table datatable-responsive table-hover">
													<col width="20%">
							  						<col width="17%">
							  						<col width="23%">
							  						<col width="13%">
							  						<col width="18%">
							  						<col width="9%">
													<thead>
														<tr>
														
															<th class=""><?php echo lang('language_lang.lbl_trans_date');?></th>
															<th class=""><?php echo lang('language_lang.lbl_transaction_id');?></th>
															<th class=""><?php echo lang('language_lang.lbl_description');?></th>
															<th class=""><?php echo lang('language_lang.lbl_type');?></th>
															<th class=""><?php echo lang('language_lang.lbl_amount');?></th>
															<th class=""><?php echo lang('language_lang.lbl_payment_gateway');?></th>
															<th class=""><?php echo lang('language_lang.lbl_options');?></th>
															
														</tr>
													</thead>
													<tbody>
													<?php 
														if($pending_payout) {
															
															$row_count = count($pending_payout);
															
															foreach ($pending_payout as $row) {

																$condition = "payment_key in('status') AND payment_id = '".$row->payment_id."'";
																$payment = $this->finance_model->PaymentName($condition);
																
														?>
														<tr>
															<td class=""><?php echo date('Y-m-d H:i:s', strtotime($row->date));?></td>
															<td class=""><?php echo $row->transactionid;?></td>
															<td class=""><?php echo ucfirst($row->description);?></td>
															<td class=""><?php echo humanize($row->type);?></td>
															<td class=""><?php echo $currency_info->currency_symbol."".number_format($row->amount, $currency_info->deimal_point, '.', '').' '.strtoupper($currency_info->currency_unit);?></td>
															<td class=""><?php echo (isset($payment->payment_name)) ? ucfirst($payment->payment_name) : '----';?></td>
															<td class="text-center">
							                                	<a class="btns" data-popup="tooltip" title="<?php echo lang('language_lang.lbl_approve_withdraw');?>"  href="javascript:void(0)" onClick="payouts('<?php echo $myencrypt->encode($row->historyid);?>')" ><i class="fa fa-thumbs-up"></i></a>
							                                	<a class="btns" data-popup="tooltip" title="<?php echo lang('language_lang.lbl_cancel_withdraw');?>"  href="javascript:void(0)" onClick="cancelpayouts('<?php echo $myencrypt->encode($row->historyid);?>')" ><i class="fa fa-thumbs-down"></i></a>
							                                </td>
														</tr>
													<?php 

															}
														}  else { 

													?>
														<?php } ?>
													</tbody>
												</table>

											</div>
										</div>
									</div>

									<div class="tab-pane fade" id="referral">

										<!-- Available hours -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.referral_text'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<div class="form-group">
												<div class="row">
													<div class="col-md-6">
													<label class="label border-left-primary label-striped"><?php echo lang('language_lang.tot_user_referrals'); ?> </label>
												   
													    <label style="margin-left:100px;" class="badge badge-primary"><?php echo $total_sponser;?></label>
												    </div>
												  <div class="col-md-6">

												    <label class="label border-left-warning label-striped"><?php echo lang('language_lang.tot_active_referrals'); ?> </label>
													    <label style="margin-left:100px;" class="badge badge-warning"><?php echo $active_sponser;?></label>
												    </div>
												</div>
												</div>
											
												<div class="form-group">
													<div class="row">
													<div class="col-md-6">
													    <label class="label border-left-primary label-striped"><?php echo lang('language_lang.tot_inactive_referrals'); ?> </label>
													    <label style="margin-left:87px;" class="badge badge-primary"><?php echo $inactive_sponser;?></label>
												    </div>
												    <div class="col-md-6">
	                                                    <label class="label border-left-warning label-striped"><?php echo lang('language_lang.tot_comm_referrals'); ?> </label>
													    <label style="margin-left:40px;" class="badge badge-warning"><?php echo $currency_info->currency_symbol.' '.number_format($total_ref_comm,$currency_info->deimal_point, '.', '');?></label>
												    </div>
												    </div>

												</div>
											
												
											</div>
											
										</div>

										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.admin_user_referral'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div>

											<div class="panel-body">
												<table class="table datatable-responsive-referral table-hover">
						
							  						<col width="25%">
							  						<col width="25%">
							  						<col width="25%">
							  						<col width="25%">
													<thead>
														<tr><th></th>
															<th class=""><?php echo lang('language_lang.referral_level_lbl');?></th>
															<th class=""><?php echo lang('language_lang.plac_smtp_username');?></th>
															<th class=""><?php echo lang('language_lang.email_text');?></th>
															<th class=""><?php echo lang('language_lang.lbl_deposit');?></th>
														</tr>
													</thead>
													<tbody>
													<?php 
							                              if($sponser_level) {
							                                foreach ($sponser_level as $level_user) {
							                                  $level = count($level_user);
							                                  if($level>0) {
							                                    for ($i=0; $i < $level; $i++) { 
							                            ?>
							                                      <tr>
							                                      <td></td>
							                                        <td><?php echo $level_user[$i]['level'];?></td>
							                                        <td><?php echo ucfirst($level_user[$i]['ref_user']);?></td>
							                                        <td><?php echo ucfirst($level_user[$i]['ref_email']);?></td>
							                                        <td><?php echo $currency_info->currency_symbol.''.number_format($level_user[$i]['deposit'],$currency_info->deimal_point, '.', '');?></td>
							                                      </tr>
							                            <?php
							                                    }
							                                  }
							                                }
							                              } else { 
							                            ?>
							                                 
							                            <?php } ?>
													</tbody>
												</table>

											</div>
										</div>

									</div>

									<div class="tab-pane fade" id="balance">

										<!-- Available hours -->
										<div class="panel panel-flat">
											<div class="panel-heading">
												<h6 class="panel-title"><?php echo lang('language_lang.referral_text'); ?></h6>
												<div class="heading-elements">
													<ul class="icons-list">
								                		<li><a data-action="collapse"></a></li>
								                		<li><a data-action="reload"></a></li>
								                		<li><a data-action="close"></a></li>
								                	</ul>
							                	</div>
											</div> 
										</div> 
									</div>

							</div>
						</div>
					</div>

					<div class="col-lg-3">

						<!-- User thumbnail -->
						<div class="thumbnail">
							<div class="thumb thumb-rounded thumb-slide">
								<img src="<?php echo base_url();?>styles/img/usr.png" alt="">
								
							</div>
						
					    	<div class="caption text-center">
					    		<h6 class="text-semibold no-margin"><?php echo $user->fullname;?> <small class="display-block"><?php echo lang('language_lang.profile_lbl_register'); ?>: <?php echo $user->createdate;?></small></h6>
				    			
					    	</div>
				    	</div>
				    	<!-- /user thumbnail -->


						<!-- Navigation -->
				    	<div class="panel panel-flat">
							<div class="panel-heading">
								<h6 class="panel-title"><?php echo lang('language_lang.admin_user_acti_nav'); ?></h6>
								<div class="heading-elements">
									<!-- <a href="#" class="heading-text">See all &rarr;</a> -->
			                	</div>
							</div>

							<div class="list-group list-group-borderless no-padding-top">
								<a href="#settings" data-toggle="tab" class="list-group-item"><i class="icon-user"></i> <?php echo lang('language_lang.admin_profile_title'); ?></a>
								<a href="#acc_info" data-toggle="tab" class="list-group-item"><i class="icon-info22"></i> <?php echo lang('language_lang.account_info_menu'); ?></a>
								<!-- <a href="#depositrequest" data-toggle="tab" class="list-group-item"><i class="icon-wallet"></i> <?php echo lang('language_lang.menu_request_deposit'); ?></a> -->
								<!-- <a href="#canceldeposit" data-toggle="tab" class="list-group-item"><i class="fa fa-remove"></i> <?php echo lang('language_lang.menu_cancel_deposit'); ?></a> -->
								<!-- <a href="#maturedeposit" data-toggle="tab" class="list-group-item"><i class="fa fa-clock-o"></i> <?php echo lang('language_lang.menu_mature_deposit'); ?></a> -->
								<!-- <a href="#deposit" data-toggle="tab" class="list-group-item"><i class="fa fa-university"></i> <?php echo lang('language_lang.menu_deposit'); ?></a> -->
								<a href="#alltrans" data-toggle="tab" class="list-group-item"><i class="icon-transmission"></i> <?php echo lang('language_lang.menu_transaction'); ?></a>
								<a href="#payout" data-toggle="tab" class="list-group-item"><i class="fa fa-sign-out"></i> <?php echo lang('language_lang.menu_payouts'); ?></a>
								<a href="#pendingpayout" data-toggle="tab" class="list-group-item"><i class="icon-coins"></i> <?php echo lang('language_lang.menu_pendingpayouts'); ?></a>
								
								<div class="list-group-divider"></div>
								<a href="#referral" data-toggle="tab" class="list-group-item"><i class="icon-users"></i> <?php echo lang('language_lang.referral_text'); ?>  <span class="badge bg-primary pull-right"><?php echo $total_sponser; ?></span></a>
								<a href="#acc_settings" data-toggle="tab" class="list-group-item"><i class="icon-gear"></i> <?php echo lang('language_lang.admin_account_sett_title'); ?></a>
							</div>
						</div>
						<!-- /navigation -->
						

						<!-- Balance chart -->
						<div class="panel panel-flat">
							<div class="panel-heading">
								<h6 class="panel-title"><?php echo lang('language_lang.admin_user_balchanges'); ?></h6>
							</div>

							<div class="panel-body">
								<div class="chart-container">
									<div class="chart" id="visits" style="height: 300px;"></div>
								</div>
	                    	</div>
						</div>
						<!-- /balance chart -->


						<!-- Connections -->
				    	<div class="panel panel-flat">
							<div class="panel-heading">
								<h6 class="panel-title"><?php echo lang('language_lang.referral_text'); ?></h6>
								<div class="heading-elements">
									<span class="badge badge-primary heading-text"><?php echo $total_sponser; ?></span>
			                	</div>
							</div>

							<ul class="media-list media-list-linked pb-5">

                               <?php if($ref_name) { foreach ($ref_name as $row) {

                               	$condition6 = "iso_2 = '".$row->country."'";
		   
		                        $countries = $this->common_model->GetRow('country',$condition6);
                               	
                               ?>

								<li class="media">
									<a href="#" class="media-link">
										<div class="media-left"><img src="<?php echo base_url();?>styles/img/usr.png" class="img-circle" alt=""></div>
										<div class="media-body">
											<span class="media-heading text-semibold"><?php echo $row->fullname; ?></span>
											<span class="media-annotation"><?php echo $countries->Country;?></span>
										</div>
										<div class="media-right media-middle">
										<?php if($row->status=='1') {?>
											<span class="status-mark bg-success"></span>
										<?php } else { ?>
										<span class="status-mark bg-danger"></span>
										<?php } ?>
										</div>
									</a>
								</li>

								<?php } } ?>

								
							</ul>
						</div>
						<!-- /connections -->

					</div>
				</div>
				<!-- /user profile -->

			</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">
	jQuery.noConflict();
	(function( $ ) {

		$(function() {

			jQuery.jGrowl.defaults.closer = false;

			<?php if($this->session->getFlashData('success_message')) { ?>
				jQuery.jGrowl("<?php echo $this->session->getFlashData('success_message');?>", {
		            header: '<?php echo lang("language_lang.success");?>',
		            theme: 'bg-success'
		        });

            <?php } ?>

            <?php if($this->session->getFlashData('error_message')) { ?>
				jQuery.jGrowl("<?php echo $this->session->getFlashData('error_message');?>", {
		            header: '<?php echo lang("language_lang.error");?>',
		            theme: 'bg-danger'
		        });

            <?php } ?>

			// Set paths
		    require.config({
		        paths: {
		            echarts: 'assets/js/plugins/visualization/echarts'
		        }
		    });


		    // Configuration
		    require(
		        [
		            'echarts',
		            // 'echarts/theme/limitless',
		            'echart',   // load-on-demand, don't forget the Magic switch type.
		            'echarts/chart/bar'
		        ],


		        // Charts setup
		        function (ec, limitless) {

		            // Init
		            var visits = ec.init(document.getElementById('visits'), limitless);
		            var plans = ec.init(document.getElementById('plans'), limitless);
		            

		            // Text label options
		            var labelRight = {normal: {color: '#FF7043', label: {position: 'right'}}};

		            // Options
		            visits_options = {

		                // Setup grid
		                grid: {
		                    x: 15,
		                    x2: 15,
		                    y: 0,
		                    y2: 25,
		                    borderWidth: 0
		                },

		                // Add tooltip
		                tooltip: {
		                    trigger: 'axis',
		                    axisPointer: {
		                        type: 'shadow'
		                    },
		                    formatter: function(params) {
		                        return params[0].seriesName + ': ' + params[0].value + ' <?php echo $currency_info->currency_symbol;?>';
		                    }
		                },

		                // Horizontal axis
		                xAxis: [{
		                    type: 'value',
		                    axisLine: {show: false},
		                    splitLine: {show: false},
		                    axisTick: {show: false}
		                }],

		                // Vertical axis
		                yAxis: [{
		                    type: 'category',
		                    axisLine: {show: false},
		                    axisLabel: {show: false},
		                    axisTick: {show: false},
		                    splitLine: {
		                        lineStyle:{
		                            type:'dashed',
		                            color: '#e5e5e5'
		                        }
		                    },
		                    data : ['<?php echo lang("language_lang.admin_user_mon_lbl"); ?>', '<?php echo lang("language_lang.admin_user_tue_lbl"); ?>', '<?php echo lang("language_lang.admin_user_wed_lbl"); ?>', '<?php echo lang("language_lang.admin_user_thu_lbl"); ?>', '<?php echo lang("language_lang.admin_user_fri_lbl"); ?>', '<?php echo lang("language_lang.admin_user_sat_lbl"); ?>', '<?php echo lang("language_lang.admin_user_sun_lbl"); ?>']
		                }],

		                // Add series
		                series: [
		                    {
		                        name: 'Balance',
		                        type: 'bar',
		                        stack: 'Total',
		                        barWidth: 20,
		                        itemStyle: {
		                            normal: {
		                                color: '#66BB6A',
		                                barBorderRadius: 3,
		                                label: {
		                                    show: true,
		                                    position: 'left',
		                                    formatter: '{b}',
		                                    textStyle: {
		                                        color: '#777'
		                                    }
		                                }
		                            },
		                            emphasis: {
		                                barBorderRadius: 3
		                            }
		                        },
		                        data: [
		                            {value: <?php echo $mon_AvailableBalance; ?>, itemStyle: labelRight},
		                            {value: <?php echo $tues_AvailableBalance; ?>, itemStyle: labelRight},
		                            {value: <?php echo $wed_AvailableBalance; ?>,  itemStyle: labelRight},
		                            {value: <?php echo $thur_AvailableBalance; ?>,  itemStyle: labelRight}, 
		                            {value: <?php echo $fri_AvailableBalance; ?>, itemStyle: labelRight},
		                            {value: <?php echo $sat_AvailableBalance; ?>,  itemStyle: labelRight},
		                            {value: <?php echo $sun_AvailableBalance; ?>, itemStyle: labelRight}
		                        ]
		                    }
		                ]
		            };


		            //
		            // Available time chart options
		            //

		            plans_options = {

		                // Setup grid
		                grid: {
		                    x: 30,
		                    x2: 10,
		                    y: 35,
		                    y2: 25
		                },

		                // Add tooltip
		                tooltip: {
		                    trigger: 'axis',
		                    axisPointer: {
		                        type: 'shadow'
		                    }
		                },

		                // Add legend
		                legend: {
		                    data:['<?php echo lang("language_lang.admin_user_incom_lbl"); ?>','<?php echo lang("language_lang.admin_user_exp_lbl"); ?>']
		                },

		                // Enable drag recalculate
		                calculable: true,

		                // Horizontal axis
		                xAxis: [{
		                    type: 'category',
		                    data : ['<?php echo lang("language_lang.admin_user_mon_lbl"); ?>', '<?php echo lang("language_lang.admin_user_tue_lbl"); ?>', '<?php echo lang("language_lang.admin_user_wed_lbl"); ?>', '<?php echo lang("language_lang.admin_user_thu_lbl"); ?>', '<?php echo lang("language_lang.admin_user_fri_lbl"); ?>', '<?php echo lang("language_lang.admin_user_sat_lbl"); ?>', '<?php echo lang("language_lang.admin_user_sun_lbl"); ?>']
		                }],

		                // Vertical axis
		                yAxis: [{
		                    type: 'value',
		                    // valueFormatString:"#0,.k",
		                }],


		                // Add series
		                series: [
		                    {
		                        name: '<?php echo lang("language_lang.admin_user_incom_lbl"); ?>',
		                        type: 'bar',
		                        data: [<?php echo $mon_ern; ?>, <?php echo $tues_ern; ?>, <?php echo $wed_ern; ?>, <?php echo $thur_ern; ?>, <?php echo $fri_ern; ?>, <?php echo $sat_ern; ?>, <?php echo $sun_ern; ?>],
		                        itemStyle: {
		                            normal: {
		                                color: '#B0BEC5',
		                                label: {
		                                    show: true,
		                                    textStyle: {
		                                        fontWeight: 500
		                                    }
		                                }
		                            }
		                        }
		                    },
		                    {
		                        name: '<?php echo lang("language_lang.admin_user_exp_lbl"); ?>',
		                        type: 'bar',
		                        data: [<?php echo $mon_exp; ?>, <?php echo $tues_exp; ?>, <?php echo $wed_exp; ?>, <?php echo $thur_exp; ?>, <?php echo $fri_exp; ?>, <?php echo $sat_exp; ?>, <?php echo $sun_exp; ?>],
		                        itemStyle: {
		                            normal: {
		                                color: '#29B6F6',
		                                label: {
		                                    show: true,
		                                    textStyle: {
		                                        fontWeight: 500
		                                    }
		                                }
		                            }
		                        }
		                    }
		                ]
		            };


		            //
		            // Apply options
		            //

		            visits.setOption(visits_options);
		            plans.setOption(plans_options);


		            //
		            // Resize chart
		            //

		            window.onresize = function () {
		                setTimeout(function (){
		                    visits.resize();
		                    plans.resize();
		                }, 200);
		            }


		            // Resize in tabs
		            $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
		                visits.resize();
		                plans.resize();
		            });
		        }
		    );


		    // Form components
		    // ------------------------------

		    // Select2 selects
		    $('.select').select2({
		        minimumResultsForSearch: Infinity
		    });


		    // Styled file input
		    $(".file-styled").uniform({
		        wrapperClass: 'bg-warning',
		        fileButtonHtml: '<i class="icon-googleplus5"></i>'
		    });


		    // Styled checkboxes, radios
		    $(".styled").uniform({
		        radioClass: 'choice'
		    });
    

		// $(document).ready(function() {

			$(".switchery").bootstrapSwitch();
			

			// Styled checkboxes and radios
		    $('.styled').uniform({
		        radioClass: 'choice'
		    });

		    if ($("#simg").length > 0) {
		        function formatFlags(state) {
		            if (!state.id) return state.text;
		            return "<img style='padding-right:10px;' src='<?php echo base_url('assets/images/flags/');?>"+'/' + state.id.toLowerCase() + ".png'/>" + state.text;
		        }
		        $("#simg").select2({
		            formatResult: formatFlags,
		            formatSelection: formatFlags,
		            escapeMarkup: function(m) {
		                return m;
		            }
		        });
		    }

		    $('#icon-bck').on('click',function() {
				window.history.back();
			});
				
		// });
		/*
		$('.cancelbtn').click(function (e) {
			e.preventDefault();
			var id = this.value;
			swal({
	            title: "<?php echo lang('language_lang.confirm_cancel_deposit_text');?>",
	            showCancelButton: true,
	            closeOnConfirm: false,
	            confirmButtonColor: "#2196F3",
	            cancelButtonColor: true,
	            showLoaderOnConfirm: true
	        },
	        function(inputValue){
	            if (inputValue === false) {
	            	return false;
	            } else {
	            	window.location.href = "<?php echo base_url();?>admin/finance/Canceldeposit/"+id;
	            }
	        });
		})*/

	});

	})(jQuery);

	function payouts(id) {
		jQuery.ajax({
            type: 'post',
            url : '<?php echo base_url('admin/masspayout/singleuserpay');?>',
            data : {'id':id},

            beforeSend: function(){

            	jQuery('.panel').block({ 
		            message: '<i class="icon-spinner2 spinner"></i>',
		            overlayCSS: {
		                backgroundColor: '#fff',
		                opacity: 0.8,
		                cursor: 'wait',
		                'box-shadow': '0 0 0 1px #ddd'
		            },
		            css: {
		                border: 0,
		                padding: 0,
		                backgroundColor: 'none'
		            }
		        });
			    
		   	},
            success : function(resp)
            {
                if(resp) {
                	
                }
            },
            complete: function(){
		    	jQuery('.panel').unblock();
		   	}
        });
	}

	function cancelpayouts(id) {

		swal({
            title: "<?php echo lang('language_lang.confirm_cancel_request_text');?>",
            showCancelButton: true,
            closeOnConfirm: false,
            confirmButtonColor: "#2196F3",
            cancelButtonColor: true,
            showLoaderOnConfirm: true
        },
        function(inputValue){
            if (inputValue === false) {
            	return false;
            } else {
            	window.location.href = "<?php echo base_url('admin/masspayout/Deleterequest/');?>"+id;
            }
        });

	}

	function closedeposit(id) {

		swal({
            title: "<?php echo lang('language_lang.confirm_cancel_request_text');?>",
            showCancelButton: true,
            closeOnConfirm: false,
            confirmButtonColor: "#2196F3",
            cancelButtonColor: true,
            showLoaderOnConfirm: true
        },
        function(inputValue){
            if (inputValue === false) {
            	return false;
            } else {
            	jQuery.ajax({
		            type: 'post',
		            url : '<?php echo base_url('admin/finance/Canceldeposit/');?>'+id,
		            data : {'id':id},
		            success : function(resp)
		            {
		                if(resp) {
		                	location.reload();
		                }
		            }
		        });
            }
        });

	}

	function cancelreqdeposit(id) {

		swal({
            title: "<?php echo lang('language_lang.confirm_cancel_request_text');?>",
            showCancelButton: true,
            closeOnConfirm: false,
            confirmButtonColor: "#2196F3",
            cancelButtonColor: true,
            showLoaderOnConfirm: true
        },
        function(inputValue){
            if (inputValue === false) {
            	return false;
            } else {
            	jQuery.ajax({
		            type: 'post',
		            url : '<?php echo base_url('admin/users/Deleterequest/');?>'+id,
		            data : {'id':id},
		            success : function(resp)
		            {
		                if(resp) {
		                	location.reload();
		                }
		            }
		        });
            }
        });

	}

	function approvedeposit(id) {

		swal({
            title: "<?php echo lang('language_lang.confirm_cancel_approve_text');?>",
            showCancelButton: true,
            closeOnConfirm: false,
            confirmButtonColor: "#2196F3",
            cancelButtonColor: true,
            showLoaderOnConfirm: true
        },
        function(inputValue){
            if (inputValue === false) {
            	return false;
            } else {
            	jQuery.ajax({
		            type: 'post',
		            url : '<?php echo base_url('admin/users/approverequest/');?>'+id,
		            data : {'id':id},
		            success : function(resp)
		            {
		                if(resp) {
		                	location.reload();
		                }
		            }
		        });
            }
        });

	}

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