commit 4932f5c02c8445f22636a72b372f788fdc096d7c Author: Skylar Ittner Date: Sat May 2 17:12:55 2020 -0600 First commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..634002c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/GeoLite2-City.mmdb +/database.mwb.bak +/settings.php \ No newline at end of file diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..c26f042 --- /dev/null +++ b/.htaccess @@ -0,0 +1,4 @@ + + RewriteEngine on + RewriteRule ([a-zA-Z0-9]+) index.php?action=$1 [PT] + \ No newline at end of file diff --git a/actions/ballotitems.php b/actions/ballotitems.php new file mode 100644 index 0000000..a2c7761 --- /dev/null +++ b/actions/ballotitems.php @@ -0,0 +1,45 @@ + 1000) { + $limit = 1000; +} + +$query = (isset($VARS["q"]) ? strtolower($VARS["q"]) : ""); + +$results = $database->select( + "ballotitems", + [ + "[>]ballotitemtypes" => ["itemtype" => "type"] + ], + [ + "itemid (id)", + "label", + "description", + "ballotitemtypes.text (type)" + ], [ + "OR" => [ + "label[~]" => $query, + "description[~]" => $query + ], + "LIMIT" => $limit + ] +); + +for ($i = 0; $i < count($results); $i++) { + $results[$i]["label"] = ucwords($results[$i]["label"]); +} + +header("Content-Type: application/json"); +sendJsonResp(null, "OK", ["count" => count($results), "results" => $results]); diff --git a/actions/geoip.php b/actions/geoip.php new file mode 100644 index 0000000..9943250 --- /dev/null +++ b/actions/geoip.php @@ -0,0 +1,39 @@ +city($clientip); + + sendJsonResp(null, "OK", [ + "location" => [ + "latitude" => $record->location->latitude, + "longitude" => $record->location->longitude + ], + "clientip" => $clientip, + "postcode" => $record->postal->code, + "attribution" => "This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com." + ]); +} catch (GeoIp2\Exception\AddressNotFoundException $ex) { + sendJsonResp("Location not found for IP address.", "ERROR", ["clientip" => $clientip]); +} diff --git a/actions/ping.php b/actions/ping.php new file mode 100644 index 0000000..c764967 --- /dev/null +++ b/actions/ping.php @@ -0,0 +1,9 @@ + [ + "load" => "ping.php", + "vars" => [ + ] + ], + "ballotitems" => [ + "load" => "ballotitems.php", + "vars" => [ + "q (optional)" => "string", + "limit (optional)" => "/^[0-9]+$/" + ] + ], + "geoip" => [ + "load" => "geoip.php", + "vars" => [] + ] +]; diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..0f51974 --- /dev/null +++ b/composer.json @@ -0,0 +1,15 @@ +{ + "name": "netsyms_davidseyler/lecte-server", + "type": "project", + "require": { + "catfan/medoo": "^1.7", + "geoip2/geoip2": "^2.10", + "anthonymartin/geo-location": "^2.0" + }, + "license": "MPL-2.0", + "authors": [ + { + "name": "Netsyms Technologies" + } + ] +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..26be454 --- /dev/null +++ b/composer.lock @@ -0,0 +1,346 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "491d3c4a08593ec25cd5740a2f9e133d", + "packages": [ + { + "name": "anthonymartin/geo-location", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/anthonymartin/GeoLocation-PHP.git", + "reference": "e92d153c8ab97116ab1342826b74c64c3302b81d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/anthonymartin/GeoLocation-PHP/zipball/e92d153c8ab97116ab1342826b74c64c3302b81d", + "reference": "e92d153c8ab97116ab1342826b74c64c3302b81d", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^7" + }, + "type": "class", + "autoload": { + "psr-0": { + "AnthonyMartin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anthony Martin", + "email": "anthony@replaycreative.com", + "homepage": "http://replaycreative.com", + "role": "Developer" + } + ], + "description": "Powerful GeoCoding library: Retrieve bounding box coordinates, distances between geopoints, point in polygon, get longitude and latitude from addresses and more with GeoLocation for PHP", + "homepage": "https://github.com/anthonymartin/GeoLocation-PHP", + "keywords": [ + "bounding box coordinates", + "bounding coordinates", + "distances", + "geocode", + "geocoding", + "geolocation", + "latitude", + "longitude", + "point in polygon" + ], + "time": "2019-09-18T19:00:37+00:00" + }, + { + "name": "catfan/medoo", + "version": "v1.7.10", + "source": { + "type": "git", + "url": "https://github.com/catfan/Medoo.git", + "reference": "2d675f73e23f63bbaeb9a8aa33318659a3d3c32f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/catfan/Medoo/zipball/2d675f73e23f63bbaeb9a8aa33318659a3d3c32f", + "reference": "2d675f73e23f63bbaeb9a8aa33318659a3d3c32f", + "shasum": "" + }, + "require": { + "ext-pdo": "*", + "php": ">=5.4" + }, + "suggest": { + "ext-pdo_dblib": "For MSSQL or Sybase database on Linux/UNIX platform", + "ext-pdo_mysql": "For MySQL or MariaDB database", + "ext-pdo_oci": "For Oracle database", + "ext-pdo_oci8": "For Oracle version 8 database", + "ext-pdo_pqsql": "For PostgreSQL database", + "ext-pdo_sqlite": "For SQLite database", + "ext-pdo_sqlsrv": "For MSSQL database on both Window/Liunx platform" + }, + "type": "framework", + "autoload": { + "psr-4": { + "Medoo\\": "/src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Angel Lai", + "email": "angel@catfan.me" + } + ], + "description": "The lightweight PHP database framework to accelerate development", + "homepage": "https://medoo.in", + "keywords": [ + "database", + "database library", + "lightweight", + "mariadb", + "mssql", + "mysql", + "oracle", + "php framework", + "postgresql", + "sql", + "sqlite" + ], + "time": "2020-02-11T08:20:42+00:00" + }, + { + "name": "composer/ca-bundle", + "version": "1.2.7", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "time": "2020-04-08T08:27:21+00:00" + }, + { + "name": "geoip2/geoip2", + "version": "v2.10.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/GeoIP2-php.git", + "reference": "419557cd21d9fe039721a83490701a58c8ce784a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/419557cd21d9fe039721a83490701a58c8ce784a", + "reference": "419557cd21d9fe039721a83490701a58c8ce784a", + "shasum": "" + }, + "require": { + "ext-json": "*", + "maxmind-db/reader": "~1.5", + "maxmind/web-service-common": "~0.6", + "php": ">=5.6" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.*", + "phpunit/phpunit": "5.*", + "squizlabs/php_codesniffer": "3.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "GeoIp2\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory J. Oschwald", + "email": "goschwald@maxmind.com", + "homepage": "https://www.maxmind.com/" + } + ], + "description": "MaxMind GeoIP2 PHP API", + "homepage": "https://github.com/maxmind/GeoIP2-php", + "keywords": [ + "IP", + "geoip", + "geoip2", + "geolocation", + "maxmind" + ], + "time": "2019-12-12T18:48:39+00:00" + }, + { + "name": "maxmind-db/reader", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/MaxMind-DB-Reader-php.git", + "reference": "febd4920bf17c1da84cef58e56a8227dfb37fbe4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/MaxMind-DB-Reader-php/zipball/febd4920bf17c1da84cef58e56a8227dfb37fbe4", + "reference": "febd4920bf17c1da84cef58e56a8227dfb37fbe4", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "conflict": { + "ext-maxminddb": "<1.6.0,>=2.0.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.*", + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpcov": "^3.0", + "phpunit/phpunit": "5.*", + "squizlabs/php_codesniffer": "3.*" + }, + "suggest": { + "ext-bcmath": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", + "ext-gmp": "bcmath or gmp is required for decoding larger integers with the pure PHP decoder", + "ext-maxminddb": "A C-based database decoder that provides significantly faster lookups" + }, + "type": "library", + "autoload": { + "psr-4": { + "MaxMind\\Db\\": "src/MaxMind/Db" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory J. Oschwald", + "email": "goschwald@maxmind.com", + "homepage": "https://www.maxmind.com/" + } + ], + "description": "MaxMind DB Reader API", + "homepage": "https://github.com/maxmind/MaxMind-DB-Reader-php", + "keywords": [ + "database", + "geoip", + "geoip2", + "geolocation", + "maxmind" + ], + "time": "2019-12-19T22:59:03+00:00" + }, + { + "name": "maxmind/web-service-common", + "version": "v0.6.0", + "source": { + "type": "git", + "url": "https://github.com/maxmind/web-service-common-php.git", + "reference": "40c928bb0194c45088b369a17f9baef9c3fc7460" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maxmind/web-service-common-php/zipball/40c928bb0194c45088b369a17f9baef9c3fc7460", + "reference": "40c928bb0194c45088b369a17f9baef9c3fc7460", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0.3", + "ext-curl": "*", + "ext-json": "*", + "php": ">=5.6" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "2.*", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0", + "squizlabs/php_codesniffer": "3.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "MaxMind\\Exception\\": "src/Exception", + "MaxMind\\WebService\\": "src/WebService" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Gregory Oschwald", + "email": "goschwald@maxmind.com" + } + ], + "description": "Internal MaxMind Web Service API", + "homepage": "https://github.com/maxmind/web-service-common-php", + "time": "2019-12-12T15:56:05+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/database.mwb b/database.mwb new file mode 100644 index 0000000..bfc7da6 Binary files /dev/null and b/database.mwb differ diff --git a/datasrc/adjectives.csv b/datasrc/adjectives.csv new file mode 100644 index 0000000..92e95cd --- /dev/null +++ b/datasrc/adjectives.csv @@ -0,0 +1,394 @@ +word,positive,neutral,negative,include +able,1,,, +abnormal,,,, +absent-minded,,,, +above average,1,,, +adventurous,1,,,1 +affectionate,1,,,1 +agile,1,,, +agreeable,1,,, +alert,1,,, +amazing,1,,, +ambitious,1,,,1 +amiable,1,,, +amusing,1,,, +analytical,,,,1 +angelic,1,,, +apathetic,,,, +apprehensive,,,, +ardent,,,, +artificial,,,, +artistic,1,,,1 +assertive,1,,, +attentive,1,,, +average,,,, +awesome,1,,, +awful,,,, +balanced,1,,, +beautiful,1,,,1 +below average,,,, +beneficent,1,,, +blue,,,, +blunt,,,, +boisterous,,,, +brave,1,,,1 +bright,1,,, +brilliant,1,,, +buff,1,,, +callous,,,, +candid,1,,, +cantankerous,,,, +capable,1,,, +careful,1,,,1 +careless,,,, +caustic,,,, +cautious,,,, +charming,1,,, +childish,,,, +childlike,1,,,1 +cheerful,1,,,1 +chic,,,, +churlish,,,, +circumspect,,,, +civil,,,, +clean,1,,,1 +clever,1,,, +clumsy,,,, +coherent,1,,,1 +cold,,,, +competent,1,,,1 +composed,1,,, +conceited,,,, +condescending,,,, +confident,1,,, +confused,,,, +conscientious,1,,,1 +considerate,1,,,1 +content,1,,, +cool,1,,, +cool-headed,1,,, +cooperative,1,,,1 +cordial,1,,, +courageous,1,,,1 +cowardly,,,, +crabby,,,, +crafty,,,,1 +cranky,,,, +crass,,,, +critical,,,, +cruel,,,, +curious,1,,,1 +cynical,,,, +dainty,1,,, +decisive,1,,,1 +deep,1,,, +deferential,,,,1 +deft,,,, +delicate,,,, +demonic,,,, +dependent,,,, +delightful,1,,, +demure,,,, +depressed,,,, +devoted,,,, +dextrous,,,, +diligent,,,,1 +direct,,,,1 +dirty,,,, +disagreeable,,,, +discerning,,,,1 +discreet,,,,1 +disruptive,,,, +distant,,,, +distraught,,,, +distrustful,,,, +dowdy,,,, +dramatic,,,, +dreary,,,, +drowsy,,,, +drugged,,,, +drunk,,,, +dull,,,, +dutiful,,,, +eager,,,, +earnest,,,, +easy-going,,,,1 +efficient,,,,1 +egotistical,,,, +elfin,,,, +emotional,,,, +energetic,,,,1 +enterprising,,,,1 +enthusiastic,,,, +evasive,,,, +even-tempered,,,,1 +exacting,,,, +excellent,,,, +excitable,,,, +experienced,,,,1 +fabulous,,,, +fastidious,,,, +ferocious,,,, +fervent,,,, +fiery,,,, +flabby,,,, +flaky,,,, +flashy,,,, +frank,,,, +friendly,,,,1 +funny,,,,1 +fussy,,,, +generous,,,,1 +gentle,,,,1 +gloomy,,,, +glutinous,,,, +good,,,, +grave,,,, +great,,,, +groggy,,,, +grouchy,,,, +guarded,,,, +hateful,,,, +hearty,,,, +helpful,,,, +hesitant,,,, +hot-headed,,,, +hypercritical,,,, +hysterical,,,, +idiotic,,,, +idle,,,, +illogical,,,, +imaginative,,,,1 +immature,,,, +immodest,,,, +impatient,,,, +imperturbable,,,, +impetuous,,,, +impractical,,,, +impressionable,,,, +impressive,,,, +impulsive,,,, +inactive,,,, +incisive,,,, +incompetent,,,, +inconsiderate,,,, +inconsistent,,,, +independent,,,,1 +indiscreet,,,, +indolent,,,, +indefatigable,,,, +industrious,,,, +inexperienced,,,, +insensitive,,,, +inspiring,,,, +intelligent,,,,1 +interesting,,,,1 +intolerant,,,, +inventive,,,,1 +irascible,,,, +irritable,,,, +irritating,,,, +jocular,,,, +jovial,,,, +joyous,,,, +judgmental,,,, +keen,,,, +kind,,,,1 +lame,,,, +lazy,,,, +lean,,,, +leery,,,, +lethargic,,,, +level-headed,,,,1 +listless,,,, +lithe,,,, +lively,,,, +local,,,, +logical,,,, +long-winded,,,, +lovable,,,, +love-lorn,,,, +lovely,,,, +maternal,,,, +mature,,,,1 +mean,,,, +meddlesome,,,, +mercurial,,,, +methodical,,,, +meticulous,,,,1 +mild,,,, +miserable,,,, +modest,,,,1 +moronic,,,, +morose,,,, +motivated,,,, +musical,,,,1 +naive,,,, +nasty,,,, +natural,,,, +naughty,,,, +negative,,,, +nervous,,,, +noisy,,,, +normal,,,, +nosy,,,, +numb,,,, +obliging,,,, +obnoxious,,,, +old-fashioned,,,,1 +one-sided,,,, +orderly,,,, +ostentatious,,,, +outgoing,,,,1 +outspoken,,,,1 +passionate,,,,1 +passive,,,, +paternal,,,, +paternalistic,,,, +patient,,,,1 +peaceful,,,,1 +peevish,,,, +pensive,,,, +persevering,,,,1 +persnickety,,,, +petulant,,,, +picky,,,, +plain,,,, +plain-speaking,,,,1 +playful,,,,1 +pleasant,,,, +plucky,,,, +polite,,,,1 +popular,,,, +positive,,,,1 +powerful,,,, +practical,,,,1 +prejudiced,,,, +pretty,,,, +proficient,,,, +proud,,,, +provocative,,,, +prudent,,,, +punctual,,,, +quarrelsome,,,, +querulous,,,, +quick,,,, +quick-tempered,,,, +quiet,,,, +realistic,,,, +reassuring,,,,1 +reclusive,,,, +reliable,,,,1 +reluctant,,,, +resentful,,,, +reserved,,,, +resigned,,,, +resourceful,,,,1 +respected,,,, +respectful,,,, +responsible,,,,1 +restless,,,, +revered,,,, +ridiculous,,,, +sad,,,, +sassy,,,, +saucy,,,, +sedate,,,, +self-assured,,,, +selfish,,,, +sensible,,,, +sensitive,,,, +sentimental,,,, +serene,,,, +serious,,,, +sharp,,,, +short-tempered,,,, +shrewd,,,, +shy,,,, +silly,,,, +sincere,,,, +sleepy,,,, +slight,,,, +sloppy,,,, +slothful,,,, +slovenly,,,, +slow,,,, +smart,,,, +snazzy,,,, +sneering,,,, +snobby,,,, +somber,,,, +sober,,,, +sophisticated,,,, +soulful,,,, +soulless,,,, +sour,,,, +spirited,,,, +spiteful,,,, +stable,,,, +staid,,,, +steady,,,, +stern,,,, +stoic,,,, +striking,,,, +strong,,,, +stupid,,,, +sturdy,,,, +subtle,,,, +sullen,,,, +sulky,,,, +supercilious,,,, +superficial,,,, +surly,,,, +suspicious,,,, +sweet,,,, +tactful,,,, +tactless,,,, +talented,,,, +testy,,,, +thinking,,,, +thoughtful,,,,1 +thoughtless,,,, +timid,,,, +tired,,,, +tolerant,,,,1 +touchy,,,, +tranquil,,,, +ugly,,,, +unaffected,,,, +unbalanced,,,, +uncertain,,,, +uncooperative,,,, +undependable,,,, +unemotional,,,, +unfriendly,,,, +unguarded,,,, +unhelpful,,,, +unimaginative,,,, +unmotivated,,,, +unpleasant,,,, +unpopular,,,, +unreliable,,,, +unsophisticated,,,, +unstable,,,, +unsure,,,, +unthinking,,,, +unwilling,,,, +venal,,,, +versatile,,,, +vigilant,,,, +warm,,,, +warmhearted,,,,1 +wary,,,, +watchful,,,, +weak,,,, +well-behaved,,,, +well-developed,,,, +well-intentioned,,,, +well-respected,,,, +well-rounded,,,, +willing,,,, +wonderful,,,, +volcanic,,,, +vulnerable,,,, +zealous,,,,1 diff --git a/datasrc/adjectives.ods b/datasrc/adjectives.ods new file mode 100644 index 0000000..1edc339 Binary files /dev/null and b/datasrc/adjectives.ods differ diff --git a/datasrc/ballotitems.csv b/datasrc/ballotitems.csv new file mode 100644 index 0000000..39ca7e4 --- /dev/null +++ b/datasrc/ballotitems.csv @@ -0,0 +1,966 @@ +itemid,label,description,weight,allowdownvote,positive,itemtype +1,accountant,,2,0,0,1 +2,actor,,2,0,0,1 +3,actuary,,2,0,0,1 +4,adhesive bonding machine tender,,2,0,0,1 +5,adjudicator,,2,0,0,1 +6,administrative assistant,,2,0,0,1 +7,administrative services manager,,2,0,0,1 +8,adult education teacher,,2,0,0,1 +9,advertising manager,,2,0,0,1 +10,advertising sales agent,,2,0,0,1 +11,aerobics instructor,,2,0,0,1 +12,aerospace engineer,,2,0,0,1 +13,aerospace engineering technician,,2,0,0,1 +14,agent,,2,0,0,1 +15,agricultural engineer,,2,0,0,1 +16,agricultural equipment operator,,2,0,0,1 +17,agricultural grader,,2,0,0,1 +18,agricultural inspector,,2,0,0,1 +19,agricultural manager,,2,0,0,1 +20,agricultural sciences teacher,,2,0,0,1 +21,agricultural sorter,,2,0,0,1 +22,agricultural technician,,2,0,0,1 +23,agricultural worker,,2,0,0,1 +24,air conditioning installer,,2,0,0,1 +25,air conditioning mechanic,,2,0,0,1 +26,air traffic controller,,2,0,0,1 +27,aircraft cargo handling supervisor,,2,0,0,1 +28,aircraft mechanic,,2,0,0,1 +29,aircraft service technician,,2,0,0,1 +30,airline copilot,,2,0,0,1 +31,airline pilot,,2,0,0,1 +32,ambulance dispatcher,,2,0,0,1 +33,ambulance driver,,2,0,0,1 +34,amusement machine servicer,,2,0,0,1 +35,anesthesiologist,,2,0,0,1 +36,animal breeder,,2,0,0,1 +37,animal control worker,,2,0,0,1 +38,animal scientist,,2,0,0,1 +39,animal trainer,,2,0,0,1 +40,animator,,2,0,0,1 +41,answering service operator,,2,0,0,1 +42,anthropologist,,2,0,0,1 +43,apparel patternmaker,,2,0,0,1 +44,apparel worker,,2,0,0,1 +45,arbitrator,,2,0,0,1 +46,archeologist,,2,0,0,1 +47,architect,,2,0,0,1 +48,architectural drafter,,2,0,0,1 +49,architectural manager,,2,0,0,1 +50,archivist,,2,0,0,1 +51,art director,,2,0,0,1 +52,art teacher,,2,0,0,1 +53,artist,,2,0,0,1 +54,assembler,,2,0,0,1 +55,astronomer,,2,0,0,1 +56,athlete,,2,0,0,1 +57,athletic trainer,,2,0,0,1 +58,ATM machine repairer,,2,0,0,1 +59,atmospheric scientist,,2,0,0,1 +60,attendant,,2,0,0,1 +61,audio and video equipment technician,,2,0,0,1 +62,audio-visual and multimedia collections specialist,,2,0,0,1 +63,audiologist,,2,0,0,1 +64,auditor,,2,0,0,1 +65,author,,2,0,0,1 +66,auto damage insurance appraiser,,2,0,0,1 +67,automotive and watercraft service attendant,,2,0,0,1 +68,automotive glass installer,,2,0,0,1 +69,automotive mechanic,,2,0,0,1 +70,avionics technician,,2,0,0,1 +71,baggage porter,,2,0,0,1 +72,bailiff,,2,0,0,1 +73,baker,,2,0,0,1 +74,barback,,2,0,0,1 +75,barber,,2,0,0,1 +76,bartender,,2,0,0,1 +77,basic education teacher,,2,0,0,1 +78,behavioral disorder counselor,,2,0,0,1 +79,bellhop,,2,0,0,1 +80,bench carpenter,,2,0,0,1 +81,bicycle repairer,,2,0,0,1 +82,bill and account collector,,2,0,0,1 +83,billing and posting clerk,,2,0,0,1 +84,biochemist,,2,0,0,1 +85,biological technician,,2,0,0,1 +86,biomedical engineer,,2,0,0,1 +87,biophysicist,,2,0,0,1 +88,blaster,,2,0,0,1 +89,blending machine operator,,2,0,0,1 +90,blockmason,,2,0,0,1 +91,boiler operator,,2,0,0,1 +92,boilermaker,,2,0,0,1 +93,bookkeeper,,2,0,0,1 +94,boring machine tool tender,,2,0,0,1 +95,brazer,,2,0,0,1 +96,brickmason,,2,0,0,1 +97,bridge and lock tender,,2,0,0,1 +98,broadcast news analyst,,2,0,0,1 +99,broadcast technician,,2,0,0,1 +100,brokerage clerk,,2,0,0,1 +101,budget analyst,,2,0,0,1 +102,building inspector,,2,0,0,1 +103,bus mechanic,,2,0,0,1 +104,butcher,,2,0,0,1 +105,buyer,,2,0,0,1 +106,cabinetmaker,,2,0,0,1 +107,cafeteria attendant,,2,0,0,1 +108,cafeteria cook,,2,0,0,1 +109,camera operator,,2,0,0,1 +110,camera repairer,,2,0,0,1 +111,cardiovascular technician,,2,0,0,1 +112,cargo agent,,2,0,0,1 +113,carpenter,,2,0,0,1 +114,carpet installer,,2,0,0,1 +115,cartographer,,2,0,0,1 +116,cashier,,2,0,0,1 +117,caster,,2,0,0,1 +118,ceiling tile installer,,2,0,0,1 +119,cellular equipment installer,,2,0,0,1 +120,cement mason,,2,0,0,1 +121,channeling machine operator,,2,0,0,1 +122,chauffeur,,2,0,0,1 +123,checker,,2,0,0,1 +124,chef,,2,0,0,1 +125,chemical engineer,,2,0,0,1 +126,chemical plant operator,,2,0,0,1 +127,chemist,,2,0,0,1 +128,chemistry teacher,,2,0,0,1 +129,chief executive,,2,0,0,1 +130,child social worker,,2,0,0,1 +131,childcare worker,,2,0,0,1 +132,chiropractor,,2,0,0,1 +133,choreographer,,2,0,0,1 +134,civil drafter,,2,0,0,1 +135,civil engineer,,2,0,0,1 +136,civil engineering technician,,2,0,0,1 +137,claims adjuster,,2,0,0,1 +138,claims examiner,,2,0,0,1 +139,claims investigator,,2,0,0,1 +140,cleaner,,2,0,0,1 +141,clinical laboratory technician,,2,0,0,1 +142,clinical laboratory technologist,,2,0,0,1 +143,clinical psychologist,,2,0,0,1 +144,coating worker,,2,0,0,1 +145,coatroom attendant,,2,0,0,1 +146,coil finisher,,2,0,0,1 +147,coil taper,,2,0,0,1 +148,coil winder,,2,0,0,1 +149,coin machine servicer,,2,0,0,1 +150,commercial diver,,2,0,0,1 +151,commercial pilot,,2,0,0,1 +152,commodities sales agent,,2,0,0,1 +153,communications equipment operator,,2,0,0,1 +154,communications teacher,,2,0,0,1 +155,community association manager,,2,0,0,1 +156,community service manager,,2,0,0,1 +157,compensation and benefits manager,,2,0,0,1 +158,compliance officer,,2,0,0,1 +159,composer,,2,0,0,1 +160,computer hardware engineer,,2,0,0,1 +161,computer network architect,,2,0,0,1 +162,computer operator,,2,0,0,1 +163,computer programmer,,2,0,0,1 +164,computer science teacher,,2,0,0,1 +165,computer support specialist,,2,0,0,1 +166,computer systems administrator,,2,0,0,1 +167,computer systems analyst,,2,0,0,1 +168,concierge,,2,0,0,1 +169,conciliator,,2,0,0,1 +170,concrete finisher,,2,0,0,1 +171,conservation science teacher,,2,0,0,1 +172,conservation scientist,,2,0,0,1 +173,conservation worker,,2,0,0,1 +174,conservator,,2,0,0,1 +175,construction inspector,,2,0,0,1 +176,construction manager,,2,0,0,1 +177,construction painter,,2,0,0,1 +178,construction worker,,2,0,0,1 +179,continuous mining machine operator,,2,0,0,1 +180,convention planner,,2,0,0,1 +181,conveyor operator,,2,0,0,1 +182,cook,,2,0,0,1 +183,cooling equipment operator,,2,0,0,1 +184,copy marker,,2,0,0,1 +185,correctional officer,,2,0,0,1 +186,correctional treatment specialist,,2,0,0,1 +187,correspondence clerk,,2,0,0,1 +188,correspondent,,2,0,0,1 +189,cosmetologist,,2,0,0,1 +190,cost estimator,,2,0,0,1 +191,costume attendant,,2,0,0,1 +192,counseling psychologist,,2,0,0,1 +193,counselor,,2,0,0,1 +194,courier,,2,0,0,1 +195,court reporter,,2,0,0,1 +196,craft artist,,2,0,0,1 +197,crane operator,,2,0,0,1 +198,credit analyst,,2,0,0,1 +199,credit checker,,2,0,0,1 +200,credit counselor,,2,0,0,1 +201,criminal investigator,,2,0,0,1 +202,criminal justice teacher,,2,0,0,1 +203,crossing guard,,2,0,0,1 +204,curator,,2,0,0,1 +205,custom sewer,,2,0,0,1 +206,customer service representative,,2,0,0,1 +207,cutter,,2,0,0,1 +208,cutting machine operator,,2,0,0,1 +209,dancer,,2,0,0,1 +210,data entry keyer,,2,0,0,1 +211,database administrator,,2,0,0,1 +212,decorating worker,,2,0,0,1 +213,delivery services driver,,2,0,0,1 +214,demonstrator,,2,0,0,1 +215,dental assistant,,2,0,0,1 +216,dental hygienist,,2,0,0,1 +217,dental laboratory technician,,2,0,0,1 +218,dentist,,2,0,0,1 +219,derrick operator,,2,0,0,1 +220,designer,,2,0,0,1 +221,desktop publisher,,2,0,0,1 +222,detective,,2,0,0,1 +223,diagnostic medical sonographer,,2,0,0,1 +224,die maker,,2,0,0,1 +225,diesel engine specialist,,2,0,0,1 +226,dietetic technician,,2,0,0,1 +227,dietitian,,2,0,0,1 +228,dinkey operator,,2,0,0,1 +229,director,,2,0,0,1 +230,dishwasher,,2,0,0,1 +231,dispatcher,,2,0,0,1 +232,door-to-door sales worker,,2,0,0,1 +233,drafter,,2,0,0,1 +234,dragline operator,,2,0,0,1 +235,drama teacher,,2,0,0,1 +236,dredge operator,,2,0,0,1 +237,dressing room attendant,,2,0,0,1 +238,dressmaker,,2,0,0,1 +239,drier operator,,2,0,0,1 +240,drilling machine tool operator,,2,0,0,1 +241,dry-cleaning worker,,2,0,0,1 +242,drywall installer,,2,0,0,1 +243,dyeing machine operator,,2,0,0,1 +244,earth driller,,2,0,0,1 +245,economics teacher,,2,0,0,1 +246,economist,,2,0,0,1 +247,editor,,2,0,0,1 +248,education administrator,,2,0,0,1 +249,electric motor repairer,,2,0,0,1 +250,electrical electronics drafter,,2,0,0,1 +251,electrical engineer,,2,0,0,1 +252,electrical equipment assembler,,2,0,0,1 +253,electrical installer,,2,0,0,1 +254,electrical power-line installer,,2,0,0,1 +255,electrician,,2,0,0,1 +256,electro-mechanical technician,,2,0,0,1 +257,elementary school teacher,,2,0,0,1 +258,elevator installer,,2,0,0,1 +259,elevator repairer,,2,0,0,1 +260,embalmer,,2,0,0,1 +261,emergency management director,,2,0,0,1 +262,emergency medical technician,,2,0,0,1 +263,engine assembler,,2,0,0,1 +264,engineer,,2,0,0,1 +265,engineering manager,,2,0,0,1 +266,engineering teacher,,2,0,0,1 +267,english language teacher,,2,0,0,1 +268,engraver,,2,0,0,1 +269,entertainment attendant,,2,0,0,1 +270,environmental engineer,,2,0,0,1 +271,environmental science teacher,,2,0,0,1 +272,environmental scientist,,2,0,0,1 +273,epidemiologist,,2,0,0,1 +274,escort,,2,0,0,1 +275,etcher,,2,0,0,1 +276,event planner,,2,0,0,1 +277,excavating operator,,2,0,0,1 +278,executive administrative assistant,,2,0,0,1 +279,executive secretary,,2,0,0,1 +280,exhibit designer,,2,0,0,1 +281,expediting clerk,,2,0,0,1 +282,explosives worker,,2,0,0,1 +283,extraction worker,,2,0,0,1 +284,fabric mender,,2,0,0,1 +285,fabric patternmaker,,2,0,0,1 +286,fabricator,,2,0,0,1 +287,faller,,2,0,0,1 +288,family practitioner,,2,0,0,1 +289,family social worker,,2,0,0,1 +290,family therapist,,2,0,0,1 +291,farm advisor,,2,0,0,1 +292,farm equipment mechanic,,2,0,0,1 +293,farm labor contractor,,2,0,0,1 +294,farmer,,2,0,0,1 +295,farmworker,,2,0,0,1 +296,fashion designer,,2,0,0,1 +297,fast food cook,,2,0,0,1 +298,fence erector,,2,0,0,1 +299,fiberglass fabricator,,2,0,0,1 +300,fiberglass laminator,,2,0,0,1 +301,file clerk,,2,0,0,1 +302,filling machine operator,,2,0,0,1 +303,film and video editor,,2,0,0,1 +304,financial analyst,,2,0,0,1 +305,financial examiner,,2,0,0,1 +306,financial manager,,2,0,0,1 +307,financial services sales agent,,2,0,0,1 +308,fine artist,,2,0,0,1 +309,fire alarm system installer,,2,0,0,1 +310,fire dispatcher,,2,0,0,1 +311,fire inspector,,2,0,0,1 +312,fire investigator,,2,0,0,1 +313,firefighter,,2,0,0,1 +314,fish and game warden,,2,0,0,1 +315,fish cutter,,2,0,0,1 +316,fish trimmer,,2,0,0,1 +317,fisher,,2,0,0,1 +318,fitness studies teacher,,2,0,0,1 +319,fitness trainer,,2,0,0,1 +320,flight attendant,,2,0,0,1 +321,floor finisher,,2,0,0,1 +322,floor layer,,2,0,0,1 +323,floor sander,,2,0,0,1 +324,floral designer,,2,0,0,1 +325,food batchmaker,,2,0,0,1 +326,food cooking machine operator,,2,0,0,1 +327,food preparation worker,,2,0,0,1 +328,food science technician,,2,0,0,1 +329,food scientist,,2,0,0,1 +330,food server,,2,0,0,1 +331,food service manager,,2,0,0,1 +332,food technologist,,2,0,0,1 +333,foreign language teacher,,2,0,0,1 +334,foreign literature teacher,,2,0,0,1 +335,forensic science technician,,2,0,0,1 +336,forest fire inspector,,2,0,0,1 +337,forest fire prevention specialist,,2,0,0,1 +338,forest worker,,2,0,0,1 +339,forester,,2,0,0,1 +340,forestry teacher,,2,0,0,1 +341,forging machine setter,,2,0,0,1 +342,foundry coremaker,,2,0,0,1 +343,freight agent,,2,0,0,1 +344,freight mover,,2,0,0,1 +345,fundraising manager,,2,0,0,1 +346,funeral attendant,,2,0,0,1 +347,funeral director,,2,0,0,1 +348,funeral service manager,,2,0,0,1 +349,furnace operator,,2,0,0,1 +350,furnishings worker,,2,0,0,1 +351,furniture finisher,,2,0,0,1 +352,gaming booth cashier,,2,0,0,1 +353,gaming cage worker,,2,0,0,1 +354,gaming change person,,2,0,0,1 +355,gaming dealer,,2,0,0,1 +356,gaming investigator,,2,0,0,1 +357,gaming manager,,2,0,0,1 +358,gaming surveillance officer,,2,0,0,1 +359,garment mender,,2,0,0,1 +360,garment presser,,2,0,0,1 +361,gas compressor,,2,0,0,1 +362,gas plant operator,,2,0,0,1 +363,gas pumping station operator,,2,0,0,1 +364,general manager,,2,0,0,1 +365,general practitioner,,2,0,0,1 +366,geographer,,2,0,0,1 +367,geography teacher,,2,0,0,1 +368,geological engineer,,2,0,0,1 +369,geological technician,,2,0,0,1 +370,geoscientist,,2,0,0,1 +371,glazier,,2,0,0,1 +372,government program eligibility interviewer,,2,0,0,1 +373,graduate teaching assistant,,2,0,0,1 +374,graphic designer,,2,0,0,1 +375,groundskeeper,,2,0,0,1 +376,groundskeeping worker,,2,0,0,1 +377,gynecologist,,2,0,0,1 +378,hairdresser,,2,0,0,1 +379,hairstylist,,2,0,0,1 +380,hand grinding worker,,2,0,0,1 +381,hand laborer,,2,0,0,1 +382,hand packager,,2,0,0,1 +383,hand packer,,2,0,0,1 +384,hand polishing worker,,2,0,0,1 +385,hand sewer,,2,0,0,1 +386,hazardous materials removal worker,,2,0,0,1 +387,head cook,,2,0,0,1 +388,health and safety engineer,,2,0,0,1 +389,health educator,,2,0,0,1 +390,health information technician,,2,0,0,1 +391,health services manager,,2,0,0,1 +392,health specialties teacher,,2,0,0,1 +393,healthcare social worker,,2,0,0,1 +394,hearing officer,,2,0,0,1 +395,heat treating equipment setter,,2,0,0,1 +396,heating installer,,2,0,0,1 +397,heating mechanic,,2,0,0,1 +398,heavy truck driver,,2,0,0,1 +399,highway maintenance worker,,2,0,0,1 +400,historian,,2,0,0,1 +401,history teacher,,2,0,0,1 +402,hoist and winch operator,,2,0,0,1 +403,home appliance repairer,,2,0,0,1 +404,home economics teacher,,2,0,0,1 +405,home entertainment installer,,2,0,0,1 +406,home health aide,,2,0,0,1 +407,home management advisor,,2,0,0,1 +408,host,,2,0,0,1 +409,hostess,,2,0,0,1 +410,hostler,,2,0,0,1 +411,hotel desk clerk,,2,0,0,1 +412,housekeeping cleaner,,2,0,0,1 +413,human resources assistant,,2,0,0,1 +414,human resources manager,,2,0,0,1 +415,human service assistant,,2,0,0,1 +416,hunter,,2,0,0,1 +417,hydrologist,,2,0,0,1 +418,illustrator,,2,0,0,1 +419,industrial designer,,2,0,0,1 +420,industrial engineer,,2,0,0,1 +421,industrial engineering technician,,2,0,0,1 +422,industrial machinery mechanic,,2,0,0,1 +423,industrial production manager,,2,0,0,1 +424,industrial truck operator,,2,0,0,1 +425,industrial-organizational psychologist,,2,0,0,1 +426,information clerk,,2,0,0,1 +427,information research scientist,,2,0,0,1 +428,information security analyst,,2,0,0,1 +429,information systems manager,,2,0,0,1 +430,inspector,,2,0,0,1 +431,instructional coordinator,,2,0,0,1 +432,instructor,,2,0,0,1 +433,insulation worker,,2,0,0,1 +434,insurance claims clerk,,2,0,0,1 +435,insurance sales agent,,2,0,0,1 +436,insurance underwriter,,2,0,0,1 +437,intercity bus driver,,2,0,0,1 +438,interior designer,,2,0,0,1 +439,internist,,2,0,0,1 +440,interpreter,,2,0,0,1 +441,interviewer,,2,0,0,1 +442,investigator,,2,0,0,1 +443,jailer,,2,0,0,1 +444,janitor,,2,0,0,1 +445,jeweler,,2,0,0,1 +446,judge,,2,0,0,1 +447,judicial law clerk,,2,0,0,1 +448,kettle operator,,2,0,0,1 +449,kiln operator,,2,0,0,1 +450,kindergarten teacher,,2,0,0,1 +451,laboratory animal caretaker,,2,0,0,1 +452,landscape architect,,2,0,0,1 +453,landscaping worker,,2,0,0,1 +454,lathe setter,,2,0,0,1 +455,laundry worker,,2,0,0,1 +456,law enforcement teacher,,2,0,0,1 +457,law teacher,,2,0,0,1 +458,lawyer,,2,0,0,1 +459,layout worker,,2,0,0,1 +460,leather worker,,2,0,0,1 +461,legal assistant,,2,0,0,1 +462,legal secretary,,2,0,0,1 +463,legislator,,2,0,0,1 +464,librarian,,2,0,0,1 +465,library assistant,,2,0,0,1 +466,library science teacher,,2,0,0,1 +467,library technician,,2,0,0,1 +468,licensed practical nurse,,2,0,0,1 +469,licensed vocational nurse,,2,0,0,1 +470,life scientist,,2,0,0,1 +471,lifeguard,,2,0,0,1 +472,light truck driver,,2,0,0,1 +473,line installer,,2,0,0,1 +474,literacy teacher,,2,0,0,1 +475,literature teacher,,2,0,0,1 +476,loading machine operator,,2,0,0,1 +477,loan clerk,,2,0,0,1 +478,loan interviewer,,2,0,0,1 +479,loan officer,,2,0,0,1 +480,lobby attendant,,2,0,0,1 +481,locker room attendant,,2,0,0,1 +482,locksmith,,2,0,0,1 +483,locomotive engineer,,2,0,0,1 +484,locomotive firer,,2,0,0,1 +485,lodging manager,,2,0,0,1 +486,log grader,,2,0,0,1 +487,logging equipment operator,,2,0,0,1 +488,logistician,,2,0,0,1 +489,machine feeder,,2,0,0,1 +490,machinist,,2,0,0,1 +491,magistrate judge,,2,0,0,1 +492,magistrate,,2,0,0,1 +493,maid,,2,0,0,1 +494,mail clerk,,2,0,0,1 +495,mail machine operator,,2,0,0,1 +496,mail superintendent,,2,0,0,1 +497,maintenance painter,,2,0,0,1 +498,maintenance worker,,2,0,0,1 +499,makeup artist,,2,0,0,1 +500,management analyst,,2,0,0,1 +501,manicurist,,2,0,0,1 +502,manufactured building installer,,2,0,0,1 +503,mapping technician,,2,0,0,1 +504,marble setter,,2,0,0,1 +505,marine engineer,,2,0,0,1 +506,marine oiler,,2,0,0,1 +507,market research analyst,,2,0,0,1 +508,marketing manager,,2,0,0,1 +509,marketing specialist,,2,0,0,1 +510,marriage therapist,,2,0,0,1 +511,massage therapist,,2,0,0,1 +512,material mover,,2,0,0,1 +513,materials engineer,,2,0,0,1 +514,materials scientist,,2,0,0,1 +515,mathematical science teacher,,2,0,0,1 +516,mathematical technician,,2,0,0,1 +517,mathematician,,2,0,0,1 +518,maxillofacial surgeon,,2,0,0,1 +519,measurer,,2,0,0,1 +520,meat cutter,,2,0,0,1 +521,meat packer,,2,0,0,1 +522,meat trimmer,,2,0,0,1 +523,mechanical door repairer,,2,0,0,1 +524,mechanical drafter,,2,0,0,1 +525,mechanical engineer,,2,0,0,1 +526,mechanical engineering technician,,2,0,0,1 +527,mediator,,2,0,0,1 +528,medical appliance technician,,2,0,0,1 +529,medical assistant,,2,0,0,1 +530,medical equipment preparer,,2,0,0,1 +531,medical equipment repairer,,2,0,0,1 +532,medical laboratory technician,,2,0,0,1 +533,medical laboratory technologist,,2,0,0,1 +534,medical records technician,,2,0,0,1 +535,medical scientist,,2,0,0,1 +536,medical secretary,,2,0,0,1 +537,medical services manager,,2,0,0,1 +538,medical transcriptionist,,2,0,0,1 +539,meeting planner,,2,0,0,1 +540,mental health counselor,,2,0,0,1 +541,mental health social worker,,2,0,0,1 +542,merchandise displayer,,2,0,0,1 +543,messenger,,2,0,0,1 +544,metal caster,,2,0,0,1 +545,metal patternmaker,,2,0,0,1 +546,metal pickling operator,,2,0,0,1 +547,metal pourer,,2,0,0,1 +548,metal worker,,2,0,0,1 +549,metal-refining furnace operator,,2,0,0,1 +550,metal-refining furnace tender,,2,0,0,1 +551,meter reader,,2,0,0,1 +552,microbiologist,,2,0,0,1 +553,middle school teacher,,2,0,0,1 +554,milling machine setter,,2,0,0,1 +555,millwright,,2,0,0,1 +556,mine cutting machine operator,,2,0,0,1 +557,mine shuttle car operator,,2,0,0,1 +558,mining engineer,,2,0,0,1 +559,mining safety engineer,,2,0,0,1 +560,mining safety inspector,,2,0,0,1 +561,mining service unit operator,,2,0,0,1 +562,mixing machine setter,,2,0,0,1 +563,mobile heavy equipment mechanic,,2,0,0,1 +564,mobile home installer,,2,0,0,1 +565,model maker,,2,0,0,1 +566,model,,2,0,0,1 +567,molder,,2,0,0,1 +568,mortician,,2,0,0,1 +569,motel desk clerk,,2,0,0,1 +570,motion picture projectionist,,2,0,0,1 +571,motorboat mechanic,,2,0,0,1 +572,motorboat operator,,2,0,0,1 +573,motorboat service technician,,2,0,0,1 +574,motorcycle mechanic,,2,0,0,1 +575,multimedia artist,,2,0,0,1 +576,museum technician,,2,0,0,1 +577,music director,,2,0,0,1 +578,music teacher,,2,0,0,1 +579,musical instrument repairer,,2,0,0,1 +580,musician,,2,0,0,1 +581,natural sciences manager,,2,0,0,1 +582,naval architect,,2,0,0,1 +583,network systems administrator,,2,0,0,1 +584,new accounts clerk,,2,0,0,1 +585,news vendor,,2,0,0,1 +586,nonfarm animal caretaker,,2,0,0,1 +587,nuclear engineer,,2,0,0,1 +588,nuclear medicine technologist,,2,0,0,1 +589,nuclear power reactor operator,,2,0,0,1 +590,nuclear technician,,2,0,0,1 +591,nursing aide,,2,0,0,1 +592,nursing instructor,,2,0,0,1 +593,nursing teacher,,2,0,0,1 +594,nutritionist,,2,0,0,1 +595,obstetrician,,2,0,0,1 +596,occupational health and safety specialist,,2,0,0,1 +597,occupational health and safety technician,,2,0,0,1 +598,occupational therapist,,2,0,0,1 +599,occupational therapy aide,,2,0,0,1 +600,occupational therapy assistant,,2,0,0,1 +601,offbearer,,2,0,0,1 +602,office clerk,,2,0,0,1 +603,office machine operator,,2,0,0,1 +604,operating engineer,,2,0,0,1 +605,operations manager,,2,0,0,1 +606,operations research analyst,,2,0,0,1 +607,ophthalmic laboratory technician,,2,0,0,1 +608,optician,,2,0,0,1 +609,optometrist,,2,0,0,1 +610,oral surgeon,,2,0,0,1 +611,order clerk,,2,0,0,1 +612,order filler,,2,0,0,1 +613,orderly,,2,0,0,1 +614,ordnance handling expert,,2,0,0,1 +615,orthodontist,,2,0,0,1 +616,orthotist,,2,0,0,1 +617,outdoor power equipment mechanic,,2,0,0,1 +618,oven operator,,2,0,0,1 +619,packaging machine operator,,2,0,0,1 +620,painter ,,2,0,0,1 +621,painting worker,,2,0,0,1 +622,paper goods machine setter,,2,0,0,1 +623,paperhanger,,2,0,0,1 +624,paralegal,,2,0,0,1 +625,paramedic,,2,0,0,1 +626,parking enforcement worker,,2,0,0,1 +627,parking lot attendant,,2,0,0,1 +628,parts salesperson,,2,0,0,1 +629,paving equipment operator,,2,0,0,1 +630,payroll clerk,,2,0,0,1 +631,pediatrician,,2,0,0,1 +632,pedicurist,,2,0,0,1 +633,personal care aide,,2,0,0,1 +634,personal chef,,2,0,0,1 +635,personal financial advisor,,2,0,0,1 +636,pest control worker,,2,0,0,1 +637,pesticide applicator,,2,0,0,1 +638,pesticide handler,,2,0,0,1 +639,pesticide sprayer,,2,0,0,1 +640,petroleum engineer,,2,0,0,1 +641,petroleum gauger,,2,0,0,1 +642,petroleum pump system operator,,2,0,0,1 +643,petroleum refinery operator,,2,0,0,1 +644,petroleum technician,,2,0,0,1 +645,pharmacist,,2,0,0,1 +646,pharmacy aide,,2,0,0,1 +647,pharmacy technician,,2,0,0,1 +648,philosophy teacher,,2,0,0,1 +649,photogrammetrist,,2,0,0,1 +650,photographer,,2,0,0,1 +651,photographic process worker,,2,0,0,1 +652,photographic processing machine operator,,2,0,0,1 +653,physical therapist aide,,2,0,0,1 +654,physical therapist assistant,,2,0,0,1 +655,physical therapist,,2,0,0,1 +656,physician assistant,,2,0,0,1 +657,physician,,2,0,0,1 +658,physicist,,2,0,0,1 +659,physics teacher,,2,0,0,1 +660,pile-driver operator,,2,0,0,1 +661,pipefitter,,2,0,0,1 +662,pipelayer,,2,0,0,1 +663,planing machine operator,,2,0,0,1 +664,planning clerk,,2,0,0,1 +665,plant operator,,2,0,0,1 +666,plant scientist,,2,0,0,1 +667,plasterer,,2,0,0,1 +668,plastic patternmaker,,2,0,0,1 +669,plastic worker,,2,0,0,1 +670,plumber,,2,0,0,1 +671,podiatrist,,2,0,0,1 +672,police dispatcher,,2,0,0,1 +673,police officer,,2,0,0,1 +674,policy processing clerk,,2,0,0,1 +675,political science teacher,,2,0,0,1 +676,political scientist,,2,0,0,1 +677,postal service clerk,,2,0,0,1 +678,postal service mail carrier,,2,0,0,1 +679,postal service mail processing machine operator,,2,0,0,1 +680,postal service mail processor,,2,0,0,1 +681,postal service mail sorter,,2,0,0,1 +682,postmaster,,2,0,0,1 +683,postsecondary teacher,,2,0,0,1 +684,poultry cutter,,2,0,0,1 +685,poultry trimmer,,2,0,0,1 +686,power dispatcher,,2,0,0,1 +687,power distributor,,2,0,0,1 +688,power plant operator,,2,0,0,1 +689,power tool repairer,,2,0,0,1 +690,precious stone worker,,2,0,0,1 +691,precision instrument repairer,,2,0,0,1 +692,prepress technician,,2,0,0,1 +693,preschool teacher,,2,0,0,1 +694,priest,,2,0,0,1 +695,print binding worker,,2,0,0,1 +696,printing press operator,,2,0,0,1 +697,private detective,,2,0,0,1 +698,probation officer,,2,0,0,1 +699,procurement clerk,,2,0,0,1 +700,producer,,2,0,0,1 +701,product promoter,,2,0,0,1 +702,production clerk,,2,0,0,1 +703,production occupation,,2,0,0,1 +704,proofreader,,2,0,0,1 +705,property manager,,2,0,0,1 +706,prosthetist,,2,0,0,1 +707,prosthodontist,,2,0,0,1 +708,psychiatric aide,,2,0,0,1 +709,psychiatric technician,,2,0,0,1 +710,psychiatrist,,2,0,0,1 +711,psychologist,,2,0,0,1 +712,psychology teacher,,2,0,0,1 +713,public relations manager,,2,0,0,1 +714,public relations specialist,,2,0,0,1 +715,pump operator,,2,0,0,1 +716,purchasing agent,,2,0,0,1 +717,purchasing manager,,2,0,0,1 +718,radiation therapist,,2,0,0,1 +719,radio announcer,,2,0,0,1 +720,radio equipment installer,,2,0,0,1 +721,radio operator,,2,0,0,1 +722,radiologic technician,,2,0,0,1 +723,radiologic technologist,,2,0,0,1 +724,rail car repairer,,2,0,0,1 +725,rail transportation worker,,2,0,0,1 +726,rail yard engineer,,2,0,0,1 +727,rail-track laying equipment operator,,2,0,0,1 +728,railroad brake operator,,2,0,0,1 +729,railroad conductor,,2,0,0,1 +730,railroad police,,2,0,0,1 +731,rancher,,2,0,0,1 +732,real estate appraiser,,2,0,0,1 +733,real estate broker,,2,0,0,1 +734,real estate manager,,2,0,0,1 +735,real estate sales agent,,2,0,0,1 +736,receiving clerk,,2,0,0,1 +737,receptionist,,2,0,0,1 +738,record clerk,,2,0,0,1 +739,recreation teacher,,2,0,0,1 +740,recreation worker,,2,0,0,1 +741,recreational therapist,,2,0,0,1 +742,recreational vehicle service technician,,2,0,0,1 +743,recyclable material collector,,2,0,0,1 +744,referee,,2,0,0,1 +745,refractory materials repairer,,2,0,0,1 +746,refrigeration installer,,2,0,0,1 +747,refrigeration mechanic,,2,0,0,1 +748,refuse collector,,2,0,0,1 +749,regional planner,,2,0,0,1 +750,registered nurse,,2,0,0,1 +751,rehabilitation counselor,,2,0,0,1 +752,reinforcing iron worker,,2,0,0,1 +753,reinforcing rebar worker,,2,0,0,1 +754,religion teacher,,2,0,0,1 +755,religious activities director,,2,0,0,1 +756,religious worker,,2,0,0,1 +757,rental clerk,,2,0,0,1 +758,repair worker,,2,0,0,1 +759,reporter,,2,0,0,1 +760,residential advisor,,2,0,0,1 +761,resort desk clerk,,2,0,0,1 +762,respiratory therapist,,2,0,0,1 +763,respiratory therapy technician,,2,0,0,1 +764,retail buyer,,2,0,0,1 +765,retail salesperson,,2,0,0,1 +766,revenue agent,,2,0,0,1 +767,rigger,,2,0,0,1 +768,rock splitter,,2,0,0,1 +769,rolling machine tender,,2,0,0,1 +770,roof bolter,,2,0,0,1 +771,roofer,,2,0,0,1 +772,rotary drill operator,,2,0,0,1 +773,roustabout,,2,0,0,1 +774,safe repairer,,2,0,0,1 +775,sailor,,2,0,0,1 +776,sales engineer,,2,0,0,1 +777,sales manager,,2,0,0,1 +778,sales representative,,2,0,0,1 +779,sampler,,2,0,0,1 +780,sawing machine operator,,2,0,0,1 +781,scaler,,2,0,0,1 +782,school bus driver,,2,0,0,1 +783,school psychologist,,2,0,0,1 +784,school social worker,,2,0,0,1 +785,scout leader,,2,0,0,1 +786,sculptor,,2,0,0,1 +787,secondary education teacher,,2,0,0,1 +788,secondary school teacher,,2,0,0,1 +789,secretary,,2,0,0,1 +790,securities sales agent,,2,0,0,1 +791,security guard,,2,0,0,1 +792,security system installer,,2,0,0,1 +793,segmental paver,,2,0,0,1 +794,self-enrichment education teacher,,2,0,0,1 +795,semiconductor processor,,2,0,0,1 +796,septic tank servicer,,2,0,0,1 +797,set designer,,2,0,0,1 +798,sewer pipe cleaner,,2,0,0,1 +799,sewing machine operator,,2,0,0,1 +800,shampooer,,2,0,0,1 +801,shaper,,2,0,0,1 +802,sheet metal worker,,2,0,0,1 +803,sheriff's patrol officer,,2,0,0,1 +804,ship captain,,2,0,0,1 +805,ship engineer,,2,0,0,1 +806,ship loader,,2,0,0,1 +807,shipmate,,2,0,0,1 +808,shipping clerk,,2,0,0,1 +809,shoe machine operator,,2,0,0,1 +810,shoe worker,,2,0,0,1 +811,short order cook,,2,0,0,1 +812,signal operator,,2,0,0,1 +813,signal repairer,,2,0,0,1 +814,singer,,2,0,0,1 +815,ski patrol,,2,0,0,1 +816,skincare specialist,,2,0,0,1 +817,slaughterer,,2,0,0,1 +818,slicing machine tender,,2,0,0,1 +819,slot supervisor,,2,0,0,1 +820,social science research assistant,,2,0,0,1 +821,social sciences teacher,,2,0,0,1 +822,social scientist,,2,0,0,1 +823,social service assistant,,2,0,0,1 +824,social service manager,,2,0,0,1 +825,social work teacher,,2,0,0,1 +826,social worker,,2,0,0,1 +827,sociologist,,2,0,0,1 +828,sociology teacher,,2,0,0,1 +829,software developer,,2,0,0,1 +830,software engineer,,2,0,0,1 +831,soil scientist,,2,0,0,1 +832,solderer,,2,0,0,1 +833,sorter,,2,0,0,1 +834,sound engineering technician,,2,0,0,1 +835,space scientist,,2,0,0,1 +836,special education teacher,,2,0,0,1 +837,speech-language pathologist,,2,0,0,1 +838,sports book runner,,2,0,0,1 +839,sports entertainer,,2,0,0,1 +840,sports performer,,2,0,0,1 +841,stationary engineer,,2,0,0,1 +842,statistical assistant,,2,0,0,1 +843,statistician,,2,0,0,1 +844,steamfitter,,2,0,0,1 +845,stock clerk,,2,0,0,1 +846,stock mover,,2,0,0,1 +847,stonemason,,2,0,0,1 +848,street vendor,,2,0,0,1 +849,streetcar operator,,2,0,0,1 +850,structural iron worker,,2,0,0,1 +851,structural metal fabricator,,2,0,0,1 +852,structural metal fitter,,2,0,0,1 +853,structural steel worker,,2,0,0,1 +854,stucco mason,,2,0,0,1 +855,substance abuse counselor,,2,0,0,1 +856,substance abuse social worker,,2,0,0,1 +857,subway operator,,2,0,0,1 +858,surfacing equipment operator,,2,0,0,1 +859,surgeon,,2,0,0,1 +860,surgical technologist,,2,0,0,1 +861,survey researcher,,2,0,0,1 +862,surveying technician,,2,0,0,1 +863,surveyor,,2,0,0,1 +864,switch operator,,2,0,0,1 +865,switchboard operator,,2,0,0,1 +866,tailor,,2,0,0,1 +867,tamping equipment operator,,2,0,0,1 +868,tank car loader,,2,0,0,1 +869,taper,,2,0,0,1 +870,tax collector,,2,0,0,1 +871,tax examiner,,2,0,0,1 +872,tax preparer,,2,0,0,1 +873,taxi driver,,2,0,0,1 +874,teacher assistant,,2,0,0,1 +875,teacher,,2,0,0,1 +876,team assembler,,2,0,0,1 +877,technical writer,,2,0,0,1 +878,telecommunications equipment installer,,2,0,0,1 +879,telemarketer,,2,0,0,1 +880,telephone operator,,2,0,0,1 +881,television announcer,,2,0,0,1 +882,teller,,2,0,0,1 +883,terrazzo finisher,,2,0,0,1 +884,terrazzo worker,,2,0,0,1 +885,tester,,2,0,0,1 +886,textile bleaching operator,,2,0,0,1 +887,textile cutting machine setter,,2,0,0,1 +888,textile knitting machine setter,,2,0,0,1 +889,textile presser,,2,0,0,1 +890,textile worker,,2,0,0,1 +891,therapist,,2,0,0,1 +892,ticket agent,,2,0,0,1 +893,ticket taker,,2,0,0,1 +894,tile setter,,2,0,0,1 +895,timekeeping clerk,,2,0,0,1 +896,timing device assembler,,2,0,0,1 +897,tire builder,,2,0,0,1 +898,tire changer,,2,0,0,1 +899,tire repairer,,2,0,0,1 +900,title abstractor,,2,0,0,1 +901,title examiner,,2,0,0,1 +902,title searcher,,2,0,0,1 +903,tobacco roasting machine operator,,2,0,0,1 +904,tool filer,,2,0,0,1 +905,tool grinder,,2,0,0,1 +906,tool maker,,2,0,0,1 +907,tool sharpener,,2,0,0,1 +908,tour guide,,2,0,0,1 +909,tower equipment installer,,2,0,0,1 +910,tower operator,,2,0,0,1 +911,track switch repairer,,2,0,0,1 +912,tractor operator,,2,0,0,1 +913,tractor-trailer truck driver,,2,0,0,1 +914,traffic clerk,,2,0,0,1 +915,traffic technician,,2,0,0,1 +916,training and development manager,,2,0,0,1 +917,training and development specialist,,2,0,0,1 +918,transit police,,2,0,0,1 +919,translator,,2,0,0,1 +920,transportation equipment painter,,2,0,0,1 +921,transportation inspector,,2,0,0,1 +922,transportation security screener,,2,0,0,1 +923,transportation worker,,2,0,0,1 +924,trapper,,2,0,0,1 +925,travel agent,,2,0,0,1 +926,travel clerk,,2,0,0,1 +927,travel guide,,2,0,0,1 +928,tree pruner,,2,0,0,1 +929,tree trimmer,,2,0,0,1 +930,trimmer,,2,0,0,1 +931,truck loader,,2,0,0,1 +932,truck mechanic,,2,0,0,1 +933,tuner,,2,0,0,1 +934,turning machine tool operator,,2,0,0,1 +935,typist,,2,0,0,1 +936,umpire,,2,0,0,1 +937,undertaker,,2,0,0,1 +938,upholsterer,,2,0,0,1 +939,urban planner,,2,0,0,1 +940,usher,,2,0,0,1 +941,valve installer,,2,0,0,1 +942,vending machine servicer,,2,0,0,1 +943,veterinarian,,2,0,0,1 +944,veterinary assistant,,2,0,0,1 +945,veterinary technician,,2,0,0,1 +946,vocational counselor,,2,0,0,1 +947,vocational education teacher,,2,0,0,1 +948,waiter,,2,0,0,1 +949,waitress,,2,0,0,1 +950,watch repairer,,2,0,0,1 +951,water treatment plant operator,,2,0,0,1 +952,weaving machine setter,,2,0,0,1 +953,web developer,,2,0,0,1 +954,weigher,,2,0,0,1 +955,welder,,2,0,0,1 +956,wellhead pumper,,2,0,0,1 +957,wholesale buyer,,2,0,0,1 +958,wildlife biologist,,2,0,0,1 +959,window trimmer,,2,0,0,1 +960,wood patternmaker,,2,0,0,1 +961,woodworker,,2,0,0,1 +962,word processor,,2,0,0,1 +963,writer,,2,0,0,1 +964,yardmaster,,2,0,0,1 +965,zoologist,,2,0,0,1 diff --git a/datasrc/ballotitems.ods b/datasrc/ballotitems.ods new file mode 100644 index 0000000..7b28dd8 Binary files /dev/null and b/datasrc/ballotitems.ods differ diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..bd386fc --- /dev/null +++ b/functions.php @@ -0,0 +1,149 @@ + 5) { + for ($i = 2; $i < strlen($key) - 2; $i++) { + $resp[$i] = "*"; + } + } + return $resp; +} + +/** + * Check if the request is allowed + * @global array $VARS + * @return bool true if the request should continue, false if the request is bad + */ +function authenticate(): bool { + global $VARS, $SETTINGS; + // HTTP basic auth + if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) { + $username = $_SERVER['PHP_AUTH_USER']; + $password = $_SERVER['PHP_AUTH_PW']; + } else if (!empty($VARS['username']) && !empty($VARS['password'])) { + $username = $VARS['username']; + $password = $VARS['password']; + } else { + return false; + } + $user = User::byUsername($username); + if (!$user->exists()) { + return false; + } + if ($user->checkPassword($password, true)) { + // Check that the user has permission to access the app + $perms = is_array($SETTINGS['api_permissions']) ? $SETTINGS['api_permissions'] : $SETTINGS['permissions']; + foreach ($perms as $perm) { + if (!$user->hasPermission($perm)) { + return false; + } + } + return true; + } + return false; +} + +/** + * Get the User whose credentials were used to make the request. + */ +function getRequestUser(): User { + global $VARS; + if (!empty($_SERVER['PHP_AUTH_USER'])) { + return User::byUsername($_SERVER['PHP_AUTH_USER']); + } else { + return User::byUsername($VARS['username']); + } +} + +function checkVars($vars, $or = false) { + global $VARS; + $ok = []; + foreach ($vars as $key => $val) { + if (strpos($key, "OR") === 0) { + checkVars($vars[$key], true); + continue; + } + + // Only check type of optional variables if they're set, and don't + // mark them as bad if they're not set + if (strpos($key, " (optional)") !== false) { + $key = str_replace(" (optional)", "", $key); + if (empty($VARS[$key])) { + continue; + } + } else { + if (empty($VARS[$key])) { + $ok[$key] = false; + continue; + } + } + + if (strpos($val, "/") === 0) { + // regex + $ok[$key] = preg_match($val, $VARS[$key]) === 1; + } else { + $checkmethod = "is_$val"; + $ok[$key] = !($checkmethod($VARS[$key]) !== true); + } + } + if ($or) { + $success = false; + $bad = ""; + foreach ($ok as $k => $v) { + if ($v) { + $success = true; + break; + } else { + $bad = $k; + } + } + if (!$success) { + http_response_code(422); + sendJsonResp("Variable $bad is missing or invalid.", "ERROR"); + } + } else { + foreach ($ok as $key => $bool) { + if (!$bool) { + http_response_code(422); + sendJsonResp("Variable $key is missing or invalid.", "ERROR"); + } + } + } +} diff --git a/index.php b/index.php new file mode 100644 index 0000000..61ed1b9 --- /dev/null +++ b/index.php @@ -0,0 +1,79 @@ += 1) { + $VARS["action"] = $route[0]; +} +if (count($route) >= 2 && strpos($route[1], "?") !== 0) { + for ($i = 1; $i < count($route); $i++) { + if (empty($route[$i]) || strpos($route[$i], "=") === false) { + continue; + } + $key = explode("=", $route[$i], 2)[0]; + $val = explode("=", $route[$i], 2)[1]; + $VARS[$key] = $val; + } +} + +if (strpos($route[count($route) - 1], "?") === 0) { + $morevars = explode("&", substr($route[count($route) - 1], 1)); + foreach ($morevars as $var) { + $key = explode("=", $var, 2)[0]; + $val = explode("=", $var, 2)[1]; + $VARS[$key] = $val; + } +} +//////// + +//if (!authenticate()) { +// header('WWW-Authenticate: Basic realm="' . $SETTINGS['site_title'] . '"'); +// header('HTTP/1.1 401 Unauthorized'); +// die("401 Unauthorized: you need to supply valid credentials."); +//} + +if (empty($VARS['action'])) { + http_response_code(400); + sendJsonResp("No action was requested.", "ERROR"); +} + +if (!isset($APIS[$VARS['action']])) { + http_response_code(404); + sendJsonResp("Specified action not found.", "ERROR"); +} + +$APIACTION = $APIS[$VARS["action"]]; + +if (!file_exists(__DIR__ . "/actions/" . $APIACTION["load"])) { + http_response_code(501); + sendJsonResp("Specified action is defined but no implementation was found.", "ERROR"); +} + +if (!empty($APIACTION["vars"])) { + checkVars($APIACTION["vars"]); +} + +require_once __DIR__ . "/actions/" . $APIACTION["load"]; diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..a2c05c2 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,8 @@ +include.path=${php.global.include.path} +php.version=PHP_74 +project.license=mpl +source.encoding=UTF-8 +src.dir=. +tags.asp=false +tags.short=false +web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..b0f47fb --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,9 @@ + + + org.netbeans.modules.php.project + + + LecteServer + + + diff --git a/required.php b/required.php new file mode 100644 index 0000000..882bc63 --- /dev/null +++ b/required.php @@ -0,0 +1,67 @@ +" + . "" + . "" + . "Error" + . "" + . "

A fatal application error has occurred.

" + . "(This isn't your fault.)" + . "

Details:

" + . "

" . htmlspecialchars($error) . "

"); +} + +use Medoo\Medoo; + +$database; +try { + $database = new Medoo([ + 'database_type' => $SETTINGS['database']['type'], + 'database_name' => $SETTINGS['database']['name'], + 'server' => $SETTINGS['database']['server'], + 'username' => $SETTINGS['database']['user'], + 'password' => $SETTINGS['database']['password'], + 'charset' => $SETTINGS['database']['charset'] + ]); +} catch (Exception $ex) { + echo json_encode(["status" => "ERROR", "message" => "Server error. Try again later."], JSON_PRETTY_PRINT); + die(); +} + +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $VARS = $_POST; +} else { + $VARS = $_GET; +} \ No newline at end of file diff --git a/settings.template.php b/settings.template.php new file mode 100644 index 0000000..0b78410 --- /dev/null +++ b/settings.template.php @@ -0,0 +1,31 @@ + true, + "database" => [ + "type" => "mysql", + "name" => "lecte", + "server" => "localhost", + "user" => "lecte", + "password" => "", + "charset" => "utf8" + ], + "app_name" => "Lecte", + "accounthub" => [ + "api" => "https://apps.netsyms.com/account/api/", + "home" => "https://apps.netsyms.com/account/home.php", + "key" => "" + ], + "url_base" => "/lecteapi/", + "mapquest_key" => "", + "mapbox_key" => "", + "geoip_database" => __DIR__ . "/GeoLite2-City.mmdb", + "mapdataurl" => "https://maps.netsyms.net/data/v3.json" +];