<?php include 'monev_header.php'; ?>

<div class="breadcome-area">
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="breadcome-list">
                    <div class="row">
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                            <div class="breadcome-heading">
                                <h4 style="margin-bottom: 0px">Edit Laporan</h4>
                            </div>
                        </div>
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                            <ul class="breadcome-menu" style="padding-top: 0px">
                                <li><a href="#">Home</a> <span class="bread-slash">/</span></li>
                                <li><span class="bread-blod">Arsip</span></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="container-fluid">


    <div class="row">
        <div class="col-lg-6 col-lg-offset-3">
            <div class="panel panel">

                <div class="panel-heading">
                    <h3 class="panel-title">Edit Laporan</h3>
                </div>
                <div class="panel-body">

                    <div class="pull-right">            
                        <a href="monev.php" class="btn btn-sm btn-primary"><i class="fa fa-arrow-left"></i> Kembali</a>
                    </div>

                    <br>
                    <br>


                    <?php 
                    $id = $_GET['id'];              
                    $data = mysqli_query($koneksi, "select * from monev where id_monev='$id'");
                    while($d = mysqli_fetch_array($data)){
                        ?>

                        <form method="post" action="monev_update.php" enctype="multipart/form-data">
						
						<input type="hidden" class="form-control" name="id" required="required"  value="<?php echo $d['id_monev']; ?>" >
						
                            <div class="form-group">
                            <label>Nomor Surat Undangan</label>
                            <select class="form-control" name="kode_surat" required="required">
                                <option value="">Pilih Nomor Surat Undangan</option>
                                <?php 
                                $undangan = mysqli_query($koneksi,"SELECT * FROM undangan");
                                while($u = mysqli_fetch_array($undangan)){
                                    ?>
                                    <option <?php if($u['kode_surat'] == $d['kode_surat_und']){echo "selected='selected'";} ?> value="<?php echo $u['kode_surat']; ?>"><?php echo $u['no_surat']; ?></option>
                                    <?php 
                                }
                                ?>
                            </select>
                        </div>
						
                            <div class="form-group">
                           <label>Jenis File Monev</label>
                           <select type="text" class="form-control" name="jenis_monev" required="required">
						            <option >Pilih Jenis File</option>
                                    <option <?php if($d['jenis_monev'] == "Monev") echo "selected"; ?>  value="Monev">Monitoring dan Evaluasi</option>
                                    <option <?php if($d['jenis_monev'] == "Notulen") echo "selected"; ?>  value="Notulen">Notulensi</option>
									<option <?php if($d['jenis_monev'] == "Daftar Hadir") echo "selected"; ?> value="Daftar Hadir">Daftar Hadir</option>
									<option <?php if($d['jenis_monev'] == "Dokumentasi") echo "selected"; ?> value="Dokumentasi">Dokumentasi</option>
                            </select>
                        </div>
						
						
						<div class="form-group">
                            <label>Nomor Urut Monev</label>
                            <input type="text" class="form-control" name="nomor_monev" required="required"  value="<?php echo $d['nomor_monev']; ?>" >
						</div>
						 
						 <div class="form-group">
                            <label>Nama File Monev</label>
                            <textarea class="form-control" name="nama_monev" required="required"> <?php echo $d['nama_monev']; ?> </textarea>
                        </div>
						

                            <div class="form-group">
                                <label>File</label>
                                <input type="file" name="file">
                                <small>Kosongkan jika tidak ingin mengubah file</small>
                            </div>

                            <div class="form-group">
                                <label></label>
                                <input type="submit" class="btn btn-primary" value="Upload">
                            </div>

                        </form>

                        <?php 
                    }
                    ?>

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


</div>


<?php include 'footer.php'; ?>