<?php
// include "jabatan.php";
include "asset/fungsi/fungsi_indotgl.php";
include "asset/fungsi/fungsi_rupiah.php";
error_reporting(0);

if(isset($_GET['id_paket']))
{
  $rs=mysql_query("Select * from paket where id_paket='".$_GET['id_paket']."'");
  $row=mysql_fetch_array($rs);
  $pak=$row['id_paket'];

}
?>
<div class="col-md-9">
<div class="panel panel-default">
<div class="panel-body">
  <div class="page-header">
      <h2>Mengisi Data</h2>
      <ol class="breadcrumb">

        <li><a href="?cat=perusahaan&page=join_paket"><i class="fa fa-"> Join Tender </i></a></li>
        <li class="active"><i class="fa fa-upload"> Upload Data </i></li>
            </ol>
    </div>



<div class="col-md-4">
  <div class="panel panel-default">
  
  <div class="panel-heading"><span class="fa fa-list"></span> <b>Rincian Paket</b></div>
  <div class="panel-body">
  
  <table class="table table-striped">
        <thead>
          <tr>
              <td align="left">Nama Paket</td>
            <td align="center"> <?php echo $row['nama_paket']; ?> </td>
          </tr>
          <tr>
              <td align="left">Nama Proyek</td>
            <td align="center"> <?php echo $row['nama_proyek']; ?> </td>
          </tr>
          <tr>
              <td align="left">HPS</td>
            <td align="center"> <?php $hps=format_rupiah($row['hps']); echo"Rp. ";echo $hps; ?> </td>
          </tr>
          <tr>
              <td align="left">Keterangan</td>
            <td align="center"> <?php echo $row['kecamatan']; ?> </td>
          </tr>
        </thead>
      </table>
  
  </div>
  </div>
  </div>




<div class="col-md-8">
  <div class="panel panel-default">
  
  <div class="panel-heading"><span class="fa fa-edit"></span> <b>Daftar Kelangkapan</b></div>
  <div class="panel-body">
  
<table class="table table-bordered" cellspacing="0" width="100%">
    <thead>
    <tr class="success">
      <th width="2%"><center>No</center></th>
      <th width="25%"><center>Kualifikasi</center></th>
          <th width="25%"><center>Administrasi</center></th>
            <th width="25%"><center>Teknis</center></th>
            <th width="23%"><center>Harga</center></th>
         
    </tr>
    </thead>
    <tbody>
    <?php
      $ra=mysql_query("Select * from harga join file_upload on harga.id_file_upload=file_upload.id_file_upload where file_upload.id_paket='$pak' and file_upload.id_perusahaan='".$_SESSION['id_perusahaan']."'");
      while($a=mysql_fetch_array($ra))
      {
      ?>
      <tr>
        <td><center>1</center></td>
        <?php 
        if(!empty($a['skk1'] and $a['skk2'] and $a['skk3'] and $a['skk4'] and $a['skk5'])){
        ?><td ><center><div class="label label-success">Lengkap</div></center></td>
        <?php
        }else{
        ?><td ><center><div class="label label-danger">Belum Lengkap</div></center></td>
        <?php
        }
        ?>
        <?php 
        if(!empty($a['ska1'] and $a['ska2'] and $a['ska3'] and $a['ska4'] and $a['ska5'])){
        ?><td ><center><div class="label label-success">Lengkap</div></center></td>
        <?php
        }else{
        ?><td ><center><div class="label label-danger">Belum Lengkap</div></center></td>
        <?php
        }
        ?>
        <?php 
        if(!empty($a['skt1'] and $a['skt2'] and $a['skt3'] and $a['skt4'] and $a['skt5'])){
        ?><td ><center><div class="label label-success">Lengkap</div></center></td>
        <?php
        }else{
        ?><td ><center><div class="label label-danger">Belum Lengkap</div></center></td>
        <?php
        }
        ?>
        <?php 
        if(!empty($a['skh1'] and $a['harga_penawaran'])){
        ?><td ><center><div class="label label-success">Lengkap</div></center></td>
        <?php
        }else{
        ?><td ><center><div class="label label-danger">Belum Lengkap</div></center></td>
        <?php

        }
        ?>

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


<table class="table table-bordered" cellspacing="0" width="50%">
<thead>
<th width="5%" >No</th>
<th width="45%">HPS</th>
<th width="45%">Harga Penawaran</th>
</thead>
<tbody>
<?php
$ra=mysql_query("Select * from harga where id_paket='$pak' and id_perusahaan='".$_SESSION['id_perusahaan']."'");
  $a=mysql_fetch_array($ra);
  $hps=format_rupiah($row['hps']);
  $harga_penawaran=format_rupiah($a['harga_penawaran']);
?>
<tr>
<td align="center">1</td>
<td><?php echo"Rp. "; echo $hps ?></td>
<td><?php echo"Rp. "; echo $harga_penawaran; ?></td>
</tr>

</tbody>
</table>

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


<div class="col-md-12">
  <div class="panel panel-default">
  
  <div class="panel-heading"><span class="fa fa-file-o"></span> <b> File Pendukung </b></div>
  <div class="panel-body">
<div>

  <ul class="nav nav-tabs" role="tablist">
    <li role="presentation" class="active"><a href="#kualifikasi" aria-controls="home" role="tab" data-toggle="tab">Kualifikasi</a></li>
    <li role="presentation"><a href="#administrasi" aria-controls="profile" role="tab" data-toggle="tab">Administrasi</a></li>
    <li role="presentation"><a href="#teknis" aria-controls="messages" role="tab" data-toggle="tab">Teknis</a></li>
    <li role="presentation"><a href="#harga" aria-controls="settings" role="tab" data-toggle="tab">Harga</a></li>
  </ul>

  <!-- Tab panes -->
  <div class="tab-content">
  <div role="tabpanel" class="tab-pane fade in active" id="kualifikasi">
  <p></p>
  <form action="" method="post" enctype="multipart/form-data">
  <div class="col-md-12">
  <table class="table table-bordered" >
    <thead>
    <tr class="success">
      <td width="5%"><center>No.</center></td>
      <td width="30%">Dokumen</td>
      <td width="10%"><center>Status</center></td>
      <td width="15%"><center>Lihat File</center></td>
      
    </tr>
    
    
    </thead>
    
    
    <tbody>
    <?php
      $ra=mysql_query("Select * from file_upload where id_paket='$pak' and id_perusahaan='".$_SESSION['id_perusahaan']."'");
      $a=mysql_fetch_array($ra);
      $skk1=$a['skk1'];
      $skk2=$a['skk2'];
      $skk3=$a['skk3'];
      $skk4=$a['skk4'];
      $skk5=$a['skk5'];
        $skk=array($skk1,$skk2,$skk3,$skk4,$skk5);
     for ($i= 0; $i <= 4; $i++){
      ?>
      <tr>
        <td align="center"><?php echo $i+1;?></td>
        <td>surat keterangan kualifikasi <?php echo $i+1;?></td>
        <td><?php 

        if(empty($skk[$i])){
        ?> <center><span class="label label-danger">belum upload</span></center>
        <td><center><a class="btn btn-default" disabled><i class="fa fa-eye"></i></a></center></td>
            
          
           
       
        <?php
        }else{ ?> <center><span class="label label-success">sudah upload</span></center>
        
        <td><center><a class="btn btn-default tooltipsku" href="#" data-toggle="modal" data-target="#modal_kualifikasi<?php echo $i;?>" data-placement="top" title="Lihat File"><i class="fa fa-eye"></i></a></center></td>
      
           
            <?php
        }
        ?></td>
      </tr>
    </form>
      <?php
      }
      ?>
    
    
    </tbody>
</table>

  </div>
  </div>


  
  <div role="tabpanel" class="tab-pane fade" id="administrasi">
  <p></p>
  
  <form  method="post" enctype="multipart/form-data">
  <div class="col-md-12">
  <table class="table table-bordered" >
    <thead>
      <tr class="success">
      <td width="5%"><center>No.</center></td>
      <td width="30%">Dokumen</td>
      <td width="10%"><center>Status</center></td>
      <td width="10%"><center>Lihat File</center></td>

    </tr>
    
    
    </thead>
    <tbody>
    <?php
      $raa=mysql_query("Select * from file_upload where id_paket='$pak' and id_perusahaan='".$_SESSION['id_perusahaan']."'");
      $aq=mysql_fetch_array($raa);
      $ska1=$aq['ska1'];
      $ska2=$aq['ska2'];
      $ska3=$aq['ska3'];
      $ska4=$aq['ska4'];
      $ska5=$aq['ska5'];
        $ska=array($ska1,$ska2,$ska3,$ska4,$ska5);
     for ($i= 0; $i <= 4; $i++){
      ?>
      <tr>
        <td align="center"><?php echo $i+1;?></td>
        <td>surat keterangan administrasi <?php echo $i+1;?></td>
        <td><?php 

        if(empty($ska[$i])){
        ?> <center><span class="label label-danger">belum upload</span></center>
        <td><center><a class="btn btn-default" disabled><i class="fa fa-eye"></i></a></center></td>
             
       
        <?php
        }else{ ?> <center><span class="label label-success">sudah upload</span></center>
        
        <td><center><a class="btn btn-default tooltipsku" href="#" data-toggle="modal" data-target="#modal_administrasi<?php echo $i;?>" data-placement="top" title="Lihat File"><i class="fa fa-eye"></i></a></center></td>
       
            <?php
        }
        ?></td>
      </tr>
    </form>
      <?php
      }
      ?>
    
    
    </tbody>
</table>
  
  
  </div>
  </div>
  <div role="tabpanel" class="tab-pane fade" id="teknis">
  <p></p>
 
  <form method="post" enctype="multipart/form-data">
  <div class="col-md-12">
  <table class="table table-bordered" >
    <thead>
      <tr class="success">
      <td width="5%"><center>No.</center></td>
      <td width="30%">Dokumen</td>
      <td width="10%"><center>Status</center></td>
      <td width="10%"><center>Lihat</center></td>
    </tr>
    
    
    </thead>
   <tbody>
    <?php
      $raaa=mysql_query("Select * from file_upload where id_paket='$pak' and id_perusahaan='".$_SESSION['id_perusahaan']."'");
      $aqa=mysql_fetch_array($raaa);
      $skt1=$aqa['skt1'];
      $skt2=$aqa['skt2'];
      $skt3=$aqa['skt3'];
      $skt4=$aqa['skt4'];
      $skt5=$aqa['skt5'];
        $skt=array($skt1,$skt2,$skt3,$skt4,$skt5);
     for ($i= 0; $i <= 4; $i++){
      ?>
      <tr>
        <td align="center"><?php echo $i+1;?></td>
        <td>surat keterangan teknis <?php echo $i+1;?></td>
        <td><?php 

        if(empty($skt[$i])){
        ?> <center><span class="label label-danger">belum upload</span></center>
        <td><center><a class="btn btn-default" disabled><i class="fa fa-eye"></i></a></center></td>
            
       
        <?php
        }else{ ?> <center><span class="label label-success">sudah upload</span></center>
        
        <td><center><a class="btn btn-default tooltipsku" href="#" data-toggle="modal" data-target="#modal_teknis<?php echo $i;?>" data-placement="top" title="Lihat File"><i class="fa fa-eye"></i></a></center></td>
       
            <?php
        }
        ?></td>
      </tr>
    </form>
      <?php
      }
      ?>
    
    
    </tbody>
</table>
  
  
  </div>
  </div>
  <div role="tabpanel" class="tab-pane fade" id="harga">
  <p></p>
  
  <div class="col-md-12">
  <table class="table table-bordered" >
    <thead>
      <tr class="success">
      <td width="5%"><center>No.</center></td>
      <td width="30%">Dokumen</td>
      <td width="10%"><center>Status / harga</center></td>
      <td width="15%"><center>Lihat File</center></td>
    </tr>
    
    
    </thead>
    <tbody>
    <?php
      $ra=mysql_query("Select file_upload.skh1, harga.harga_penawaran from file_upload join harga on file_upload.id_file_upload=harga.id_file_upload where harga.id_paket='$pak' and harga.id_perusahaan='".$_SESSION['id_perusahaan']."'");
      while($a=mysql_fetch_array($ra))
      {
      ?>
      <tr>
        <td align="center">1</td>
        <td>surat keterangan harga 1</td>
        <td><?php 
        $skh1=$a['skh1'];
        if( empty($skh1)){
        ?> <center><span class="label label-danger">belum upload</span></center>
        <td><center><a class="btn btn-default" href="<?php echo $a['skh1']; ?>" disabled><i class="fa fa-eye"></i></a></center></td>
        
        <?php
        }else{ ?> <center><span class="label label-success">sudah upload</span></center>
        
        <td><center><a class="btn btn-default tooltipsku" href="#" data-toggle="modal" data-target="#modal_harga" data-placement="top" title="Lihat File"><i class="fa fa-eye"></i></a></center></td>
     
        <?php
        }
        ?></td>
    <?php
     }
    ?>
    
    </tbody>
</table>
  
  
  </div>
  </div>
</div>


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

</div>
</div>

</div></div>



<?php

 for ($i= 0; $i <= 4; $i++){
?>
<div id="modal_kualifikasi<?php echo $i;?>" 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">File Terupload</h4>
            </div>
            <div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
  <div class="col-md-12">
   <table class="table table-bordered">
      <tr class="success">
        <td><center>No</center></td>
        <td>Surat Keterangan Kualifikasi <?php echo$i+1;?></td>
        <td><center>Download</center></td>
        
      </tr>
      <tr>
        <?php
        $no=0;
        $ra=mysql_query("Select * from file_upload where id_paket='$pak' and id_perusahaan='".$_SESSION['id_perusahaan']."'");
      while($a=mysql_fetch_array($ra)){ 
      $skk[]=$a['skk1'];
      $skk[]=$a['skk2'];
      $skk[]=$a['skk3'];
      $skk[]=$a['skk4'];
      $skk[]=$a['skk5'];
      $file=explode(',', $skk[$i]);
      for ($c=0;$c<count($file);$c++){$no++;
        $bb=$file[$c];
     
      ?>
        <td align="center"><?php echo $no;?></td>

        <td><?php echo $bb."</br>"; ?></td>

        <td><center><a class="btn btn-default tooltipsku" target="_blank"  href="./asset/file/kualifikasi/<?php echo $bb; ?>" data-placement="top" title="Download"><i class="fa fa-download"></i></a></center></td>
         </tr>
  <?php
    }
     }
      ?>
     
        
        
      
     
    </table>


  </div></div>


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






<?php

 for ($i= 0; $i <= 4; $i++){
?>
<div id="modal_administrasi<?php echo $i;?>" 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">File Terupload</h4>
            </div>
            <div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
  <div class="col-md-12">
   <table class="table table-bordered">
      <tr class="success">
        <td><center>No</center></td>
        <td>Surat Keterangan Administrasi <?php echo$i+1;?></td>
        <td><center>Download</center></td>
        
      </tr>
      <tr>
        <?php
        $no=0;
        $ra=mysql_query("Select * from file_upload where id_paket='$pak' and id_perusahaan='".$_SESSION['id_perusahaan']."'");
      while($a=mysql_fetch_array($ra)){ 
      $ska[]=$a['ska1'];
      $ska[]=$a['ska2'];
      $ska[]=$a['ska3'];
      $ska[]=$a['ska4'];
      $ska[]=$a['ska5'];
      $file=explode(',', $ska[$i]);
      for ($c=0;$c<count($file);$c++){$no++;
        $bb=$file[$c];
     
      ?>
        <td align="center"><?php echo $no;?></td>

        <td><?php echo $bb."</br>"; ?></td>

        <td><center><a class="btn btn-default tooltipsku" target="_blank"  href="./asset/file/administrasi/<?php echo $bb; ?>" data-placement="top" title="Download"><i class="fa fa-download"></i></a></center></td>
         </tr>
       
  <?php
    }
     }
      ?>
       
        
    </table>
</form>

  </div></div>

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

<?php

 for ($i= 0; $i <= 4; $i++){
?>
<div id="modal_teknis<?php echo $i;?>" 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">File Terupload</h4>
            </div>
            <div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
  <div class="col-md-12">
   <table class="table table-bordered">
      <tr class="success">
        <td><center>No</center></td>
        <td>Surat Keterangan Teknis <?php echo$i+1;?></td>
        <td><center>Download</center></td>
        
      </tr>
      <tr>
        <?php
        $no=0;
        $ra=mysql_query("Select * from file_upload where id_paket='$pak' and id_perusahaan='".$_SESSION['id_perusahaan']."'");
      while($a=mysql_fetch_array($ra)){ 
      $skt[]=$a['skt1'];
      $skt[]=$a['skt2'];
      $skt[]=$a['skt3'];
      $skt[]=$a['skt4'];
      $skt[]=$a['skt5'];
      $file=explode(',', $skt[$i]);
      for ($c=0;$c<count($file);$c++){$no++;
        $bb=$file[$c];
     
      ?>
        <td align="center"><?php echo $no;?></td>

        <td><?php echo $bb."</br>"; ?></td>

        <td><center><a class="btn btn-default tooltipsku" target="_blank"  href="./asset/file/teknis/<?php echo $bb; ?>" data-placement="top" title="Download"><i class="fa fa-download"></i></a></center></td>
         </tr>
  <?php
    }
     }
      ?>
     
    </table>
</form>

  </div></div>


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


<div id="modal_harga" 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">File Terupload</h4>
            </div>
            <div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
  <div class="col-md-12">
   <table class="table table-bordered">
      <tr class="success">
        <td><center>No</center></td>
        <td>Surat Keterangan Harga 1</td>
        <td><center>Download</center></td>
        
      </tr>
      <tr>
        <?php
        $no=0;
        $ra=mysql_query("Select * from file_upload where id_paket='$pak' and id_perusahaan='".$_SESSION['id_perusahaan']."'");
      while($a=mysql_fetch_array($ra)){ 
      $skh1=$a['skh1'];
      $file=explode(',', $skh1);
      for ($c=0;$c<count($file);$c++){$no++;
        $bb=$file[$c];
     
      ?>
        <td align="center"><?php echo $no;?></td>

        <td><?php echo $bb."</br>"; ?></td>

        <td><center><a class="btn btn-default tooltipsku" target="_blank"  href="./asset/file/harga/<?php echo $bb; ?>" data-placement="top" title="Download"><i class="fa fa-download"></i></a></center></td>
         </tr>
          
  <?php
    }
     }
      ?>
        
    </table>
     </div></div>
</form>

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


