Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['reset'])) {
- $namaPekerja = $_POST['namaPekerja'];
- $idPerusahaan = $_POST['idPerusahaan'];
- $noKTP = $_POST['noKTP'];
- $alamat = $_POST['alamat'];
- $kota= $_POST['kota'];
- $kodePos = $_POST['kodePos'];
- $jenisKelamin = $_POST['jenisKelamin'];
- $agama = $_POST['agama'];
- $noTelepon = $_POST['noTelepon'];
- $jabatan = $_POST['jabatan'];
- $negara = $_POST['negara'];
- $ekstensi_diperbolehkan = array('png','jpg');
- $namaFoto = $_FILES['foto']['name'];
- $x = explode('.', $namaFoto);
- $ekstensi = strtolower(end($x));
- $ukuran = $_FILES['foto']['size'];
- $file_tmp = $_FILES['foto']['tmp_name'];
- $idPekerja = $_POST['idPekerja'];
- $jabatan = $_POST['jabatan'];
- if(in_array($ekstensi, $ekstensi_diperbolehkan) === true){
- if($ukuran < 1044070){
- move_uploaded_file($file_tmp, '../foto_pekerja/'.$namaFoto);
- $inputDataPekerja = "UPDATE profile_pekerja SET
- idPerusahaan = '$idPerusahaan',
- namaPekerja = '$namaPekerja',
- noKTP = '$noKTP',
- alamat = '$alamat',
- kota = '$kota',
- negara = '$negara',
- kodePos = '$kodePos',
- kelamin = '$jenisKelamin',
- agama = '$agama',
- noTelepon = '$noTelepon',
- jabatan = '$jabatan',
- foto = '$namaFoto'
- WHERE idPekerja = '$idPekerja'";
- $hasilInputDataPekerja = mysqli_query($connection, $inputDataPekerja);
- if ($hasilInputDataPekerja == true) {
- echo "<script>alert('Data pekerja berhasil diupdate!')</script>";
- } else {
- echo "<script>alert('Data pekerja gagal diupdate!')</script>";
- }
- } else {
- echo "<script>alert('Ukuran file terlalu besar! Maksimal 1 mb')</script>";
- }
- } else {
- echo "<script>alert(Eksistensi tidak didukung! Harus PNG/JPG')</script>";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement