<?php
session_start();

// Merchant key here as provided by Payu
$MERCHANT_KEY = "RDTYPK"; //Please change this value with live key for production
   $hash_string = '';
// Merchant Salt as provided by Payu
$SALT = "1kDOkTO6"; //Please change this value with live salt for production

// End point - change to https://secure.payu.in for LIVE mode
$PAYU_BASE_URL = "https://secure.payu.in";

$action = '';

$posted = array();
if(!empty($_POST)) {
    //print_r($_POST);
  foreach($_POST as $key => $value) {    
    $posted[$key] = $value; 
	
  }
}

$formError = 0;
$_SESSION['amount'] = "12,980.00";
$productinfo="GRE Classroom Course";
$udf1="GRE Classroom Coaching";
$udf2="Velachery, Chennai";
$udf3="Weekends";
$udf4="Dec 8, 2018";
$udf5="9 Weekends";
$sid=session_id();
if(empty($posted['txnid'])) {
   // Generate random transaction id
    $idgen = substr(hash('sha256', mt_rand() . microtime()), 0, 5);
    $txnid = "GRECR_$idgen";  
} else {
  $txnid = $posted['txnid'];
}
$hash = '';
// Hash Sequence
$hashSequence = "key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|||||";
if(empty($posted['hash']) && sizeof($posted) > 0) {
  if(
          empty($posted['key'])
          || empty($posted['txnid'])
          || empty($posted['amount'])
          || empty($posted['firstname'])
          || empty($posted['email'])
          || empty($posted['phone'])
          || empty($posted['productinfo'])
          || empty($posted['state'])          
  ) {
    $formError = 1;
  } else {
    
	$hashVarsSeq = explode('|', $hashSequence);
 
	foreach($hashVarsSeq as $hash_var) { 
if($hash_var == "amount"){ 
     $hash_string .= isset($_SESSION['amount']) ? $posted[$hash_var] : ''; 
      $hash_string .= '|'; 
}
else{ 
     $hash_string .= isset($posted[$hash_var]) ? $posted[$hash_var] : ''; 
      $hash_string .= '|'; 
} 
    } 

    $hash_string .= $SALT;


    $hash = strtolower(hash('sha512', $hash_string));
    $action = $PAYU_BASE_URL . '/_payment';
  }
} elseif(!empty($posted['hash'])) {
  $hash = $posted['hash'];
  $action = $PAYU_BASE_URL . '/_payment';
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html dir="ltr" lang="en-US">
  <head>
  <script>
    var hash = '<?php echo $hash ?>';
    function submitPayuForm() {
      if(hash == '') {
        return;
      }
      var payuForm = document.forms.payuForm;
      payuForm.submit();
    }
  </script>
    <title>Wizako GRE Coaching Classes - Online Payment of Fees</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />    
    <link href="/css/default.css" rel="stylesheet" type="text/css">    
    <!-- Stylesheets
	============================================= -->
	<link rel="stylesheet" href="//d7kp8jhpycd2x.cloudfront.net/css/bootstrap.css" type="text/css" />
	<link rel="stylesheet" href="//d7kp8jhpycd2x.cloudfront.net/instyle.css" type="text/css" />	    
	<link rel="stylesheet" href="//d7kp8jhpycd2x.cloudfront.net/dark.css" type="text/css" />
    <link rel="stylesheet" href="//d7kp8jhpycd2x.cloudfront.net/css/animate.css" type="text/css" />	
	<link rel="stylesheet" href="//d7kp8jhpycd2x.cloudfront.net/css/responsive.css" type="text/css" />
    <link rel="stylesheet" href="//d7kp8jhpycd2x.cloudfront.net/css/colors.css" type="text/css" />
    <link rel="stylesheet" href="//d7kp8jhpycd2x.cloudfront.net/css/wizako.css" type="text/css" />
    <link rel="stylesheet" href="//d7kp8jhpycd2x.cloudfront.net/css/magnific-popup.css" type="text/css" />
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,400,400italic,600,700" type="text/css" />
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway:300,400,500,600,700" type="text/css" />
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Crete+Round:400,400italic" type="text/css" />    
    <link rel="stylesheet" href="/css/font-icons.css" type="text/css" />  
    <!-- Favicons and Apple touch icons
    ====================================== -->
    <link rel="icon" href="/favicon.png" type="image/png" sizes="16x16">
    <link rel="apple-touch-icon" href="/touch-icon-iphone.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/touch-icon-ipad.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/touch-icon-iphone-retina.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/touch-icon-ipad-retina.png">
      
    <style>
        table {
            font-family: Lato, sans-serif;
            font-size: 14px;
            border-collapse: collapse;
            width: 100%;
        }

        td, th {
            font-family: Lato, sans-serif;
            border: 1px solid #dddddd;
            font-size: 14px;
            text-align: left;
            padding: 8px;
            height: 50px;
            vertical-align: middle;
        }

        caption {
            font-size: 16px;
            font-family: Lato, sans-serif;
            color: #0bb2c5;
            text-align: left;
            padding-bottom: 10px;
            }
    </style>  
      
    <html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.24.0 (Ubuntu)</center>
</body>
</html>

    <html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.24.0 (Ubuntu)</center>
</body>
</html>


  </head>
  <body onload="submitPayuForm()" data-loader="4" data-loader-color="#92c5ef;">
    <!-- Document Wrapper
	============================================= -->
	<div id="wrapper" class="clearfix">
    <!-- header begins TO BE INSERTED -->
        
        <header id="header">

			<div id="header-wrap">

				<div class="container clearfix">

					<div id="primary-menu-trigger"><i class="icon-reorder"></i></div>

					<!-- Logo
					============================================= -->
					<div id="logo">
						<a href="//www.wizako.com" class="standard-logo" data-dark-logo="//res.wizako.com/picts/126X100_dark.png"><img src="//d7kp8jhpycd2x.cloudfront.net/picts/logo-top.png" alt="Wizako Logo"></a>
						<a href="//www.wizako.com" class="retina-logo" data-dark-logo="//res.wizako.com/picts/250X200_dark.png"><img src="//d7kp8jhpycd2x.cloudfront.net/picts/logo-top-2x.png" alt="Wizako Logo"></a>
					</div><!-- #logo end -->
                    </div>

			</div>

		</header><!-- #header end -->
        
    <!-- header ends -->
        
        <!-- Page Title
		============================================= -->
		<section id="page-title" class="page-title-parallax page-title-dark nomargin" style="background-image: url('/picts/parallax/terms-conditions3.jpg'); padding: 120px 0;" data-stellar-background-ratio="0.3">

			<div class="container clearfix nomargin">
				<h1>Review and Signup Online</h1>
				<span>Wizako's GRE&reg; Classes</span>
				<ol class="breadcrumb">
					<li><a href="/">Home</a></li>					
                    <li><a href="/gre/gre-coaching-classes-chennai.shtml">GRE Coaching Chennai</a></li>					
					<li class="active">Online Fees Payment Page</li>
				</ol>
			</div>

		</section><!-- #page-title end -->

	   <section id="content">		
                
        <div class="content-wrap">     
      
        
        <?php if($formError) { ?>
            <h2 class="nomargin" style="color:red;">Please fill all mandatory fields.</h3>
          <br/>
          <br/>
        <?php } ?>
        <form autocomplete="off" action="<?php echo $action; ?>" method="post" name="payuForm" >
          <input type="hidden" name="key" value="<?php echo $MERCHANT_KEY ?>" />
          <input type="hidden" name="hash" value="<?php echo $hash ?>"/>
          <input type="hidden" name="txnid" value="<?php echo $txnid ?>" />
          <input type="hidden" name="amount" value="<?php echo $_SESSION["amount"] ?>" />
          <input type="hidden" name="productinfo" value="<?php echo $productinfo ?>" />
          <input type="hidden" name="udf1" value="<?php echo $udf1 ?>" />
          <input type="hidden" name="udf2" value="<?php echo $udf2 ?>" />
          <input type="hidden" name="udf3" value="<?php echo $udf3 ?>" />
          <input type="hidden" name="udf4" value="<?php echo $udf4 ?>" />    
          <input type="hidden" name="udf5" value="<?php echo $udf5 ?>" />

            <input type="hidden" name="surl" value="https://classes.wizako.com/gre/PayU/response.php" />   <!--Please change this parameter value with your success page absolute url like http://mywebsite.com/response.php. -->
             <input type="hidden" name="furl" value="https://classes.wizako.com/gre/PayU/response.php" /><!--Please change this parameter value with your failure page absolute url like http://mywebsite.com/response.php. -->



            <div class="col_one_third">
                <h3 class="nomargin">Review Details</h3>
                <table id="transactiondetails">								
								<tbody>
								   <tr>
									   <td class="blu">Course</td>
									   <td><?php echo $udf1;?></td>									   
									</tr>
								   <tr>
									   <td class="blu">Center</td>
									   <td><?php echo $udf2;?></td>									   
									</tr>
                                    <tr>
									   <td class="blu">Batch Type</td>
									   <td><?php echo $udf3;?></td>									   
									</tr>
                                    <tr>
									   <td class="blu">Start Date</td>
									   <td><?php echo $udf4;?></td>									   
									</tr>
                                    <tr>
									   <td class="blu">Duration</td>
									   <td><?php echo $udf5;?></td>									   
									</tr>
                                    <tr style="background-color:#253b46;">
									   <td class="blu">Amount</td>
									   <td style="color:white;">INR <?php echo $_SESSION["amount"];?></td>
									</tr>                                    
								</tbody>
				</table>
                <h5 class="nomargin"><a href="#myModal1" data-lightbox="inline">Read Terms and Conditions</a></h5>
                By clicking submit after filling your details, you agree to the terms and conditions.
                
                <!-- Modal -->
					<div class="modal1 mfp-hide" id="myModal1">
						<div class="block divcenter" style="background-color: #FFF; max-width: 500px;">
							<div class="center" style="padding: 30px;">
								<h3>Terms and Conditions</h3>
								<ol class="numchoice nobottommargin">
                                    <li class="choice1 tc">The fees paid is inclusive of GST, cost of study material and tests provided by Wizako.</li>
                                    <li class="choice1 tc">If for some reason you choose not to take up the classroom program and you intimate us before the announced start date of the batch, you will get a 50% refund of the fees. However, NO part of the fees will be refunded once classes for a batch commence.</li>
                                    <li class="choice1 tc">Registration for the classroom program is subject to availability of seats and registration done is for a specific batch and center. Shifting between batches or centers will not be permitted.</li>
                                    <li class="choice1 tc">Should a need arise Wizako reserves the right to reschedule or cancel a class.</li>
                                    <li class="choice1 tc">When you click on the "submit" button to complete the payment process, you will be redirected to a secure payment page of PayU to complete your payment.</li>
                                    <li class="choice1 tc">You will enter all your payment details only on PayU's website. Wizako does not collect your payment details such as credit or debit card number nor does it store your payment details.</li>
                                    <li class="choice1 tc">You will be able to pay online using your credit card or debit card or the net banking facility of select Indian banks. Upon successful completion of your payment, you will be redirected to Wizako's website.</li>
                                    <li class="choice1 tc">You will receive an email from PayU  with the details of the transaction to the email id that you provided while completing the registration process. Either take a print out of the email or carry a soft copy in your mobile device when you visit Wizako's learning centre for the first session.</li>
                                    <li class="choice1 tc">Should you have any queries at any point, please send an email to <a href="mailto:learn@wizako.com">learn@wizako.com</a> or call us on <a href="tel:+919500048484">+91 9500048484</a>.</li>
                    </ol>
							</div>
							<div class="section center nomargin" style="padding: 30px;">
								<a href="#" class="button" onClick="$.magnificPopup.close();return false;">I Agree</a>
							</div>
						</div>
					</div>
            </div>

            <div class="col_two_third col_last">
						<h3 class="nomargin">Please fill the form to complete Online Registration</h3>

                            <p style="font-size:14px;" class="wiztext">Submitting the completed form will take you to PayU's secured payment gateway page. You will enter your payment details ONLY in that page. Neither does Wizako collect nor does it store your payment information.</p>


							<div class="col_one_fourth">
								<label for="register-form-name">First Name:</label>
								<input name="firstname" id="firstname" class="form-control" value="<?php echo (empty($posted['firstname'])) ? '' : $posted['firstname']; ?>" />
							</div>
                            
                            <div class="col_one_fourth">
								<label for="register-form-last">Last Name:</label>
								<input name="lastname" id="lastname" class="form-control" value="<?php echo (empty($posted['lastname'])) ? '' : $posted['lastname']; ?>" />
							</div>

							<div class="col_one_fourth">
								<label for="register-form-email">Email Address:</label>
								<input name="email" id="email" class="form-control" value="<?php echo (empty($posted['email'])) ? '' : $posted['email']; ?>" />
							</div>
                            
                            <div class="col_one_fourth col_last">
								<label for="register-form-phone">Phone:</label>
								<input name="phone" class="form-control" value="<?php echo (empty($posted['phone'])) ? '' : $posted['phone']; ?>" />
							</div>

							<div class="clear"></div>

							<div class="col_full">
								<label for="register-form-address">Address:</label>
								<input name="address1" class="form-control" value="<?php echo (empty($posted['address1'])) ? '' : $posted['address1']; ?>" />                                
							</div>							
							<div class="clear"></div>

							<div class="col_one_fourth">
								<label for="register-form-city">City:</label>
								<input name="city" class="form-control" value="<?php echo (empty($posted['city'])) ? '' : $posted['city']; ?>" />
							</div>
                            
                            <div class="col_one_fourth">
								<label for="register-form-state">State:</label>
								<input name="state" class="form-control" value="<?php echo (empty($posted['state'])) ? '' : $posted['state']; ?>" />
							</div>
                            
                            <div class="col_one_fourth">
								<label for="register-form-country">Country:</label>
								<input name="country" class="form-control" value="<?php echo (empty($posted['country'])) ? '' : $posted['country']; ?>" />
							</div>

							<div class="col_one_fourth col_last">
								<label for="register-form-pincode">Pincode:</label>
								<input name="zipcode" class="form-control" value="<?php echo (empty($posted['zipcode'])) ? '' : $posted['zipcode']; ?>" />
							</div>

							<div class="clear"></div>
                
                            <div class="col_half col_last">
                                <?php if(!$hash) { ?>
								<input type="submit" class="button button-3d button-black nomargin" value="Submit" />
                                <?php } ?>
							</div>
                            <div class="col_half">
                            </div>

					</div>
        
        </form>
        </div>
    </section>
        
    <!-- Go To Top
	============================================= -->
	<div id="gotoTop" class="icon-angle-up"></div>

    <!-- External JavaScripts
	============================================= -->
	<script type="text/javascript" src="//d7kp8jhpycd2x.cloudfront.net/js/jquery.js"></script>
	<script type="text/javascript" src="//d7kp8jhpycd2x.cloudfront.net/js/plugins.js"></script>

	<!-- Footer Scripts
	============================================= -->
	<script type="text/javascript" src="//d7kp8jhpycd2x.cloudfront.net/js/functions.js"></script>
    </div>        
  </body>
</html>
