├── rich-editor ├── koneksi.php~ ├── koneksi.php ├── save.php~ ├── save.php ├── view.php ├── view.php~ ├── detail.php ├── detail.php~ ├── index.php ├── index.php~ ├── article.sql └── dist │ ├── summernote.css │ └── summernote.min.js ├── README.md ├── oop ├── config │ └── config.ini ├── proccess │ ├── logout.php │ ├── delete.php │ └── processUser.php ├── class │ ├── getConfig.php │ ├── Factory.php │ ├── dbConnect.php │ ├── dbConnect.php~ │ ├── userAccount.php~ │ ├── userAccount.php │ ├── Iterator.php~ │ ├── Iterator.php │ ├── pagination.php │ ├── pagination.php~ │ ├── db.php~ │ └── db.php ├── view │ ├── login.php │ ├── add_user_view.php │ └── admin.php ├── index.php └── tes (1).sql └── pdo-search ├── connection.php ├── connection.php~ ├── style.css ├── style.css~ ├── index.php └── index.php~ /rich-editor/koneksi.php~: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #Collection of PDO examples 2 | -------------------------------------------------------------------------------- /oop/config/config.ini: -------------------------------------------------------------------------------- 1 | ;konfigurasi database 2 | 3 | dbdns = "mysql:host=localhost;dbname=test" 4 | dbuser = "root" 5 | dbpass = "" 6 | -------------------------------------------------------------------------------- /oop/proccess/logout.php: -------------------------------------------------------------------------------- 1 | userLogout(); 9 | 10 | -------------------------------------------------------------------------------- /oop/proccess/delete.php: -------------------------------------------------------------------------------- 1 | deleteUser(array('nim'=>$nim)); -------------------------------------------------------------------------------- /rich-editor/koneksi.php: -------------------------------------------------------------------------------- 1 | PDO::ERRMODE_EXCEPTION 9 | )); 10 | -------------------------------------------------------------------------------- /pdo-search/connection.php: -------------------------------------------------------------------------------- 1 | PDO::ERRMODE_EXCEPTION 10 | )); 11 | -------------------------------------------------------------------------------- /pdo-search/connection.php~: -------------------------------------------------------------------------------- 1 | PDO::ERRMODE_EXCEPTION 10 | )); 11 | -------------------------------------------------------------------------------- /rich-editor/save.php~: -------------------------------------------------------------------------------- 1 | prepare("INSERT INTO article (title,content) VALUES (:title,:content)"); 4 | $stmt->bindParam(':title', $title); 5 | $stmt->bindParam(':content', $content); 6 | 7 | // insert one row 8 | $title = $_POST['title']; 9 | $content = $_POST['content']; 10 | if($stmt->execute()) 11 | header("Location:index.php"); 12 | 13 | -------------------------------------------------------------------------------- /rich-editor/save.php: -------------------------------------------------------------------------------- 1 | prepare("INSERT INTO article (title,content) VALUES (:title,:content)"); 5 | $stmt->bindParam(':title', $title); 6 | $stmt->bindParam(':content', $content); 7 | 8 | // insert one row 9 | $title = $_POST['title']; 10 | $content = $_POST['content']; 11 | if($stmt->execute()) 12 | header("Location:index.php"); 13 | 14 | -------------------------------------------------------------------------------- /pdo-search/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | 3 | background:#f8f9fa; 4 | width:99%; 5 | } 6 | 7 | .form{ 8 | 9 | padding:30px; 10 | border:1px solid #eee; 11 | background:#fff; 12 | margin-left:30%; 13 | width:500px; 14 | height:300px; 15 | } 16 | h2{text-align:center;margin-bottom:30px;color:#ff3c1f} 17 | input,button {height:30px} 18 | 19 | table{border-collapse:collapse;width:100%;border:1px solid #ddd} 20 | table tr td,table tr th{height:30px;padding:5px} 21 | .footer{text-align:center;} 22 | -------------------------------------------------------------------------------- /pdo-search/style.css~: -------------------------------------------------------------------------------- 1 | body{ 2 | 3 | background:#f8f9fa; 4 | width:99%; 5 | } 6 | 7 | .form{ 8 | 9 | padding:30px; 10 | border:1px solid #eee; 11 | background:#fff; 12 | margin-left:30%; 13 | width:500px; 14 | height:300px; 15 | } 16 | h2{text-align:center;margin-bottom:30px;color:#ff3c1f} 17 | input,button {height:30px} 18 | 19 | table{border-collapse:collapse;width:100%;border:1px solid #ddd} 20 | table tr td,table tr th{height:30px;padding:10px} 21 | .footer{text-align:center;} 22 | -------------------------------------------------------------------------------- /oop/proccess/processUser.php: -------------------------------------------------------------------------------- 1 | $_POST['nim'], 6 | 'nama' => $_POST['nama'], 7 | 'alamat' => $_POST['alamat'], 8 | ); 9 | $mode = $_POST['mode']; 10 | include_once '../class/userAccount.php'; 11 | 12 | $user = new UserAccount(); 13 | 14 | if($mode =='new'): 15 | $user->addUser($data); 16 | else: 17 | $id = $_POST['id']; 18 | $user->saveEditUser($data,$id); 19 | endif; 20 | //header('Location:home.php'); 21 | 22 | -------------------------------------------------------------------------------- /rich-editor/view.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT * FROM article"); 6 | $query->execute(); 7 | if($query->rowCount() > 0 ){ 8 | 9 | $no=1; 10 | while ($r = $query->fetch()) { 11 | 12 | echo '