
<div class="content-header">
  <div class="container-fluid">
    <div class="row mb-2">
      <div class="col-sm-6">
        <h1 class="m-0 text-dark">Restaurant Details
        </h1>
      </div><!-- /.col -->
      <div class="col-sm-6">
        <ol class="breadcrumb float-sm-right">
          <li class="breadcrumb-item"><a href="<?= base_url(); ?>/dashboard">Home</a></li>
          <li class="breadcrumb-item active">Restaurant Details</li>
        </ol>
      </div><!-- /.col -->
    </div><!-- /.row -->
  </div><!-- /.container-fluid -->
</div>

<!-- Main content -->
<section class="content">
  <div class="container-fluid">
    <div class="row">
      <div class="col-md-3" style="display: none;">

      </div>
      <!-- /.col -->
      <div class="col-md-10">
      <a class="icon" style="text-decoration: none;" href="<?php echo base_url(); ?>dashboard/editresturent/<?php echo $this->session->userdata('restid'); ?>">
                                    <button class="btn btn-info mt-2">Edit Restaurant</button>
                </a> 
      <div class="card">
          <div class="card-header p-2">
            <ul class="nav nav-pills">
              <!-- <li class="nav-item"><a class="nav-link active" href="#basicinfo" data-toggle="tab">Basic Info</a></li> -->
              <!--  <li class="nav-item"><a class="nav-link " href="#bookings" data-toggle="tab">Bookings</a></li>-->
              <!--  <li class="nav-item"><a class="nav-link" href="#vechicle_geofence" data-toggle="tab">Geofence</a></li>-->
              <!--<li class="nav-item"><a class="nav-link" href="#vechicle_incomexpense" data-toggle="tab">Income & Expense</a></li>-->
            </ul>
          </div><!-- /.card-header -->
          <div class="card-body">
         
          <div class="tab-content">
                    <?php 
                    //  echo "<pre>";
                    //  print_r($dishreview);
                    //  echo "</pre>";
                    ?>

              <div class="tab-pane active" id="basicinfo">
                <table class="table table-sm table-bordered">
                  <tbody>

            
                    <tr>
                    <tr>
                      <td>Restaurant Name</td>
                      <td><?php echo $resturentinfo["name"]; ?></td>
                    </tr>
                    <tr>
                      <td>Restaurant Address</td>
                      <td><?php echo $resturentinfo["address"]; ?></td>
                    </tr>
                    <tr>
                      <td>WebSite</td>
                      <td><?php echo $resturentinfo["website"]; ?></td>
                    </tr>

                   

                    <td>Image</td>
                      <td>
                        <?php if($resturentinfo["image"] !=""){ ?>
                        <a href="<?= $resturentinfo["image"] ?>" target="_blank">
                        <img class="custom-img img-thumnail" style="height:100px;width:100px;" 
                        src="<?php echo $resturentinfo["image"]; ?>" alt=""></a>
                          <?php } ?>
                          </td> 
                      </tr>

                    <tr>
                      <td>Oval All Rating</td>
                      <td><?php 
                            $x=0; 
                            if(isset($resturentinfo['rating'])){
                            foreach($resturentinfo['rating'] as $rating){
                              $x=$x+$rating; 
                            }
                                
                            echo ($x/count($resturentinfo['rating']));
                            }else{
                            echo $x;
                        }
                            
                            ?></td>
                    </tr>

                    <tr>
                      <td>No Of People Rated</td>
                      <td><?php 
                            $x=0; 
                            if(isset($resturentinfo['rating'])){
                            $rating=$resturentinfo['rating']; 
                                echo count($rating);
                            }else{
                            echo $x;
                        }
                            
                            ?></td>

                    </tr>
                    <tr>
                      <td>Date Added By</td>
                      <td><?php echo date("Y-M-d",$Dish["date"]/1000); ?></td>
                    </tr>
                    <tr>
                      <td>association</td>
                      <td><?php if($resturentinfo["association"]==false){
                        echo "Not Yet.";
                      }else{
                        echo getusername($resturentinfo['userId']);
                      } ?></td>
                    </tr>
                    <tr>
                      <td>Portal Id:</td>
                      <td><?php echo $resturentinfo["uniqueid"]; ?></td>
                    </tr>
                    <tr>
                      <td>Portal Password:</td>
                      <td><?php echo $resturentinfo["pwd"]; ?></td>
                    </tr>
                    

                    <tr>
                      <td>Country</td>
                      <td><?php echo $resturentinfo["country"]; ?></td>
                    </tr>
                    <tr>
                      <td>Phone Number</td>
                      <td><?php echo $resturentinfo["phoneNumber"]; ?></td>
                    </tr>


                  </tbody>
                </table>
                <hr>
                <h4>All Rating</h4>
                <table class="table table-sm table-bordered">
                   <thead>
                    <tr>
                       <th>Date</th>
                       <th>Username</th>
                       <th>Over All</th> 
                       <th>Food Quailty</th> 
                       <th>Ambience</th> 
                       <th>Cleanliness</th> 
                       <th>Value for Price</th> 
                       <th>Speed of Service</th>
                       <th>Special Accommodations</th>  
                       <th>Rating</th> 
                       <th>Review</th> 

                       </tr>
                   </thead>     
                <tbody>  
                  <?php foreach($dishreview as $dr){
                    // echo "<pre>";
                    // print_r($dr);
                    // echo "</pre>";
                    //
                     ?>   
                  <tr>
                  <td><?php echo date("Y-M-d",$dr["date"]/1000); ?></td> 
                  <td><?php echo getusername($dr['userId']); ?></td>
                    <td><?php echo $dr['Overall']; ?></td>
                    <td><?php echo $dr['Food Quality']; ?></td>
                    <td><?php echo $dr['Ambience']; ?></td>
                    <td><?php echo $dr['Cleanliness']; ?></td>
                    <td><?php echo $dr['Value for Price']; ?></td>
                    <td><?php echo $dr['Speed of Service']; ?></td>
                    <td><?php echo $dr['Special Accommodations']; ?></td>
                    <td><?php echo $dr['rating']; ?></td>
                    <td><?php echo $dr['review']; ?></td>
                  </tr>
                  <?php } ?>
                  </tbody>
                </table>
                  </div>
              <!-- /.tab-pane -->
            </div>
            <!-- /.tab-content -->
          </div><!-- /.card-body -->
        </div>
        <!-- /.nav-tabs-custom -->
      </div>
      <!-- /.col -->
    </div>
    <!-- /.row -->
  </div><!-- /.container-fluid -->
</section>
<!-- /.content -->

<!-- /.content-wrapper -->