Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 23
Like Tree10Likes

Thread: Need help. Need to create a fire dept related website

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    15
    Member #
    37740

    Need help. Need to create a fire dept related website

    Looking to build a website where I have word and adobe docs that are associated to a building.

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,715
    Member #
    5580
    Liked
    717 times
    You'll have explain more ... any website can have files uploaded that people can link to. Not sure what you mean.


  4. #3
    Junior Member
    Join Date
    Nov 2013
    Posts
    15
    Member #
    37740
    I need to be able to input a number (of a building) and it brings up the plans (.pdf) and the cover sheet (.doc), and be able to display, and move from one pdf or doc to another.

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,715
    Member #
    5580
    Liked
    717 times
    They key will be how you name the PDF files. Let's say you have a building with 3 floors ...

    Give the building a number of some kind, and then arrange the PDF's (filenames) in some logical order.
    Upload all of the PDF files to one directory, where all of the PDF's are stored.

    Then create a text file .. using Notepad. That file might be called "catalog.txt". Each line of the file is one PDF. The line describes the building address, ID number (maybe the address number), the PDF filename, and a Description.

    Example, this text file might be called "catalog.txt" ...

    Address | Number | PDF | Description
    813 Elm St.|813|p1-1.pdf|1st Floor Section 1
    813 Elm St.|813|p1-2.pdf|1st Floor Section 2
    813 Elm St.|813|p2.1.pdf|2nd Floor Section 1

    Now, a PHP script can pick out the group of PDF's for any building ID and then will logically arrange them by the way you named the PDF files.

    It can search by building address, building ID, or any of the words in the description.

    When you get that far, let me know.
    Firemann25 likes this.


  6. #5
    Junior Member
    Join Date
    Nov 2013
    Posts
    15
    Member #
    37740
    will do. Thanks

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,715
    Member #
    5580
    Liked
    717 times
    When you get a .txt file created, list the first 10 lines of it so I can see how you did each line. I separate my fields with a pipe |

    You can separate with a comma if you wish, but some descriptions have commas in them, so that's why I use a character that isn't commonly used.

    You can also add more fields on each line ... perhaps describing where fire hose connections are located?
    Firemann25 likes this.


  8. #7
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    I don't have much to add to what Max said, other than that I use three pipes (|||) instead of one as a delimiter. I've found that people use pipes the odd time in descriptions, but no one has used three pipes yet.
    Firemann25 likes this.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  9. #8
    Junior Member
    Join Date
    Nov 2013
    Posts
    15
    Member #
    37740
    Number||| type ||| Files ||| description
    100 ||| word ||| 100-coversheet ||| Coversheet
    100 ||| pdf ||| 100-post office-1st flr ||| 1st Floor Plan
    100 ||| pdf ||| 100-post office-2ND flr ||| 2nd Floor Plan
    103 ||| word ||| 103-pw ||| Coversheet
    103 ||| First Floor ||| 103-public works-flr1 ||| 1st floor plan
    103 ||| Second Floor ||| 103-public works-flr2 ||| 2nd floor plan

    This is how I set this up.

  10. #9
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    I'd take the spaces out between the pipes. Your pipes are your delimiter (separator) so you don't need the spaces.

    Max will have to help you from here on out, though.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  11. #10
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,715
    Member #
    5580
    Liked
    717 times
    Well that's pretty close ... you actually want to have the filename there as well.
    Also, removed unwanted spaces.
    You already know what type is it by the file extension (.pdf, .doc, etc)

    Number||| Files ||| description
    100|||100-coversheet.doc|||Coversheet
    100|||100-post office-1st flr.pdf|||1st Floor Plan
    100|||100-post office-2ND flr.pdf|||2nd Floor Plan
    103|||103-pw.doc|||Coversheet
    103|||103-public works-flr1.pdf|||1st floor plan
    103|||103-public works-flr2.pdf|||2nd floor plan

    Let's say you named that file "catalog.txt" and you uploaded it to your website ....

    This would be an example of a PHP script ....
    Save the "catalog.txt" file above and then upload this script, call it "test.php" and run it... just as a test.

    Code:
    <?php
    
    // let's say we're searching for only 103
    $search="103";
    
    // open the file and put it into an array.
    $file=file("catalog.txt");
    
    // loop through and pick out the codes that match the search parameter
    foreach($file as $row){
    list($code, $filename, $description) = explode('|||',$row);
        // print out the results only if the search matches the code
        if($search==$code){
        echo $description." - <a href='files/".$filename."'>".$filename."</a><br />";
        }
    }
    ?>
    That code is just a test to make sure your "catalog.txt" file works and a place to start.

    I don't know where your pdf, doc files are stored, so I just assume you might have then in a directory called "files/".

    Next, there would be a form for the user to enter the "code". And then an actual download script instead of just a link. It could also search the description, but for now, I'm just searching the code. But this is how it is done. Let me know if the test script works (I didn't test it).

    One more thing ... if you were to make them ALL PDF files, that would make this all easier and better for you. The fact that some are PDF, DOC, DOCX, etc, will add more work to the scripting.


    .
    Last edited by mlseim; Nov 20th, 2013 at 12:44 PM.
    Firemann25 likes this.



Page 1 of 3 1 2 3 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:06 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com