Tambah Order List


Isi jika di perlukan
Anda bisa pilih salah satu untuk mengisi bagian ini
prepare("SELECT id FROM pelanggan WHERE email = :email OR nik = :nik"); $cekExist->execute([ ':email' => $_POST['email'], ':nik' => $_POST['nik'] ]); if ($cekExist->rowCount() === 0) { $stmt = $pdo->prepare("INSERT INTO order_list (id_data_server, id_profile_paket, id_marketing, jenis_layanan, nama, nik, alamat, id_master_desa, latitude, longitude, nomor_whatsapp, email, status, catatan, create_with) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'order', ?, ?)"); $stmt->execute([$_POST['ids'], $_POST['idp'], $_POST['idm'], $_POST['jenis'], $_POST['nama'], $_POST['nik'], $_POST['alamat'], $_POST['desa'], $_POST['latitude'], $_POST['longitude'], $nowa, $_POST['email'], $_POST['catatan'], $SvNama]); $last_id = $pdo->lastInsertId(); $ano = $pdo->prepare("SELECT nomor_whatsapp FROM data_server WHERE id = ?"); $ano->execute([$_POST['ids']]); $no = $ano->fetch(PDO::FETCH_ASSOC); $nomor = explode(',', $no['nomor_whatsapp'] . ',' . $nowa); // Kirim Pesan WhatsApp $APIwa = new PesanWA(); $APIwa->Create_Pesan($_POST['ids'], $last_id, 'pesan_registrasi', 'order'); $Pesan = $APIwa->Get_Pesan(); $APIwa->Send_Pesan($_POST['ids'], 'sendMessage', $nomor, $Pesan); sweetAlert("Order list telah di tambah", "success", "?" . encrypt_url('order_list')); } else { $existRow = $cekExist->fetch(PDO::FETCH_ASSOC); if ($existRow['email'] === $_POST['email']) { sweetAlert("Registrasi GAGAL..! EMAIL sudah terdaftar", "error"); } elseif ($existRow['nik'] === $_POST['nik']) { sweetAlert("Registrasi GAGAL..! NIK sudah terdaftar", "error"); } else { sweetAlert("Registrasi GAGAL..! gagal upload ke database", "error"); } } } catch (PDOException $e) { sweetAlert("Error: " . $e->getMessage(), "error"); // Handle exception // echo "Error: " . $e->getMessage(); } } ?>