<?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_withdraw_ping_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><a href="#"><?php echo $this->lang->line('hf_withdrawal');?></a> <i class="icon-angle-right"></i></li>

				<li>

					<a href="#">
						<?php echo $this->lang->line('hf_withdraw_ping_history');?>
					</a>

				</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();?>withdrawal/ping_listing/">
				<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="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('report_from_member_downline');?></label>
					<div class="controls">
						<input type="text" name="search_downline" class="m-wrap medium" value="<?php echo isset($search_downline) ? htmlspecialchars($search_downline, 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('withdraw_request_date');?></label>
					<div class="controls">
						<select id="search_withdrawal_date" name="search_withdrawal_date" class="medium m-wrap" tabindex="1">
							<option <?php echo (isset($search_withdrawal_date) && $search_withdrawal_date == 1) ? 'selected="selected"' : '';?> value="1"><?php echo $this->lang->line('member_register_date_all');?></option>
							<option <?php echo (isset($search_withdrawal_date) && $search_withdrawal_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_withdrawal_date) && $search_withdrawal_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" id="datetimepicker1">
								<input class="m-wrap m-ctrl-medium" size="16" type="text" name="search_start_date" value="<?php echo isset($search_start_date) ? htmlspecialchars($search_start_date, ENT_QUOTES) : date('Y-m-d H:i');?>">
								<span class="add-on"><i class="icon-th"></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" id="datetimepicker2">
								<input class="m-wrap m-ctrl-medium" size="16" type="text" name="search_end_date" value="<?php echo isset($search_end_date) ? htmlspecialchars($search_end_date, ENT_QUOTES) : date('Y-m-d H:i');?>">
								<span class="add-on"><i class="icon-th"></i></span>
							</div>
						</div>
					</div>
				</div>
				
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('withdraw_status');?></label>
					<div class="controls">
						<div class="row-fluid">
							<?php
							if($this->session->userdata('member_search_withdrawal_date')) {
								$op1 = '';
								$op2 = '';
								$op3 = '';
								$arr = explode(',', $this->session->userdata('member_search_withdrawal_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_withdrawal_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_withdrawal_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_withdrawal_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_withdrawal_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_withdrawal_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_withdrawal_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_withdraw_ping_history');?></div>

				</div>

				<div class="portlet-body">
					<?php 
						$alert_box = '';
						$alert_msg = '';
						
						if($this->session->userdata('form_msg_type') == 100) {
							$alert_box = 'success';
							$alert_msg = $this->session->userdata('form_msg');
						}
						else if($this->session->userdata('form_msg_type') == 200) {
							$alert_box = 'error';
							$alert_msg = $this->session->userdata('form_msg');
						}
						
						if($this->session->userdata('form_msg_type') == 100 OR $this->session->userdata('form_msg_type') == 200) {
							$this->session->unset_userdata(array('form_msg_type' => '', 'form_msg' => ''));
						}

						if( ! empty($alert_msg)) {
					?>
					<div class="alert alert-<?php echo $alert_box;?>">
						<button class="close" data-dismiss="alert"></button>
						<?php echo $alert_msg;?>
					</div>
					<?php }?>
					
					<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();?>withdrawal/withdrawal_ping_export"><?php echo $this->lang->line('member_export_to_excel');?></a></li>
							</ul>
						</div>
					</div>

					<form id="withdrawal-form" class="form-horizontal" method="post" action="<?php echo base_url();?>withdrawal/ping_listing_update/">
						<table class="table table-striped table-hover table-bordered" id="table-listing">
							<thead>
								<tr>
									<th><input type="checkbox" id="mainchkbox" name="chkbox[]" onchange="checkBox(this);" /></th>
									<th><?php echo $this->lang->line('withdraw_request_date');?></th>
									<th><?php echo $this->lang->line('withdraw_actual_amount');?></th>
									<th><?php echo $this->lang->line('withdraw_withdrawal_rate');?></th>
									<th><?php echo $this->lang->line('withdraw_currency_rate');?></th>
									<th><?php echo $this->lang->line('withdraw_charges');?></th>
									<th><?php echo $this->lang->line('withdraw_from_member');?></th>
									<th><?php echo $this->lang->line('registration_coin_wallet_address');?></th>
									<th><?php echo $this->lang->line('withdraw_status');?></th>
									<th>&nbsp;</th>
								</tr>
							</thead><!--/thead-->
							
							<tfoot>
								<tr>
									<th colspan="2" style="text-align:right"><?php echo $this->lang->line('report_total');?>:</th>
									<th></th>
									<th></th>
									<th></th>
									<th></th>
									<th></th>
									<th></th>
									<th></th>
									<th></th>
								</tr>
							</tfoot>

							<tbody></tbody>
						</table>
						
						<select id="listing_submit" name="update_status" class="medium m-wrap" tabindex="1" onchange="update_withdrawal_ping_listing_status()">
							<option value="0"><?php echo $this->lang->line('withdrawal_select_action');?></option>
							<option value="1"><?php echo $this->lang->line('withdrawal_approve_withdrawal');?></option>
							<option value="2"><?php echo $this->lang->line('withdrawal_cancel_withdrawal');?></option>
						</select>
						<input class="no_display" type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
					</form>

				</div>

			</div>

		</div>

	</div>

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