<?php include 'admin/includes/db_config.php';?>
<?php $page="about-us";?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Top Notch Real Estate</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/revolution-slider.css" rel="stylesheet">
<link href="css/jquery-ui.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link rel="shortcut icon" href="images/favicon.png" type="image/x-icon">
<link rel="icon" href="images/favicon.png" type="image/x-icon">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link href="css/responsive.css" rel="stylesheet">
<link href="css/home.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<style>
.news-detail-section .comments-container .comments-area .comment-box.reply-comment{
	margin-left:0px!important;
}
.btn-style-two:hover{
    color:white;
}
</style>
<?php
	$success=0;
if(isset($_REQUEST['submit'])){

$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$phone=$_REQUEST['phone'];
$msg=$_REQUEST['message'];
$message="<p>Name: ".$name."</p>";
$message.="<p>Email: ".$email."</p>";
$message.="<p>Phone: ".$phone."</p>";
$message.="<p>Message: ".$msg."</p>";
$to = "infotopnotchrealestate@gmail.com";
//$to = "karim@topnotchdubai.com";
$subject = "Feedback from Top Notch Real Estate";
$from =$email;
$headers = "From:" . $from."\r\n";
$headers .= "Content-type: text/html\r\n"; 
//$headers .= 'Cc: info@topnotchdubai.com' . "\r\n";
//$headers .= 'Cc: prog2@infobahnworld.com' . "\r\n";

mail($to,$subject,$message,$headers);
$success=1;

}

?>
<body>
<div class="page-wrapper">
 	
  <?php include 'header.php';?>
    
   <section class="page-title" style="background-image:url(images/feedback.jpg);">
<!--        <div class="overlay-layer"></div>-->
        <div class="auto-container" style="max-width:190px;background-color: rgba(0, 0, 0, 0.6);">
            <div class="content-box">
                <h2>Feedback </h2>
            </div>
        </div>
    </section>
     
    <!-- <section class="page-info">
        <div class="auto-container">
        	Breadcrumb
            <div class="breadcrumb-outer">
                <ul class="bread-crumb clearfix">
                    <li><a href="index.php">Home</a></li>
                    <li class="active">Feedback</li>
                </ul>
            </div>
        </div>
    </section>-->
    <!--Sidebar Page-->
    <div class="sidebar-page-container" style="padding-top:40px!important">
        <div class="auto-container">
            <div class="row clearfix">
				
                <!--Content Side-->
                <div class="content-side col-lg-12 col-md-12 col-sm-12 col-xs-12">
                       <?php if($success==1) {?>
                        <p style="
    color: #097c17;
    font-weight: 600;
    font-size: 17px;">Thank You. Your feedback recieved successfully.</p>
                        <?php } ?>
                        <?php if($success==2) {?>
                         <p style="
    color: #097c17;
    font-weight: 600;
    font-size: 17px;">Please enter values in mandatory fields</p>
                        <?php } ?>
                    <!--News Details Section-->
                    <section class="news-detail-section">
                        <div class="text-center"><button type="submit" class="theme-btn btn-style-two" data-toggle="modal" data-target="#feedbackmodal" style="background:red;border:none;">Click Here to give Experiential Feedback with Top Notch Real Estate &ensp; <i class="fa fa-edit"></i></button></div><br>
                        <!--Comments Container-->
                        <div class="comments-container">
                            <div class="comments-area">
							        <?php
									if (isset($_GET['page_no']) && $_GET['page_no']!="") {
	$page_no = $_GET['page_no'];
	} else {
		$page_no = 1;
        }

	$total_records_per_page = 10;
    $offset = ($page_no-1) * $total_records_per_page;
	$previous_page = $page_no - 1;
	$next_page = $page_no + 1;
	$adjacents = "2"; ?>
							       <?php
									$result_count = mysqli_query($con,"SELECT COUNT(*) As total_records FROM tbl_feedback");
									$total_records = mysqli_fetch_array($result_count);
									//$total_records_per_page=10;
	$total_records = $total_records['total_records'];
    $total_no_of_pages = ceil($total_records / $total_records_per_page);
	$second_last = $total_no_of_pages - 1; // total page minus 1
									//print_r($second_last);
									
							$sel_news=mysqli_query($con,"select * from tbl_feedback order by feedback_id desc LIMIT $offset, $total_records_per_page ");
							while($res_news=mysqli_fetch_array($sel_news)) {
							
							?>
                                <!--Comment Box-->
                                <div class="comment-box reply-comment">
                                    <div class="inner-box" style="padding-left:0px!important;">
                                        <div class="comment-info"><strong><?php echo $res_news['name'];?></strong></div>
                                        <div class="text"><?php echo $res_news['message'];?></div>
                                        
                                    </div>
                                </div>
							<?php } ?>
                            </div>
                        </div>
						
						  <!-- Modal -->
  <div class="modal fade" id="feedbackmodal" role="dialog">
    <div class="modal-dialog">
    
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
         
          <h4 class="modal-title">Feedback Form</h4>
        </div>
		  <form method="post" action="" >
        <div class="modal-body">
		<div class="form-container">
                <div class="default-form contact-form">
                  
                        <div class="row clearfix">
						<div class="form-group col-md-6 col-sm-6 col-xs-12">
                                <input type="text" name="name" placeholder="Full Name" required>
                            </div>
                            
                            <div class="form-group col-md-6 col-sm-6 col-xs-12">
                                <input type="email" name="email" placeholder="Email Address" required>
                            </div>
                            
                            <div class="form-group col-md-12 col-sm-12 col-xs-12">
                                <input type="text" name="phone" placeholder="Phone">
                            </div> 
                              
                            <div class="form-group col-md-12 col-sm-12 col-xs-12">
                                <textarea name="message" placeholder="Feedback" required></textarea>
                            </div>
                         
							</div>
							
						</div>
					</div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
		     
                        
                                <div class="text-center"><button type="submit" name="submit" class="btn btn-default pull-right" style="background-color:#0a3a69;color:white;">Submit Feedback</button></div>
                          
        </div>
		</form>
      </div>
      
    </div>
  </div>
  
  

                    </section>
					          <div style='padding: 10px 20px 0px; border-top: dotted 1px #CCC;' class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<strong>Page <?php echo $page_no." of ".$total_no_of_pages; ?></strong>
</div> 
								
<ul class="pagination col-lg-12 col-md-12 col-sm-12 col-xs-12">
	<?php // if($page_no > 1){ echo "<li><a href='?page_no=1'>First Page</a></li>"; } ?>
    
	<li <?php if($page_no <= 1){ echo "class='disabled'"; } ?>>
	<a <?php if($page_no > 1){ echo "href='?page_no=$previous_page'"; } ?>>Previous</a>
	</li>
       
    <?php 
	if ($total_no_of_pages <= 10){  	 
		for ($counter = 1; $counter <= $total_no_of_pages; $counter++){
			if ($counter == $page_no) {
		   echo "<li class='active'><a>$counter</a></li>";	
				}else{
           echo "<li><a href='?page_no=$counter'>$counter</a></li>";
				}
        }
	}
	elseif($total_no_of_pages > 10){
		
	if($page_no <= 4) {			
	 for ($counter = 1; $counter < 8; $counter++){		 
			if ($counter == $page_no) {
		   echo "<li class='active'><a>$counter</a></li>";	
				}else{
           echo "<li><a href='?page_no=$counter'>$counter</a></li>";
				}
        }
		echo "<li><a>...</a></li>";
		echo "<li><a href='?page_no=$second_last'>$second_last</a></li>";
		echo "<li><a href='?page_no=$total_no_of_pages'>$total_no_of_pages</a></li>";
		}

	 elseif($page_no > 4 && $page_no < $total_no_of_pages - 4) {		 
		echo "<li><a href='?page_no=1'>1</a></li>";
		echo "<li><a href='?page_no=2'>2</a></li>";
        echo "<li><a>...</a></li>";
        for ($counter = $page_no - $adjacents; $counter <= $page_no + $adjacents; $counter++) {			
           if ($counter == $page_no) {
		   echo "<li class='active'><a>$counter</a></li>";	
				}else{
           echo "<li><a href='?page_no=$counter'>$counter</a></li>";
				}                  
       }
       echo "<li><a>...</a></li>";
	   echo "<li><a href='?page_no=$second_last'>$second_last</a></li>";
	   echo "<li><a href='?page_no=$total_no_of_pages'>$total_no_of_pages</a></li>";      
            }
		
		else {
        echo "<li><a href='?page_no=1'>1</a></li>";
		echo "<li><a href='?page_no=2'>2</a></li>";
        echo "<li><a>...</a></li>";

        for ($counter = $total_no_of_pages - 6; $counter <= $total_no_of_pages; $counter++) {
          if ($counter == $page_no) {
		   echo "<li class='active'><a>$counter</a></li>";	
				}else{
           echo "<li><a href='?page_no=$counter'>$counter</a></li>";
				}                   
                }
            }
	}
?>
    
	<li <?php if($page_no >= $total_no_of_pages){ echo "class='disabled'"; } ?>>
	<a <?php if($page_no < $total_no_of_pages) { echo "href='?page_no=$next_page'"; } ?>>Next</a>
	</li>
    <?php if($page_no < $total_no_of_pages){
		echo "<li><a href='?page_no=$total_no_of_pages'>Last &rsaquo;&rsaquo;</a></li>";
		} ?>
</ul>

                </div>
                <!--Content Side-->
                

            </div>
        </div>
    </div>
   
   
   <?php include 'footer.php';?>
      
</div>
<!--End pagewrapper-->

<!--Scroll to top-->
<!--<div class="scroll-to-top scroll-to-target" data-target="html"><span class="icon fa fa-long-arrow-up"></span></div>-->

<script src="js/jquery-1.12.0.min.js"></script>
<!--<script src="js/jquery.js"></script> -->
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/bxslider.js"></script>
<script src="js/jquery.fancybox.pack.js"></script>
<script src="js/jquery.fancybox-media.js"></script>
<script src="js/validate.js"></script>
<script src="js/owl.js"></script>
<script src="js/wow.js"></script>
<script src="js/script.js"></script>
</body>

<!-- Mirrored from themexriver.com/shelter/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Tue, 17 Dec 2019 04:49:10 GMT -->
</html>
