LISTING BERBASISWEB

Listing Program Data Jabatan
<?php
include('conn.php');
?>
<body background="logo/55.png">
<div><h3><font color="#FFFFFF"><u>Data Jabatan</u></font></h3></div>
<?php
$aksi = $_GET['aksi']; //atu halo halaman per page
switch( $aksi ){
default :
                        $per_page = 25;
        if( empty($_GET['page']) ){
                $posisi = 0;
                $_GET['page'] = 1;
        } else {
                $posisi = ( $_GET['page'] - 1 ) * $per_page;
        }
        $pages_query = mysql_query("SELECT COUNT(kode_jabatan) FROM tb_jabatan");
        $pages = ceil(mysql_result($pages_query, 0) / $per_page);

        $page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
        $start_page = ($page - 1) * $per_page;

        $no = $posisi+1;
                        $pem = '';
                        if( isset($_GET['cari']) === false ){
                                    $t_jabatan = mysql_query("SELECT * FROM tb_jabatan ORDER BY kode_jabatan DESC LIMIT $start_page , $per_page");
                        } else {
                                    if( empty($_GET['cari']) === true ){
                                                $t_jabatan = mysql_query("SELECT * FROM tb_jabatan WHERE nama_jabatan LIKE '%$_GET[cari]%' ORDER BY nama_jabatan DESC LIMIT $start_page , $per_page");
                                                $pem = '<div class="alert aler-error"><h4><font color="red">Warning !!!</h4>Anda belum mengetikkan nama yang dicari.</font></div>';
                                    } else {
                                                $t_jabatan = mysql_query("SELECT * FROM tb_jabatan WHERE nama_jabatan LIKE '%$_GET[cari]%' ORDER BY nama_jabatan DESC LIMIT $start_page , $per_page");
                                                if( mysql_num_rows($t_jabatan) == 0 ){
                                                            $pem = '<div class="alert aler-error"><font color="red"><h4>Warning !!!</h4>nama jabatan yang anda cari tidak ada.</font></div>';
                                                }
                                    }
                        }
                       
                        $jabatan = mysql_query("SELECT * FROM tb_jabatan");
                        if( mysql_num_rows($jabatan) > 0 ){
                                    ?><form  method="get" action="<?php echo $_SERVER['PHP_SELF'] ?>">
                <input type="hidden" name="mod" value="jabatan">
                <input type="text" placeholder="Cari nama jabatan" name="cari">
                <button type="submit" class="btn"><i class="icon-search"></i>&nbsp;Search</button>
            </form><?php
                                    echo $pem;
                                    ?><table border="1">
                                                <thead>
                                                            <tr>
                                                                        <td width="24" bgcolor="#FFFFFF">No.</td>
                        <td width="116" align="center" bgcolor="#FFFFFF">Kode jabatan</td>
                                                              <td width="116" align="center" bgcolor="#FFFFFF">Nama jabatan</td>
                    
                                                              <td colspan="2" bgcolor="#FFFFFF"><center><a  href="?mod=<?php echo $_GET ['mod'] ?>&aksi=tambah"><img src="logo/Add.ico"><br>
                                                      Tambah</i></a></center></td>
                                                            </tr>
                                                </thead>
                                                <tbody>
                                                            <?php
                                                            while( $ti = mysql_fetch_array($t_jabatan) ){
                                                                        ?><tr>
                                                                                    <td align="center" bgcolor="#FFFFFF"><?php echo $no ?></td>
                <td align="center" bgcolor="#FFFFFF"><?php echo $ti['kode_jabatan'] ?></td>
                                                              <td align="center" bgcolor="#FFFFFF"><?php echo $ti['nama_jabatan'] ?></td>
                        
            <td width="36" bgcolor="#FFFFFF"><center><a href=?mod=<?php echo $_GET['mod'] ?>&aksi=edit&id=<?php echo $ti['kode_jabatan'] ?>"><img src="logo/Modify.ico">Edit</a></center></td>
   
    <td width="41" bgcolor="#FFFFFF"><center><a class="btn btn-mini btn-danger" data-toggle="tooltip" title="Hapus Data" href="?mod=<?php echo $_GET['mod'] ?>&aksi=hapus&id=<?php echo $ti['kode_jabatan'] ?>" onClick="return confirm('Apakah anda ingin menghapus data ini..?')"><i class="icon-trash icon-white"><img src="logo/Delete.ico">Hapus</i></a></center></td>
   
                                                                        </tr><?php
                                                                        $no++;}
                                                            ?>
                                                </tbody>
                                    </table>
           
                        <?php
                        } else {
                                    ?><div class="alert alert-danger"><h4>Perhatian !!!</h4>Data jabatan masih kosong. Silakan <a class="link" href="?mod=jabatan&aksi=tambah">[ klik ]</a> untuk menambah data jabatan.</div><?php
                        }
                       
                        break;
           
            case 'tambah';
                        if( isset($_POST['submit']) ){
                                    $err = array();
                                   
                                    $kode_jabatan = $_POST['kode_jabatan'];
                                    $nama_jabatan = $_POST['nama_jabatan'];

                                    if( empty($kode_jabatan) ){ $err[] = 'kode_jabatan masih kosong.'; }
                                    if( empty($nama_jabatan) ){ $err[] = 'nama_jabatan masih kosong.'; }
                                   
                                    if( empty($err) ){
                                                $save = mysql_query("INSERT INTO tb_jabatan (kode_jabatan,nama_jabatan ) VALUES ('$kode_jabatan','$nama_jabatan')");
                                                if( $save === true ){
                                                            ?><script>alert('Data jabatan berhasil disimpan.'); window.location=('?mod=jabatan');</script><?php
                                                } else {
                                                            ?><script>alert('Data jabatan gagal disimpan.'); window.location=('?mod=jabatan');</script><?php
                                                }
                                    } else {
                                                $err_msg = '<div class="alert alert-danger"><h4>Warning !!!</h4><ul><li>' . implode('</li><li>' , $err) . '</li></ul></div>';
                                    }
                        }
                       
                        if( isset($err) ){
                                    if( empty($err) === false ){
                                                echo $err_msg;
                                    }
                        }
                        ?><form class="form" method="post" enctype="multipart/form-data">
        <table width="264" border="1">
        <tr>
    <td width="95" bgcolor="#FFFFFF"><label>Kode jabatan </label></td>
    <td width="153" bgcolor="#FFFFFF">:<input  type="text" name="kode_jabatan" PLACEHOLDER="Masukan kode jabatan" value="<?php echo $kode_jabatan ?>" /></td>
  </tr>
  <tr>
    <td width="95" bgcolor="#FFFFFF"><label>Nama jabatan </label></td>
    <td width="153" bgcolor="#FFFFFF">:<input  type="text" name="nama_jabatan" PLACEHOLDER="Masukan nama jabatan" value="<?php echo $nama_pendidikan ?>" /></td>
 
</table>
           
            <div class="form-actions">
<input class="btn btn-primary" type="submit" name="submit" value="Simpan" />
                <input class="btn btn-primary"  type="button" value="Batal" onClick="self.history.back();" >
                <br>
            </div>
        </form><?php
                        break;
                       
            case 'edit';
                        if( isset($_POST['submit']) ){
                                    $err = array();
                                   
                                    $kode_jabatan = $_POST['kode_jabatan'];
                                    $nama_jabatan = $_POST['nama_jabatan'];
                                   
                                    if( empty($kode_jabatan) ){ $err[] = 'kode_jabatan masih kosong.'; }
                                    if( empty($nama_jabatan) ){ $err[] = 'nama_jabatan masih kosong.'; }
                                   
                                    if( empty($err) ){
                                                if( empty($file_tmp) === false ){
                                                            $save = mysql_query("UPDATE tb_jabatan SET kode_jabatan='$kode_jabatan',nama_jabatan='$nama_jabatan' WHERE kode_jabatan='$_GET[id]'");
                                                            if( $save === true ){
                                                                        ?><script>alert('Data jabatan berhasil di perbaharui.'); window.location=('?mod=jabatan');</script><?php
                                                            } else {
                                                                        ?><script>alert('Data jabatan gagal di perbaharui.'); window.location=('?mod=jabatan');</script><?php
                                                            }
                                                } else {
                                                            $save = mysql_query("UPDATE tb_jabatan SET kode_jabatan='$kode_jabatan',nama_jabatan='$nama_jabatan' WHERE kode_jabatan='$_GET[id]'");
                                                            if( $save === true ){
                                                                        ?><script>alert('Data jabatan berhasil di perbaharui.'); window.location=('?mod=jabatan');</script><?php
                                                            } else {
                                                                        ?><script>alert('Data jabatan gagal di perbaharui.'); window.location=('?mod=jabatan');</script><?php
                                                            }
                                                }
                                    } else {
                                                $err_msg = '<div class="alert alert-danger"><h4>Warning !!!</h4><ul><li>' . implode('</li><li>' , $err) . '</li></ul></div>';
                                    }
                        }
                       
                        if( isset($err) ){
                                    if( empty($err) === false ){
                                                echo $err_msg;
                                    }
                        }
                       
                        $te = mysql_fetch_array(mysql_query("SELECT * FROM tb_jabatan WHERE kode_jabatan='$_GET[id]'"));
                        ?><form class="form" method="post" enctype="multipart/form-data">
        <table width="264" border="0">
        <tr>
            <td bgcolor="#FFFFFF"><label>kode_jabatan </label></td>
      <td bgcolor="#FFFFFF"><input class="input-xlarge" type="text" name="kode_jabatan"  value="<?php echo $te['kode_jabatan'] ?>" /></td></tr>
            <tr>
            <tr>
            <td bgcolor="#FFFFFF"><label>nama_jabatan </label></td>
        <td bgcolor="#FFFFFF"><input class="input-xlarge" type="text" name="nama_jabatan"  value="<?php echo $te['nama_jabatan'] ?>" /></td></tr>
        
  </table>
            <div class="form-actions">
      <input class="btn btn-primary" type="submit" name="submit" value="Perbaharui" />
                <input class="btn btn-primary"  type="button" value="Batal" onClick="self.history.back();" >
                <br>
            </div>
        </form><?php
                        break;
                       
            case 'hapus';
                        $hapus = mysql_query("DELETE FROM tb_jabatan WHERE kode_jabatan='$_GET[id]'");
                        if( $hapus === true ){
                                    ?><script>alert('Data jabatan berhasil di hapus.'); window.location=('?mod=jabatan');</script><?php
                        } else {
                                    ?><script>alert('Data jabatan gagal di hapus.'); window.location=('?mod=jabatan');</script><?php
                        }
                        break;
}
?>
</body>

Listing Program Data Guru
<?php
include('conn.php');
?>
<div><h3><font color="#FFFFFF"><u>Data Guru</u></font></h3></div>
<body background="logo/55.png">
<?php

$aksi = $_GET['aksi']; //atu halo halaman per page
switch( $aksi ){
    default :
                        $per_page = 10;
        if( empty($_GET['page']) ){
                $posisi = 0;
                $_GET['page'] = 1;
        } else {
                $posisi = ( $_GET['page'] - 1 ) * $per_page;
        }
        $pages_query = mysql_query("SELECT COUNT(nip) FROM tb_guru");
        $pages = ceil(mysql_result($pages_query, 0) / $per_page);

        $page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
        $start_page = ($page - 1) * $per_page;

        $no = $posisi+1;
                        $pem = '';
                        if( isset($_GET['cari']) === false ){
                                    $t_guru = mysql_query("SELECT * FROM tb_guru ORDER BY nip DESC LIMIT $start_page , $per_page");
                        } else {
                                    if( empty($_GET['cari']) === true ){
                                                $t_guru = mysql_query("SELECT * FROM tb_guru WHERE nama_guru = '$_GET[cari]' ORDER BY nama_guru DESC LIMIT $start_page , $per_page");
                                                $pem = '<div class="alert aler-error"><font color="#FF0000"><h4>Warning !!!</h4>Anda belum mengetikkan nama yang dicari.</font></div>';
                                    } else {
                                                $t_guru = mysql_query("SELECT * FROM tb_guru WHERE nama_guru = '$_GET[cari]' ORDER BY nama_guru DESC LIMIT $start_page , $per_page");
                                                if( mysql_num_rows($t_guru) == 0 ){
                                                            $pem = '<div class="alert aler-error"><font color="#FF0000"><h4><font color="#FF0000">Warning !!!</h4>nama guru yang anda cari tidak ada.</font></div>';
                                                }
                                    }
                        }
                       
                        $guru = mysql_query("SELECT * FROM tb_guru");
                        if( mysql_num_rows($guru) > 0 ){
                                    ?><form  method="get" action="<?php echo $_SERVER['PHP_SELF'] ?>">
                <input type="hidden" name="mod" value="guru">
                <input type="text" placeholder="Cari nama guru" name="cari">
                <button type="submit" class="btn"><i class="icon-search"></i>&nbsp;Search</button>
            </form><?php
                                    echo $pem;
                                    ?><table width="780" border="1">
                                                <thead>
                                                            <tr>
                                                                        <td width="26" bgcolor="#FFFFFF" align="center">No.</td>
                                                                        <td width="37" bgcolor="#FFFFFF"align="center">Nip</td>
                      <td width="101" bgcolor="#FFFFFF"align="center">Nama Guru</td>
                      <td width="84" bgcolor="#FFFFFF"align="center">Tempat_lahir</td>
                      <td width="80" bgcolor="#FFFFFF"align="center">Tanggal_lahir</td>
                      <td width="73" bgcolor="#FFFFFF"align="center">Alamat</td>
                      <td width="69" bgcolor="#FFFFFF"align="center">Telpon</td>
                      <td width="90" bgcolor="#FFFFFF"align="center">Jenis kelamin</td>
                      <td width="97" bgcolor="#FFFFFF"align="center">Nama jabatan</td>
                       
                                                              <td colspan="2" bgcolor="#FFFFFF"><center><a  href="?mod=<?php echo $_GET ['mod'] ?>&aksi=tambah"><img src="logo/Add.ico"><br>
                                                      Tambah</i></a></center></td>
                                                            </tr>
                                                </thead>
                                                <tbody>
                                                            <?php
                                                            while( $ti = mysql_fetch_array($t_guru) ){
                                                                        ?><tr>
                                                                                    <td bgcolor="#FFFFFF"align="center"><?php echo $no ?></td>
                                                              <td bgcolor="#FFFFFF"align="center"><?php echo $ti['nip'] ?></td>
                                                              <td bgcolor="#FFFFFF"align="center"><?php echo $ti['nama_guru'] ?></td>
          <td bgcolor="#FFFFFF"align="center"><?php echo $ti['tempat_lahir'] ?></td>
                            <td bgcolor="#FFFFFF"align="center"><?php echo $ti['tanggal_lahir'] ?></td>
                      <td bgcolor="#FFFFFF"align="center"><?php echo $ti['alamat'] ?></td>
                      <td bgcolor="#FFFFFF"align="center"><?php echo $ti['telpon'] ?></td>
                      <td bgcolor="#FFFFFF"align="center"><?php echo $ti['jk'] ?></td>
                      <td bgcolor="#FFFFFF"align="center"><?php echo $ti['nama_jabatan'] ?></td>      

            <td width="36" bgcolor="#FFFFFF"><center><a href=?mod=<?php echo $_GET['mod'] ?>&aksi=edit&id=<?php echo $ti['nip'] ?>"><img src="logo/Modify.ico">Edit</a></center></td>
   
<td width="41" bgcolor="#FFFFFF"><center><a class="btn btn-mini btn-danger" data-toggle="tooltip" title="Hapus Data" href="?mod=<?php echo $_GET['mod'] ?>&aksi=hapus&id=<?php echo $ti['nip'] ?>" onClick="return confirm('Apakah anda ingin menghapus data ini..?')"><i class="icon-trash icon-white"><img src="logo/Delete.ico">Hapus</i></a></center></td>
   
                                                                        </tr><?php
                                                                        $no++;}
                                                            ?>
                                                </tbody>
                                    </table>
           
                        <?php
                        } else {
                                    ?><div class="alert alert-danger"><h4>Perhatian !!!</h4>Data Guru masih kosong. Silakan <a class="link" href="?mod=guru&aksi=tambah">[ klik ]</a> untuk menambah data Guru.</div><?php
                        }
                       
                        break;
           
            case 'tambah';
                        if( isset($_POST['submit']) ){
                                    $err = array();
                                   
                                    $nip = $_POST['nip'];
                                    $nama_guru = $_POST['nama_guru'];
                                    $tempat_lahir = $_POST['tempat_lahir'];
                                    $tanggal_lahir = $_POST['thn']."-".$_POST['bln']."-".$_POST['tgl'];
                                    $alamat = $_POST['alamat'];
                                    $telpon = $_POST['telpon'];
                                    $jk = $_POST['jk'];
                                    $nama_jabatan = $_POST['nama_jabatan'];

                                    if( empty($nip) ){ $err[] = 'nip masih kosong.'; }
                                    if( empty($nama_guru) ){ $err[] ='nama guru masih kosong.'; }
                                    if( empty($tempat_lahir) ){ $err[] = 'tempat_lahir masih kosong.'; }
                                    if( empty($tanggal_lahir) ){ $err[] = 'tanggal_lahir masih kosong.'; }
                                    if( empty($alamat) ){ $err[] = 'alamat masih kosong.'; }
                                    if( empty($telpon) ){ $err[] = 'telpon masih kosong.'; }
                                    if( empty($jk) ){ $err[] = 'jk masih kosong.'; }
                                    if( empty($nama_jabatan) ){ $err[] = 'nama jabatan masih kosong.'; }
                                   
                                    if( empty($err) ){
                                                $save = mysql_query("INSERT INTO tb_guru (nip,nama_guru,tempat_lahir,tanggal_lahir,alamat,telpon,jk,nama_jabatan) VALUES ('$nip','$nama_guru','$tempat_lahir','$tanggal_lahir', '$alamat','$telpon','$jk','$nama_jabatan')");
                                                if( $save === true ){
                                                            ?><script>alert('Data Guru berhasil disimpan.'); window.location=('?mod=guru');</script><?php
                                                } else {
                                                            ?><script>alert('Data Guru gagal disimpan.'); window.location=('?mod=guru');</script><?php
                                                }
                                    } else {
                                                $err_msg = '<div class="alert alert-danger"><h4>Warning !!!</h4><ul><li>' . implode('</li><li>' , $err) . '</li></ul></div>';
                                    }
                        }
                       
                        if( isset($err) ){
                                    if( empty($err) === false ){
                                                echo $err_msg;
                                    }
                        }
                        ?><form class="form" method="post" enctype="multipart/form-data">
        <table width="357" border="1">
  <tr>
    <td width="138" bgcolor="#FFFFFF"><label>Nip</label></td>
    <td width="203" bgcolor="#FFFFFF">:<input  type="text" name="nip" PLACEHOLDER="Masukan Nip" value="<?php echo $nip ?>" /></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><label>Nama Guru</label></td>
    <td bgcolor="#FFFFFF">:<input  type="text" name="nama_guru" PLACEHOLDER="Masukan nama guru"  value="<?php echo $nama_guru ?>" /></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><label>Tempat lahir</label></td>
    <td bgcolor="#FFFFFF">:<input  type="text" name="tempat_lahir" PLACEHOLDER="Masukan tempat lahir"  value="<?php echo $tempat_lahir ?>" /></td>
  </tr>
   <tr>
                                    <td bgcolor="#FFFFFF">Tanggal Lahir</td>
                                                <td bgcolor="#FFFFFF">:
                                                <select name="tgl">
                                                <?
                                                            for ($i=1; $i<=31; $i++) {
                                                                        $tg = ($i<10) ? "0$i" : $i;
                                                                        echo "<option value='$tg'>$tg</option>";       
                                                            }
                                                ?>
                                                </select> -
                                                <select name="bln">
                                                <?
                                                            for ($i=1; $i<=12; $i++) {
                                                                        $bl = ($i<10) ? "0$i" : $i;
                                                                        echo "<option value='$bl'>$bl</option>";       
                                                            }
                                                ?>
                                                </select> -
                                                <select name="thn">
                                                <?
                                                            for ($i=1970; $i<=2014; $i++) {
                                                                        echo "<option value='$i'>$i</option>";           
                                                            }
                                                ?>
                                                </select>
  </td>
                          </tr>
  <tr>
    <td bgcolor="#FFFFFF"><label>Alamat </label></td>
    <td bgcolor="#FFFFFF">:<input  type="text" name="alamat" PLACEHOLDER="Masukan alamat"  value="<?php echo $alamat ?>" /></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><label>Telpon </label></td>
    <td bgcolor="#FFFFFF">:<input  type="text" name="telpon" PLACEHOLDER="Masukan telpon"  value="<?php echo $telpon ?>" /></td>
  </tr>
  <tr>
          <td bgcolor="#FFFFFF"><label>Jenis Kelamin </label></td>
          <td bgcolor="#FFFFFF">:<select name ="jk">
          <option value="selected" class="input-xlarge"<?php echo $jk?>>Silakan pilih</option>
            <option value="laki-laki"<?php echo $jk?>>Laki-laki</option>
            <option value="perempuan"<?php echo $jk?>>Perempuan</option>
          </option>
      </select></td>
          </tr>
  <tr>
                <td width="138" bgcolor="#FFFFFF"><label>Nama jabatan </label></td>
                <td width="203" bgcolor="#FFFFFF">:<select name="nama_jabatan">
           <option value="">Silakan Pilih</option>
                                                <?php
                    $pendataan =mysql_query("SELECT * from tb_jabatan order by kode_jabatan desc");
                    while($nn = mysql_fetch_array($pendataan)){
                ?>
            <option value="<?php echo $nn['nama_jabatan']?>"><?php echo $nn['nama_jabatan']?></option>
                                                <?php
                    }
                ?>
       </select></td>
                  </tr>                      
</table>
           
            <div class="form-actions">
<input class="btn btn-primary" type="submit" name="submit" value="Simpan" />
                <input class="btn btn-primary"  type="button" value="Batal" onClick="self.history.back();" >
                <br>
            </div>
        </form><?php
                        break;
                       
            case 'edit';
                        if( isset($_POST['submit']) ){
                                    $err = array();
                                   
                                    $nip = $_POST['nip'];
                                    $nama_guru = $_POST['nama_guru'];
                                    $tempat_lahir = $_POST['tempat_lahir'];
                                    $tanggal_lahir = $_POST['thn']."-".$_POST['bln']."-".$_POST['tgl'];
                                    $alamat = $_POST['alamat'];
                                    $telpon = $_POST['telpon'];
                                    $jk = $_POST['jk'];
                                    $nama_jabatan = $_POST['nama_jabatan'];

                                    if( empty($nip) ){ $err[] = 'nip masih kosong.'; }
                                    if( empty($nama_guru) ){ $err[] = 'nama_guru masih kosong.'; }
                                    if( empty($tempat_lahir) ){ $err[] = 'tempat_lahir masih kosong.'; }
                                    if( empty($tanggal_lahir) ){ $err[] = 'tanggal_lahir masih kosong.'; }
                                    if( empty($alamat) ){ $err[] = 'alamat masih kosong.'; }
                                    if( empty($telpon) ){ $err[] = 'telpon masih kosong.'; }
                                    if( empty($jk) ){ $err[] = 'jk masih kosong.'; }
                                    if( empty($nama_jabatan) ){ $err[] = 'nama_jabatan masih kosong.'; }
                                   
                                    if( empty($err) ){
                                                if( empty($file_tmp) === false ){
                                                            $save = mysql_query("UPDATE tb_guru SET nip='$nip' , nama_guru='$nama_guru' , tempat_lahir='$tempat_lahir' , tanggal_lahir='$tanggal_lahir' , alamat='$alamat' , telpon='$telpon' , jk='$jk' , nama_jabatan='$nama_jabatan' WHERE nip ='$_GET[id]'");
                                                            if( $save === true ){
                                                                        ?><script>alert('Data Guru berhasil di perbaharui.'); window.location=('?mod=simpan');</script><?php
                                                            } else {
                                                                        ?><script>alert('Data Guru gagal di perbaharui.'); window.location=('?mod=simpan');</script><?php
                                                            }
                                                } else {
                                                            $save = mysql_query("UPDATE tb_guru SET nip='$nip' , nama_guru='$nama_guru' , tempat_lahir='$tempat_lahir' , tanggal_lahir='$tanggal_lahir' , alamat='$alamat' , telpon='$telpon' , jk='$jk' , nama_jabatan='$nama_jabatan' WHERE nip ='$_GET[id]'");
                                                            if( $save === true ){
                                                                        ?><script>alert('Data Guru berhasil di perbaharui.'); window.location=('?mod=guru');</script><?php
                                                            } else {
                                                                        ?><script>alert('Data Guru gagal di perbaharui.'); window.location=('?mod=guru');</script><?php
                                                            }
                                                }
                                    } else {
                                                $err_msg = '<div class="alert alert-danger"><h4>Warning !!!</h4><ul><li>' . implode('</li><li>' , $err) . '</li></ul></div>';
                                    }
                        }
                       
                        if( isset($err) ){
                                    if( empty($err) === false ){
                                                echo $err_msg;
                                    }
                        }
                       
                        $te = mysql_fetch_array(mysql_query("SELECT * FROM tb_guru WHERE nip ='$_GET[id]'"));
                        ?><form class="form" method="post" enctype="multipart/form-data">
            <table width="361" border="1">
                        <tr>
            <td width="139" bgcolor="#FFFFFF"><label>nip</label></td>
          <td width="206" bgcolor="#FFFFFF">:<input class="input-xlarge" type="text" name="nip"  value="<?php echo $te['nip'] ?>" /></td>
        </tr>
        <tr>
         <td bgcolor="#FFFFFF"> <label>Nama Guru</label></td>
     <td bgcolor="#FFFFFF">:<input class="input-xlarge" type="text" name="nama_guru"  value="<?php echo $te['nama_guru'] ?>" /></td>
           </tr>
            <tr>
    <td bgcolor="#FFFFFF"><label>tempat lahir </label></td>
    <td bgcolor="#FFFFFF">:<input  type="text" name="tempat_lahir" value="<?php echo $te['tempat_lahir'] ?>" /></td>
  </tr>
 <tr>
              <td bgcolor="#FFFFFF">Tanggal Lahir</td>
                                                <td bgcolor="#FFFFFF">:
                                                <select name="tgl">
                                                <?
                                                            for ($i=1; $i<=31; $i++) {
                                                                        $tg = ($i<10) ? "0$i" : $i;
                                                                        $sele = ($tg==$tgl)? "selected" : "";
                                                                        echo "<option value='$tg' $sele>$tg</option>";          
                                                            }
                                                ?>
                                                </select> -
                                                <select name="bln">
                                                <?
                                                            for ($i=1; $i<=12; $i++) {
                                                                        $bl = ($i<10) ? "0$i" : $i;
                                                                        $sele = ($bl==$bln)?"selected" : "";
                                                                        echo "<option value='$bl' $sele>$bl</option>";          
                                                            }
                                                ?>
                                                </select> -
                                                <select name="thn">
                                                <?
                                                            for ($i=1970; $i<=2014; $i++) {
                                                                        $sele = ($i==$thn)?"selected" : "";
                                                                        echo "<option value='$i' $sele>$i</option>";  
                                                            }
                                                ?>
                                                </select>
    </td>
                                    </tr>
           <tr>
           <td bgcolor="#FFFFFF"><label>Alamat</label></td>
           <td bgcolor="#FFFFFF">:<input class="input-xlarge" type="text" name="alamat"  value="<?php echo $te['alamat'] ?>" /></td>
            </tr>
             <tr>
           <td bgcolor="#FFFFFF"><label>Telpon</label></td>
           <td bgcolor="#FFFFFF">:<input class="input-xlarge" type="text" name="telpon"  value="<?php echo $te['telpon'] ?>" /></td>
            </tr>
             <tr>
          <td bgcolor="#FFFFFF"><label>Jenis Kelamin </label></td>
          <td bgcolor="#FFFFFF">:<select name ="jk">
          <option value="selected" class="input-xlarge"<?php echo $jk?>>"<?php echo $te['jk'] ?>"</option>
            <option value="laki-laki"<?php echo $jk?>>Laki-laki</option>
            <option value="perempuan"<?php echo $jk?>>Perempuan</option>
          </option>
          </select></td>
          </tr>
          <tr>
            <td width="139" bgcolor="#FFFFFF"><label>Nama jabatan</label></td>
                <td width="206" bgcolor="#FFFFFF">:<select name="nama_jabatan">
           <option value="">"<?php echo $te['nama_jabatan'] ?>"</option>
                                                <?php
                    $pendataan =mysql_query("SELECT * from tb_jabatan order by kode_jabatan desc");
                    while($nn = mysql_fetch_array($pendataan)){
                ?>
            <option value="<?php echo $nn['nama_jabatan']?>"><?php echo $nn['nama_jabatan']?></option>
                                                <?php
                    }
                ?>
           </select></td></tr>
  </table>
           
            <div class="form-actions">
<input class="btn btn-primary" type="submit" name="submit" value="Perbaharui" />
                <input class="btn btn-primary"  type="button" value="Batal" onClick="self.history.back();" >
                <br>
            </div>
        </form><?php
                        break;
                       
            case 'hapus';
                        $hapus = mysql_query("DELETE FROM tb_guru WHERE nip ='$_GET[id]'");
                        if( $hapus === true ){
                                    ?><script>alert('Data guru berhasil di hapus.'); window.location=('?mod=guru');</script><?php
                        } else {
                                    ?><script>alert('Data guru gagal di hapus.'); window.location=('?mod=guru');</script><?php
                        }
                        break;
}
?>
</body>

Listing Program Data Sekolah
<?php
include('conn.php');
?>
<div><h3><font color="#FFFFFF"><u>Data Sekolah</u></font></h3></div>
<body background="logo/55.png">
<?php

$aksi = $_GET['aksi']; //atu halo halaman per page
switch( $aksi ){
    default :
                        $per_page = 10;
        if( empty($_GET['page']) ){
                $posisi = 0;
                $_GET['page'] = 1;
        } else {
                $posisi = ( $_GET['page'] - 1 ) * $per_page;
        }
        $pages_query = mysql_query("SELECT COUNT(kode_sekolah) FROM tb_sekolah");
        $pages = ceil(mysql_result($pages_query, 0) / $per_page);

        $page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
        $start_page = ($page - 1) * $per_page;

        $no = $posisi+1;
                        $pem = '';
                        if( isset($_GET['cari']) === false ){
                                    $t_guru = mysql_query("SELECT * FROM tb_sekolah ORDER BY kode_sekolah DESC LIMIT $start_page , $per_page");
                        } else {
                                    if( empty($_GET['cari']) === true ){
                                                $t_guru = mysql_query("SELECT * FROM tb_sekolah WHERE nama_sekolah = '$_GET[cari]' ORDER BY nama_sekolah DESC LIMIT $start_page , $per_page");
                                                $pem = '<div class="alert aler-error"><font color="#FF0000"><h4>Warning !!!</h4>Anda belum mengetikkan nama yang dicari.</font></div>';
                                    } else {
                                                $t_guru = mysql_query("SELECT * FROM tb_sekolah WHERE nama_sekolah = '$_GET[cari]' ORDER BY nama_sekolah DESC LIMIT $start_page , $per_page");
                                                if( mysql_num_rows($t_guru) == 0 ){
                                                            $pem = '<div class="alert aler-error"><font color="#FF0000"><h4><font color="#FF0000">Warning !!!</h4>nama sekolah yang anda cari tidak ada.</font></div>';
                                                }
                                    }
                        }
                       
                        $guru = mysql_query("SELECT * FROM tb_sekolah");
                        if( mysql_num_rows($guru) > 0 ){
                                    ?><form  method="get" action="<?php echo $_SERVER['PHP_SELF'] ?>">
                <input type="hidden" name="mod" value="guru">
                <input type="text" placeholder="Cari nama sekolah" name="cari">
                <button type="submit" class="btn"><i class="icon-search"></i>&nbsp;Search</button>
            </form><?php
                                    echo $pem;
                                    ?><table width="780" border="1">
                                                <thead>
                                                            <tr>
                                                                        <td width="34" bgcolor="#FFFFFF" align="center">No.</td>
                                                                        <td width="87" bgcolor="#FFFFFF"align="center">Kode sekolah</td>
                      <td width="126" bgcolor="#FFFFFF"align="center">Nama sekolah</td>
                      <td width="108" bgcolor="#FFFFFF"align="center">Status</td>
                      <td width="98" bgcolor="#FFFFFF"align="center">Tanggal_berdiri</td>
                      <td width="94" bgcolor="#FFFFFF"align="center">Alamat</td>
                      <td width="118" bgcolor="#FFFFFF"align="center">Telpon</td>
                   
                                                              <td colspan="2" bgcolor="#FFFFFF"><center><a  href="?mod=<?php echo $_GET ['mod'] ?>&aksi=tambah"><img src="logo/Add.ico"><br>
                                                      Tambah</i></a></center></td>
                                                            </tr>
                                                </thead>
                                                <tbody>
                                                            <?php
                                                            while( $ti = mysql_fetch_array($t_guru) ){
                                                                        ?><tr>
                                                                                    <td bgcolor="#FFFFFF"align="center"><?php echo $no ?></td>
                                                              <td bgcolor="#FFFFFF"align="center"><?php echo $ti['kode_sekolah'] ?></td>
                                                              <td bgcolor="#FFFFFF"align="center"><?php echo $ti['nama_sekolah'] ?></td>
                <td bgcolor="#FFFFFF"align="center"><?php echo $ti['status'] ?></td>
                            <td bgcolor="#FFFFFF"align="center"><?php echo $ti['tgl_berdiri'] ?></td>
                      <td bgcolor="#FFFFFF"align="center"><?php echo $ti['alamat'] ?></td>
                      <td bgcolor="#FFFFFF"align="center"><?php echo $ti['telpon'] ?></td>
                         

            <td width="36" bgcolor="#FFFFFF"><center>
            <a href=?mod=<?php echo $_GET['mod'] ?>&aksi=edit&id=<?php echo $ti['kode_sekolah'] ?>"><img src="logo/Modify.ico"> Edit</a>
            </center></td>
   
<td width="41" bgcolor="#FFFFFF"><center><a class="btn btn-mini btn-danger" data-toggle="tooltip" title="Hapus Data" href="?mod=<?php echo $_GET['mod'] ?>&aksi=hapus&id=<?php echo $ti['kode_sekolah'] ?>" onClick="return confirm('Apakah anda ingin menghapus data ini..?')"><i class="icon-trash icon-white"><img src="logo/Delete.ico">Hapus</i></a></center></td>
   
                                                                        </tr><?php
                                                                        $no++;}
                                                            ?>
                                                </tbody>
                                    </table>
           
                        <?php
                        } else {
                                    ?><div class="alert alert-danger"><h4>Perhatian !!!</h4>Data Sekolah masih kosong. Silakan <a class="link" href="?mod=sekolah&aksi=tambah">[ klik ]</a> untuk menambah data Sekolah.</div><?php
                        }
                       
                        break;
           
            case 'tambah';
                        if( isset($_POST['submit']) ){
                                    $err = array();
                                   
                                    $kode_sekolah = $_POST['kode_sekolah'];
                                    $nama_sekolah = $_POST['nama_sekolah'];
                                    $status = $_POST['status'];
                                    $tgl_berdiri = $_POST['thn']."-".$_POST['bln']."-".$_POST['tgl'];
                                    $alamat = $_POST['alamat'];
                                    $telpon = $_POST['telpon'];
                                   
                                    if( empty($kode_sekolah) ){ $err[] = 'kode sekolah masih kosong.'; }
                                    if( empty($nama_sekolah) ){ $err[] ='nama sekolah masih kosong.'; }
                                    if( empty($status) ){ $err[] = 'status masih kosong.'; }
                                    if( empty($tgl_berdiri) ){ $err[] = 'tanggal_berdiri masih kosong.'; }
                                    if( empty($alamat) ){ $err[] = 'alamat masih kosong.'; }
                                    if( empty($telpon) ){ $err[] = 'telpon masih kosong.'; }
                                   
                                    if( empty($err) ){
                                                $save = mysql_query("INSERT INTO tb_sekolah (kode_sekolah,nama_sekolah,status,tgl_berdiri,alamat,telpon) VALUES ('$kode_sekolah','$nama_sekolah','$status','$tgl_berdiri', '$alamat','$telpon')");
                                                if( $save === true ){
                                                            ?><script>alert('Data Sekolah berhasil disimpan.'); window.location=('?mod=Sekolah');</script><?php
                                                } else {
                                                            ?><script>alert('Data Sekolah gagal disimpan.'); window.location=('?mod=Sekolah');</script><?php
                                                }
                                    } else {
                                                $err_msg = '<div class="alert alert-danger"><h4>Warning !!!</h4><ul><li>' . implode('</li><li>' , $err) . '</li></ul></div>';
                                    }
                        }
                       
                        if( isset($err) ){
                                    if( empty($err) === false ){
                                                echo $err_msg;
                                    }
                        }
                        ?><form class="form" method="post" enctype="multipart/form-data">
        <table width="339" border="1">
  <tr>
    <td width="150" bgcolor="#FFFFFF"><label>Kode sekolah</label></td>
    <td width="173" bgcolor="#FFFFFF">:<input  type="text" name="kode_sekolah" PLACEHOLDER="Masukan kode_sekolah" value="<?php echo $kode_sekolah ?>" /></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><label>Nama sekolah</label></td>
    <td bgcolor="#FFFFFF">:<input  type="text" name="nama_sekolah" PLACEHOLDER="Masukan nama sekolah"  value="<?php echo $nama_sekolah ?>" /></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><label>Status</label></td>
    <td bgcolor="#FFFFFF">:<input  type="text" name="status" PLACEHOLDER="Masukan status"  value="<?php echo $status ?>" /></td>
  </tr>
   <tr>
                                    <td bgcolor="#FFFFFF">Tanggal berdiri</td>
                                                <td bgcolor="#FFFFFF">:
                                                <select name="tgl">
                                                <?
                                                            for ($i=1; $i<=31; $i++) {
                                                                        $tg = ($i<10) ? "0$i" : $i;
                                                                        echo "<option value='$tg'>$tg</option>";       
                                                            }
                                                ?>
                                                </select> -
                                                <select name="bln">
                                                <?
                                                            for ($i=1; $i<=12; $i++) {
                                                                        $bl = ($i<10) ? "0$i" : $i;
                                                                        echo "<option value='$bl'>$bl</option>";       
                                                            }
                                                ?>
                                                </select> -
                                                <select name="thn">
                                                <?
                                                            for ($i=1970; $i<=2014; $i++) {
                                                                        echo "<option value='$i'>$i</option>";           
                                                            }
                                                ?>
                                                </select>
  </td>
                          </tr>
  <tr>
    <td bgcolor="#FFFFFF"><label>Alamat </label></td>
    <td bgcolor="#FFFFFF">:<input  type="text" name="alamat" PLACEHOLDER="Masukan alamat"  value="<?php echo $alamat ?>" /></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><label>Telpon </label></td>
    <td bgcolor="#FFFFFF">:<input  type="text" name="telpon" PLACEHOLDER="Masukan telpon"  value="<?php echo $telpon ?>" /></td>
  </tr>

</table>
           
            <div class="form-actions">
<input class="btn btn-primary" type="submit" name="submit" value="Simpan" />
                <input class="btn btn-primary"  type="button" value="Batal" onClick="self.history.back();" >
                <br>
            </div>
        </form><?php
                        break;
                       
            case 'edit';
                        if( isset($_POST['submit']) ){
                                    $err = array();
                                   
                                    $kode_sekolah = $_POST['kode_sekolah'];
                                    $nama_sekolah = $_POST['nama_sekolah'];
                                    $status = $_POST['status'];
                                    $tgl_berdiri = $_POST['thn']."-".$_POST['bln']."-".$_POST['tgl'];
                                    $alamat = $_POST['alamat'];
                                    $telpon = $_POST['telpon'];
                                   
                                    if( empty($kode_sekolah) ){ $err[] = 'kode_sekolah masih kosong.'; }
                                    if( empty($nama_sekolah) ){ $err[] = 'nama_sekolah masih kosong.'; }
                                    if( empty($status) ){ $err[] = 'status masih kosong.'; }
                                    if( empty($tgl_berdiri) ){ $err[] = 'tgl_berdiri masih kosong.'; }
                                    if( empty($alamat) ){ $err[] = 'alamat masih kosong.'; }
                                    if( empty($telpon) ){ $err[] = 'telpon masih kosong.'; }
                                   
                                    if( empty($err) ){
                                                if( empty($file_tmp) === false ){
                                                            $save = mysql_query("UPDATE tb_sekolah SET kode_sekolah='$kode_sekolah' , nama_sekolah='$nama_sekolah' , status='$status' , tgl_lahir='$tgl_berdiri' , alamat='$alamat' , telpon='$telpon' WHERE kode_sekolah ='$_GET[id]'");
                                                            if( $save === true ){
                                                                        ?><script>alert('Data Sekolah berhasil di perbaharui.'); window.location=('?mod=simpan');</script><?php
                                                            } else {
                                                                        ?><script>alert('Data Sekolah gagal di perbaharui.'); window.location=('?mod=simpan');</script><?php
                                                            }
                                                } else {
                                                            $save = mysql_query("UPDATE tb_sekolah SET kode_sekolah='$kode_sekolah' , nama_sekolah='$nama_sekolah' , status='$status' , tgl_berdiri='$tgl_berdiri' , alamat='$alamat' , telpon='$telpon' WHERE kode_sekolah ='$_GET[id]'");
                                                            if( $save === true ){
                                                                        ?><script>alert('Data Sekolah berhasil di perbaharui.'); window.location=('?mod=Sekolah');</script><?php
                                                            } else {
                                                                        ?><script>alert('Data Sekolah gagal di perbaharui.'); window.location=('?mod=Sekolah');</script><?php
                                                            }
                                                }
                                    } else {
                                                $err_msg = '<div class="alert alert-danger"><h4>Warning !!!</h4><ul><li>' . implode('</li><li>' , $err) . '</li></ul></div>';
                                    }
                        }
                       
                        if( isset($err) ){
                                    if( empty($err) === false ){
                                                echo $err_msg;
                                    }
                        }
                       
                        $te = mysql_fetch_array(mysql_query("SELECT * FROM tb_sekolah WHERE kode_sekolah ='$_GET[id]'"));
                        list($thn,$bln,$tgl) = explode ("-",$te['tgl_berdiri']);
                        ?><form class="form" method="post" enctype="multipart/form-data">
            <table width="334" border="1">
                        <tr>
            <td width="145" bgcolor="#FFFFFF"><label>Kode sekolah</label></td>
          <td width="173" bgcolor="#FFFFFF">:<input class="input-xlarge" type="text" name="kode_sekolah"  value="<?php echo $te['kode_sekolah'] ?>" /></td>
        </tr>
        <tr>
         <td bgcolor="#FFFFFF"> <label>Nama sekolah</label></td>
       <td bgcolor="#FFFFFF">:<input class="input-xlarge" type="text" name="nama_sekolah"  value="<?php echo $te['nama_sekolah'] ?>" /></td>
           </tr>
            <tr>
    <td bgcolor="#FFFFFF"><label>Status </label></td>
    <td bgcolor="#FFFFFF">:<input  type="text" name="status" value="<?php echo $te['status'] ?>" /></td>
  </tr>
 <tr>
                                                <td bgcolor="#FFFFFF">Tgl berdiri</td>
                                                <td bgcolor="#FFFFFF">:
                                                <select name="tgl">
                                                <?
                                                            for ($i=1; $i<=31; $i++) {
                                                                        $tg = ($i<10) ? "0$i" : $i;
                                                                        $sele = ($tg==$tgl)? "selected" : "";
                                                                        echo "<option value='$tg' $sele>$tg</option>";          
                                                            }
                                                ?>
                                                </select> -
                                                <select name="bln">
                                                <?
                                                            for ($i=1; $i<=12; $i++) {
                                                                        $bl = ($i<10) ? "0$i" : $i;
                                                                        $sele = ($bl==$bln)?"selected" : "";
                                                                        echo "<option value='$bl' $sele>$bl</option>";          
                                                            }
                                                ?>
                                                </select> -
                                                <select name="thn">
                                                <?
                                                            for ($i=1970; $i<=2014; $i++) {
                                                                        $sele = ($i==$thn)?"selected" : "";
                                                                        echo "<option value='$i' $sele>$i</option>";  
                                                            }
                                                ?>
                                                </select>
</td>
                                    </tr>
           <tr>
           <td bgcolor="#FFFFFF"><label>Alamat</label></td>
           <td bgcolor="#FFFFFF">:<input class="input-xlarge" type="text" name="alamat"  value="<?php echo $te['alamat'] ?>" /></td>
            </tr>
             <tr>
           <td bgcolor="#FFFFFF"><label>Telpon</label></td>
           <td bgcolor="#FFFFFF">:<input class="input-xlarge" type="text" name="telpon"  value="<?php echo $te['telpon'] ?>" /></td>
            </tr>
             
      </table>
           
            <div class="form-actions">
<input class="btn btn-primary" type="submit" name="submit" value="Perbaharui" />
                <input class="btn btn-primary"  type="button" value="Batal" onClick="self.history.back();" >
                <br>
            </div>
        </form><?php
                        break;
                       
            case 'hapus';
                        $hapus = mysql_query("DELETE FROM tb_sekolah WHERE kode_sekolah ='$_GET[id]'");
                        if( $hapus === true ){
                                    ?><script>alert('Data sekolah berhasil di hapus.'); window.location=('?mod=sekolah');</script><?php
                        } else {
                                    ?><script>alert('Data sekolah gagal di hapus.'); window.location=('?mod=sekolah');</script><?php
                        }
                        break;
}
?>
</body>

Listing Program  Pendataan Guru
<?php
include('conn.php');
?>
<body background="logo/55.png">
<div><h3><font color="#FFFFFF"><u>Data Pendataan Guru</u></font></h3></div>

<?php

$aksi = $_GET['aksi']; //atu halo halaman per page
switch( $aksi ){
    default :
                        $per_page = 25;
        if( empty($_GET['page']) ){
                $posisi = 0;
                $_GET['page'] = 1;
        } else {
                $posisi = ( $_GET['page'] - 1 ) * $per_page;
        }
        $pages_query = mysql_query("SELECT COUNT(kode_pendataan) FROM tb_pendataan");
        $pages = ceil(mysql_result($pages_query, 0) / $per_page);

        $page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
        $start_page = ($page - 1) * $per_page;

        $no = $posisi+1;
                        $pem = '';
                        if( isset($_GET['cari']) === false ){
                                    $t_pendataanbarang = mysql_query("SELECT * FROM tb_pendataan ORDER BY kode_pendataan DESC LIMIT $start_page , $per_page");
                        } else {
                                    if( empty($_GET['cari']) === true ){
                                                $t_pendataanbarang = mysql_query("SELECT * FROM tb_pendataan WHERE tgl_pendataan LIKE '%$_GET[cari]%' ORDER BY tgl_pendataan DESC LIMIT $start_page , $per_page");
                                                $pem = '<div class="alert aler-error"><h4><font color="red">Warning !!!</h4>Anda belum mengetikkan tgl pendataan yang dicari.</font></div>';
                                    } else {
                                                $t_pendataanbarang = mysql_query("SELECT * FROM tb_pendataan WHERE tgl_pendataan LIKE '%$_GET[cari]%' ORDER BY tgl_pendataan DESC LIMIT $start_page , $per_page");
                                                if( mysql_num_rows($t_pendataanbarang) == 0 ){
                                                            $pem = '<div class="alert aler-error"><font color="red"><h4>Warning !!!</h4>tgl pendataan yang anda cari tidak ada.</font></div>';
                                                }
                                    }
                        }
                       
                        $pendataanbarang = mysql_query("SELECT * FROM tb_pendataan where kode_pendataan");
                        if( mysql_num_rows($pendataanbarang) > 0 ){
                                    ?><form  method="get" action="<?php echo $_SERVER['PHP_SELF'] ?>">
                <input type="hidden" name="mod" value="departemen">
                <input type="text" placeholder="Cari tgl pendataan" name="cari">
                <button type="submit" class="btn"><i class="icon-search"></i>&nbsp;Search</button>
            </form><?php
                                    echo $pem;
                                    ?><table border="1">
                                                <thead>
                                                            <tr>
                                                                        <td width="24" bgcolor="#FFFFFF">No.</td>
                        <td width="116" align="center" bgcolor="#FFFFFF">Kode pendataan</td>
                                                              <td width="116" align="center" bgcolor="#FFFFFF">Tanggal pendataan</td>
                      <td width="116" align="center" bgcolor="#FFFFFF">Nip</td>
                      <td width="116" align="center" bgcolor="#FFFFFF">Nama guru</td>
                    <td width="116" align="center" bgcolor="#FFFFFF">Kode jabatan</td>
                      <td width="116" align="center" bgcolor="#FFFFFF">Nama Jabatan</td>
                     <td width="116" align="center" bgcolor="#FFFFFF">Kode sekolah</td>
                         <td width="116" align="center" bgcolor="#FFFFFF">Nama sekolah</td>
                     
                                                              <td colspan="2" bgcolor="#FFFFFF"><center><a  href="?mod=<?php echo $_GET ['mod'] ?>&aksi=tambah"><img src="logo/Add.ico"><br>
                                                      Tambah</i></a></center></td>
                                                            </tr>
                                                </thead>
                                                <tbody>
                                                            <?php
                                                            while( $ti = mysql_fetch_array($t_pendataanbarang) ){
                                                                        ?><tr>
                                                                                    <td align="center" bgcolor="#FFFFFF"><?php echo $no ?></td>
                <td align="center" bgcolor="#FFFFFF"><?php echo $ti['kode_pendataan'] ?></td>
                                                              <td align="center" bgcolor="#FFFFFF"><?php echo $ti['tgl_pendataan'] ?></td>
                      <td align="center" bgcolor="#FFFFFF"><?php echo $ti['nip'] ?></td>
                     <td align="center" bgcolor="#FFFFFF"><?php echo $ti['nama_guru'] ?></td>
                     <td align="center" bgcolor="#FFFFFF"><?php echo $ti['kode_jabatan'] ?></td>
                     <td align="center" bgcolor="#FFFFFF"><?php echo $ti['nama_jabatan'] ?></td>
                     <td align="center" bgcolor="#FFFFFF"><?php echo $ti['kode_sekolah'] ?></td>
                     <td align="center" bgcolor="#FFFFFF"><?php echo $ti['nama_sekolah'] ?></td>

            <td width="36" bgcolor="#FFFFFF"><center><a href=?mod=<?php echo $_GET['mod'] ?>&aksi=edit&id=<?php echo $ti['kode_pendataan'] ?>"><img src="logo/Modify.ico">Edit</a></center></td>
   
<td width="41" bgcolor="#FFFFFF"><center><a class="btn btn-mini btn-danger" data-toggle="tooltip" title="Hapus Data" href="?mod=<?php echo $_GET['mod'] ?>&aksi=hapus&id=<?php echo $ti['kode_pendataan'] ?>" onClick="return confirm('Apakah anda ingin menghapus data ini..?')"><i class="icon-trash icon-white"><img src="logo/Delete.ico">Hapus</i></a></center></td>
   
                                                                        </tr><?php
                                                                        $no++;}
                                                            ?>
                                                </tbody>
                                    </table>
           
                        <?php
                        } else {
                                    ?><div class="alert alert-danger"><h4>Perhatian !!!</h4>Data pendataan masih kosong. Silakan <a class="link" href="?mod=pendataan&aksi=tambah">[ klik ]</a> untuk menambah data pendataan.</div><?php
                        }
                       
                        break;
           
            case 'tambah';
                        if( isset($_POST['submit']) ){
                                    $err = array();
                                   
                                    $kode_pendataan = $_POST['kode_pendataan'];
                                    $tgl_pendataan = $_POST['thn']."-".$_POST['bln']."-".$_POST['tgl'];
                                    $nip = $_POST['nip'];
                                    $nama_guru = $_POST['nama_guru'];
                                    $kode_jabatan = $_POST['kode_jabatan'];
                                    $nama_jabatan = $_POST['nama_jabatan'];
                                    $kode_sekolah = $_POST['kode_sekolah'];
                                    $nama_sekolah = $_POST['nama_sekolah'];
                                   
                                    if( empty($kode_pendataan) ){ $err[] = 'kode_pendataan masih kosong.'; }
                                    if( empty($tgl_pendataan) ){ $err[] = 'nama_pendataan masih kosong.'; }
                                    if( empty($nip) ){ $err[] = 'nip masih kosong.'; }
                                    if( empty($nama_guru) ){ $err[] = 'nama_guru masih kosong.'; }
                                    if( empty($kode_jabatan) ){ $err[] = 'kode_jabatan masih kosong.'; }
                                    if( empty($nama_jabatan) ){ $err[] = 'nama_jabatan masih kosong.'; }
                                    if( empty($kode_sekolah) ){ $err[] = 'kode_sekolah masih kosong.'; }
                                    if( empty($nama_sekolah) ){ $err[] = 'nama_sekolah masih kosong.'; }
                                                                       
                                    if( empty($err) ){
                                                $save = mysql_query("INSERT INTO tb_pendataan(kode_pendataan,tgl_pendataan,nip,nama_guru,kode_jabatan,nama_jabatan,kode_sekolah,nama_sekolah) VALUES ('$kode_pendataan','$tgl_pendataan','$nip','$nama_guru','$kode_jabatan','$nama_jabatan','$kode_sekolah','$nama_sekolah')");
                                                if( $save === true ){
                                                            ?><script>alert('Data pendataan berhasil disimpan.'); window.location=('?mod=pendataan');</script><?php
                                                } else {
                                                            ?><script>alert('Data pendataan gagal disimpan.'); window.location=('?mod=pendataan');</script><?php
                                                }
                                    } else {
                                                $err_msg = '<div class="alert alert-danger"><h4>Warning !!!</h4><ul><li>' . implode('</li><li>' , $err) . '</li></ul></div>';
                                    }
                        }
                       
                        if( isset($err) ){
                                    if( empty($err) === false ){
                                                echo $err_msg;
                                    }
                        }
                        ?><form class="form" method="post" enctype="multipart/form-data">
        <table width="312" border="1">
        <tr>
    <td width="120" bgcolor="#FFFFFF"><label>Kode pendataan </label></td>
    <td width="182" bgcolor="#FFFFFF">:<input  type="text" name="kode_pendataan" PLACEHOLDER="Masukan kode pendataan" value="<?php echo $kode_pendataan ?>" /></td>
  </tr>
  <tr>
                                    <td bgcolor="#FFFFFF">Tanggal pendataan</td>
                                                <td bgcolor="#FFFFFF">:
                                                <select name="tgl">
                                                <?
                                                            for ($i=1; $i<=31; $i++) {
                                                                        $tg = ($i<10) ? "0$i" : $i;
                                                                        echo "<option value='$tg'>$tg</option>";       
                                                            }
                                                ?>
                                                </select> -
                                                <select name="bln">
                                                <?
                                                            for ($i=1; $i<=12; $i++) {
                                                                        $bl = ($i<10) ? "0$i" : $i;
                                                                        echo "<option value='$bl'>$bl</option>";       
                                                            }
                                                ?>
                                                </select> -
                                                <select name="thn">
                                                <?
                                                            for ($i=1970; $i<=2014; $i++) {
                                                                        echo "<option value='$i'>$i</option>";           
                                                            }
                                                ?>
                                                </select>
  </td>
                          </tr>
  <tr>
               <td bgcolor="#FFFFFF"><label>Nip</label></td>
    <td bgcolor="#FFFFFF">:<?php
                    $pendataan =mysql_query("SELECT * from tb_guru");
                                                            $jsArray = "var prdName = new Array();\n";
                                                            echo '<select name="nip" "prdId" onchange="document.getElementById(\'prd_name\').value = prdName[this.value]">'; 
echo '<option>pilih</option>';
while ($row = mysql_fetch_array($pendataan)) { 
 echo '<option value="' . $row['nip'] . '">' . $row['nip'] . '</option>';
    $jsArray .= "prdName['" . $row['nip'] . "'] = '" . addslashes($row['nama_guru']) . "';\n";
echo '</select>'; 
?> </td></tr>
<tr>
<td bgcolor="#FFFFFF">Nama guru</td>
  <td bgcolor="#FFFFFF"><input name="nama_guru" type="text" id="prd_name" size="30" value="<?php echo $nama_guru ?>"/>
<script type="text/javascript"> 
<?php echo $jsArray; ?> 
</script>
</td></tr>
<tr>
               <td bgcolor="#FFFFFF"><label>Kode jabatan</label></td>
    <td bgcolor="#FFFFFF">:<?php
                    $pendataan =mysql_query("SELECT * from tb_jabatan");
                                                            $jsArray = "var prdName1 = new Array();\n";
                                                            echo '<select name="kode_jabatan" "prdId" onchange="document.getElementById(\'prd_name1\').value = prdName1[this.value]">'; 
echo '<option>pilih</option>';
while ($row = mysql_fetch_array($pendataan)) { 
 echo '<option value="' . $row['kode_jabatan'] . '">' . $row['kode_jabatan'] . '</option>';
    $jsArray .= "prdName1['" . $row['kode_jabatan'] . "'] = '" . addslashes($row['nama_jabatan']) . "';\n"; 
echo '</select>'; 
?> </td></tr>
<tr>
<td bgcolor="#FFFFFF">Nama jabatan</td>
  <td bgcolor="#FFFFFF"><input name="nama_jabatan" type="text" id="prd_name1" size="30" value="<?php echo $nama_jabatan ?>"/>
<script type="text/javascript"> 
<?php echo $jsArray; ?> 
</script>
</td></tr>                      
<tr>
               <td bgcolor="#FFFFFF"><label>Kode sekolah</label></td>
    <td bgcolor="#FFFFFF">:<?php
                    $pendataan =mysql_query("SELECT * from tb_sekolah");
                                                            $jsArray = "var prdName2 = new Array();\n";
                                                            echo '<select name="kode_sekolah" "prdId" onchange="document.getElementById(\'prd_name2\').value = prdName2[this.value]">'; 
echo '<option>pilih</option>';
while ($row = mysql_fetch_array($pendataan)) { 
 echo '<option value="' . $row['kode_sekolah'] . '">' . $row['kode_sekolah'] . '</option>';
    $jsArray .= "prdName2['" . $row['kode_sekolah'] . "'] = '" . addslashes($row['nama_sekolah']) . "';\n"; 
echo '</select>'; 
?> </td></tr>
<tr>
<td bgcolor="#FFFFFF">Nama sekolah</td>
  <td bgcolor="#FFFFFF"><input name="nama_sekolah" type="text" id="prd_name2" size="30" value="<?php echo $nama_sekolah ?>"/>
<script type="text/javascript"> 
<?php echo $jsArray; ?> 
</script>
</td></tr>                                              
</table>
          
            <div class="form-actions">
  <input class="btn btn-primary" type="submit" name="submit" value="Simpan" />
                <input class="btn btn-primary"  type="button" value="Batal" onClick="self.history.back();" >
                <br>
            </div>
        </form><?php
                        break;
                       
            case 'edit';
                        if( isset($_POST['submit']) ){
                                    $err = array();
                                   
                                    $kode_pendataan = $_POST['kode_pendataan'];
                                    $tgl_pendataan = $_POST['thn']."-".$_POST['bln']."-".$_POST['tgl'];
                                    $nip = $_POST['nip'];
                                    $nama_guru = $_POST['nama_guru'];
                                    $kode_jabatan = $_POST['kode_jabatan'];
                                    $nama_jabatan = $_POST['nama_jabatan'];
                                    $kode_sekolah = $_POST['kode_sekolah'];
                                    $nama_sekolah = $_POST['nama_sekolah'];
                                   

                                    if( empty($kode_pendataan) ){ $err[] = 'kode_pendataan masih kosong.'; }
                                    if( empty($tgl_pendataan) ){ $err[] = 'tgl pendataan masih kosong.'; }
                                    if( empty($nip) ){ $err[] = 'nip masih kosong.'; }
                                    if( empty($nama_guru) ){ $err[] = 'nama guru masih kosong.'; }
                                    if( empty($kode_jabatan) ){ $err[] = 'kode_jabatan masih kosong.'; }
                                    if( empty($nama_jabatan) ){ $err[] = 'nama_jabatan masih kosong.'; }
                                    if( empty($kode_sekolah) ){ $err[] = 'kode_sekolah masih kosong.'; }
                                    if( empty($nama_sekolah) ){ $err[] = 'nama_sekolah masih kosong.'; }
                                   
                                   
                                    if( empty($err) ){
                                                if( empty($file_tmp) === false ){
                                                            $save = mysql_query("UPDATE tb_pendataan SET kode_pendataan='$kode_pendataan',tgl_pendataan='$tgl_pendataan',nip='$nip' , nama_guru='$nama_guru',kode_jabatan='$kode_jabatan',nama_jabatan='$nama_jabatan',kode_sekolah='$kode_sekolah',nama_sekolah='$nama_sekolah' WHERE kode_pendataan='$_GET[id]'");
                                                            if( $save === true ){
                                                                        ?><script>alert('Data pendataan berhasil di perbaharui.'); window.location=('?mod=pendataan');</script><?php
                                                            } else {
                                                                        ?><script>alert('Data pendataan gagal di perbaharui.'); window.location=('?mod=pendataan');</script><?php
                                                            }
                                                } else {$save = mysql_query("UPDATE tb_pendataan SET kode_pendataan='$kode_pendataan',tgl_pendataan='$tgl_pendataan',nip='$nip' , nama_guru='$nama_guru',kode_jabatan='$kode_jabatan',nama_jabatan='$nama_jabatan',kode_sekolah='$kode_sekolah',nama_sekolah='$nama_sekolah' WHERE kode_pendataan='$_GET[id]'");
                                                            if( $save === true ){
                                                                        ?><script>alert('Data pendataan berhasil di perbaharui.'); window.location=('?mod=pendataan');</script><?php
                                                            } else {
                                                                        ?><script>alert('Data pendataan gagal di perbaharui.'); window.location=('?mod=pendataan');</script><?php
                                                            }
                                                }
                                    } else {
                                                $err_msg = '<div class="alert alert-danger"><h4>Warning !!!</h4><ul><li>' . implode('</li><li>' , $err) . '</li></ul></div>';
                                    }
                        }
                       
                        if( isset($err) ){
                                    if( empty($err) === false ){
                                                echo $err_msg;
                                    }
                        }
                       
                        $te = mysql_fetch_array(mysql_query("SELECT * FROM tb_pendataan WHERE kode_pendataan='$_GET[id]'"));
                        list($thn,$bln,$tgl) = explode ("-",$te['tgl_pendataan']);
                        ?><form class="form" method="post" enctype="multipart/form-data">
         <table width="334" border="1">
        <tr>
    <td width="124" bgcolor="#FFFFFF"><label>kode pendataan </label></td>
    <td width="200" bgcolor="#FFFFFF">:<input  type="text" name="kode_pendataan" value="<?php echo $te['kode_pendataan'] ?>" /></td>
  </tr>
 <tr>
                                                <td bgcolor="#FFFFFF">Tanggal pendataan</td>
                                                <td bgcolor="#FFFFFF">:
                                                <select name="tgl">
                                                <?
                                                            for ($i=1; $i<=31; $i++) {
                                                                        $tg = ($i<10) ? "0$i" : $i;
                                                                        $sele = ($tg==$tgl)? "selected" : "";
                                                                        echo "<option value='$tg' $sele>$tg</option>";          
                                                            }
                                                ?>
                                                </select> -
                                                <select name="bln">
                                                <?
                                                            for ($i=1; $i<=12; $i++) {
                                                                        $bl = ($i<10) ? "0$i" : $i;
                                                                        $sele = ($bl==$bln)?"selected" : "";
                                                                        echo "<option value='$bl' $sele>$bl</option>";          
                                                            }
                                                ?>
                                                </select> -
                                                <select name="thn">
                                                <?
                                                            for ($i=1970; $i<=2014; $i++) {
                                                                        $sele = ($i==$thn)?"selected" : "";
                                                                        echo "<option value='$i' $sele>$i</option>";  
                                                            }
                                                ?>
                                                </select>
                          </td>             
  <tr>
<td bgcolor="#FFFFFF">Nip</td>
           <td bgcolor="#FFFFFF">:
                                                <?php
                    $pendataan =mysql_query("SELECT * from tb_guru");
                                                            $jsArray = "var prdName= new Array();\n";
                                                            echo '<select name="nip" "prdId" onchange="document.getElementById(\'prd_name\').value = prdName[this.value]">'; 
echo '<option>pilih</option>';
while ($row = mysql_fetch_array($pendataan)) { 
 echo '<option value="' . $row['nip'] . '">' . $row['nip'] . '</option>';
    $jsArray .= "prdName['" . $row['nip'] . "'] = '" . addslashes($row['nama_guru']) . "';\n"; 
echo '</select>'; 
?> 
   <tr>
<td bgcolor="#FFFFFF">Nama guru</td>
  <td bgcolor="#FFFFFF"><input name="nama_guru" type="text" id="prd_name" size="30" value="<?php echo $te['nama_guru'] ?>"/>
<script type="text/javascript"> 
<?php echo $jsArray; ?> 
</script> </td></tr>
<tr>
<td bgcolor="#FFFFFF">Kode jabatan</td>
           <td bgcolor="#FFFFFF">
                                                <?php
                    $pendataan =mysql_query("SELECT * from tb_jabatan");
                                                            $jsArray = "var prdName1 = new Array();\n";
                                                            echo '<select name="kode_jabatan" "prdId" onchange="document.getElementById(\'prd_name1\').value = prdName1[this.value]">'; 
echo '<option>pilih</option>';
while ($row = mysql_fetch_array($pendataan)) { 
 echo '<option value="' . $row['kode_jabatan'] . '">' . $row['kode_jabatan'] . '</option>';
    $jsArray .= "prdName1['" . $row['kode_jabatan'] . "'] = '" . addslashes($row['nama_jabatan']) . "';\n"; 
echo '</select>'; 
?> 
   <tr>
<td bgcolor="#FFFFFF">Nama jabatan</td>
  <td bgcolor="#FFFFFF"><input name="nama_jabatan" type="text" id="prd_name1" size="30" value="<?php echo $te['nama_jabatan'] ?>"/>
<script type="text/javascript"> 
<?php echo $jsArray; ?> 
</script> </td></tr>
<tr>
<td bgcolor="#FFFFFF">Kode sekolah</td>
           <td bgcolor="#FFFFFF">:
                                                <?php
                    $pendataan =mysql_query("SELECT * from tb_sekolah");
                                                            $jsArray = "var prdName2 = new Array();\n";
                                                            echo '<select name="kode_sekolah" "prdId" onchange="document.getElementById(\'prd_name2\').value = prdName2[this.value]">'; 
echo '<option>pilih</option>';
while ($row = mysql_fetch_array($pendataan)) { 
 echo '<option value="' . $row['kode_sekolah'] . '">' . $row['kode_sekolah'] . '</option>';
    $jsArray .= "prdName2['" . $row['kode_sekolah'] . "'] = '" . addslashes($row['nama_sekolah']) . "';\n"; 
echo '</select>'; 
?> 
   <tr>
<td bgcolor="#FFFFFF">Nama sekolah</td>
  <td bgcolor="#FFFFFF"><input name="nama_sekolah" type="text" id="prd_name2" size="30" value="<?php echo $te['nama_sekolah'] ?>"/>
<script type="text/javascript"> 
<?php echo $jsArray; ?> 
</script> </td></tr>

    </table>
            <div class="form-actions">
  <input class="btn btn-primary" type="submit" name="submit" value="Perbaharui" />
                <input class="btn btn-primary"  type="button" value="Batal" onClick="self.history.back();" >
                <br>
            </div>
        </form><?php
                        break;
                       
            case 'hapus';
                        $hapus = mysql_query("DELETE FROM tb_pendataan WHERE kode_pendataan='$_GET[id]'");
                        if( $hapus === true ){
                                    ?><script>alert('Data pendataan pegawai berhasil di hapus.'); window.location=('?mod=departemen');</script><?php
                        } else {
                                    ?><script>alert('Data pendataan pegawai gagal di hapus.'); window.location=('?mod=departemen');</script><?php
                        }
                        break;
}
?>
</body>

 Listing Program Laporan Data Jabatan
<?php
            include("koneksi.php");
?>
<html>
<head>
</head>
<body bgcolor="#FFFFFF">
 <?php
  $no = $posisi+1;
$departemen = mysql_query("SELECT * FROM tb_jabatan where kode_jabatan") ;
if( $i = mysql_num_rows($departemen) > 0 ){
                                                                       
            ?>
     <div align="center">
       <p><strong>Laporan Data Jabatan</strong></p>
       <p><img src="../logo/logo RDTL.png" width="166" height="124"></p>
       <strong>
       <h3>-------------------</h3>
       <p>Ministerio da Educacao Direccao da Educacao Distrito Dili</p>
       <p>&nbsp;</p>
</strong></div>
    <hr>
<table width="100%" height="96" border="1" cellpadding="0" cellspacing="0">

  <tr style="background-color:#1FABE0;">
    <td bgcolor="#FFFFFF" style="text-align:center;" ><strong>No</strong></td>
   <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Kode jabatan</strong></td>
    <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Nama jabatan</strong></td>
  </tr>
 <?php
    while( $i = mysql_fetch_array($departemen) ){
 ?>                                                                  
  <tr style="background-color:#C4E1FF">
            <td height="25px" align="center" bgcolor="#FFFFFF"><?php echo $no ?></td>
<td align="center" bgcolor="#FFFFFF"><?php echo $i['kode_jabatan'] ?></td>
    <td align="center" bgcolor="#FFFFFF"><?php echo $i['nama_jabatan'] ?></td>
  </tr>
 
<?php
$no++;
            }
}
?>
</table>
<p>&nbsp; </p>

<script>
window.print();
  </script>
 
  <p align="center">  <center>Dili, <?
  $tgl=date (' d - m - Y ');
  echo $tgl;
  ?></p>
<p align="center">Director</p>
</body>
</html>

Listing Program Laporan Data Per-Sekolah
<?php
            include("koneksi.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Laporan</title>
</head>

<body bgcolor="#FFFFFF">
<table width="742" border="0" align="center">
  <tr>
    <td width="410" height="277" align="center" valign="middle"><p>
    <h3>Laporan Per-sekolah</h3></p>
      <p><img src="../logo/LOGO1.png" width="146" height="129"></p>
      <h3><strong>-------------------------</strong></h3>
      <p><strong>Ministerio da Educacao Direccao da Educacao Distrito Dili</strong></p></td>  
  </tr>
</table>
<hr>
<hr>
<br>
<td width="241″>
<select multiple="multiple" name="id" id="id" onChange="pilih(this.value)">

</select>
</td>
<td width="195″ valign="top">
<select name="id" id="id" onChange="pilih(this.value)">
<option value="0″ selected="selected">Laporan per-sekolah</option>
<?php
$query_limit=mysql_query("SELECT * FROM tb_pendataan");
while($row=mysql_fetch_array($query_limit))
{
?><option value="<?php  echo $row['nama_sekolah']; ?>"><?php  echo $row['nama_sekolah']; ?></option><?php
}
?>
</select>
<script>
function pilih(id){
location.replace("lappersekolah.php?id="+id);
}
</script>

</td>
<br>
<article class="module width_full">
            <header><h3>&nbsp;</h3></header>
                        <div class="module_content">
        <?php
                        if($_GET['']!==""){
$id=$_GET['id'];
?>
        <?php                 
                        // ================ TAMPILKAN DATANYA =====================//
                        echo "<table border='1' cellspacing='0' align='center'  class='data'>
                                    <tr>
                                    <th width='5%'>No</th>
                                    <th width='10%'>Nama sekolah</th>
                                    <th width='10%'>Kode pendataan</th>
                                    <th width='10%'>Tanggal pendataan</th>
                                    <th width='10%'>Nip</th>
                                    <th width='10%'>Nama guru</th>
                                    <th width='10%'>Kode jabatan</th>
                                    <th width='10%'>Nama jabatan</th>
                                    <th width='10%'>Kode sekolah</th>
                                   
                        </tr>";
                       
                        $query_limit    = mysql_query("select * from tb_pendataan where nama_sekolah='$id'") or die (mysql_error());
                        $j_data             = mysql_num_rows($query_limit);

                        if ($j_data == 0) {
                                    echo "<tr><td id='tengah' colspan='8'>-- Tidak Ada Data --</td></tr>";
                        } else {
                                    $no = 1;
                                    while ($a_guru = mysql_fetch_array($query_limit)) {
                                               
                                                echo "
                                                <tr>
                                                <td id='tengah'>$no</td>
                                                <td>$a_guru[nama_sekolah]</td>
                                                <td>$a_guru[kode_pendataan]</td>
                                                <td>$a_guru[tgl_pendataan]</td>
                                                <td>$a_guru[nip]</td>
                                                <td>$a_guru[nama_guru]</td>
                                                <td>$a_guru[kode_jabatan]</td>
                                                <td>$a_guru[nama_jabatan]</td>
                                                <td>$a_guru[kode_sekolah]</td>
                                               
                                                </tr>";
                                                $no++;
                                    }
                        }
                        echo "</table>";
                        ?>
        <?php
}
?>
                        </div>
</article>
<br>
<br>
<p align="center">  <center>Dili, <?
  $tgl=date (' d - m - Y ');
  echo $tgl;
  ?></p>
<p align="center">Director</p>
<script>
window.print();
  </script>
</body>
</html>

Listing Program  Laporan Data Seluruh Sekolah
<?php
            include("koneksi.php");
?>
<html>
<head>
</head>
<body bgcolor="#FFFFFF">
<h3 align="center">Laporan Data Keseluruhan Sekolah</h3>
 <?php
  $no = $posisi+1;
$jadwal = mysql_query("SELECT * FROM tb_sekolah where kode_sekolah") ;
if( $i = mysql_num_rows($jadwal) > 0 ){
                                                                       
            ?>
<table width="100%" height="25px" border="1" cellpadding="0" cellspacing="0">
  <tr style="background-color:#1FABE0;">
    <td bgcolor="#FFFFFF" style="text-align:center;" align="center"><strong>No</strong></td>
    <td bgcolor="#FFFFFF" style="text-align:center;" align="center"><strong>Kode sekolah</strong></td>
    <td bgcolor="#FFFFFF" style="text-align:center;" align="center"><strong>Nama sekolah</strong></td>
    <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Status</strong></td>
    <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Tanggal berdiri</strong></td>
    <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Alamat</strong></td>
    <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Telpon</strong></td>
   
  </tr>
 <?php
    while( $i = mysql_fetch_array($jadwal) ){
 ?>
                                                                       
  <tr style="background-color:#C4E1FF">
            <td height="25px" align="center" bgcolor="#FFFFFF"><?php echo $no ?></td>
    <td height="25px" align="center" bgcolor="#FFFFFF"><?php echo $i['kode_sekolah'] ?></td>
    <td height="25px" align="center" bgcolor="#FFFFFF"><?php echo $i['nama_sekolah'] ?></td>
    <td align="center" bgcolor="#FFFFFF"><?php echo $i['status'] ?></td>
    <td align="center" bgcolor="#FFFFFF"><?php echo $i['tgl_berdiri'] ?></td>
    <td align="center" bgcolor="#FFFFFF"><?php echo $i['alamat'] ?></td>
    <td align="center" bgcolor="#FFFFFF"><?php echo $i['telpon'] ?></td>
  </tr>
<?php
$no++;
            }
}
?>
</table>

<a href="keseluruhansekolah.php"><button><img src="../logo/Print.ico">Cetak Laporan</button></a>

</body>
</html>

Listing Program Laporan Data Per-guru
<?php
            include("koneksi.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Laporan</title>
</head>

<body bgcolor="#FFFFFF">
<table width="742" border="0" align="center">
  <tr>
    <td width="410" height="277" align="center" valign="middle"><p>
    <h3>Laporan Per-guru</h3></p>
      <p><img src="../logo/LOGO1.png" alt="" width="146" height="129"></p>
      <h3><strong>-------------------------</strong></h3>
      <p><strong>Ministerio da Educacao Direccao da Educacao Distrito Dili</strong></p></td>  
  </tr>
</table>
<hr>
<hr>
<br>
<td width="241″>
<select multiple="multiple" name="id" id="id" onChange="pilih(this.value)">

</select>
</td>
<td width="195″ valign="top">
<select name="id" id="id" onChange="pilih(this.value)">
<option value="0″ selected="selected">Laporan per-guru</option>
<?php
$query_limit=mysql_query("SELECT * FROM tb_pendataan");
while($row=mysql_fetch_array($query_limit))
{
?><option value="<?php  echo $row['nama_guru']; ?>"><?php  echo $row['nama_guru']; ?></option><?php
}
?>
</select>
<script>
function pilih(id){
location.replace("lapperguru.php?id="+id);
}
</script>

</td>
<br>
<article class="module width_full">
            <header><h3>&nbsp;</h3></header>
                        <div class="module_content">
        <?php
                        if($_GET['']!==""){
$id=$_GET['id'];
?>
        <?php                 
                        // ================ TAMPILKAN DATANYA =====================//
                        echo "<table border='1' cellspacing='0' align='center'  class='data'>
                                    <tr>
                                    <th width='5%'>No</th>
                                    <th width='10%'>Nama guru</th>
                                    <th width='10%'>Kode pendataan</th>
                                    <th width='10%'>Tanggal pendataan</th>
                                    <th width='10%'>Nip</th>                  
                                    <th width='10%'>Kode jabatan</th>
                                    <th width='10%'>Nama jabatan</th>
                                    <th width='10%'>Kode sekolah</th>
                                    <th width='10%'>Nama sekolah</th>
                                   
                        </tr>";
                       
                        $query_limit    = mysql_query("select * from tb_pendataan where nama_guru='$id'") or die (mysql_error());
                        $j_data             = mysql_num_rows($query_limit);

                        if ($j_data == 0) {
                                    echo "<tr><td id='tengah' colspan='8'>-- Tidak Ada Data --</td></tr>";
                        } else {
                                    $no = 1;
                                    while ($a_guru = mysql_fetch_array($query_limit)) {
                                               
                                                echo "
                                                <tr>
                                                <td id='tengah'>$no</td>
                                                <td>$a_guru[nama_guru]</td>
                                                <td>$a_guru[kode_pendataan]</td>
                                                <td>$a_guru[tgl_pendataan]</td>
                                                <td>$a_guru[nip]</td>                        
                                                <td>$a_guru[kode_jabatan]</td>
                                                <td>$a_guru[nama_jabatan]</td>
                                                <td>$a_guru[kode_sekolah]</td>
                                                <td>$a_guru[nama_sekolah]</td>
                                               
                                                </tr>";
                                                $no++;
                                    }
                        }
                        echo "</table>";
                        ?>
        <?php
}
?>
                        </div>
</article>
<br>
<br>
<p align="center">  <center>Dili, <?
  $tgl=date (' d - m - Y ');
  echo $tgl;
  ?></p>
<p align="center">Director</p>
<script>
window.print();
  </script>
</body>
</html>

Listing Program Laporan Data  Seluruh Guru
<?php
            include("koneksi.php");
?>
<html>
<head>
</head>
<body bgcolor="#FFFFFF">
<h3 align="center">Laporan Data Departemen</h3>
 <?php
  $no = $posisi+1;
$jadwal = mysql_query("SELECT * FROM tb_guru where nip") ;
if( $i = mysql_num_rows($jadwal) > 0 ){
                                                                       
            ?>
<table width="100%" height="25px" border="1" cellpadding="0" cellspacing="0">
  <tr style="background-color:#1FABE0;">
    <td bgcolor="#FFFFFF" style="text-align:center;" align="center"><strong>No</strong></td>
    <td bgcolor="#FFFFFF" style="text-align:center;" align="center"><strong>Nip</strong></td>
    <td bgcolor="#FFFFFF" style="text-align:center;" align="center"><strong>Nama guru</strong></td>
    <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Tempat lahir</strong></td>
    <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Tanggal lahir</strong></td>
    <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Alamat</strong></td>
    <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Telpon</strong></td>
    <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Jenis kelamin</strong></td>
    <td height="40px" align="center" bgcolor="#FFFFFF"><strong>Nama jabatan</strong></td>
   
  </tr>
 <?php
    while( $i = mysql_fetch_array($jadwal) ){
 ?>
                                                                       
  <tr style="background-color:#C4E1FF">
            <td height="25px" align="center" bgcolor="#FFFFFF"><?php echo $no ?></td>
     <td height="25px" align="center" bgcolor="#FFFFFF"><?php echo $i['nip'] ?></td>
    <td height="25px" align="center" bgcolor="#FFFFFF"><?php echo $i['nama_guru'] ?></td>
    <td align="center" bgcolor="#FFFFFF"><?php echo $i['tempat_lahir'] ?></td>
    <td align="center" bgcolor="#FFFFFF"><?php echo $i['tanggal_lahir'] ?></td>
    <td align="center" bgcolor="#FFFFFF"><?php echo $i['alamat'] ?></td>
    <td align="center" bgcolor="#FFFFFF"><?php echo $i['telpon'] ?></td>
    <td align="center" bgcolor="#FFFFFF"><?php echo $i['jk'] ?></td>
    <td align="center" bgcolor="#FFFFFF"><?php echo $i['nama_jabatan'] ?></td>
  </tr>
<?php
$no++;
            }
}
?>
</table>

<a href="keseluruhanguru.php"><button><img src="../logo/Print.ico">Cetak Laporan</button></a>

</body>
</html>
Listing Program Laporan  Guru Per-Sekolah
<?php
            include("koneksi.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Laporan</title>
</head>

<body bgcolor="#FFFFFF">
<table width="742" border="0" align="center">
  <tr>
    <td width="410" height="277" align="center" valign="middle"><p>
    <h3>Laporan Guru Per-sekolah</h3></p>
      <p><img src="../logo/LOGO1.png" alt="" width="146" height="129"></p>
      <h3><strong>-------------------------</strong></h3>
      <p><strong>Ministerio da Educacao Direccao da Educacao Distrito Dili</strong></p></td>  
  </tr>
</table>
<hr>
<hr>
<br>
<td width="241″>
<select multiple="multiple" name="id" id="id" onChange="pilih(this.value)">

</select>
</td>
<td width="195″ valign="top">
<select name="id" id="id" onChange="pilih(this.value)">
<option value="0″ selected="selected">Laporan guru per-sekolah</option>
<?php
$query_limit=mysql_query("SELECT * FROM tb_pendataan");
while($row=mysql_fetch_array($query_limit))
{
?><option value="<?php  echo $row['nama_sekolah']; ?>"><?php  echo $row['nama_sekolah']; ?></option><?php
}
?>
</select>
<script>
function pilih(id){
location.replace("gurupersekolah.php?id="+id);
}
</script>

</td>
<br>
<article class="module width_full">
            <header><h3>&nbsp;</h3></header>
                        <div class="module_content">
        <?php
                        if($_GET['']!==""){
$id=$_GET['id'];
?>
        <?php                 
                        // ================ TAMPILKAN DATANYA =====================//
                        echo "<table border='1' cellspacing='0' align='center'  class='data'>
                                    <tr>
                                    <th width='5%'>No</th>
                                    <th width='10%'>Nama sekolah</th>
                                    <th width='10%'>Kode pendataan</th>
                                    <th width='10%'>Tanggal pendataan</th>
                                    <th width='10%'>Nip</th>
                                    <th width='10%'>Nama guru</th>
                                    <th width='10%'>Kode jabatan</th>
                                    <th width='10%'>Nama jabatan</th>
                                    <th width='10%'>Kode sekolah</th>
                                   
                        </tr>";
                       
                        $query_limit    = mysql_query("select * from tb_pendataan where nama_sekolah='$id'") or die (mysql_error());
                        $j_data             = mysql_num_rows($query_limit);

                        if ($j_data == 0) {
                                    echo "<tr><td id='tengah' colspan='8'>-- Tidak Ada Data --</td></tr>";
                        } else {
                                    $no = 1;
                                    while ($a_guru = mysql_fetch_array($query_limit)) {
                                               
                                                echo "
                                                <tr>
                                                <td id='tengah'>$no</td>
                                                <td>$a_guru[nama_sekolah]</td>
                                                <td>$a_guru[kode_pendataan]</td>
                                                <td>$a_guru[tgl_pendataan]</td>
                                                <td>$a_guru[nip]</td>
                                                <td>$a_guru[nama_guru]</td>
                                                <td>$a_guru[kode_jabatan]</td>
                                                <td>$a_guru[nama_jabatan]</td>
                                                <td>$a_guru[kode_sekolah]</td>
                                                </tr>";
                                                $no++;
                                    }
                        }
                        echo "</table>";
                        ?>
        <?php
}
?>
                        </div>
</article>
<br>
<br>
<p align="center">  <center>Dili, <?
  $tgl=date (' d - m - Y ');
  echo $tgl;
  ?></p>
<p align="center">Director</p>

</body>
</html>


                                                

Komentar