0) ? $Size : 25; $First=(!array_key_exists('f', $_GET) || empty($_GET['f'])) ? 1 : only_digits($_GET['f'], 4); $First=(is_numeric($First) && $First>0) ? $First : 1; if ($First > $PayCnt) { $First=max(1,intval($PayCnt / $Size) * $Size + 1); } $hbc_name=hbc_name(); ?> '."\n"; echo ''."\n"; echo ''."\n"; ?>
'."\n"; echo 'Payment List'."\n"; echo ''."\n"; $query='select * from payments order by '; switch ($Order) { case 'aa': $query.='amt, brewer, seq'; break; case 'ad': $query.='amt desc, brewer, seq'; break; case 'ba': $query.='brewer, seq'; break; case 'bd': $query.='brewer desc, seq desc'; break; case 'da': $query.='chg_ts, brewer, seq'; break; case 'dd': $query.='chg_ts desc, brewer, seq'; break; case 'sa': $query.='pay_stat, brewer, seq'; break; case 'sd': $query.='pay_stat desc, brewer, seq'; break; case 'ta': $query.='pay_type, brewer, seq'; break; case 'td': $query.='pay_type desc, brewer, seq'; break; default: $query.='brewer, seq'; } if (!empty($Size) && $Size > 0) { $query.=' limit '.(($First > 1) ? ($First - 1).', ' : '').$Size; } echo ''."\n"; if ($PayCnt == 0) { echo '

'."\n"; echo 'No Payments Found'."\n"; echo '

'."\n"; } else { echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; table_nav ('pay_list.php?k='.$Key.'&o='.$Order, $PayCnt, $First, $Size, 10, TRUE); echo '    '."\n"; echo ''."\n"; echo '
'."\n"; echo 'Brewer Search: '."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; } $pay_res=mysqli_query($db, $query); $Cnt=0; while ($pay_row=mysqli_fetch_assoc($pay_res)) { ++$Cnt; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; } if ($Cnt != 0) { echo '
'."\n"; echo 'Brewer
Number
'."\n"; echo '
'."\n"; echo 'Payment
Number'."\n"; echo '
'."\n"; echo 'Payment
Date
'."\n"; echo '
'."\n"; echo 'Payment
Type
'."\n"; echo '
'."\n"; echo 'Payment
Status
'."\n"; echo '
'."\n"; echo 'Payment
Amount
'."\n"; echo '
'."\n"; echo 'Made By'."\n"; echo ''."\n"; echo 'Action'."\n"; echo '
'."\n"; echo ''.$pay_row['brewer'].''."\n"; echo ''."\n"; echo ''.$pay_row['seq'].''."\n"; echo ''."\n"; echo date('M j, Y g:i A', strtotime($pay_row['chg_ts'])); echo ''."\n"; echo format_paytype($pay_row['pay_type'])."\n"; echo ''."\n"; echo (array_key_exists($pay_row['pay_stat'], $PayStat) ? $PayStat[$pay_row['pay_stat']] : '** '.$pay_row['pay_stat'].' **')."\n"; echo ''."\n"; echo $pay_row['amt']."\n"; echo ''."\n"; $query='select keyval from accts where brewer="'.$pay_row['brewer'].'" and acct_type="B"'; $key_res=mysqli_query($db, $query); $key_row=mysqli_fetch_row($key_res); if ($pay_row['keyval'] == $key_row[0]) { echo 'Brewer'; } else { $query='select name from accts where keyval="'.$pay_row['keyval'].'" and acct_type="A"'; $key_res=mysqli_query($db, $query); if (mysqli_num_rows($key_res) == 0) { echo 'Unknown'; } else { $key_row=mysqli_fetch_row($key_res); echo $key_row[0]; } } echo "\n"; echo ''."\n"; if ($pay_row['pay_stat'] == 'P') { echo 'Accept'."\n"; } else { echo ' '."\n"; } echo ''."\n"; if ($pay_row['pay_type'] == 'CK' && $pay_row['pay_stat'] != 'V') { echo 'Void'."\n"; } elseif ($pay_row['pay_type'] == 'PP' && $pay_row['pay_stat'] != 'C') { echo 'Cancel'."\n"; } else { echo ' '."\n"; } echo '
'."\n"; } if ($Cnt > 10) { echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; table_nav ('pay_list.php?k='.$Key.'&o='.$Order, $PayCnt, $First, $Size, 10, TRUE); echo '    '."\n"; echo ''."\n"; echo '
'."\n"; echo 'Brewer Search: '."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; } ?>