      
<?php
include '../../../../config/koneksi.php';
session_start();
?>

       <?php
       echo  $_GET['kode_sub_skpd'];
       echo  $_GET['kode_programh'];
       echo  $_GET['id_iprogramh'];
       $kode_sub_skpd=$_GET['kode_sub_skpd'];
       $kode_program=$_GET['kode_programh'];
       $id_iprogram=$_GET['id_iprogramh'];


$sqlie  = mysqli_query($koneksi, "SELECT 
    distinct a.kode_program,a.program,
    pr.indikator_iprogram,
    pr.k_target_iprogram_renstra,
    pr.k_realisasi_iprogram_renstra,
    pr.target_iprogram_renja,
    pr.t_iprogram1,
    pr.t_iprogram2,
    pr.t_iprogram3,
    pr.t_iprogram4,
    pr.satuan_iprogram

    from(( renja as a)
    left join
    (
     SELECT a.kode_sub_skpd,a.kode_program,a.tahun,a.indikator_iprogram,
    a.k_target_iprogram_renstra,
    a.k_realisasi_iprogram_renstra,
    a.target_iprogram_renja,
    a.t_iprogram1,
    a.t_iprogram2,
    a.t_iprogram3,
    a.t_iprogram4,
    a.satuan_iprogram

    from iprogram as a where a.kode_sub_skpd='$kode_sub_skpd' and a.kode_program='$kode_program' and id_iprogram='$id_iprogram' and a.tahun='$_SESSION[tahun]'
    ) as pr on pr.kode_sub_skpd=a.kode_sub_skpd and pr.kode_program=a.kode_program)


    where 
    a.kode_sub_skpd='$kode_sub_skpd' and a.kode_program='$kode_program' 

    ");
foreach ($sqlie as $rowe) {

    ?>
              <p><label>Indikator Program</label>
                <textarea id="indikator_iprogram" class="form-control"><?php echo $rowe['indikator_iprogram'] ?></textarea>
              
              </p>
              
                <table class="table">
                    <tr>
                        <td style="text-align:center; vertical-align: middle;width:20px">
                            <label>Target Renstra SKPD pada Tahun 2026<br> (Kondisi Akhir Periode Rencana)</label>
                        </td>
                        <td style="width:10px"></td>
                        <td style="text-align:center; vertical-align: middle;width:20px">
                            <label>Realisasi  Capaian Program Renstra SKPD <br> sampai dengan Renja SKPD Tahun <?php  echo ($_SESSION['tahun'])-1;?></label>
                        </td>
                        <td style="width:10px"></td>
                        <td style="text-align:center; vertical-align: middle;width:20px">
                            <label>Target Kinerja dan Anggaran Renja SKPD Tahun Berjalan yang dievaluasi (<?php  echo $_SESSION['tahun'];?>)</label>
                        </td>
                        <td style="width:10px"></td>
                        <td style="text-align:center; vertical-align: middle;width:20px">
                            <label>Satuan</label>
                        </td>
                    </tr>
                    <tr>
                        <td style="vertical-align: top;">
                             <table>
                                <tr><td>Kinerja&nbsp(K)</td><td><input type="text" id="k_target_iprogram_renstra" class="form-control" value="<?php echo $rowe['k_target_iprogram_renstra'] ?>" ></td></tr>
                            </table>
                           
                        </td>
                        <td style="width:50px"></td>
                        <td  style="vertical-align: top;">
                                <table>
                                    <tr><td>Kinerja&nbsp(K)</td><td><input type="text" id="k_realisasi_iprogram_renstra" value="<?php echo $rowe['k_realisasi_iprogram_renstra'] ?>" class="form-control" ></td></tr>
                                </table>
                        </td>
                        <td style="width:50px"></td>
                         <td style="vertical-align: top;">
                             <table>
                                <tr><td>Target&nbsp(K)</td><td><input type="text" id="target_iprogram_renja" class="form-control" value="<?php echo $rowe['target_iprogram_renja'] ?>"></td></tr>
                            </table>
                         </td>
                        <td style="width:50px"></td>
                         <td style="vertical-align: top;">
                             <table>
                                <tr><td>Satuan</td><td><input type="text" id="satuan_iprogram" class="form-control" value="<?php echo $rowe['satuan_iprogram'] ?>"></td></tr>
                            </table>
                         </td>

                    </tr>
                </table>
             
              <table class="table">
                  <tr><th colspan="8" style="text-align: center;">Realisasi  Triwulan</th></tr>
                  <tr>
                    <th colspan="2" style="text-align: center;">I</th>
                    <th colspan="2" style="text-align: center;">II</th>
                    <th colspan="2" style="text-align: center;">III</th>
                    <th colspan="2" style="text-align: center;">IV</th>
                </tr>
                  <tr>
                    <td>Kinerja(K)</td>
                    <td><input type="text" id="t_iprogram1" class="form-control" value="<?php echo $rowe['t_iprogram1'] ?>"></td>
                    <td>Kinerja(K)</td>
                    <td><input type="text" id="t_iprogram2" class="form-control" value="<?php echo $rowe['t_iprogram2'] ?>"></td>
                    <td>Kinerja(K)</td>
                    <td><input type="text" id="t_iprogram3" class="form-control" value="<?php echo $rowe['t_iprogram3'] ?>"></td>
                    <td>Kinerja(K)</td>
                    <td><input type="text" id="t_iprogram4" class="form-control" value="<?php echo $rowe['t_iprogram4'] ?>"></td></tr>
              </table>

               <div class="modal-footer justify-content-between" style="background-image: linear-gradient(white,lightblue); border-radius: 18px;">
                <button style="float:right" class="btn btn-warning" data-dismiss="modal" >Batal</button>
         
            <button style="float:left" class="btn btn-danger " data-dismiss="modal" onclick="hapusprogram()">Hapus</button>

         
            </div>


              
             <?php }

mysqli_close($koneksi);
         ?>