This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'conn.php'; | |
if(isset($_POST['submit'])){ | |
$karyawan =R::dispense('karyawan'); | |
$karyawan->nama =$_POST['nama']; | |
$karyawan->email=$_POST['email']; | |
$save =R::store($karyawan); | |
if($save){ | |
echo 'sukses'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php require_once 'conn.php'; | |
if(isset($_GET['id'])){ | |
$id=$_GET['id']; | |
}else{ | |
header('Location:./'); | |
} | |
$karyawan=R::load('karyawan',$id); | |
$delete=R::trash($karyawan); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php require_once 'conn.php'; | |
if(isset($_GET['id'])){ | |
$id=$_GET['id']; | |
}else{ | |
header('Location:./'); | |
} | |
if(isset($_POST['submit'])){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php require_once 'conn.php'; | |
$karyawan=R::find('karyawan'); | |
?> | |
<!DOCTYPE html> | |
<html> | |
<table border="1"> | |
<thead> | |
<th>#</th> | |
<th>Nama</th> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php require_once 'conn.php'; | |
$karyawan=R::load('karyawan','1'); // Baris ini menyatakan load karyawan yang memiliki id 1 | |
$delete=R::trash($karyawan); // Kemudian buang (data) karyawannya | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php require_once 'conn.php'; | |
$karyawan=R::load('karyawan','1'); | |
$karyawan->nama='Joko Susilo'; | |
R::store($karyawan); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php require_once 'conn.php'; | |
$karyawan=R::find('karyawan'); | |
?> | |
<!DOCTYPE html> | |
<html> | |
<table border="1"> | |
<thead> | |
<th>#</th> | |
<th>Nama</th> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php require_once 'conn.php'; | |
/* | |
Sedikit menambahkan kriteria, sehingga perintah menjadi | |
select * from karyawan where nama like "%ardha%" | |
*/ | |
$karyawan=R::find('karyawan','nama LIKE "%ardha%"'); | |
foreach ($karyawan as $result) { | |
echo $result->nama.'<br/>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php require_once 'conn.php'; | |
$karyawan=R::find('karyawan'); // Perintah ini seperti select * from karyawan | |
foreach ($karyawan as $result) { | |
echo $result->nama.' - '.$result->email.'<br/>'; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'conn.php'; | |
if(isset($_POST['submit'])){ | |
$karyawan =R::dispense('karyawan'); | |
$karyawan->nama =$_POST['nama']; | |
$karyawan->email=$_POST['email']; | |
$save =R::store($karyawan); | |
if($save){ | |
echo 'sukses'; |
NewerOlder