<script type="text/javascript" src="tinymce/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
  tinymce.init({
  selector: 'textarea',
  height: 500,
  theme: 'modern',
  plugins: [
    'advlist autolink lists link image charmap print preview hr anchor pagebreak',
    'searchreplace wordcount visualblocks visualchars code fullscreen',
    'insertdatetime media nonbreaking save table contextmenu directionality',
    'emoticons template paste textcolor colorpicker textpattern imagetools'
  ],
  toolbar1: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
  toolbar2: 'print preview media | forecolor backcolor emoticons',
  image_advtab: true,
  templates: [
    { title: 'Test template 1', content: 'Test 1' },
    { title: 'Test template 2', content: 'Test 2' }
  ],
  content_css: [
    '//fast.fonts.net/cssapi/e6dc9b99-64fe-4292-ad98-6974f93cd2a2.css',
    '//www.tinymce.com/css/codepen.min.css'
  ]
 });
</script>
<div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
          DATA KEGIATAN UKS
          </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>
                                    <div class="btn-group">
                                        <button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i class="fa fa-wrench"></i></button>
                                      <ul class="dropdown-menu" role="menu">
                                        <li><a href="#">Action</a></li>
                                        <li><a href="#">Another action</a></li>
                                        <li><a href="#">Something else here</a></li>
                                        <li class="divider"></li>
                                        <li><a href="#">Separated link</a></li>
                                      </ul>
                                    </div>
                                <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
					include 'koneksi.php';
					$ID = $_GET['ID'];
					$query = mysql_query("SELECT * FROM SuratMasuk where ID='$ID'") or die (mysql_error());
					$data = mysql_fetch_array($query);
					?>
			<form id="form-data" role="form" action="" method="post" enctype="multipart/form-data">
                      <div class="form-group">
                        <label for="inputName" class="col-sm-2 control-label">Nama Kegiatan</label>
                        <div class="col-sm-3">
                          <input type="text" class="form-control" id="JenisSurat" placeholder="" name="JenisSurat" value=" <?php echo $data['JenisSurat']; ?>" required >
                        </div>
                      </div>
                      <br><br>
                      <div class="form-group">
                        <label for="inputExperience" class="col-sm-2 control-label">Lokasi</label>
                        <div class="col-sm-10">
                          <input type="text" class="form-control" id="NoSurat" placeholder="" name="NoSurat" value=" <?php echo $data['NoSurat']; ?>" required >
                        </div>
                      </div>
                      <br><br>
                      <div class="form-group">
                        <label for="inputSkills" class="col-sm-2 control-label">Waktu Pelaksanaan</label>
                        <div class="col-sm-4">
                          <input type="date" class="form-control" id="TanggalSurat"  name="TanggalSurat" value=" <?php echo $data['TanggalSurat']; ?>" required >
                        </div>
                      </div>
                      <br><br>
                      <div class="form-group">
                        <label for="inputExperience" class="col-sm-2 control-label">Isi</label>
                        <div class="col-sm-10">
                          <textarea class="form-control" id="IsiSurat" name="IsiSurat" required ><?php echo $data['IsiSurat']; ?></textarea><br>
                        </div>
                      </div>
                      <br><br>
                      <div class="form-group">
                        <label for="inputSkills" class="col-sm-2 control-label">Penanggungjawab</label>
                        <div class="col-sm-10">
                          <input type="text" class="form-control" id="Pengirim" placeholder="" name="Pengirim" value=" <?php echo $data['Pengirim']; ?>"  required ><br>
                        </div>
                      </div>
                      
                      <div class="form-group">
                        <label for="inputSkills" class="col-sm-2 control-label">Keterangan</label>
                        <div class="col-sm-10">
                          <input type="text" class="form-control" id="Keterangan" placeholder="" name="Keterangan" value=" <?php echo $data['Keterangan']; ?>" required ><br>
                        </div>
                      </div>  
                      <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                          <button type="submit" class="btn btn-danger"name="TambahAgenda">Submit</button>
                          <?php
				if (isset($_POST['TambahAgenda'])) 
				{
				include 'koneksi.php';					
				    $JenisSurat = $_POST['JenisSurat'];
	                            $NoSurat= $_POST['NoSurat']; 
	                            $TanggalSurat= $_POST['TanggalSurat']; 
	                            $IsiSurat= $_POST['IsiSurat']; 
	                            $Pengirim= $_POST['Pengirim'];
	                            $Penerima= $_POST['Penerima'];
	                            $Keterangan = $_POST['Keterangan'];
	                            
				$query = mysql_query("UPDATE SuratMasuk SET JenisSurat='$JenisSurat', NoSurat='$NoSurat', TanggalSurat='$TanggalSurat', IsiSurat='$IsiSurat', Pengirim='$Pengirim', Penerima='$Penerima', Keterangan='$Keterangan' WHERE ID='$ID' ") or die (mysql_error());
					echo "<script>window.location='indexadmin.php?p=UksKegiatan';</script>";
				}
				?>
					
				</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>