File: /home/barbeatleanalyti/public_html/manage.beatleanalytics.com/site/template/offerprocess.php
<!--<link rel="stylesheet" type="text/css" href="theme/black/css/tm_editable.css">
<link rel="stylesheet" type="text/css" href="theme/black/css/tm_validator.css">
<link rel="stylesheet" type="text/css" href="theme/black/css/profile.css">
<link rel="stylesheet" type="text/css" href="theme/black/css/round-button-theme.css">
-->
<link href="http://fontawesome.io/assets/font-awesome/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="theme/black/css/profile.css">
<!--<link rel="stylesheet" href="profile.css"> -->
<?php
// Declare new object
$objProfile = object;
// Assing object
$objProfile = $objDB->objController;
// Assign all variable's value
$pg = $objProfile->pg;
$acn = $objProfile->acn;
$v = $objProfile->v;
$error = $objProfile->error;
$msg = $objProfile->msg;
$login = $objProfile->login;
$profileimage = $objProfile->profileimage;
$proid = $objProfile->proid;
?>
<style>
.head-line{
margin-top:2px !important;
margin-bottom:2px !important;
}
</style>
<?php if($v == 'list') {
$SQL = "SELECT beatle_userlogin.* FROM beatle_userlogin WHERE beatle_userlogin.UserID = ".$_SESSION['UserInfo']['UserID'];
$rsUserInfo = $objDB->sql_query($SQL);
if(!empty($proid)) {
$rsProducts = $objProfile->fetchOfferInfo($proid);
$dt = date('Y-m-d H:i:s');
$SQL = "SELECT * FROM beatle_offers_apply WHERE offerid = ".$proid." AND approved = 'N' AND userid = ".$_SESSION['UserInfo']['UserID']." AND added_date <= '".$dt."' AND expire_time >= '".$dt."'";
$rsOfferApplied = $objDB->sql_query($SQL);
$inTime = 'N';
if(count($rsOfferApplied) > 0){
$datetime = strtotime(date("Y-m-d H:i:s"));
$style = 'filter:grayscale(80%) blur(1px);';
if((int)strtotime($rsOfferApplied[0]['added_date']) <= (int)$datetime && (int)strtotime($rsOfferApplied[0]['expire_time']) >= (int)$datetime){
$inTime = 'Y';
}
}
if($inTime == 'Y') { ?>
<style>
.error-page{
width:100% !important;
text-align:center;
margin:200px auto 0 auto;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<!-- Main content -->
<section class="content">
<div class="error-page">
<div class="error-content">
<h1><b>THANK YOU ! for you applied offer of the day </b></h1>
<h2>Please show the following token number to counter for the verification.</h2>
<h2><b>TOKEN NUMBER<br /><?php echo $rsOfferApplied[0]['tokenid']; ?> </b></h2>
<h3>Token expiration time <br /><span id="time"></span> minutes!</h3>
<script>
//alert('<?php echo date("m-d-Y H:i:s",strtotime($rsOfferApplied[0]['expire_time']))." ".$rsOfferApplied[0]['added_date']?>');
// Set the date we're counting down to
var countDownDate = new Date('<?php echo date("m-d-Y H:i:s",strtotime($rsOfferApplied[0]['expire_time']))?>').getTime();
// Update the count down every 1 second
var x = setInterval(function() {
// Get todays date and time
//var now = new Date().getTime();
var now = new Date().getTime();
//var now = <?php echo strtotime(date('Y-m-d H:i:s'))?>;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var now = this.responseText;
}
};
xhttp.open("GET", "runajax.php/fetchcurrenttime", true);
xhttp.send();
//alert(now);
// Find the distance between now an the count down date
var distance = countDownDate - now;
//alert(distance);
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Output the result in an element with id="demo"
document.getElementById("time").innerHTML = hours + "h "+ minutes + "m " + seconds + "s ";
// If the count down is over, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById("time-display").innerHTML = '<p><strong>Oops..</strong></p><p><strong>Your token number has been expired</strong></p><p>Please tap on following button and complete the process again to generate a new token number</p>';
}
}, 1000);
</script>
</div>
<!-- /.error-content -->
</div>
<!-- /.error-page -->
</section>
<!-- /.content -->
</div>
<?php }else{ ?>
<div class="content-wrapper">
<section class="content-header">
<h1>
<?php if(strtolower($v) == 'list') { ?> Offer details.
<?php }?>
</h1>
</section>
<div class="col-md-12">
<?php
// Error or success message display
$objDB->NotificaitonForResult($msg,$error);
?>
</div>
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="box box-primary" style="border:none; border-top:2px solid #3c8dbc; height: 843px;">
<div class="box-header">
<div class="orderprocess" >
<!--<div class = "full_row"> -->
<div class="row">
<div class="col-md-12">
<div class="col-md-12 products-name">
<span class="filed-left"><i class="fa fa-envelope-open" aria-hidden="true"></i> <strong>REDEEM POINTS :</strong>
</span>
<span class="filed-right">
<strong> <?php echo $rsProducts[0]['points']; ?></strong>
</span>
</div>
<div class="col-md-2"></div>
</div>
</div><br />
<form name="frmSettings" id="frmSettings" method="post" action="manage.php?pg=offerprocess&acn=setOrderData" enctype="multipart/form-data" >
<input type="hidden" name="offerid" id="offerid" value="<?php echo $rsProducts[0]['offerid']?>" />
<input type="hidden" name="orgid" id="orgid" value="<?php echo $rsProducts[0]['orgid']?>" />
<div class="row">
<div class="col-md-4">
<div class="offer-banner">
<img src="<?php echo OFFER_BANNER_ROOT.$rsProducts[0]['offer_image']?>">
</div>
</div>
<div class="col-md-8 products-details">
<div class="col-md-12 orderprocess-right profile-id no-padding">
<div class="products-redeem pill-left">
<span class="filed-left"><i class="fa fa-id-badge" aria-hidden="true"></i> Profile id :</span>
<span class="filed-right">
<?php if(!empty($rsUserInfo[0]['db_userLoginName'])) {
echo "# ".$rsUserInfo[0]['db_userLoginName']; ?>
<?php }else { ?>
<input name="username" id="username" class="form-control input-md" onkeyup="javascript: return validateAddress(this.value)" <?php if(!empty($rsUserInfo[0]['db_userLoginName'])) echo 'disabled="disabled"'; ?> value="<?php echo $rsUserInfo[0]['db_userLoginName']; ?>" type="button">
<?php } ?>
</span>
</div>
<div class="products-redeem email-id pill-right">
<span class="filed-left"><i class="fa fa-id-badge" aria-hidden="true"></i> Email id :</span>
<span class="filed-right">
<?php echo $rsUserInfo[0]['db_email']; ?>
<!---
<input name="email_" id="email_" disabled="disabled" class="form-control input-md"type="text" value="<?php echo $rsUserInfo[0]['db_email']; ?>" >
<input name="email" id="email" type="hidden" value="<?php echo $rsUserInfo[0]['db_email']; ?>" >
---->
</span>
</div>
</div>
<div class="card-info">
<?php
$SQL = "SELECT db_Orgname FROM beatle_organization WHERE OrgId = ".$rsProducts[0]['orgid'];
$rsOwnerInfo = $objDB->sql_query($SQL);
?>
<div class="validity"> <strong>Organization Name : </strong> <span> <?php echo $rsOwnerInfo[0]['db_Orgname'];?></span> </div>
<div class="validity"> <strong>Industry Name : </strong> <span> -</span> </div>
<div class="validity"> <strong>Branch Name : </strong> <span> - </span></div>
<div class="validity"> <strong>Offer Validity : </strong> <span> <?php echo date("d/m/Y H:i A",strtotime($rsProducts[0]['startdate'])). " to ".date("d/m/Y H:i A",strtotime($rsProducts[0]['enddate'])) ; ?> </span></div>
<div class="validity"> <strong>Point require : </strong><span><?php echo $rsProducts[0]['epoint'];?> </span></div>
<div class="descri"> <strong>Description : </strong> <span> <?php echo $rsProducts[0]['description'];?> </span></div>
</div>
<br />
<div> <input type="submit" name="btn" class="btn btn-info" value="REDEEM NOW" /> </div>
<br />
</div>
</div>
</form>
<!-- /.tab-content -->
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<?php } ?>
<?php }else{ ?>
<?php } ?>
<?php } ?>
<!--hover-to-zoom-product-->
<script>
$(document).ready(function(){
$('#ex1').zoom();
});
</script>