<?php $this->load->view('header');?>
		
	<section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1><?php echo $this->lang->line('hf_home');?></h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item active"><?php echo $this->lang->line('hf_home');?></li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
	
	<section class="content">
      <div class="container-fluid">
		<?php /*if($allowed_game == 0) {?>
		<div class="alert alert-danger alert-dismissible">
		  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
		  <h5><i class="icon fas fa-ban"></i> <?php echo $this->lang->line('home_notice');?></h5>
		  <?php echo $this->lang->line('home_game_suspended');?>
		</div>
		<?php }*/?>	
		
        <div class="row">
          <div class="col-md-3">

            <!-- Profile Image -->
            <div class="card card-primary card-outline">
              <div class="card-body box-profile">
                <div class="text-center">
                  <img class="profile-user-img img-fluid img-circle" src="<?php echo base_url();?>assets/dist/img/avatar5.png" alt="<?php echo $this->session->userdata('member_username');?>">
                </div>

                <h3 class="profile-username text-center"><?php echo $this->session->userdata('member_username');?></h3>

				<?php
					$actual_level = $level;
					if($special_level > $level) {
						$actual_level = $special_level;
					}
				?>
                <p class="text-muted text-center"><?php if($actual_level > 0) {?><img src="<?php echo base_url();?>assets/img/badges/rank_<?php echo $actual_level;?>.png" border="0" /> <?php }?><?php echo $this->lang->line(get_level($actual_level));?></p>

                <ul class="list-group list-group-unbordered mb-3">
                  <li class="list-group-item" style="display: none;">
                    <b><?php echo $this->lang->line('wallet_1');?></b> <span class="float-right"><?php echo number_format($v_unit, 2, '.', ',');?></span>
                  </li>
                  <li class="list-group-item">
                    <b><?php echo $this->lang->line('wallet_2');?></b> <span class="float-right"><?php echo number_format($v_unit2, 2, '.', ',');?></span>
                  </li>
                  <li class="list-group-item" style="display: none;">
                    <b><?php echo $this->lang->line('wallet_3');?></b> <span class="float-right"><?php echo number_format($v_unit3, 2, '.', ',');?></span>
                  </li>
				  <li class="list-group-item" style="display: none;">
                    <b><?php echo $this->lang->line('wallet_4');?></b> <span class="float-right"><?php echo number_format($v_unit4, 2, '.', ',');?></span>
                  </li>
				  <li class="list-group-item" style="display: none;">
                    <b><?php echo $this->lang->line('wallet_5');?></b> <span class="float-right"><?php echo number_format($v_unit5, 2, '.', ',');?></span>
                  </li>
                </ul>
              </div>
              <!-- /.card-body -->
            </div>
            <!-- /.card -->
          </div>
          <!-- /.col -->
          <div class="col-md-9">
            <div class="row">
			  <div class="col-12 col-sm-6 col-md-6" style="display: none;">
				<div class="info-box bg-white">
				  <span class="info-box-icon bg-black elevation-1"><i class="fas fa-user-shield"></i></span>

				  <div class="info-box-content">
					<span class="info-box-text"><?php echo $this->lang->line('home_missbet_insurance');?></span>
					<?php
						$insurance_display_day = '';
						$remaining_day = 0;
						if(isset($insurance_date)) {
							$current_date = time();
							
							if($insurance_date > $current_date) {
								$tmp = ($insurance_date - $current_date);
								$tmp2 = ($tmp / 86400);
								$arr = explode('.', $tmp2);
								$remaining_day = $arr[0];
							}
							else {
								$remaining_day = 0;
							}
						}
						
						if($remaining_day > 1) {
							$insurance_display_day = $remaining_day . $this->lang->line('home_days');
						}
						else {
							$insurance_display_day = $remaining_day . $this->lang->line('home_day');
						}
					?>
					<?php echo (($insurance_date > time()) ? '<span class="info-box-number text-primary">' . $this->lang->line('home_activated') . ' (' . $insurance_display_day . ')</span>' : '<span class="info-box-number text-danger">' . $this->lang->line('home_inactivate') . ' (' . $insurance_display_day . ')</span>');?>
				  </div>
				  <!-- /.info-box-content -->
				</div>
				<!-- /.info-box -->
			  </div>
			  <!-- /.col -->
			  <div class="col-12 col-sm-6 col-md-6">
				<div class="info-box">
				  <span class="info-box-icon bg-maroon elevation-1"><i class="fas fa-chart-line"></i></span>

				  <div class="info-box-content">
					<span class="info-box-text"><?php echo $this->lang->line('home_rolling');?></span>
					<span class="info-box-number"><span id="rolling"><?php echo number_format((($v_unit8 > 0) ? $v_unit8 : 0), 2, '.', ',');?></span> / <?php echo number_format((($total_rolling > 0) ? $total_rolling : 0), 2, '.', ',')?></span>
				  </div>
				  <!-- /.info-box-content -->
				</div>
				<!-- /.info-box -->
			  </div>
			  <!-- /.col -->
			  
			  <!-- fix for small devices only -->
			  <div class="clearfix hidden-md-up"></div>
			  
			  <div class="col-12 col-sm-6 col-md-6" style="display: none;">
				<div class="info-box">
				  <span class="info-box-icon bg-orange elevation-1"><i class="fas fa-gamepad"></i></span>

				  <div class="info-box-content">
					<span class="info-box-text"><?php echo $this->lang->line('platform_1');?></span>
					<span class="info-box-number" id="platform_1"><?php echo number_format((($v_unit6 > 0) ? $v_unit6 : 0), 2, '.', ',');?></span>
				  </div>
				  <!-- /.info-box-content -->
				</div>
				<!-- /.info-box -->
			  </div>
			  <!-- /.col -->
			  <div class="col-12 col-sm-6 col-md-6">
				<div class="info-box mb-3">
				  <span class="info-box-icon bg-purple elevation-1"><i class="fas fa-gamepad"></i></span>

				  <div class="info-box-content">
					<span class="info-box-text"><?php echo $this->lang->line('platform_2');?></span>
					<span class="info-box-number" id="platform_2"><?php echo number_format((($v_unit7 > 0) ? $v_unit7 : 0), 2, '.', ',');?></span>
				  </div>
				  <!-- /.info-box-content -->
				</div>
				<!-- /.info-box -->
			  </div>
			  <!-- /.col -->
			  
			  <!-- fix for small devices only -->
			  <div class="clearfix hidden-md-up"></div>
			  
			  <div class="col-12 col-sm-6 col-md-6">
				<div class="info-box">
				  <span class="info-box-icon bg-info elevation-1"><i class="fas fa-funnel-dollar"></i></span>

				  <div class="info-box-content">
					<span class="info-box-text"><?php echo $this->lang->line('home_total_profit');?></span>
					<span class="info-box-number"><?php echo number_format((($total_earn > 0) ? $total_earn : 0), 2, '.', ',');?></span>
				  </div>
				  <!-- /.info-box-content -->
				</div>
				<!-- /.info-box -->
			  </div>
			  <!-- /.col -->
			  <div class="col-12 col-sm-6 col-md-6">
				<div class="info-box mb-3">
				  <span class="info-box-icon bg-warning elevation-1"><i class="fas fa-users"></i></span>

				  <div class="info-box-content">
					<span class="info-box-text"><?php echo $this->lang->line('home_total_downlines');?> / <?php echo $this->lang->line('home_total_sales');?></span>
					<span class="info-box-number"><?php echo number_format((($total_player > 0) ? $total_player : 0), 0, '', ',');?> / <?php echo number_format((($total_sales > 0) ? $total_sales : 0), 0, '.', ',');?></span>
				  </div>
				  <!-- /.info-box-content -->
				</div>
				<!-- /.info-box -->
			  </div>
			  <!-- /.col -->
			  
			  <!-- fix for small devices only -->
			  <div class="clearfix hidden-md-up"></div>
			  
			  <div class="col-12 col-sm-6 col-md-6">
				<div class="info-box mb-3">
				  <span class="info-box-icon bg-danger elevation-1"><i class="fas fa-hand-holding-usd"></i></span>

				  <div class="info-box-content">
					<span class="info-box-text"><?php echo $this->lang->line('home_total_invest');?></span>
					<span class="info-box-number"><?php echo number_format((($invest['total_invest'] > 0) ? $invest['total_invest'] : 0), 0, '', ',');?></span>
				  </div>
				  <!-- /.info-box-content -->
				</div>
				<!-- /.info-box -->
			  </div>
			  <!-- /.col -->
			  <div class="col-12 col-sm-6 col-md-6">
				<div class="info-box mb-3">
				  <span class="info-box-icon bg-success elevation-1"><i class="fas fa-dollar-sign"></i></span>

				  <div class="info-box-content">
					<span class="info-box-text"><?php echo $this->lang->line('home_total_invest_amount');?></span>
					<span class="info-box-number"><?php echo number_format((($invest['total_amount'] > 0) ? $invest['total_amount'] : 0), 2, '.', ',');?></span>
				  </div>
				  <!-- /.info-box-content -->
				</div>
				<!-- /.info-box -->
			  </div>
			  <!-- /.col -->
			</div>
          </div>
          <!-- /.col -->
        </div>
        <!-- /.row -->
      </div><!-- /.container-fluid -->
    </section>
		
<?php $this->load->view('footer');?>		