include './htmlsortform.php'; include './htmlsearch.php'; //results from dbdata get all function $results = getAllCorpData(); //variables for sort $bysort = filter_input(INPUT_GET, 'sort'); $column2 = filter_input(INPUT_GET, 'column2'); //variables for search form/function $bycolumn = filter_input(INPUT_GET, 'column'); $bysearch = filter_input(INPUT_GET, 'search'); $action = filter_input(INPUT_GET, 'action'); //action determines which form //search and column pertain to action in htmlsearch //if action === search means 'search' form if ($action === 'search') { $results = searchCorps($bycolumn, $bysearch); } //if for $action === 'sort', other page, 'htmlsortform' if ($action === 'sort') { $results = sortCorps($column2, $bysort); } $count = count($results); ?> <table> <thead> <tr> <th>ID</th> <th>Corporation Name</th> <th>Incorporation Date</th>
$results = getAllCorpsData(); // action variable gets input value $action = filter_input(INPUT_GET, 'action'); // if action is sort, returns data from order function using results variable if ($action === 'sort') { $results = orderCorps(); } // if action is search, returns data from search function using results variable if ($action === 'search') { /* Gets search form name from URL * Gets search value from ID in URL * Sets results = results of the search function */ $column = filter_input(INPUT_GET, 'searchColumn'); $search = filter_input(INPUT_GET, 'searchQuery'); $results = searchCorps($column, $search); } ?> <img id="img1" src="images/002.png"/> <!-- creates table header using sql table column names --> <table class="table table-hover"> <thead> <tr> <th>id</th> <th>corp</th> <th>incorp_dt</th> <th>email</th> <th>zipcode</th> <th>owner</th> <th>phone</th>