<?php require "../settings.php"; if (isset($_POST["key"])) { switch ($_POST["key"]) { case "search": $OUTPUT = show_runs($_POST); break; default: $OUTPUT = get_runs(); } } else { $OUTPUT = get_runs(); } $OUTPUT .= "<br>" . mkQuickLinks(ql("../supp-payment-run.php", "Creditor Payment Run"), ql("supp-payment-list.php", "Creditor Payment Run Listing")); require "../template.php"; function get_runs() { $display = "\n\t\t<h2>View Credit Runs</h2>\n\t\t<table " . TMPL_tblDflts . ">\n\t\t<form action='" . SELF . "' method='POST'>\n\t\t\t<input type='hidden' name='key' value='search'>\n\t\t\t<tr>\n\t\t\t\t<th>By Date Range</th>\n\t\t\t</tr>\n\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t<td>" . mkDateSelect("from", date("Y"), date("m"), "01") . " To " . mkDateSelect("to") . " <input type='submit' value='Search'></td>\n\t\t\t</tr>\n\t\t</form>\n\t\t</table>"; return $display; } function show_runs($_POST) { extract($_POST); $from_date = "{$from_year}-{$from_month}-{$from_day}"; $to_date = "{$to_year}-{$to_month}-{$to_day}"; db_conn('contract'); $get_dist = "SELECT distinct(run_id) FROM credit_runs"; $run_dist = db_exec($get_dist) or errDie("Unable to get creditor run information."); if (pg_numrows($run_dist) < 1) { return "<li class='err'>No Previous Creditor Runs Found.</li>";
echo "<center><h2> Update a run - {$num} runs were found</h2>"; echo "<table border=1>"; echo "<tr><td><b>Run Number</td><td><b>Date</td><td><b>Hares</td><td><b>Location</td></tr>"; while ($row = mysql_fetch_assoc($result)) { $run_num = "{$row['run_number']}"; $run_date = "{$row['run_date']}"; $hares = "{$row['hares']}"; $location = "{$row['location']}"; echo "<tr><td><A href='edit_run.php?run={$run_num}'>{$run_num}</a></td><td>{$run_date}</td><td>{$hares}</td><td>{$location}</td></tr>"; } echo "</table>"; } } function get_run_search_criteria() { print '<center><h2>Update run</h2></center><p>'; print '<form method="POST" action="update_run.php">'; print '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=3>'; print '<TR><TD VALIGN=TOP>Run Number: </td><TD VALIGN=TOP><INPUT NAME="run_number" TYPE=TEXT SIZE=8 MAXLENGTH=8></td></tr>'; print '<TR><TD VALIGN=TOP>Date: </td><TD VALIGN=TOP><INPUT NAME="run_date" TYPE=TEXT SIZE=12 MAXLENGTH=12></td></tr>'; print '<TR><TD VALIGN=TOP>Hares: </td><TD VALIGN=TOP><INPUT NAME="hares" TYPE=TEXT SIZE=40 MAXLENGTH=40></td></tr>'; print '</TABLE>'; print '<INPUT TYPE=RESET VALUE="clear"> <INPUT TYPE=SUBMIT name="submit" VALUE="find">'; print '</FORM>'; } if (empty($_REQUEST['submit'])) { get_run_search_criteria(); } else { show_runs(); } include 'sfh3_footer.html';