<div class="col-md-9">
<div class="panel panel-default">
<div class="panel-body">
	

	<div class="page-header">
			<h2>Pesan Tamu</h2>
			<ol class="breadcrumb">

				<li><a href="dashboard.php"><i class="fa fa-home"> Home</i></a></li>
				<li class="active"><i class="fa fa-envelope"> Pesan Tamu  </i></li>
            </ol>
	</div>


<table id="tabel" class="table table-bordered display" cellspacing="0" width="100%">
		<thead>
		<tr class="success">
			<th width="5%">No</th>
        	<th width="25%">Nama</th>
            <th width="35%">Email</th>
            <th width="20%">Alamat</th>
            <th width="15%"><center>Aksi</center></th>
         
		</tr>
		</thead>

		<tbody>
		<?php
  		$nomor=0;
  		$rw=mysql_query("Select * from hubungi_kami");
  		while($s=mysql_fetch_array($rw))
  		{$nomor++;
        $pesan=substr($s['pesan'],0,50);
  		?>
   		<tr>
    		<td align="center"><?php echo $nomor; ?></td>
    		<td><?php echo $s['nama']; ?></td>
   
    		<td><?php echo $s['email']; ?></td>
            <td><?php echo $pesan;?>...</td>
    		<td ><center><button class="btn btn-default tooltipsku" type="button" data-placement="top" title="Lihat rincian" data-toggle="modal" data-target="#modal_rincian<?php echo $s['id_pesan'];?>"><i class="fa fa-folder-open" >   </i></button>
    		</center>
		</tr>
		<?php
 		 }
 		?>
		</tbody>
</table>
</div></div></div>

<?php
$rw=mysql_query("Select * from hubungi_kami");
while($s=mysql_fetch_array($rw)){
?>
<div id="modal_rincian<?php echo $s['id_pesan'];?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Rincian Pesan</h4>
            </div>
            <div class="modal-body">
<form class="form-horizontal">
    <input type="hidden" class="form-control" id="id_perusahaan<?php echo $s['id_perusahaan'];?>" name="id_perusahaan" value="<?php echo $s['id_perusahaan'];  ?>" required > 
<div class="form-group">
    <center>  <label for="nama" class="col-sm-4 control-label" >Nama Pengirim</label></center>
      <div class="col-md-7">
         <input type="text" class="form-control" id="nama<?php echo $s['hubungi_kami'];?>" name="nama" value="<?php echo $s['nama'];  ?>" required readonly> 
      </div>
   </div>
   <div class="form-group">
    <center>  <label for="alamat" class="col-sm-4 control-label">Email </label></center>
      <div class="col-md-7">
         <input  class="form-control" name="email" value=" <?php echo $s['email'];  ?>" disabled>
      </div>
   </div>
 
   <div class="form-group">
    <center>  <label for="telepon" class="col-sm-4 control-label">pesan </label></center>
      <div class="col-md-5">
         <textarea type="text" class="form-control" name="pesan"  disabled> <?php echo $s['pesan'];  ?></textarea>
      </div>
   </div>
  
            </div>
 </form>
        </div>
    </div>
</div>
<?php
}
?>
