Hello All,
This is a short PHP project, handles only FLAT files. NO Database.
Page 0: Simple menu navigation - a list of links to the programming pages.
Page 1:
=====
Create a page that is updating a flat file.
There are 8 fields in the form that need to be managed:
username <textbox>
password <textbox>
host <textbox>
database_name <textbox>
database_pass <textbox>
license_id <textbox>
client_id <textbox>
ip_number <textbox>
"Save Changes" <button>
These fields are all showing up as variables in a flat text file as follow:
You will see sample data in the "Quotes". These are the values we need to maintain.
my $user="admin_something";
my $pass="somepass@^$!1";
my $host = "localhost";
my $db = "database_name";
my $dbpass = "mydbpass%#q1";
my $licenseID = "123455";
my $client_id = "123456";
my $ip_number = "1.2.3.4";
The variables in the "quotes" need to be updated/modified.
Page 2: This is going to be a busy page - it has 3 parts to it.
The part are NOT dependent on each other, and should be segmented such that
they can be cut/copy/paste to a different page if we want to split the functionality.
=======
Part A:
Default Current-Status behaviour:
At the TOP of the page, we should have TWO radio buttons and Save Button:
"Default Current-Status for New Users" <Enabled> < Disabled> {Save Button}
This should store the value in a flat file (1,0 or Enabled, Disabled).
The value will be loaded upon file open and will display the value in the flat file.
The save button will commit the changes back to the flat file and upon reload it will reflect the change.
Part B:
Table of Users:
When the forms opens, it will load the list of users from the API, then compare each username loaded and see if there is a matching value in a flat file that we will designate. If there is a match in the username it will load the table of users with a checkbox Enabled next to those users with a match.
If there is no match for the username, the username will show up in the table with the checkbox NOT checked.
Technical:
1. It will retrieve the list of users from an API code (provided below a sample of the API, with some debug statements).
2. In the background, It will store FLAGGED userlist/usernames that are pulled from the API call.
The flat file will store only the flagged users.
(we'll have a checkbox for enable/disable option that the flag will indicate its status).
We will have more users retrieved from the API call than users that are FLAGGED.
3. It will list the users in a table that looks like this:
<label-link=Username> <label-link=Current Status> <Label-link=Select>
USERNAME | Current-Status | Checkbox
Current-Status should show the words: "Enabled" in Bold-Green or "Disabled" in Bold-Red
Default value for the Checkbox is empty (unchecked).
<label-link=Username> = Sortable and reverse sort (sort ascending and descending)
<label-link=Current Status> = Sortable and reverse sort (sort ascending and descending)
Below the table, there should be TWO buttons:
"Enable Selected Users" | "Disabled Selected Users"
The <Clickable Label=Select> is a toggle for "Select All" and "Deselect All".
Based on the checked/selected checkbox they should change their "Current-Status".
The Current-Status is the flag that will be stored in the flat file.
===
The sample API code is attached to this project.
===
Part C:
In this section we will use an Append to EOF with \n for each entry.
<label =Quick Allow IP> <Text box field> {Save Button}
This will append to a flat file a list of IPs that will entered into the text box.
<label=Edit Allowed IP List> {Edit Button}
Once you click on the {Edit Button} you should open page 3.
The text box should receive text and enter it >> append >> into an "[login to view URL]" file.
PAGE 3:
===
In this page show a {Text Area} that is will show the content of "[login to view URL]" file.
<button=Save Changes> and <button=Cancel> hould be at the bottom of the text area .
Ask any question on PMs.
Budget $50-$100.
Good Luck.
I got lost in the middle of your explanations, but I'm confident I can do this. There are three ways to do this without a database (1) text file + regex and string parsing, (2) text file + Tokenizer Functions, (3) SQLite + usual sql queries. If there is a reason you do not want to use SQLite (still a flat file but also a database), then using tokenizer is more robust, but method one could also deliver the functionality.