HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/barbeatleanalyti/www/manage.beatleanalytics.com/site/template 19-3-2018 1_10/profilenew.php
<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">
<script>
	$(document).ready(function(){
		$("#FromDate").datepicker({format:'dd-mm-yyyy'});
		$("#ToDate").datepicker({format:'dd-mm-yyyy'});
	});

		function validateDate(){
			
			var D1 = document.getElementById("ToDate");
			var D2 = document.getElementById("FromDate");
			
			if(D1.value.trim() == ""){
				D1.style.border = "1px solid red";
				return false;
			}
			
			if(D2.value.trim() == ""){
				D2.style.border = "1px solid red";
				return false;
			}
		}	
	
	</script>
<?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> <i class="fa fa-home"></i> <strong> <span style="font-size:16px !important;" id="org-name"><?php echo $OrgName; ?></span> </strong> </h1>
    <ol class="breadcrumb">
      <li><a href="dashboardma.html"><i class="fa fa-home"></i> Home</a></li>
      <li class="active">Profile</li>
    </ol>
  </section>
  
  <!---<section class="content-header">
 <h1> 
 <?php if(strtolower($v) == 'list') { ?> Profile details. 
 <?php  }?>
 </h1>
 </section>----->
  
  <div class="col-md-12">
    <?php
	// Error or success message display
	$objDB->NotificaitonForResult($msg,$error);



	$stateid = $uInfo___[0]['db_state'];
	$cityid = $uInfo___[0]['db_city'];
	
	$completepoint = 0;
	
	if(empty($uInfo___[0]['db_userLoginName'])){
		$v = 'edit';
	}else{
		$completepoint = $completepoint + 10;
	}


	

	if(empty($uInfo___[0]['db_state']) || $uInfo___[0]['db_state'] == 0){
		$v = 'edit';
	}else{
		$completepoint = $completepoint + 10;
	}

	if(empty($uInfo___[0]['db_city']) || $uInfo___[0]['db_city'] == 0){
		$v = 'edit';
	}else{
		$completepoint = $completepoint + 10;
	}
	
	if(empty($uInfo___[0]['db_username'])){
		$v = 'edit';
	}else{
		$completepoint = $completepoint + 10;
	}
	
	
	if(empty($uInfo___[0]['db_phone'])){
		$v = 'edit';
	}else{
		$completepoint = $completepoint + 10;
	}
	
	if(empty($uInfo___[0]['db_email'])){
		$v = 'edit';
	}else{
		$completepoint = $completepoint + 10;
	}
	
	if(empty($uInfo___[0]['db_address'])){
		$v = 'edit';
	}else{
		$completepoint = $completepoint + 10;
	}
	
	if(empty($uInfo___[0]['db_pincode'])){
		$v = 'edit';
	}else{
		$completepoint = $completepoint + 10;
	}
	
?>
  </div>
  <section class="content" style="min-height:1210px;">
  <div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
      <div class="box box-primary" style="min-height: 978px;"> 
        
        <!-- /.box-header -->
        <div class="box-body">
          <?php 


				if($pe___ == 'Y') { ?>
          <div class="callout callout-danger text-center">
            <h3>THANK YOU FOR USING <strong>BEATLEANALYTICS.COM PORTAL</strong></h3>
            <h3><em>Please fill and complete your profile first &nbsp;&nbsp;&nbsp; <i class="fa fa-hand-o-down" aria-hidden="true"></i></em></h3>
          </div>
          <?php } ?>
          <?php 
											$ProfileImage = $objProfile->FetchWebProfileImage();
											
											//$ProfileImage = $objProfile->FetchUserProfilePhoto();
											if($ProfileImage != ""){
												if(!fopen(UPLOAD_WEBPROFILEIMAGE.$ProfileImage,"r")){
													$ProfileImage = _IMAGEPATH_.'/noimage_responsive.png';	
												}else {
													$ProfileImage = UPLOAD_WEBPROFILEIMAGE.$ProfileImage;
													$completepoint = $completepoint + 10;
												}
											}
											else
												$ProfileImage = _IMAGEPATH_.'/noimage_responsive.png';
								?>
          <!----profile-edit-->
				<?php if($v  == 'edit') {?>
                  <div class="profie-02" id="edit-pro">
                
              		<div class="header-profile"><h1>Create Your Profile</h1></div>
                                   
               
					<div class="col-md-4 col-sm-12 col-xs-12">
				<div class="profile-left">
						<div class="profile-pic">	
						<div class="profile-pic-top">
						 <ul class="img-list1">
   							<li style="width:175px; height:175px;">
                				<img id="UserWebImage_" src="<?php echo $ProfileImage ;?>" class="img-responsive img-circle" alt="User Image">
                           </li>                          
                         </ul>
                         
						 <button id="#popup_upload_" data-toggle="modal" data-target="#popup_upload"   type="button" class="">Upload Photo</button>
						  <p>(Maximum File size 500KB)</p>
						  </div>
						  
						  <div class="davidar"></div>
						  <div class="profile-pic-bottom">
						  <div class="profile-completeness">
						  <h3>  Profile Completeness : <span style="color:#096"><?php echo $completepoint;?>%</span></h3>
						  </div>
						  <div class="progress">
								<div class="progress-bar progress-bar-green" role="progressbar" aria-valuenow="<?php echo $completepoint;?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $completepoint;?>%">
								  <span class="sr-only">40% Complete (success)</span>
								</div>
                         </div>
						  </div>
					   </div>
					   
			   
			   </div>
   
				</div>
			
                <!--<input type="hidden" name="ctype" id="ctype" value="<?php echo strtolower($rsUserInfo[0]['UserType'])?>" /> -->
                    <div class="col-md-8 col-sm-12 col-xs-12 filled-section-right">
                <form name="frmSettings" id="frmSettings" method="post" action="manage.php?pg=profilenew&acn=setSettingData" enctype="multipart/form-data" > 
                <input type="hidden" name="acn" id="acn" value="setSettingData" />
                <input type="hidden" name="pg" id="pg" value="profilenew" />
				<div class="col-md-6 col-sm-12 col-xs-12">
                <div class="profile-right">
                           <div class="box-body">
              
              
              
              <br>

              

              <h4>Choose Id</h4>

              <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-id-badge"></i></span>
                <input name="username" id="username" type="text" <?php if(!empty($uInfo___[0]['db_userLoginName'])) echo 'readonly="readonly"'; ?> class="form-control" placeholder="Choose Id" value="<?php echo $uInfo___[0]['db_userLoginName'];?>">
              </div>
              <br>
               <h4>Full Name</h4>

              <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-user"></i></span>
                <input type="email" class="form-control" placeholder="Full Name" name="name" id="name" value="<?php echo $uInfo___[0]['db_username'];?>">
              </div>
              <br>
               <h4>Email Id</h4>

              <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-envelope" aria-hidden="true"></i></span>
                <input type="email" class="form-control" placeholder="Email Id" name="email" id="email"  value="<?php echo $uInfo___[0]['db_email'];?>">
              </div>
              <br>
                <h4>Phone No</h4>

              <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-mobile"></i></span>
                <input type="email" class="form-control" placeholder="Phone No" name="contact_number" id="contact_number" value="<?php echo $uInfo___[0]['db_phone'];?>">
              </div>
              <br>
               <h4>Address</h4>

              <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-address-card"></i></span>
                <input type="email" class="form-control" placeholder="Address" name="address" id="address" value="<?php echo $uInfo___[0]['db_address'];?>">
              </div>
              <br>
            </div>
                </div>
                
                
				</div>
				
				<div class="col-md-6 col-sm-12 col-xs-12">
                <div class="profile-right">
                           <div class="box-body">
              <br />
                
               
              
               
              
               <h4>PIN Code</h4>

              <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-file-archive-o"></i></span>
                <input type="email" class="form-control" placeholder="PIN Code" id="pincode" maxlength="6"  name="pincode" value="<?php echo $uInfo___[0]['db_pincode'];?>">
              </div>
              <br>
              
               <h4>State</h4>

              <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-flag"></i></span>
               <!--<select class="form-control" id="status" name="status"> -->
               <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> 
              </div>
              <br>
               <h4>City</h4>

              <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-building"></i></span>
               	<span 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>
              <br>
                <h4>About Me</h4>

              <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-commenting-o" aria-hidden="true"></i></span>
                <textarea class="form-control" rows="3" name="aboutme" id="aboutme" placeholder="Write something about you here.."><?php echo $uInfo___[0]['db_aboutme'];?></textarea>
              </div>
              <br>
              
              <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(); 
				}
           
				   
				   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";
												error = 1;
											}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.value.trim() == 0){
												pincode.style.border = "1px solid red";
												error = 1;
											}else{
												if(pincode.value.trim().length != 6){
													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>
             
               </div>
              
                </div>
              
                
                </div>

				</form>                
                
			  	
                <div class=" col-md-12 col-sm-12 col-xs-12 box-footerbutton-save-edit-chang-pass">
					
					<button type="submit" onclick="javascript: return validateFrom();"  id="save" class="btn btn-info" style="font-size: 20px; padding: 11px 37px;">Save</button>
					<button type="button" class="btn btn-warning" data-toggle="modal" data-target="#modal-warning" style="    font-size: 20px; padding: 11px 37px;">
               Change Password
              </button>
			  
			  <div class="modal modal-warning fade in" id="modal-warning" style="display: none; padding-right: 17px;">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header" style="border-radius: 8px 8px 0px 0px;">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">×</span></button>
                <h4 class="modal-title">Change Password</h4>
              </div>
            <form name="frmSettings" id="frmSettings" method="post" action="manage.php?pg=profileemp&acn=setPasswordData" enctype="multipart/form-data" > 
            <input type="hidden" name="ctype" id="ctype" value="<?php echo strtolower($rsUserInfo[0]['UserType'])?>" />
              <div class="modal-body" style="padding:37px !IMPORTANT;">
                  <div class="chang-pass">
					 <div class="form-group">
                        <label for="amount" class="col-sm-5 control-label">Old password</label>
                        <div class="col-sm-7">
                            <input type="password" class="form-control" id="oldpass" name="oldpass">
                        </div>
                    </div>
					
					 <div class="form-group">
                        <label for="amount" class="col-sm-5 control-label">New password</label>
                        <div class="col-sm-7">
                            <input type="password" class="form-control" id="newpass" name="newpass">
                        </div>
                    </div>
					
					 <div class="form-group">
                        <label for="amount" class="col-sm-5 control-label">Confirm password</label>
                        <div class="col-sm-7">
                           <input type="password" class="form-control" id="cnewpass" name="cnewpass">
                        </div>
                    </div>
					
					
					

					
					</div>
              </div>
              <div class="modal-footer" style="border-radius:0px 0px 8px 8px;">
                 <button type="button" class="btn btn-outline pull-left" data-dismiss="modal">Close</button>
                 <!--<button type="button" class="btn btn-outline">Save changes</button> -->
                 <button type="submit" onclick="javascript: return validatePassword();" class="btn btn-outline">Save changes</button>
              </div>

            					<script>
                                    function validatePassword(){
                                            
                                            var oldpass = document.getElementById('oldpass');
                                            var newpass = document.getElementById('newpass');
                                            var cnewpass = document.getElementById('cnewpass');
                                            var error = 0;
											
											
											
                                            if(oldpass.value.trim() == ""){
                                                oldpass.style.border = "1px solid red";
                                                error = 1;
                                            }else{
                                                oldpass.style.border = "1px solid #ccc";
                                            }
											
											
                                            if(newpass.value.trim() == ""){
                                                newpass.style.border = "1px solid red";
                                                error = 1;
                                            }else{
                                              
											  if(newpass.value.length < 6 || newpass.value.length > 20){
                                                	newpass.style.border = "1px solid red";
                                                	//alert("new pas error");
													error = 1;
											  }else{
													newpass.style.border = "1px solid #ccc";
											  }
											  
                                            }
                                           
										    
                                            
											
											
											if(cnewpass.value.trim() == ""){
												cnewpass.style.border = "1px solid red";
												error = 1;
											}else{
												
												if(cnewpass.value.length < 6 || cnewpass.value.length > 20){
                                               	 	cnewpass.style.border = "1px solid red";
                                                	//alert("cpass eror");
													error = 1;
												}else{
												  	cnewpass.style.border = "1px solid #ccc";
												}
											}
											
											//alert(error);
											if(error == 1)
                                            return false;
											
											if(newpass.value.trim() != cnewpass.value.trim()){
												alert("Confirm password not matched.");
												cnewpass.style.border = "1px solid red";
                                                error = 1;
                                            }else{
                                               // cnewpass.style.border = "1px solid #ccc";
                                            }
											
                                            if(error == 1)
                                            return false;
											
											
											
                                    }
                                </script>
              
              
            </div>
            <!-- /.modal-content -->
          </div>
          <!-- /.modal-dialog -->
        </div>
			  
			  
					
				
	
				</div>
			  
                </div>
                
					<style>
.profie-02 .box-footerbutton-save-edit-chang-pass {text-align: center; margin-bottom:20px;}
.profie-02 .davidar {width: 100%; height: 2px;  background: #9a9494;}
.profie-02 .profile-left {text-align: center;}
.profie-02 .profile-pic {text-align: center; margin: 0 auto;}
.profie-02 .profile-pic img {margin: 0 auto;}
.profie-02 .progress {  width: 80%;margin: 18px auto;}
.profie-02 .profile-completeness h3 {
    text-align: left;
    width: 80%;
    margin: 0 auto;
}
.profie-02 .profile-pic {
    border: 1px solid #ddd;
    padding: 6px;
}
.profie-02 .profile-pic img#UserWebImage_ {
    border-radius: 100%;
    background: whitesmoke;
    padding: 14px;
}
.profie-02 .profile-pic-top , .profile-pic-bottom {
    margin-top: 49px; margin-bottom: 52px;
}
.profie-02 .profile-pic-top button {
    margin-top: 15px;
    background: #1caf9a;
    border: none;
    border-radius: 3px;
    padding: 5px 18px;
    font-size: 16px;
    color: #FFF;
}
.profie-02 .profile-pic-top p {
    margin-top: 15px;
    font-size: 20px;
}

.profie-02 .profile-right {
    width: 90%;
    margin: 0 auto;
}
.profie-02 .profile-right input {
    padding: 9px 10px;
    font-size: 17px;
    background: #f4efef;
}
.profie-02 .profile-right .input-group i {
    font-size: 19px;
    margin: 0 6px;
}
.profie-02 .profile-right h4 {
    margin: 0px;
}


 .header-profile {
    background: #f4efef;
    padding: 25px 42px;
    margin-top: 39px;
    margin-bottom: 13px;
}
 .header-profile h1 {
    padding: 0px;
    margin: 0px;
}
.profie-02.filled-section-right {
    border: 1px solid #dddddd;
}

.profie-02 i.fa.fa-envelope {
    margin: 0 4px;
}
.profie-02 i.fa.fa-mobile {
    padding: 0 1px;
    font-size: 30px;
}
.profie-02 i.fa.fa-commenting-o {
    font-size: 25px !IMPORTANT;
    padding: 0px !IMPORTANT;
    margin: 0 2px !IMPORTANT;
}
.profie-02 i.fa.fa-address-card {
    font-size: 20px;
    padding: 0px;
    margin: 0px 3px;
}

.profie-02 .col-md-12.col-sm-12.col-xs-12.box-footer {
    border: none;
    text-align: center;
}
.filled-section-right {
    border: 1px solid #dddddd;
}
.col-md-12.col-sm-12.col-xs-12.box-footer button {
    font-size: 26px;
    padding: 12px 48px;
}
.input-group select {
    padding: 11px 0 !IMPORTANT;
    background: #f4efef !IMPORTANT;
    color: #999999 !IMPORTANT;
}
textarea.form-control {
    padding: 3px 7px;
    background: #f4efef;
    font-size: 14px;
}
.diyaidar-profile {
    margin-top: 225px;
    width: 100%;
    float: left;
    height: 5px;
    background: #222d32;
}
			</style>
				</div>
                <?php } else { ?>
                  <div class="new-profile" id="complit-pro">
				  
				    <div class="col-md-12 col-sm-12 col-xs-12">  
						<div class="profile-name"><span class="welcome-name"><h1>Welcome <?php echo $uInfo___[0]['db_username']?></h1></span></div>
						
					<span  id="lblName" class="editable about-me cust" ><?php echo $uInfo___[0]['db_aboutme']?></span>	
						
					<div class="edit-profile pull-right cust">
					
					<!--<button type="button"  id="edit"></button> -->
                    <a href="profilenew.html?v=edit" class="btn btn-primary btn-md">Edit Profile</a>
					
				</div> 
				</div>
				
           <div class="col-md-12 col-sm-12 col-xs-12 ">
		  <div class="col-md-3 col-sm-3 col-xs-12 profile-left">
		    	<div class="profile-img">
		     
       
       				<ul class="img-list1">
  

   				<li class="customer-profile" style="width:75%; height:auto;">
                <img id="UserWebImage_" src="<?php echo $ProfileImage; ?>" class="img-responsive " alt="User Image">
                 <a href="#popup_upload_" data-toggle="modal" data-target="#popup_upload">
   <span class="text-content1 cust-chang-img" style="width:100%; border-radius:11px 11px 0 0; height:45px;"><span><strong>Change Image</strong></span></span>
   
   </a>
   
   </li> 
   				
				  
   </ul>
      
			  </div>
				
				<div class="personal-details">
				   <div class="panel-default">
                <div class="panel-body form-horizontal payment-form" style="padding-bottom: 0px;">
                    <div class="form-group">
					<div class="col-md-12 col-sm-12 col-xs-12 complit-pro">
                    <p>Profile id :   <span><?php echo $uInfo___[0]['db_userLoginName']?></span></p>
                    <p>Full Name  :   <span  id="lblName" class="editable" ><?php echo $uInfo___[0]['db_username']?></span> </p>
                    <p>Email id   :   <span id="lblName" class="editable"><?php echo $uInfo___[0]['db_email']?></span></p>
                    <p>Phone no   :   <span id="lblName" class="editable"><?php echo $uInfo___[0]['db_phone']?></span></p>
                    <p>Address    :   <span id="lblName" class="editable"><?php echo $uInfo___[0]['db_address']?></span></p>
					 
					 
					  <p>PIN Code :  <span  id="lblName" class="editable" ><?php echo $uInfo___[0]['db_pincode']?></span><span class="edit"></span></p>

					<?php 
					$st = '';
					if(!empty($uInfo___[0]['db_state']) && $uInfo___[0]['db_state'] != 0) {
						$SQL = "SELECT * FROM states where id = ".$uInfo___[0]['db_state']." order by name ASC ";
						$rsStates_ = $objDB->sql_query($SQL);
						$st = $rsStates_[0]['name'];
					}
					
					
					$ct = '';
					if(!empty($uInfo___[0]['db_state']) && $uInfo___[0]['db_state'] != 0) {
						$SQL = "SELECT * FROM cities where id = ".$uInfo___[0]['db_city']." order by name ASC ";
						$rsCity_ = $objDB->sql_query($SQL);
						$ct = $rsCity_[0]['name'];
					}
					?>
                    
                    <p>State  :  <span  id="lblName" class="editable" ><?php echo $st?></span></p>
                    <p>City  :  <span  id="lblName" class="editable" ><?php echo $ct?></span></p>
                 <!--   <p>About Me  : <span  id="lblName" class="editable" ><?php echo $uInfo___[0]['db_aboutme']?></span></p>-->
                    
                    
                    </div>
                	</div>
            	</div>            
       <!-- / panel preview -->
			
			
			</div>
				</div>
		
    

			
			
			
			</div>
          <style>
            span.chng-pic {
    background: #222d328a;
    width: 94%;
    /* float: left; */
    position: absolute;
    text-align: center;
    margin: 0 auto;
    bottom: 46px;
    left: 10px;
    padding: 8px 0;
    font-size: 25px;
    color: white;
    display: none;
}
.profile-img:hover span.chng-pic {
    display: block;
}


          </style>
		  
			<?php if($_SESSION['UserInfo']['UType'] == 'End_user') { ?>    
	
   	<div class="col-md-9 profile-box cus-pro">
	
	
            <div class="small-boxs bx-box footer-box " >
            <div class="box-header with-border box-header headline">
              <h3 class="box-title"> <img src="theme/black/images/bonus-points.png">&nbsp;&nbsp;My Bonus Points</h3>

             
            </div>
			
			 <div class="" style="clear:both;"></div>
            <div class="box-body map cust" style="height:auto;">
			  <div class="news-manu skill-bar">
			      <div class="tab-pane <?php if($objProfile->back == 'tab_2') echo 'active';?>" id="tab_2">
				    <div class="container" style="width:100%; margin:17px 0px;">
  					<div class="my-bounes-point">
					
					
  <div class="col-lg-6 bonas-main">
  <!---<div class="my-point"><p><img src="theme/black/images/bonus-points-big.png"><?php echo $totalPoints =  $objProfile->fetchTotalBonus();?></p></div>
  <p class="f-bounes"><i><?php echo ucwords(number_to_word($totalPoints));
  
  ?></i></p>-->
  
    <div class="bonas-pint-round">
<div class="bonus-point">
  <div class="coin">
    <div class="face heads">
     <?php echo $totalPoints =  $objProfile->fetchTotalBonus();?>
    </div>
    <div class="face tails">
     <?php echo $totalPoints =  $objProfile->fetchTotalBonus();?>
    </div>
  </div>
</div>
<p class="f-bounes"><i><?php echo ucwords(number_to_word($totalPoints));?></i></p>




</div>
  
  
  
  
  </div>
  
    
  
    <div class="col-lg-6 bonas-main">
      <div class="pur">
	 
	  
	  <!-----------redem -popup------------------>
	  
	   <a href="#" data-target="#pwdModal" data-toggle="modal" class="col-md-5 pull-left"> <button type="button"  >Offer Redeem</button></a>
	  
	   
	   <a href="#" data-target="#pwdModal2" data-toggle="modal" class="col-md-6 pull-right"> <button type="button"  >Product Redeem</button></a>
					

<!--modal-->
		<div id="pwdModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" style="display: none;">
    <div class="modal-dialog redem">
        <div class="modal-content">
            <div class="modal-header">
			
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="opacity: 14; color:#FFF; padding: 1px 17px;">×</button>
                 <h2 class="text-center" style="color:#000;">Redeem Your Point  <small class="label  bg-yellow"><?php echo $totalPoints =  $objProfile->fetchTotalBonus();?></small>
			
			</h2>

            </div>
            <div class="modal-body">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-body">
                          
                          <?php
								//$SQL = "SELECT * FROM beatle_products WHERE stock != 0";
								//$rsProducts = $objDB->sql_query($SQL);
								$SQL = "SELECT * FROM beatle_offers  WHERE orgid = ".$_SESSION['OtherInfo']['OrgID']." AND 
								startdate <= '".date('Y-m-d H:i:s')."' AND 
								enddate >= '".date('Y-m-d H:i:s')."' AND 
								active = 'Y' AND
								onhold = 'N'
								ORDER BY startdate DESC";
								$rsOfferData = $objDB->sql_query($SQL);
								
								
								//echo "<pre>";
								//print_r($rsProducts);
								//echo "</pre>";
								
								
								if(count($rsOfferData) > 0){ 
								
								for($i=0; $i<count($rsOfferData); $i++ ) { 
								
									$div = $i%4; 
								
									//if($div == 0) { echo '<div class="text-center Redeem-main">'; }
								?>
									
                                	<div class="col-md-3">
                                        <div class="bx-box footer-box offer-data" style="height: 537px;">
                                        <div class="box-header ui-sortable-handle bx-box" style="cursor: move;">
                                          <i class="ion ion-clipboard"></i>
                                            <h3 class="box-title" style="width:100%;">	<div class="title"> <strong>Title :	&nbsp; </strong><span> <?php echo $rsOfferData[$i]['title'];?></span> </div></h3>
                                        </div>
                                      
                                        <div class="box-body sub">
                                          <div class="card-img">
                                          <div class="card" style="text-align:center;" id="festival-banner"><img style="width:100% !important; height:250px !important;" class="card-bkimg" alt="" src="<?php echo OFFER_BANNER_ROOT.$rsOfferData[$i]['offer_image']?>"></div>
                                         </div> 
                                         <div class="card-info" style="text-align: left;">
                                             <div class="validity"> <strong>Offer Validity : 	&nbsp;</strong> <span> <?php echo date("d/m/Y H:i A",strtotime($rsOfferData[$i]['startdate'])).' to '. date("d/m/Y H:i A",strtotime($rsOfferData[$i]['enddate']));?></span> </div>
                                            <div class="validity"> <strong>Point require : 	&nbsp;</strong>  <span> <?php echo $rsOfferData[$i]['epoint'];?> </span> </div>
                                            
                                         </div>
                                         <br>
                                          <a href="offerprocess.html?prid=<?php echo $rsOfferData[$i]['offerid'];?>" class="btn btn-block btn-primary fancy-btn" style="width: 125px; margin: 0 auto;">Redeem</a>
                                        </div>
                                      </div>
                                   </div>
								<?php  
									//if($div == 3 || $div == count($rsProducts)-1) { echo '</div> <hr>'; }
								}
								
								} else{
									
									echo 'No any products found';
									
								} ?>
                          	
                           
							
							
							
							
							
							
							 
                        </div>
                    </div>
                </div>
            </div>
          <div class="modal-footer">
                <!---  <div class="col-md-12">
                    <button class="btn" data-dismiss="modal" aria-hidden="true" style="padding: 8px 30px; margin:0px;
    font-size: 19px;">Cancel</button>
                </div>---->
            </div>
        </div>
    </div>
</div>
								
				<!------poup-forget-pass--end----->
							
								
	  
	  
	  
	
	  </div>
	  
	   <div class="col-lg-12 bonus-points-text" style="margin-top:60px;">
	<p><i>Enjoy with Bonus Points by Beatle Analytics. Bonus Point Rewards has something for everyone. The only feedback
	rewards program that has the simplest way to earn rewards and many carefully selected, exciting rewards for you.</i></p>
	</div>
	
  </div>
    
  </div>
                      <br>
                    </div>
              	  </div>
			  </div>
            </div>
            
          </div>
		  
		   <div class="redeem-process"><img src="theme/black/images/redeem-process.png"></div>
          
       </div>
	
	<!---total visit test--->
	<!--<div class="total footer">
	 
	 
	 <div class="col-md-3 ">
	 <div class="total visit">
	 <img src="theme/black/images/images.png">
	  <P>40</P>
	 <div class="footer-total visit">Total visit</div>
	 </div>
	 </div>
	 
	 <div class="col-md-3 total order">
	 <img src="theme/black/images/order.png">
	  <P>5</P>
	 <div class="footer-total order">Total order</div>
	 </div>
	
	</div>--->
          <div style="clear:both;"></div>
          <br>
          <div class="">
            <div class="col-md-6 cus-pro">
              <div class="small-boxs">
                <div class="box-header with-border headline">
                  <h3 class="box-title">Last five visit</h3>
                  <div class="box-tools pull-right" style="margin:8px 0px;"> <a href="cusers.html?v=list&tab=tab_1"> <span class="label label-success">View All Visit</span></a> </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                  <div class="table-responsive">
                    <?php $rsVisit = $objProfile->fetchCustomerVisit(); ?>
                    <table class="table no-margin">
                      <thead>
                        <tr>
                          <th>Date</th>
                          <th>Organization</th>
                          <th>Location</th>
                          <th>Type</th>
                          <th>Rating</th>
                        </tr>
                      </thead>
                      <?php
				  	if(count($rsVisit) > 0) {
						$cnt = count($rsVisit);
						if($cnt < 5)
						$cnt = 5;
						
						for($i=0;$i<$cnt; $i++) {
							
						if($i < count($rsVisit)) {
                  ?>
                      <tr>
                        <td><a href="cusers.html?back=profilenew&v=list&cid=<?php echo $rsVisit[$i]['userId'];?>&tid=<?php echo $rsVisit[$i]['tokenid'];?>&Industrys=<?php echo $rsVisit[$i]['db_surveyIndId'];?>"><?php echo date("d/m/Y",strtotime($rsVisit[$i]['created_date']));?></a></td>
                        <td><?php echo $objProfile->FetchOrganizationName($rsVisit[$i]['orgid']);?></td>
                        <td><span class=""><?php echo $objProfile->FetchBranchName($rsVisit[$i]['db_surveyBranchid']);?></span></td>
                        <td><span class=""><?php echo $objProfile->FetchIndustryName($rsVisit[$i]['db_surveyIndId']);?></span></td>
                        <td><span class=""><?php echo $objProfile->fetchCustomerRating($rsVisit[$i]['userId'],$rsVisit[$i]['tokenid']);?></span></td>
                      </tr>
                      <?php } else{  ?>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                      </tr>
                      <?php
							 }
						}
				  	} else{
					  ?>
                      <tr>
                        <td colspan="10" align="center"> No any visit recoed found.</td>
                      </tr>
                      <?php
				  }?>
                    </table>
                  </div>
                  <!-- /.table-responsive --> 
                </div>
                <!-- /.box-body --> 
                
              </div>
            </div>
            <div class="col-md-6 cus-pro">
              <div class="small-boxs">
                <div class="box-header with-border headline">
                  <h3 class="box-title">Last five Orders</h3>
                  <div class="box-tools pull-right" style="margin:8px 0px;"> <a href="cusers.html?v=list&tab=tab_2"> <span class="label label-danger">View All Orders</span></a> </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                  <div class="table-responsive">
                    <table class="table no-margin">
                      <thead>
                        <tr>
                          <th class="text-center">Order ID</th>
                          <th class="text-center">Product Name</th>
                          <th class="text-center">Quantity</th>
                          <th class="text-center">Status</th>
                          <th class="text-center">Created Date</th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php 
								
								//print_r($_SESSION);
								//echo "<pre>";
								//print_r($rsCustomerInfo);
								//echo "</pre>";
								
								$rsOrderData = $objProfile->fetchOrderDetails();
								if(count($rsOrderData)>0){
								
								
								
								for ($i=0;$i< count($rsOrderData);$i++)
								{
									   
								?>
                        <tr>
                          <td><?php echo $rsOrderData[$i]['orderuid']; ?></td>
                          <td><?php echo $rsOrderData[$i]['productname']; ?></td>
                          <td><?php echo $rsOrderData[$i]['quantity']; ?></td>
                          <td><?php echo $rsOrderData[$i]['status']; ?></td>
                          <td><?php echo date("d/m/Y H:i A",strtotime($rsOrderData[$i]['created_date'])); ?></td>
                        </tr>
                        <?php }
									}else{
									 ?>
                        <tr>
                          <td colspan="10" align="center"> No any data found. </td>
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                  </div>
                  <!-- /.table-responsive --> 
                </div>
                <!-- /.box-body --> 
                
              </div>
            </div>
          </div>
          <style>
	
	
	
	</style>
          <!---//total visit test--->
          
          <?php }else{ ?>
          <div class="col-md-9 col-sm-9 col-xs-12"> 
            <!-- panel preview -->
            <div class="panel-default">
              <div class="panel-body form-horizontal payment-form ">
                <div class="form-group"> 
                  
                  <!--<div class="col-md-12 col-sm-12 col-xs-12 complit-pro owner">
                    <p>Profile id:   <span><?php echo $uInfo___[0]['db_userLoginName']?></span></p>
                    <p>Full Name  :   <span  id="lblName" class="editable" ><?php echo $uInfo___[0]['db_username']?></span> </p>
                    <p>Email id   :   <span id="lblName" class="editable"><?php echo $uInfo___[0]['db_email']?></span></p>
                    <p>Phone no   :   <span id="lblName" class="editable"><?php echo $uInfo___[0]['db_phone']?></span></p>
                    <p>Address    :   <span id="lblName" class="editable"><?php echo $uInfo___[0]['db_address']?></span></p>
					<p>PIN Code :  <span  id="lblName" class="editable" ><?php echo $uInfo___[0]['db_pincode']?></span><span class="edit"></span></p>

						
					
					
					<?php 
					$st = '';
					if(!empty($uInfo___[0]['db_state']) && $uInfo___[0]['db_state'] != 0) {
						$SQL = "SELECT * FROM states where id = ".$uInfo___[0]['db_state']." order by name ASC ";
						$rsStates_ = $objDB->sql_query($SQL);
						$st = $rsStates_[0]['name'];
					}
					
					
					$ct = '';
					if(!empty($uInfo___[0]['db_state']) && $uInfo___[0]['db_state'] != 0) {
						$SQL = "SELECT * FROM cities where id = ".$uInfo___[0]['db_city']." order by name ASC ";
						$rsCity_ = $objDB->sql_query($SQL);
						$ct = $rsCity_[0]['name'];
					}
					?>
                    
                    <p>State  :  <span  id="lblName" class="editable" ><?php echo $st?></span></p>
                    <p>City  :  <span  id="lblName" class="editable" ><?php echo $ct?></span></p>
                    <p>About Me  : <span  id="lblName" class="editable" ><?php echo $uInfo___[0]['db_aboutme']?></span></p>
                    
                    
                    </div> --> 
                  
                  <!-----20-12-2017-->
					
					<div class="col-md-12 profile-box cus-pro">
	
	
            <div class="small-boxs bx-box footer-box ">
            <div class="box-header with-border box-header headline">
              <h3 class="box-title"> <img src="theme/black/images/bonus-points.png">&nbsp;&nbsp; Total Redeem Point By Customer</h3>

             
            </div>
            <div class="box-body map cust" style="height:auto;">
			  <div class="news-manu skill-bar">
                        <div class="tab-pane " id="tab_2">
                            <div class="container" style="width:100%; margin:17px 0px;">
                            <div class="my-bounes-point">
                            <div class="col-lg-6 bonas-main">
                             <!--- <div class="my-point"><p><img src="theme/black/images/bonus-points-big.png"><?php echo fetchTotalPointsClient();?></p></div>
                              <p class="f-bounes"><i><?php echo ucwords(number_to_word(fetchTotalPointsClient())); ?></i></p>--->
                           <div class="bonas-pint-round">
<div class="bonus-point">
  <div class="coin">
    <div class="face heads">
      <?php echo fetchTotalPointsClient();?>
    </div>
    <div class="face tails">
      <?php echo fetchTotalPointsClient();?>
    </div>
  </div>
</div>
<p class="f-bounes"><i><?php echo ucwords(number_to_word(fetchTotalPointsClient())); ?></i></p>




</div>

						   </div>
                            
                            <div class="col-lg-6 bonas-main">
        
           				 <div class="pur">
            
						            		   <button type="button" class="btn btn-default col-lg-5" data-toggle="modal" data-target="#modal-default-owner">
						                        Redeem
						                      </button>
						                      <div class="col-lg-2"></div>
						                       <button type="button" class="btn btn-default  purchase-email col-lg-5" data-toggle="modal" data-target="#modal-default-owner12">
						                       Purchase 
						                      </button>
						  </div>
            <!--model-->
			

            <div class="col-lg-12 bonus-points-text pull-right" style="margin-top:60px;">
                            	<p><i>Enjoy with Bonus Points by Beatle Analytics. Bonus Point Rewards has something for everyone. The only feedback
                            	rewards program that has the simplest way to earn rewards and many carefully selected, exciting rewards for you.</i></p>
                            </div>
            
               
          </div>
          
                            
                        </div>
                      <br>
                    </div>
              	  </div>
			  </div>
            </div>
            
          </div>
		  
		   
          
       </div>
	   <div class="redeem-process"><img src="theme/black/images/owner-redeem-process.png"></div>
	   
	  			
					<!--//20-12-2017------->
                  
                  <style>
				
					/**.complit-pro p span.edit {
    background: url(http://kalpeshpc/owner.beatleanalytics.com/theme/black/images/editar.png);
    background-size: 12px;
    background-repeat: no-repeat;
    background-position: right;
    
}
**/


.profile-name h1 {
    padding: 0px;
    margin: 0px;
}
.complit-pro.owner p {
   
    width: auto;
}
					</style>
                </div>
              </div>
              <!-- / panel preview --> 
              
            </div>
          </div>
          <div class="Redeem-history-own">
           <div class="col-md-3 cus-pro">
              <div class="small-boxs">
                <div class="box-header with-border headline">
                  <h3 class="box-title">Redeem History</h3>
                  <div class="box-tools pull-right" style="margin:8px 0px;"> <a href="emailer.html?v=report"> <span class="label label-danger">View All</span></a></div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                  <div class="table-responsive">
                    <table class="table no-margin">
                      <thead>
                        <tr>
                          <th>Date</th>
                          
                          <th>Point/ Rs.</th>
                        </tr>
                      </thead>
                      <tbody>
                      <?php
					  	$rsRedeemData = fetchAllRedeemData();
						if(count($rsRedeemData) > 0) {
							for($rp=0; $rp<count($rsRedeemData); $rp++) {
                      ?>
                        <tr>
                          <td><?php echo date("d/m/Y",strtotime($rsRedeemData[$rp]['created_date']));?></td>
                          <td><span class=""> <span>Point</span> - <?php echo $rsRedeemData[$rp]['point'];?> </span></td>
                        </tr>
                      <?php } 
					  
					  }else{ ?>
						  <tr>
                          		<td colspan="2"> No any data found </td>
                          </tr>
					  <?php } ?>  
                        
                        
                        
                      </tbody>
                    </table>
                  </div>
                  <!-- /.table-responsive --> 
                </div>
                <!-- /.box-body --> 
                
              </div>
            </div>
			
			<div class="col-md-3 cus-pro">
              <div class="small-boxs">
                <div class="box-header with-border headline">
                  <h3 class="box-title">Purchase History</h3>
                  <div class="box-tools pull-right" style="margin:8px 0px;"> <a href="emailer.html?v=list"> <span class="label label-danger">View All</span></a></div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                  <div class="table-responsive">
                    <table class="table no-margin">
                      <thead>
                        <tr>
                          <th>Date</th>
                          <th>Status</th>
                          <th>Point/ Rs.</th>
                        </tr>
                      </thead>
                      <tbody>
                      <?php
					  	$rsRedeemData = fetchAllPurchaseHistoryData();
						if(count($rsRedeemData) > 0) {
							for($rp=0; $rp<count($rsRedeemData); $rp++) {
                      ?>
                        <tr>
                          <td><?php echo date("d/m/Y",strtotime($rsRedeemData[$rp]['created_date']));?></td>
                          <td><span class=""><?php echo $rsRedeemData[$rp]['status'];?> </span></td>
                          <td><span class=""> <span>Rs</span> - <?php echo $rsRedeemData[$rp]['totalprice'];?>/- </span></td>
                        </tr>
                      <?php } 
					  
					  }else{ ?>
						  <tr>
                          		<td colspan="2"> No any data found </td>
                          </tr>
					  <?php } ?>  
                        
                        
                        
                      </tbody>
                    </table>
                  </div>
                  <!-- /.table-responsive --> 
                </div>
                <!-- /.box-body --> 
                
              </div>
            </div>
         

		 </div>
       
<div class="col-md-3 cus-pro">
              <div class="small-boxs">
                <div class="box-header with-border headline">
                  <h3 class="box-title">Subscription Email</h3>
                  
                </div>
                <!-- /.box-header -->
                <div class="box-body" style="height: 250px;">
                  <div class="table-responsive">
                     <div class="col-lg-12 bonas-main">
                              <div class="my-point"><p class="subscrib-email"><i class="fa fa-envelope" aria-hidden="true"></i>&nbsp;<?php echo fetchRemainPointClient('email');?></p></div>
                              	<p class="f-bounes"><i><?php echo ucwords(number_to_word(fetchRemainPointClient('email'))); ?></i></p>
                            </div>
				  </div>
                  <!-- /.table-responsive --> 
                </div>
                <!-- /.box-body --> 
                
              </div>
            </div>
			
			<div class="col-md-3 cus-pro">
              <div class="small-boxs">
                <div class="box-header with-border headline">
                  <h3 class="box-title">Subscription SMS</h3>
                  
                </div>
                <!-- /.box-header -->
                <div class="box-body" style="height: 250px;">
                  <div class="table-responsive">
                     <div class="col-lg-12 bonas-main">
                              <div class="my-point"><p><i class="fa fa-commenting-o" aria-hidden="true"></i>&nbsp;0</p></div>
                              <p class="f-bounes"><i>Zero</i></p>
                            </div>
				  </div>
                  <!-- /.table-responsive --> 
                </div>
                <!-- /.box-body --> 
                
              </div>
            </div>







	   <?php } ?>
          <script>
     $(function() {
                $('#profile-image1').on('click', function() {
                    $('#profile-image-upload').click();
                });
            });       
                </script> 
          <script> 
    $(document).ready(function(){
        $("#flip").click(function(){
            $("#panel").slideToggle("slow");
        });
    });
    </script>
    
    <div class="modal fade in" id="modal-default-owner" style="display: none; padding-right: 17px;">
          <div class="modal-dialog own-point">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <input type="hidden" name="total_redeem_point" id="total_redeem_point" value="<?php echo fetchTotalPointsClient();?>" />
                  <span aria-hidden="true">×</span></button>
                <h4 class="modal-title">Redeem Your Point</h4>
              </div>
              <div class="modal-body">
				<!--<form name="frmRedeem" id="frmRedeem" method="post" action=""> -->
                <div class="owner-redeem-option">
                    <div class="tab">
                      <button class="tablinks" onclick="openCity(event, 'London')" id="defaultOpen">Emailer</button>
                    </div>
                    
                    <div id="London" class="tabcontent" >
                      <div class="col-md-6">
                      <h3>Email</h3>
                      <p>1 Bonus Point=1 Credit</p>
                      <p>Your Bonus Point <span class="own-point"><?php echo fetchTotalPointsClient();?></span></p>
                      <p>Exchange <input class="ent-point" type="number" id="number_val" name="number_val" value=""></p>
                      
                      <br>
                      <button type="button" class="btn choos-file btn-default" onclick="javascript: redeem_point_client()" style="background: #d29c21; color: #fff; font-size: 17px !IMPORTANT; box-shadow: 1px 1px 3px black;}">Redeem now</button>
                   </div>
				   
				   <div class="col-md-6">
					   
					<div class="exchange">
					
					<img src="theme/black/images/mail_exchange.png">		
					</div>					
					</div>
				   
				   
				   </div>
                    
                    
                    <!--horizontal-tabbing-script-->
                    
                    </div>
				<!--</form> -->
				
              </div>
              <div class="modal-footer"></div>
            </div>
           
          </div>
       
        </div>




        


        

      



					<script>
					
					function validatEamilRequest(){
						var pt = document.getElementById('email_request').value.trim();
						
						if( parseInt(pt) <= 0) {
							document.getElementById('email_request').style.border = '1px solid red';
							return false;
						}
						
						var xhttp12 = new XMLHttpRequest();
						xhttp12.onreadystatechange = function() {
							if (xhttp12.readyState == 4 && xhttp12.status == 200) {
								 if(xhttp12.responseText == 0){
									alert('Your email purchase request has been added successfuly, we will contact you soon !');
									window.location.href = 'profilenew.html';
								 }else 
								 if(xhttp12.responseText == 1){
									alert('Oops, Here is something wrong to add email purchase request, please try agai!');
									window.location.href = 'profilenew.html';
								 }
							}
						};
						xhttp12.open("GET", "runajax.php?acn=insertemailrequest&point="+pt, true);
						xhttp12.send();
					}
				
					function redeem_point_client(){
						var pt = document.getElementById('total_redeem_point').value.trim();
						var number_val = document.getElementById('number_val');
						var nval = parseInt(number_val.value.trim());
						//alert(number_val.value.trim() +" = "+ pt);
						//return false;
						
						/*
						if( number_val.value.trim() == 0 ){
							number_val.style.border = '1px solid red';
							return false;
						}else*/ 
						if( nval >= parseInt(pt)) {
							number_val.style.border = '1px solid red';
							return false;
						}else{
							number_val.style.border = '1px solid #ddd';
						}
						
						var xhttpxx = new XMLHttpRequest();
						xhttpxx.onreadystatechange = function() {
							if (xhttpxx.readyState == 4 && xhttpxx.status == 200) {
								 if(xhttpxx.responseText == 0){
									alert('Your bonus point redeemed successfuly with email!');
									window.location.href = 'profilenew.html';
								 }else 
								 if(xhttpxx.responseText == 1){
									alert('Oops, You dont have sufficient redeemable point!');
									window.location.href = 'profilenew.html';
								 }
							}
						};
						xhttpxx.open("GET", "runajax.php?acn=total_redeem_point&point="+nval, true);
						xhttpxx.send();
						
						
						
					}
                    function openCity(evt, cityName) {
                        var i, tabcontent, tablinks;
                        tabcontent = document.getElementsByClassName("tabcontent");
                        for (i = 0; i < tabcontent.length; i++) {
                            tabcontent[i].style.display = "none";
                        }
                        tablinks = document.getElementsByClassName("tablinks");
                        for (i = 0; i < tablinks.length; i++) {
                            tablinks[i].className = tablinks[i].className.replace(" active", "");
                        }
                        document.getElementById(cityName).style.display = "block";
                        evt.currentTarget.className += " active";
                    }

                    // Get the element with id="defaultOpen" and click on it
                    document.getElementById("defaultOpen").click();
                    </script>
    
          <?php } ?>
        </div>
      </div>
    </div>
  </div>
</div>
</div>
</section>
</div>
<style>
.modal-header small.label.bg-yellow {
    font-size: 30px;
    border-radius: 11px;
}



.edit-profile button {
    font-size: 22px;
    padding: 11px 30px;
    background: #e08e0b;
}

.edit-profile {margin-top:25px;}
.box-header.with-border {
        background: #394247;
}
.profile-box {
    margin-top: 17px;
}
.box-body.map {
    background: whitesmoke;
}

.box-header.with-border.box-header { border-radius:4px;}

  
  
     .modal-content .modal-header .my-point{    width: 75px;
    height: 75px;
    float: left;}
	
	
	   .modal-content .modal-header .my-point P{ padding: 21px 0;
    TEXT-ALIGN: CENTER;
	   font-size: 25px;}
	   
	   .popover.fade.right.in h3.popover-title {
    color: black !IMPORTANT;
    font-size: 19px !IMPORTANT;
    box-shadow: 0 0 black !important;
}
 .popover.fade.right.in{
 WIDTH: 193PX;}
 .count-price {
    text-align: center;
    height: 200px;
    border: 1px solid #ddd;
    margin-top: 38px;
}
.counting-price {
    /* clear: both; */
    width: 74%;
    margin: 0 auto;
    display: flow-root;
    text-align: center;
}
.counting-price p {
  
    font-size: 17px !IMPORTANT;
    width: 250px; text-align:right;
}
.total-price {
	border-top:1px solid #ddd;
}
.card-info .validity , .card-info .descri {
    font-size: 14px;
    margin-bottom: 4px;    clear: both;
   
}

</style>

<!----TOOLTIP PRICE-->
<script>
$(document).ready(function(){
    $('[data-toggle="popover"]').popover();   
});
</script>



<script>
	$(document).ready(function(e) {
        $('#email_request').keyup(function(){
			
			var req = parseInt($(this).val());
			if(req < 0 || req == '' || isNaN(req)){
				$(this).val(0);
				req = 0;
				//return false;
			}
			
			var paisa = req * .04;
			var tax =  (paisa * 18 / 100);
			tax = tax.toFixed(2)
			var rs = (parseFloat(paisa)+parseFloat(tax));
			rs = rs.toFixed(2)
			
			$('#total-rs').html('<p class="pull-right">'+req+' Email X .04 Paisa = <span class="pull-right">'+paisa+'</span></p><p class="pull-right">18% Tex = <span class="pull-right">'+tax+'</span></p><p class="pull-right total-price">Total Rs. = <span class="pull-right">'+rs+'</span></p>');
			
			/*var xhttp12 = new XMLHttpRequest();
			xhttp12.onreadystatechange = function() {
				if (xhttp12.readyState == 4 && xhttp12.status == 200) {
					document.getElementById("city-data").innerHTML = xhttp12.responseText;
			   }
			};
			xhttp12.open("GET", "runajax.php?acn=fetchCityData&sid="+sid, true);
			xhttp12.send();
			*/
			
		})
    });


function isNumberKey(evt,event)
{
	 var charCode = (evt.which) ? evt.which : evt.keyCode
	 if (charCode > 31 && (charCode < 48 || charCode > 57))
		return false;
	
	 return true;
}	
</script>



<div class="modal fade in" id="modal-default-owner12" style="display: none; padding-left: 8px;">
          <div class="modal-dialog own-point" style="width: 60%;">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <input type="hidden" name="total_redeem_point" id="total_redeem_point" value="230">
                  <span aria-hidden="true">×</span></button>
                <h4 class="modal-title">Email Purchase</h4>
              </div>
              <div class="modal-body">
				<!--<form name="frmRedeem" id="frmRedeem" method="post" action=""> -->
                <div class="owner-redeem-option">
                    <div class="tab">
                      <button class="tablinks active" onclick="openCity(event, 'London')" id="defaultOpen">Emailer</button>
                    </div>
                    
                    <div id="London" class="tabcontent " style="display: block;">
                      <div class="col-md-7">
                  <h3>Email Purchase Request</h3>
			     <p>1 Email = 4 Paisa</p>
			     <p>Email Quantity <input class="ent-point" type="text" id="email_request" name="email_request" value=""></p>     
				 <br>
				 <button type="button" class="btn choos-file btn-default" onclick="javascript: validatEamilRequest();"  style="background: #d29c21; color: #fff; font-size: 17px !IMPORTANT; box-shadow: 1px 1px 3px black;}">Purchase Email</button>

 
                      
                     </div>
					 <div class="col-md-5">
					 <div class="price-arrow-left"><img src="theme/black/images/price-arrow.png"></div>
					<!--- <i class="fa fa-arrow-left" aria-hidden="true"></i>-->
					 <div class="count-price">
					    <h3>your price is</h3>
						<div class="counting-price" id="total-rs">
						 <p class="pull-right">00 Email = <span class="pull-right">00</span></p>
						 <p class="pull-right">18% Tax = <span class="pull-right">00</span></p>
						 <p class="pull-right total-price">Total Rs. = <span class="pull-right">00</span></p>
						 </div>
						 </div>
					</div>
					
                    </div>
					
					
                    
                    
                    <!--horizontal-tabbing-script-->
                    
                    </div>
				<!--</form> -->
				
              </div>
              <div class="modal-footer"></div>
            </div>
           
          </div>
       
        </div>
		
		
		
		
	
	<!--	<div class="modal fade in" id="purchase-sms" style="display:none; padding-right: 17px;">
          <div class="modal-dialog own-point">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">×</span></button>
                <h4 class="modal-title">Purchase Email</h4>
              </div>
              <div class="modal-body">
			  <div class="col-md-12" style="text-align: center; border-right: 1px solid #ddd; margin-top: 23px; margin-bottom: 20px;">
			   <h3>Email Purchase Request</h3>
			   <p>1 Email = 4 Paisa</p>
			  
			   
			   <br>
			   <p>Email Quantity <input class="ent-point" type="number" id="email_request" name="email_request" value=""><a href="#"  type="button" class="btn btn-block btn-primary col-md-2" data-toggle="popover" title="your price" data-content="Rs.500" style="width: 100px;float: left;">count price</a></p>     
 

			   <br>
			   <button type="button" class="btn btn-default" onclick="javascript: validatEamilRequest();"  style="background: #d29c21; color: #fff; font-size: 17px !IMPORTANT; box-shadow: 1px 1px 3px black;}">Purchase Email</button>

 



			 </div>
			   
                
              </div>
              <div class="modal-footer">
                
              </div>
            </div>
            
          </div>
          
        </div>---->
		
		
		
		
		
				<div id="pwdModal2" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" style="display: none;">
    <div class="modal-dialog redem" style="    width: 90%;">
        <div class="modal-content">
            <div class="modal-header">
			
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="opacity: 14; color:#a5a2a2;font-size:35px; padding: 1px 17px;">×</button>
                 <h2 class="text-center" style="color:#000;">Redeem Your Point  <small class="label  bg-yellow"><?php echo $totalPoints =  $objProfile->fetchTotalBonus();?></small>
			
			</h2>

            </div>
            <div class="modal-body">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-body">
                          
                          <?php
								$SQL = "SELECT * FROM beatle_products WHERE stock != 0";
								$rsProducts = $objDB->sql_query($SQL);
								
								//echo "<pre>";
								//print_r($rsProducts);
								//echo "</pre>";
								
								
								if(count($rsProducts) > 0){ 
								
								for($i=0; $i<count($rsProducts); $i++ ) { 
								
									$div = $i%4; 
								
									//if($div == 0) { echo '<div class="text-center Redeem-main">'; }
								?>
									
								
                              	<div class="col-md-3 Redeem-box">
                                   <div class="Redeem-item">
                                   
                                  <?php
								  if($_SERVER['HTTP_HOST']=='localhost' || $_SERVER['HTTP_HOST']=='kalpeshpc' ) { 
								  		echo '<img src="http://'.$_SERVER['HTTP_HOST'].'/newdemo.beatleanalytics.com/assets/products/'.$rsProducts[$i]['prod_image'].'">';
								  }else{
										if(SUBDOMAIN_NAME == 'owner'){ 
											echo '<img src="http://newdemo.beatleanalytics.com/assets/products/'.$rsProducts[$i]['prod_image'].'">';
										}else if(SUBDOMAIN_NAME == 'manage'){
											echo '<img src="http://manage.beatleanalytics.com/assets/products/'.$rsProducts[$i]['prod_image'].'">';
										}
								  } 
								  ?>
                                   
                                   
                                   </div>
                                   <div class="point-rd">
								   <p style="margin:0;">BeatleBuddy</p>
                                   <b><?php echo $rsProducts[$i]['name'];?></b>
                                   <p><?php echo $rsProducts[$i]['points'];?><span> Point</span></p>
                                   
                                  <div class="col-md-3"></div>
                                   <div class="col-md-6 prodacat-btn">
                                   <?php
								   	if($totalPoints >= $rsProducts[$i]['points']) {
                                   ?>
                                   <a href="orderprocess.html?prid=<?php echo $rsProducts[$i]['productid'];?>" class="btn btn-block btn-primary">Redeem Now</a>
                                   <?php } else {   ?>
								   <a onclick="javascript:;" href="#" class="btn btn-block btn-primary disabled">Redeem Now</a>
								  <?php  }?>
                                   
                                   </div>
								   <div class="col-md-3"></div>  
                                   
                                   </div>
							  	</div>
								
								<!-----26-12-2017---->
							<!---	<div class="col-md-3">
            <div class="bx-box footer-box offer-data" style="height: 537px;">
            <div class="box-header ui-sortable-handle bx-box" style="cursor: move;">
              <i class="ion ion-clipboard"></i>
                <h3 class="box-title" style="width:100%;">	<div class="title"> <strong>Title :	&nbsp; </strong> </div> <div> my third offers in BA </div></h3>
            </div>
          
            <div class="box-body sub">
              <div class="card-img">
			  <div class="card" style="text-align:center;" id="festival-banner"><img style="width:100% !important; height:250px !important;" class="card-bkimg" alt="" src="theme/black/images/offer-banner.png"></div>
             </div> 
			 <div class="card-info" style="text-align: left;">
			     <div class="validity"> <strong>Offer Validity : 	&nbsp;</strong> <span> 27/10/2017 00:00 AM to 30/10/2017 23:59 PM</span> </div>
                <div class="validity"> <strong>Point require : 	&nbsp;</strong>  <span>500 </span> </div>
                
			 </div>
			 <br>
              <a href="orderprocess.html?prid=<?php echo $rsProducts[$i]['productid'];?>" class="btn btn-block btn-primary fancy-btn" style="width: 125px; margin: 0 auto;">Redeem</a>
            </div>
          
            
          </div>
          
       </div>----->
	   
	   
								
								<!------//26-12-2017----->

                            
								<?php  
									//if($div == 3 || $div == count($rsProducts)-1) { echo '</div> <hr>'; }
								}
								
								} else{
									
									echo 'No any products found';
									
								} ?>
                          	
                           
							
							
							
							
							
							
							 
                        </div>
                    </div>
                </div>
            </div>
          <div class="modal-footer">
                <!---  <div class="col-md-12">
                    <button class="btn" data-dismiss="modal" aria-hidden="true" style="padding: 8px 30px; margin:0px;
    font-size: 19px;">Cancel</button>
                </div>---->
            </div>
        </div>
    </div>
</div>





<!-------bonuss-point-round-start---->
<style>

.heads {
background:url(theme/black/images/redeem-round.png); background-repeat:no-repeat;
z-index: 2;
transform: rotateY(0deg);
}
.tails {
background:url(theme/black/images/tails.png); background-repeat:no-repeat;
z-index: 1;
transform: rotateY(180deg);
}

.bonus-point {
background:url(theme/black/images/development.png); background-repeat:no-repeat; height: 261px;     height: 261px;
margin: 0 auto;
text-align: center;
width: 178px;
}
	
	
</style>