File: /home/kochikidswysewor/public_html/wp-content/themes/children-charity-child/single-children.php
<?php
/**
* @package WordPress
* @subpackage Children Charity
* @version 1.0.7
*
* Default Page Template
* Created by CMSMasters
*
*/
get_header();
list($cmsmasters_layout) = children_charity_theme_page_layout_scheme();
$_SESSION['child_id'] = get_the_ID();?>
<section class="ourChildrenInnr">
<div class="container">
<!-- <header class="title hrd">OPEN YOUR HEART & HOME<span>There is no such things as other
people’s children!</span></header> -->
<?php $ID = get_the_ID();
$image = get_the_post_thumbnail($ID,'child_image_cr');
$categories = get_the_terms( $ID, 'children_categories' );
$cat_name = $categories[0]->name;
$title = get_the_title(); ?>
<div class="row">
<div class="col-lg-8">
<div class="leftCnt">
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php
$userType = wp_get_current_user();
if($userType->roles[0] != 'agent') {
if ( is_user_logged_in() ) {
?>
<div class="p_t_20">
<a href="<?php echo get_permalink( 16892 ); ?>"><button type="submit" name="sponsersubmit" id="sponsersubmit" class="sponsorbutton" value="Sponsor">Contribute</button></a>
</div>
<?php
}else{
?>
<!-- <a data-toggle="modal" data-target="#donate-for-child"><button type="submit" name="sponsersubmit" id="sponsersubmit" class="sponsorbutton" value="Sponsor">Contribute</button></a> -->
<div class="p_t_20">
<a data-target="donate-for-child" data-title="Contribute"><button type="submit" name="sponsersubmit" id="sponsersubmit" class="sponsorbutton" value="Sponsor">Contribute</button></a>
</div>
<?php
}
}?>
<!--<form name="sponser_submit" id="sponser_submit" method="POST" action="<?php// bloginfo('wpurl')?>/<?php// echo $action_url; ?>">
<input type="hidden" name="child_id" value="<?php// echo get_the_ID();?>">
<input type="submit" name="sponsersubmit" id="sponsersubmit" class="sponsorbutton" value="Sponsor">
</form>-->
</div>
<?php
if ( !is_user_logged_in() ) { ?>
<!-- <div class="modal fade" id="donate-for-child" tabindex="-1" role="dialog"
aria-labelledby="coocking-instructionsLabel" aria-hidden="true" style="display:none";> -->
<section class="tw-modal-wrapper vhCenter modal-md myPopupOpen" id="donate-for-child">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="tw-modal-container">
<!-- <div class="modal-header">
<h5 class="modal-title" id="coocking-instructionsLabel">Contribute</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div> -->
<header class="heading_wrapper vCenter">
<header class="tw-modal-header" id="coocking-instructionsLabel">Contribute</header>
<button type="button" class="tw-modal-close-button">X</button>
</header>
<div class="tw-modal-body">
<div class="form-group" style="margin:13px auto 0">
<a href="<?php echo get_permalink( 16892 ); ?>"><button type="submit" name="sponsersubmit" id="sponsersubmit" class="sponsorbutton" value="Sponsor">Continue as Guest</button></a>
<a href="<?php echo get_permalink( 17560 ); ?>"><button type="submit" name="sponsersubmit" id="sponser-submit" class="sponsorbutton" value="Sponsor">Login To Proceed</button></a>
</div>
</div>
<!-- <div class="modal-footer">
</div> -->
</div>
</div>
</section>
<?php } ?>
</div>
<!-- <div class="col-lg-8">
<div class="leftCnt">
<h1><?php// the_title(); ?></h1>
<?php// the_content(); ?>
<?php //if ( is_user_logged_in() ) {
// $action_url ='sponsor';
//}else{
// $action_url ='donate-confirmation';
// } ?>
<form name="sponser_submit" id="sponser_submit" method="POST" action="<?php// bloginfo('wpurl')?>/<?php // echo $action_url; ?>">
<input type="hidden" name="child_id" value="<?php// echo get_the_ID();?>">
<input type="submit" name="sponsersubmit" id="sponsersubmit" class="sponsorbutton" value="Sponsor">
</form>
</div>
</div>-->
<div class="col-lg-4">
<div class="rightCnt">
<?php
if ( has_post_thumbnail() ) {
?>
<figure class="kidImg"><?php the_post_thumbnail(); ?></figure>
<?php }else{?>
<figure class="kidImg"><img src="<?php bloginfo("stylesheet_directory"); ?>/img/default.jpg"></figure>
<?php } ?>
<table>
<thead><tr><th colspan="2">Details</th></tr></thead>
<tbody>
<!-- <tr>
<td class="lft">Age</td>
<td class="rgt"><?php// the_field('age'); ?> years</td>
</tr> -->
<!-- <tr>
<td class="lft">Birthday</td>
<td class="rgt"><?php// the_field('birthday'); ?></td>
</tr> -->
<tr>
<td class="lft">Cause</td>
<td class="rgt"><?php echo $cat_name; ?></td>
</tr>
<tr>
<td class="lft">Posted Date</td>
<td class="rgt"><?php the_field('date'); ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<script>
jQuery('#sponserbutton').click(function(){
document.getElementById("sponser_submit").submit();
});
jQuery(document).on("click",".btnpay",function(){
var baccount = jQuery(".baccount").val();
var ifsc = jQuery(".ifsc").val();
var amount = jQuery(".amount").val();
var date = jQuery(".date").val();
var purpose = jQuery(".purpose").val();
jQuery.ajax({ type: 'POST',
url: "<?php echo bloginfo('stylesheet_directory'); ?>/pay_now.php",
data: {baccount:baccount,ifsc:ifsc,amount:amount,date:date,purpose:purpose},
// async: true,
// cache: false,
success : function(data){
}
});
});
jQuery("#sponser-submit").click(
function() {
// must stringify the object before save
createCookie("child_id",'<?php echo $ID;?>',1);
localStorage.setItem('login_clicked', 1);
}
);
</script>
<?php get_footer();