Login   Register  
PHP Classes
elePHPant
Icontem

File: test_PMC_IBAN.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Markus Pfeifenberger  >  PMC_IBAN  >  test_PMC_IBAN.php  >  Download  
File: test_PMC_IBAN.php
Role: Example script
Content type: text/plain
Description: PMC_IBAN test file
Class: PMC_IBAN
Computes International Bank Account Numbers (IBAN)
Author: By
Last change:
Date: 11 years ago
Size: 2,835 bytes
 

Contents

Class file image Download
<?php
include("./PMC_IBAN.php");

$file_arr_iban "./iban.arr.php";
include(
$file_arr_iban);

foreach(
$arr as $k=>$v) {
    
$s = ( $_POST["land"]==$k ) ? " selected" ""
    
$land_option .= '<option value="'.$k.'"'.$s.'>'.$v["land"].'</option>';
}

// new class obeject
$PMC_IBAN = new PMC_IBAN($file_arr_iban);

$iban = ($_POST["kto"]!="" AND $_POST["blz"]!="" AND $_POST["land"]!="") ? 
        
$PMC_IBAN->getIBAN($_POST["kto"], $_POST["blz"], $_POST["land"], 1) : "";
        
$iban1 str_replace(" """$iban);        

if (
$iban) {
    
$validation "checksum ".($PMC_IBAN->validateIBAN($iban1) ? "<font color=\"#33CC00\">OK</font>" "<font color=\"#CC3300\">not OK</font>");
}

if (
$valiban) {
    
$ok $PMC_IBAN->validateIBAN($valiban);
    
$c $ok "iban" "nok";    
    
$result "checksum ".($ok "<font color=\"#33CC00\">OK</font>" "<font color=\"#CC3300\">not OK</font>");
    
    
$result "  <tr>".
              
"    <td>Result:</td>".
              
"    <td class=\"$c\">$result</td>".
              
"  </tr>";
}

?>
<html>
<head>
<title>PMC_IBAN generator</title>
<style type="text/css">
<!--
pre { margin-top : 0; margin-bottom: 0; }
td.iban { background-color : #CCF1C9; font-family : font-family : "Courier New", Courier, monospace; font-weight:normal;font-size : 12; }
td.nok { background-color : #F1CCC9; }
td { font-family : Verdana; font-size : 11; font-weight:bold;}
-->
</style>
</head>
<body>

<table cellpadding="5">
<form name="getIBAN" method="POST" action="?">
  <tr>
    <td>Kontonummer</td>
    <td><input type="text" name="kto" value="<?php echo $kto;?>" ></td>
  </tr>
  <tr>
    <td>Bankleitzahl</td>
    <td><input type="text" name="blz" value="<?php echo $blz;?>"></td>    
  </tr>
  <tr>
    <td>Land:</td>  
    <td><select name="land"><?php echo $land_option;?></select></td>        
  </tr>
  <tr>
    <td>&nbsp;</td>  
    <td><input type="submit" name="submit" value="generate IBAN"></td>        
  </tr>  
  <tr>
    <td>IBAN:</td>  
    <td class="iban"><pre><?php echo $iban;?></pre></td>    
  </tr>
  <tr>
    <td>&nbsp;</td>  
    <td class="iban"><pre><?php echo $iban1;?></pre></td>    
  </tr>  
  <tr>
    <td>&nbsp;</td>  
    <td >&nbsp;</td>    
  </tr>    
  <tr>
    <td>Validating IBAN:</td>  
    <td><?php echo $validation;?></td>    
  </tr>      
</form>
</table>

<br>
<hr>
<br>

<table cellpadding="5">
<form name="valIBAN" method="POST" action="?">
  <tr>
    <td>IBAN Validator:</td>  
    <td >&nbsp;</td>    
  </tr>      
  <tr>
    <td>IBAN:</td>  
    <td><input type="text" name="valiban" value="<?php echo $valiban;?>"  size="42" maxlenght="42"></td>    
  </tr>
  <tr>
    <td>&nbsp;</td>  
      <td><input type="submit" name="submit" value="validate IBAN"></td>        
  </tr>      
<?php echo $result;?>
</form>
</table>

</body>
</html>