kppnadministration /@dm1n/modul/mod_submenu/submenu.php

Language PHP Lines 115
MD5 Hash c1d551b8e7137f4c188205733edeeeed Estimated Cost $2,459 (why?)
Repository https://bitbucket.org/metamorph/kppnadministration.git View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
session_start();
 if (empty($_SESSION['username']) AND empty($_SESSION['passuser'])){
  echo "<link href='style.css' rel='stylesheet' type='text/css'>
 <center>Untuk mengakses modul, Anda harus login <br>";
  echo "<a href=../../index.php><b>LOGIN</b></a></center>";
}
else{
$aksi="modul/mod_submenu/aksi_submenu.php";
switch($_GET[act]){
  // Tampil Sub Menu
  default:
    echo "<h2>Sub Menu</h2>
          <input type=button value='Tambah Sub Menu' onclick=\"window.location.href='?module=submenu&act=tambahsubmenu';\">
          <table>
		<tr><th>no</th><th>sub menu</th><th>menu utama</th><th>seksi</th><th>link submenu</th><th>aksi</th></tr>";

    $tampil = mysql_query("SELECT a.id_sub,a.nama_sub,b.nama_menu,a.seksi,a.link_sub FROM submenu a,mainmenu b WHERE a.id_main=b.id_main");
  
    $no = 1;
    while($r=mysql_fetch_array($tampil)){
      echo "<tr><td>$no</td>
                <td>$r[nama_sub]</td>
                <td>$r[nama_menu]</td>
				<td align='center'>$r[seksi]</td>
                <td>$r[link_sub]</td>
		            <td><a href=?module=submenu&act=editsubmenu&id=$r[id_sub]>Edit</a> | 
		                <a href=$aksi?module=submenu&act=hapus&id=$r[id_sub]>Hapus</a></td>
		
		        </tr>";
      $no++;
    }
    echo "</table>";
    break;
  
  case "tambahsubmenu":
    echo "<h2>Tambah Sub Menu</h2>
          <form method=POST action='$aksi?module=submenu&act=input'>
          <table>
          <tr><td>Sub Menu</td>     <td> : <input type=text name='nama_sub'></td></tr>
          <tr><td>Menu Utama</td>  <td> : 
          <select name='menu_utama'>
            <option value=0 selected>- Pilih Menu Utama -</option>";
            $tampil=mysql_query("SELECT * FROM mainmenu ORDER BY nama_menu");
            while($r=mysql_fetch_array($tampil)){
              echo "<option value=$r[id_main]>$r[nama_menu]</option>";
            }
    echo "</select></td></tr>
	 <tr><td>Seksi</td><td> : 
		    <select name='seksi'>
		    	<option value=0 selected='selected'>- Pilih Seksi -</option>
		    	<option value='ALL'>ALL - Semua Seksi</option>
		    	<option value='UM'>UM - Sub Bagian Umum</option>
		    	<option value='PD'>PD - Pencairan Dana</option>
		    	<option value='BP'>BP - Bank dan Giro Pos</option>
		    	<option value='VR'>VR - Verifikasi dan Akuntansi</option>
		    	<option value='APD'>APD - Kasi Pencairan Dana</option>
		    </select>
		   </td>
	  </tr>
          <tr><td>Link Sub Menu</td><td> : <input type=text name='link_sub'></td></tr>
          <tr><td colspan=2><input type=submit value=Simpan>
                            <input type=button value=Batal onclick=self.history.back()></td></tr>
          </table></form>";
     break;
    
  case "editsubmenu":
    $edit = mysql_query("SELECT * FROM submenu WHERE id_sub='$_GET[id]'");
    $r    = mysql_fetch_array($edit);

    echo "<h2>Edit Sub Menu</h2>
          <form method=POST action=$aksi?module=submenu&act=update>
          <input type=hidden name=id value=$r[id_sub]>
          <table>
          <tr><td width=70>Sub Menu</td>     <td> : <input type=text name='nama_sub' value='$r[nama_sub]'></td></tr>
          <tr><td>Menu Utama</td>  <td> : <select name='menu_utama'>";
 
          $tampil=mysql_query("SELECT * FROM mainmenu ORDER BY nama_menu");
          if ($r[id_main]==0){
            echo "<option value=0 selected>- Pilih Menu Utama -</option>";
          }   

          while($w=mysql_fetch_array($tampil)){
            if ($r[id_main]==$w[id_main]){
              echo "<option value=$w[id_main] selected>$w[nama_menu]</option>";
            }
            else{
              echo "<option value=$w[id_main]>$w[nama_menu]</option>";
            }
          }
    echo "</select></td></tr>
	 <tr><td>Seksi</td><td> : 
		    <select name='seksi'>";
		    $qSeksi	= mysql_query("SELECT DISTINCT seksi FROM r_seksi ORDER BY seksi");
		    if($r[id_sub==0]){
    		    echo "<option value=0 selected='selected'>- Pilih Seksi -</option>";
		    }
		    while($rSeksi	= mysql_fetch_array($qSeksi)){
			    if($r[seksi]==$rSeksi[seksi]){
		    			echo "<option value='$rSeksi[seksi]' selected='selected'>$rSeksi[seksi] - $rSeksi[namaseksi]</option>";
			    }
			    else{
				    	echo "<option value='$rSeksi[seksi]'>$rSeksi[seksi] - $rSeksi[namaseksi]</option>";
			    }
		    }
	
          echo "<tr><td>Link Sub Menu</td><td> : <input type=text name='link_sub' value='$r[link_sub]'></td></tr>
          <tr><td colspan=2><input type=submit value=Update>
                            <input type=button value=Batal onclick=self.history.back()></td></tr>
         </table></form>";
    break;  
}
}
?>
Back to Top