<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<div class="box" style="position:relative;">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1><img src="view/image/payment/multisafepay-logo.png" alt="payment" /><?php echo $heading_title; ?></h1>
    <div class="buttons"><a onclick="$('#form').submit();" class="button"><span><?php echo $button_save; ?></span></a><a onclick="location='<?php echo $cancel; ?>';" class="button"><span><?php echo $button_cancel; ?></span></a></div>
  </div>
  <div class="content">
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
  <div id="tab_general" class="page">
    <table class="form">
	 
      <tr>
        <td><?php echo $entry_environment; ?></td>
        <td><select name="multisafepay_environment">
				<option value='0'<?php if($multisafepay_environment == 0) echo 'selected'; ?>>Live account</option>
            	<option value='1' <?php if($multisafepay_environment ==1) echo 'selected'; ?>>Test account</option>

			</select><br /><a href='https://testmerchant.multisafepay.com/signup' target='_blank'><?php echo $text_free_account; ?></a>
		</td>
      </tr>
	  <tr>
        <td><?php echo $entry_environment; ?></td>
        <td><select name="multisafepay_account_type">
				<option value='connect'<?php if($multisafepay_account_type == 'connect') echo 'selected'; ?>>Connect</option>
            	<option value='fastcheckout' <?php if($multisafepay_account_type == 'fastcheckout') echo 'selected'; ?>>Fastcheckout</option>
			</select>
		</td>
      </tr>
	  	  <tr>
        <td><?php echo $enable_checkout_button; ?></td>
        <td><select name="enable_checkout_button_connect">
				<option value='true'<?php if($enable_checkout_button_connect == 'true') echo 'selected'; ?>>Ja</option>
            	<option value='false' <?php if($enable_checkout_button_connect == 'false') echo 'selected'; ?>>Nee</option>
			</select>
		</td>
      </tr>
    <tr>
      <td><?php echo $entry_multisafepay_redirect_url; ?></td>
      <td>
				<select name="multisafepay_redirect_url">
					<option value='true'<?php if($multisafepay_redirect_url == 'true') echo 'selected'; ?>>Enabled</option>
					<option value='false' <?php if($multisafepay_redirect_url == 'false') echo 'selected'; ?>>Disabled</option>
				</select>
			</td>
    </tr>
		<script>
		
		var sliderIntervalId = 0;
		var sliderHeight = 0;
		var sliding = false;
		var slideSpeed = 10;

		function Slide()
		{
			 if(sliding)
					return;
			 sliding = true;
			 if(sliderHeight == 232){
					document.getElementById('myTable').style.border = "0px";
					sliderIntervalId = setInterval('SlideUpRun()', 30);
					}
			 else{
					sliderIntervalId = setInterval('SlideDownRun()', 30);
					document.getElementById('myTable').style.border = "1px solid #003A88";
					}
		}

		function SlideUpRun()
		{
			 slider = document.getElementById('myTable');
			 if(sliderHeight <= 0)
			 {
					sliding = false;
					sliderHeight = 0;
					slider.style.height = '0px';
					clearInterval(sliderIntervalId);
			 }
			 else
			 {
					sliderHeight -= slideSpeed;
					if(sliderHeight < 0)
						 sliderHeight = 0;
					slider.style.height = sliderHeight + 'px';
			 }
		}

		function SlideDownRun()
		{
			 slider = document.getElementById('myTable');
			 if(sliderHeight >= 255)
			 {
					sliding = false;
					sliderHeight = 255;
					slider.style.height = '255px';
					clearInterval(sliderIntervalId);
			 }
			 else
			 {
					sliderHeight += slideSpeed;
					if(sliderHeight > 255)
						 sliderHeight = 255;
					slider.style.height = sliderHeight + 'px';
			 }
		}


		function switchtable(){
		var myTable = document.getElementById('myTable');
		if(myTable.style.display == "none"){
				myTable.style.display = "block";
			}
		else{
				myTable.style.display = "none";
			}
		}
		function showtable(){
		var myLink = document.getElementById('paymethods');
		myLink.style.display = "block";
		}
		
		function hidetable(){
		var myLink = document.getElementById('paymethods');
		myLink.style.display = "none";
		}
		</script>

    <tr>
      <td><?php echo $entry_multisafepay_gateway_selection; ?></td>
      <td>
				<select name="multisafepay_gateway_selection">
					<option value='1' onclick="showtable();" <?php if($multisafepay_gateway_selection == 1) echo 'selected'; ?>>Enabled</option>
					<option value='0' onclick="hidetable();" <?php if($multisafepay_gateway_selection == 0) echo 'selected'; ?>>Disabled</option>
				</select>
				<br />
				<br />
				<!--<a id="paymethods" onclick="switchtable();" class="color:#003366; cursor:pointer; text-decoration:underlined;"><?php echo $select_methods; ?></a>-->
				<a id="paymethods" onclick="Slide();" class="color:#003366; cursor:pointer; text-decoration:underlined;"><?php echo $select_methods; ?></a>
				
				<div id="myTable" style="overflow:hidden; height:0px; position: absolute; background-color: white; top: 214px; left: 400px;">
						<table>
							<tr>
								<td>MisterCash: </td>
								<td><input type="checkbox" <?php if($MSP_MISTERCASH == 1) echo 'checked'; ?> value='1' name="MSP_MISTERCASH" /></td>
							</tr>
							<tr>
								<td>Automatisch Incasso: </td>
								<td><input type="checkbox" <?php if($MSP_DIRDEB == 1) echo 'checked'; ?> value="1" name="MSP_DIRDEB" /></td>
							</tr>
							<tr>
								<td>MultiSafepay wallet: </td>
								<td><input type="checkbox" <?php if($MSP_WALLET == 1) echo 'checked'; ?> value="1" name="MSP_WALLET" /></td>
							</tr>
							<tr>
								<td>Bank Transfer: </td>
								<td><input type="checkbox" <?php if($MSP_BANKTRANS == 1) echo 'checked'; ?> value="1" name="MSP_BANKTRANS" /></td>
							</tr>
							<tr>
								<td>iDEAL: </td>
								<td><input type="checkbox" <?php if($MSP_IDEAL == 1) echo 'checked'; ?> value="1" name="MSP_IDEAL" /></td>
							</tr>
							<tr>
								<td>Visa CreditCards: </td>
								<td><input type="checkbox" <?php if($MSP_VISA == 1) echo 'checked'; ?> value="1" name="MSP_VISA" /></td>
							</tr>
							<tr>
								<td>MasterCard: </td>
								<td><input type="checkbox" <?php if($MSP_MASTERCARD == 1) echo 'checked'; ?> value="1" name="MSP_MASTERCARD" /></td>
							</tr>
							<tr>
								<td>DirectEbanking: </td>
								<td><input type="checkbox" <?php if($MSP_DIRECTBANK == 1) echo 'checked'; ?> value="1" name="MSP_DIRECTBANK" /></td>
							</tr>
							<tr>
								<td>GiroPay: </td>
								<td><input type="checkbox" <?php if($MSP_GIROPAY == 1) echo 'checked'; ?> value="1" name="MSP_GIROPAY" /></td>
							</tr>
							<tr>
								<td>Maestro: </td>
								<td><input type="checkbox" <?php if($MSP_MAESTRO == 1) echo 'checked'; ?> value="1" name="MSP_MAESTRO" /></td>
							</tr>
							<tr>
								<td>Pay after delivery: </td>
								<td><input type="checkbox" <?php if($MSP_PAYAFTER == 1) echo 'checked'; ?> value="1" name="MSP_PAYAFTER" /></td>
							</tr>
						</table>
				</div>
			</td>
		</tr>

	  <tr>
        <td><span class="required">*</span> <?php echo $entry_multisafepay_merchantid; ?></td>
        <td><input type="text" name="multisafepay_merchant_id" value="<?php echo $multisafepay_merchant_id; ?>" /><br />
          <?php if ($error_merchant) { ?>
          <span class="error"><?php echo $error_merchant; ?></span>
          <?php } ?></td>
      </tr>	  
      <tr>
        <td><span class="required">*</span> <?php echo $entry_multisafepay_siteid; ?></td>
        <td><input type="text" name="multisafepay_site_id" value="<?php echo $multisafepay_site_id; ?>" /></td>
      </tr>
	  
	  <tr>
        <td><span class="required">*</span> <?php echo $entry_multisafepay_secure_code; ?></td>
        <td><input type="text" name="multisafepay_secure_code" value="<?php echo $multisafepay_secure_code; ?>" /></td>
      </tr>
	  <tr>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	  </tr>
	   <tr>
		<td><strong><?php echo $text_set_bno_data; ?></strong></td>
		<td>&nbsp;</td>
	</tr>
	<tr>
        <td><?php echo $entry_multisafepay_merchantid; ?></td>
        <td><input type="text" name="bno_multisafepay_merchant_id" value="<?php echo $bno_multisafepay_merchant_id; ?>" /></td>
      </tr>	  
      <tr>
        <td><?php echo $entry_multisafepay_siteid; ?></td>
        <td><input type="text" name="bno_multisafepay_site_id" value="<?php echo $bno_multisafepay_site_id; ?>" /></td>
      </tr>
	  
	  <tr>
        <td><?php echo $entry_multisafepay_secure_code; ?></td>
        <td><input type="text" name="bno_multisafepay_secure_code" value="<?php echo $bno_multisafepay_secure_code; ?>" /></td>
      </tr>
	  <tr>
		<td><?php echo $text_min_bno_amount; ?></td>
		<td><input type="text" name="min_bno_amount" value="<?php echo $min_bno_amount; ?>" /></td>
	  </tr>
	  <tr>
		<td><?php echo $text_max_bno_amount; ?></td>
		<td><input type="text" name="max_bno_amount" value="<?php echo $max_bno_amount; ?>" /></td>
	  </tr>
	   <tr>
        <td><?php echo $entry_environment; ?></td>
        <td><select name="bno_multisafepay_environment">
				<option value='0'<?php if($bno_multisafepay_environment == 0) echo 'selected'; ?>>Live account</option>
            	<option value='1' <?php if($bno_multisafepay_environment ==1) echo 'selected'; ?>>Test account</option>

			</select><br /><a href='https://testmerchant.multisafepay.com/signup' target='_blank'><?php echo $text_free_account; ?></a>
		</td>
      </tr>
	  <tr>
		<td><?php echo $text_bno_product_fee_id ?></td>
		<td><input type="text" name="bno_product_fee_id" value="<?php echo $bno_product_fee_id; ?>" /></td>
	  </tr>
	   <tr>
        <td><?php echo $text_bno_ip_validation_option; ?></td>
        <td><select name="bno_ip_validation_enabler">
				<option value='0' <?php if($bno_ip_validation_enabler == 0) echo 'selected'; ?>>Disabled</option>
            	<option value='1' <?php if($bno_ip_validation_enabler ==1) echo 'selected'; ?>>Enabled</option>
			</select>
		</td>
      </tr>
	   <tr>
		<td><?php echo $text_bno_ip_validation_address; ?></td>
		<td><input type="text" name="bno_ip_validation_address" value="<?php echo $bno_ip_validation_address; ?>" /></td>
	  </tr>
	   <tr>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	  </tr>
	  <tr>
		<td><strong><?php echo $text_set_order_status; ?></strong></td>
		<td>&nbsp;</td>
	</tr>
	
	<tr>
        <td><?php echo $entry_multisafepay_order_status_id_initialized; ?></td>
        <td><select name="multisafepay_order_status_id_initialized">
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $multisafepay_order_status_id_initialized) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
          </select></td>
    </tr>
	
	<tr>
        <td><?php echo $entry_multisafepay_order_status_id_completed; ?></td>
        <td><select name="multisafepay_order_status_id_completed">
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $multisafepay_order_status_id_completed) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
          </select></td>
    </tr>
	
	<tr>
        <td><?php echo $entry_multisafepay_order_status_id_uncleared; ?></td>
        <td><select name="multisafepay_order_status_id_uncleared">
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $multisafepay_order_status_id_uncleared) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
          </select></td>
    </tr>	
	
	<tr>
        <td><?php echo $entry_multisafepay_order_status_id_reserved; ?></td>
        <td><select name="multisafepay_order_status_id_reserved">
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $multisafepay_order_status_id_reserved) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
          </select></td>
    </tr>
	
	<tr>
        <td><?php echo $entry_multisafepay_order_status_id_void; ?></td>
        <td><select name="multisafepay_order_status_id_void">
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $multisafepay_order_status_id_void) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
          </select></td>
    </tr>
	
	<tr>
        <td><?php echo $entry_multisafepay_order_status_id_refunded; ?></td>
        <td><select name="multisafepay_order_status_id_refunded">
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $multisafepay_order_status_id_refunded) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
          </select></td>
    </tr>
	
	<tr>
        <td><?php echo $entry_multisafepay_order_status_id_declined; ?></td>
        <td><select name="multisafepay_order_status_id_declined">
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $multisafepay_order_status_id_declined) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
          </select></td>
    </tr>
	
	<tr>
        <td><?php echo $entry_multisafepay_order_status_id_expired; ?></td>
        <td><select name="multisafepay_order_status_id_expired">
            <?php foreach ($order_statuses as $order_status) { ?>
            <?php if ($order_status['order_status_id'] == $multisafepay_order_status_id_expired) { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
            <?php } else { ?>
            <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
            <?php } ?>
            <?php } ?>
          </select></td>
    </tr>	
	
	<tr>
        <td width="25%"><?php echo $entry_status; ?></td>
        <td><select name="multisafepay_status">
            <option value="1" <?php if ($multisafepay_status) { echo 'selected';} ?>>Enabled</option>
            <option value="0" <?php if ($multisafepay_status == 0) { echo 'selected';} ?>>Disabled</option>
           
          </select></td>
      </tr>	  
  
      <tr>
        <td><?php echo $entry_sort_order; ?></td>
        <td><input type="text" name="multisafepay_sort_order" value="<?php echo $multisafepay_sort_order; ?>" size="1" /></td>
      </tr>
    </table>
  </div>
</form>
</div>
</div>
</div>
<?php echo $footer; ?>