Ok, so I had envisioned using table to show the flow chart … instead I’m going to just use keywords “goto: some label” like we’re programing in basic. I’ll actually hold off on that one till you guys confirm you’ve done basic too. I’ll just write semi-pseudo code out.
Create a webpage: 1stPage.display.php
Query1: ActionList’s name & id table
Query2: domain table for domain_id(already held in session var) joining with character table’s char_name & char_id (which in my db holds all liutenants and regents)
Show user an html select drop down menu listing ActionList’s Name
Show user an html select drop down menu listing all characters
Submit button is hit, calling 1stPage.commit.php
Check first select actually was set
Check second select actually was set
Query4: All of table ActionList joining CostPlan, TargetType, Target#Determiner, Ratio
Query5 on Target#Determiner query proper table (select statement, ignore details)
Check second var (character) is right class for action
Check is variable T#Determiner_ID greater than 1? (assume yes for now)
Compute: Target#Determiner along with Query5 max number of targets the guy running action can affect
Check Query4’s result for RequiredAtLoc
if no set flag to query6 all targets(based on targetType from query4) in which domain has a holding, ownership of the province or a regent/lieutenant present.
if yes set flag to query6 all targets in province where the regent/lieutenant doing the action is located.
Query6: based on flag load list of all targets in to a multiselect form and display it to users
Submit button is hit, calling 2ndPage.display.php
Display all the targets available in multiselect
Submit button is hit, calling 3rdPage.display.php
Display each target’s name, domain they belong too & a drop down menu counting upto 100 (use a constant so it’s easy to enlarge) so the players can bid regency to increase their chances.
Submit button is hit, calling 3rdPage.commit.php
Check that player can afford the action + bidding of all the extra rp
If yes, create entry in the current domain (listed in session var already) table for pending actions.