
<?php
ob_start();
	session_start();
//Merchant key here as provided by Payu
$MERCHANT_KEY = "BqVkSpZF";
 
//Merchant Salt as provided by Payu
$SALT = "eayReArUXp";
 
//End point - change to https://secure.payu.in for LIVE mode
//$PAYU_BASE_URL = "https://test.payu.in";
$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;
 
if(empty($posted['txnid'])) {
  // Generate random transaction id
  $txnid = substr(hash('sha256', mt_rand() . microtime()), 0, 20);
} else {
  $txnid = $posted['txnid'];
}
$hash = '';
// Hash Sequence
$hashSequence = "key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|udf6|udf7|udf8";
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['surl'])
          || empty($posted['furl'])
		  || empty($posted['udf1'])
		  || empty($posted['udf2'])
		  || empty($posted['udf3'])
		  || empty($posted['udf4'])
		  || empty($posted['udf5'])
		  || empty($posted['udf6'])
		  || empty($posted['udf7'])
		  || empty($posted['udf8'])
   || empty($posted['service_provider'])
  ) {
  	
    $formError = 1;
  } else {
    //$posted['productinfo'] = json_encode(json_decode('[{"name":"tutionfee","description":"","value":"500","isRequired":"false"},{"name":"developmentfee","description":"monthly tution fee","value":"1500","isRequired":"false"}]'));
 $hashVarsSeq = explode('|', $hashSequence);
    $hash_string = ''; 
 foreach($hashVarsSeq as $hash_var) {
      $hash_string .= isset($posted[$hash_var]) ? $posted[$hash_var] : '';
      $hash_string .= '|';
    }
 
    $hash_string .= $SALT;
    
	
	 $firstname=$posted['firstname'];
	 $email=$posted['email'];
	 $phone=$posted['phone'];
	 $seatcount=$posted['udf2'];
	 $seatno=$posted['udf1'];
	 $seatlay=$posted['udf3'];
	 $busid=$posted['udf4'];
	 $trip=$posted['udf5'];
	 $totalseat=$posted['udf6'];
	 $totalamt=$posted['udf7'];
	 $availid=$posted['udf8'];
	   
	
	 $json_travels = array("$seatcount","$seatno","$seatlay","$busid","$trip","$totalseat","$totalamt","$availid","$firstname","$email","$phone");
	 $str_json = json_encode($json_travels);
	 $_SESSION['jsonbooking']=$str_json;
	
 
    $hash = strtolower(hash('sha512', $hash_string));
    $action = $PAYU_BASE_URL . '/_payment';
  }
} elseif(!empty($posted['hash'])) {
  $hash = $posted['hash'];
  
  
     $firstname=$posted['firstname'];
	 $email=$posted['email'];
	 $phone=$posted['phone'];
	 $firstname=$posted['firstname'];
	 $email=$posted['email'];
	 $phone=$posted['phone'];
	 $seatcount=$posted['udf2'];
	 $seatno=$posted['udf1'];
	 $seatlay=$posted['udf3'];
	 $busid=$posted['udf4'];
	 $trip=$posted['udf5'];
	 $totalseat=$posted['udf6'];
	 $totalamt=$posted['udf7'];
	 $availid=$posted['udf8'];
	
	 $json_travels = array("$seatcount","$seatno","$seatlay","$busid","$trip","$totalseat","$totalamt","$availid","$user","$email","$phone");
	 $str_json = json_encode($json_travels);
	 $_SESSION['jsonbooking']=$str_json;
  
  $action = $PAYU_BASE_URL . '/_payment';
}
?>
<!DOCTYPE html>
<html>

<!-- Mirrored from wp1.themexlab.com/html2/preview-human-welfare/donate.html by HTTrack Website Copier/3.x [XR&CO'2010], Sat, 29 Apr 2017 05:40:28 GMT -->
<head>
<meta charset="utf-8">
<title>Sri Srinivasa Charitable Trust</title>
<!-- Stylesheets -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<!-- Responsive -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link href="css/responsive.css" rel="stylesheet">


 <script>
    var hash = '<?php echo $hash ?>';
    function submitPayuForm() {
      if(hash == '') {
        return;
      }
      var payuForm = document.forms.payuForm;
      payuForm.submit();
    }
  </script>
</head>

<body onload="submitPayuForm()">

<div class="page-wrapper">
 	
    <!-- Preloader -->
	<!--
    <div class="preloader"></div>
 	-->
    <!-- Main Header-->
    <header class="main-header">
    	<!-- Header Top -->
    	<div class="header-top">
        	<div class="auto-container">
            	<div class="clearfix">
                    
                    <!--Top Left-->
                    <div class="top-left">
                    	<ul class="clearfix">
                        	<li><span class="icon flaticon-technology"></span>+12345 06 789</li>
                            <li><span class="icon flaticon-note"></span>mail@humanwelfare.com</li>
                        </ul>
                    </div>
                    
                    <!--Top Right-->
                    <div class="top-right">
                    
                    	<!--social-icon-->
                        <div class="social-icon">
                        	<a href="#"><span class="fa fa-facebook"></span></a>
                            <a href="#"><span class="fa fa-youtube-play"></span></a>
                            <a href="#"><span class="fa fa-linkedin"></span></a>
                            <a href="#"><span class="fa fa-instagram"></span></a>
                            <a href="#"><span class="fa fa-twitter"></span></a>
                        </div>
                        
                        
                    </div>
                    
                </div>
                
            </div>
        </div><!-- Header Top End -->
        
        
        <!-- Main Box -->
    	<div class="main-box">
        	<div class="auto-container">
            	<div class="outer-container clearfix">
                    <!--Logo Box-->
                    <div class="logo-box">
                        <div class="logo"><a href="index.html"><img src="images/logo.png" alt=""></a></div>
                    </div>
                    
                    <!--Nav Outer-->
                    <div class="nav-outer clearfix">
                        <!-- Main Menu -->
                        <nav class="main-menu">
                            <div class="navbar-header">
                                <!-- Toggle Button -->    	
                                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                </button>
                            </div>
                            
                            <div class="navbar-collapse collapse clearfix">
                                 <ul class="navigation clearfix">
                                    <li class="current dropdown"><a href="index.html">Home</a></li>
                                    <li class="dropdown"><a href="#">About Us</a>
                                    	<ul>
                                            <li><a href="about-us.html">About Us</a></li>
                                            <li><a href="our-team.html">Our Team</a></li>
                                        </ul>
                                    </li>
                                  
                                    <li class="dropdown"><a href="#">Pages</a>
                                    	<ul>
                                            <li><a href="donate.html">Donate Now</a></li>
                                            <li><a href="volunteer.html">Volunteer</a></li>
                                        </ul>
                                    </li>
                                    <li><a href="gallery.html">Gallery</a></li>
                                    
                                    <li><a href="contact.html">Contact</a></li>
                                    
                                 </ul>
                            </div>
                        </nav><!-- Main Menu End-->
                        
                    </div><!--Nav Outer End-->
                    
                    <!-- Hidden Nav Toggler -->
                    <div class="nav-toggler">
                    <button class="hidden-bar-opener"><span class="icon fa fa-bars"></span></button>
                    </div><!-- / Hidden Nav Toggler -->
                    
            	</div>    
            </div>
        </div>
    
    </header>
    <!--End Main Header -->
    
    
    <!-- Hidden Navigation Bar -->
    <section class="hidden-bar right-align">
        
        <div class="hidden-bar-closer">
            <button class="btn"><i class="fa fa-close"></i></button>
        </div>
        
        <!-- Hidden Bar Wrapper -->
        <div class="hidden-bar-wrapper">
        
            <!-- .logo -->
            <div class="logo text-center">
                <a href="index-2.html"><img src="images/logo-2.png" alt=""></a>			
            </div><!-- /.logo -->
            
            <!-- .Side-menu -->
            <div class="side-menu">
            <!-- .navigation -->
                <ul class="navigation">
                    <li class="dropdown"><a href="#">Home</a>
                        <ul>
                            <li><a href="index-2.html">Homepage One</a></li>
                            <li><a href="index-3.html">Homepage Two</a></li>
                        </ul>
                    </li>
                    <li class="dropdown"><a href="#">About Us</a>
                        <ul>
                            <li><a href="about-us.html">About Us</a></li>
                            <li><a href="our-team.html">Our Team</a></li>
                        </ul>
                    </li>
                    <li class="dropdown"><a href="#">Causes</a>
                        <ul>
                            <li><a href="causes.html">Our Causes</a></li>
                            <li><a href="single-cause.html">Single Cause</a></li>
                        </ul>
                    </li>
                    <li class="dropdown"><a href="#">Events</a>
                        <ul>
                            <li><a href="events.html">Our Events</a></li>
                            <li><a href="single-event.html">Event Details</a></li>
                        </ul>
                    </li>
                    <li class="current dropdown"><a href="#">Pages</a>
                        <ul>
                            <li><a href="donate.html">Donate Now</a></li>
                            <li><a href="volunteer.html">Volunteer</a></li>
                            <li><a href="faqs.html">FAQs</a></li>
                            <li><a href="error-page.html">404 Page</a></li>
                        </ul>
                    </li>
                    <li><a href="gallery.html">Gallery</a></li>
                    <li class="dropdown"><a href="#">Shop</a>
                        <ul>
                            <li><a href="shop.html">Our Shop</a></li>
                            <li><a href="shop-single.html">Shop Single</a></li>
                            <li><a href="shopping-cart.html">Shopping Cart</a></li>
                        </ul>
                    </li>
                    <li class="dropdown"><a href="#">Blog</a>
                        <ul>
                            <li><a href="blog.html">Our Blog</a></li>
                            <li><a href="blog-single.html">Blog Single</a></li>
                        </ul>
                    </li>
                    <li><a href="contact.html">Contact</a></li>
                </ul>
            </div><!-- /.Side-menu -->
        
            <div class="social-icons">
                <ul>
                    <li><a href="#"><i class="fa fa-facebook"></i></a></li>
                    <li><a href="#"><i class="fa fa-twitter"></i></a></li>
                    <li><a href="#"><i class="fa fa-google-plus"></i></a></li>
                    <li><a href="#"><i class="fa fa-linkedin"></i></a></li>
                </ul>
            </div>
        
        </div><!-- / Hidden Bar Wrapper -->
    </section>
    <!-- / Hidden Bar -->
    
    <!--Page Title-->
	<!--
	style="background-image:url(images/background/bg-page-title-1.jpg);"
	-->
    <section class="page-title" >
        <div class="auto-container">
            <h1>Donate Now</h1>
            <div class="bread-crumb-outer">
                <ul class="bread-crumb clearfix">
                    <li><a href="index-2.html">Home</a></li>
                    <li><a href="#">Pages</a></li>
                    <li class="active">Donation</li>
                </ul>
            </div>
        </div>
    </section>
    
    
    <!--Donate Section-->
    <section class="donate-now">
    	<div class="auto-container">
        	<div class="default-form">
                <form 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="service_provider" value="payu_paisa" size="64" />
								  <input type="hidden" name="surl" value="<?php echo (empty($posted['surl'])) ? 'http://localhost/trust/success.php' : $posted['surl'] ?>" size="64" />
								  <input type="hidden" name="furl" value="<?php echo (empty($posted['furl'])) ? 'http://localhost/trust/failure.php' : $posted['furl'] ?>" size="64" />
								  <input type="hidden" name="curl" value="<input name="furl" value="http://localhost/trust/failure.php" size="64"  />
								   <input type="hidden" name="productinfo" value="<?php echo (empty($posted['productinfo'])) ? 'Sri Srinivasa Capitable Trust' : $posted['productinfo'] ?>" />
                    <div class="row clearfix">
                        
                        <!--Left Column-->
                        <div class="left-column col-md-6 col-sm-12 col-xs-12">
                            <div class="default-title"><h3>DONATION DETAILS</h3></div>
                            <div class="row clearfix">
                            
                                <div class="form-group col-md-12 col-sm-12 col-xs-12">
                                    <div class="field-label">How much would you like to donate?</div>
                                    <div class="select-amount clearfix">
                                        
                                        <div class="input-box"><input type="text" name="amount" value="<?php echo (empty($posted['amount'])) ? '' : $posted['amount'] ?>" placeholder="Enter Your Amount"></div>
                                    </div>
                                </div>
                            
                                <div class="form-group col-md-12 col-sm-12 col-xs-12">
                                    <div class="field-label">Would you like to make a regular donation?</div>
                                    <select name="how-many-times">
                                        <option>One Time</option>
                                        <option>Two Times</option>
                                        <option>Three Times</option>
                                        <option>Four Times</option>
                                        <option>Five Times</option>
                                    </select>
                                </div>
                                
                                
                                
                            </div>
                            
                        </div>
                        
                        <!--Right Column-->
                        <div class="right-column col-md-6 col-sm-12 col-xs-12">
                            <div class="default-title"><h3>DONOR DETAILS</h3></div>
                            <div class="row clearfix">
                            
                                <div class="form-group col-md-6 col-sm-6 col-xs-12">
                                    <div class="field-label">First Name *</div>
                                    <input type="text" name="firstname" id="firstname" value="<?php echo (empty($posted['firstname'])) ? '' : $posted['firstname']; ?>" placeholder="" required>
                                </div>
                               
                                
                                <div class="form-group col-md-6 col-sm-6 col-xs-12">
                                    <div class="field-label">Email *</div>
                                    <input type="email" name="email" id="email" value="<?php echo (empty($posted['email'])) ? '' : $posted['email']; ?>" placeholder="" required>
                                </div>
                                
                                <div class="form-group col-md-6 col-sm-6 col-xs-12">
                                    <div class="field-label">Phone</div>
                                    <input type="text" name="phone" id="phone"  value="<?php echo (empty($posted['phone'])) ? '' : $posted['phone']; ?>" value="" placeholder="">
                                </div>
                                
                                <div class="form-group col-md-12 col-sm-12 col-xs-12">
                                    <div class="field-label">Address</div>
                                    <textarea name="udf1" placeholder=""><?php echo (empty($posted['udf1'])) ? '' : $posted['udf1'] ?></textarea>
                                </div>
                                <input type="hidden" name="udf2" value="<?php echo (empty($posted['udf2'])) ? 'sdf' : $posted['udf2'] ?>" />
				<input type="hidden" name="udf3" value="<?php echo (empty($posted['udf3'])) ? 'sdf' : $posted['udf3'] ?>" />
				<input type="hidden" name="udf4" value="<?php echo (empty($posted['udf4'])) ? 'sdf' : $posted['udf4'] ?>" />
				<input type="hidden" name="udf5" value="<?php echo (empty($posted['udf5'])) ? 'sdf' : $posted['udf5'] ?>" />
				<input type="hidden" name="udf6" value="<?php echo (empty($posted['udf6'])) ? 'sdf' : $posted['udf6'] ?>" />
				<input type="hidden" name="udf7" value="<?php echo (empty($posted['udf7'])) ? 'sdf' : $posted['udf7'] ?>" />
				<input type="hidden" name="udf8" value="<?php echo (empty($posted['udf8'])) ? 'sdf' : $posted['udf8'] ?>" /> 
				<?php if(!$hash) { ?>
                                <div class="form-group col-md-12 col-sm-12 col-xs-12">
                                   <input type="submit" class="theme-btn btn-style-three"></input>
                                </div>
								 <?php } ?>
                                
                            </div>
                            
                        </div>
                         
                    </div>
                </form>
                
            </div>
        </div>
    </section>
    
    
    
    
    <!--Main Footer-->
    <footer class="main-footer">
    	<div class="auto-container">
        
            <!--Widgets Section-->
            <div class="widgets-section">
            	<div class="row clearfix">
                	<!--Big Column-->
                	<div class="big-column col-md-6 col-sm-12 col-xs-12">
                    	<div class="row clearfix">
                            
                            <!--Footer Column-->
                        	<div class="footer-column col-md-6 col-sm-6 col-xs-12">
                            	<div class="footer-widget about-widget">
                                	<div class="footer-logo"><figure><a href="index-2.html"><img src="images/logo-3.png" alt=""></a></figure></div>
                                    <div class="widget-content">
                                    	<div class="text">
                                        	<p>Capitalise on low hanging fruit to identify a ballpark value added activity to beta test. Override lickthroughs from DevOps.</p>
                                            <a href="#" class="more-link">Read More <span class="fa fa-angle-double-right"></span></a>
                                        </div>
                                        
                                        <div class="social-links">
                                        	<a href="#"><span class="fa fa-facebook-f"></span></a>
                                            <a href="#"><span class="fa fa-twitter"></span></a>
                                            <a href="#"><span class="fa fa-linkedin"></span></a>
                                            <a href="#"><span class="fa fa-google-plus"></span></a>
                                            <a href="#"><span class="fa fa-skype"></span></a>
                                        </div>
                                        
                                    </div>
                                </div>
                            </div>
                            
                            <!--Footer Column-->
                        	<div class="footer-column col-md-6 col-sm-6 col-xs-12">
                            	<div class="footer-widget links-widget">
                                	<h2>Our Projects</h2>
                                    <div class="widget-content">
                                        <ul class="list">
                                            <li><a href="#">Water Surve</a></li>
                                            <li><a href="#">Education for all</a></li>
                                            <li><a href="#">Treatment</a></li>
                                            <li><a href="#">Food Serving</a></li>
                                            <li><a href="#">Cloth</a></li>
                                            <li><a href="#">Selter Project</a></li>
                                            <li><a href="#">Help Orphan</a></li>
                                        </ul>
                                    </div>
                                </div>
                                
                            </div>
                            
                        </div>
                    </div>
                    
                    <!--Big Column-->
                	<div class="big-column col-md-6 col-sm-12 col-xs-12">
                    	<div class="row clearfix">
                            
                            <!--Footer Column-->
                        	<div class="footer-column col-md-6 col-sm-6 col-xs-12">
                            	<div class="footer-widget posts-widget">
                                	<h2>Latest News</h2>
                                    <div class="widget-content">
                                    	<div class="posts">
                                            <div class="post">
                                                <figure class="post-thumb"><img src="images/resource/post-thumb-1.jpg" alt=""><a href="#" class="overlay-link"><span class="fa fa-link"></span></a></figure>
                                                <div class="desc-text"><a href="#">Education for all childrens</a></div>
                                                <div class="time">May 25, 2016</div>
                                            </div>
                                            <div class="post">
                                                <figure class="post-thumb"><img src="images/resource/post-thumb-2.jpg" alt=""><a href="#" class="overlay-link"><span class="fa fa-link"></span></a></figure>
                                                <div class="desc-text"><a href="#">Homes for homeless peoples</a></div>
                                                <div class="time">May 25, 2016</div>
                                            </div>
                                            <div class="post">
                                                <figure class="post-thumb"><img src="images/resource/post-thumb-3.jpg" alt=""><a href="#" class="overlay-link"><span class="fa fa-link"></span></a></figure>
                                                <div class="desc-text"><a href="#">Foods for childrens</a></div>
                                                <div class="time">May 25, 2016</div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <!--Footer Column-->
                        	<div class="footer-column col-md-6 col-sm-6 col-xs-12">
                            	<div class="footer-widget contact-widget">
                                	<h2>Contact Us</h2>
                                    <div class="widget-content">
                                    	<ul class="contact-info">
                                            <li>P6 12th Street, Olive Building <br>Newyork, USA</li>
                                            <li>+1 123 456 7890</li>
                                        	<li>mail@humanwelfare.com </li>
                                        </ul>
                                        
                                    	<!--Newsletter One-->
                                        <div class="newsletter-one">
                                        	<h4>Subscribe to our newsletter</h4>
                                            <form method="post" action="http://wp1.themexlab.com/html2/preview-human-welfare/contact.html">
                                                <div class="form-group">
                                                    <input type="email" name="email" value="" required placeholder="Your Email">
                                                    <button type="submit" class="theme-btn"><span class="fa fa-paper-plane"></span></button>
                                                </div>
                                            </form>
                                        </div>
                                    
                                    </div>
                                </div>
                                
                            </div>
                            
                        </div>
                    </div>
                    
                 </div>
             </div>
        
        </div>
        
        <!--Footer Bottom-->
         <div class="footer-bottom">
         	<div class="auto-container">
            	<div class="copyright-text">Copyright &copy; 2016. All Rights Reserved Human Welfare</div>
            </div>
        </div>
    </footer>
    
</div>
<!--End pagewrapper-->

<!--Scroll to top-->
<div class="scroll-to-top scroll-to-target" data-target="html"><span class="fa fa-long-arrow-up"></span></div>


<script src="js/jquery.js"></script> 
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="js/jquery.fancybox.pack.js"></script>
<script src="js/jquery.fancybox-media.js"></script>
<script src="js/wow.js"></script>
<script src="js/script.js"></script>
</body>

<!-- Mirrored from wp1.themexlab.com/html2/preview-human-welfare/donate.html by HTTrack Website Copier/3.x [XR&CO'2010], Sat, 29 Apr 2017 05:40:28 GMT -->
</html>