<?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>Laporan Kualifikasi</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-"> Laporan Kualifikasi  </i></li>
            </ol>



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

		<tbody>
		<?php
 
  		$nomor=0;
  		$rw=mysql_query("Select * from paket 
        join kualifikasi on paket.id_paket=kualifikasi.id_paket Group by paket.id_paket ");
  		while($s=mysql_fetch_array($rw))
  		
  		{   $count1 = mysql_query("SELECT id_kualifikasi FROM kualifikasi WHERE id_paket = '".$s['id_paket']."'");
         $paket=mysql_num_rows($count1);

  		$nomor++;
  		
  		?>
   		<tr>
    		<td align="center"><?php echo $nomor; ?></td>
    		<td><?php echo $s['nama_paket']; ?></td>
    		<td align="center"><?php echo $paket; ?></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 
        join kualifikasi on paket.id_paket=kualifikasi.id_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 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 Kualifikasi</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-6">
         <input type="text" class="form-control" id="kecamatan<?php echo $s['id_paket'];?>" name="kecamatan" value="<?php echo $s['kecamatan'];  ?>" required readonly> 
      </div>
   </div>
               
  <hr width="90%"/>
  <h5 align="center">Laporan Kualifikasi</h5>
   <div class="text-right ">
<a type="button" href="system/web/print_kualifikasi.php?id_paket=<?php echo $s['id_paket'];?>" target="_blank" class="btn btn-default tooltipsku" data-placement="right" title="Print"><i class="fa fa-print"></i></a>
<a type="button" href="system/web/pdf_kualifikasi.php?id_paket=<?php echo $s['id_paket'];?>" target="_blank" class="btn btn-default tooltipsku" data-placement="left" title="Download pdf"><i class="fa fa-download"></i></a>

</div><p></p>
  <table id="" class="table table-bordered display" cellspacing="0" width="100%">
		<thead>
		<tr class="success">
			<th width="2%">No</th>
        	<th>Nama Perusahaan</th>
          <th >SKK 1</th>
          <th >SKK 2</th>
          <th >SKK 3</th>
           <th >SKK 4</th>
            <th >SKK 5</th>
             <th >Jumlah</th>
              <th >Keterangan</th>
              <th >Alasan Gugur</th>
         
		</tr>
		</thead>
		<tbody>
		<?php
        $id_paket=$s['id_paket'];
      $nomor=0;
      $query=mysql_query("Select * from paket 
        join kualifikasi on paket.id_paket=kualifikasi.id_paket 
        join perusahaan on kualifikasi.id_perusahaan=perusahaan.id_perusahaan
        where kualifikasi.id_paket='$id_paket'
        ");
      while ($ss=mysql_fetch_array($query)) { $nomor++;
     

        if($ss['skk1']<70){
        $gugur1="danger";
      }else{
        $gugur1="default";
      }

      if($ss['skk2']<70){
        $gugur2="danger";
      }else{
        $gugur2="default";
      }

      if($ss['skk3']<70){
        $gugur3="danger";
      }else{
        $gugur3="default";
      }

      if($ss['skk4']<70){
        $gugur4="danger";
      }else{
        $gugur4="default";
      }
      if($ss['skk5']<70){
        $gugur5="danger";
      }else{
        $gugur5="default";
      }

      if($ss['jumlah_kual']<350){
        $gugur6="danger";
      }else{
        $gugur6="default";
      }
      if($ss['keterangan_kual']!='lulus'){
        $gugur7="danger";
      }else{
        $gugur7="default";
      }


        ?>
   		<tr>
        
    		<td align="center"><?php echo $nomor; ?></td>
    		<td ><?php echo $ss['nama']; ?></td>
        <td align="center" class="<?php echo $gugur1;?>" ><?php echo $ss['skk1'];?></td>
        <td align="center" class="<?php echo $gugur2;?>" ><?php echo $ss['skk2'];?></td>
        <td align="center" class="<?php echo $gugur3;?>" ><?php echo $ss['skk3'];?></td>
        <td align="center" class="<?php echo $gugur4;?>" ><?php echo $ss['skk4'];?></td>
        <td align="center" class="<?php echo $gugur5;?>" ><?php echo $ss['skk5'];?></td>
        <td class="<?php echo $ss['jumlah_kual'];?>" align="center"><?php echo $ss['jumlah_kual']; ?></td>

        <td class="<?php echo $gugur7;?>" align="center"><?php echo $ss['keterangan_kual']; ?></td>

        <td><?php echo $ss['alasan_kual']; ?></td>
     
		</tr>
    <?php
    }
    ?>

		</tbody>
</table>
  </form>
            </div>


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