<?php include 'menu/menu_admin.php'; ?> <!DOCTYPE html> <html> <head> <title>SMART TRAVEL</title> </head> <body> <?php include_once 'ckaryawan.php'; $karyawan = new ckaryawan(); $tampil = $karyawan->getList(); ?> <div class="container"> <table border="1" class="table table-bordered"> <tr> <td colspan="6" align="center">SMART</td> </tr> <tr> <td>Nama</td> <td>Telpon</td> <td>Jabatan</td> <td>User Name</td> <td colspan="2">Aksi</td> </tr> <?php while ($data = mysql_fetch_array($tampil)) { ?> <tr>
<?php include 'ckaryawan.php'; include 'header.php'; $cm = new ckaryawan(); $query = $cm->getSearch(); if ($data = mysql_fetch_array($query)) { ?> <div class="container"> <form action="index.php?hal=karyawan&file=edit" method="POST" > <legend>Input Data Karyawan</legend> <input type="hidden" name="id" value="<?php echo $data['id']; ?> " class="form-control"> <div class="form-group"> <label for="">Nama</label> <input type="text" name="nama" value="<?php echo $data['nama']; ?> " class="form-control" id="" placeholder="Input Nama Karyawan"> </div> <div class="form-group"> <label for="">Telpon</label> <input type="text" maxlength="12" name="telp" value="<?php echo $data['telp']; ?> " class="form-control" id="" placeholder="Input telepon"> </div> <div class="form-group">
<?php include_once 'ckaryawan.php'; $id = $_POST['id']; $nama = $_POST['nama']; $telp = $_POST['telp']; $password = $_POST['password']; $jabatan = $_POST['jabatan']; $user_name = $_POST['user_name']; $cm = new ckaryawan(); $cm->setid($id); $cm->setnama($nama); $cm->settelp($telp); $cm->setpassword($password); $cm->setjabatan($jabatan); $cm->setuser_name($user_name); $hasil = $cm->getInsert(); if ($hasil) { echo "simpan data berhasil!!"; echo "<br>"; echo "Nama :" . $cm->getnama(); echo "<br>"; echo "Telp :" . $cm->gettelp(); echo "<br>"; echo "Password :"******"<br>"; echo "Jabatan :" . $cm->getjabatan(); echo "<br>"; echo "User_Name :" . $cm->getuser_name(); echo "<br>"; echo "<a href=index.php?hal=karyawan&file=tampil>Input Lagi</a>";
<?php include 'ckaryawan.php'; $id = $_POST['id']; $nama = $_POST['nama']; $telp = $_POST['telp']; $password = $_POST['password']; $jabatan = $_POST['jabatan']; $user_name = $_POST['user_name']; $cm = new ckaryawan(); $cm->setid($id); $cm->setnama($nama); $cm->settelp($telp); $cm->setpassword($password); $cm->setjabatan($jabatan); $cm->setuser_name($user_name); $edit = $cm->getUpdate(); if ($edit) { ?> <script language="javascript">alert("Data berhasil diubah") document.location="index.php?hal=karyawan&file=tampil ";</script> <?php } else { echo "data gagal terupdate"; }
<?php include 'ckaryawan.php'; $cm = new ckaryawan(); $query = $cm->getDelete(); if ($query) { ?> <script language="javascript">alert("Data berhasil dihapus") document.location="index.php?hal=karyawan&file=tampil";</script> <?php } else { echo "data gagal terhapus"; }