//db.php
require_once 'login.php';
//args passed in from login.php
$conn = new mysqli($host, $user, $pass, $db);
$conn->connect_error && die('Fatal DB connection error');
//php main section of week18-practice.php
require_once 'week-18-php/db.php';
require_once 'week-18-php/TableBuilder.php';
$result = $conn->query('SELECT * FROM classics');
!result && die("Query failed.");
$fetch_head = array_keys($result->fetch_assoc());
$fetch_rows = $result->fetch_all();
//html + php section of week18-practice.php
<table id="practice_table" class="display">
<thead style="font-weight: bold;">
<*php add_head_row($fetch_head); *>
</thead>
<tbody>
<*php build_rows($fetch_rows); *>
</tbody>
</table>
//TableBuilder.php
//wrapper for add_row, for easy user interface
function add_head_row($row){
echo add_row($row, 'thead');
}
//wrapper for add_row, for easy user interface
function add_body_row($row){
echo add_row($row, 'tbody');
}
//takes in a single 1D row array, optional row type, body by default
function add_row($row, $type = 'tbody'){
echo "" .
array_reduce($row, function($persist, $index){
$t = $type == 'thead' ? ['', ' | '] : ['', ' | '];
return $persist.$t[0].$index.$t[1];
}, '') .
"
";
}
//takes in a 2D array of rows, optional row type, body by default
function get_row_group($rows, $type='tbody'){
echo array_reduce($rows, function($persist, $index){
return $persist.add_row($index, $type);
}, '');
}
Animation Collection Browser Initial Specs
Essentially taking my current collection, which is a mixed of well organized titles, each
with a 'qaulity info - title.txt' file, which holds A/V, series, summary, download source,
and fansub group notes, and a hand selected preview image, and turning it into a searchable,
sortable, filterable, etc. app. Above image is basis for UI (image only, no
code template, etc.).
-Back end:
-Existing Debian + Nginx + MariadbO
-Python + Django or Flask REST API for MySQL queries, file hosting...set up to run well
w/ existing php servers
-Front end:
-functional React w/ hooks for routing, state, etc., create-react-app
-underscore.js ---optional
-See image for layout React
-some tables libary for "detailed view" (react-tables, ag-tables, etc.) ---optional
-fancybox.js lib for lower image thumbs and upper browser viewer ---optional
-Front end v2:
-chart.js (genres compare, most common directors, studios, etc.)
v1 - Basic Release - browser only
--------------------------------
*SEE ATTACHED DESIGN IMAGE
-Upper portion shows details on title. Can change view to show different details/formats.
-Lower portion is browser.
-L menu changes view for browser.
-R menu changes model shown in view (ex. titles, genres, etc.).
-Clicking on genre takes to list of titles in genre, etc..
-Search bar in between top and bottoms. Searched based on whatever is selected on R menu
Back-End Popuplation
--------------------------
1) summary, series info details can be pulled from some web api
2) for media details, see if can automate some media-info pull, which can display in json
inside the app
3) release notes and will have to come from existing .txt files
4) as ALL titles have a 'quality info - tile.txt' file, I could could automate a lot of the
DB population, API queries, etc. for population by using the 'title' string from those
text files for the root model basis.
v2 - User addition
---------------------------------
-Add users. Users can log in. Create request lists. I send them a USB full of files.
-Users can also create: watch, watched, etc lists
-Can keep same SPA layout, by adding list views for user specific lists in lower portion, and
adding 'add' 'remove' functions to titles.