<div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            PENGATURAN 
          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            
          </ol>
        </section>

        <!-- Main content -->
        <section class="content">
        <!-- TAB INDUK PENDUDUK -->
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title"></h3>
                            <div class="box-tools pull-right">
                                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                                    
                                <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                            </div>
                    </div><!-- /.box-header -->
                    <div class="box-body">
					<?php
                                    $query = mysql_query("SELECT * FROM contact");
                                    while ($data = mysql_fetch_array($query)) {
                                    ?>
                <form id="form-data" role="form" action="" method="post" enctype="multipart/form-data">           
                    
                    <div class="row">
                        <div class="col-sm-3">
                            <img src="images/Kontak/<?php echo $data['image']; ?>" class="img-thumbnail" width="250" height=""><br><br>
                           

                        </div>
                    
                        <div class="col-sm-9" > <!-- padding left -->
                            

                            <div class="form-group">
                                <label for="inputName" class="col-sm-3 control-label">Alamat</label>
                                <div class="col-sm-8">
                                    <textarea class="form-control" id="alamat" name="alamat"><?php echo $data['alamat']; ?></textarea>
                                </div>
                            </div>
                            <br><br><br><br>
                            <div class="form-group">
                                <label for="inputName" class="col-sm-3 control-label">Kecamatan</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" id="Kecamatan" name="Kecamatan" value="<?php echo $data['Kecamatan']; ?>">
                                </div>
                            </div>
                            <br><br>
                            <div class="form-group">
                                <label for="inputName" class="col-sm-3 control-label">Kota/Kabupaten</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" id="Kota" name="Kota" value="<?php echo $data['Kota']; ?>">
                                </div>
                            </div>
                            <br><br>
                            <div class="form-group">
                                <label for="inputName" class="col-sm-3 control-label">Provinsi</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" id="Provinsi" name="Provinsi" value="<?php echo $data['Provinsi']; ?>">
                                </div>
                            </div>
                            <br><br>
                            <div class="form-group">
                                <label for="inputName" class="col-sm-3 control-label">No Telpon </label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" id="TelponDesa" name="TelponDesa" value="<?php echo $data['TelponDesa']; ?>">
                                </div>
                            </div>
                            <br><br>
                             <div class="form-group">
                                <label for="inputName" class="col-sm-3 control-label">Faksimile</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" id="telp_lain" name="telp_lain" value="<?php echo $data['telp_lain']; ?>">
                                </div>
                            </div>
                            <br><br>
                            <div class="form-group">
                                <label for="inputName" class="col-sm-3 control-label">Email </label>
                                <div class="col-sm-8">
                                    <input type="email" class="form-control" id="email" name="email" value="<?php echo $data['email']; ?>">
                                </div>
                            </div>

                            <br><br>
                        </div> <!-- end padding left -->
                    </div>
                    <div class="box-footer">
                        <div class="form-group" style="padding-left:930px;">
                            <button class="btn btn-primary btn-lg" name="EditKontak"><i class="fa fa-refresh"></i> Update</button>
                        </div>
                    </div>
					<?php
				if (isset($_POST['EditKontak'])) 
				{
				include ('koneksi.php');
				error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
				$id = $_POST['id'];
				$image=$_FILES['image']['name'];
				$move=move_uploaded_file($_FILES['image']['tmp_name'],'images/Kontak/'.$image);
				if(empty($image))   //jika gambar kosong atau tidak di ganti
				{
					$update=mysql_query("update contact set pemerintah='$_POST[pemerintah]',alamat='$_POST[alamat]',Kecamatan='$_POST[Kecamatan]', Kota='$_POST[Kota]', Provinsi='$_POST[Provinsi]', TelponDesa='$_POST[TelponDesa]', telp_lain='$_POST[telp_lain]', email='$_POST[email]' where id='$_POST[id]' ") or die (mysql_error());
				echo "<script>document.location='indexadmin.php?p=UksPengaturan' </script> ";
				}
				elseif (!empty($image)) // jika gambar di ganti
				{
					$update=mysql_query("update contact set pemerintah='$_POST[pemerintah]', alamat='$_POST[alamat]', Kecamatan='$_POST[Kecamatan]', Kota='$_POST[Kota]', Provinsi='$_POST[Provinsi]', TelponDesa='$_POST[TelponDesa]', telp_lain='$_POST[telp_lain]', email='$_POST[email]', image='$image' where id='$_POST[id]' ") or die (mysql_error());
				echo "<script>document.location='indexadmin.php?p=UksPengaturan' </script> ";
				}
				}
				?>
                </form>  
                          <?php } ?>

                    </div><!-- ./box-body -->
                </div><!-- /.box -->
            </div><!-- /.col -->
        </div><!-- /.row -->
        <!-- TAB END INDUK PENDUDUK --------------------------------------------------------------------->    
    </section>
</div>
<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>