<?php
include('../../../function/__data_app_db.php');
$__data_ction = 'false';
 $_name_in_jsnj  = $__go_to = $errData = $sub_array=$type_desc='';
if(isset($_POST['process'])){
   $i = 1;
$query_quot = mysqli_query($_conn_db,"select * from review  order by review_id desc");
$i = 1;
while($data_quot = mysqli_fetch_array($query_quot)){
    $stars = show_jsnj_data($data_quot['review_star']);
    $result_show =	show_jsnj_data($data_quot['action']);
    $review_name = show_jsnj_data($data_quot['review_name']);
    $review_phone = show_jsnj_data($data_quot['review_phone']);
    $review_email = show_jsnj_data($data_quot['review_email']);
    $id = $review_id = show_jsnj_data($data_quot['review_id']);
    $review_img = show_jsnj_data($data_quot['review_img']);
    $r_u_img = '<img src="../../../images/review/'.$review_id.'/'.$review_img.'" style="width: 80px; max-height: 80px;">';

    $review_message = show_jsnj_data($data_quot['review_message']);
     if($result_show==1){
    $show_btn = '<button class="btn btn-success waves-effect waves-light btn-sm result_show" data-result="'.$review_id.'"  data-toggle="tooltip" title="" data-original-title="Click here to Show Review/Review" data-type="'.$result_show.'"><i class="fa fa-eye"></i> Show</button>';
                      } else if($result_show==2){
         $show_btn =   '<button class="btn btn-warning waves-effect waves-light btn-sm result_show" data-result="'.$review_id.'" data-toggle="tooltip" title="" data-original-title="Click here to Hide Review/Testimoniol" data-type="'.$result_show.'"><i class="fa fa-eye-slash"></i> Hide</button>';
                   }
    $count = $i++;
    $sub_array.= "<tr>
<td><div class='checkbox'><input type='checkbox' class='checkbox-input dsdata' id='$id-$i' value='$id'><label for='$id-$i'></label></div></td>
        <td>$count</td>
        <td>$review_name</td>
        <td>$review_phone</td>
        <td>$review_email</td>
        <td>$stars</td>
        <td>$review_message</td>
        <td>$show_btn</td>
    </tr>";
};
    $output = array(
        "tr" => $sub_array,
        "res"  =>  'true'
    );
    echo json_encode($output);
} else {
 echo 'error found';
};
?>
