<?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_topup_online_history');?> 

			</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_topup');?> <i class="icon-angle-right"></i></li>

				<li>

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

				</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="member-form" class="form-horizontal" method="post" action="<?php echo base_url();?>topup/listing/">
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('member_username');?></label>
					<div class="controls">
						<input type="text" name="search_to_username" class="m-wrap medium" value="<?php echo isset($search_to_username) ? htmlspecialchars($search_to_username, ENT_QUOTES) : '';?>" />
					</div>
				</div>
				
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('member_upline_username');?></label>
					<div class="controls">
						<input type="text" name="search_username" class="m-wrap medium" value="<?php echo isset($search_username) ? htmlspecialchars($search_username, ENT_QUOTES) : '';?>" />
					</div>
				</div>
				
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('member_exclude_downline_group');?></label>
					<div class="controls">
						<input id="tags_1" type="text" name="exclude_downline" class="m-wrap medium tags" value="<?php echo isset($exclude_downline) ? htmlspecialchars($exclude_downline, ENT_QUOTES) : '';?>" />
					</div>
				</div>

				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('topup_transaction_date');?></label>
					<div class="controls">
						<select id="search_topup_date" name="search_topup_date" class="medium m-wrap" tabindex="1">
							<option <?php echo (isset($search_topup_date) && $search_topup_date == 1) ? 'selected="selected"' : '';?> value="1"><?php echo $this->lang->line('member_register_date_all');?></option>
							<option <?php echo (isset($search_topup_date) && $search_topup_date == 2) ? 'selected="selected"' : '';?> value="2"><?php echo $this->lang->line('member_register_date_custom');?></option>
						</select>
					</div>
				</div>								
								
				<div id="custom_date_panel" <?php echo (isset($search_topup_date) && $search_topup_date == 2) ? '' : 'class="no_display"';?>>
					<div class="control-group">
						<label class="control-label"><?php echo $this->lang->line('member_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="search_start_date" value="<?php echo isset($search_start_date) ? htmlspecialchars($search_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('member_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="search_end_date" value="<?php echo isset($search_end_date) ? htmlspecialchars($search_end_date, ENT_QUOTES) : date('m/d/Y');?>" /><span class="add-on"><i class="icon-calendar"></i></span>
							</div>
						</div>
					</div>
				</div>
				
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('member_member_type');?></label>
					<div class="controls">
						<div class="row-fluid">
							<?php
							if($this->session->userdata('member_search_topup_date')) {
								$op1 = '';
								$op2 = '';
								$op3 = '';
								$arr = explode(',', $this->session->userdata('member_search_member_type'));
								foreach($arr as $v) {
									switch($v) {
										case 1: $op1 = 'checked="checked"'; break;
										case 2: $op2 = 'checked="checked"'; break;
										case 3: $op3 = 'checked="checked"'; break;
									}
								}
							?>
							<div class="span10 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_member_type[]" value="1" <?php echo $op1;?> /> <?php echo $this->lang->line('registration_empty_sales');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_member_type[]" value="2" <?php echo $op2;?> /> <?php echo $this->lang->line('registration_real_sales');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_member_type[]" value="3" <?php echo $op3;?> /> <?php echo $this->lang->line('registration_borrow_sales');?>
								</label>
							</div>
							<?php
							}
							else {
							?>
							<div class="span10 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_member_type[]" value="1" checked="checked" /> <?php echo $this->lang->line('registration_empty_sales');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_member_type[]" value="2" checked="checked" /> <?php echo $this->lang->line('registration_real_sales');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_member_type[]" value="3" checked="checked" /> <?php echo $this->lang->line('registration_borrow_sales');?>
								</label>
							</div>
							<?php }?>
						</div>
					</div>
				</div>
				
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('topup_payment_gateway');?></label>
					<div class="controls">
						<div class="row-fluid">
							<?php
							if($this->session->userdata('member_search_topup_date')) {
								$op1 = '';
								$op2 = '';
								$op3 = '';
								$op4 = '';
								$op5 = '';
								$op6 = '';
								$op7 = '';
								$op8 = '';
								$op9 = '';
								$op10 = '';
								$op11 = '';
								$op12 = '';
								$op13 = '';
								$op14 = '';
								$op15 = '';
								$arr = explode(',', $this->session->userdata('member_search_payment_gateway'));
								foreach($arr as $v) {
									switch($v) {
										case 1: $op1 = 'checked="checked"'; break;
										case 2: $op2 = 'checked="checked"'; break;
										case 6: $op3 = 'checked="checked"'; break;
										case 8: $op4 = 'checked="checked"'; break;
										case 9: $op5 = 'checked="checked"'; break;
										case 10: $op6 = 'checked="checked"'; break;
										case 11: $op7 = 'checked="checked"'; break;
										case 12: $op8 = 'checked="checked"'; break;
										case 13: $op9 = 'checked="checked"'; break;
										case 14: $op10 = 'checked="checked"'; break;
										case 15: $op11 = 'checked="checked"'; break;
										case 16: $op12 = 'checked="checked"'; break;
										case 17: $op13 = 'checked="checked"'; break;
										case 18: $op14 = 'checked="checked"'; break;
										case 19: $op15 = 'checked="checked"'; break;
									}
								}
							?>
							<div class="span12 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="1" <?php echo $op1;?> /> <?php echo $this->lang->line('payment_gateway_1');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="2" <?php echo $op2;?> /> <?php echo $this->lang->line('payment_gateway_2');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="6" <?php echo $op3;?> /> <?php echo $this->lang->line('payment_gateway_3');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="8" <?php echo $op4;?> /> <?php echo $this->lang->line('payment_gateway_4');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="9" <?php echo $op5;?> /> <?php echo $this->lang->line('payment_gateway_5');?>
								</label>
							</div>
							<?php
							}
							else {
							?>
							<div class="span12 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="1" checked="checked" /> <?php echo $this->lang->line('payment_gateway_1');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="2" checked="checked" /> <?php echo $this->lang->line('payment_gateway_2');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="6" checked="checked" /> <?php echo $this->lang->line('payment_gateway_3');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="8" checked="checked" /> <?php echo $this->lang->line('payment_gateway_4');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="9" checked="checked" /> <?php echo $this->lang->line('payment_gateway_5');?>
								</label>
							</div>
							<?php }?>
						</div>
					</div>
				</div>
				
				<div class="control-group">
					<label class="control-label">&nbsp;</label>
					<div class="controls">
						<div class="row-fluid">
							<?php
							if($this->session->userdata('member_search_topup_date')) {
							?>
							<div class="span12 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="10" <?php echo $op6;?> /> <?php echo $this->lang->line('payment_gateway_6');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="11" <?php echo $op7;?> /> <?php echo $this->lang->line('payment_gateway_7');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="12" <?php echo $op8;?> /> <?php echo $this->lang->line('payment_gateway_8');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="13" <?php echo $op9;?> /> <?php echo $this->lang->line('payment_gateway_9');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="14" <?php echo $op10;?> /> <?php echo $this->lang->line('payment_gateway_10');?>
								</label>
							</div>
							<?php
							}
							else {
							?>
							<div class="span12 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="10" checked="checked" /> <?php echo $this->lang->line('payment_gateway_6');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="11" checked="checked" /> <?php echo $this->lang->line('payment_gateway_7');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="12" checked="checked" /> <?php echo $this->lang->line('payment_gateway_8');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="13" checked="checked" /> <?php echo $this->lang->line('payment_gateway_9');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="14" checked="checked" /> <?php echo $this->lang->line('payment_gateway_10');?>
								</label>
							</div>
							<?php }?>
						</div>
					</div>
				</div>
				
				<div class="control-group">
					<label class="control-label">&nbsp;</label>
					<div class="controls">
						<div class="row-fluid">
							<?php
							if($this->session->userdata('member_search_topup_date')) {
							?>
							<div class="span12 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="15" <?php echo $op11;?> /> <?php echo $this->lang->line('payment_gateway_11');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="16" <?php echo $op12;?> /> <?php echo $this->lang->line('payment_gateway_12');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="17" <?php echo $op13;?> /> <?php echo $this->lang->line('payment_gateway_13');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="18" <?php echo $op14;?> /> <?php echo $this->lang->line('payment_gateway_14');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="19" <?php echo $op15;?> /> <?php echo $this->lang->line('payment_gateway_15');?>
								</label>
							</div>
							<?php
							}
							else {
							?>
							<div class="span12 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="15" checked="checked" /> <?php echo $this->lang->line('payment_gateway_11');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="16" checked="checked" /> <?php echo $this->lang->line('payment_gateway_12');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="17" checked="checked" /> <?php echo $this->lang->line('payment_gateway_13');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="18" checked="checked" /> <?php echo $this->lang->line('payment_gateway_14');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_payment_gateway[]" value="19" checked="checked" /> <?php echo $this->lang->line('payment_gateway_15');?>
								</label>
							</div>
							<?php }?>
						</div>
					</div>
				</div>
				
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('topup_topup_currency');?></label>
					<div class="controls">
						<div class="row-fluid">
							<?php
							if($this->session->userdata('member_search_topup_date')) {
								$op1 = '';
								$op2 = '';
								$op3 = '';
								$op4 = '';
								$op5 = '';
								$op6 = '';
								$arr = explode(',', $this->session->userdata('member_search_currency'));
								foreach($arr as $v) {
									switch($v) {
										case 1: $op1 = 'checked="checked"'; break;
										case 3: $op2 = 'checked="checked"'; break;
										case 6: $op3 = 'checked="checked"'; break;
										case 8: $op4 = 'checked="checked"'; break;
										case 9: $op5 = 'checked="checked"'; break;
										case 11: $op6 = 'checked="checked"'; break;
									}
								}
							?>
							<div class="span10 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="1" <?php echo $op1;?> /> <?php echo $this->lang->line('currency_cny_without_symbol');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="3" <?php echo $op2;?> /> <?php echo $this->lang->line('currency_myr_without_symbol');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="6" <?php echo $op3;?> /> <?php echo $this->lang->line('currency_thb_without_symbol');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="8" <?php echo $op4;?> /> <?php echo $this->lang->line('currency_sgd_without_symbol');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="9" <?php echo $op5;?> /> <?php echo $this->lang->line('currency_vnd_without_symbol');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="11" <?php echo $op6;?> /> <?php echo $this->lang->line('currency_idr_without_symbol');?>
								</label>
							</div>
							<?php
							}
							else {
							?>
							<div class="span10 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="1" checked="checked" /> <?php echo $this->lang->line('currency_cny_without_symbol');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="3" checked="checked" /> <?php echo $this->lang->line('currency_myr_without_symbol');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="6" checked="checked" /> <?php echo $this->lang->line('currency_thb_without_symbol');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="8" checked="checked" /> <?php echo $this->lang->line('currency_sgd_without_symbol');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="9" checked="checked" /> <?php echo $this->lang->line('currency_vnd_without_symbol');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_currency[]" value="11" checked="checked" /> <?php echo $this->lang->line('currency_idr_without_symbol');?>
								</label>
							</div>
							<?php }?>
						</div>
					</div>
				</div>
				
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('topup_status');?></label>
					<div class="controls">
						<div class="row-fluid">
							<?php
							if($this->session->userdata('member_search_topup_date')) {
								$op1 = '';
								$op2 = '';
								$op3 = '';
								$arr = explode(',', $this->session->userdata('member_search_topup_status'));
								foreach($arr as $v) {
									switch($v) {
										case 0: $op1 = 'checked="checked"'; break;
										case 1: $op2 = 'checked="checked"'; break;
										case 2: $op3 = 'checked="checked"'; break;
									}
								}
							?>
							<div class="span10 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_topup_status[]" value="0" <?php echo $op1;?> /> <?php echo $this->lang->line('withdrawal_pending_withdrawal');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_topup_status[]" value="1" <?php echo $op2;?> /> <?php echo $this->lang->line('withdrawal_approve_withdrawal');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_topup_status[]" value="2" <?php echo $op3;?> /> <?php echo $this->lang->line('withdrawal_cancel_withdrawal');?>
								</label>
							</div>
							<?php
							}
							else {
							?>
							<div class="span10 paddingTop7">
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_topup_status[]" value="0" checked="checked" /> <?php echo $this->lang->line('withdrawal_pending_withdrawal');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_topup_status[]" value="1" checked="checked" /> <?php echo $this->lang->line('withdrawal_approve_withdrawal');?>
								</label>
								<label class="checkbox line inline-label">
									<input type="checkbox" name="search_topup_status[]" value="2" checked="checked" /> <?php echo $this->lang->line('withdrawal_cancel_withdrawal');?>
								</label>
							</div>
							<?php }?>
						</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('member_submit');?></button>
				</div>
			</form>
			</div>

			<!-- END EXAMPLE TABLE PORTLET-->

		</div>

	</div>

	<!-- END PAGE CONTENT -->

	<!-- BEGIN PAGE CONTENT-->

	<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_topup_online_history');?></div>

				</div>

				<div class="portlet-body">
				
					<div class="clearfix">
						<div class="btn-group pull-right">
							<button class="btn dropdown-toggle" data-toggle="dropdown"><?php echo $this->lang->line('member_tools');?> <i class="icon-angle-down"></i></button>
							<ul class="dropdown-menu pull-right">
								<li><a href="<?php echo base_url();?>topup/topup_export"><?php echo $this->lang->line('member_export_to_excel');?></a></li>
							</ul>
						</div>
					</div>

					<table class="table table-striped table-hover table-bordered" id="table-listing">
						<thead>
							<tr>
								<th><?php echo $this->lang->line('topup_transaction_date');?></th>
								<th><?php echo $this->lang->line('topup_payment_gateway');?></th>
								<th><?php echo $this->lang->line('topup_topup_currency');?></th>
								<th><?php echo $this->lang->line('topup_actual_amount');?></th>
								<th><?php echo $this->lang->line('topup_topup_amount');?></th>
								<th><?php echo $this->lang->line('topup_currency_rate');?></th>
								<th><?php echo $this->lang->line('topup_to');?></th>
								<th><?php echo $this->lang->line('topup_status');?></th>
							</tr>
						</thead><!--/thead-->
						
						<tfoot>
							<tr>
								<th colspan="3" style="text-align:right"><?php echo $this->lang->line('report_total');?>:</th>
								<th></th>
								<th></th>
								<th></th>
								<th></th>
								<th></th>
							</tr>
						</tfoot>

						<tbody></tbody>
					</table>
				</div>

			</div>

		</div>

	</div>

	<!-- END PAGE CONTENT -->
	
<?php $this->load->view('footer');?>