File: /home/kochikidswysewor/www/wp-content/themes/children-charity-child/page-thank-you.php
<?php
/**
* @package WordPress
* @subpackage Children Charity
* @version 1.0.7
*
* Default Page Template
* Created by CMSMasters
*
*/
get_header();
if(isset($_GET['pay'])) {
$msg = "<h1>Thank You<span>For the donation. Transaction details are send to your email.</span></h1><a href='".get_bloginfo('wpurl')."' class='btn sponsorbutton' role='button'><span>BACK TO HOME</span></a>";
$dash = '<div class="thank_a"><a href="'.get_bloginfo('wpurl').'>/user-dashboard/">Click here to view all the sponsored children </a></div>';
}
else {
$msg = "<h1>Thank You<span>For Contacting Us! We’ll Be In Touch Shortly.</span></h1><a href='javascript:history.go(-1)'' class='btn sponsorbutton' role='button'><span>BACK</span></a>";
$dash= "";
}
list($cmsmasters_layout) = children_charity_theme_page_layout_scheme();?>
<section class="thankYou">
<div class="container">
<div class="thnz">
<?php echo $msg; ?>
</div>
<?php if($dash!=""){
echo $dash;
} ?>
</div>
</section>
<?php header("HTTP/1.1 200 OK");
// $header = "";
// $emailtext = "";
// $raw_post_data = file_get_contents('php://input');
// $raw_post_array = explode('&', $raw_post_data);
// $resp = 'cmd=_notify-validate';
// foreach ($raw_post_array as $param => $var)
// {
// $var = urlencode(stripslashes($var));
// $resp .= "&$param=$var";
// }
// mail('josmijose.techintl@gmail.com', 'PAYPAL', json_encode($resp));
// mail('josmijose.techintl@gmail.com', 'payment_status', $_REQUEST['payment_status']);
// mail('josmijose.techintl@gmail.com', 'sponsor datass', json_encode($_REQUEST));
// $payment_status = $_REQUEST['payment_status'];
// if($payment_status=="Completed"){
// $custom_data = $_REQUEST['custom'];
// $array_custom = explode(":", $custom_data);
// $amount = $_REQUEST['mc_gross'];
// $sponsor_content = $array_custom[0];
// $child_id = $array_custom[1];
// $user_name = $array_custom[2];
// $user_id = $array_custom[3];
// $user_email = $array_custom[4];
// $transaction_id = $_REQUEST['txn_id'];
// $sponser_array = array();
// $sponsor_html ="";
// mail('josmijose.techintl@gmail.com', 'array_custom', json_encode($array_custom));
// mail('josmijose.techintl@gmail.com', 'sponsor email', $_POST['txn_id']);
// $sponsor_html.='
// <div style="width:400px;">
// <img src="http://kochikids.org/wp-content/uploads/2019/12/Kochi-Kids.jpg" alt="Kochi Kids" style="width:100px; margin:0 auto 10px; display:block">
// <div style="width:400px;color:#fff; font-family:Arial, Helvetica, sans-serif; font-size: 15px; font-weight:normal; text-align: center; background: #362740; padding: 5px; margin: auto; line-height: 1;">Ph: 00000 0000</div>
// <h1 style="color:#333; font-family:Arial, Helvetica, sans-serif; font-size: 20px; font-weight:bold;" >Hi '. $user_name.',</h1>
// <p>Thank you for sponsoring a child.</p>
// <h6 style="color:#cd366b; font-family:Arial, Helvetica, sans-serif; font-size: 16px; font-weight:bold; padding: 10px; padding-left: 0; margin-top: 0; margin-bottom: 0;">Transaction ID: '.$transaction_id.'</h6>
// <table style="width:400px; border: 1px solid rgb(216, 216, 216); padding: 0;border-collapse: separate;
// border-spacing:0px;">
// <tbody>
// <tr>
// <td style="border-right:1px solid rgb(216, 216, 216); border-bottom: 1px solid rgb(216, 216, 216); color:#333; font-family:Arial, Helvetica, sans-serif; font-size: 14px; font-weight:bold; padding: 10px;" colspan="0">Name </td>
// <td style="color:#333; font-family:Arial, Helvetica, sans-serif; font-size: 14px; font-weight:normal; border-bottom: 1px solid rgb(216, 216, 216); padding: 10px;">'.get_the_title($child_id).'</td>
// </tr>
// <tr>
// <td style="border-right:1px solid rgb(216, 216, 216);color:#333; font-family:Arial, Helvetica, sans-serif; font-size: 14px; font-weight:bold; padding: 10px;">Sponsored Amount </td>
// <td style="color:#333; font-family:Arial, Helvetica, sans-serif; font-size: 14px; font-weight:normal; padding: 10px;">'. $amount.'</td>
// </tr>
// </tbody>
// </table>
// </div>';
// $email = $user_email;
// $admin_email = get_option('admin_email');
// $subject = "Invoice from Kochi Kids";
// $headers = "MIME-Version: 1.0\r\n";
// $headers.="Content-Type: text/html;\n\tcharset=\"iso-8859-1\"\n";
// $headers.= "From: Kochi Kids <".$admin_email."> \r\n";
// mail($email,$subject,$sponsor_html,$headers);
// if($child_id!=""){
// if(have_rows('sponsor_user_details',$child_id)):
// while(have_rows('sponsor_user_details',$child_id)): the_row();
// $sponser_array[] = get_sub_field('sponsors_',$child_id);
// endwhile;
// endif;
// if (!in_array($user_id, $sponser_array)){
// if ( ! add_post_meta( $child_id, 'sponsors_', $user_id, true ) ) {
// update_post_meta ( $child_id, 'sponsors_', $user_id );
// $row = array(
// 'sponsor_name' => $user_name,
// 'sponsors_' => $user_id,
// 'sponser_amount' => $amount,
// 'sponsor_description' => $sponsor_content,
// 'transaction_id' => $transaction_id,
// );
// add_row('sponsor_user_details', $row , $child_id);
// update_row('sponsor_user_details', $row , $child_id);
// update_row('sponsor_user_details', 2 ,$row, $child_id);
// }
// }
// }
?>
<?php
// }
?>
<?php get_footer();