// Example PHP script that retrieves library files.


// check if we are given a type post variable
if (isset($_POST['type']))
    $type = $_POST['type'];

// if retrieving a CIK library
if ($type=="CIK"){
    // Print out the header for our CSV file
    echo("CIK,CCC,Entry Name,Street 1,Street 2,City,State,Zip,Type,Contact Name,Contact Phone,Emails,IRS Number,File Number,Ticker,Comments,SROS,Investment Company Type,Accelerated Filer Status,Well-Known Seasoned Issuer,Voluntary Filer,Shell Company,Smaller Reporting Company,FYE,Grouping\r\n");
    
    // Print out the items from our library. These can be retrieved from a database, or compiled from any source.
    // This sample justs plain old sample data.
    echo("\"0123456789\",\"abcdef#7\",\"Above Average Company\",\"100 Mail Street\",\"Suite 300\",\"Normville\",\"NY\",\"10000\",\"company\",\"James West\",\"222 222-2222\",\"efiler@average.com;dfiler@average.com\",\"20-987654\",\"33-12345\",\"AVG\",\"\",\"\"\"AMEX\"\"\",\"\",\"Non-Accelerated Filer\",\"1\",\"1\",\"1\",\"0\",\"\",\"Smith, Smith, Smith and Smith\"\r\n");
    echo("\"0000990645\",\"abcde#g6\",\"Excellent Company\",\"180 East Shore Road\",\"\",\"Normville\",\"NY\",\"10000\",\"company\",\"Emma Filer\",\"(516) 222-4444\",\"efiler@excellentfund.com; bsmith@smithsmithsmithandsmith.com\",\"11-5555555\",\"1-9999\",\"EXC\",\"\",\"\"\"AMEX\"\"\",\"\",\"Non-Accelerated Filer\",\"1\",\"1\",\"1\",\"0\",\"\",\"Smith, Smith, Smith and Smith\"\r\n");
    echo("\"0088888888\",\"a#bcdeg9\",\"Example Inc.\",\"180 East Shore Road\",\"\",\"Normville\",\"NY\",\"10000\",\"company\",\"Steve Stevens\",\"(555) 555-5555\",\"efiler@excellentcompany.com\",\"\",\"\",\"\",\"\",\"\"\"AMEX\"\"\",\"\",\"Not Applicable\",\"1\",\"1\",\"1\",\"0\",\"\",\"The Law Firm\"\r\n");
    echo("\"0123456789\",\"abcdef#7\",\"Average Company\",\"100 Mail Street\",\"Suite 300\",\"Normville\",\"NY\",\"10000\",\"company\",\"James West\",\"222 222-2222\",\"efiler@average.com;dfiler@average.com\",\"20-987654\",\"33-123456\",\"AVG\",\"\",\"\"\"AMEX\"\"\",\"\",\"Non-Accelerated Filer\",\"1\",\"1\",\"1\",\"0\",\"\",\"Smith, Smith, Smith and Smith\"\r\n");
    echo("\"0000998923\",\"asdfgh#3\",\"Soap Corp.\",\"\",\"\",\"\",\"\",\"\",\"unknown\",\"Dave Washburn\",\"\",\"\",\"41-232344\",\"333-44444\",\"\",\"\",\"\",\"N-1\",\"\",\"1\",\"1\",\"1\",\"1\",\"\",\"The Law Firm\"\r\n");
    echo("\"0000054203\",\"alkj6$wa\",\"Progressive Relapse\",\"\",\"\",\"\",\"\",\"\",\"unknown\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"1\",\"1\",\"1\",\"0\",\"\",\"Novaworks\"\r\n");
    echo("\"0000099923\",\"asdfgh#3\",\"Movie Watchers Inc\",\"\",\"\",\"\",\"\",\"\",\"unknown\",\"Al Dente\",\"\",\"\",\"41-232344\",\"333-44444\",\"\",\"\",\"\",\"\",\"\",\"1\",\"1\",\"1\",\"0\",\"\",\"The Law Firm\"\r\n");
    echo("\"0000990644\",\"abcde#g7\",\"Excellent Fund\",\"180 East Shore Road\",\"\",\"Normville\",\"NY\",\"10000\",\"company\",\"Emma Filer\",\"(516) 222-4444\",\"efiler@excellentfund.com; bsmith@smithsmithsmithandsmith.com\",\"11-5555555\",\"1-9999\",\"EXC\",\"\\\"Cheese\\\"\",\"\"\"AMEX\"\"\",\"\",\"Non-Accelerated Filer\",\"1\",\"1\",\"1\",\"0\",\"\",\"Smith, Smith, Smith and Smith\"\r\n");
    echo("\"0000000009\",\"abcdef#1\",\"Large Company\",\"100 Mail Street\",\"Suite 300\",\"Normville\",\"NY\",\"10000\",\"company\",\"Bob Jenkins\",\"222 222-2222\",\"efiler@average.com;dfiler@average.com\",\"20-987654\",\"33-123456\",\"AVG\",\"\",\"\"\"AMEX\"\"\",\"\",\"Non-Accelerated Filer\",\"1\",\"1\",\"1\",\"0\",\"\",\"Smith, Smith, Smith and Smith\"\r\n");
    echo("\"0000990001\",\"abcde#g6\",\"Excellent Trust\",\"180 East Shore Road\",\"\",\"Normville\",\"NY\",\"10000\",\"company\",\"Emma Filer\",\"(516) 222-4444\",\"efiler@excellentfund.com; bsmith@smithsmithsmithandsmith.com\",\"11-5555555\",\"1-9999\",\"EXCT\",\"\",\"\"\"AMEX\"\"\",\"\",\"Non-Accelerated Filer\",\"1\",\"1\",\"1\",\"0\",\"\",\"Smith, Smith, Smith and Smith\"\r\n");
    echo("\"0000990681\",\"asdfgh1@\",\"Mane Street Trust\",\"\",\"\",\"\",\"\",\"\",\"unknown\",\"\",\"\",\"\",\"\",\"811-123456\",\"\",\"\",\"\"\"AMEX\"\"\",\"N-1A\",\"\",\"1\",\"1\",\"1\",\"1\",\"\",\"ABC Holdings\"\r\n");
    return;
    }

if ($type=="OWNERS"){
    //Print out the header for our CSV file
    echo("Reporting Owner CIK,Reporting Owner CCC,Name,Street 1,Street 2,City,State,Zip,Issuer CIK,Issuer Name,Is 10% Owner,Is Director,Is Officer,Is Other,Officer Title,Other Text,Signature,Ticker");
    
    // Print out the items from our library. These can be retrieved from a database, or compiled from any source.
    // This sample justs plain old sample data.    
    echo("\"0000141412\",\"ui4h$kkd\",\"Scott\",\"123 East Henrietta Rd\",\"\",\"Washington\",\"NJ\",\"16547\",\"0123812818\",\"Very Good Fund\",\"0\",\"1\",\"0\",\"0\",\"\",\"\",\"/s/ Scott\",\"VGF\"\r\n");
    echo("\"0000023342\",\"ui4h$kkd\",\"Josh\",\"333 Metro Park\",\"\",\"Rochester\",\"NY\",\"14623\",\"0123812818\",\"Very Good Fund\",\"0\",\"1\",\"0\",\"0\",\"\",\"\",\"/s/ Josh\",\"VGF\"\r\n");
    echo("\"0000023342\",\"ui4h$kkd\",\"Josh\",\"333 Metro Park\",\"\",\"Rochester\",\"NY\",\"14623\",\"0000238387\",\"Boolean Tech\",\"1\",\"0\",\"0\",\"0\",\"\",\"\",\"/s/ Josh\",\"BOOL\"\r\n");
    echo("\"0002342342\",\"ui4h$kkd\",\"David\",\"123 Fakestreet\",\"\",\"Hackettstown\",\"NJ\",\"7840\",\"0000123141\",\"OK Technology\",\"0\",\"0\",\"0\",\"0\",\"\",\"\",\"/s/ David\",\"OKT\"\r\n");
    return;
    }