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

	<div class="row-fluid">
		<div class="span12">

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

			<h3 class="page-title"><?php echo $this->lang->line('hf_payout_request');?> </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_payout');?> <i class="icon-angle-right"></i></li>
				<li><?php echo $this->lang->line('hf_payout_request');?></li>
			</ul>
			<!-- END PAGE TITLE & BREADCRUMB-->
		</div>
	</div>
	
	<div class="row-fluid">
		<div class="span12">
			<form id="payout-form" class="form-horizontal" method="post" action="<?php echo base_url();?>payout/submit/" onsubmit="return validateForm('payout-form')">
				<?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="control-group">
					<label class="control-label" ><?php echo $this->lang->line('payout_department');?>: </label>
					<div class="controls">
						<select id="department_id" name="department_id" class="m-wrap span2">
							<option value="1" <? echo ((isset($department_id) && $department_id == 1) ? 'selected="selected"' : '');?>><?php echo $this->lang->line('department_1');?></option>
							<option value="2" <? echo ((isset($department_id) && $department_id == 2) ? 'selected="selected"' : '');?>><?php echo $this->lang->line('department_2');?></option>
							<option value="3" <? echo ((isset($department_id) && $department_id == 3) ? 'selected="selected"' : '');?>><?php echo $this->lang->line('department_3');?></option>
						</select>
					</div>
				</div>	
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('payout_payment_gateway');?></label>
					<div class="controls">
						<select id="payment_gateway_id" name="payment_gateway_id" class="m-wrap span2">
							<option value="1" <?php echo (isset($gateway_id) && $gateway_id == '1') ? 'selected="selected"' : '';?>><?php echo $this->lang->line('payment_gateway_3');?></option>
						</select>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('payout_currency');?></label>
					<div class="controls">
						<select id="currency_id" name="currency_id" class="m-wrap span2">
							<option value="3" <?php echo (isset($currency_id) && $currency_id == '3') ? 'selected="selected"' : '';?>><?php echo $this->lang->line('currency_myr_without_symbol');?></option>
						</select>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" ><?php echo $this->lang->line('payout_bank');?>: </label>
					<div class="controls">
						<select id="bank_id" name="bank_id" class="m-wrap span2">
							<?php
								foreach(get_malaysia_bank_3() as $k => $v) {
									if(isset($bank_id)) {
										if($k == $bank_id) {
											echo '<option value="' . $k . '" selected="selected">' . $this->lang->line($v) . '</option>';
										}
										else {
											echo '<option value="' . $k. '">' . $this->lang->line($v) . '</option>';
										}
									}
									else {
										echo '<option value="' . $k. '">' . $this->lang->line($v) . '</option>';
									}
								}
							?>
						</select>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('payout_holder_name');?></label>
					<div class="controls">
						<input type="text" id="holder_name" name="holder_name" class="m-wrap medium" value="<? echo (isset($holder_name) ? htmlspecialchars($holder_name, ENT_QUOTES) : '');?>" />
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('payout_account_no');?></label>
					<div class="controls">
						<input type="text" id="account_no" name="account_no" class="m-wrap medium" value="<? echo (isset($account_no) ? htmlspecialchars($account_no, ENT_QUOTES) : '');?>" />
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('payout_amount');?></label>
					<div class="controls">
						<input type="text" id="amount" name="amount" class="m-wrap medium" value="<? echo (isset($amount) ? htmlspecialchars($amount, ENT_QUOTES) : '');?>" />
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('payout_remark');?></label>
					<div class="controls">
						<input type="text" id="remark" name="remark" class="m-wrap medium" value="<? echo (isset($remark) ? htmlspecialchars($remark, ENT_QUOTES) : '');?>" />
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?php echo $this->lang->line('payout_security_key');?></label>
					<div class="controls">
						<input type="password" id="security_key" name="security_key" class="m-wrap medium" />
					</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('payout_submit');?></button>
				</div>
			</form>
		</div><!-- End span12 -->
		
	</div> <!-- End Row Fluid -->

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