### Technique of preparation of server programs

#### I. Structure and appointment of server programs

After registration of the contract with the provider giving hostings-services, he will inform you the following data: the domain name, the login, the password, the e-mail address, and also the name of two directories. Pages of a site are stored in one directory, conditionally we name this directory "home\", and in another executed programs contain, conditionally we name this directory "cgi-bin\". Actually these directories can be called in another way, in this case simply replace the names presented in our template on what are given by the provider.
In directories "home\" and "cgi-bin\" you, probably, want to create subdirectories in which files of the future site will be stored. It can be, for example, in case if you wish to organise a site for a network of the hotels located in different cities, and, maybe, and in the different countries. Directories in this case can have the following appearance: - "home\Country\City\Hotel\" and "cgi-bin\Country\City\Hotel\" .
If you create a site only for one hotel, you will not create internal directories. Therefore further the unessential directories will be concluded in square brackets.
In a template of a site offered you the tree of directories has the following appearance :

1. - "cgi-bin\[Country\City\Hotel\]" - directory with executed programs.
   In a directory following files should contain:

   | - "br.cgi" - the program which accepts orders for reservation, writes them in a file, and makes the response about successful or unsuccessful reception.

2. - "home\" - directory with site pages. In it contain :
   1. "FilesForHotel\" - directory in which the files necessary for design of all pages of a site are stored. In a directory "FilesForHotel\" following files should contain :
      - - "style.css" - file of styles for all pages of a site,
      - - "blue.jpg" - file with background drawing,
      - - "vert_line.gif" - drawing with a vertical line,
      - - "pust.htm" - auxiliary file.
   2. "[Country\City\Hotel\]site pages".
      Site structure :
      1. - "Photos\" - directory in which photos of a building and rooms of the hotel contain. For example, files can be called so : "hotel.jpg", "t1.jpg", "t2.gif", "t3.jpg" and so on.
      2. - "index.html" - the main page of a site of hotel, original "title page". Contains a photo of a facade of hotel, the information on given services.
      3. - "opred_types.php" - the program which defines, how many and what types of the hotel rooms exist in the given hotel. The information undertakes from a file "hotel_types.htm", sent on a server the manager of hotel, also deduces them in the form of the table at call " nomers.php ". How to send a file "hotel_types.htm" on a server read in the help on system "Hotel-Admin".
      4. - "nomers.php" - contains the information on hotel rooms with photos, the prices etc. In the bottom part of a window contains the form for inquiry input about presence of vacant rooms in hotel on any interval of time set by the client.
      5. - "opred_dann.php" - the program which reads the current data about presence of vacant rooms and forms programs on JavaScript.
      6. - "sw_nomers.php" - programs on JavaScript. In this unit following functions are fulfilled :
         - Checks correctness of data entry by the client in inquiry about presence of vacant rooms.
         - Defines, how many free places are available in hotel during the time period set by the client.
         - Creates a window and outputs in it results of inquiry.
      7. - "br.php" - contains the form for input of the order on reservation.
      8. - "br.js" - programs on JavaScript. Executable functions :
         - Checks correctness and sufficiency of the inputed data in the order on reservation - surname presence, presence of amount of ordered rooms, types of rooms and amount of places in rooms.
         - Checks correctness of the inputed dates of an interval of reservation.
         - Checks presence of phone and an e-mail address of the client.
         - Cuts off too long text.
         - Encodes the data according to characters codes of the text of the order.
      9. - "email.js" - programs on JavaScript. Forms the address hotel e-mail so that to protect it from a spam.
      10. - "see-on-line.php" - page on which Internet cameras are located. They allow clients to see in real-time mode hotel, weather conditions and even to organise it-lajn - appointments.

#### II. Designing of files of a site

Run (two times fast click a filename) the program " PS.exe ". After program start fill all necessary fields. If you do not wish to include in the future site any information, input nothing in an appropriate field.

- Enter the hotel name. This field is mandatory for filling, the name of hotel will be placed in all pages of a site. All other fields can be empty. Thus in appropriate places of pages of a site there will be skips.
- Enter an e-mail address, phone, the post address and the scheme of journey to hotel. In the e-mail it is necessary to type a part of the address to '@' character and a part of the address after '@' character. It is not necessary (!) to type the character '@'.
- Enter the subdirectory name in "home\" and "cgi-bin\" , in which files of a site of hotel will be allocated. Press the button [Example] being nearby for to look, how similar subdirectories can look. (For example, " Moskva\Kosmos ").
- Further type the name of the file containing a photo of hotel. Press the button being nearby [Example] for reception of the name of a file with a hotel photo. (For example, " hotel.jpg ").
- Following fields contain the information on a location of hotel and on services given by it. You can press buttons [Example] being nearby and fill fields at own discretion.
- If you do not wish to place a photo of hotel rooms, put a tick opposite to words "or to refuse a photo of hotel rooms".
  If you wish to place photos of hotel rooms in a site of hotel, at first photograph a hotel room of each type. Photos of types of hotel rooms should be called " tN ", where N - number of hotel type. Initial number is equal 1, final - to amount of types of hotel rooms. Types of hotel rooms and order their followings are defined in system "Hotel-Admin". There should be a strict conformity between numbers of hotel types in system "Hotel-Admin" and numbers of photos on a hotel site.
  Extension of files with photos - either "*.jpg", or "*.gif". By default, all photos have extension "*.jpg". If all photos of your hotel types have extension "*.jpg", type nothing, and pass to filling of a following field. If some photos have extension "*.gif", type number of type of the hotel room which photo has extension "*.gif", and press the button [Input]. That is, it should be number from 1 to amount of types of hotel rooms. It is necessary to do this operation so much time, how many is available photos with extension "*.gif". Numbers which you have entered, will be placed in the list which is near to the button [Input]. You can remove undesirable number from the list, having selected it and having pressed the button [Delete].
  For example, let there are following photos of hotel rooms : "t1.jpg", "t2.gif", "t3.jpg". In the field of input "Number of a photo with extension 'gif '" it is necessary to input number '2' and to press the button [Input].
- Type a full way to the program "br.cgi". This way can look as follows :"http:\\Domen\cgi-bin\[Country\City\Hotel\]". To get acquainted with a format it is possible, having pressed the button [Example] being nearby.
- If you wish to include in a file page "see-on-line", put a tick about words "to include service see-on-line", if do not want, do not tick off. Service "see-on-line" is interesting additional service which will allow hotel to involve more clients. In certain places of hotel (before a facade, in a hall etc.) are established Internet cameras. After that, in a mode of real time clients can look a facade of hotels, weather conditions and even arrange on-line - meetings to relatives and colleagues.
- Press the button [Design]. All necessary files will be placed accordingly in a directory "home\[Country\City\Hotel\]" and "cgi-bin\ [Country\City\Hotel\]".
- Further all files from directories "home\" and "cgi-bin\" it is necessary to place in directories corresponding to these directories on a server. Service FTP should be given the provider.
  Attention !
  - All executed programs ("br.cgi") should be copied on a server in Ascii mode.
  - Access rights on all directories and site files should be not more low 755.
  Note.
  If you some times designed a site (pressed the button [Design]) on a server place only last version. For example, if you did not enter subdirectories in directories "home\" and "cgi-bin\" files of site will be in directories "home\" and "cgi-bin\". If in last version you have entered subdirectories in directories "home\" and "cgi-bin\", for example, "Country\City\Hotel\" files will be placed in directories "home\Country\City\Hotel\" and "cgi-bin\Country\City\Hotel\". Thus files of the previous version remain in directories "home\" and "cgi-bin\". And so, copy on a server only files from "home\Country\City\Hotel\" and "cgi-bin\Country\City\Hotel\", and files of a site of the previous version simply remove.
- For site start in an Internet window specify in an address field of a window a full way to a file "index.html" . For example, "http://hotel-portal/Country/City/Hotel/".
- Look attentively all pages of the site. If you wish to change something, open a corresponding file in a window "Notepad", edit this file at own discretion, write a file and place it on a server.
- If you want to include any services which have been not included earlier in the file, again run the program "PS.exe", input the data anew, design a site and place files on a server.

#### III. Consultations concerning installation, adjustment and operation

If you had complexities at adjustment of the server programs, you can :

- Once again attentively read the given instruction on system adjustment.
- Read questions and answers to them in section "FAQ". Perhaps, there you will find the answer to your question.
- Write the letter with a question on e-mail.