<?php
include "asset/fungsi/fungsi_rupiah.php";
?>
<div class="col-md-9">
<div class="panel panel-default">
<div class="panel-body">
	

	<div class="page-header">
			<h2>Input Nilai</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-file-text-o"> Input Nilai  </i></li>
            </ol>

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

		<tbody>
		<?php
  		$nomor=0;
  		$rw=mysql_query("Select * from paket");
  		while($s=mysql_fetch_array($rw))
  		
  		{
  		$count = mysql_query("SELECT id_perusahaan FROM peserta WHERE id_paket = '".$s['id_paket']."'");
  		$a=mysql_num_rows($count);
  		$nomor++;
  		
  		?>
   		<tr>
    		<td align="center"><?php echo $nomor; ?></td>
    		<td><?php echo $s['nama_paket']; ?></td>
    		<td ><span class="label label-info"><?php echo $a; ?> </span>&nbsp;perusahaan</td>
    		<td >
    		<center>
  			<button href="#" class="btn btn-default tooltipsku" type="button" data-placement="top" title="Lihat Rincian" data-toggle="modal" data-target="#modal_rincian<?php echo $s['id_paket'];?>"><i class="fa fa-folder-open" >  </i></button>
    		</center>
    		</td>
		</tr>
		<?php
 		 }
 		?>
		</tbody>
</table>

<?php
$rw=mysql_query("Select * from paket");
while($s=mysql_fetch_array($rw)){
?>
<div id="modal_rincian<?php echo $s['id_paket'];?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <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 Paket dan Penilaian</strong></h4>
            </div>
            <div class="modal-body">
<form class="form-horizontal" role="form" enctype="multipart/form-data">
<div class="form-group">
    <center>  <label for="nama_paket" class="col-sm-4 control-label" >Nama Paket</label></center>
      <div class="col-md-7">
         <input type="text" class="form-control" id="nama_paket<?php echo $s['id_paket'];?>" name="nama_paket" value="<?php echo $s['nama_paket'];  ?>" required readonly> 
      </div>
   </div>
   <div class="form-group">
    <center>  <label for="nama_proyek" class="col-sm-4 control-label" >Nama Proyek</label></center>
      <div class="col-md-7">
         <input type="text" class="form-control" id="nama_proyek<?php echo $s['id_paket'];?>" name="nama_proyek" value="<?php echo $s['nama_proyek'];  ?>" required readonly> 
      </div>
   </div>
   
    <div class="form-group">
    <center>  <label for="hps" class="col-sm-4 control-label">HPS </label></center>
      <div class="col-md-7">
       <div class="input-group">
      <div class="input-group-addon">Rp.</div>
         <input rows="3" class="form-control" id="hps<?php echo $s['id_paket'];?>" name="hps" value="<?php $hps=format_rupiah($s['hps']);  echo $hps;  ?>" required readonly> 
      <div class="input-group-addon">.00</div>
    </div>
      </div>
   </div>
   <div class="form-group">
    <center>  <label for="kecamatan" class="col-sm-4 control-label">Keterangan </label></center>
      <div class="col-md-7">
         <input type="text" class="form-control" id="kecamatan<?php echo $s['id_paket'];?>" name="kecamatan" value="<?php echo $s['kecamatan'];  ?>" required readonly> 
      </div>
   </div>
               </form>
  <hr width="90%"/>
  <h5 align="center">Daftar Peserta Tender</h5>
  <table id="" class="table table-bordered display" cellspacing="0" width="100%">
		<thead>
		<tr class="success">
			<th width="2%">No</th>
        	<th>Nama Peserta</th>
          <th ><center>Status Penilaian<center></th>
            <th width="10%"><center>Aksi</center></th>
         
		</tr>
		</thead>
		<tbody>
		<?php
  		$nomor=0;
  		$ra=mysql_query("Select * from perusahaan 
      JOIN evaluasi on perusahaan.id_perusahaan=evaluasi.id_perusahaan
  		JOIN paket on evaluasi.id_paket=paket.id_paket
      JOIN kualifikasi on evaluasi.id_kualifikasi=kualifikasi.id_kualifikasi
      JOIN administrasi on evaluasi.id_administrasi=administrasi.id_administrasi
      JOIN teknis on evaluasi.id_teknis=teknis.id_teknis
      JOIN harga on evaluasi.id_harga=harga.id_harga
       where paket.id_paket='".$s['id_paket']."'");
  		while($a=mysql_fetch_array($ra))
  		{
  		$nomor++;
  		?>
   		<tr>
    		<td align="center"><?php echo $nomor; ?></td>
    		<td><?php echo $a['nama']; ?></td>
        <?php 
        if(empty($a['keterangan_kual'] and $a['keterangan_adm'] and $a['keterangan_teknis'] and $a['keterangan_hrg'])){
          ?>
          <td align="center"><p class="label label-danger">Belum Selesai<p></td>
          <?php
        }else{
          ?>
          <td align="center"><p class="label label-info">Selesai</p></td>
          <?php
        }

         ?>
         <?php
         if($a['validasi']==0){
             ?>
            <td >
        <form class="form-horizontal" role="form" method="post" action="?cat=web&page=detail_evaluasi&id_perusahaan=<?php echo $a['id_perusahaan']; ?>&id_paket=<?php echo $s['id_paket']; ?>" enctype="multipart/form-data">
      <input type="hidden" class="form-control" id="id_paket<?php echo $s['id_paket'];?>" name="id_paket" value="<?php echo $s['id_paket'];  ?>" required > 
      <button type="submit" name="paket" class="btn btn-default tooltipsku" data-placement="top" title="Penilaian" disabled><i class="fa fa-edit" > </i></button>
        </form>
        </td>
          <?php
         }else{
          ?>
            <td >
        <form class="form-horizontal" role="form" method="post" action="?cat=web&page=detail_evaluasi&id_perusahaan=<?php echo $a['id_perusahaan']; ?>&id_paket=<?php echo $s['id_paket']; ?>" enctype="multipart/form-data">
      <input type="hidden" class="form-control" id="id_paket<?php echo $s['id_paket'];?>" name="id_paket" value="<?php echo $s['id_paket'];  ?>" required > 
      <button type="submit" name="paket" class="btn btn-default tooltipsku" data-placement="top" title="Penilaian"><i class="fa fa-edit" > </i></button>
        </form>
        </td>
          <?php
         }

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


        </div>
    </div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>