Commit fcfdcce0 by Amsal Situmorang

horass

parent 8d1e7065
<?php
//Mendapatkan Nilai ID
$id = $_GET['id'];
//Import File Koneksi Database
require_once('koneksi.php');
//Membuat SQL Query
$sql = "DELETE FROM resep WHERE id_resep=$id;";
//Menghapus Nilai pada Database
if(mysqli_query($con,$sql)){
echo 'Berhasil Menghapus Resep';
}else{
echo 'Gagal Menghapus Resep';
}
mysqli_close($con);
?>
\ No newline at end of file
<?php
define('HOST','127.0.0.1');
define('USER','root');
define('PASS','');
define('DB','pos_resto');
//membuat koneksi dengan database
$con = mysqli_connect(HOST,USER,PASS,DB) or die('Unable to Connect');
?>
\ No newline at end of file
<?php
if($_SERVER['REQUEST_METHOD']=='POST'){
//Mendapatkan Nilai Variable
$nama = $_POST['nama'];
$bahan = $_POST['bahan'];
$deskripsi = $_POST['deskripsi'];
//Pembuatan Syntax SQL
$sql = "INSERT INTO resep (nama,bahan,deskripsi) VALUES ('$nama','$bahan','$deskripsi')";
//Import File Koneksi database
require_once('koneksi.php');
//Eksekusi Query database
if(mysqli_query($con,$sql)){
echo 'Berhasil Menambahkan Resep';
}else{
echo 'Gagal Menambahkan Resep';
}
mysqli_close($con);
}
?>
\ No newline at end of file
<?php
//Mendapatkan Nilai Dari Variable ID Pegawai yang ingin ditampilkan
$id = $_GET['id'];
//Importing database
require_once('koneksi.php');
//Membuat SQL Query dengan pegawai yang ditentukan secara spesifik sesuai ID
$sql = "SELECT * FROM resep WHERE id_resep=$id";
//Mendapatkan Hasil
$r = mysqli_query($con,$sql);
//Memasukkan Hasil Kedalam Array
$result = array();
$row = mysqli_fetch_array($r);
array_push($result,array(
"id_resep"=>$row['id_resep'],
"nama"=>$row['nama'],
"bahan"=>$row['bahan'],
"deskripsi"=>$row['deskripsi']
));
//Menampilkan dalam format JSON
echo json_encode(array('result'=>$result));
mysqli_close($con);
?>
\ No newline at end of file
<?php
require_once('koneksi.php');
//Membuat SQL Query
$sql = "SELECT * FROM resep";
//Mendapatkan Hasil
$r = mysqli_query($con,$sql);
//Membuat Array Kosong
$result = array();
while($row = mysqli_fetch_array($r)){
//Memasukkan Nama dan ID kedalam Array Kosong yang telah dibuat
array_push($result,array(
"id_resep"=>$row['id_resep'],
"nama"=>$row['nama']
));
}
//Menampilkan Array dalam Format JSON
echo json_encode(array('result'=>$result));
mysqli_close($con);
?>
\ No newline at end of file
<?php
if($_SERVER['REQUEST_METHOD']=='POST'){
//MEndapatkan Nilai Dari Variable
$id = $_POST['id_resep'];
$nama = $_POST['nama'];
$bahan = $_POST['bahan'];
$deskripsi = $_POST['deskripsi'];
//import file koneksi database
require_once('koneksi.php');
//Membuat SQL Query
$sql = "UPDATE resep SET nama = '$nama', bahan = '$bahan', deskripsi = '$deskripsi' WHERE id_resep = $id;";
//Meng-update Database
if(mysqli_query($con,$sql)){
echo 'Berhasil Update Data Resep';
}else{
echo 'Gagal Update Data Resep';
}
mysqli_close($con);
}
?>
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
<?php
define('HOST','127.0.0.1');
define('USER','root');
define('PASS','');
define('DB','pos_resto');
//membuat koneksi dengan database
$con = mysqli_connect(HOST,USER,PASS,DB) or die('Unable to Connect');
?>
\ No newline at end of file
<?php
//Mendapatkan Nilai ID
$id = $_GET['id'];
//Import File Koneksi Database
require_once('koneksi.php');
//Membuat SQL Query
$sql = "DELETE FROM promo WHERE id_promo=$id;";
//Menghapus Nilai pada Database
if(mysqli_query($con,$sql)){
echo 'Berhasil Menghapus Promo';
}else{
echo 'Gagal Menghapus Promo';
}
mysqli_close($con);
?>
\ No newline at end of file
<?php
require_once 'koneksi.php';
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$nama = $_POST['nama'];
$deskripsi = $_POST['deskripsi'];
$tglAwal = $_POST['tanggal_awal'];
$tglAkhir = $_POST['tanggal_akhir'];
$query = "INSERT INTO promo(nama, deskripsi , tanggal_awal , tanggal_akhir) VALUES ('$nama' , '$deskripsi', '$tglAwal', '$tglAkhir')";
$exeQuery = mysqli_query($con, $query);
echo ($exeQuery) ? json_encode(array('kode' =>1, 'pesan' => 'berhasil menambahkan data')) : json_encode(array('kode' =>2, 'pesan' => 'data gagal ditambahkan'));
}
else
{
echo json_encode(array('kode' =>101, 'pesan' => 'request tidak valid'));
}
?>
\ No newline at end of file
<?php
define('HOST','127.0.0.1');
define('USER','root');
define('PASS','');
define('DB','pos_resto');
//membuat koneksi dengan database
$con = mysqli_connect(HOST,USER,PASS,DB) or die('Unable to Connect');
?>
\ No newline at end of file
<?php
require_once 'koneksi.php';
$query = "SELECT * FROM promo ORDER BY id_promo desc";
$result = mysqli_query($con,$query);
$array = array();
while ($row = mysqli_fetch_assoc($result))
{
$array[] = $row;
}
echo ($result) ?
json_encode(array("kode" => 1, "result"=>$array)) :
json_encode(array("kode" => 0, "pesan"=>"data tidak ditemukan"));
?>
<?php
if($_SERVER['REQUEST_METHOD']=='POST'){
//MEndapatkan Nilai Dari Variable
$id_promo = $_POST['id_promo'];
$nama = $_POST['nama'];
$deskripsi = $_POST['deskripsi'];
$tglAwal = $_POST['tanggal_awal'];
$tglAkhir = $_POST['tanggal_akhir'];
//import file koneksi database
require_once('koneksi.php');
//Membuat SQL Query
$sql = "UPDATE promo SET nama = '$nama', deskripsi = '$deskripsi', tanggal_awal = '$tglAwal' , tanggal_akhir = '$tglAkhir' WHERE id_promo=$id_promo;";
//Meng-update Database
if(mysqli_query($con,$sql)){
echo 'Berhasil Update Data Promo';
}else{
echo 'Gagal Update Data Promo';
}
mysqli_close($con);
}
?>
\ No newline at end of file
<?php
//Mendapatkan Nilai Dari Variable ID Pegawai yang ingin ditampilkan
$id = $_GET['id'];
//Importing database
require_once('koneksi.php');
//Membuat SQL Query dengan pegawai yang ditentukan secara spesifik sesuai ID
$sql = "SELECT * FROM promo WHERE id_promo=$id";
//Mendapatkan Hasil
$r = mysqli_query($con,$sql);
//Memasukkan Hasil Kedalam Array
$result = array();
$row = mysqli_fetch_array($r);
array_push($result,array(
"id_promo"=>$row['id_promo'],
"nama"=>$row['nama'],
"deskripsi"=>$row['deskripsi'],
"tanggal_awal"=>$row['tanggal_awal'],
"tanggal_akhir"=>$row['tanggal_akhir']
));
//Menampilkan dalam format JSON
echo json_encode(array('result'=>$result));
mysqli_close($con);
?>
\ No newline at end of file
<?php
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'pos_resto');
?>
\ No newline at end of file
<?php
require_once 'koneksi.php';
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$id_resep = $_POST['id_resep'];
$query = "DELETE FROM resep WHERE id_resep ='$id_resep'";
$exeQuery = mysqli_query($konek, $query);
echo ($exeQuery) ? json_encode(array('kode' =>1, 'pesan' => 'berhasil Menghapus data')) : json_encode(array('kode' =>2, 'pesan' => 'data gagal dihapus'));
}
else
{
echo json_encode(array('kode' =>101, 'pesan' => 'request tidak valid'));
}
?>
\ No newline at end of file
<?php
require_once 'koneksi.php';
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$nama = $_POST['nama'];
$bahan = $_POST['bahan'];
$deskripsi = $_POST['deskripsi'];
$query = "INSERT INTO resep (nama, bahan, deskripsi) VALUES ('$nama','$bahan' , '$deskripsi')";
$exeQuery = mysqli_query($konek, $query);
echo ($exeQuery) ? json_encode(array('kode' =>1, 'pesan' => 'berhasil menambahkan data')) : json_encode(array('kode' =>2, 'pesan' => 'data gagal ditambahkan'));
}
else
{
echo json_encode(array('kode' =>101, 'pesan' => 'request tidak valid'));
}
?>
\ No newline at end of file
<?php
include 'config.php';
$konek = new Mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die(Mysqli_errno());
?>
\ No newline at end of file
<?php
require_once 'koneksi.php';
$query = "SELECT * FROM makanan ORDER BY nama";
$result = mysqli_query($konek,$query);
$array = array();
while ($row = mysqli_fetch_assoc($result))
{
$array[] = $row;
}
echo ($result) ?
json_encode(array("kode" => 1, "result"=>$array)) :
json_encode(array("kode" => 0, "pesan"=>"data tidak ditemukan"));
?>
\ No newline at end of file
<?php
require_once 'koneksi.php';
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$id_resep = $_POST['id_makanan'];
$nama = $_POST['nama'];
$bahan = $_POST['bahan'];
$deskripsi = $_POST['deskripsi'];
$query = "UPDATE resep SET nama = '$nama',bahan = '$bahan', deskripsi = '$deskripsi' WHERE id_resep='$id_resep";
$exeQuery = mysqli_query($konek, $query);
echo ($exeQuery) ? json_encode(array('kode' =>1, 'pesan' => 'data berhasil update')) : json_encode(array('kode' =>2, 'pesan' => 'data gagal diupdate'));
}
else
{
echo json_encode(array('kode' =>101, 'pesan' => 'request tidak valid'));
}
?>
\ No newline at end of file
<?php
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'pos_resto');
?>
\ No newline at end of file
<?php
require_once 'koneksi.php';
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$tanggal = $_POST['tanggal'];
$total = $_POST['total'];
$query = "INSERT INTO transaksi (tanggal, total) VALUES ('$tanggal','$total')";
$exeQuery = mysqli_query($konek, $query);
echo ($exeQuery) ? json_encode(array('kode' =>1, 'pesan' => 'berhasil menambahkan data')) : json_encode(array('kode' =>2, 'pesan' => 'data gagal ditambahkan'));
}
else
{
echo json_encode(array('kode' =>101, 'pesan' => 'request tidak valid'));
}
?>
\ No newline at end of file
<?php
include 'config.php';
$konek = new Mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die(Mysqli_errno());
?>
\ No newline at end of file
<?php
require_once 'koneksi.php';
$query = "SELECT * FROM transaksi ORDER BY tanggal";
$result = mysqli_query($konek,$query);
$array = array();
while ($row = mysqli_fetch_assoc($result))
{
$array[] = $row;
}
echo ($result) ?
json_encode(array("kode" => 1, "result"=>$array)) :
json_encode(array("kode" => 0, "pesan"=>"data tidak ditemukan"));
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment