├── css └── style.css ├── database ├── php_fetch_crud_2022-03-09_201959.sql └── table.sql ├── index.php ├── js └── app.js └── php ├── config.php ├── delete-data.php ├── edit-data.php ├── get-total-count.php ├── insert-data.php ├── select-data.php └── update-data.php /css/style.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300&display=swap'); 2 | 3 | *{ 4 | margin: 0px; 5 | padding: 0px; 6 | box-sizing: border-box; 7 | font-family: 'Fredoka', sans-serif; 8 | } 9 | .container-fluid{ 10 | padding: 20px; 11 | background-color: #B53471; 12 | } 13 | .container-fluid .container{ 14 | text-align: center; 15 | color: white; 16 | } 17 | 18 | .container{ 19 | width: 80%; 20 | margin: 0px auto; 21 | } 22 | 23 | .card{ 24 | border: 2px solid #6F1E51; 25 | width: 100%; 26 | padding: 10px 5px; 27 | margin: 20px 0px; 28 | border-radius:10px; 29 | } 30 | .card-body{ 31 | display: flex; 32 | justify-content: space-between; 33 | align-items: center; 34 | } 35 | 36 | .btn{ 37 | outline: none; 38 | border: none; 39 | padding: 10px 15px; 40 | border-radius: 10px; 41 | font-size: 18px; 42 | cursor: pointer; 43 | } 44 | .btn-primary{ 45 | background-color: #0652DD; 46 | color: white; 47 | } 48 | .btn:active{ 49 | transform:scale(.9) 50 | } 51 | 52 | table{ 53 | width: 100%; 54 | border: 2px solid #eee; 55 | border-collapse: collapse; 56 | } 57 | thead tr th{ 58 | border: 2px solid #eee; 59 | padding: 10px !important; 60 | } 61 | tr{ 62 | border: 2px solid #eee; 63 | width: 100%; 64 | text-align: center; 65 | } 66 | tr>td{ 67 | border: 2px solid #eee; 68 | padding: 10px !important; 69 | 70 | } 71 | 72 | .btn-success{ 73 | background-color: #006266; 74 | color: white; 75 | } 76 | .btn-danger{ 77 | background-color: #EA2027; 78 | color: white; 79 | } 80 | .modal{ 81 | position:fixed; 82 | top: 0; 83 | background-color: rgba(0, 0, 0, 0.842); 84 | width: 100%; 85 | height: 100vh; 86 | display:none; 87 | justify-content: center; 88 | align-items:center; 89 | } 90 | .modal-body{ 91 | background-color: white; 92 | width: 50%; 93 | padding: 30px; 94 | border-radius: 10px; 95 | } 96 | .modal-body h3{ 97 | margin-bottom: 30px ; 98 | text-align: center; 99 | } 100 | label{ 101 | margin: 10px 0px; 102 | } 103 | .form-group{ 104 | margin: 20px 0px; 105 | } 106 | .form-control{ 107 | width: 100%; 108 | outline: none; 109 | border: none; 110 | background-color:none; 111 | border-bottom: 1px solid #006266; 112 | padding: 10px 0px; 113 | font-size: 18px; 114 | } 115 | 116 | .buttons{ 117 | display: flex; 118 | justify-content: space-between; 119 | } 120 | 121 | .alerts{ 122 | } 123 | .alert{ 124 | position:fixed; 125 | top: 10px; 126 | right: 20px; 127 | padding: 10px 20px; 128 | border-radius: 10px; 129 | color: white; 130 | font-size: 18px; 131 | } 132 | .alert-success{ 133 | background-color: rgb(31, 192, 31); 134 | display:none; 135 | } 136 | 137 | .alert-danger{ 138 | background-color: rgb(194, 27, 27); 139 | display:none; 140 | } 141 | @media screen and (max-width:700px) { 142 | .table-responsive{ 143 | overflow-x: scroll; 144 | } 145 | } -------------------------------------------------------------------------------- /database/php_fetch_crud_2022-03-09_201959.sql: -------------------------------------------------------------------------------- 1 | /*!40101 SET NAMES utf8 */; 2 | /*!40014 SET FOREIGN_KEY_CHECKS=0 */; 3 | /*!40101 SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 4 | /*!40111 SET SQL_NOTES=0 */; 5 | CREATE DATABASE /*!32312 IF NOT EXISTS*/ php_fetch_crud /*!40100 DEFAULT CHARACTER SET utf8mb4 */; 6 | USE php_fetch_crud; 7 | 8 | -------------------------------------------------------------------------------- /database/table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE students( 2 | id int NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT 'Primary Key', 3 | std_name VARCHAR(255) COMMENT '', 4 | std_age VARCHAR(255) COMMENT '', 5 | std_country VARCHAR(255) COMMENT '' 6 | ) DEFAULT CHARSET UTF8 COMMENT ''; -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 |Id | 39 |Name | 40 |Age | 41 |Country | 42 |Edit | 43 |Delete | 44 |
---|