SQL Based Phone Directory

Moodle Entry

Goal

To examine and set up an SQL based C++/Web phone directory.

You will use from the following project: https://github.com/expertlearningsystems/PhoneBookComplete

The project can be tried here: https://cslab.kenyon.edu/class/ssd/skon/PhoneAppComplete/phoneApp.html

Method

Step 1 - Get the demo software running from your account and with your Database:

Download the following project and make the required changes to turn it into your own project: https://github.com/expertlearningsystems/PhoneBookComplete

This should be done with the followings:

  1. (MAC) Open a terminal
    type: "ssh username@cslab.kenyon.edu"
    Enter your student ID as the password

    (Windows) Download Putty. Run Putty. Enter "cslab.kenyon.edu" for IP, Hit open. Hit "Ok" for the security warning. Enter your Kenyon username and your student ID for password.

  2. Get the PhoneBookComplete project with the following command (only works if you have a github account, and have accessed the collaborate invitation I sent):
    git clone https://github.com/expertlearningsystems/PhoneBookComplete
 

Get it running. You will need to:

  1. Create your own version of the database.
  2. Create the Folder PhoneBookComplete in /var/www/html/class/ssd/yourusername/
  3. Change the names (skon) in the software
    • in Makefile change user to your username
    • in the Javascript (phoneApp.js) change the, and cgi program name to your username:
      $.ajax({ url: '/cgi-bin/<i><b>skon</b></i>_phoneAppComplete.cgi?deleteid='+$(this).attr('ID')+'&operation=delete',
    • In PhoneBook.h to change USER and DB to your username and PASS to your student ID
      #define HOST "localhost"
      #define USER "<i>skon</i>"
      #define DB "<i>PhoneAppDB</i>"
      #define PASS "<i>password</i>"
    • In phoneApp.cpp change logfile name you your username
  4. Add a PhoneBookComplete directory to your web directory
    mkdir /var/www/html/class/ssd/username/PhoneAppComplete
  5. Type "make" to build and deploy your application
  6. Add the Routines to the Database (see next step)
  7. Go to the app in a browser (with your username):
    https://cslab.kenyon.edu/class/ssd/<i><b>username</b></i>/PhoneAppComplete/
  8. Add some records to the data base.
Below is the structure of the database table you will need. You need to create a table named "Phonebook" with the same fields and types, in you database:

Screen_Shot_2018-02-15_at_4.27.14_PM.png

Note the "AUTO_INCREMENT" for the ID field. This field is used as the unique ID for every row, and can be used for unambiguously refering to a record when changing or deleting. The "AUTO_INCREMENT" attribute assigns unique inter values for each record in a sequence. To do this click the "A_I" box for the field (you must scroll to the right to see it). This check box is avalable both then creating the table, and when editing the structure.

Step 2 - Review the procedures which could be added to

The following routines will need to be added in the "Procedures" tab to your database to finish the app (must be in the database, not the table, to see this tab):

Screen_Shot_2018-02-15_at_4.30.07_PM.png


Screen_Shot_2018-02-15_at_4.34.48_PM.png
Screen_Shot_2018-02-15_at_4.35.04_PM.png



Screen_Shot_2018-02-15_at_4.36.22_PM.png

You would need to add these to you new Phonebook database.

Screen_Shot_2018-02-20_at_2.56.06_PM.png


Screen_Shot_2018-02-20_at_2.55.50_PM.png

  • Screen_Shot_2018-02-20_at_2.55.24_PM.pngg: Screen_Shot_2018-02-20_at_2.54.27_PM.png
Step 3 - Get the system to work with your database.

Turn in a link to you running application.

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng Screen_Shot_2018-02-15_at_4.27.14_PM.png r1 manage 63.8 K 2018-02-15 - 21:27 JimSkon  
PNGpng Screen_Shot_2018-02-15_at_4.30.07_PM.png r1 manage 109.4 K 2018-02-15 - 21:30 JimSkon  
PNGpng Screen_Shot_2018-02-15_at_4.34.48_PM.png r1 manage 116.9 K 2018-02-15 - 21:37 JimSkon  
PNGpng Screen_Shot_2018-02-15_at_4.35.04_PM.png r1 manage 99.7 K 2018-02-15 - 21:37 JimSkon  
PNGpng Screen_Shot_2018-02-15_at_4.35.34_PM.png r1 manage 60.9 K 2018-02-15 - 21:37 JimSkon  
PNGpng Screen_Shot_2018-02-15_at_4.35.48_PM.png r1 manage 34.8 K 2018-02-15 - 21:37 JimSkon  
PNGpng Screen_Shot_2018-02-15_at_4.35.59_PM.png r1 manage 33.1 K 2018-02-15 - 21:37 JimSkon  
PNGpng Screen_Shot_2018-02-15_at_4.36.22_PM.png r1 manage 89.6 K 2018-02-15 - 21:37 JimSkon  
PNGpng Screen_Shot_2018-02-20_at_2.54.27_PM.png r1 manage 107.7 K 2018-02-20 - 19:57 JimSkon  
PNGpng Screen_Shot_2018-02-20_at_2.55.24_PM.png r1 manage 84.6 K 2018-02-20 - 19:57 JimSkon  
PNGpng Screen_Shot_2018-02-20_at_2.55.50_PM.png r1 manage 87.0 K 2018-02-20 - 19:57 JimSkon  
PNGpng Screen_Shot_2018-02-20_at_2.56.06_PM.png r1 manage 84.5 K 2018-02-20 - 19:57 JimSkon  
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2018-02-22 - JimSkon
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback