array(1, 2, 3)); $Len=array('AMOUNT' => 8); foreach ($Len as $tag => $maxlen) { ${$tag}=(!array_key_exists($tag, $_POST)|| empty($_POST[$tag])) ? '' : chk_str($_POST[$tag], $maxlen); } foreach ($Active as $tag => $tag_val) { foreach ($tag_val as $ecnt) { $etag=$tag.'_'.$ecnt; $e_tags[$etag]=(!array_key_exists($etag, $_POST) || empty($_POST[$etag])) ? FALSE : TRUE; } } } $PayTo=get_ctrl('PAYTO'); $PP_ACCEPT=get_ctrl('PP-ACCEPT'); ?>

Brewer #


'."\n"; $CntPaid=cntPaid(); $CntPaidBrewer=cntPaid($BrewerNo); $LimitE=get_ctrl('LIMITE'); $LimitEP=get_ctrl('LIMITEP'); if ($LimitE == 'Y' && $LimitEP == 'Y') { $LimitEV=get_ctrl('LIMITEV'); if ($LimitEV < $CntPaid + $CntEntry - $CntPaidBrewer) { $Left=$LimitEV - $CntPaid; echo 'Due to Entry Limits, payment can '; if ($Left > 0) { echo 'only be made for '.$Left.' entr'.($Left > 1 ? 'ies' : 'y')."\n"; echo '
'."\n"; echo 'The one'.($Left > 1 ? 's' : '').' to be submitted will have to be selected from the registered entries.'."\n"; } else { echo 'not be made for any more entries'; } echo '

'."\n"; $CostEntry=Pricing($Left + $CntPaidBrewer, $BrewerNo); $AmtDue=$CostEntry - $AmtPaid - $AmtPending; } } $SuffixEntry=($CntEntry == 1 ? 'y' : 'ies'); if ($CntPayments > 0) { echo ($AdminAcct ? 'There '.$VerbPayment : 'You have made').' '.$CntPayments.' payment'.($CntPayments > 1 ? 's totaling' : ' of').' $'.format_price($AmtPaid).($AmtPending > 0 ? ' with $'.format_price($AmtPending).' pending' : '')."\n"; echo '

'."\n"; } $NoneLeft=(NoneLeft('E') || NoneLeft('EB', $BrewerNo)); if ($AmtDue < 0) { echo ($AdminAcct ? 'There has been' : 'You have made').' an overpayment of $'.format_price(abs($AmtDue))."\n"; echo '
'."\n"; if (!$AdminAcct) { echo '
'."\n"; echo 'Please contact the '.contact_link().' for a refund, if needed'."\n"; } echo '
'."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; } elseif ($AmtDue == 0) { if ($CntEntry == $CntPaidBrewer) { if ($AdminAcct) { echo 'The '.$CntEntry.' registered entr'.($CntEntry == 1 ? 'y' : 'ies').' '.$VerbEntry.' completely paid.'."\n"; } else { echo 'You are completely paid for the '.$CntEntry.' entr'.$SuffixEntry.' that '.$VerbEntry.' currently registered'."\n"; } } else { if ($AdminAcct) { echo 'There '.$VerbEntry.' '.$CntEntry.' registered entri'.$SuffixEntry.' of which '.$CntPaidBrewer.' entr'.($CntPaidBrewer ? 'y' : 'ies').' have been paid'."\n"; } else { echo 'You have paid for '.$CntPaidBrewer.' entr'.($CntPaidBrewer == 1 ? 'y' : 'ies').' of the '.$CntEntry.' entr'.$SuffixEntry.' currently registered'."\n"; } } echo '
'."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; } else { if ($AdminAcct) { echo 'A'.($CntPayments == 0 ? '' : 'n additional').' payment of $'.format_price($AmtDue).' needs to be made'."\n"; } else { echo 'You need to make a'.($CntPayments == 0 ? '' : 'n additional').' payment of $'.format_price($AmtDue)."\n"; } echo '

'."\n"; if (!empty($PayTo)) { echo 'Make Checks Payable to '.$PayTo.'
'."\n"; echo '
'."\n"; } echo '
'."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; if ($Stage > 0 && ($e_tags['AMOUNT_1'] || $e_tags['AMOUNT_2'] || $e_tags['AMOUNT_3'])) { echo ''."\n"; echo ''."\n"; echo ''."\n"; } echo '
'."\n"; echo 'Payment Amount'."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; if ($e_tags['AMOUNT_1']) { echo 'Payment Amount must be a number
'."\n"; } if ($e_tags['AMOUNT_2']) { echo 'Payment Amount must be a positive number
'."\n"; } if ($e_tags['AMOUNT_3']) { echo 'Payment Amount is excessive, please limit payment to $'.format_price($AmtDue).'
'."\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"; echo ''."\n"; if (!empty($PayTo)) { echo ''."\n"; } echo ''."\n"; if ($PP_ACCEPT == 'L' || $PP_ACCEPT == 'S') { echo ''."\n"; } echo ''."\n"; echo '
'."\n"; echo ''."\n"; echo ''."\n"; echo ' '."\n"; echo ''."\n"; echo ''."\n"; echo '
'."\n"; echo '
'."\n"; } if ($AnyPayments > 0) { if ($AdminAcct) { $query='select count(*) from payments where brewer="'.$BrewerNo.'" and keyval!="'.$BrewerKey.'"'; $cnt_res=mysqli_query($db, $query); $cnt_row=mysqli_fetch_row($cnt_res); $AdminPay=($cnt_row[0] > 0); } else { $AdminPay=FALSE; } $AcceptPay=FALSE; $PendingPP=FALSE; $PendingCK=FALSE; $ActionCnt=0; $query='select count(*) from payments where brewer="'.$BrewerNo.'" and pay_type="CK" and pay_stat="P"'; $cnt_res=mysqli_query($db, $query); $cnt_row=mysqli_fetch_row($cnt_res); if ($cnt_row[0] > 0) { $PendingCK=TRUE; ++$ActionCnt; } if ($AdminAcct) { $query='select count(*) from payments where brewer="'.$BrewerNo.'" and pay_stat="P"'; $cnt_res=mysqli_query($db, $query); $cnt_row=mysqli_fetch_row($cnt_res); if ($cnt_row[0] > 0) { $AcceptPay=TRUE; ++$ActionCnt; } $query='select count(*) from payments where brewer="'.$BrewerNo.'" and pay_type="PP" and pay_stat="P"'; $cnt_res=mysqli_query($db, $query); $cnt_row=mysqli_fetch_row($cnt_res); if ($cnt_row[0] > 0) { $PendingPP=TRUE; if (!$PendingCK) { ++$ActionCnt; } } } echo '

'."\n"; echo 'Payment History'."\n"; echo '

'."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; if ($AdminPay) { echo ''."\n"; } if ($PendingCK || $PendingPP || $AcceptPay) { echo ' 1 ? ' colspan="'.$ActionCnt.'"' : '').'>'."\n"; echo 'Action'."\n"; echo ''."\n"; } echo ''."\n"; $TabIndex=5; $query='select * from payments where brewer="'.$BrewerNo.'" order by seq'; $pay_res=mysqli_query($db, $query); while ($pay_row=mysqli_fetch_assoc($pay_res)) { echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; if ($AdminPay) { echo ''."\n"; } if ($PendingCK || $PendingPP) { echo ''."\n"; } if ($AcceptPay) { echo ''."\n"; } echo ''."\n"; } echo '
'."\n"; echo 'Payment Date'."\n"; echo ''."\n"; echo 'Type'."\n"; echo ''."\n"; echo 'Status'."\n"; echo ''."\n"; echo 'Amount'."\n"; echo ''."\n"; echo 'Made By'."\n"; echo '
'."\n"; echo date("M j, Y g:i A", strtotime($pay_row['chg_ts']))."\n"; 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"; if ($pay_row['keyval'] == $BrewerKey) { echo 'Brewer'."\n"; } else { $query='select name from accts where keyval="'.$pay_row['keyval'].'" and acct_type="A"'; $key_res=mysqli_query($db, $query); $key_row=mysqli_fetch_row($key_res); echo $key_row[0]."\n"; } echo ''."\n"; if ($pay_row['pay_type'] == 'CK' && ($AdminAcct || $pay_row['pay_stat'] == 'P')) { echo 'Void'."\n"; } elseif ($AdminAcct && $pay_row['pay_type'] == 'PP') { echo 'Cancel'."\n"; } else { echo ' '."\n"; } echo ''."\n"; if ($pay_row['pay_stat'] == 'P') { echo 'Accept'."\n"; } else { echo ' '."\n"; } echo '
'."\n"; } echo '
'."\n"; ?>