<form action='' method='post' name='frm-tambah'> //FORM PERTAMAA !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<table>
<tr>
<td>Nomor Risalah</td><td> : </td>
<td><input type='text' name='kd_risalah' id='kb' value='<?php echo $valKB; ?>'></td>
</tr>
<tr>
<td>Pemohon Risalah</td><td> : </td>
<td><input type='text' name='no_surat'></td>
</tr>
<tr>
<td>Penanggung jawab</td><td> : </td>
<td><?php
echo "<select name='pl'>";
$tampil=mysql_query("SELECT * FROM pl ORDER BY id");
echo "<option value='' selected>- Pilih Salah Satu -</option>";
while($w=mysql_fetch_array($tampil))
{
echo "<option value=$w[nama]>$w[nama]</option>";
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td>Tanggal Surat</td><td> : </td>
<td><input type='text' name='tahun' size='10' value='<?php echo $arr['tgl_masuk']; ?>'></td>
</tr>
<tr>
<td>Pemohon</td><td> : </td>
<td><input type='text' name='pemohon' value="<?php echo $arr['pemohon']; ?>"></td>
</tr>
<tr>
<td>Limit Lelang</td><td> : </td>
<td><input type='text' name='lmt' size='10' value="<?php echo $arr['lmt']; ?>"></td>
</tr>
<tr>
<td>Baru/Ulang </td><td> : </td>
<td><select name='lmt'>
<option value='B'>Baru</option>
<option value='U'>Ulang</option>
</select>
</td>
</tr>
<form action="#" method="post"> //FORM KEDUA !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<tr>
<td>Input Jumlah Debitur</td><td> : </td>
<td>
<select name="jmldbt<?php echo $jumlah; ?>"><br>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
</select>
</td>
<td><input type="submit" name="tambahdt" value="+" class="btn btn-info"></td>
</form>
</tr>
<?php
if($_POST['jmldbt'])
{
?>
<?php
$jumlah = $_POST['jmldbt'];
for($a=1;$a<=$jumlah;$a++)
{
?>
<tr>
<td>Debitur Ke - <?php echo $a; ?></td><td> : </td>
<td><input type="text" name="nmdbt<?php echo $jumlah; ?>"><br></td>
</tr>
<?php
}
?>
<?php
}
?>
<tr>
<td>Lokasi Risalah</td><td> : </td>
<td><select name='lemari'style="width: 140px;">
<option value=''>--Lemari--</option>
<option value='Lemari 1984'>Lemari 1984</option>
<option value='Lemari 1985'>Lemari 1985</option>
<option value='Lemari 1986'>Lemari 1986</option>
<option value='Lemari 1987'>Lemari 1987</option>
<option value='Lemari 1988'>Lemari 1988</option>
<option value='Lemari 1989'>Lemari 1989</option>
<option value='Lemari 1990'>Lemari 1990</option>
<option value='Lemari 1991'>Lemari 1991</option>
<option value='Lemari 1992'>Lemari 1992</option>
<option value='Lemari 1993'>Lemari 1993</option>
<option value='Lemari 1994'>Lemari 1994</option>
<option value='Lemari 1995'>Lemari 1995</option>
<option value='Lemari 1996'>Lemari 1996</option>
<option value='Lemari 1997'>Lemari 1997</option>
<option value='Lemari 1998'>Lemari 1998</option>
<option value='Lemari 1999'>Lemari 1999</option>
<option value='Lemari 2000'>Lemari 2000</option>
<option value='Lemari 2001'>Lemari 2001</option>
<option value='Lemari 2002'>Lemari 2002</option>
<option value='Lemari 2003'>Lemari 2003</option>
<option value='Lemari 2004'>Lemari 2004</option>
<option value='Lemari 2005'>Lemari 2005</option>
<option value='Lemari 2006'>Lemari 2006</option>
<option value='Lemari 2007'>Lemari 2007</option>
<option value='Lemari 2008'>Lemari 2008</option>
<option value='Lemari 2009'>Lemari 2009</option>
<option value='Lemari 2010'>Lemari 2010</option>
<option value='Lemari 2011'>Lemari 2011</option>
<option value='Lemari 2012'>Lemari 2012</option>
<option value='Lemari 2013'>Lemari 2013</option>
<option value='Lemari 2014'>Lemari 2014</option>
<option value='Lemari 2015'>Lemari 2015</option>
<option value='Lemari 2016'>Lemari 2016</option>
<option value='Lemari 2017'>Lemari 2017</option>
<option value='Lemari 2018'>Lemari 2018</option>
</select>
<select name='indeks' style="width: 100px;">
<option value=''>--Indeks--</option>
<option value='Indeks A'>Indeks A</option>
<option value='Indeks B'>Indeks B</option>
<option value='Indeks C'>Indeks C</option>
<option value='Indeks D'>Indeks D</option>
<option value='Indeks E'>Indeks E</option>
</select>
<select name='rak' style="width: 100px;">
<option value=''>--Rak--</option>
<option value='Rak 1'>Rak 1</option>
<option value='Rak 2'>Rak 2</option>
<option value='Rak 3'>Rak 3</option>
<option value='Rak 4'>Rak 4</option>
<option value='Rak 5'>Rak 5</option>
<option value='Rak 6'>Rak 6</option>
</select>
</td>
</tr>
<tr><td colspan='3'><input class="btn btn-info" type='submit' value='Tambah' name='tambah'></td></tr>
</table>
</form>
<script language="javascript" >
function OperasiPerhitungan(){
A1 = document.getElementById("angka1").value;
A2 = document.getElementById("angka2").value;
A3 = (parseFloat(A1) + parseFloat(A2))/2;
document.getElementById("hasil").value =A3;
}
</script>
<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
<div class="row">
<div class="col-lg-12">
<center><h3 class="page-header">EDIT NILAI</h3></center>
</div>
</div><!--/.row-->
<?php include ('koneksi.php');
$nip=$_SESSION['$nip'];
?>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-danger">
<div class="panel-body">
<form method="POST" action="input_nilai_edit_proses.php">
<table id="example" class="" cellspacing="0" width="100%">
<thead>
<tr class="alert warning">
<th>No</th>
<th></th>
<th>NIS</th>
<th>Siswa</th>
<th>UH 1</th>
<th>UH 2</th>
<th>RERATA</th>
</tr>
</thead>
<tbody>
<?php
include('koneksi.php');
$id_mapel = $_GET['id_mapel'];
$query = mysql_query("SELECT siswa.nama,nilai.id_mapel, nilai.id_nilai,
nilai.nis, nilai.uh1,nilai.uh2
FROM siswa, nilai WHERE siswa.nis=nilai.nis AND nilai.id_mapel= '$id_mapel'");
$no = 0; //membuat variabel $no untuk membuat nomor urut
while($data = mysql_fetch_array($query)){
$no++;
$id_nilai = $data['id_nilai'];
$id_mapel = $data['id_mapel'];
$rerata = $data['rerata'];
?>
<tr>
<td><?php echo $no; ?></td>
<td><input type="hidden" name="id_nilai[]" value="<?php echo $data['id_nilai']; ?>"></td>
<td><?php echo $data['nis']; ?></td>
<td><?php echo $data['nama']; ?></td>
<td><input type="number" name="uh1[]" id="angka1" onchange="OperasiPerhitungan();" value="0" style="width:50px"></td>
<td><input type="number" name="uh2[]" id="angka2" onchange="OperasiPerhitungan();" value="0" style="width:50px"></td>
<td><input type="number" name="rerata[]" id="hasil" disabled="disabled" value="0" style="width:80px"></td>
</tr>
<?php } ?>
</tbody>
</table>
<div class='navbar-form pull-left'>
<button type="submit" name="tambah" class="btn btn-danger">Simpan</button>
</div>
</form>
$tanggal = strtotime('2018-05-22');
$sekarang = time(); // Waktu sekarang
$diff = $sekarang - $tanggal ;
echo 'Waktu pengerjaan yaitu ' . floor($diff / (60 * 60 * 24)).' Hari'.'<br><br>';
if ($diff <= 3){
echo ' Ontime';
}else{
echo ' Over time';
mohon bantuannya jika ada kesalahan.