Repository navigation
Conversation
JS now reads data-restrict-lamination attr set by PHP rather than re-hardcoding paper type IDs. Added temporary console.log for debugging. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Finish option IDs changed with DB reseed (None=8, Laminating=22, not 1 and 2). PHP now identifies lamination by name and stamps data-is-lamination attr. JS reads the attr instead of hardcoding. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
|
||
| ///////Month/////// | ||
| $month_html = "<select class='form-control' name='month'>"; | ||
| $year_html = "<select class='form-select' name='year'>"; |
There was a problem hiding this comment.
It switched "month" to "year" here for some reason, but then continued to use $month_html below even though it's now uninitialized
| } | ||
| ?> | ||
| <a class='btn btn-sm btn-primary' href='<?php echo $_SERVER['PHP_SELF'] . "?year=" . $previous_year; ?>'>Previous Year</a> | ||
| <a class='btn btn-sm btn-primary' href='<?php echo $_SERVER['PHP_SELF'] . "?year=" . $next_year; ?>'>Next Year</a> |
There was a problem hiding this comment.
It removed the functionality where (I think) it's disabling the next button if we're looking at the current year already
| for ($i=$min_year; $i<=date("Y");$i++) { | ||
| if ($i == $year) { $year_html .= "<option value='" . $i . "' selected='true'>" . $i . "</option>"; } | ||
| else { $year_html .= "<option value='" . $i . "'>" . $i . "</option>"; } | ||
| $min_year = max(functions::get_minimal_year($db), date("Y") - 50); // Last 20 years max |
There was a problem hiding this comment.
Comment says 20, but the math is subtracting 50
| if ($i == $year) { $year_html .= "<option value='" . $i . "' selected='true'>" . $i . "</option>"; } | ||
| else { $year_html .= "<option value='" . $i . "'>" . $i . "</option>"; } | ||
| $min_year = max(functions::get_minimal_year($db), date("Y") - 50); // Last 20 years max | ||
| $current_year = date("Y"); |
There was a problem hiding this comment.
$current_year could be moved up a line and used in the $min_year calculation
| } | ||
|
|
||
| // Check if selected paper type is Graphic Matte Canvas (17, 18) or Fine Art Watercolor (7) | ||
| $restrictLamination = in_array($selectedPaperTypeId, [17, 18, 7]); |
There was a problem hiding this comment.
Rather than hard-coding paper type IDs here (and below on line 40), I would add a boolean field to the paper type table to track whether each type allows lamination. That way, we won't have to change the code when adding future paper types, and we're also not relying on certain paper types having certain ID numbers.
|
|
||
| $dataAttr = $isLamination ? " data-is-lamination='true'" : ""; | ||
|
|
||
| if ($isLamination && $restrictLamination) { |
There was a problem hiding this comment.
I'm a little unclear on what these if statements are checking. A couple of them look like they do the same thing. And don't these get overridden by the javascript below that runs on page load anyway?
joerleigh
left a comment
There was a problem hiding this comment.
Overall, I think the bootstrap migration looks fine, apart from the sections I commented on. I mostly suggested minor tweaks except for the database structure change which is a little more involved.
Initial overview to verify Bootstrap migration was successful and did not create any obvious security issues, as this was generated with the Help of AI