public static function add($newItem) { $val_description = $_POST[$newItem][0]; $val_quantity = $_POST[$newItem][1]; $val_price = $_POST[$newItem][2]; $crud = new CRUD(); $crud->insert(' itens ', ' description=?, qty=?, price=? ', array($val_description, $val_quantity, $val_price)); return $crud; }
<?php include "model/_crud.mysqli.oop.php"; $crud = new CRUD("localhost", "root", "", "restoran"); $connection = mysql_connect("localhost", "root", ""); $db = mysql_select_db("restoran"); $nmor_meja = @$_POST['mm']; $sql = mysql_query("SELECT * FROM meja where tmpmeja='{$nmor_meja}'"); $data = mysql_fetch_array($sql); $cek = mysql_num_rows($sql); if ($cek > 0) { header('location:index.php'); } else { session_start(); @($_SESSION['nomor_meja'] = $nmor_meja); $data = array('no' => '', 'tmpmeja' => $nmor_meja); $crud->insert('meja', $data); header('location:menu.php'); } ?>
<?php require_once "CRUD.php"; $req = ''; $text = ''; if ($_REQUEST["str"]) { $req .= $_REQUEST["str"]; $params = explode("/", $req); $crud = new CRUD(); $sucess = $crud->insert('Cliente', 'nome=?, telefone=?, email=?', array($params[0], $params[1], $params[2])); } //echo 'Done!';
<?php include "../model/_crud.mysqli.oop.php"; $crud = new CRUD("localhost", "root", "", "restoran"); $keterangan = @$_POST['keterangan']; $nama = @$_POST['nama']; $gambar = @$_FILES['gambar']['tmp_name']; $target = '../tampilan/img/'; $harga = @$_POST['harga']; $nama_gambar = @$_FILES['gambar']['name']; $pindah = move_uploaded_file($gambar, $target . $nama_gambar); if ($pindah) { $data = array('nama' => $nama, 'gambar' => $nama_gambar, 'harga' => $harga, 'keterangan' => $keterangan); $crud->insert('makanan', $data); header('location:../admin.php'); } else { ?> <script type="text/javascript"> alert('gambar gagal di upload'); </script> <?php echo "ada yang salah"; echo "{$nama}"; echo "{$gambar}"; echo "{$harga}"; }
<?php require_once "/../class/ConDB.class.php"; $pergunta = $_POST['pergunta']; $resposta = $_POST['resposta']; $crud = new CRUD(); $crud->insert('faq', 'pergunta=?, resposta=?', array($pergunta, $resposta)); print $pergunta;
<?php require_once "CRUD.php"; $req = ''; $text = ''; if ($_REQUEST["str"]) { $req .= $_REQUEST["str"]; $params = explode("/", $req); $crud = new CRUD(); $crud->insert('Cliente', 'Nome=?, Telefone=?, Email=?', array($params[0], $params[1], $params[2])); }
<?php include "../model/_crud.mysqli.oop.php"; $crud = new CRUD("localhost", "root", "", "restoran"); $no = @$_POST['id']; $nama = @$_POST['nama']; $gambar = @$_FILES['gambar']['tmp_name']; $banyak = @$_POST['banyak']; $harga = @$_POST['harga']; $nama_gambar = @$_FILES['gambar']['name']; $jumlah = $harga * $banyak; $mmeja = @$_POST['meja']; $data = array('meja' => $mmeja, 'nama' => $nama, 'noo' => '', 'banyak' => $banyak, 'harga' => $harga, 'total' => $jumlah); $crud->insert('keranjang', $data); header('location:../menu.php');
<?php include "../model/_crud.mysqli.oop.php"; $crud = new CRUD("localhost", "root", "", "restoran"); $nama = @$_POST['nama']; $username = @$_POST['username']; $password = @$_POST['password']; $alamat = @$_POST['alamat']; $telepon = @$_POST['telepon']; $jabatan = @$_POST['jabatan']; $data = array('nama' => $nama, 'username' => $username, 'password' => $password, 'alamat' => $alamat, 'telepon' => $telepon, 'jabatan' => $jabatan); $crud->insert('pegawai', $data); header('location:..admin.php');