ok

Mini Shell

Direktori : /home2/selectio/www/wedding-info-new/admin/
Upload File :
Current File : /home2/selectio/www/wedding-info-new/admin/alliance_profile.php

<?php include "header.php"; 
    $ids = $_REQUEST['id'];
    $readonly="readonly";
    $hidden= 'hidden';
   $statement = $pdo->prepare("SELECT  * FROM tbl_alliances_register where  id=".$ids);
   $statement->execute();
   $datas = $statement->fetchAll(PDO::FETCH_ASSOC);
   $totalData = $statement->rowCount();
   
   $statement1 = $pdo->prepare("SELECT * FROM `tbl_images` WHERE  user_id=".$ids);
   $statement1->execute();
   $photos = $statement1->fetchAll(PDO::FETCH_ASSOC);
   $totalData = $statement1->rowCount();
   
   
   
   $statement_rwd = $pdo->prepare("SELECT * FROM  tbl_rewards WHERE user_id = ".$ids);
   $statement_rwd->execute();
   $photos_rwd = $statement_rwd->fetchAll(PDO::FETCH_ASSOC);
   $totalData_rwd = $statement_rwd->rowCount();
   
   
   
   
   
     if($datas[0]['allaiance_verified']==0){
         $text="./assets/gif/waiting.gif";
         $color="bg-warning";
         
     }elseif($datas[0]['allaiance_verified']==1){
         $text="./assets/gif/approved.gif";
         $color="bg-success";
         
     }elseif($datas[0]['allaiance_verified']==null){
         $text="./assets/gif/rejected.gif";
         
         $color="bg-danger";
         
     }
     
   ?> 
   <style>
       .image-new{
    padding: 0.25rem;
    background-color: var(--bs-body-bg);
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    max-width: 100%;
    height: 150px;
       }
   </style>
<form id="all_ver_form">
   <div class="page-wrapper">
     
      <div class="page-content">
         <div class=" card card-body">
            <div class="row">
               <div class="col-12 col-sm-12 col-md-6 col-lg-6">
            <!--<img style="position: absolute;width: 50px;" src="< ?=$text?>"  />-->
                  <h5 style="text-align: center;">PROFILE INFO</h5>
                  <table class="table" style="width: 100%;">
                     <tr>
                        <td scope="row" width="40%">Profile Created For <?=$datas[0]['verification_status']?>  </td>
                        <td style="text-align: center;">:</td>
                        <td><?=$datas[0]['profile_ctd_fr']?></td>
                     </tr>
                     <tr>
                        <td scope="row">Name</td>
                        <td style="text-align: center;">:</td>
                        <td><?=$datas[0]['name']?></td>
                     </tr>
                     <tr>
                        <td scope="row">Gender</td>
                        <td style="text-align: center;">:</td>
                        <td><?=$datas[0]['gender']?></td>
                     </tr>
                     <tr>
                        <td scope="row">Date Of Birth</td>
                        <td style="text-align: center;">:</td>
                        <td><?=$datas[0]['dob']?></td>
                     </tr>
                     <tr>
                        <td scope="row">Age</td>
                        <td style="text-align: center;">:</td>
                        <td><?=$datas[0]['age']?></td>
                     </tr>
                     <tr>
                        <td scope="row">Mobile No.</td>
                        <td style="text-align: center;">:</td>
                        <td><?=$datas[0]['mobile_no']?></td>
                     </tr>
                     <tr>
                        <td scope="row">Alternate Mobile No.</td>
                        <td style="text-align: center;">:</td>
                        <td><?=$datas[0]['mobile_no_alt']?></td>
                     </tr>
                     <tr>
                        <td scope="row">Legal Address</td>
                        <td style="text-align: center;">:</td>
                        <td><?=$datas[0]['lgl_address']?>,
                           <br><?=$datas[0]['city']?>,
                           <br><?=$datas[0]['state']?>,
                           <br><?=$datas[0]['pincode']?>,
                           <br><?=$datas[0]['l_mark']?>.
                        </td>
                     </tr>
                     <tr>
                        <td scope="row">Occupation</td>
                        <td style="text-align: center;">:</td>
                        <td><?=$datas[0]['profile_ctd_fr']?></td>
                     </tr>
                       <tr>
                        <td colspan='3' scope="row"><center><b>Attempts</b></center> </td>
                     </tr>
                       <tr>
                        <td scope="row">Password change</td>
                        <td style="text-align: center;">:</td>
                        <td>10 times</td>
                     </tr>
                     <tr>
                        <td scope="row">Profile Name</td>
                        <td style="text-align: center;">:</td>
                        <td>1 attempt</td>
                     </tr>
                     
                     
                     
                     
                     <tr>
                        <td scope="row">Salary</td>
                        <td style="text-align: center;">:</td>
                        <td>
                            <?=$datas[0]['annual_incm']?>

                        
                        <?php  
$statement_int = $pdo->prepare("SELECT * FROM tbl_attempt_values WHERE alliance_id = :ids AND field_name = 'annual_incm'");
$statement_int->bindParam(':ids', $ids, PDO::PARAM_INT);
$statement_int->execute();
$intrest = $statement_int->fetchAll(PDO::FETCH_ASSOC);
$totalData_int = count($intrest);
?>
                            
                            
                            
                            <ul>
                                <?php  foreach ($intrest as $int){  ?>
                                <li> <small><?=$int['old_value']?></small></li>
                                <?php } ?>
                            </ul>
                        
                        
                        </td>
                     </tr>
                     <tr>
                        <td scope="row">Last Login</td>
                        <td style="text-align: center;">:</td>
                        <?php
// Get the timestamp from the data source
$updated_at = strtotime($datas[0]['updated_at']);
$current_time = time();
$time_diff_seconds = $current_time - $updated_at;

// Define time intervals in seconds
$minute = 60;
$hour = $minute * 60;
$day = $hour * 24;
$week = $day * 7;
$month = $day * 30;
$year = $day * 365;

// Display the result based on the time difference
if ($time_diff_seconds < 2) {
    $time =  "1 second ago";
} elseif ($time_diff_seconds < $minute) {
    $time =  $time_diff_seconds . " seconds ago";
} elseif ($time_diff_seconds < $hour) {
    $time =  floor($time_diff_seconds / $minute) . " minutes ago";
} elseif ($time_diff_seconds < $day) {
    $time =  floor($time_diff_seconds / $hour) . " hours ago";
} elseif ($time_diff_seconds < $week) {
    $time =  floor($time_diff_seconds / $day) . " days ago";
} elseif ($time_diff_seconds < $month) {
    $time =  floor($time_diff_seconds / $week) . " weeks ago";
} elseif ($time_diff_seconds < $year) {
    $time =  floor($time_diff_seconds / $month) . " months ago";
} else {
    $time =  floor($time_diff_seconds / $year) . " years ago";
}
?>

                        
                        
                        <td> <?=$time?> (<?=$datas[0]['login_count']?> Times)</td>
                        
                     </tr>
                     <tr>
                         <td>Last Login Time</td>
                         <td>:</td>
                         <td><?= date('m/d/Y h:i:s A', strtotime($datas[0]['updated_at'])) ?></td>
                     </tr>
                  </table>
               </div>
               <div <?=(($datas[0]['verification_status'] == 2) ? "hidden":"hidden")?> class="col-12 col-sm-12 col-lg-6" >
                   <div style="height: 100%;display: grid;place-items: center;"  >
                       <img style="height: 150px;" src="image/man.png" />
                   </div>
                   
                   
               </div>
               <div <?=(($datas[0]['verification_status'] == 2) ? "":"")?>  class="col-12 col-sm-12 col-md-6 col-lg-6">
                  <div  class="row">
                     <h4 class="h5" style="text-align: center;">VERIFICATION PROOF</h4>
                     <div class="col-12 col-sm-12 col-md-4 col-lg-4" style="display: flex;justify-content: center;">
                        <div>
                           <p>Profile Photo </p>
                            <a href=".<?=$datas[0]['v_photos']?>" target="_blank" >
                           <img style="box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;" src=".<?=$datas[0]['v_photos']?>" class="image-new">
                           </a>   
                        </div>
                     </div>
                     <div class="col-12 col-sm-12 col-md-4 col-lg-4"style="display: flex;justify-content: center;">
                        <div>
                           <p>Pan Card</p>
                            <a href=".<?=$datas[0]['h_communication']?>" target="_blank" >
                           <img style="box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;" src=".<?=$datas[0]['h_communication']?>" class="image-new">
                           </a>   
                           </div>
                     </div>
                     <div class="col-12 col-sm-12 col-md-4 col-lg-4" style="display: flex;justify-content: center;">
                        <div>
                           <p>Aadhar Card</p>
                            <a href=".<?=$datas[0]['v_aadhar']?>" target="_blank" >
                           <img style="box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;" src=".<?=$datas[0]['v_aadhar']?>" class="image-new">
                           </a>                            </div>
                     </div>
                  </div>
                  <br>
               
                  <div class="row">
                     <div class="col-10 col-sm-10 col-md-10 col-lg-10">
                        <div class="md-form amber-textarea active-amber-textarea-2" >
                           <label>Aadhar Name</label><br> <input type="text" id="aadhar_name" class="md-textarea form-control" <?=$readonly?> name="aadhar_name" placeholder="Enter Aadhar Number" />
                        </div>
                     </div>
                     <div class="col-10 col-sm-10 col-md-10 col-lg-10">
                        <div class="md-form amber-textarea active-amber-textarea-2" >
                           <label>Aadhar card Mobile No.</label><br> <input type="text" id="aadhar_mbl" class="md-textarea form-control" <?=$readonly?> name="aadhar_mbl" placeholder="Enter Aadhar Number" />
                        </div>
                     </div>
                     <div class="col-10 col-sm-10 col-md-10 col-lg-10">
                        <div class="md-form amber-textarea active-amber-textarea-2" >
                           <label>Aadhar Card No.</label><br> <input type="text" id="adh_no" class="md-textarea form-control" <?=$readonly?> name="aadhar_no" placeholder="Enter Aadhar Number" />
                        </div>
                     </div>
                     <div class="col-10 col-sm-10 col-md-10 col-lg-10">
                        <div class="md-form amber-textarea active-amber-textarea-2" >
                           <label>Gender</label><br> <input type="text" id="gender" class="md-textarea form-control" <?=$readonly?> name="gender" placeholder="" />
                        </div>
                     </div>
                     <div class="col-10 col-sm-10 col-md-10 col-lg-10">
                        <div class="md-form amber-textarea active-amber-textarea-2" >
                           <label>Date of Birth</label><br> <input type="text" id="dob" class="md-textarea form-control" <?=$readonly?> name="dob" placeholder="Enter Aadhar Number" />
                        </div>
                     </div>
                     <div  <?=$hidden?> class="col-2 col-sm-2 col-md-2 col-lg-2">
                        <div class="md-form amber-textarea active-amber-textarea-2" >
                            <label>Verify</label><br> 
                                <input type="button" class="btn  btn-sm btn-warning" id="add_ver_btn" name="aadhar_no_" Value="Check"/>
                        </div>
                     </div>

                  </div>
      </div>
            </div>
            <div class="row" style="display: flex;justify-content: center;" >
               <div class="col-12 col-sm-12 col-md-6 col-lg-6">
                  <div class="md-form amber-textarea active-amber-textarea-2">
                     <label for="form16">Remarks</label>
                     <textarea name="remarks" id="form16" class="md-textarea form-control" rows="3"></textarea>
                  </div>
               </div>
            </div>
            <div class="row"  >
                <?php foreach ($photos as $photo){ ?>
                <div class="col-3 col-sm-3 col-md-3" >
                    <img style="    width: 175px;height:175px;" src=" <?=".".$photo['image']?>" />
                    <!--<lable for="accept">Accepted  <input type="checkbox" id="accept" name="accepted[]" value="1" /></lable>-->
                    <div <?=$hidden?> class="form-group">
                        <label for="accept<?=$photo['id']?>"><input type="radio" id="accept<?=$photo['id']?>" name="pic_ver_<?=$photo['id']?>[]" value="1" class="form-check-input">Accepted</label>
                        <label for="reject<?=$photo['id']?>"><input type="radio" id="reject<?=$photo['id']?>" name="pic_ver_<?=$photo['id']?>[]" value="3" class="form-check-input">Rejected</label>
                        <input type="hidden" name="pic_id[]" value="<?=$photo['id']?>" />
                    </div>
                </div>
                <?php } ?>
            </div>
            
            <div <?=$datas[0]['plans'] !=0 ? "":"hidden" ?> class="row"  >
                <center><p class="text-warning">Membership already activated</p></center>
            </div>
            <div <?=$datas[0]['plans'] !=0 ? "":"" ?> class="row"  >
            <center>Reward Section</center>
                
                <?php foreach ($photos_rwd as $photo_rwd){ ?>
                <div class="col-3 col-sm-3 col-md-3" >
                    <img style="    width: 175px;height:175px;" src=" <?=".".$photo_rwd['photo']?>" />
                    <!--<lable for="accept">Accepted  <input type="checkbox" id="accept" name="accepted[]" value="1" /></lable>-->
                <center  <?=($photo_rwd['verification_status']==1 ?"":"hidden")?> ><p class="text-success">Verified  <?=$photo_rwd['verification_status']?></p></center>
                    <div  <?=($photo_rwd['verification_status']==1 ?"hidden":"")?> class="form-group">
                        <label for="accept_rwd<?=$photo_rwd['id']?>"><input type="radio" id="accept_rwd<?=$photo_rwd['id']?>" name="pic_ver_rwd_<?=$photo_rwd['id']?>[]" <?=($photo_rwd['verification_status'] == 1)?  "checked":"" ?> value="1" class="form-check-input">Accepted</label>
                        <label for="reject_rwd<?=$photo_rwd['id']?>"><input type="radio" id="reject_rwd<?=$photo_rwd['id']?>" name="pic_ver_rwd_<?=$photo_rwd['id']?>[]"   <?=($photo_rwd['verification_status'] == 3)?  "checked":"" ?> value="3" class="form-check-input">Rejected</label>
                        <input type="hidden" name="pic_id_rwd[]" value="<?=$photo_rwd['id']?>" />
                    </div>
                </div>
                <?php } ?>
                
                <input <?=$hidden?> id="rewards_btn" <?=($totalData_rwd >=7  ? "":"" )?> type="button" class="btn btn-sm btn-warning"  style="    width: 91px; height: 39px; margin-top: 90px;" value="approve" />
            </div>
            <div hidden class="row" style="display: flex;justify-content: center;" >
               <div class="col-12 col-sm-12 col-md-6 col-lg-6" style="display: flex;justify-content: center;">
                   
                  <div  class="form-check form-check-inline " id="verification">
                     <input <?=($datas[0]['verification_status'] == 1)?  "checked":"" ?> class="form-check-input"  type="radio" name="status_ver"  value="1" />
                     <label class="form-check-label" for="verified">Verified</label>
                  </div>
                  <div class="form-check form-check-inline">
                     <input class="form-check-input" type="radio" name="status_ver" id="n_verified" value="0" />
                     <label class="form-check-label" for="n_verified">Rejected</label>
                  </div>
               </div>
            </div>
            <center <?=$hidden?> ><button class="btn btn-sm btn-md btn-danger" >Submit</button></center>
         </div>
      </div>
   </div>
</form>
<script>

   $(document).ready(function() {
       $("#verification").hide()
  

   $('#all_ver_form').submit(function(e) {
       e.preventDefault();
       var formData = new FormData(this);
       formData.append('type', 'upload');
       var ids = <?=$ids?>;

       console.log(formData);
       $.ajax({
           url: 'api/alliance_verification.php?ids=' + ids,
           type: 'post',
           dataType: 'json',
           data: formData,
           cache: false,
           contentType: false,
           processData: false,
           success: function(response) {
               console.log(response);
               if (response['status'] == 200) {
                   success(response['message']);
               } else {
                   warning(response['message']);
               }
           }
       });
   });
   });
</script>
<?php include "footer.php"; ?>
<script>

    $('#add_ver_btn').click(function () {
     
        var adh_no = $("#adh_no").val();
        var aadhar_mbl = $("#aadhar_mbl").val();
        var aadhar_name = $("#aadhar_name").val();
        var gender = $("#gender").val();
        var dob = $("#dob").val();
        
        
        var ids = <?=$ids?>;
        $.ajax({
            url: 'api/alliance_verification.php',
            type: 'post',
            dataType: 'json',
            data: { aadhar_no: adh_no, types:'check',ids:ids,aadhar_mbl:aadhar_mbl,aadhar_name:aadhar_name,gender:gender,dob:dob },
            success: function (response) {
                console.log(response);
                if (response['status'] == 200) {
                    success(response['message']);
                    $("#verification").show()


                } else {
                    warning(response['message']);
                    $("#verification").hide()

                }
            }
        });
});

</script>
<script>

    $('#rewards_btn').click(function () {
        
        var rewards = $("#rewards_btn").val();
        var ids = <?=$ids?>;
        alert(rewards+ids);
        $.ajax({
            url: 'api/alliance_verification.php',
            type: 'post',
            dataType: 'json',
            data: { types:'rewards',rewards:rewards,ids:ids },
            success: function (response) {
                console.log(response);
                if (response['status'] == 200) {
                    success(response['message']);
                    $("#verification").show()


                } else {
                    warning(response['message']);
                    $("#verification").hide()

                }
            }
        });
});

</script>

Zerion Mini Shell 1.0