$page_info100 .= "You have <strong class=\"text-success\">" . readable_number($remaining_entries) . " (" . $remaining_entries . ")"; if ($remaining_entries == 1) { $page_info100 .= " entry "; } else { $page_info100 .= " entries "; } $page_info100 .= "left before you reach the limit of " . readable_number($row_limits['prefsUserEntryLimit']) . " (" . $row_limits['prefsUserEntryLimit'] . ") "; if ($row_limits['prefsUserEntryLimit'] > 1) { $page_info100 .= " entries "; } else { $page_info100 .= " entry "; } $page_info100 .= "per participant</strong> in this competition."; } if ($totalRows_log >= $row_limits['prefsUserEntryLimit']) { $page_info100 .= "You have reached the limit of <strong class=\"text-danger\">" . readable_number($row_limits['prefsUserEntryLimit']) . " (" . $row_limits['prefsUserEntryLimit'] . ") "; if ($row_limits['prefsUserEntryLimit'] > 1) { $page_info100 .= "entries "; } else { $page_info100 .= "entry "; } $page_info100 .= "per participant</strong> in this competition."; } $page_info100 .= "</div>"; } if ($discount) { $page_info100 .= "<div class=\"bcoem-sidebar-panel\">"; $page_info100 .= "<small><em class=\"text-muted\">"; if (NHC) { $page_info100 .= "* As an AHA member, your entry fees are "; } else {
function readable_number($a) { // http://www.iamcal.com/publish/articles/php/readable_numbers/ $bits_a = array("thousand", "million", "billion", "trillion", "quadrillion"); $bits_b = array("ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"); $bits_c = array("one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"); if ($a == 0) { return 'zero'; } $out = $a < 0 ? 'minus ' : ''; $a = abs($a); for ($i = count($bits_a); $i > 0; $i--) { $p = pow(1000, $i); if ($a > $p) { $b = floor($a / $p); $a -= $p * $b; $out .= readable_number($b) . ' ' . $bits_a[$i - 1]; $out .= $a ? ', ' : ''; } } if ($a > 100) { $b = floor($a / 100); $a -= 100 * $b; $out .= readable_number($b) . ' hundred' . ($a ? ' and ' : ' '); } if ($a >= 20) { $b = floor($a / 10); $a -= 10 * $b; $out .= $bits_b[$b - 1] . ' '; } if ($a) { $out .= $bits_c[$a - 1]; } return $out; }
<?php slot('share_text'); echo entity_link($relationship['Entity1']); ?> <?php echo $current === NULL ? "is/was" : ($current == '1' ? "is" : "was"); ?> a member of <?php echo entity_link($relationship['Entity2']); end_slot(); echo get_slot('share_text'); slot('share_text', RelationshipTable::formatSentenceForShare(get_slot('share_text'))); ?> </span> <br /> <br /> <?php $data = array('Title' => $relationship['description1'], 'Start date' => Dateable::convertForDisplay($relationship['start_date']), 'End date' => Dateable::convertForDisplay($relationship['end_date']), 'Is current' => LsLogic::nullOrBoolean($relationship['is_current']), 'Dues' => readable_number($relationship['dues'], '$'), 'Notes' => $relationship['notes'] ? nl2br($relationship['notes']) : null); ?> <?php include_partial('global/section', array('title' => 'Details')); ?> <div class="padded"> <?php include_partial('global/datatable', array('data' => $data)); ?> </div>
if ($_SESSION['contestEntryFeeDiscount'] == "Y") { $primary_page_info .= sprintf(" %s per entry after the %s entry. ", $currency_symbol . number_format($_SESSION['contestEntryFee2'], 2), addOrdinalNumberSuffix($_SESSION['contestEntryFeeDiscountNum'])); } if ($_SESSION['contestEntryCap'] != "") { $primary_page_info .= sprintf(" %s for unlimited entries. ", $currency_symbol . number_format($_SESSION['contestEntryCap'], 2)); } $primary_page_info .= "</small></p>"; if ($row_brewer['brewerDiscount'] == "Y") { $primary_page_info .= sprintf("<p class=\"lead\"><small><span class=\"fa fa-star-o text-primary\"></span> Your fees have been discounted to <strong class=\"text-success\">%s</strong> per entry.</small></p>", $currency_symbol . number_format($_SESSION['contestEntryFeePasswordNum'], 2)); } $primary_page_info .= sprintf("<p class=\"lead\"><small><span class=\"fa fa-exclamation-triangle text-danger\"></span> Your total entry fees are <strong class=\"text-success\">%s</strong>. You need to pay <strong class=\"text-danger\">%s</strong>.</small></p>", $currency_symbol . number_format($total_entry_fees, 2), $currency_symbol . number_format($total_to_pay, 2)); if ($total_not_paid == 0) { $primary_page_info .= sprintf("<p class=\"lead\"><small><span class=\"fa fa-thumbs-o-up text-danger\"></span> %s</p>", "Your fees have been paid. Thank you!</small></p>"); } else { $primary_page_info .= "<p class=\"lead\"><small>"; $primary_page_info .= sprintf("<span class=\"fa fa-exclamation-triangle text-danger\"></span> You currently have <strong class=\"text-danger\">%s unpaid confirmed ", readable_number($total_not_paid)); if ($total_not_paid == "1") { $primary_page_info .= "entry</strong>:"; } else { $primary_page_info .= "entries</strong>:"; } $primary_page_info .= "</small></p>"; $primary_page_info .= "<ol>"; do { if ($row_log_confirmed['brewPaid'] != "1") { $entry_no = sprintf("%04s", $row_log_confirmed['id']); $primary_page_info .= sprintf("<li>Entry #%s: %s (Category %s)</li>", $entry_no, $row_log_confirmed['brewName'], $row_log_confirmed['brewCategory'] . $row_log_confirmed['brewSubCategory']); $entries .= sprintf("%04s", $row_log_confirmed['id']) . ", "; $return_entries .= $row_log_confirmed['id'] . "-"; } } while ($row_log_confirmed = mysql_fetch_assoc($log_confirmed));
if ($_SESSION['contestEntryFeeDiscount'] == "Y") { $primary_page_info .= sprintf(" %s per entry after the %s entry. ", $currency_symbol . number_format($_SESSION['contestEntryFee2'], 2), addOrdinalNumberSuffix($_SESSION['contestEntryFeeDiscountNum'])); } if ($_SESSION['contestEntryCap'] != "") { $primary_page_info .= sprintf(" %s for unlimited entries. ", $currency_symbol . number_format($_SESSION['contestEntryCap'], 2)); } $primary_page_info .= "</p>"; if ($row_brewer['brewerDiscount'] == "Y") { $primary_page_info .= sprintf("<span class='icon'><img src='" . $base_url . "images/star.png' border='0' alt='Entry Fees' title='Entry Fees'></span>Your fees have been discounted to %s per entry.</p>", $currency_symbol . number_format($_SESSION['contestEntryFeePasswordNum'], 2)); } $primary_page_info .= sprintf("<p><span class='icon'><img src='" . $base_url . "images/money.png' border='0' alt='Entry Fees' title='Entry Fees'></span>Your total entry fees are %s. You need to pay %s.</p>", $currency_symbol . number_format($total_entry_fees, 2), $currency_symbol . number_format($total_to_pay, 2)); if ($total_not_paid == 0) { $primary_page_info .= sprintf("<p><span class='icon'><img src='" . $base_url . "images/thumb_up.png' border='0' alt='Entry Fees' title='Entry Fees'></span>%s</p>", "Your fees have been paid. Thank you!"); } else { $primary_page_info .= "<p>"; $primary_page_info .= sprintf("<span class='icon'><img src='" . $base_url . "images/money.png' border='0' alt='Entry Fees' title='Entry Fees'></span>You currently have %s <strong>unpaid</strong> ", readable_number($total_not_paid)); if ($total_not_paid == "1") { $primary_page_info .= "entry:"; } else { $primary_page_info .= "entries:"; } $primary_page_info .= "</p>"; $primary_page_info .= "<ul>"; do { if ($row_log['brewPaid'] != "1") { $entry_no = sprintf("%04s", $row_log['id']); $primary_page_info .= sprintf("<li>Entry #%s: %s (Category %s)</li>", $entry_no, $row_log['brewName'], $row_log['brewCategory'] . $row_log['brewSubCategory']); $entries .= sprintf("%04s", $row_log['id']) . ", "; $return_entries .= $row_log['id'] . "-"; } } while ($row_log = mysql_fetch_assoc($log));
$add_entry_link .= "'>Add an Entry</a>"; $add_entry_link .= "</span>"; // Build Beer XML Link $beer_xml_link .= "<span class='adminSubNav'>"; $beer_xml_link .= "<span class='icon'><img src='" . $base_url . "images/page_code.png' border='0' alt='Add Entry Using BeerXML' title='Add Entry Using BeerXML' /></span>"; $beer_xml_link .= "<a href='" . build_public_url("beerxml", "default", "default", $sef, $base_url) . "'>Import Entries Using BeerXML</a>"; $beer_xml_link .= "</span>"; // Build Print List of Entries Link $print_list_link .= "<span class='adminSubNav'>"; $print_list_link .= "<span class='icon'><img src='" . $base_url . "images/printer.png' border='0' alt='Print Entry List' title='Print Entry List' /></span>"; $print_list_link .= "<a id='modal_window_link' href='" . $base_url . "output/print.php?section=list&action=print' title='Print Your List of Entries and Info'>Print Your List of Entries and Info</a>"; $print_list_link .= "</span>"; // Build Entry Fee Message $entry_fee_message .= "<span class='adminSubNav'>"; $entry_fee_message .= "<span class='icon'><img src='" . $base_url . "images/money.png' border='0' alt='Entry Fees' title='Entry Fees' /></span>"; $entry_fee_message .= "You currently have " . readable_number($total_not_paid) . " <strong>unpaid</strong>"; if ($total_not_paid == "1") { $entry_fee_message .= " entry. "; } else { $entry_fee_message .= " entries. "; } $entry_fee_message .= "Your total entry fees are " . $currency_symbol . $total_entry_fees; if (NHC && $_SESSION['brewerDiscount'] != "Y") { $entry_fee_message .= " (as a non-AHA member)"; } $entry_fee_message .= ". You need to pay " . $currency_symbol . $total_to_pay . "."; $entry_fee_message .= "</span>"; // Build Discount Fee Message $discount_fee_message .= "<span class='adminSubNav'>"; $discount_fee_message .= "<span class='icon'><img src='" . $base_url . "images/star.png' border='0' alt='Discount!' title='Discount!' /></span>"; if (NHC) {
$registration_closed_msg = ""; if (open_limit($totalRows_entry_count, $row_limits['prefsEntryLimit'], $registration_open)) { $comp_entry_limit = TRUE; } else { $comp_entry_limit = FALSE; } $remaining_entries = 0; if (!empty($row_limits['prefsUserEntryLimit'])) { $remaining_entries = $row_limits['prefsUserEntryLimit'] - $totalRows_log; } else { $remaining_entries = 1; } if ($registration_open == "1" && !$ua) { if ($comp_entry_limit) { if ($section != "admin") { $closed_msg .= "<div class='closed'>The limit of " . readable_number($row_limits['prefsEntryLimit']) . " (" . $row_limits['prefsEntryLimit'] . ") entries has been reached. No further entries will be accepted."; if (!isset($_SESSION['loginUsername'])) { $closed_msg .= " However, judges and stewards may still <a href='" . build_public_url("register", "judge", "default", $sef, $base_url) . "'>register here</a>."; } $closed_msg .= "</div>"; } } } if ($registration_open == "0" && !$ua && $section != "admin") { if (!isset($_SESSION['loginUsername'])) { $registration_open_msg .= "<div class='closed'>General registration will open " . $reg_open . ".</div>"; } if (!isset($_SESSION['loginUsername']) && $judge_window_open == "0") { $judge_reg_open_msg .= "<div class='info'>Judge/steward registration will open " . $judge_open . ".</div>"; } if (!isset($_SESSION['loginUsername']) && $section != "register" && $judge_window_open == "1") {
<?php use_helper('LsNumber'); $data = array('Types' => implode(', ', array_keys(EntityTable::getExtensionsForDisplay($entity, false))), 'Start Date' => Dateable::convertForDisplay($entity['start_date']), 'End Date' => Dateable::convertForDisplay($entity['end_date']), 'Website' => $entity['website'] ? link_to(excerpt($entity['website'], 25, '...', false), $entity['website']) : null, 'Employees' => readable_number($entity['employees']), 'Revenue' => readable_number($entity['revenue'], '$')); ?> <?php include_partial('global/datatable', array('data' => $data, 'label_width' => isset($label_width) ? $label_width : '80px'));
$page_info16 .= " (exceptions are detailed below)"; } $page_info16 .= "."; $page_info16 .= "</p>"; } if (!empty($row_limits['prefsUSCLExLimit'])) { $excepted_styles = explode(",", $row_limits['prefsUSCLEx']); if (count($excepted_styles) == 1) { $sub = "sub-category"; } else { $sub = "sub-categories"; } if ($row_limits['prefsUSCLExLimit'] == 1) { $page_info16 .= sprintf("<p>Each entrant is limited to %s for the following %s: </p>", readable_number($row_limits['prefsUSCLExLimit']) . " (" . $row_limits['prefsUSCLExLimit'] . ")", $sub); } else { $page_info16 .= sprintf("<p>Each entrant is limited to %s entries for for the following %s: </p>", readable_number($row_limits['prefsUSCLExLimit']) . " (" . $row_limits['prefsUSCLExLimit'] . ")", $sub); } $page_info16 .= style_convert($row_limits['prefsUSCLEx'], "7"); } } // Payment $header1_6 .= "<a name='payment'></a><h2>Payment</h2>"; $page_info6 .= "<p>After registering your personal information and adding your entries to the system, you must pay your entry fee(s). Accepted payment methods are:</p>"; $page_info6 .= "<ul>"; if ($_SESSION['prefsCash'] == "Y") { $page_info6 .= "<li>Cash</li>"; } if ($_SESSION['prefsCheck'] == "Y") { $page_info6 .= sprintf("<li>Check, made out to <em>%s</em></li>", $_SESSION['prefsCheckPayee']); } if ($_SESSION['prefsPaypal'] == "Y") {
} ?> <?php if ($desc2 = $relationship['description2']) { ?> <?php $data[' ' . ucfirst($desc2)] = entity_link($relationship['Entity2']); ?> <?php } } ?> <?php $data = array_merge($data, array('Start date' => Dateable::convertForDisplay($relationship['start_date']), 'End date' => Dateable::convertForDisplay($relationship['end_date']), 'Is current' => LsLogic::nullOrBoolean($relationship['is_current']), 'Amount' => readable_number($relationship['amount'], '$'), 'Goods' => $relationship['goods'], 'Notes' => $relationship['notes'] ? nl2br($relationship['notes']) : null)); ?> <?php if ($relationship['filings'] && ($lobbyings = RelationshipTable::getLobbyingsFromLobbyFilingById($relationship['id']))) { ?> <?php $agencyAry = array(); ?> <?php foreach ($lobbyings as $lobbying) { ?> <?php if (in_array($lobbying->entity1_id, array($relationship['entity1_id'], $relationship['entity2_id']))) { ?>
<?php use_helper('LsNumber'); ?> <?php $data = array('Endowment' => readable_number($entity->endowment, '$'), 'Students' => $entity->students, 'Faculty' => $entity->faculty, 'Tuition' => readable_number($entity->tuition, '$'), 'Private' => $entity->is_private); ?> <?php include_partial('global/datatable', array('data' => $data, 'label_width' => isset($label_width) ? $label_width : '80px'));
?> ; <?php } ?> // document.getElementById('summary').innerHTML = butSummary; } </script> <?php echo "<p><span class='dataLabel'>Table Location:</span>" . table_location($row_tables_edit['id'], $_SESSION['prefsDateFormat'], $_SESSION['prefsTimeZone'], $_SESSION['prefsTimeFormat'], "default") . "</p>"; ?> <p onload="updateButCount(event);">Based upon your <a href="<?php echo $base_url; ?> index.php?section=admin&go=judging_preferences">competition organization preferences</a>, this table can be divided into <?php echo readable_number($flight_count); ?> flights. For each entry below, designate the flight in which it will be judged.</p> <form name="flights" method="post" action="<?php echo $base_url; ?> includes/process.inc.php?action=<?php echo $action; ?> &dbTable=<?php echo $judging_flights_db_table; ?> " onreset="updateButCount(event);"> <script type="text/javascript" language="javascript"> $(document).ready(function() { $('#flightCount').dataTable( {
$file_type = $_FILES['userfile']['type']; $file_name = $_FILES['userfile']['name']; $file_ext = strtolower(substr($file_name, strrpos($file_name, "."))); // File size check if ($_FILES['userfile']['size'] > $MAX_SIZE) { $message .= "The file size is over 2MB. Please adjust the size and try again."; } elseif (!in_array($file_type, $FILE_MIMES) && !in_array($file_ext, $FILE_EXTS)) { $message .= "Sorry, that file type is not allowed to be uploaded. Only .xml file extensions are allowed."; } elseif (is_uploaded_file($_FILES['userfile']['tmp_name'])) { $input = new InputBeerXML($_FILES['userfile']['tmp_name']); if ($_POST["insert_type"] == "recipes") { $insertedRecipes = $input->insertRecipes(); if (count($insertedRecipes) > 1) { $message .= ucwords(readable_number(count($insertedRecipes))) . " entries added."; } else { $message .= ucwords(readable_number(count($insertedRecipes))) . " entry added."; } } $_SESSION['recipes'] = $recipes; $message .= " " . $_FILES['userfile']['name'] . " has been uploaded and the brew has been added to your list of entries."; } /* //header(sprintf("Location: %s", stripslashes($updateGoTo))); //print "<script>window.location.href='index.php?section=".$section."&action=importXML&msg=1'</script>"; */ } elseif (!$_FILES['userfile']) { $message .= ""; } else { $message .= "Invalid file specified."; } if (!empty($message)) {
} ?> // document.getElementById('summary').innerHTML = butSummary; } </script> <?php echo "<p><strong>Table Location:</strong> " . table_location($row_tables_edit['id'], $_SESSION['prefsDateFormat'], $_SESSION['prefsTimeZone'], $_SESSION['prefsTimeFormat'], "default") . "</p>"; ?> <p onload="updateButCount(event);">Based upon your <a href="<?php echo $base_url; ?> index.php?section=admin&go=judging_preferences">competition organization preferences</a>, <?php if ($flight_count == 1) { echo " this table only requires one flight."; } else { echo " this table can be divided into " . readable_number($flight_count) . " flights. For each entry below, designate the flight in which it will be judged."; } ?> </p> <form name="flights" method="post" action="<?php echo $base_url; ?> includes/process.inc.php?action=<?php echo $action; ?> &dbTable=<?php echo $judging_flights_db_table; ?> " onreset="updateButCount(event);"> <script type="text/javascript" language="javascript"> $(document).ready(function() {
} else { ?> <?php echo RelationshipTable::getCategoryDefaultDescription($relationship); ?> <?php } } ?> <?php if ($amount = $relationship['amount']) { ?> ⋅ <?php echo '$' . readable_number($amount); } ?> <?php if ($count = $relationship['filings']) { ?> <?php if ($count == 1) { ?> ⋅ <?php echo $count; ?> filing <?php } else {
<?php use_helper('LsNumber'); ?> <?php include_partial('relationship/membershiponeliner', array('relationship' => $relationship, 'profiled_entity' => $profiled_entity, 'related_entity' => $related_entity)); ?> <?php $o = LsDoctrineQuery::create()->from('Ownership o')->where('o.relationship_id = ?', $relationship['id'])->setHydrationMode(Doctrine::HYDRATE_ARRAY)->fetchOne(); ?> <?php if ($stake = $o['percent_stake']) { ?> ⋅ <?php echo $stake . '% stake'; } elseif ($shares = $o['shares']) { ?> ⋅ <?php echo readable_number($shares) . ' shares'; ?> <?php }
<?php echo RelationshipTable::getDisplayDescription($relationship) ? '(' . RelationshipTable::getDisplayDescription($relationship) . ')' : ''; ?> <?php echo $relationship['Entity2']['primary_ext'] == 'Person' ? 'under' : 'at'; ?> <?php echo entity_link($relationship['Entity2']); end_slot(); echo get_slot('share_text'); slot('share_text', RelationshipTable::formatSentenceForShare(get_slot('share_text'))); ?> </span> <br /> <br /> <?php $data = array('Title' => $relationship['description1'], 'Start date' => Dateable::convertForDisplay($relationship['start_date']), 'End date' => Dateable::convertForDisplay($relationship['end_date']), 'Is current' => LsLogic::nullOrBoolean($relationship['is_current']), 'Board member' => LsLogic::nullOrBoolean($relationship['is_board']), 'Executive' => LsLogic::nullOrBoolean($relationship['is_executive']), 'Employee' => LsLogic::nullOrBoolean($relationship['is_employee']), 'Compensation' => readable_number($relationship['compensation'], '$'), 'Notes' => $relationship['notes'] ? nl2br($relationship['notes']) : null); ?> <?php include_partial('global/section', array('title' => 'Details')); ?> <div class="padded"> <?php include_partial('global/datatable', array('data' => $data)); ?> </div>