<?php
	include('public/functions.php');
 	$qry = "SELECT * FROM menuapp_config ORDER BY id ASC";
	$result = mysqli_query($connect, $qry);
?>

<!-- START CONTENT -->
<section id="content">

      <!--breadcrumbs start-->
      <div id="breadcrumbs-wrapper" class=" grey lighten-3">
          <div class="container">
            <div class="row">
                <div class="col s12 m12 l12">
                  <h5 class="breadcrumbs-title">Menu App</h5>
                  <ol class="breadcrumb">
                    <li><a href="dashboard.php">Inicio</a>
                    </li>
                    <li><a class="active">Configuração do app</a>
                    </li>
                  </ol>
                </div>
            </div>
          </div>
      </div>
      <!--breadcrumbs end-->

      <!--start container-->
      <div class="container">
          <div class="section">
              <div class="row">
                  <div class="col s12 m12 l12">
                      <div class="card-panel">
                        <div class="row">
                          <?php if(isset($_SESSION['msg'])) { ?>
                          <div class='card-panel teal lighten-2'>
                              <span class='white-text text-darken-2'><?php echo $_SESSION['msg'] ?></span>
                          </div>

                          <?php unset($_SESSION['msg']); }?>

                          <div class="col s12 m12 l12">
                              <table>
                                <thead>
                                  <tr>
                                    <th>Local</th>
                                    <th>Link</th>
                                    <th>Status</th>
                                    <th width="10%">Ação</th>
                                  </tr>
                                </thead>
                                <tbody>
                                  <?php while($data = mysqli_fetch_assoc($result)){ ?>
    					 		  <tr>
                                    <td>TV</td>
                                    <td><?php echo $data['tv_link'] ?></td>
                                    <td><?php echo $data['tv_status'] ?></td>
                                    <td><a href="edittv.php?local=tv" class="btn cyan waves-effect waves-light">Editar</a></td>
                                  </tr>
								   <tr>
                                    <td>Rádio</td>
									<td><?php echo $data['radio_link'] ?></td>
                                    <td><?php echo $data['radio_status'] ?></td>
                                    <td><a href="editradio.php?local=radio" class="btn cyan waves-effect waves-light">Editar</a></td>
                                  </tr>
						 		  <tr>
                                    <td>Programação</td>
									<td><?php echo $data['programacao_link'] ?></td>
                                    <td><?php echo $data['programacao_status'] ?></td>
                                    <td><a href="editapp.php?local=programacao" class="btn cyan waves-effect waves-light">Editar</a></td>
                                  </tr>
                                  <tr>
                                    <td>Equipe</td>
                                    <td><?php echo $data['equipe_link'] ?></td>
                                    <td><?php echo $data['equipe_status'] ?></td>
                                    <td><a href="editapp.php?local=equipe" class="btn cyan waves-effect waves-light">Editar</a></td>
                                  </tr>
								  <tr>
                                    <td>Promoções</td>
									<td><?php echo $data['promocao_link'] ?></td>
                                    <td><?php echo $data['promocao_status'] ?></td>
									<td><a href="editapp.php?local=promocoes" class="btn cyan waves-effect waves-light">Editar</a></td>
                                    <td>
								  <tr>
                                    <td>Recados</td>
									<td><?php echo $data['recados_link'] ?></td>
                                    <td><?php echo $data['recados_status'] ?></td>
                                    <td><a href="editapp.php?local=recados" class="btn cyan waves-effect waves-light">Editar</a></td>
                                  </tr>
								  <tr>
                                    <td>Whatsapp</td>
                                    <td><?php echo $data['whatsapp_link'] ?></td>
                                    <td><?php echo $data['whatsapp_status'] ?></td>
                                    <td><a href="editapp.php?local=whatsapp" class="btn cyan waves-effect waves-light">Editar</a></td>
                                  </tr>
                                  <tr>
                                    <td>Site</td>
                                    <td><?php echo $data['site_link'] ?></td>
                                    <td><?php echo $data['site_status'] ?></td>
                                    <td><a href="editapp.php?local=site" class="btn cyan waves-effect waves-light">Editar</a></td>
                                  </tr>
									
                                  <tr>
                                    <td>Facebook</td>
                                    <td><?php echo $data['facebook_link'] ?></td>
                                    <td><?php echo $data['facebook_status'] ?></td>
                                    <td><a href="editapp.php?local=facebook" class="btn cyan waves-effect waves-light">Editar</a></td>
                                  </tr>
										        <td>Twitter</td>
                                    <td><?php echo $data['twitter_link'] ?></td>
                                    <td><?php echo $data['twitter_status'] ?></td>
                                    <td><a href="editapp.php?local=twitter" class="btn cyan waves-effect waves-light">Editar</a></td>
                                  </tr>
                                  <tr>
                                    <td>Instagram</td>
                                    <td><?php echo $data['instagram_link'] ?></td>
                                    <td><?php echo $data['instagram_status'] ?></td>
                                    <td><a href="editapp.php?local=instagram" class="btn cyan waves-effect waves-light">Editar</a></td>
                                  </tr>
										             <tr>
										    
										    <tr>
                                    <td>Youtube</td>
                                    <td><?php echo $data['youtube_link'] ?></td>
                                    <td><?php echo $data['youtube_status'] ?></td>
                                    <td><a href="editapp.php?local=youtube" class="btn cyan waves-effect waves-light">Editar</a></td>
                                  </tr>

                                  <?php } ?>
                                </tbody>
                              </table>
                          </div>

                          </div>
                      </div>

                  </div>

              </div>
          </div>
      </div>

</section>
