JezK
Edit File: professionalsList.php
<?php include('mainHeader.php'); if(!isset($_REQUEST['pid'])) { echo "<script>alert('Invalid details');window.location='index.php'</script>"; } $id=$users->encrypt_decrypt('decrypt',$_REQUEST['pid']); if($id<=0) { echo "<script>alert('Invalid details');window.location='index.php'</script>"; } $busiDet=$users->getBusiness('id',$id); $noOfProf=$users->getNoOfprofessional(); $getava=$users->getProfessionalBusinessList($id); $businesspic_main='img/dummybusinesspic.png'; if($busiDet['0']['business_pic']!='' && file_exists('uploads/'.$busiDet['0']['business_pic'])) { $businesspic_main='uploads/'.$busiDet['0']['business_pic']; } $parentIsProf = 0; $parentIsProf =$users->getParentIsProfessional($busiDet['0']['id']); ?> <html> <head> <meta charset="utf-8"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Video Consultation</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="robots" content="all,follow"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/custom.css"> <link rel="stylesheet" href="css/font-awesome.min.css"> <link rel="stylesheet" href="css/fontastic.css"> <!-- Google fonts - Roboto --> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"> <!-- Custom Scrollbar--> <link rel="stylesheet" href="css/jquery.mCustomScrollbar.css"> <!-- theme stylesheet--> <link rel="stylesheet" href="css/style.default.css" id="theme-stylesheet"> <link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="build/css/intlTelInput.css" /> <link rel="stylesheet" type="text/css" href="css/daterangepicker.css" /> <link rel="stylesheet" type="text/css" href="css/dataTables.bootstrap4.min.css"> <link rel="stylesheet" href="css/user.css" /> <link href='https://fonts.googleapis.com/css?family=Poppins' rel='stylesheet'> </head> <style> .masthead { padding-top: calc(6rem + 0px); padding-bottom: 6rem; } @media screen and (max-width: 768px) and (min-width: 360px) { .mrWidth { width: 100%; } } .bappntmnt { padding: 10px 60px; border-radius: 10px; border: none; background: #133087; color: white; font-weight: bold; } .bigbappntmnt { padding: 10px 53px; border: none; color: white; border-radius: 13px; background: #133087; font-weight: bold; } .textCgrey { color: rgb(122, 122, 122); ; } .textCblue { color: #133087; } .nv-pad { padding: 0px 20px; } .nv-pad>a { color: black !important; } .clsShadow { box-shadow: 0 0 3px !important; } .clsWord { word-spacing: 5px; } .social-media { display: inline-block; float: right; margin-bottom: 0; } .social-media li { display: inline-block; } .smlBorder:before { content: ""; position: absolute; left: 45%; top: 10px; height: 1px; width: 12%; /* percentage of the element width*/ border-bottom: 1px solid #133087; margin-top: 1.2em; } #home-section { background: #262626; position: relative; z-index: 999999; } body { font-family: 'Poppins' !important; font-weight: normal !important; } .scrollNav { top: 0 !important; } .navbartop { top: 0 !important; } .fixed-top-nav { position: fixed; top: 39; right: 0; left: 0; z-index: 1030; } </style> <body> <header class="masthead mt-4"> <div class="container flex-column"> <div class="row"> <div class="col-12 col-sm-6 col-md-6"> <!--<img src="./img/call.jpg" class="img-fluid" alt="" height="400px" width="582px"> --> <img src="<?php echo $businesspic_main;?>" class="img-fluid" alt="" height="400px" width="582px"> </div> <div class="col-12 col-sm-6 col-md-6"> <div class="px-5"> <h1 class="" style="font-size:27.8px;"><span class="smlBorder"><?php echo $busiDet[0]['business_name'];?></span></h1> <div></div> </div> <div class="px-5 py-4"> <p style="line-height:30px; " class="textCgrey"> <?php echo $busiDet[0]['about'];?> </p> </div> <div class="px-5 pb-5"> <h3>No of professionals : <?php echo isset($noOfProf[$busiDet['0']['id']])?($noOfProf[$busiDet['0']['id']] + $parentIsProf):$parentIsProf;?></h3> </div> <div class="px-5"> <div class="row"> <div class="col-sm-4 pt-4"> <h4 class="d-flex"> <img class="img-fluid" src="./img/greenverified.png" alt=""> <span class="pt-2">Verified</span></h4> </div> <?php if(array_search($id, array_column($getava, 'id')) !== false) { ?> <div class="col-sm-8 text-center"> <h4 class="textCblue">Consultation <?php echo $getava[0]['call_cost'];?><?php echo $recentPractCountry=="India"?"Rs.":($recentPractCountry=="United States"?"$":"");?>/ <?php echo $getava[0]['call_to_minutes'];?>min</h4> <?php if(isset($_SESSION['id'])){ ?> <a href="bookAppointment.php?pid=<?php echo $users->encrypt_decrypt('encrypt',$getava[0]['id']);?>" class="bigbappntmnt">Book Appointment</a> <?php }else{ ?> <a href="login.php?pid=<?php echo $_REQUEST['pid'];?>" class="bigbappntmnt">Book Appointment</a> <?php } ?> <!--<button class="bigbappntmnt">BOOK AN APPOINTMENT</button>--> </div> <?php } ?> </div> </div> </div> </div> </div> </header> <section class="bg-white pb-5"> <div class="container "> <div class="row"> <?php foreach($getava as $k=>$v){ // if($id ==$v['id']){ // continue; // } $businesspic='img/dummybusinesspic.png'; if($v['business_pic']!='' && file_exists('uploads/'.$v['business_pic'])) { $businesspic='uploads/'.$v['business_pic']; } $countryName = $users->getCountry($v['country']); ?> <div class="col-sm-6 col-md-4 col-lg-4 mt-4"> <div class="card"> <!--<img class="card-img-top" src="./img/call.jpg" width="350" height="263" style="border-bottom:3px solid #133087;">--> <img class="card-img-top" src="<?php echo $businesspic;?>" width="350" height="263" style="border-bottom:3px solid #133087;"> <div class="p-3 clsShadow"> <h4 class="textCblue"><?php echo (isset($v['business_name']) && $v['business_name']!='')?$v['business_name']:$v['professional_name'];?></h4> <p class="text-dark">Profesion : <span class="textCgrey"><?php echo $v['profession'];?></span></p> <p class="text-dark">Profesional Name : <span class="textCgrey"><?php echo $v['professional_name'];?></span></p> <p class="textCgrey clsWord"><span class="text-dark">About : </span> <?php echo $v['about'];?> </p> <p class="textCgrey"><span><img src="./img/locaddress.png" alt=""> </span><span class="text-dark">Address : </span> <?php echo $v['location'];?></p> <div class="text-center"> <h4 class="textCblue">Consultation <?php echo $v['call_cost'];?><?php echo $recentPractCountry=="India"?"Rs.":($recentPractCountry=="United States"?"$":"");?>/ <?php echo $v['call_to_minutes'];?>min</h4> </div> <!--<div class="text-center"><button class="bappntmnt">BOOK AN APPOINTMENT</button></div>--> <div class="text-center"> <?php if(isset($_SESSION['id'])){ ?> <a href="bookAppointment.php?pid=<?php echo $users->encrypt_decrypt('encrypt',$v['id']);?>" class="bappntmnt">Book Appointment</a> <?php }else{ ?> <a href="login.php?pid=<?php echo $_REQUEST['pid'];?>" class="bappntmnt">Book Appointment</a> <?php } ?> </div> </div> </div> </div> <?php }?> </div> </div> </section> <?php include('mainFooter.php') ?> <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBmzC6LorWBcIWA94XksFf6IrpHej_z_pI&callback=GetAddress"> </script> <script type="text/javascript" src="js/geoPosition.js"></script> <script type="text/javascript" src="js/geoPositionSimulator.js"></script> <script type="text/javascript" src="js/underscore.js"></script> <script> /*function detectlocation(){ var lat = "43.7667855" ; var long = "-79.2157321" ; var url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" +lat+","+long+"&sensor=false&key=AIzaSyBmzC6LorWBcIWA94XksFf6IrpHej_z_pI"; $.get(url,function(data) { var loc1 = data.results[0]; var county, city; $.each(loc1, function(k1,v1) { if (k1 == "address_components") { for (var i = 0; i < v1.length; i++) { for (k2 in v1[i]) { if (k2 == "types") { var types = v1[i][k2]; if (types[0] =="sublocality_level_1") { county = v1[i].long_name; alert ("county: " + county); } if (types[0] =="locality") { city = v1[i].long_name; alert ("city: " + city); return false; } } } } return false; } }); $('#location').html(city); }); return false; } */ function parse_place(place) { var location = []; for (var ac = 0; ac < place.address_components.length; ac++) { var component = place.address_components[ac]; switch (component.types[0]) { case 'locality': location['city'] = component.long_name; break; case 'administrative_area_level_1': location['state'] = component.long_name; break; case 'country': location['country'] = component.long_name; break; } }; return location; } function detectlocation() { //user clicks button if ("geolocation" in navigator) { //check geolocation available //try to get user current location using getCurrentPosition() method navigator.geolocation.getCurrentPosition(function(position) { /*$.ajax('https://maps.googleapis.com/maps/api/geocode/json?latlng=' + position.coords.latitude + ',' + position.coords.longitude + '&key=AIzaSyBmzC6LorWBcIWA94XksFf6IrpHej_z_pI') $.ajax('https://maps.googleapis.com/maps/api/geocode/json?latlng=16.9891,82.2475&key=AIzaSyBmzC6LorWBcIWA94XksFf6IrpHej_z_pI') .then( function success (response) { console.log('User\'s Address Data is ', response) }, function fail (status) { console.log('Request failed. Returned status of', status) } )*/ GetAddress(position.coords.latitude, position.coords.longitude); //alert(position.coords.latitude) //$("#result").html("Found your location <br />Lat : "+position.coords.latitude+" </br>Lang :"+ position.coords.longitude); }); } else { console.log("Browser doesn't support geolocation!"); } return false; } function GetAddress(lat, lng) { /*var latlng = new google.maps.LatLng(lat, lng); var geocoder = geocoder = new google.maps.Geocoder(); var findResult = function(results, name){ var result = _.find(results, function(obj){ return obj.types[0] == name && obj.types[1] == "political"; }); return result ? result.long_name : null; }; geocoder.geocode({ 'latLng': latlng }, function (results, status) { console.log(results); if (status == google.maps.GeocoderStatus.OK) { results = results[0].address_components; console.log(results); var city = findResult(results, "locality"); var state = findResult(results, "administrative_area_level_1"); var country = findResult(results, "country"); if(city!='' && city!=undefined) { $("#location").val(city) }else if(state!='' && state!=undefined) { $("#location").val(state) } else if(country!='' && country!=undefined) { $("#location").val(country) } } });*/ var latlng = new google.maps.LatLng(lat, lng); var geocoder = geocoder = new google.maps.Geocoder(); geocoder.geocode({ latLng: latlng }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { var arrAddress = results; $.each(arrAddress, function(i, address_component) { //console.log(address_component); if (address_component.types[0] == "locality") { $("#location").val(address_component.address_components[0].long_name) } /*else if(address_component.types[0] == "administrative_area_level_1"){ $("#location").val(address_component.address_components[0].long_name) } else if(address_component.types[0] == "country"){ $("#location").val(address_component.address_components[0].long_name) } */ }); } else { console.log("No results found"); } } else { console.log("Geocoder failed due to: " + status); } }); } function searchValidation() { if ($('#location').val() == '' && $('#search').val() == '') { alert("Please enter city or search"); return false; } } // $(document).ready(function() { $(window).scroll(function() { if ($(window).scrollTop() > 10) { $('nav.navbar ').addClass('navbartop'); } if ($(window).scrollTop() < 10) { $('#nav_bar').removeClass('navbartop'); } }); // }); $(document).ready(function(){ $(window).scrollTop(0); }); </script>