File: /home/barbeatleanalyti/public_html/manage.beatleanalytics.com/site/template/orderprocess.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;
?>
<style>
.head-line{
margin-top:2px !important;
margin-bottom:2px !important;
}
</style>
<div class="content-wrapper">
<section class="content-header">
<h1>
<?php if(strtolower($v) == 'list') { ?> Products 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">
<?php if($v == 'list') {
$SQL = "SELECT beatle_userlogin.* FROM beatle_userlogin WHERE beatle_userlogin.UserID = ".$_SESSION['UserInfo']['UserID'];
$rsUserInfo = $objDB->sql_query($SQL);
//if($rsUserInfo[0]['db_state'])
$stateid = $rsUserInfo[0]['db_state'];
$cityid = $rsUserInfo[0]['db_city'];
///$rsProducts = $objProfile->
$rsProducts = $objProfile->fetchProductInfo($objProfile->proid);
?>
<div class="box box-primary" style="border:none; border-top:2px solid #3c8dbc;">
<!-- Custom Tabs -->
<div class="box-header">
<div class="orderprocess" >
<form name="frmSettings" id="frmSettings" method="post" action="manage.php?pg=orderprocess&acn=setOrderData" enctype="multipart/form-data" >
<input type="hidden" name="ctype" id="ctype" value="<?php echo strtolower($rsUserInfo[0]['UserType'])?>" />
<input type="hidden" name="proid" id="proid" value="<?php echo $objProfile->proid; ?>" />
<input type="hidden" name="prodname" id="prodname" value="<?php echo $rsProducts[0]['name']; ?>" />
<input type="hidden" name="prodimage" id="prodimage" value="<?php echo $rsProducts[0]['prod_image']; ?>" />
<!--<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 />
<div class="row">
<div class="col-md-4 products-img">
<span class='zoom' id='ex1' width='555' height='320'>
<?php
if($_SERVER['HTTP_HOST']=='localhost' || $_SERVER['HTTP_HOST']=='kalpeshpc' ) {
echo '<img style="border:5px solid #ccc; padding:10px;" class="img-responsive" src="http://'.$_SERVER['HTTP_HOST'].'/newdemo.beatleanalytics.com/assets/products/'.$rsProducts[0]['prod_image'].'">';
}else{
if(SUBDOMAIN_NAME == 'owner'){
echo '<img class="profile-user-img img-responsive" src="http://newdemo.beatleanalytics.com/assets/products/'.$rsProducts[0]['prod_image'].'">';
}else if(SUBDOMAIN_NAME == 'manage'){
echo '<img class="profile-user-img img-responsive" src="http://manage.beatleanalytics.com/assets/products/'.$rsProducts[0]['prod_image'].'">';
}
}
?>
</span>
</div>
<style>
</style>
<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'])) { ?>
<input name="username" id="username" value="<?php echo $rsUserInfo[0]['db_userLoginName']; ?>" type="hidden">
<?php 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="text">
<?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=""><h1><i class="fa fa-shopping-bag" aria-hidden="true"></i> <?php echo $rsProducts[0]['name']; ?></h1>
</div>
<div class=""><h3> <i class="fa fa-building-o" aria-hidden="true"></i> BeatleBuddy</h3>
</div>
<P>Suspendisse quos? Tempus cras iure temporibus? Eu laudantium cubilia sem sem! Repudiandae et! Massa
senectus enim minim sociosqu delectus posuere.</p>
<br />
<div class="col-md-8 orderprocess-right">
<span class="filed-left"><i class="fa fa-user" aria-hidden="true"></i> Full Name :</span>
<span class="filed-right">
<input name="name" id="name" class="form-control input-md" type="text" value="<?php echo $rsUserInfo[0]['db_username']; ?>">
</span>
</div>
<br />
<!---
<div class="col-md-8 orderprocess-right">
<span class="filed-left"><i class="fa fa-envelope-open" aria-hidden="true"></i> Email id :</span>
<span class="filed-right">
<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>
---->
<br />
<div class="col-md-8 orderprocess-right">
<span class="filed-left"><i class="fa fa-mobile" aria-hidden="true"></i> Phone no :</span>
<span class="filed-right">
<input class="form-control input-md" type="text" maxlength="10" name="contact_number" id="contact_number" value="<?php echo $rsUserInfo[0]['db_phone']; ?>" >
</span>
<div class="col-md-3"></div>
</div>
<br />
<div class="col-md-8 orderprocess-right">
<span class="filed-left"><i class="fa fa-address-card" aria-hidden="true"></i> Address :</span>
<span class="filed-right">
<input class="form-control input-md" name="address" id="address" type="text" value="<?php echo $rsUserInfo[0]['db_address']; ?>" >
</span>
</div>
<br />
<div class="col-md-8 orderprocess-right">
<span class="filed-left"><i class="fa fa-file-archive-o" aria-hidden="true"></i> PIN Code :</span>
<span class="filed-right">
<input class="form-control input-md" id="pincode" maxlength="6" name="pincode" type="text" value="<?php echo $rsUserInfo[0]['db_pincode']; ?>" >
</span>
</div>
<br />
<div class="col-md-8 orderprocess-right">
<span class="filed-left"><i class="fa fa-flag" aria-hidden="true"></i> State :</span>
<span class="filed-right">
<select onchange="javascript: fetchCityData(this.value)" class="form-control" name="state" id="state">
<?php
$SQL = "SELECT * FROM states where country_id = 101 order by name ASC ";
$rsStates = $objDB->sql_query($SQL);
for($s = 0; $s<count($rsStates); $s++) {
if(empty($stateid)){
$stateid = $rsStates[0]['id'];
}
$selState = '';
if($stateid == $rsStates[$s]['id']){
$selState = 'selected="selected"';
}
?>
<option <?php echo $selState;?> value="<?php echo $rsStates[$s]['id']?>"><?php echo $rsStates[$s]['name']?></option>
<?php } ?>
</select>
</span>
</div>
<br />
<div class="col-md-8 orderprocess-right">
<span class="filed-left"><i class="fa fa-building" aria-hidden="true"></i> City :</span>
<span class="filed-right">
<select class="form-control" name="city" id="city">
<?php $SQL = "SELECT * FROM cities where state_id = ".$stateid." order by name ASC ";
$rsCity = $objDB->sql_query($SQL);
for($s = 0; $s<count($rsCity); $s++) {
$selState = '';
if($cityid == $rsCity[$s]['id']){
$selState = 'selected="selected"';
}
?>
<option <?php echo $selState; ?> value="<?php echo $rsCity[$s]['id']?>"><?php echo $rsCity[$s]['name']?></option>
<?php } ?>
</select>
</span>
<div class="bt-button add-product">
<button type="submit" onclick="javascript: return validateFrom();" class="btn btn-block btn-success">Redeem Now</button>
<!-- <button type="button" class="btn btn-block btn-info">Edit</button>
<button type="button" class="btn btn-block btn-warning">Cencle</button>
--> </div>
</div>
</div>
</div>
<br />
<!--<div class="f-from">
<span class="col-lg-2 control-label m-pro ">
<p><span> <i class="fa fa-user"></i> </span> Full Name :</p>
</span>
<span class="col-lg-8 f-pro">
</span>
</div> -->
<!--<div class="f-from">
<span class="col-lg-2 control-label m-pro ">
<p><span> <i class="fa fa-envelope-open" aria-hidden="true"></i> </span> Email id: </p>
</span>
<span class="col-lg-8 f-pro">
</span>
</div> -->
<!--<div class="f-from">
<span class="col-lg-2 control-label m-pro ">
<p><span> <i class="fa fa-mobile" aria-hidden="true"></i> </span> Phone no: </p>
</span>
<span class="col-lg-8 f-pro">
<input class="form-control input-md" type="text" maxlength="10" name="contact_number" id="contact_number" value="<?php echo $rsUserInfo[0]['db_phone']; ?>" >
</span>
</div> -->
<!--<div class="f-from">
<span class="col-lg-2 control-label m-pro ">
<p><span> <i class="fa fa-address-card" aria-hidden="true"></i> </span> Address :</p>
</span>
<span class="col-lg-8 f-pro">
<input class="form-control input-md" name="address" id="address" type="text" value="<?php echo $rsUserInfo[0]['db_address']; ?>" >
</span>
</div> -->
<!--<div class="f-from">
<span class="col-lg-2 control-label m-pro ">
<p><span> <i class="fa fa-file-archive-o"></i> </span> PIN Code :</p>
</span>
<span class="col-lg-8 f-pro">
<input class="form-control input-md" id="pincode" maxlength="6" name="pincode" type="text" value="<?php echo $rsUserInfo[0]['db_pincode']; ?>" >
</span>
</div> -->
<!--<div class="f-from">
<span class="col-lg-2 control-label m-pro ">
<p><span> <i class="fa fa-flag"></i> </span> State :</p>
</span>
<span class="col-lg-8 f-pro">
<select onchange="javascript: fetchCityData(this.value)" class="form-control" name="state" id="state">
<?php
$SQL = "SELECT * FROM states where country_id = 101 order by name ASC ";
$rsStates = $objDB->sql_query($SQL);
for($s = 0; $s<count($rsStates); $s++) {
if(empty($stateid)){
$stateid = $rsStates[0]['id'];
}
$selState = '';
if($stateid == $rsStates[$s]['id']){
$selState = 'selected="selected"';
}
?>
<option <?php echo $selState;?> value="<?php echo $rsStates[$s]['id']?>"><?php echo $rsStates[$s]['name']?></option>
<?php } ?>
</select>
</span>
</div> -->
<script>
function fetchCityData(sid){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("city-data").innerHTML = this.responseText;
}
};
xhttp.open("GET", "runajax.php?acn=fetchCityData&sid="+sid, true);
xhttp.send();
}
</script>
<script>
function validateAddress(TCode){
if(/[^a-zA-Z0-9\/]/.test( TCode )) {
document.getElementById('username').value = TCode.slice(0, -1)
return false;
}
return true;
}
function validateFrom(){
var name = document.getElementById('name');
var contact_number = document.getElementById('contact_number');
var email = document.getElementById('email');
//var user_name_hdn = document.getElementById('user_name_hdn');
var username = document.getElementById('username');
var address = document.getElementById('address');
var pincode = document.getElementById('pincode');
var error = 0;
//if(user_name_hdn.value.trim() == ""){
if(username.value.trim() == ""){
username.style.border = "1px solid red";
error = 1;
}else{
username.style.border = "1px solid #ccc";
}
//}
if(name.value.trim() == ""){
name.style.border = "1px solid red";
error = 1;
}else{
name.style.border = "1px solid #ccc";
}
if(contact_number.value.trim() == ""){
contact_number.style.border = "1px solid red";
error = 1;
}else{
contact_number.border = "1px solid #ccc";
}
if(contact_number.value.length != 10){
contact_number.style.border = "1px solid red";
error = 1;
}else{
contact_number.style.border = "1px solid #ccc";
}
/*
if(ValidateEmail(email) == false){
email.style.border = "1px solid red";
}else{
email.style.border = "1px solid #ccc";
}*/
if(address.value.trim() == ""){
address.style.border = "1px solid red";
error = 1;
}else{
address.style.border = "1px solid #ccc";
}
if(pincode.value.trim() == ""){
pincode.style.border = "1px solid red";
error = 1;
}else{
pincode.style.border = "1px solid #ccc";
}
if(error == 1)
return false;
document.getElementById('frmSettings').submit();
}
function isNumber(evt) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
return true;
}
function ValidateEmail(mail)
{
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail.value.trim()))
{
return true;
}
//alert("You have entered an invalid email address!")
return false;
}
</script>
<br />
<!--<div class="f-from">
<span class="col-lg-2 control-label m-pro ">
<p><span> <i class="fa fa-building"></i> </span> City :</p>
</span>
<span class="col-lg-8 f-pro" id="city-data">
<select class="form-control" name="city" id="city">
<?php $SQL = "SELECT * FROM cities where state_id = ".$stateid." order by name ASC ";
$rsCity = $objDB->sql_query($SQL);
for($s = 0; $s<count($rsCity); $s++) {
$selState = '';
if($cityid == $rsCity[$s]['id']){
$selState = 'selected="selected"';
}
?>
<option <?php echo $selState; ?> value="<?php echo $rsCity[$s]['id']?>"><?php echo $rsCity[$s]['name']?></option>
<?php } ?>
</select>
</span>
</div> -->
<!-- </div> -->
</form>
</div>
<!-- Other Libraries -->
<!---woch-
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
-->
<!-- Tm Library -->
<!-- /.tab-pane -->
<!-- /.tab-pane -->
</div>
<!-- /.tab-content -->
</div>
</div>
<?php } ?>
</div>
</div>
<!-- Other Libraries -->
<!---<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>------>
<!-- Tm Library -->
<!--
<script type="text/javascript" src="theme/black/js/tm_validator.js"></script>
<script type="text/javascript" src="theme/black/js/tm_editable.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#text_demo, #textarea_demo, #checkbox_demo, #select_demo, .width_auto_demo').tm_editbale('init',{
theme:'round-button-theme',
outside_btn:{
onshow:" <i class='fa fa-pencil'></i> ",
new_line:false,
onhover:''
},
inside_btn:{
new_line:false,
ok:"<i class='fa fa-check'></i>",
cancel:"<i class='fa fa-times'></i>"
}
});
setTimeout(function(){
$('#radio_demo').tm_editbale('init',{
theme:'round-button-theme',
outside_btn:{
onshow:" <i class='fa fa-pencil'></i> ",
new_line:false,
onhover:''
},
inside_btn:{
new_line:false,
ok:"<i class='fa fa-check'></i>",
cancel:"<i class='fa fa-times'></i>"
}
});
},350);
});
</script> -->
<!--hover-to-zoom-product-->
<script>
$(document).ready(function(){
$('#ex1').zoom();
});
</script>