McSA_Checkin
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:
*****************
McSA Check-in App
*****************

Written by KHALID AZIZ for NORTHWESTERN UNIVERSITY's MUSLIM-CULTURAL STUDENTS ASSOCIATION.

This app is similar to the checkin apps found on Facebook etc, except that it is specialized to the Northwestern campus in Evanston. Currently, users can register, log-in, checkin into various significant on-campus locations, and see where other users have checked in. There are two views users can choose from when exploring other checkins: the default map-view, which contains a Google Map with markers for various locations, and a list view, which lists out all checkins.

FOR IMPLEMENTATION:

* Copy the project folder into your server.
* In mcsa_checkin.php, add the username and password of your db.
* Set up the db as follows:
  - create a database called mcsa_checkin_app.
  - in the db, create a table called users_table with the following specs:
+------------+-------------+------+-----+-------------------+----------------+
| Field      | Type        | Null | Key | Default           | Extra          |
+------------+-------------+------+-----+-------------------+----------------+
| user_id    | int(4)      | NO   | PRI | NULL              | auto_increment |
| password   | varchar(30) | YES  |     | NULL              |                |
| firstname  | varchar(30) | YES  |     | NULL              |                |
| lastname   | varchar(30) | YES  |     | NULL              |                |
| datejoined | timestamp   | NO   |     | CURRENT_TIMESTAMP |                |
| email      | varchar(50) | YES  |     | NULL              |                |
| approved   | tinyint(1)  | YES  |     | 0                 |                |
+------------+-------------+------+-----+-------------------+----------------+

  - create a table called locations_table with the following specs:
+-------------+----------------+------+-----+---------+----------------+
| Field       | Type           | Null | Key | Default | Extra          |
+-------------+----------------+------+-----+---------+----------------+
| location_id | int(6)         | NO   | PRI | NULL    | auto_increment |
| name        | varchar(30)    | YES  |     | NULL    |                |
| latitude    | decimal(17,15) | YES  |     | NULL    |                |
| longitude   | decimal(17,15) | YES  |     | NULL    |                |
+-------------+----------------+------+-----+---------+----------------+

  - create a table called checkin_table with the following specs:
+-------------+-----------+------+-----+-------------------+----------------+
| Field       | Type      | Null | Key | Default           | Extra          |
+-------------+-----------+------+-----+-------------------+----------------+
| checkin_id  | int(6)    | NO   | PRI | NULL              | auto_increment |
| user_id     | int(6)    | YES  |     | NULL              |                |
| location_id | int(6)    | YES  |     | NULL              |                |
| timestamp   | timestamp | NO   |     | CURRENT_TIMESTAMP |                |
+-------------+-----------+------+-----+-------------------+----------------+

* If you want to change any names, you're going to have to modify the PHP file correspondingly.
* Add the locations you want into the DB manually. There's currently no form to this via AJAX.
* Users do have a registration form, but they'll beed to be approved manually by whoever has access to the db.
* Modify the Google Map coordinates to wherever you want them to point to in the viewcheckins.js file. Currently, they point to the Northwestern Evanston campus. You might want to tinker around with the zoom etc too, depending on your needs. 
* Once all of that is set up, the application should be running. (I apologize if it's not, and it's my fault; I set up the workspace a while back and I'm recalling all of these from memory.)

Another note:
* Currently, the MySQL code in the PHP file is set up to return ALL checkins. This is for testing purposes. If your app gains significant use, you might want to limit that to an appropriate period, like a week or a day or something.


CURRENT APP STRUCTURE:

* There's one PHP file called mcsa_checkin.php that handles all the server-side stuff. All the JS files query db via the PHP file.
* Each page in the app has an HTML file and a corresponding JS file. The code is JS-heavy, with HTML only providing the barebones structure of the forms etc.
* A CSS file handles the CSS. Since this isn't a standalone website, feel free to modify/merge that into something else.


TOOLS USED:

* PHP 5.3.3
* MySQL 5.1.49-1ubuntu8.1
* Google Maps API v3	--src=http://maps.google.com/maps/api/js?sensor=false
* jQuery v1.4.2 	--src=http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js


POTENTIAL FUTURE IMPROVEMENTS:

* Form for admins to approve users.
* Form for admins to add locations.
* Checkin via text. 
* Check a location for checkins via text.
* Consolidate the multiple Javascript files into one JS file.

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。