ok
Direktori : /home2/selectio/www/wedding-info-new/ |
Current File : /home2/selectio/www/wedding-info-new/astrologer_view.php |
<?php if (isset($_SESSION["user"])) { header("location: login_first.php"); exit(); } include "header.php"; $u_id = $_SESSION["user"]["id"]; $ids = $_REQUEST["ids"]; $u_id =1; //hide future // $query_wishlist = "select * from tbl_astrologers_wishlist WHERE user_id = " . $u_id; $query_wishlist = "select * from tbl_astrologers_wishlist WHERE user_id = " . $u_id; $prepared2 = $pdo->prepare($query_wishlist); $prepared2->execute(); $result_wishlist = $prepared2->fetchAll(PDO::FETCH_ASSOC); // $query1 =" // SELECT * // FROM tbl_astrologer // WHERE verification_status = 1 AND ((NOW() NOT BETWEEN COALESCE(start_time, NOW()) AND end_time) OR start_time IS NULL); "; // $prepared1 = $pdo->prepare($query1); $query1 =" SELECT * FROM tbl_astrologer; "; $prepared1 = $pdo->prepare($query1); $prepared1->execute(); $result1 = $prepared1->fetchAll(PDO::FETCH_ASSOC); ?> <style> @import url('https://fonts.cdnfonts.com/css/segoe-ui-4'); #notification{ position: fixed; z-index: 1; width: 100%; } .img-count{ width: 95%; text-align: right; position: relative; bottom: 18px; color: white; font-size: medium; letter-spacing: 3px; } </style> <!--conditions--> <!--finally should delete start--> <section class="" style=" border-bottom:8px solid gray"> <div class="row" style=" font-family: 'Segoe UI', sans-serif; ;" > <div class="" style="height:auto;"> <div class="row "> <div class="col-12 col-sm-12" style=";" > <section class="top-space pt-0" style="margin-top: 20px;"> </section> <!-- profile section end --> </div> </div> </div> </div> </section> <!--finally should delete end--> <!--redirect id data end--> <!--all verified data start--> <?php foreach ($result1 as $resultr) { // TEST - START $query_avl = "select * from tbl_avl where user_id =".$resultr["id"] ; $prepared_avl = $pdo->prepare($query_avl); $prepared_avl->execute(); $available = $prepared_avl->fetchAll(PDO::FETCH_ASSOC); $row_count_avl = $prepared_avl->rowCount(); if ($row_count_avl > 0) { $current_date = date("Y-m-d"); $current_time = date("H:i:s"); $day = date("l", strtotime($current_date)); $time = "hidden"; $call = "Call Unavailable"; error_log($available[0]['monday_start']); if ($day == "Monday" && $available[0]['monday_start'] <= $current_time && $available[0]['monday_end'] >= $current_time) { $time = "show"; $call = ""; } elseif ($day == "Tuesday" && $available[0]['tuesday_start'] <= $current_time && $available[0]['tuesday_end'] >= $current_time) { $time = "show"; $call = ""; } elseif ($day == "Wednesday" && $available[0]['wednesday_start'] <= $current_time && $available[0]['wednesday_end'] >= $current_time) { $time = "show"; $call = ""; } elseif ($day == "Thursday" && $available[0]['thursday_start'] <= $current_time && $available[0]['thursday_end'] >= $current_time) { $time = "show"; $call = ""; } elseif ($day == "Friday" && $available[0]['friday_start'] <= $current_time && $available[0]['friday_end'] >= $current_time) { $time = "show"; $call = ""; } elseif ($day == "Saturday" && $available[0]['saturday_start'] <= $current_time && $available[0]['saturday_end'] >= $current_time) { $time = "show"; $call = ""; } elseif ($day == "Sunday" && $available[0]['sunday_start'] <= $current_time && $available[0]['sunday_end'] >= $current_time) { $time = "show"; $call = ""; }else{ $time = "hidden"; $call = '<button class="btn btn-solid btn-sm" data-bs-toggle="modal" data-bs-target="#available_time'.$resultr["id"].'" ><small> Available time </small> </button>'; } } // photos $user_id =$resultr["id"]; $pic_query = "SELECT * FROM `tbl_images` WHERE user_id = :user_id"; $prepared_pic = $pdo->prepare($pic_query); $prepared_pic->bindParam(':user_id', $user_id, PDO::PARAM_INT); // Assuming user_id is an integer $prepared_pic->execute(); $picture = $prepared_pic->fetchAll(PDO::FETCH_ASSOC); $row_count_picture = $prepared_pic->rowCount(); // TEST -END $query_wishlist_loop ="SELECT * FROM tbl_astrologers_wishlist WHERE user_id = " .$u_id ." AND astrologer_id = " .$resultr["id"]; $prepared = $pdo->prepare($query_wishlist_loop); $prepared->execute(); $result_wishlist_loop = $prepared->fetchAll(PDO::FETCH_ASSOC); $row_count = $prepared->rowCount(); $select_liked = ""; // if($result_wishlist_loop[0]['alliance_id']==$resultr['id'] ){ if ($row_count > 0) { $select_liked = "active inactive"; $insert = "active"; } else { $select_liked = "deactivate"; $insert = "deactive"; } ?> <section id="<?= $resultr["id"] ?>" style="border-bottom:8px solid gray"> <div class="row" style="font-family: ' font-family: 'Segoe UI', sans-serif; ;" > <div class="" style="height:auto; ;"> <div class="row"> <div class="col-12 col-sm-12" style="position:relative;"> <div class="row"> <div class="col-12 col-sm-12" style="margin-left: 0px;;" > <!-- profile section start --> <section class="top-space pt-0" style="padding-top:0px;margin-top: 0px;"> <div class="profile-detail" style="padding-bottom: 0px;padding-top: 6px; margin-left: -10px;position:relative"> <div class="media"> <img src="<?= $resultr["v_photos"]?>" class="img-fluid" style="width: 44px;height: 44px; border: 2px solid blue; margin-left: 10px; padding-left: 0px; margin-left: 5px;" alt="" /> <div class="media-body"> <span style="color:green;text-align:right;position:absolute;right: 16px;top: 11px;">Online</span> <h3 style="font-size: small;"><b><?= $resultr["name"] ?></b> </h3> </div> </div> </div> <div class="profile-detail" style="padding-top: 0px;padding-bottom: 0px; padding-left: 11px;"> <p style=" line-height:20px;margin-bottom: 0px;"><b><small><?php echo $resultr["lgl_address"] .",<br>" .$resultr["name"] ."," .$resultr["city"] ."," .$resultr[ "state" ]; ?></small></b></p> </div> </section> <!-- profile section end --> </div> </div> <!--<div class="carousel-item active" data-bs-interval="10000">--> <?php // $count = 1; // $row_count_picture += 1; ?> <div class="carousel slide" id="myCarousel<?= $resultr["id"] ?>" data-bs-ride="carousel"> <input type="hidden" value="<?= $resultr["id"] ?>" id="carousel_id<?= $resultr["id"] ?>" /> <div class="carousel-inner"> <div class="carousel-item active" data-bs-interval="100000"> <div class="d-flex justify-content-center align-items-center border rounded bg-dark" style="height: 300px; overflow: hidden;"> <img src="<?= $resultr["v_photos"] ?>" class="d-block h-100 object-cover" alt="..."> </div> </div> </div> </div> <!--<img style=" width: 96%;height: 30vh;object-fit: cover;margin-left: 5px;display: grid;place-items: center;margin-top: 5px;margin-bottom: 5px;" src="https://mdbcdn.b-cdn.net/img/new/standard/city/041.webp" style="height:50vh;;display:cover" class="img-thumbnail" alt="Hollywood Sign on The Hill" />--> <a style="position: absolute;top: 40%;right: 6%;color: white;font-size: 18px;border-radius: 27px;"> <div class="wishlist-btn <?= $select_liked ?>" id="wishlist_<?= $resultr["id"] ?>" onClick="wishlist(<?= $resultr["id"] ?>,'<?= $insert ?>')"> <i class="iconly-Heart icli"></i> <i class="iconly-Heart icbo"></i> <div class="effect-group"> <span class="effect"></span> <span class="effect"></span> <span class="effect"></span> <span class="effect"></span> <span class="effect"></span> </div> </div> </a> <a style="position: absolute;top: 50%;color: white;right: 8%;;font-size: 18px;"><i class="fa fa-share-alt" style=" border-radius: 20px; background: white; padding: 4px 5px 3px 4px; color: black; font-weight: 100;" aria-hidden="true"></i></a> </div> </div> <div class="row"> <div class="col-8 col-sm-8" style=" padding-top: 13px; margin-left: 0px; padding-left: 24px;" > <div class="product-content"> <ul style="padding-left: 11px;" class="ratings">4.5 <li><i class="iconly-Star icbo"></i></li> <li><i class="iconly-Star icbo"></i></li> <li><i class="iconly-Star icbo"></i></li> <li><i class="iconly-Star icbo"></i></li> <li><i class="iconly-Star icbo empty"></i></li> (54) </ul> </div> </div> <div class="col-4 col-sm-4" style="text-align: right;padding-right: 30px;" > <h3 style=" padding-top: 14px;"><b>ID NO</b> 001</h3> </div> </div> <div class="row" > <div class="col-12 col-sm-12" style="padding: 30px;padding-top: 0px;padding-bottom: 0px;"> <table class="table table-striped"> <tbody> <tr> <td>Experience</td> <td>:</td> <td><?= $resultr["experience"] ?></td> </tr> <tr> <td>Language</td> <td>:</td> <td><?= $resultr["language"] ?></td> </tr> <tr> <td>Plan Hrs</td> <td>:</td> <td><?= $resultr["plan_hrs"] ?></td> </tr> <tr> <td>Religion</td> <td>:</td> <td><?= $resultr["religion"] ?></td> </tr> </tbody> </table> </div> </div> </div> <center style=" margin-bottom: 21px;" > <a class=" btn-sm btn-outline"> Chat </a> <a class="btn-sm btn-solid" <?=$time?> >Call </a> <span><?=$call?></span></center> </div> </div> <!--people calling time start--> <div class="modal fade" id="available_time<?=$resultr["id"]?>" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" style="font-size: larger;" id="staticBackdropLabel"><b>Available Time</b></h5> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="table-responsive-sm"> <table class="table "> <tr> <th>Days</th> <th>Start Time</th> <th>End Time</th> </tr> <tr <?=($day == "Monday" ? "style='background: rgba(0, 0, 0, 0.05);'" : "");?> > <td>Monday</td> <td><?=date("g:i A", strtotime($available[0]['monday_start']))?></td> <td><?=date("g:i A", strtotime($available[0]['monday_end']))?></td> </tr> <tr <?=($day == "Tuesday" ? "style='background: rgba(0, 0, 0, 0.05);'" : "");?> > <td>Tuesday</td> <td><?=date("g:i A", strtotime($available[0]['tuesday_start']))?></td> <td><?=date("g:i A", strtotime($available[0]['tuesday_end']))?></td> </tr> <tr <?=($day == "Wednesday" ? "style='background: rgba(0, 0, 0, 0.05);'" : "");?> > <td>Wednesday</td> <td><?=date("g:i A", strtotime($available[0]['wednesday_start']))?></td> <td><?=date("g:i A", strtotime($available[0]['wednesday_end']))?></td> </tr> <tr <?=($day == "Thursday" ? "style='background: rgba(0, 0, 0, 0.05);'" : "");?> > <td>Thursday</td> <td><?=date("g:i A", strtotime($available[0]['thursday_start']))?></td> <td><?=date("g:i A", strtotime($available[0]['thursday_end']))?></td> </tr> <tr <?=($day == "Friday" ? "style='background: rgba(0, 0, 0, 0.05);'" : "");?> > <td>Friday</td> <td><?=date("g:i A", strtotime($available[0]['friday_start']))?></td> <td><?=date("g:i A", strtotime($available[0]['friday_end']))?></td> </tr> <tr <?=($day == "Saturday" ? "style='background: rgba(0, 0, 0, 0.05);'" : "");?> > <td>Saturday</td> <td><?=date("g:i A", strtotime($available[0]['saturday_start']))?></td> <td><?=date("g:i A", strtotime($available[0]['saturday_end']))?></td> </tr> <tr <?=($day == "Sunday" ? "style='background: rgba(0, 0, 0, 0.05);'" : "");?> > <td>Sunday</td> <td><?=date("g:i A", strtotime($available[0]['sunday_start']))?></td> <td><?=date("g:i A", strtotime($available[0]['sunday_end']))?></td> </tr> </table> <center class="text-danger" >Closed </center> </div> </div> </div> </div> <!--people calling time end--> </section> <?php } ?> <input id="userid" type="hidden" value="<?= $result[0]["verification_status"] ?>" /> <!--all verified data end--> <!-- login section end --> <!-- panel space start --> <!-- panel space end --> <script> $(document).ready(function(){ $('#read_more_cnt').hide() $('.read_more_cnt_').hide() $('#notification').hide() // $('#read_more').click(function(){ // var uid= $('#userid').val() // if(uid == 2){ // alert(uid); // $('#notification').show() // $('#read_more_cnt').hide() // } // }) }) function readMore_p(id,uid){ if(uid == 1){ $('#read_more').hide(); $('#read_more_cnt').show() }else{ $('#notification').show() setTimeout(function(){ $('#notification').hide(); // Hide the div }, 5000); $('#read_more').show(); } } function readMore(id,uid) { if(uid==1){ $('#read_more_cnt_' + id).show(); $('#read_more_' + id).hide(); }else{ $('#notification').show() setTimeout(function(){ $('#notification').hide(); // Hide the div }, 5000); $('#read_more').show(); } } </script> <?php include "footer2.php"; ?> <script> function wishlist_new(id, insert) { $("#wishlist_" + id).removeAttr("onclick"); $("#wishlist_" + id).attr("onclick", "wishlist(" + id + ", '" + insert + "')"); } function wishlist(id, insert) { $.ajax({ url: 'api/astrologer_wishlist.php', type: 'post', dataType: 'json', data: { id: id, type: 'wishlist', insert: insert }, success: function(response) { var text = response.element; var ids = response.ids; console.log(response); console.log("#wishlist_" + id +"text"+text); $("#wishlist_" + ids).removeAttr('onclick'); $("#wishlist_" + ids).attr('onclick', 'wishlist_new(' + ids + ', "' + text + '")'); if (response.status == 200) { // success(response.message); // wishlist(id, response.element); } else { // warning(response.message); console.warn(response.message); } } }); } </script> <script> $('.carousel-item').each(function() { console.log('Carousel'); var id =$('#carosal_id').val(); console.log('Carousel ID: '+id); $('#myCarousel'+id).on('slide.bs.carousel', function (e) { var id =$('#carosal_id').val(); var slideFrom = $(this).find('.active').index(); var slideTo = $(e.relatedTarget).index(); console.log("ID: "+id); console.log("slideFrom: "+slideFrom); console.log("slideTo: "+slideTo); console.log(slideTo + 1); // Update count $('#imageCount'+id).text(slideTo + 1); }); }); /*$(document).ready(function(){ var id =$('#carosal_id').val(); $('#myCarousel'+id).on('slide.bs.carousel', function (e) { var id =$('#carosal_id').val() var slideFrom = $(this).find('.active').index(); var slideTo = $(e.relatedTarget).index(); // Update count $('#imageCount'+id).text(slideTo + 1); }); }); function Carousel(id){ $('#myCarousel'+id).on('slide.bs.carousel', function (e) { var slideFrom = $(this).find('.active').index(); var slideTo = $(e.relatedTarget).index(); // Update count $('#imageCount'+id).text(slideTo + 1); }); }*/ </script> <script> $(document).ready(function() { $('.carousel').each(function() { var id = $(this).find('input[type="hidden"]').val(); $(this).on('slide.bs.carousel', function (e) { var slideFrom = $(this).find('.active').index(); var slideTo = $(e.relatedTarget).index(); $('#imageCount' + id).text(slideTo + 1); }); }); }); </script>