1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

My 2020 project

Discussion in 'Programming' started by amusicsite, 30 Jan 2020.

  1. amusicsite

    amusicsite dn ʎɐʍ sᴉɥ┴ Staff Member

    Location:
    UK
    I've decided this year to roll out a little project I've been meaning to do for a while.

    I'm not quite sure what it's final shape will be but concept is a set of tools that can help you quickly and safely build out a suite of tools on an intranet. Or even to knock up a quick demo website.

    I intent to keep a log here of how it develops so here is what I've started with.

    1) Set up an AdminDB database to hold the data and connect to it with root privileges.
    2) Set up a table of databases this allows you to choose which database to grab any data from.
    3) Set up menu builder database. Currently allows multiple menus, nesting menu items.
    4) Set up a forms builder database. Currently this allows you create multiple forms and choose the right options for each data type.

    I did a job over a decade ago to rebuild from scratch a website, CMS, Intranet and Intranet tools for a small business. This project builds on some of the tools and things I developed to make my own life easier.

    So next steps is to build out the admin tools needed to do some basic tasks. Next up will probably add a SiteDB to store info about different sites. Then once the forms and menu systems are up and running, build out the pages and forms needed to firstly create, update and modify any database on the system. Then the tools to modify the menu and form systems.

    Then the idea is you can create a new website, create the database, tables and menus/pages needed within one system that creates uniform working code.

    So, say for instance you want to knock up a simple tool to perform some calculations on some form data. You can make a site, set up the database and forms easily. So you can concentrate on just working on getting the calculations right.

    Anyway, more as the project advances.
     
  2. amusicsite

    amusicsite dn ʎɐʍ sᴉɥ┴ Staff Member

    Location:
    UK
    So far I have mainly been playing around in how to get things working smoothly but I have a semi-working rough outline.

    The next thing I added was a table of SQL strings in the AdminDB. This will hold all the core SQL strings needed.

    Then I have this rough script, that will probably need improving over time, which you can call from any page using

    $QueryID = 8; $VarID=""; include ("sql-get.php");

    The QueryID is which database row to get the string from and the VarID is not filtering that result. e.g. the database would hold "Select * From DB Where x=" then the VarID is added at the end. You can run multiple quires on a page and the results get dumped to an auto incremental variable ${"SQLfromDB" . $qi}

    PHP:
    <?php
    if (!isset($qi)){
        
    $qi 1;
    }
    else
    {
        
    $qi++;
    }
    $GetSQL "SELECT AdminSQL.SQL_String FROM AdminSQL WHERE AdminSQL.SQL_ID = " $QueryID;
    ${
    "BuildSQL" $qi} = $conn->query($GetSQL);
    if (${
    "BuildSQL" $qi}->num_rows 0) {
        while(
    $SQL_Item = ${"BuildSQL" $qi}->fetch_assoc()) {
            ${
    "SQLfromDB" $qi} = $SQL_Item["SQL_String"] . $VarID;
        }
    }
    ?>
    So far I have it working as far as I can add new menu items and SQL strings from the admin. I've set up the basic menu below and the next step is to get the menu, forms and SQL parts so I can add edit and sort all the items.

    - Menus
    -- Add Menu Item (Working)
    -- Edit Menu Items
    - Forms
    -- Edit Form Items
    -- Add Form
    - SQL
    -- Add SQL (Working)
    -- Edit SQL

    Been quite fun playing around with this. Once I have something worthy of a 0.1 label I'll throw it up online somewhere. Still quite a few teaks and optimisation needed before that... As well as getting the core functions working of course.