public static function cardinal($x)
 {
     if ($x <= 0) {
         return 'zero';
     }
     $y = $x % 20;
     if ($x >= 10000000) {
         return number_format(strval($x), 0);
     }
     if (($y = floor($x / 1000000)) > 0 && $y <= 9) {
         $val = '';
         $z = $x - $y * 1000000;
         if ($z > 0) {
             $val = ' ' . StringUtility::cardinal($z);
         }
         return StringUtility::cardinal($y) . ' million' . $val;
     }
     if (($y = floor($x / 1000)) > 0 && $y <= 999) {
         $val = '';
         $z = $x - $y * 1000;
         if ($z > 0) {
             $val = ' ' . StringUtility::cardinal($z);
         }
         return StringUtility::cardinal($y) . ' thousand' . $val;
     }
     if (($y = floor($x / 100)) > 0 && $y <= 9) {
         $val = '';
         $z = $x - $y * 100;
         if ($z > 0) {
             $val = ' and ' . StringUtility::cardinal($z);
         }
         return StringUtility::cardinal($y) . ' hundred' . $val;
     }
     switch ($y = floor($x / 10)) {
         case 2:
             $val = 'twenty';
             if (($z = $x % ($y * 10)) > 0 && $z <= 9) {
                 $val .= ' ' . StringUtility::cardinal($z);
             }
             return $val;
         case 3:
             $val = 'thirty';
             if (($z = $x % ($y * 10)) > 0 && $z <= 9) {
                 $val .= ' ' . StringUtility::cardinal($z);
             }
             return $val;
         case 4:
             $val = 'fourty';
             if (($z = $x % ($y * 10)) > 0 && $z <= 9) {
                 $val .= ' ' . StringUtility::cardinal($z);
             }
             return $val;
         case 5:
             $val = 'fifty';
             if (($z = $x % ($y * 10)) > 0 && $z <= 9) {
                 $val .= ' ' . StringUtility::cardinal($z);
             }
             return $val;
         case 6:
             $val = 'sixty';
             if (($z = $x % ($y * 10)) > 0 && $z <= 9) {
                 $val .= ' ' . StringUtility::cardinal($z);
             }
             return $val;
         case 7:
             $val = 'seventy';
             if (($z = $x % ($y * 10)) > 0 && $z <= 9) {
                 $val .= ' ' . StringUtility::cardinal($z);
             }
             return $val;
         case 8:
             $val = 'eighty';
             if (($z = $x % ($y * 10)) > 0 && $z <= 9) {
                 $val .= ' ' . StringUtility::cardinal($z);
             }
             return $val;
         case 9:
             $val = 'ninety';
             if (($z = $x % ($y * 10)) > 0 && $z <= 9) {
                 $val .= ' ' . StringUtility::cardinal($z);
             }
             return $val;
     }
     switch ($x) {
         case 1:
             return 'one';
         case 2:
             return 'two';
         case 3:
             return 'three';
         case 4:
             return 'four';
         case 5:
             return 'five';
         case 6:
             return 'six';
         case 7:
             return 'seven';
         case 8:
             return 'eight';
         case 9:
             return 'nine';
         case 10:
             return 'ten';
         case 11:
             return 'eleven';
         case 12:
             return 'twelve';
         case 13:
             return 'thirteen';
         case 14:
             return 'fourteen';
         case 15:
             return 'fifteen';
         case 16:
             return 'sixteen';
         case 17:
             return 'seventeen';
         case 18:
             return 'eighteen';
         case 19:
             return 'nineteen';
     }
 }
Exemple #2
0
                            echo '<td valign="top" align="center">';
                            $link = 'http://www.catsone.com/professional';
                            $image = 'images/add_licenses.jpg';

                            echo '<a href="' . $link . '">';
                            echo '<img src="' . $image . '" border="0" alt="Click here to add more user licenses"/>';
                            echo '</a>';
                            echo '<div style="text-align: left; padding: 10px 25px 0px 25px;">';
                            echo 'A <i>user license</i>, or <i>seat</i>, is the limit of full-access users you can have. You may ';
                            echo 'have unlimited read only users.';
                            echo '<p>';

                            echo 'This version of CATS is licensed to:<br /><center>';
                            echo '<b>' . LicenseUtility::getName() . '</b><br />';
                            $seats = LicenseUtility::getNumberOfSeats();
                            echo ucfirst(StringUtility::cardinal($seats)) . ' ('.$seats.') user license'.($seats!=1?'s':'').'<br />';
                            echo 'Valid until ' . date('m/d/Y', LicenseUtility::getExpirationDate()) . '<br />';
                            echo '</center>';


                            echo '<p>';
                            echo 'Click <a href="<?php echo $link; ?>">here</a> to purchase additional user seats.';
                            echo '</div></td>';
                        }
                        ?>
                    </tr>
                </table>

                <input type="submit" class="button" name="submit" id="submit" value="Add User" />&nbsp;
                <input type="reset"  class="button" name="reset"  id="reset"  value="Reset" onclick="document.getElementById('userAccessStatus').innerHTML='Delete - All lower access, plus the ability to delete information on the system.'" />&nbsp;
                <input type="button" class="button" name="back"   id="back"   value="Cancel" onclick="javascript:goToURL('<?php echo(CATSUtility::getIndexName()); ?>?m=settings&amp;a=manageUsers');" />