<?php $this->load->view('header');?>

	<!-- BEGIN PAGE HEADER-->

	<div class="row-fluid">

		<div class="span12">

			<!-- BEGIN PAGE TITLE & BREADCRUMB-->

			<h3 class="page-title">

				<?php echo $this->lang->line('hf_income_summary_report');?>

			</h3>

			<ul class="breadcrumb">

				<li>

					<i class="icon-home"></i>

					<a href="<?php echo base_url();?>home/"><?php echo $this->lang->line('hf_home');?></a> 

					<i class="icon-angle-right"></i>

				</li>
				<li><?php echo $this->lang->line('hf_report');?> <i class="icon-angle-right"></i></li>

				<li>

					<?php echo $this->lang->line('hf_income_summary_report');?>

				</li>
			</ul>

			<!-- END PAGE TITLE & BREADCRUMB-->

		</div>

	</div>

	<!-- END PAGE HEADER-->

	<!-- BEGIN PAGE CONTENT-->

	<div class="row-fluid">

		<div class="span12">

			<!-- BEGIN EXAMPLE TABLE PORTLET-->

			<div class="portlet">
			<form id="report-form" class="form-horizontal" method="post" action="<?php echo base_url();?>report/income_summary/">
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('report_from_member_username');?></label>
					<div class="controls">
						<input type="text" name="username" class="m-wrap medium" value="<?php echo isset($username) ? htmlspecialchars($username, ENT_QUOTES) : '';?>" />
					</div>
				</div>							
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('report_income_date');?></label>
					<div class="controls">
						<select id="income_date" name="income_date" class="medium m-wrap" tabindex="1">
							<option <?php echo (isset($income_date) && $income_date == 1) ? 'selected="selected"' : '';?> value="1"><?php echo $this->lang->line('report_all_time');?></option>
							<option <?php echo (!isset($income_date) || (isset($income_date) && $income_date == 2)) ? 'selected="selected"' : '';?> value="2"><?php echo $this->lang->line('report_today');?></option>
							<option <?php echo (isset($income_date) && $income_date == 3) ? 'selected="selected"' : '';?> value="3"><?php echo $this->lang->line('report_yesterday');?></option>
							<option <?php echo (isset($income_date) && $income_date == 4) ? 'selected="selected"' : '';?> value="4"><?php echo $this->lang->line('report_last_7_days');?></option>
							<option <?php echo (isset($income_date) && $income_date == 5) ? 'selected="selected"' : '';?> value="5"><?php echo $this->lang->line('report_this_month');?></option>
							<option <?php echo (isset($income_date) && $income_date == 6) ? 'selected="selected"' : '';?> value="6"><?php echo $this->lang->line('report_last_month');?></option>
							<option <?php echo (isset($income_date) && $income_date == 7) ? 'selected="selected"' : '';?> value="7"><?php echo $this->lang->line('report_custom_date');?></option>
						</select>
					</div>
				</div>		
				
				<div id="custom_date_panel" <?php echo (isset($income_date) && $income_date == 7) ? '' : 'class="no_display"';?>>
					<div class="control-group">
						<label class="control-label"><?php echo $this->lang->line('report_start_date');?></label>
						<div class="controls">
							<div class="input-append date date-picker" data-date="<?php echo date('d-m-Y');?>" data-date-format="dd-mm-yyyy" data-date-viewmode="years">
								<input class="m-wrap m-ctrl-medium date-picker" readonly size="16" type="text" name="start_date" value="<?php echo isset($start_date) ? htmlspecialchars($start_date, ENT_QUOTES) : date('m/d/Y');?>" /><span class="add-on"><i class="icon-calendar"></i></span>
							</div>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label"><?php echo $this->lang->line('report_end_date');?></label>
						<div class="controls">
							<div class="input-append date date-picker" data-date="<?php echo date('d-m-Y');?>" data-date-format="dd-mm-yyyy" data-date-viewmode="years">
								<input class="m-wrap m-ctrl-medium date-picker" readonly size="16" type="text" name="end_date" value="<?php echo isset($end_date) ? htmlspecialchars($end_date, ENT_QUOTES) : date('m/d/Y');?>" /><span class="add-on"><i class="icon-calendar"></i></span>
							</div>
						</div>
					</div>
				</div>
				
				<div class="form-actions">
					<input class="no_display" type="hidden" id="<?php echo $this->security->get_csrf_token_name(); ?>" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
					<button type="submit" class="btn blue"><i class="icon-ok"></i> <?php echo $this->lang->line('report_submit');?></button>
				</div>
			</form>
			</div>

			<!-- END EXAMPLE TABLE PORTLET-->

		</div>

	</div>

	<!-- END PAGE CONTENT -->
	
	<?php if($this->session->userdata('report_income_date')) {?>
	<div class="row-fluid">

		<div class="span12">

			<div class="portlet box blue">

				<div class="portlet-title">

					<div class="caption"><i class="icon-reorder"></i><?php echo $this->lang->line('hf_income_summary_report');?></div>

				</div>

				<div class="portlet-body">
					<table class="table table-striped table-hover table-bordered" id="table-listing">
						<thead>
							<tr>
								<th><?php echo $this->lang->line('report_income_date');?></th>
								<th><?php echo $this->lang->line('report_intro_bonus');?></th>
								<th><?php echo $this->lang->line('report_algebra_bonus');?></th>
								<th><?php echo $this->lang->line('report_differential_bonus');?></th>
								<th><?php echo $this->lang->line('report_same_bonus');?></th>
								<th><?php echo $this->lang->line('report_pool_bonus');?></th>
								<th><?php echo $this->lang->line('report_total');?></th>
							</tr>
						</thead>
						
						<tfoot>
							<tr>
								<th style="text-align:right"><?php echo $this->lang->line('report_total');?>:</th>
								<th></th>
								<th></th>
								<th></th>
								<th></th>
								<th></th>
								<th></th>
							</tr>
						</tfoot>

						<tbody></tbody>
					</table>

				</div>

			</div>

		</div>

	</div>
	<?php }?>

<?php $this->load->view('footer');?>