One Hat Cyber Team
Your IP :
172.16.0.254
Server IP :
58.26.163.33
Server :
Windows NT DGPENSV2LPKMN 10.0 build 14393 (Windows Server 2016) AMD64
Server Software :
Apache/2.4.46 (Win64) OpenSSL/1.1.1h PHP/7.3.25
PHP Version :
7.3.25
Buat File
|
Buat Folder
Eksekusi
Dir :
C:
/
xampp7
/
htdocs
/
edgpens_220424
/
edg_200430
/
View File Name :
upload.php
<?php if(empty($page)){ include("../access.php"); } ?> <?php $modal_name = str_replace("/", "-", $page); $user = get_user($_SESSION['session']); $ii = $_GET['ii']; $success = 0; $type_submit = "add"; $user = get_user_full($_SESSION['session']); $roles = (int)$user['idRoles']; $idUser = (int)$user['idUser']; if($roles == 1 || $roles == 5){ if(!empty($ii)){ if($roles == 1){ $query="SELECT * FROM permohonan_main WHERE idUserApply='{$idUser}'"; $result=$mysqli->query($query); $row=$result->fetch_assoc(); if(!$row){ echo "<script>window.location.replace('index.php?page=edg/main&np=edg/ship_particular');</script>"; exit(); } } } }else{ echo "<script>window.location.replace('index.php?page=edg/main');</script>"; exit(); } if($_POST): $do = $_POST['type_submit']; if($ii > 0){ // $sql = " UPDATE // permohonan_main // SET // flagSecurityMeasures = ?, // catatanSecurityMeasures = ?, // latitude = ?, // longitude = ?, // ETA = ?, // namaMaster = ?, // flagDG = ? // WHERE // idPermohonan = ?"; // $param_type = "ssssssss"; // $param_data = array( // "flagSecurityMeasures" => $_POST['flagSecurityMeasures'], // "catatanSecurityMeasures" => $_POST['catatanSecurityMeasures'], // "latitude" => $_POST['latitude'], // "longitude" => $_POST['longitude'], // "ETA" => change_date($_POST['ETA'],'Y-m-d')." ".$_POST['ETA_time'], // "namaMaster" => $_POST['namaMaster'], // "flagDG" => $_POST['flagDG'], // "idPermohonan" => $ii // ); // $data = mysqli_prepare_audit($sql,$param_type,$param_data); } $success = 1; endif; if($success){ echo "<script>window.location.replace('index.php?page=edg/main&np=edg/port_call&ii={$ii}');</script>"; exit(); } if($_GET['ii'] > 0){ $stmt = $mysqli->stmt_init(); $stmt->prepare("SELECT a.idPermohonan, a.flagDG FROM permohonan_main a WHERE a.idPermohonan=? "); $stmt->bind_param("s",$permohonan_main = $ii); $stmt->execute(); if ($stmt->error) print_r('error executing statement: ' . $stmt->error); $result = $stmt->get_result(); $stmt->close(); $row=$result->fetch_assoc(); $stmt = $mysqli->stmt_init(); $stmt->prepare("SELECT idPL, namaFail, keterengan FROM permohonan_lampiran WHERE idPermohonanMain=? "); $stmt->bind_param("s",$permohonan_main = $ii); $stmt->execute(); if ($stmt->error) print_r('error executing statement: ' . $stmt->error); $result2 = $stmt->get_result(); $stmt->close(); $session = array(); // $row=$result->fetch_assoc(); $isps = ""; $isps_href = "index.php?page=edg/main&np=edg/isps_info&ii={$ii}"; if($row['flagDG'] == Y){ $dis_next = ""; $dg = ""; $dg_href = "index.php?page=edg/main&np=edg/dg&ii={$ii}"; }else{ $dis_next = "disabled"; $dg = "disabled"; $dg_href = "javascript:void(0)"; } $particular = "disabled"; $particular = "javascript:void(0)"; if(!$row){ echo "<script>window.location.replace('index.php?page=edg/main&np=edg/ship_particular');</script>"; exit(); } }else{ echo "<script>window.location.replace('index.php?page=edg/main&np=edg/ship_particular');</script>"; exit(); } // $stmt = $mysqli->stmt_init(); // $stmt = $mysqli->prepare("SELECT * FROM kod_kapal where nama=?"); // $stmt->bind_param("s", $nama); // $nama="test1"; // $stmt->execute(); // print_r($stmt->info."asdsa"); // // $stmt->debugDumpParams(); // $stmt -> bind_result($flag); // $stmt -> fetch(); // $stmt->close(); ?> <!-- Blank Header --> <div class="content-header"> <div class="row"> <div class="col-sm-6"> <div class="header-section"> <!-- <h1>NEW APPLICATION</h1> --> <h1> <ol class="breadcrumb" style="padding:0px; margin: 0px"> <li><a href="index.php?page=edg/main" style="color:black"><i class="fa fa-home"></i></a></li> <li><a href="javascript:void(0)" style="color:black">NEW APPLICATION</a></li> </ol> </h1> </div> </div> <div class="col-sm-6 hidden-xs"> <div class="header-section"> <!-- <ul class="breadcrumb breadcrumb-top"> --> <!-- <li>Extra Pages</li> --> <!-- <li><a href="">Blank</a></li> --> <!-- </ul> --> </div> </div> </div> </div> <!-- END Blank Header --> <!-- Get Started Block --> <div class="block full"> <!-- Get Started Title --> <div class="block-section"> <ul class="nav nav-pills nav-justified"> <li class=""><a href="index.php?page=edg/main&np=edg/ship_particular&ii=<?php echo $ii; ?>">Ship Particular</a></li> <li class=""><a href="index.php?page=edg/main&np=edg/isps_info&ii=<?php echo $ii; ?>">ISPS Information</a></li> <li class=""><a href="index.php?page=edg/main&np=edg/port_call&ii=<?php echo $ii; ?>">Last 10 Port Calls</a></li> <li class=""><a href="index.php?page=edg/main&np=edg/other_part&ii=<?php echo $ii; ?>">Other Particular</a></li> <li class="active"><a href="index.php?page=edg/main&np=edg/upload&ii=<?php echo $ii; ?>">File Upload</a></li> <li class="<?php echo $dg; ?>"><a href="<?php echo $dg_href; ?>">Dangerous Goods</a></li> </ul> </div> <div class="block full"> <div class="row"> <div class="col-md-6"> <?php ?> <form id="my-awesome-dropzone" action="edg/upload_me.php?ii=22" class="dropzone"> <div class="dropzone-previews"></div> <!-- this is were the previews should be shown. --> <!-- <hr> --> <center> <div class="form-group"> <div class="input-group bootstrap-timepixcker"> <span class="input-group-addon">File Name</span> <input type="text" name="name_file" class="form-control"> </div> </div> <hr> <div class="btn-group"> <a class="btn btn-warning" href="index.php?page=edg/main&np=edg/other_part&ii=<?php echo $ii;?>"><i class="fa fa-chevron-left"></i></a> <button type="submit" class="btn btn-primary" href="index.php?page=edg/main">Submit</button> <a class="btn btn-warning <?php echo $dis_next;?>" href="index.php?page=edg/main&np=edg/dg&ii=<?php echo $ii;?>"><i class="fa fa-chevron-right"></i></a> </div> </center> <!-- Now setup your input fields --> <!-- <input type="email" name="username" /> --> <!-- <input type="password" name="password" /> --> <!-- <button type="submit">Submit data and files!</button> --> </form> </div> <div class="col-md-6"> <table class="table table-condensed table-border table-hover table-striped"> <thead> <tr> <th width="20px">No.</th> <th>File</th> <th class="text-center" width="100px">Action</th> </tr> </thead> <tbody> <?php $i=1; while($aa = $result2->fetch_assoc()){ $link = "upload/{$ii}/".$aa['namaFail']; ?> <tr> <td class="text-right"><?php echo $i++?>.</td> <td><a href="<?php echo $link; ?>" target="new"><?php echo $aa['keterengan']; ?></a></td> <td class="text-center"><a href="javascript:void(0)" title="Delete Record" class="btn btn-effect-ripple btn-xs btn-danger del-me" data-val="<?php echo $aa['idPL'];?>"><i class="fa fa-times"></i></a></td> </tr> <?php }?> </tbody> </table> </div> </div> <script type="text/javascript"> Dropzone.options.myAwesomeDropzone = { // The camelized version of the ID of the form element // The configuration we've talked about above autoProcessQueue: false, uploadMultiple: true, parallelUploads: 100, maxFiles: 100, acceptedFiles: "image/jpeg,image/png,image/gif,image/*,application/pdf,.psd", // The setting up of the dropzone init: function() { var myDropzone = this; // First change the button to actually tell Dropzone to process the queue. this.element.querySelector("button[type=submit]").addEventListener("click", function(e) { // Make sure that the form isn't actually being sent. e.preventDefault(); e.stopPropagation(); var test1 = $("#my-awesome-dropzone").hasClass("dz-started"); var test2 = $("#my-awesome-dropzone").find(".dz-preview").hasClass("dz-error"); var cont = 0; if($("[name='name_file']").val() === ''){ if(!$("#val-password-error").length){ $("[name='name_file']").parent(".input-group").after("<div id=\"val-password-error\" class=\"help-block2 \" style='margin-top:8px;font-weight:400;font-style:italic;color: #de815c'>Please Enter The File Name.</div>"); $("[name='name_file']").parents(".form-group").addClass("has-error2"); cont = 1; } } else{ $("#val-password-error").remove(); $("[name='name_file']").parents(".form-group").removeClass("has-error2"); } if(!test1){ if(!$(".dz-default").find("#erro2").length){ $(".dz-default").find("span").after("<div id=\"erro2\" class=\"help-block2 \" style='margin-top:8px;font-weight:400;font-style:italic;color: #de815c'>Please Select File To Upload.</div>"); cont = 1; } }else{ $("#erro2").remove(); } if(cont===0){ $("#my-awesome-dropzone").css("border-color",""); if(confirm("Save This File?")){ myDropzone.processQueue(); } }else{ $("#my-awesome-dropzone").css("border-color","#de815c"); } }); // Listen to the sendingmultiple event. In this case, it's the sendingmultiple event instead // of the sending event because uploadMultiple is set to true. this.on("sendingmultiple", function() { // Gets triggered when the form is actually being sent. // Hide the success button or the complete form. }); this.on("successmultiple", function(files, response) { // Gets triggered when the files have successfully been sent. // Redirect user or notify of success. if(response.trim() == 'success'){ window.location.replace('index.php?page=edg/main&np=edg/upload&ii=<?php echo $ii;?>'); }else{ alert("Ops. Something Wrong When Uploading!"); } }); this.on("errormultiple", function(files, response) { // Gets triggered when there was an error sending the files. // Maybe show form again, and notify user of error }); this.on("addedfile", function(file) { // Create the remove button var removeButton = Dropzone.createElement("<button>Remove file</button>"); // Capture the Dropzone instance as closure. var _this = this; // Listen to the click event removeButton.addEventListener("click", function(e) { // Make sure the button click doesn't submit the form: e.preventDefault(); e.stopPropagation(); // Remove the file preview. _this.removeFile(file); // If you want to the delete the file on the server as well, // you can do the AJAX request here. }); // Add the button to the file preview element. file.previewElement.appendChild(removeButton); }); this.on("addedfile", function(e) { if (this.files[1]!=null){ this.removeFile(this.files[0]); } }); this.on('sending', function(e) { // Append all form inputs to the formData Dropzone will POST // var data = $('form').serializeArray(); // $.each(data, function(key, el) { // formData.append(el.name, el.value); // }); // alert(2); // file.preventDefault(); // file.stopPropagation(); return false; console.log(e); // e.stopPropagation(); }); this.confirm = function(question, accepted, rejected) { // Do your thing, ask the user for confirmation or rejection, and call // accepted() if the user accepts, or rejected() otherwise. Make // sure that rejected is actually defined! // alert(1); }; } } // $("#my-awesome-dropzone").on("submit",function(){ // alert(1); // return false; // }); </script> </div> </div>