torbengb / toolpool Goto Github PK
View Code? Open in Web Editor NEWThis is a prototype of a community platform for people to share their tools for DIY home-improvement projects.
License: MIT License
This is a prototype of a community platform for people to share their tools for DIY home-improvement projects.
License: MIT License
It should not even be possible to see this page without being logged in.
The [loan] button on "/users/view.php?id=" does not do anything.
move button 'delete' to page 'edit' with target="list.php" and let code remain in list page.
It should not even be possible to see this page without being logged in?
stop using "try ... catch" operators,
see https://phpdelusions.net/top#try_catch
Catching an exception only to report it is a sure overkill. Simply because uncaught exception is a fatal error already, and it will be reported by itself. Without that blunt try/catch/die sequence, making your code much cleaner.
and https://phpdelusions.net/pdo_examples/insert
Important! You don't have to check the result of execute() (as it is often shown in low-quality tutorials). Such a condition will make no sense, as in case of error, a PDOException will be thrown and the script execution will be terminated, which means such a condition will never reach the else part.
Neither a try ... catch operator should be used, unless you have a specific scenario to handle the error, such as a transaction rollback shown below. Please see the article about error reporting for the details.
Safe password hashing
https://www.php.net/manual/en/faq.passwords.php
Naitive php api
https://www.php.net/manual/en/book.password.php
concrete examples
https://alexwebdevelop.com/php-password-hashing/
/tools/new.php
When adding a new item:
Integer '1' can be used to indicate '(not specified)', but I can even enter an integer '123456' that is definitely not an existing ID in the taxonomy table.
/tools/view.php?id=7
I see the details of the tool, but there is no 'edit' link even when I am the owner of the item.
To actually edit a tool, I need to go to
/profile/tools.php
and then click the edit link there.
Copy that link into the tool detail screen.
TODO: Looks like the two sets of start+end dates don't have any value set.
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value: '' for column 'agreedstart' at row 1
Obviously a necessary step. (But I need to learn to walk before I can run.)
Laravel seems to be the most sensible choice, not necessarily the easiest but by far most used.
Example commentary: https://athemes.com/collections/best-php-frameworks/
and other formalia
The umlaut characters are wrong.
This is especially seen in the taxonomy.
Perhaps the umlauts are bad in the source files, or the database isn't UTF-8?
that was hardcoded as '12' during initial development.
We don't want to delete the record, just mark it active=0.
The UPDATE should be preceeded by a SELECT so that existing values can be re-inserted into the UPDATE.
toolpool .com is taken, obviously. Find a different name?
alternative TLD's:
.club .community .fun .live .loan .network .one .site .tools .zone
DB values hae weird characters instead of the expected umlauts.
need to revise INIT INSERT SQL statements so they begin from 1, not from 0.
Need to revise code to match this change.
Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5 in /home/toolpool_test/domains/toolpool.club/test/tools/view.php:171 Stack trace: #0 /home/toolpool_test/domains/toolpool.club/test/tools/view.php(171): PDOStatement->execute() #1 {main} thrown in /home/toolpool_test/domains/toolpool.club/test/tools/view.php on line 171
because region is important for Tool Pool to determine the user's neighborhood, it cannot be left blank.
Currently, 'status' is just a BOOL in LOANS that tells that a given loan is active (not returned yet).
Need to change this:
Tool itself needs a (redundant?) status [AVAILABLE | LOANED] to indicate whether it's free to loan.
If the tool status is AVAILABLE then show the LOAN button.
If the tool status is LOANED then show the RESERVE button (waiting list). Perhaps give an indication like MAX(agreedend)?
Action LOAN sets the tool status to LOANED, then creates an entry in table LOANS.
Action RESERVE creates an entry in table LOANS (#TODO later: the owner should be notified).
Action RETURN ends the current loan, then checks for any reservations and picks the one with MIN(agreedstart), then sets that loan to status ACTIVE (#TODO later: the new lender should be notified). If no next loan then set tool status to AVAILABLE.
The "About" link goes to Github README.md which is not aimed at end-users.
Link to new, better text instead.
Similar to issue #10, the user registration form has a region
dropdown that should only list regions of the selected country.
CREATE DATABASE `foo` DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
CREATE TABLE `bar` (
`baz` int NOT NULL AUTO_INCREMENT
PRIMARY KEY (`id`)
) DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
DH won't let me run the first statement.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.