0byt3m1n1
Path:
/
home
/
k74ns2xygros
/
www
/
globetech
/
cms
/
PaytmKit
/
[
Home
]
File: pgResponse.php
<?php session_start(); ?> <?php include 'header.php'; ?> <?php header("Pragma: no-cache"); header("Cache-Control: no-cache"); header("Expires: 0"); // following files need to be included require_once("./lib/config_paytm.php"); require_once("./lib/encdec_paytm.php"); $paytmChecksum = ""; $paramList = array(); $isValidChecksum = "FALSE"; $paramList = $_POST; $paytmChecksum = isset($_POST["CHECKSUMHASH"]) ? $_POST["CHECKSUMHASH"] : ""; //Sent by Paytm pg //Verify all parameters received from Paytm pg to your application. Like MID received from paytm pg is same as your application�s MID, TXN_AMOUNT and ORDER_ID are same as what was sent by you to Paytm PG for initiating transaction etc. $isValidChecksum = verifychecksum_e($paramList, PAYTM_MERCHANT_KEY, $paytmChecksum); //will return TRUE or FALSE string. if ($isValidChecksum == "TRUE") { // echo "<b>Checksum matched and following are the transaction details:</b>" . "<br/>"; if ($_POST["STATUS"] == "TXN_SUCCESS") { // echo "<b>Transaction status is success</b>" . "<br/>"; //Process your transaction here as success transaction. //Verify amount & order id received from Payment gateway with your application's order id and amount. // $success_msg = "Your Registration fees for Globetech Creations Pvt. Ltd. is paid successfully. Please wait for acceptence of your application and we will contact you soon."; $success_msg = "Your process is successfully completed. Please wait for acceptence of your application and we will contact you soon."; } else { // echo "<b>Transaction status is failure</b>" . "<br/>"; $failure_msg = "Thank you for registering with us. However,the transaction has been failed. Please check your credentials carefully and try again after sometime."; } $items_post = array(); if (isset($_POST) && count($_POST) > 0) { foreach ($_POST as $paramName => $paramValue) { $items_post["$paramName"] = $paramValue; // echo "<br/>" . $paramName . " = " . $paramValue; } } // print_r($items_post); $order_id = $ORDERID = $items_post['ORDERID']; $cid = substr(strrchr($order_id, "_"), 1); $MID = $items_post['MID']; $TXNID = $items_post['TXNID']; $amount = $TXNAMOUNT = $items_post['TXNAMOUNT']; $payment_mode = $PAYMENTMODE = $items_post['PAYMENTMODE']; $CURRENCY = $items_post['CURRENCY']; $TXNDATE = $items_post['TXNDATE']; $order_status = $STATUS = $items_post['STATUS']; $RESPCODE = $items_post['RESPCODE']; $RESPMSG = $items_post['RESPMSG']; $GATEWAYNAME = $items_post['GATEWAYNAME']; $BANKTXNID = $items_post['BANKTXNID']; $BANKNAME = $items_post['BANKNAME']; $trans_date = date('Y-m-d H:i:s', strtotime($TXNDATE)); // $items_response = array(); // $responseParamList = getTxnStatusNew($paramList); // if (isset($responseParamList) && count($responseParamList) > 0) { // foreach ($responseParamList as $paramName => $paramValue) { // echo $paramName . ' : ' . $paramValue; // $items_response[$paramName] = $paramValue; // } // } // print_r($items_response); // echo $items_response['TXNID']; // echo 'bankid' . $items_response['BANKTXNID']; // echo $TXNAMOUNT = 'amount' . $items_response['TXNAMOUNT']; } else { // echo "<b>Checksum mismatched.</b>"; //Process transaction as suspicious. $error_msg = "Security Error. Illegal access detected as Checksum mismatched or Process transaction as suspicious."; } ?> <style> /*--thank you pop starts here--*/ .thank-you-pop{ width:100%; padding:20px; text-align:center; } .thank-you-pop img{ width:76px; height:auto; margin:0 auto; display:block; margin-bottom:25px; } .thank-you-pop h1{ font-size: 42px; margin-bottom: 25px; color:#5C5C5C; } .thank-you-pop p{ font-size: 20px; margin-bottom: 27px; color: #5C5C5C; padding: 0% 10%; } .thank-you-pop h3.cupon-pop{ font-size: 25px; margin-bottom: 40px; color: #222; display: inline-block; text-align: center; padding: 10px 20px; border: 2px dashed #222; clear: both; font-weight: normal; } .thank-you-pop h3.cupon-pop span{ color: #03A9F4; } .thank-you-pop a{ display: inline-block; margin: 0 auto; padding: 9px 20px; color: #fff; text-transform: uppercase; font-size: 14px; background-color: #8BC34A; border-radius: 17px; } .thank-you-pop a i{ margin-right:5px; color:#fff; } #ignismyModal .modal-header{ border:0px; } /*--thank you pop ends here--*/ @media print{ #counter_span,header,nav{ display:none; } .thank-you-pop{ display:block; } } </style> <?php include '../assets/config.php'; $user = new User(); //if ($order_status === "Success" || $order_status === "Initiated") { if ($STATUS == "TXN_SUCCESS") { ?> <?php // $result = $user->view_specific_employee($cid); $result = $user->employee_details($cid); $employee = mysqli_fetch_assoc($result); //print_r($employee); $employee_name = $employee['customer_name']; $phone = $employee['phone']; ?> <div class="thank-you-pop"> <img src="../build/images/Green-Round-Tick.png" alt=""> <h1>Thank You!</h1> <p><?php echo $success_msg; ?></p> <!--<h3 class="cupon-pop">Your Reference No: <span><?php // echo $tracking_id; ?></span></h3>--> <div class="container col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2"> <div class="panel panel-info"> <div class="panel-heading">Payment done Successfully on <?php echo date("d-m-Y h:i:s", strtotime($TXNDATE)); ?>.</div> <div class="panel-body"> <table class="table" style="text-transform: uppercase;text-align: left;"> <!--shipping information(optional):--> <h4 style="text-align:center;">Payment Details</h4> <tr> <td>Employee Name </td><td>:</td><td><span><?php echo $employee_name; ?></span></td> </tr> <tr> <td>Mobile No. </td><td>:</td><td><span><?php echo $phone; ?></span></td> </tr> <tr> <td>Order Id </td><td>:</td><td><span><?php echo $order_id; ?></span></td> </tr> <!-- <tr> <td>Reference No. </td><td>:</td><td><span><?php // echo $tracking_id; ?></span></td> </tr>--> <tr> <td>Payment Mode </td><td>:</td><td><span><?php echo $payment_mode; ?></span></td> </tr> <tr> <td>Registration Fees </td><td>:</td><td><span><?php echo $amount; ?></span></td> </tr> <tr> <td>Order Status </td><td>:</td><td><span><?php echo 'SUCCESS'; ?></span></td> </tr> <tr> <td>Transaction Date </td><td>:</td><td><span><?php echo date("d-m-Y h:i:s", strtotime($TXNDATE)); ?></span></td> </tr> </table> <button type="button" onclick="window.print();" class="btn btn-success">Print</button> <span id="counter_span"> <br> Please print your payment slip otherwise you will be redirected in <span id="counter">30</span> seconds.</span> </div> </div> </div> <!--<p>You will be redirected in <span id="counter">10</span> seconds.</p>--> </div> <?php } else { ?> <!--<div class="alert alert-danger"> <strong>Oops!</strong> <?php // echo $error_msg.$failure_msg.$aborted_msg; ?> </div>--> <div class="thank-you-pop"> <img src="../build/images/red_Cross.png" alt=""> <h1>Oops!</h1> <!--<p><?php // echo $error_msg . $failure_msg . $aborted_msg; ?></p>--> <div class="container"> <div class="panel panel-danger"> <div class="panel-heading">Registration Process Failed!</div> <div class="panel-body"><?php echo $error_msg . $failure_msg; ?> <span id="counter_span"> <br> You will be redirected in <span id="counter">30</span> seconds. </span> </div> </div> </div> </div> <?php } ?> <?php //session_start(); $_SESSION['cid'] = $cid; $_SESSION["phone"] = $phone; if ($STATUS == "TXN_SUCCESS") { $sql_query = "UPDATE `employee` SET `payment_status`='Success',`payment_reference_no`='$tracking_id',`payment_order_id`='$order_id',`payment_trans_date`='$trans_date',`form_status`='complete' WHERE `cid`='$cid'"; $Data = mysqli_query($user->conn, $sql_query); $tran_sql = "INSERT INTO `employee_transaction_detail`(`emp_cid`, `amount`, `txn_id`, `order_id`, `trans_date`, `trans_status`,`txn_for`) VALUES ('$cid','$amount','$TXNID','$order_id','$trans_date','$STATUS','employee_registration')"; $trans_Data = mysqli_query($user->conn, $tran_sql); $get_emp_details = "SELECT * FROM `employee` WHERE `cid`='$cid'"; $emp_result = mysqli_query($user->conn, $get_emp_details); $employee = mysqli_fetch_assoc($emp_result); $choice_ex_id = $employee['choice_ex_id']; $electrycity_zone = $employee['electrycity_zone']; $skilled = $employee['skilled']; $work_type = $employee['work_type']; if (strcasecmp($work_type, '3') == 0) { if (strcasecmp($skilled, '2') == 0) { $total_res_emp = 'total_res_lm_skilled_emp'; //total reserved employee } else if (strcasecmp($skilled, '3') == 0) { $total_res_emp = 'total_res_lm_semiskilled_emp'; } else if (strcasecmp($skilled, '4') == 0) { $total_res_emp = 'total_res_lm_unskilled_emp'; } } else if (strcasecmp($work_type, '2') == 0) { if (strcasecmp($skilled, '2') == 0) { $total_res_emp = 'total_res_sso_skilled_emp'; } else if (strcasecmp($skilled, '3') == 0) { $total_res_emp = 'total_res_sso_semiskilled_emp'; } else if (strcasecmp($skilled, '4') == 0) { $total_res_emp = 'total_res_sso_unskilled_emp'; } } $sql_query_emp = "UPDATE employee INNER JOIN electrycity_zone ON electrycity_zone.`electrycity_zone_name` = employee.`electrycity_zone` SET employee.`entry_no_main` = electrycity_zone.total_emp_registered+electrycity_zone.$total_res_emp+1 WHERE employee.`cid`='$cid'"; $Data_emp = mysqli_query($user->conn, $sql_query_emp); $update_main_substation_emp = "UPDATE `electrycity_zone` SET `total_emp_registered`=`total_emp_registered`+1 WHERE `ex_id`='$choice_ex_id' and `electrycity_zone_name`='$electrycity_zone'"; $up_sub = mysqli_query($user->conn, $update_main_substation_emp); for ($ch = 1; $ch <= 10; $ch++) { $choice_no = 'choice_' . $ch; $entry_no = 'entry_no_' . $ch; if ($employee[$choice_no] != 0) { $ez_id = $employee[$choice_no]; $update_substation_emp = "UPDATE `electrycity_zone` SET `total_emp_registered`=`total_emp_registered`+1 WHERE `ez_id`='$ez_id'"; $up_choices = mysqli_query($user->conn, $update_substation_emp); $sql_query = "UPDATE employee INNER JOIN electrycity_zone ON electrycity_zone.`ez_id` = employee.`$choice_no` SET employee.`$entry_no` = electrycity_zone.total_emp_registered+electrycity_zone.$total_res_emp WHERE employee.`cid`='$cid'"; $Data = mysqli_query($user->conn, $sql_query); } } if ($Data) { echo "<script> setTimeout(function () { location.href='../print_after_registration.php'; }, 60000);</script>"; } } else { if ($order_status == 'TXN_FAILURE') { $trans_date = date('Y-m-d H:i:s'); } $sql_query = "UPDATE `employee` SET `payment_status`='$order_status',`payment_reference_no`='$tracking_id',`payment_order_id`='$order_id',`payment_trans_date`='$trans_date' WHERE `cid`='$cid'"; $Data = mysqli_query($user->conn, $sql_query); if ($Data) { echo "<script> setTimeout(function () { location.href='../select_zone.php?terms=on'; }, 60000);</script>"; } } ?> <?php include 'footer.php'; ?> <script> function countdown() { var i = document.getElementById('counter'); // if (parseInt(i.innerHTML)<=0) { // location.href = 'login.php'; // } i.innerHTML = parseInt(i.innerHTML) - 1; } setInterval(function () { countdown(); }, 1000); </script>