<!-- **********************************************************************************************************************************************************
    MAIN CONTENT
    *********************************************************************************************************************************************************** -->
<!--main content start-->
<?php
if ($data_testimony->num_rows() == 0) {
    $id = "";
    $nama = "";
    $alamat = "";
    $no_telp = "";
    $picture = "";
    $testimony = "";
    $status = "";
} else {
    foreach ($data_testimony->result() as $tes) {
        $id = $tes->id;
        $nama = $tes->name;
        $alamat = $tes->address;
        $no_telp = $tes->phone_no;
        $picture = $tes->picture;
        $testimony = $tes->testimony;
        $status = $tes->status;
    }
}
?>
<section id="main-content">
    <section class="wrapper">
        <div class="row mt">
            <div class="col-lg-12">
                <div class="form-panel">
                    <h4 class="mb"><i class="fa fa-angle-right"></i> Edit Testimony</h4>
                    <form class="form-horizontal style-form" method="POST" action="<?= base_url() ?>admin/testimony/simpanData" enctype="multipart/form-data">
                        <input type="hidden" value="<?= $id ?>" name="id">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Nama</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" value="<?= $nama ?>" name="nama">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Alamat</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" value="<?= $alamat ?>" name="alamat">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">No Telp</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" value="<?= $no_telp ?>" name="no_telp">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Testimony</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" value="<?= $testimony ?>" name="testimony">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Image</label>
                            <div class="col-sm-10">
                                <input type="file" class="form-control" name="userfile">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">Status</label>
                            <div class="col-sm-10">
                                <select name="status" class="form-control">
                                    <option value="<?= $status ?>">
                                        <?php
                                        if($status==1){
                                            echo "Approved";
                                        }
                                        else{
                                            echo "Not Approved";
                                        }
                                        ?>
                                    </option>
                                    <option value="">--Chose One--</option>
                                    <option value="0">Not Aprroved</option>
                                    <option value="1">Aprroved</option>
                                </select>
                            </div>
                        </div>


                        <hr/>
                        <a href="<?= base_url() ?>admin/testimony">
                            <button type="button" class="btn btn-default"><i class="fa fa-arrow-left"></i> Cancel</button>
                        </a>
                        <button type="submit" class="btn btn-primary pull-right"><i class="fa fa-save"></i> Save Data</button>
                    </form>
                    <div style="clear: both"></div>
                </div>
            </div>
        </div><!--row -->
    </section>
</section>
