Server IP : 101.255.104.117 / Your IP : 101.255.104.117 Web Server : Apache/2.4.34 (Win32) OpenSSL/1.0.2o PHP/5.6.38 System : Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586 User : user ( 0) PHP Version : 5.6.38 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/xampp182/htdocs/silppm/ |
Upload File : |
<?php $id = ""; $judul = ""; $hp = ""; $skim = ""; $buton = "Simpan"; $proposal = "-"; $topik = "-"; $tgl_usulan = "-"; $biaya = "-"; $skema = "-"; $periode = "-"; $skim = "-"; $nama = "-"; $id_peneliti = "-"; $struktural = "-"; $prodi = "-"; if(isset($_GET["deleteID"])) { $sql = "delete from usulan_pengabdian where id = ".$_GET["deleteID"]; if (mysqli_query($conn, $sql)) { echo "<script>window.alert('Data Sudah Terhapus');</script>"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } } if(isset($_GET["editID"])) { $sql = "SELECT * FROM usulan_pengabdian where id = ".$_GET["editID"]." order by id desc"; $result = mysqli_query($conn, $sql); if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { $id = $row['id']; $judul = $row['judul']; $tgl_usulan = $row['tgl_usulan']; $skim = $row['skim']; $id_peneliti = $row['id_peneliti']; $prodi = $row['prodi']; $periode = $row['periode']; $biaya = $row['biaya']; $topik = $row['topik']; $proposal = $row['proposal']; $buton = "Koreksi"; } } } if(isset($_POST["Unggah"])) { $image_id = time(); $images = $_FILES["fileInput"]["name"]; if($images) { $rename = explode(".",$images); if(count($rename) > 1) { $images = "peng".$image_id.".".$rename[1]; $url = $images; move_uploaded_file($_FILES["fileInput"]["tmp_name"],"files/" . $images); } } $sql = "insert into files_pengabdian (judul,id_pengabdian,keterangan,tgl,id_user,url) values ('".$_POST["judul"]."',".$_GET["editID"].",'".$_POST["keterangan"]."','".$skr."',".$_SESSION["user-id"].",'".$url."')"; if (mysqli_query($conn, $sql)) { echo "<script>window.alert('Upload Sukses Ditambahkan.');</script>"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } } if(isset($_GET["setaktif"])) { $setz = mysqli_query($conn, "update usulan_pengabdian set aktif = 0"); $sql = "update usulan_pengabdian set aktif = 1 where id = ".$_GET["setaktif"]; if (mysqli_query($conn, $sql)) { echo "<script>window.alert('Set Aktif');</script>"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } } if(isset($_POST["Simpan"]) || isset($_POST["Koreksi"])) { if(isset($_POST["tgl_usulan"])) $tgl_usulan = $_POST["tgl_usulan"]; if(isset($_POST["skim"])) $skim = $_POST["skim"]; if(isset($_POST["judul"])) $judul = $_POST["judul"]; if(isset($_POST["id"])) $id = $_POST["id"]; if(isset($_POST["periode"])) $periode = $_POST["periode"]; if(isset($_POST["skema"])) $skema = $_POST["skema"]; if(isset($_POST["biaya"])) $biaya = $_POST["biaya"]; if(isset($_POST["topik"])) $topik = $_POST["topik"]; if(isset($_POST["proposal"])) $proposal = $_POST["proposal"]; if(isset($_POST["id_peneliti"])) $id_peneliti = $_POST["id_peneliti"]; if(isset($_POST["prodi"])) $prodi = $_POST["prodi"]; $sql = "select max(id) as id from usulan_pengabdian"; $result = mysqli_query($conn, $sql); if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { $mxID = $row['id']+1; } } $tbField[0] = "id"; $tbField[1] = "tgl_usulan"; $tbField[2] = "skim"; $tbField[3] = "periode"; $tbField[4] = "skema"; $tbField[5] = "biaya"; $tbField[6] = "topik"; $tbField[7] = "proposal"; $tbField[8] = "id_peneliti"; $tbField[9] = "prodi"; $tbField[10] = "judul"; $tbIsi[0] = $mxID; $tbIsi[1] = "'".$tgl_usulan."'"; $tbIsi[2] = "'".$skim."'"; $tbIsi[3] = "'".$periode."'"; $tbIsi[4] = "'".$skema."'"; $tbIsi[5] = "'".$biaya."'"; $tbIsi[6] = "'".$topik."'"; $tbIsi[7] = "'".$proposal."'"; $tbIsi[8] = "'".$id_peneliti."'"; $tbIsi[9] = "'".$prodi."'"; $tbIsi[10] = "'".$judul."'"; if(isset($_POST["Simpan"])) { $nmField = compile_array($tbField); $isiField = compile_array($tbIsi); $sql = "insert into usulan_pengabdian (".$nmField.") values (".$isiField.")"; $notif = $ssm; } if(isset($_POST["Koreksi"])) { $compileSet = compile_array2($tbField,$tbIsi); $sql = "update usulan_pengabdian set ".$compileSet." where id = ".$id; $notif = $sum; } if (mysqli_query($conn, $sql)) { echo "<script>window.alert('".$notif."');location.href='dashboard.php?DataPengabdian&editID=".$mxID."';</script>"; } else { echo "Error: " . $sql . "<br>" . mysqli_error($conn); } } ?> <?php if(isset($_POST["Add"]) || isset($_GET["editID"]) || $_GET["tambah"] == 1) { ?> <div class="container-fluid"> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Entry Data </h6> </div> <div class="card-body"> <form class="user" action="dashboard.php?DataPengabdian" accept-charset="utf-8" method="post"> <style> table td, table th { padding: 5px; /* cellpadding */ } </style> <div class="col m6"> <div class="row"> <div class="input-field col m6 s12"> <table border="0" width="100%" cellspacing="1" cellpadding="1"> <tr> <td width="30%">Judul Pengabdian</td> <td width="70%"> <input value="<?php echo $id;?>" name="id" type="hidden"> <input value="<?php echo $judul;?>" name="judul" type="text" class="form-control" id="exampleFirstName" placeholder="Judul"> </td> </tr> <tr> <td>Tanggal Usulan</td> <td> <input value="<?php echo $tgl_usulan;?>" name="tgl_usulan" type="date" class="form-control" id="tgl_usulan" placeholder=""> </td> </tr> <tr> <td>Skim Pengabdian</td> <td> <input value="<?php echo $skim;?>" name="skim" type="text" class="form-control" id="var" placeholder="nama periode masuk"> </td> </tr> <tr> <td>Periode Pengabdian</td> <td> <input value="<?php echo $periode;?>" name="periode" type="text" class="form-control" id="var" placeholder="nama periode masuk"> </td> </tr> <tr> <td>Skema Pengabdian</td> <td> <input value="<?php echo $skema;?>" name="skema" type="text" class="form-control" id="skema" placeholder=""> </td> </tr> <tr> <td>Biaya Pengabdian</td> <td> <input value="<?php echo $biaya;?>" name="biaya" type="number" class="form-control" id="biaya" placeholder=""> </td> </tr> <tr> <td>Topik Pengabdian</td> <td> <input value="<?php echo $topik;?>" name="topik" type="text" class="form-control" id="topik" placeholder=""> </td> </tr> <tr> <td>Program Studi</td> <td> <select name="prodi" class="form-control" id="prodi"> <?php $sql = "SELECT * FROM f_prodi order by id desc"; $result = mysqli_query($conn, $sql); if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { ?> <option value="<?php echo $row["prodi"];?>"><?php echo $row["prodi"];?></option> <?php } } ?> </select> </td> </tr> <tr> <td>Proposal</td> <td> <input value="<?php echo $proposal;?>" name="proposal" type="text" class="form-control" id="proposal" placeholder=""> </td> </tr> <tr> <td>Pilih Peneliti</td> <td> <select name="id_peneliti" class="form-control" id="id_peneliti"> <?php $sql = "SELECT * FROM peneliti order by nama asc"; $result = mysqli_query($conn, $sql); if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { ?> <option value="<?php echo $row["id"];?>"><?php echo $row["nama"];?></option> <?php } } ?> </select> </td> </tr> <tr> <td> </td> <td> <div class="form-group row"> <div class="col-sm-2 mb-3 mb-sm-0"> <button name="<?php echo $buton;?>" type="submit" class="btn btn-primary btn-block"><?php echo $buton;?></button> </div> <div class="col-sm-2"> <button name="Cancel" type="submit" class="btn btn-primary btn-block">Cancel</button> </div> </div> </td> </tr> </table> </div> </div> </div> </div> </div> </div> </form> <form class="user" action="dashboard.php?DataPengabdian&editID=<?php echo $_GET["editID"];?>" enctype="multipart/form-data" accept-charset="utf-8" method="post"> <div class="container-fluid"> <!-- Page Heading --> <!-- DataTales Example --> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Files Pengabdian</h6> </div> <div class="card-body"> <div class="table-responsive"> <table border="0" width="100%" cellspacing="1" cellpadding="1"> <tr> <td width="30%">Judul</td> <td width="70%"> <input value="<?php echo $judul;?>" name="judul" type="text" class="form-control" id="judul" placeholder=""> </td> </tr> <tr> <td>Keterangan</td> <td> <select name="keterangan" class="form-control" id="keterangan"> <option value="Proposal Penelitian">Proposal Penelitian</option> <option value="Hasil Penelitian">Hasil Penelitian</option> </select> </td> </tr> <tr> <td>Upload Files</td> <td> <input name="fileInput" type="file" class="form-control" placeholder=""> </td> </tr> <tr> <td> </td> <td> <div class="form-group row"> <div class="col-sm-2 mb-3 mb-sm-0"> <button name="Unggah" type="submit" class="btn btn-primary btn-block">Unggah</button> </div> <div class="col-sm-2"> <button name="Cancel" type="submit" class="btn btn-primary btn-block">Cancel</button> </div> </div> </td> </tr> </table> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>Judul</th> <th>Keterangan</th> <th>Files</th> <th>Hapus</th> </tr> </thead> <tfoot> <tr> <th>Judul</th> <th>Keterangan</th> <th>Files</th> <th>Hapus</th> </tr> </tfoot> <tbody> <?php $sql = "SELECT * FROM files_pengabdian where id_pengabdian = ".$_GET["editID"]." order by id desc"; $result = mysqli_query($conn, $sql); if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { ?> <tr> <td><?php echo $row['judul'];?></td> <td><?php echo $row['keterangan'];?></td> <td><a href="files/<?php echo $row['url'];?>" target="blank"><?php echo $row['url'];?></a></td> <td> <a class="btn btn-primary btn-danger" href="dashboard.php?DetPengabdian&editID=<?php echo $_GET["editID"];?>&ID2=<?php echo $row['id'];?>"><i class="fas fa-trash"></i></a--> </td> </tr> <?php } } ?> </tbody> </table> </div> </div> </div> </div> </form> <?php }else{ ?> <form class="user" action="dashboard.php?DataPengabdian" accept-charset="utf-8" method="post"> <div class="container-fluid"> <!-- Page Heading --> <!-- DataTales Example --> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">DataTables</h6> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <?php if($profile == "ADMIN") { ?><th>Delete</th><?php } ?> <th>Edit</th> <th>NO</th> <th>Tanggal</th> <th>Judul</th> <th>Periode</th> <th>Biaya</th> </tr> </thead> <tfoot> <tr> <?php if($profile == "ADMIN") { ?><th>Delete</th><?php } ?> <th>Edit</th> <th>NO</th> <th>Tanggal</th> <th>Judul</th> <th>Skema</th> <?php if($profile == "ADMIN") { ?><th>DOSEN</th><?php }else{ ?><th>Biaya</th><?php } ?> </tr> </tfoot> <tbody> <?php if($profile == "ADMIN") { $sql = "SELECT a.*,nama FROM usulan_pengabdian a left join peneliti b on a.id_peneliti = b.id order by a.id desc"; }else{ $nidn2 = substr($nidn,1,20); $sql = "SELECT a.* FROM usulan_pengabdian a left join peneliti b on a.id_peneliti = b.id where b.nidn like '%".$nidn."%' or b.nidn like '%".$nidn2."%' order by a.id desc"; } $result = mysqli_query($conn, $sql); $no = 0; if(mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { ?> <tr> <?php if($profile == "ADMIN") { ?><td> <a class="btn btn-primary btn-danger" href="dashboard.php?DataPengabdian&deleteID=<?php echo $row['id'];?>"><i class="fas fa-trash"></i></a> </td><?php } ?> <td> <a class="btn btn-primary btn-warning" href="dashboard.php?DataPengabdian&editID=<?php echo $row['id'];?>"><i class="fas fa-edit"></i></a> </td> <td><?php echo $no = ($no+1);?></td> <td><?php echo $row['tgl_usulan'];?></td> <td><?php echo $row['judul'];?></td> <td><?php echo $row['periode'];?></td> <?php if($profile == "ADMIN") { ?><td><?php echo ($row['nama']);?></td><?php }else{ ?><td><?php echo format_currency($row['biaya']);?></td><?php } ?> </tr> <?php } } ?> </tbody> </table> <hr> <button name="Add" type="submit" class="btn btn-primary btn-block">Tambah Pengabdian</button> </div> </div> </div> </div> </form> <?php } ?>