├── .gitignore ├── Lecture1 ├── README.md ├── all_in_one.sql ├── footer.php ├── header.php ├── index.php ├── login.php ├── logout.php ├── mytasks.php ├── newtask.php ├── note.php └── registration.php ├── Lecture2 ├── README.md ├── category.html ├── category.php ├── note_item.php └── restful_api.php ├── Lecture3 ├── README.md ├── connection.php ├── controllers │ ├── items_controller.php │ └── pages_controller.php ├── index.php ├── models │ ├── items.php │ └── pages.php ├── routes.php └── views │ ├── items │ ├── item.php │ ├── item_add.php │ ├── item_add_ok.php │ ├── item_update_ok.php │ └── items.php │ ├── layout.php │ └── pages │ ├── error.php │ └── home.php ├── Lecture4 ├── .gitignore ├── README.md ├── about.html ├── contact.html ├── display_name.js ├── hello.js ├── hello_files.js ├── hello_static.js ├── listneremitter.js ├── package-lock.json ├── package.json ├── read_file.js ├── readstream.js ├── testfile.txt └── timeout_callback.js ├── Lecture5 ├── .gitignore ├── README.md ├── app.js ├── bin │ └── www ├── controllers │ ├── NoteCategoryController.js │ ├── NoteItemController.js │ └── UserController.js ├── dbdata.js ├── models │ ├── NoteCategoryModel.js │ ├── NoteItemModel.js │ └── UserModel.js ├── package-lock.json ├── package.json ├── public │ └── stylesheets │ │ └── style.css ├── routes │ ├── NoteCategoryRoutes.js │ ├── NoteItemRoutes.js │ ├── UserRoutes.js │ └── index.js └── views │ ├── error.hbs │ ├── index.hbs │ ├── layout.hbs │ ├── noteItems │ ├── list.hbs │ └── newNote.hbs │ ├── partials │ ├── footer.hbs │ └── header.hbs │ └── user │ ├── list.hbs │ ├── login.hbs │ ├── profile.hbs │ └── register.hbs ├── Lecture6 ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── components │ ├── about.js │ ├── home.js │ ├── items-alt.js │ └── items.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── serviceWorker.js │ └── setupTests.js ├── Lecture9 └── ReactRedux │ ├── .gitignore │ ├── README.md │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt │ └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── components │ ├── about.js │ ├── footer.js │ ├── header.js │ ├── home.js │ ├── item-add.js │ ├── item-change.js │ ├── items-all.js │ ├── items-done.js │ ├── items-todo.js │ ├── login.js │ ├── nav-menu.js │ ├── profile.js │ └── register.js │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── redux │ ├── slices │ │ ├── authSlice.js │ │ ├── itemsSlice.js │ │ ├── sidebarSlice.js │ │ └── userSlice.js │ └── store.js │ ├── serviceWorker.js │ └── setupTests.js └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | temp/ 2 | .idea -------------------------------------------------------------------------------- /Lecture1/README.md: -------------------------------------------------------------------------------- 1 | # Lecture 1 2 | A simple PHP application Notes, where we write down tasks that we need to do in the future. User can In this example, the following topics are covered: 3 | 1. registration 4 | 2. login 5 | 3. cookies 6 | 4. sessions 7 | 5. HTTP post 8 | 6. HTML forms 9 | 7. Databases 10 | 8. Connection to DB 11 | 12 | # Tools used 13 | 1. WAMP 14 | 2. MyPhpAdmin 15 | 3. MariaDB 16 | 4. PHP Storm 17 | -------------------------------------------------------------------------------- /Lecture1/all_in_one.sql: -------------------------------------------------------------------------------- 1 | create database notes_schema; 2 | 3 | CREATE TABLE notes_schema.user ( 4 | user_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, 5 | name VARCHAR(255) DEFAULT '', 6 | username VARCHAR(100) NOT NULL, 7 | password VARCHAR(100) NOT NULL 8 | ); 9 | 10 | CREATE TABLE notes_schema.note_item ( 11 | item_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, 12 | name VARCHAR(255) DEFAULT '' 13 | ); 14 | 15 | CREATE TABLE notes_schema.note_category ( 16 | category_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, 17 | name VARCHAR(255) DEFAULT '' 18 | ); 19 | 20 | 21 | CREATE TABLE notes_schema.note ( 22 | task_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, 23 | user_id INT NOT NULL , 24 | category_id INT NOT NULL , 25 | item_id INT NOT NULL , 26 | FOREIGN KEY (user_id) REFERENCES notes_schema.user(user_id), 27 | FOREIGN KEY (category_id) REFERENCES notes_schema.note_category(category_id), 28 | FOREIGN KEY (item_id) REFERENCES notes_schema.note_item(item_id) 29 | ); 30 | 31 | ALTER TABLE notes_schema.note 32 | ADD COLUMN done TINYINT DEFAULT '0' AFTER item_id; 33 | 34 | 35 | INSERT INTO notes_schema.user (name, username, password) VALUES ('Tomaz', 'tomazk', SHA1('12345678')); 36 | INSERT INTO notes_schema.user (name, username, password) VALUES ('Sandi', 'sandim', SHA1('87654321')); 37 | INSERT INTO notes_schema.user (name, username, password) VALUES ('Mario', 'marioc', SHA1('11111111')); 38 | 39 | 40 | INSERT INTO notes_schema.note_item (name) VALUES ('Pedagoske obremenitve'); 41 | INSERT INTO notes_schema.note_item (name) VALUES ('Vpis ocen zagovorov vaj DSMJ'); 42 | INSERT INTO notes_schema.note_item (name) VALUES ('Priprava nalog za tekmovanje Pisek'); 43 | INSERT INTO notes_schema.note_item (name) VALUES ('Kupi pnevmatike'); 44 | INSERT INTO notes_schema.note_item (name) VALUES ('Vadi MAT z Ajdo za test'); 45 | INSERT INTO notes_schema.note_item (name) VALUES ('Priprava prosojnic Kotlin'); 46 | 47 | 48 | INSERT INTO notes_schema.note_category (name) VALUES ('Sluzba'); 49 | INSERT INTO notes_schema.note_category (name) VALUES ('Doma'); 50 | INSERT INTO notes_schema.note_category (name) VALUES ('Nakup'); 51 | 52 | 53 | INSERT INTO notes_schema.note (user_id, category_id, item_id, done) VALUES ('1', '1', '1', '0'); 54 | INSERT INTO notes_schema.note (user_id, category_id, item_id, done) VALUES ('1', '1', '2', '0'); 55 | INSERT INTO notes_schema.note (user_id, category_id, item_id, done) VALUES ('2', '1', '3', '1'); 56 | INSERT INTO notes_schema.note (user_id, category_id, item_id, done) VALUES ('1', '2', '4', '0'); 57 | INSERT INTO notes_schema.note (user_id, category_id, item_id, done) VALUES ('1', '2', '5', '0'); 58 | INSERT INTO notes_schema.note (user_id, category_id, item_id, done) VALUES ('1', '1', '6', '0'); -------------------------------------------------------------------------------- /Lecture1/footer.php: -------------------------------------------------------------------------------- 1 |