ok

Mini Shell

Direktori : /proc/self/root/home2/selectio/www/wedding-info-new/
Upload File :
Current File : //proc/self/root/home2/selectio/www/wedding-info-new/astrologer_profile.php


<?php  
        include "header.php";
        $u_id=$_SESSION['astrologer']['id'];
        // $query = "select tbl_alliances_register.* ,(select COUNT(id) FROM tbl_rewards WHERE tbl_rewards.user_id=tbl_alliances_register.id and tbl_rewards.verification_status='1') as verify from   tbl_alliances_register WHERE id = ". $u_id;
        $query = "select * FROM tbl_astrologer WHERE id = ". $u_id;
        $prepared2 = $pdo->prepare($query);
        $prepared2->execute();
        $result = $prepared2->fetchAll(PDO::FETCH_ASSOC);

        // Prepare the SQL statement with a placeholder
        $sql = "SELECT * FROM `tbl_wishlist` WHERE alliance_id = ".$u_id;
        $prepared_f = $pdo->prepare($sql);
        $prepared_f->execute();
        $results = $prepared_f->fetchAll(PDO::FETCH_ASSOC);
        $followers = $prepared_f->rowCount();


        // Now $results contains the fetched rows from the database

        
        // $row_count_follower = $result_f->rowCount();
        // img
        $query1 = "select * from   tbl_images where user_id = ".$u_id;
        $prepared3 = $pdo->prepare($query1);
        $prepared3->execute();
        $result2 = $prepared3->fetchAll(PDO::FETCH_ASSOC);
        $pic_row = $prepared3->rowCount();
        
        $query_rwd = "select * from   tbl_rewards where user_id = ".$u_id;
        $prepared_rwd = $pdo->prepare($query_rwd);
        $prepared_rwd->execute();
        $result_rwd = $prepared_rwd->fetchAll(PDO::FETCH_ASSOC);
        $pic_row_rwd = $prepared_rwd->rowCount();
        
        $query2 = "select * from   tbl_avl where user_id = ".$u_id ." and `user_of`= 3 ";
        $prepared3 = $pdo->prepare($query2);
        $prepared3->execute();
        $available = $prepared3->fetchAll(PDO::FETCH_ASSOC);
        
        ?>
<style>
        .image-container {
            position: relative;
        }

        .image {
            width: 200px; /* Set the original width of the image */
            height: auto; /* Maintain aspect ratio */
        }

        .enlarged {
    width: 200px;
    height: auto;
    position: absolute;
    top: 31%;
    z-index: 9999;
    margin-left: 25%;
        }
    .category-slider-container {
  width: 100%; /* Set the desired width for your container */
  overflow-x: scroll; /* Enable horizontal scrolling */
  white-space: nowrap; /* Prevent items from wrapping to the next line */
}




body{
  font-family: sans-serif;
 margin: 0px;
}

</style>
     <!-- user avtar section -->
      <!-- profile section start -->
     <section class="top-space pt-0" style="position:relative">
         <div class="profile-detail" style="padding-bottom: 0px;padding-top: 6px; margin-left: -10px;position:relative">
             <div class="media">
                 <img src="assets/images/user/1.png" class="img-fluid" style="width: 44px;height: 44px; margin-left: 10px;  padding-left: 0px;  margin-left: 5px;;border: 2px solid blue;" alt="" />
                 <div class="media-body">
                     <span style="color:green;text-align:right;position:absolute;right: 17px;top: 11px;">Online <?=$u_id?> </span>
                     <h3 style="font-size: small;"><b><?=$result[0]['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 $result[0]['lgl_address'].",<br>".$result[0]['name'].",".$result[0]['city'] .",".$result[0]['state']?></small></b></p>
    </div>
     <small><button style="position: absolute;
    top: 12px;
    right: 3px;
    top: 70px;
    font-size: 10px;
    padding: 0px;" class="btn btn-sm btn-danger" data-bs-toggle="modal" data-bs-target="#rewards">Rewards</button></small>
     </section>
     <!-- profile section end -->
     <!-- user avtar end -->
    
    <style>
            .follower_row{
                padding: 50px;
                padding-top: 5px;
                padding-bottom: 5px;
            }
            .inner{
                 display: grid;
                place-items: center;
                /*height: 5vh;*/
    
            }
        .custom-file-upload {
            border: 1px solid #ccc;
            display: inline-block;
            padding: 6px 12px;
            cursor: pointer;
        }
         .inner .btn.btn-sm {
        font-size: 14px;
        padding: 4px 14px;
        margin-bottom: 14px;
        }
        
    </style>
    <div class="row" style="padding-bottom: 20px;    --bs-gutter-x: -2.5rem;" >
        <div class="col-6 col-sm-6 inner" >
            <h3><b><?=$pic_row?></b></h3> 
            <p>Photos</p>
            
                         <a href="astrologer_register.php?edit=edit"> <button class="btn btn-solid btn-sm"  ><small> Edit </small> </button> </a>
                         <button class="btn btn-solid btn-sm"  data-bs-toggle="modal" data-bs-target="#plan" ><small> Plan </small> </button>
            
        </div>
        <div class="col-6 col-sm-6 inner" >
             <h3><b><?=$followers?></b></h3> 
             <a href="followers.php"> <p>Followers</p> </a>
            <button class="btn btn-solid btn-sm"  data-bs-toggle="modal" data-bs-target="#deactive" ><small> Disable Account  </small> </button>
             <button class="btn btn-solid btn-sm"  data-bs-toggle="modal" data-bs-target="#available" ><small> Available time </small> </button>
          

        </div>
    </div>
    

<!--people deactivate start-->
<div class="modal fade" id="rewards" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true" style="">
  <div class="modal-dialog modal-dialog-centered">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="staticBackdropLabel">Rewards</h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div>
<!--test-->
             
          

      </div>

    </div>
  </div>
</div>
<!--people deactivate end-->
<!--people deactivate start-->
<div class="modal fade" id="deactive" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true" style="">
  <div class="modal-dialog modal-dialog-centered">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="staticBackdropLabel">Deactivate</h5>
        
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div>
                <center><a href="#" class="btn btn-solid btn-sm" data-bs-toggle="modal" data-bs-target="#delete"  > <small>Permanently Deactivate </small></a> </center>
                <center><button class="btn btn-solid btn-sm"  data-bs-toggle="modal" data-bs-target="#staticBackdrop" ><small> Temporarily Suspend </small> </button>  </center>

             
          

      </div>

    </div>
  </div>
</div>
<!--people deactivate end-->
<!--people cedit start-->
<div class="modal fade" id="plan" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true" style="">
  <div class="modal-dialog modal-dialog-centered">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="staticBackdropLabel">Plans</h5>
        
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div>
          <form  id="plan_form" >
          <div class="container mt-2 mb-2">
                <label for="plan_hrs" class="form-label">Plan Hrs:</label>
                <input type="text" name="plan_hrs" id="plan_hrs" value="<?=$result[0]['plan_hrs']?>" class="form-control" >
            </div>
          <div class="container mt-2 mb-2">
                <label for="endDateTimePicker" class="form-label">Plan Mins:</label>
                <input type="text" name="plan_mins" id="plan_mins" value="<?=$result[0]['plan_mins']?>" class="form-control" >
            </div>
          <div class="container mt-2 mb-2">
                <label for="endDateTimePicker" class="form-label">Profile:</label>
                <input type="text" name="plan_profiles" id="plan_profiles" value="<?=$result[0]['plan_profiles']?>" class="form-control" >
            </div>
            <center><input type="submit" class="btn btn-sm btn-warning"  value="Submit" /></center>
              </form>
      </div>

    </div>
  </div>
</div>
<!--people cedit end-->
<!--people calling time start-->
<div class="modal fade" id="available" 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" id="staticBackdropLabel">Temproarily Disable</h5>
        
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
        <form id="available_form" >
        <div class="table-responsive-sm">

         <table class="table table-striped">
            <tr>
                <th></th>
                <th><label for="startDateTimePicker" class="form-label">Start Time:</label></th>
                <th><label for="startDateTimePicker" class="form-label">End Time:</label></th>
            </tr>
            <tr>
                <td>Monday</td>
                <td>
                    
                                    <input type="time" name="mon_start_time" id="mo" class="form-control" value="<?=$available[0]['monday_start'] ?>" >
                </td>
                <td>
                                <input type="time" name="mon_end_time"  value="<?=$available[0]['monday_end'] ?>" class="form-control" >
                </td>
            </tr>
            <tr>
                <td>Tuesday</td>
                <td>
                                <input type="time" name="tue_start_time" id="mo" class="form-control"value="<?=$available[0]['tuesday_start'] ?>" >
                </td>
                <td>
                                    
                                <input type="time" name="tue_end_time"  class="form-control"value="<?=$available[0]['tuesday_end'] ?>" >
                </td>
            </tr>
            
            <tr>
                <td>Wednesday</td>
                <td>
                                <input type="time" name="wed_start_time" id="mo" class="form-control"value="<?=$available[0]['wednesday_start'] ?>" >
                </td>
                <td>
                                    
                                <input type="time" name="wed_end_time"  class="form-control"value="<?=$available[0]['wednesday_end'] ?>" >
                </td>
            </tr>
            <tr>
                <td>Thursday</td>
                <td>
                                <input type="time" name="thur_start_time" id="mo" class="form-control"value="<?=$available[0]['thursday_start'] ?>" >
                </td>
                <td>
                                <input type="time" name="thur_end_time"  class="form-control"value="<?=$available[0]['thursday_end'] ?>" >
                </td>
            </tr>
            <tr>
                <td>Friday</td>
                <td>
                    <input type="time" name="fri_start_time" id="mo" class="form-control"value="<?=$available[0]['friday_start'] ?>" >
                    </td>
                    <td>
                    <input type="time" name="fri_end_time"  class="form-control"value="<?=$available[0]['friday_end'] ?>" >
                </td>
            </tr>
            <tr>
                <td>Saturday</td>
                <td>
                                <input type="time" name="sat_start_time" id="mo" class="form-control"value="<?=$available[0]['saturday_start'] ?>" >
                                </td>
                                <td>
                                    
                                <input type="time" name="sat_end_time"  class="form-control"value="<?=$available[0]['friday_end'] ?>" >
                </td>
            </tr>
            <tr>
                <td>Sunday</td>
                <td>
                                <input type="time" name="sun_start_time" id="mo" class="form-control"value="<?=$available[0]['sunday_start'] ?>" >
                                    
                                </td>
                                <td>
                                <input type="time" name="sun_end_time"  class="form-control"value="<?=$available[0]['sunday_end'] ?>" >
                </td>
            </tr>
            
                            
            
        </table>
        </div>
           
           
           
            <div class="container mt-2 mb-2 text-center">
                <input type="submit" class="btn btn-sm btn-success" value="Submit">
            </div>
    </form>

    </div>
  </div>
</div>
  
<!--people calling time end-->
<!--people calling time start-->
<div class="modal fade" id="staticBackdrop" 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" id="staticBackdropLabel">Temproarily Disable</h5>
        
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
    <form id="deactive_form" >
            <div class="container mt-2 mb-2">
                <label for="startDateTimePicker" class="form-label">Start Date and Time:</label>
                <input type="datetime-local" name="start_time" id="startDateTimePicker" value="<?=$result[0]['start_time']?>" class="form-control" >
            </div>
            <div class="container mt-2 mb-2">
                <label for="endDateTimePicker" class="form-label">End Date and Time:</label>
                <input type="datetime-local" name="end_time" id="endDateTimePicker" value="<?=$result[0]['end_time']?>" class="form-control" >
            </div>
            <div class="container mt-2 mb-2 text-center">
                <input type="submit" class="btn btn-sm btn-success" value="Submit">
            </div>
    </form>
    </div>
  </div>
</div>
<!--people calling time end-->
   <!-- tab section start -->
<!--delete account start-->
<div class="modal fade" id="delete" 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" id="staticBackdropLabel">Delete Account</h5>
        
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
    <form id="delete_form" >
            <div class="container mt-2 mb-2">
                <label for="feedback" class="form-label">Feedback:</label>
                <textarea name ="feedback" id="feedback" class="form-control" ></textarea>
            </div>
            <div class="container mt-2 mb-2">
                <label for="reason" class="form-label">Reason for delete</label>
                <textarea name ="reason" id="reason" class="form-control" ></textarea>
            </div>
             <input type="hidden" id="ids" value="<?= $_SESSION['user']['id'] ?>">
            <div class="container mt-2 mb-2 text-center">
                <input type="submit" class="btn btn-sm btn-success" value="Submit">
            </div>
           
    </form>
    </div>
  </div>
</div>


<!--delete account end-->



   
     <!-- panel space start -->
     <section class="panel-space"></section>
     <!-- panel space end -->


     <!-- bottom panel start -->
    
     


     
     
<script>
    $(document).ready(function(){

      $('#deactive_form').submit(function(event) {
        event.preventDefault(); // Prevent the form from submitting normally
        var startDateTime = $('#startDateTimePicker').val();
        var endDateTime = $('#endDateTimePicker').val();
        alert(endDateTime +startDateTime);
                     $.ajax({
    type: "POST",
    url: "api/deactive.php",
    data: {
        startDateTime: startDateTime,
        endDateTime: endDateTime,
        deactive_user: 2
    },
    dataType: "json",
    success: function(response) {
        if (response.success) {
            alert(response.message); // Show success message
        } else {
            alert("Error: " + response.message); // Show error message
        }
    },
    error: function(xhr, status, error) {
        console.error("AJAX Error: " + xhr.responseText); // Log AJAX error for debugging
    }
});

    
    });
      $('#delete_form').submit(function(event) {
        event.preventDefault(); // Prevent the form from submitting normally
        var feedback = $('#feedback').val();
         var ids = $('#ids').val();
        var reason = $('#reason').val();
        alert(feedback +reason);
                     $.ajax({
    type: "POST",
    url: "api/delete.php",
    data: {
        reason: reason,
        feedback: feedback,
        ids:ids
        
    },
    dataType: "json",
    success: function(response) {
        if (response.success) {
            alert(response.message); // Show success message
            window.location.href = "index.php";
        } else {
            alert("Error: " + response.message); // Show error message
        }
    },
    error: function(xhr, status, error) {
        console.error("AJAX Error: " + xhr.responseText); // Log AJAX error for debugging
    }
});

    
    });

        $("#exampleModal").click(); 
    });
     $("#upd_img").click(function () {
                // Trigger a click event on the file input element
                $("#files").click();
            });
     $("#rewards_img").click(function () {
                // Trigger a click event on the file input element
                $("#rewardss").click();
            });
        $("#files").change(function () {
                var fileCount = $('#files')[0].files.length;
                var selectedFile = this.files[0];
                if (selectedFile) {
                    $("#submit").click();
                }
            });
        $("#rewardss").change(function () {
                var fileCount = $('#rewardss')[0].files.length;
                var selectedFile = this.files[0];
                if (selectedFile) {
                    $("#submit_rewards").click();
                }
            });
    $('#photos_form').on('submit',function(e){
    e.preventDefault();
    alert("photos start......");
    var fileCount = $('#files')[0].files.length;
    var formData = new FormData(this);
    formData.append('type', 'photos_form');
    formData.append('count', fileCount);
    console.log(formData);
    $.ajax({
        url: 'api/profile_add.php',
        type: 'post',
        dataType: 'json',
        data: formData,
        cache: false,
        contentType: false,
        processData: false,
        success: function(response) {
            console.log(response);
            if (response['status'] == 200) {
                alert(response['message']);
                $(this).trigger("reset");
                window.location.href = 'profile-setting.php';
            } else {
                alert(response['message']);
            }
        }
    });
               })
    $('#rewards_form').on('submit',function(e){
    e.preventDefault();
    var fileCount = $('#rewardss')[0].files.length;
    alert(fileCount)
    var formData = new FormData(this);
    formData.append('type', 'rewards_form');
    formData.append('count', fileCount);
    console.log(formData);
    $.ajax({
        url: 'api/profile_add.php',
        type: 'post',
        dataType: 'json',
        data: formData,
        cache: false,
        contentType: false,
        processData: false,
        success: function(response) {
            console.log(response);
            if (response['status'] == 200) {
                alert(response['message']);
                $(this).trigger("reset");
                window.location.href = 'profile-setting.php';
            } else {
                alert(response['message']);
            }
        }
    });
               })
    
 function showAlert(id) {
      var confirmation = confirm("Do you want to delete item with ID: " + id + "?");
    if (confirmation) {
        $.ajax({
            url: 'api/profile_add.php',
            type: 'post',
            dataType: 'json',
            data: {type:"img-delete", id: id }, // Pass the ID to the server-side script
            success: function(response) {
                console.log(response);
                if (response['status'] == 200) {
                    alert(response['message']);
                    $(this).trigger("reset");
                    window.location.href = 'profile-setting.php';
                } else {
                    alert(response['message']);
                }
            }
        });

    } else {
        alert("Deletion cancelled for item  ");
    }
}
 function showAlertrwd(id) {
      var confirmation = confirm("Do you want to delete item with ID: " + id + "?");
    if (confirmation) {
        $.ajax({
            url: 'api/profile_add.php',
            type: 'post',
            dataType: 'json',
            data: {type:"rwd-delete", id: id }, // Pass the ID to the server-side script
            success: function(response) {
                console.log(response);
                if (response['status'] == 200) {
                    alert(response['message']);
                    $(this).trigger("reset");
                    window.location.href = 'profile-setting.php';
                } else {
                    alert(response['message']);
                }
            }
        });

    } else {
        alert("Deletion cancelled for item  ");
    }
}
        

</script>
<script>
     function modalImg(id) {
     $("#final").attr("src", id);

     $('#imgmodel').click();
  }
</script>
<script>
      
$(document).ready(function() {
    $('#available_form').submit(function(event) {
        event.preventDefault(); // Prevent form submission
        
        // Collect form data
        var formData = new FormData(this);
        console.log(formData);
        
        // Send AJAX request using modern syntax
        $.ajax({
            type: 'POST',
            url: 'api/available_time.php', // PHP file to handle form data
            data: formData,
            processData: false, // Prevent jQuery from processing the data (important for FormData)
            contentType: false, // Set content type to false, jQuery will tell the server its form data
            success: function(response) {
                // Parse JSON response
                try {
                    var jsonResponse = JSON.parse(response);
                    if (jsonResponse.status === 200) {
                        console.log(jsonResponse);
                        // Call wishlist function with appropriate arguments
                        // wishlist(id, jsonResponse.element);
                    } else {
                        console.warn(jsonResponse.message);
                    }
                } catch (error) {
                    console.error("Error parsing JSON response: " + error);
                }
            },
            error: function(xhr, status, error) {
                console.error("AJAX request failed: " + status + ", " + error);
            }
        });
    });
});

</script>

<script>
// $(document).ready(function() {
//     $('#edit_form').submit(function(event) {
//         event.preventDefault(); // Prevent form submission
        
//         // Send AJAX request
//         $.ajax({
//             type: 'POST',
//             url: 'api/edit_profile.php',
//             data: new FormData(this),
//             processData: false,
//             contentType: false,
//             success: function(response) {
//                 try {
//                     var jsonResponse = JSON.parse(response);
//                     if (jsonResponse.status === 200) {
//                         console.log(jsonResponse);
//                         // Call wishlist function with appropriate arguments
//                         // wishlist(id, jsonResponse.element);
//                     } else {
//                         console.warn(jsonResponse.message);
//                     }
//                 } catch (error) {
//                     console.error("Error parsing JSON response: " + error);
//                 }
//             },
//             error: function(xhr, status, error) {
//                 console.error("AJAX request failed: " + status + ", " + error);
//             }
//         });
//     });
// });
   $(document).ready(function() {
    $('#edit_form').submit(function(e) {
        e.preventDefault();
        alert('hello');
        var formData = new FormData(this);
        formData.append('type', 'upload');
        console.log(formData);
        $.ajax({
            url: 'api/profile_edit.php',
            type: 'post',
            dataType: 'json',
            data: formData,
            cache: false,
            contentType: false,
            processData: false,
            success: function(response) {
                console.log(response);
                if (response['status'] == 200) {
                    alert(response['message']);
                } else {
                    alert(response['message']);
                }
            }
        });
    });
});

</script>
<script>
$(document).ready(function() {
    $('#plan_form').submit(function(e) {
        e.preventDefault(); // prevent the form from submitting in the traditional way

        alert('form submitted');

        var formData = new FormData(this);
        formData.append('type', 'plan_form');
        console.log(formData);

        $.ajax({
            url: 'api/astrologer_add.php',
            type: 'post',
            dataType: 'json',
            data: formData,
            cache: false,
            contentType: false,
            processData: false,
            success: function(response) {
                console.log(response);
                if (response.status === 200) { // use response.status instead of response['status']
                    alert(response.message);
                    $('#plan_form')[0].reset(); // reset the form using the correct selector
                    window.location.href = 'astrologer.php';
                } else {
                    alert(response.message);
                }
            }
        });
    });
});
</script>




<?php  include "footer2.php" ?>

Zerion Mini Shell 1.0