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

       <?php
       echo  $_GET['kode_sub_skpd'];
       echo  $_GET['kode_programs'];
       $kode_sub_skpd=$_GET['kode_sub_skpd'];
       $kode_programs=$_GET['kode_programs'];


$sqlie  = mysqli_query($koneksi, "SELECT 
    distinct a.kode_program,a.program,
    pr.sasaran,
    pr.id_msasaran

    from(( renja as a)
    left join
    (
     SELECT id_sasaran as id_msasaran,kode_program,kode_sub_skpd,sasaran
    from evsasaran as a where a.kode_sub_skpd='$kode_sub_skpd' and a.kode_program='$kode_programs' 
    ) 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_programs' 

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

    ?>
              
       <p><label>Sasaran</label>
        <textarea id='sasaran' class="form-control"><?php echo $rowe['sasaran'] ?></textarea></p>
           <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>

             <?php 
             if(empty($rowe['id_msasaran']))
             {

             ?>
             <button style="float:left" class="btn btn-success " data-dismiss="modal" onclick="inputsasaran()">Simpan</button>
         <?php }
         
         else
         {
         ?>
                <button style="float:left" class="btn btn-success " data-dismiss="modal" onclick="ubahsasaran()">Ubah</button>
      


         <?php
     }

        ?> 

         
            </div>
             <?php }

mysqli_close($koneksi);
         ?>