Sunteți pe pagina 1din 20

Bet Me

Group 11
Team Members:
Blake Wong
Casey Steel
Sean Shen
Shaurting Chin
Eugene Cassel

Report Created by: Bassel Mahdawi

Table of Contents:
Page 3: Introduction
Pages 4 to 17: Code
Page 18: User Guide
Page 19: Personal Experiences
Page 20: Peer Evaluation Form

Intoduction:
The app we chose to create for this class is called Bet
Me. It is an app that provides basketball statistics and
odds in order to bet on basketball games successfully. It
works by searching for a certain team and bringing the
odds up for you to view.

Teaminfo.php
<?php
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" >
<title>Bet Me</title>
<!--[if IE]>
<script
src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[if lt IE 9]>
<script src="http://ie7js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->

<meta name="viewport" content="width=device-width, initial-scale=1,


maximum-scale=1">
<link rel="stylesheet"
href="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.1/jquery.mobile1.4.1.min.js"></script
<style>
p.notes {font-weight: bold}
</style>
</head>
<body>
<!-- THE START OF A MOBILE WEB PAGE: TEAM-------------------------------------------------------------->
<div data-role="page" id="team">
<!-- THE HEADER SECTION

--------------------------------->

5
<!-- THE CONTENT SECTION

-------------------------------->

<div data-role="content">
<ul data-role="listview">
<li><a href="#team_leader">Team Leader</a></li>
<li><a href="#team_members">Team Members</a></li>
</ul>
</div>

<!-- THE FOOTNOTE SECTION -------------------------------->


<div data-role="footer" data-position="fixed" data-id="nav" datatheme="b">
<div data-role="navbar">
<ul>
<li><a
href="http://localhost/mwa11/php/gr11_index.php">Home</a></li>
<li><a href="#team" class="ui-btn-active ui-statepersist">Team</a></li>
<li><a
href="http://localhost/MIS4312/project.php">Project</a></li>
</ul>
</div>
</div>
</div>
<!-- THE END OF A MOBILE WEB PAGE: TEAM----------------------------------------------------------------->

<!-- THE START OF A MOBILE WEB PAGE: TEAM_LEADER-------------------------------------------------------->


<div data-role="page" id="team_leader">
<!-- THE HEADER SECTION

<!-- THE CONTENT SECTION

--------------------------------->

--------------------------------->

<div data-role="content">
<p align="Center"><b>Blake Wong</b></p>
<p align="Center"><b>BS MIS</b></p>
<p align="Center"><b>Email: bcw091020@utdallas.edu</b></p>
</div>
<!-- THE FOOTNOTE SECTION --------------------------------->
<div data-role="footer" data-position="fixed" data-id="nav" datatheme="b">

6
<div data-role="navbar">
<ul>
<li><a
href="http://localhost/mwa11/php/gr11_index.php">Home</a></li>
<li><a href="#team" class="ui-btn-active ui-statepersist">Team</a></li>
<li><a
href="http://localhost/MIS4312/mwa11/php/project.php">Project</a></li>
</ul>
</div>
</div>
</div>
<!-- THE END OF A MOBILE WEB PAGE: TEAM_LEADER -------------------------------------------------->

<!-- THE START OF A MOBILE WEB PAGE: TEAM_MEMBERS------------------------------------------------------->


<div data-role="page" id="team_members">
<!-- THE HEADER SECTION

<!-- THE CONTENT SECTION

--------------------------------->

--------------------------------->

<div data-role="content">
<p align="Center"><b>Shaurting Shin</b></p>
<p align="Center"><b>BS MIS</b></p>
<p align="Center"><b> </b></p>
</div>
<div data-role="content">
<p align="Center"><b>Casey Steele</b></p>
<p align="Center"><b>BS MIS</b></p>
<p align="Center"><b> </b></p>
</div>
<div data-role="content">
<p align="Center"><b>Sean Shin</b></p>
<p align="Center"><b>BS MIS</b></p>
<p align="Center"><b> </b></p>
</div>
<div data-role="content">
<p align="Center"><b>Bassel Mahdawi</b></p>

7
<p align="Center"><b>BS MIS</b></p>
<p align="Center"><b> </b></p>
</div>
<div data-role="content">
<p align="Center"><b>Eugene Cassel</b></p>
<p align="Center"><b>BS MIS</b></p>
<p align="Center"><b> </b></p>
</div>

<!-- THE FOOTNOTE SECTION --------------------------------->


<div data-role="footer" data-position="fixed" data-id="nav" datatheme="b">
<div data-role="navbar">
<ul>
<li><a
href="http://localhost/mwa11/php/gr11_index.php">Home</a></li>
<li><a href="#team" class="ui-btn-active ui-statepersist">Team</a></li>
<li><a
href="http://localhost/MIS4312/mwa11/php/project.php">Project</a></li>
</ul>
</div>
</div>
</div>
<!-- THE END OF A MOBILE WEB PAGE: TEAM_MEMBERS -------------------------------------------------->
</body>
</html>

Registration.php
<?php
/**
* Created by JetBrains PhpStorm.
* User: Blake Wong
* Date: 3/31/14
* Time: 7:19 PM
* To change this template use File | Settings | File Templates.
*/
mysql_connect("localhost") or die(mysql_error());
mysql_select_db("BM_users") or die(mysql_error());

8
if (isset($_POST['submit'])) {

//Checks for blank fields


if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] ) {
die('Please fill in all of the required fields.');
}
// checks if the username is in use
if (!get_magic_quotes_gpc()) {
$_POST['username'] = addslashes($_POST['username']);
}
$usercheck = $_POST['username'];
$check = mysql_query("SELECT username FROM users WHERE username =
'$usercheck'")
or die(mysql_error());
$check2 = mysql_num_rows($check);

//If the username is already in use, this will be displayed


if ($check2 != 0) {
die('Sorry, the username '.$_POST['username'].' is already in use.');
}

//this makes sure both passwords entered match


if ($_POST['pass'] != $_POST['pass2']) {
die('Please enter matching passwords.');
}

// password encryption

// DB is now updated with new user


$insert = "INSERT INTO users (username, password)
VALUES ('".$_POST['username']."', '".$_POST['pass']."')";
$add_member = mysql_query($insert);
?>

<h1>Registered</h1>
<p>Thank you for registering with Bet Me. May the odds forever be in your
favor.</a>.</p>
<?php
}
else
{
?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">


<table border="0">
<tr><td>Username:</td><td>
<input type="text" name="username" maxlength="60">
</td></tr>
<tr><td>Password:</td><td>
<input type="password" name="pass" maxlength="10">
</td></tr>
<tr><td>Confirm Password:</td><td>
<input type="password" name="pass2" maxlength="10">

10

</td></tr>
<tr><th colspan=2><input type="submit" name="submit"
value="Register"></th></tr> </table>
</form>

<?php
}
?>

Login.php
<?php
/**
* Created by JetBrains PhpStorm.
* User: Blake Wong
* Date: 3/31/14
* Time: 7:30 PM
* To change this template use File | Settings | File Templates.
*/
// connect to BM_users DB
mysql_connect("localhost") or die(mysql_error());
mysql_select_db("BM_users") or die(mysql_error());

//Checks for login cookie


if(isset($_COOKIE['ID_my_site']))

//if there is, it logs you in and directs you to the home page.
{
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users WHERE username =
'$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{

11
if ($pass != $info['password'])
{
}
else
{
header("Location: gr11_index.php");

}
}
}

//if the login form is submitted


if (isset($_POST['submit'])) { // if form has been submitted

// makes sure they filled it in


if(!$_POST['username'] | !$_POST['pass']) {
die('You did not fill in a required field.');
}
// checks it against the database

if (!get_magic_quotes_gpc()) {
$_POST['email'] = addslashes($_POST['email']);
}
$check = mysql_query("SELECT * FROM users WHERE username =
'".$_POST['username']."'")or die(mysql_error());

12
//Gives error if user dosen't exist
$check2 = mysql_num_rows($check);
if ($check2 == 0) {
die('That user does not exist, please register with Bet Me. <a
href=registration.php>Click Here to Register</a>');
}
while($info = mysql_fetch_array( $check ))
{

//gives error if the password is wrong


if ($_POST['pass'] != $info['password']) {
die('Incorrect password, please try again.');
}
else
{

// if login is ok then we add a cookie


$_POST['username'] = stripslashes($_POST['username']);
$hour = time() + 3600;
setcookie(ID_my_site, $_POST['username'], $hour);
setcookie(Key_my_site, $_POST['pass'], $hour);

//then redirect them to the Home Page


header("Location: gr11_index.php");
}

13
}
}
else
{

// if they are not logged in


?>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<table border="0">
<tr><td colspan=2><h1>Login</h1></td></tr>
<tr><td>Username:</td><td>
<input type="text" name="username" maxlength="40">
</td></tr>
<tr><td>Password:</td><td>
<input type="password" name="pass" maxlength="50">
</td></tr>
<tr><td colspan="2" align="right">
<input type="submit" name="submit" value="Login">
</td></tr>
</table>
</form>
<?php
}

?>

14

<?php
// Connects to your Database
mysql_connect("localhost", "username", "password") or die(mysql_error());
mysql_select_db("BM_users") or die(mysql_error());

//checks cookies to make sure they are logged in


if(isset($_COOKIE['ID_my_site']))
{
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users WHERE username =
'$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{

//if the cookie has the wrong password, they are taken to the login
page
if ($pass != $info['password'])
{ header("Location: login.php");
}

//otherwise they are shown the admin area


else
{
echo "Admin Area<p>";
echo "Your Content<p>";

15
echo "<a href=logout.php>Logout</a>";
}
}
}
else

//if the cookie does not exist, they are taken to the login screen
{
header("Location: login.php");
}
?>

Gr11_index.php
<?php
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" >
<title>Mobile Web Applications</title>
<!--[if IE]>
<script
src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[if lt IE 9]>
<script src="http://ie7js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->

<meta name="viewport" content="width=device-width, initial-scale=1,


maximum-scale=1">
<link rel="stylesheet"
href="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.css" />

16
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.1/jquery.mobile1.4.1.min.js"></script
<style>
p.notes {font-weight: bold}
</style>
</head>
<body>
<!-- THE START OF A MOBILE WEB PAGE -------------------------->
<div data-role="page" id="home">
<!-- THE HEADER SECTION --------------------------------->
<div data-role="header" data-theme="b">
<h1>Semester Project</h1>
</div>

<!-- THE CONTENT SECTION -------------------------------->


<div data-role="content">
<div style="text-align: center;">
<h2>MIS4312: Group 11</h2>
<h2>Spring 2014</h2>
</div>
<p align="Center"><b>Bet Me</b></p>
<p align="Center"><b>Always have the best odds in your
hand.</b></p>
</div>

<!-- THE FOOTNOTE SECTION -------------------------------->


<div data-role="footer" data-position="fixed" data-id="nav" datatheme="b">
<div data-role="navbar">
<ul>
<li><a href="#home" class="ui-btn-active ui-statepersist">Home</a></li>
<li><a
href="http://localhost/mwa11/php/teaminfo.php">Team</a></li>
<li><a
href="http://localhost/MIS4312/mwa11/php/lecture_simple_mobile_web_page_pr
oject.php">Project</a></li>
</ul>
</div>
</div>

17

</div>
<!-- THE END OF A MOBILE WEB PAGE ----------------------------->

</body>
</html>

Logout.php
<?php
/**
* Created by JetBrains PhpStorm.
* User: Blake Wong
* Date: 3/31/14
* Time: 7:51 PM
* To change this template use File | Settings | File Templates.
*/
$past = time() - 100;
//A time set in the past will make the session void, therefore logging
out. See Ya!!
setcookie(ID_my_site, gone, $past);
setcookie(Key_my_site, gone, $past);
header("Location: login.php");
?>

18

Users Guide:
By using the mobile web application Bet Me, the user will have access to tons of data
that will help them make informed decisions on hot to bet on professional basketball games. The
first screen that will appear when the web app has loaded will be the login screen. From here, a
new user can register, and a returning user can sign in. After the user has logged in, they will
have access to the database. From here, the user will be able to view all the professional
basketball teams basic and advanced statistics. The app is designed to be simple, so the only
steps are:
1. Login/Register
2. Search/View Statistics
There are certain statistics that should be the focus of your attention. Since the app
focuses on making a team decision and not individual player statistics, the focus should be on the
team dynamic. The top statistical categories for making an informed betting decision would be:

Venue (Home or road game)

How many games have been played by the team in the last few days

Points Per Game (PPG)

Points Allowed Per Game

For example, if the team played a game the night before, then there is a higher chance the team
loses because they are tired from the night before. The venue matters because all teams perform
better at home than they do on the road. With the hometown fans supporting them the players get
an energy boost. PPG shows how effective your offense is and points allowed per game shows
your defenses capabilities. After studying these statistical categories the odds will be in your
favor.

19

Personal Experiences:
Overall, this project was a success. Even though we werent able to perfect the application
completely, I feel like I learned a lot.
The good:

I was able to connect with new people that are in the same field as me.
I was able to learn how to develop a web application using tools I have never used before.
Group meetings were successful.
The team showed dedication to the project.
We had fun!

The bad:

Sometimes we got stuck on a certain part of the project for a long time.

20

MIS4312 Mobile Web App Development


Semester Project Peer Evaluation
My Group: Group 11_______
My Name: Bassel Mahdawi

I evaluate other team members contribution to the project as follows:


On scale of 10
10 is the highest
Team member #2: Blake Wong ______________________ Score:
Team member #3: Casey Steele ______________________ Score:
Team member #4: Sean Shen _______________________ Score:
Team member #5: Shaurting Chin _____________________ Score:
Team member #6: Eugene Cassel _____________________ Score:

S-ar putea să vă placă și