Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

Commit

Permalink
Factoring out header and footer include files. (should have been done…
Browse files Browse the repository at this point in the history
… a long time ago) And laying groundwork for Ticketing system
  • Loading branch information
Tyler Hall committed Jun 21, 2010
1 parent f1d8d8c commit fcfb338
Show file tree
Hide file tree
Showing 22 changed files with 263 additions and 699 deletions.
22 changes: 2 additions & 20 deletions application.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,7 @@
$tweet_terms = $app->tweet_terms;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Shine</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
<link rel="stylesheet" href="css/yuiapp.css" type="text/css">
<link rel="alternate" type="application/rss+xml" title="Appcast Feed" href="appcast.php?id=<?PHP echo $app->id; ?>" />
</head>
<body class="rounded">
<div id="doc3" class="yui-t6">

<div id="hd">
<?PHP include('inc/header.inc.php'); ?>
</div>
<?PHP include('inc/header.inc.php'); ?>

<div id="bd">
<div id="yui-main">
Expand Down Expand Up @@ -262,7 +247,4 @@
</div>
</div>

<div id="ft"></div>
</div>
</body>
</html>
<?PHP include('inc/footer.inc.php'); ?>
24 changes: 2 additions & 22 deletions feedback-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,7 @@
$f->update();
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Shine</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
<link rel="stylesheet" href="css/yuiapp.css" type="text/css">
<style type="text/css" media="screen">
th { text-align:right; font-weight:bold; }
</style>
</head>
<body class="rounded">
<div id="doc3" class="yui-t0">

<div id="hd">
<?PHP include('inc/header.inc.php'); ?>
</div>
<?PHP include('inc/header.inc.php'); ?>

<div id="bd">
<div id="yui-main">
Expand Down Expand Up @@ -119,7 +102,4 @@
</div>
</div>

<div id="ft"></div>
</div>
</body>
</html>
<?PHP include('inc/footer.inc.php'); ?>
21 changes: 2 additions & 19 deletions feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,7 @@
$feedback = DBObject::glob('Feedback', "SELECT * FROM shine_feedback ORDER BY dt DESC");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Shine</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
<link rel="stylesheet" href="css/yuiapp.css" type="text/css">
</head>
<body class="rounded">
<div id="doc3" class="yui-t0">

<div id="hd">
<?PHP include('inc/header.inc.php'); ?>
</div>
<?PHP include('inc/header.inc.php'); ?>

<div id="bd">
<div id="yui-main">
Expand Down Expand Up @@ -81,7 +67,4 @@
</div>
</div>

<div id="ft"></div>
</div>
</body>
</html>
<?PHP include('inc/footer.inc.php'); ?>
9 changes: 9 additions & 0 deletions inc/footer.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div id="ft"></div>
</div>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.fancybox-1.2.1.pack.js"></script>
<script type="text/javascript" charset="utf-8">
$(".fb").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false });
</script>
</body>
</html>
37 changes: 15 additions & 22 deletions inc/header.inc.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
<?PHP
if(rand(1,30) == 1)
include 'tweet-cron.php';
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Shine</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
<link rel="stylesheet" href="css/yuiapp.css" type="text/css">
<link rel="stylesheet" href="js/jquery.fancybox.css" type="text/css" media="screen">
</head>
<body class="rounded">
<div id="doc3" class="yui-t6">

$db = Database::getDatabase();
$feedback_count = $db->getValue("SELECT COUNT(*) FROM shine_feedback WHERE new = 1");
$tweet_count = $db->getValue("SELECT COUNT(*) FROM shine_tweets WHERE new = 1");
?>
<div id="navigation">
<ul id="primary-navigation">
<li<?PHP if($nav == 'applications') : ?> class="active"<?PHP endif; ?>><a href="index.php">Applications</a></li>
<li<?PHP if($nav == 'orders') : ?> class="active"<?PHP endif; ?>><a href="orders.php">Orders</a></li>
<li<?PHP if($nav == 'feedback') : ?> class="active"<?PHP endif; ?>><a href="feedback.php">Feedback (<?PHP echo $feedback_count; ?>)</a></li>
<li<?PHP if($nav == 'tweets') : ?> class="active"<?PHP endif; ?>><a href="tweets.php">Tweets (<?PHP echo $tweet_count; ?>)</a></li>
<li<?PHP if($nav == 'stats') : ?> class="active"<?PHP endif; ?>><a href="stats.php">Sparkle Stats</a></li>
</ul>
<div id="hd">
<?PHP include('inc/nav.inc.php'); ?>
</div>

<ul id="user-navigation">
<li><a href="users.php">Users</a></li>
<li><a href="settings.php">Settings</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
<div class="clear"></div>
</div>
25 changes: 25 additions & 0 deletions inc/nav.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?PHP
if(rand(1,30) == 1)
include 'tweet-cron.php';

$db = Database::getDatabase();
$feedback_count = $db->getValue("SELECT COUNT(*) FROM shine_feedback WHERE new = 1");
$tweet_count = $db->getValue("SELECT COUNT(*) FROM shine_tweets WHERE new = 1");
?>
<div id="navigation">
<ul id="primary-navigation">
<li<?PHP if($nav == 'applications') : ?> class="active"<?PHP endif; ?>><a href="index.php">Applications</a></li>
<li<?PHP if($nav == 'orders') : ?> class="active"<?PHP endif; ?>><a href="orders.php">Orders</a></li>
<li<?PHP if($nav == 'feedback') : ?> class="active"<?PHP endif; ?>><a href="feedback.php">Feedback (<?PHP echo $feedback_count; ?>)</a></li>
<li<?PHP if($nav == 'tweets') : ?> class="active"<?PHP endif; ?>><a href="tweets.php">Tweets (<?PHP echo $tweet_count; ?>)</a></li>
<li<?PHP if($nav == 'stats') : ?> class="active"<?PHP endif; ?>><a href="stats.php">Sparkle Stats</a></li>
<li<?PHP if($nav == 'tickets') : ?> class="active"<?PHP endif; ?>><a href="tickets.php">Tickets</a></li>
</ul>

<ul id="user-navigation">
<li><a href="users.php">Users</a></li>
<li><a href="settings.php">Settings</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
<div class="clear"></div>
</div>
37 changes: 32 additions & 5 deletions includes/class.objects.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ public function __construct($id = null)
parent::__construct('shine_users', array('username', 'password', 'level', 'email'), $id);
}

/**
* Give the user object the ability to change the password with encryption.
*
* @param string $password The plain text string value of the password.
*/
public function setPassword($password)
{
$Config = Config::getConfig();
Expand Down Expand Up @@ -344,3 +339,35 @@ function __construct($id = null)
parent::__construct('shine_tweets', array('tweet_id', 'app_id', 'username', 'dt', 'body', 'profile_img', 'new', 'replied_to', 'reply_date', 'deleted'), $id);
}
}

class Ticket extends DBObject
{
function __construct($id = null)
{
parent::__construct('shine_ticket', array('app_id', 'title', 'description', 'created_by', 'milestone_id', 'state_id', 'dt_created', 'dt_last_state'), $id);
}
}

class Milestone extends DBObject
{
function __construct($id = null)
{
parent::__construct('shine_milestone', array('app_id', 'title', 'dt_due', 'description'), $id);
}
}

class TicketHistory extends DBObject
{
function __construct($id = null)
{
parent::__construct('shine_milestone', array('dt', 'ticket_id', 'app_id', 'user_id', 'state_from_id', 'state_to_id', 'milestone_from_id', 'milestone_to_id', 'comment'), $id);
}
}

class TicketStatus extends DBObject
{
function __construct($id = null)
{
parent::__construct('shine_ticket_statuses', array('title', 'is_open', 'css_class'), $id);
}
}
28 changes: 2 additions & 26 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,7 @@
$opw30_fb = clone $opw30;
$opw30_fb->dimensions = '640x400';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Shine</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
<link rel="stylesheet" href="css/yuiapp.css" type="text/css">
<link rel="stylesheet" href="js/jquery.fancybox.css" type="text/css" media="screen">
</head>
<body class="rounded">
<div id="doc3" class="yui-t6">

<div id="hd">
<?PHP include('inc/header.inc.php'); ?>
</div>

<?PHP include('inc/header.inc.php'); ?>
<div id="bd">
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
Expand Down Expand Up @@ -162,12 +146,4 @@
</div>
</div>

<div id="ft"></div>
</div>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.fancybox-1.2.1.pack.js"></script>
<script type="text/javascript" charset="utf-8">
$(".fb").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false });
</script>
</body>
</html>
<?PHP include('inc/footer.inc.php'); ?>
22 changes: 2 additions & 20 deletions order-new.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,7 @@

$applications = DBObject::glob('Application', 'SELECT * FROM shine_applications ORDER BY name');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Shine</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
<link rel="stylesheet" href="css/yuiapp.css" type="text/css">
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
</head>
<body class="rounded">
<div id="doc3" class="yui-t6">

<div id="hd">
<?PHP include('inc/header.inc.php'); ?>
</div>
<?PHP include('inc/header.inc.php'); ?>

<div id="bd">
<div id="yui-main">
Expand Down Expand Up @@ -87,7 +72,4 @@
</div>
</div>

<div id="ft"></div>
</div>
</body>
</html>
<?PHP include('inc/footer.inc.php'); ?>
29 changes: 2 additions & 27 deletions order.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,7 @@
redirect('orders.php');
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Shine</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
<link rel="stylesheet" href="css/yuiapp.css" type="text/css">
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
</head>
<body class="rounded">
<div id="doc3" class="yui-t6">

<div id="hd">
<?PHP include('inc/header.inc.php'); ?>
</div>
<?PHP include('inc/header.inc.php'); ?>

<div id="bd">
<div id="yui-main">
Expand Down Expand Up @@ -93,14 +78,4 @@
</div>
</div>

<div id="ft"></div>
</div>
<script type="text/javascript" charset="utf-8">
google.load("jquery", "1");
google.setOnLoadCallback(function(){
$('#email').click(function(){return confirm('Are you sure you want to email the user their license?');});
$('#delete').click(function(){return confirm('Are you sure you want to delete this order?');});
});
</script>
</body>
</html>
<?PHP include('inc/footer.inc.php'); ?>
27 changes: 2 additions & 25 deletions orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,7 @@
$opma_fb = clone $opma;
$opma_fb->dimensions = '640x400';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Shine</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
<link rel="stylesheet" href="css/yuiapp.css" type="text/css">
<link rel="stylesheet" href="js/jquery.fancybox.css" type="text/css" media="screen">
</head>
<body class="rounded">
<div id="doc3" class="yui-t6">

<div id="hd">
<?PHP include('inc/header.inc.php'); ?>
</div>
<?PHP include('inc/header.inc.php'); ?>

<div id="bd">
<div id="yui-main">
Expand Down Expand Up @@ -202,12 +187,4 @@
</div>
</div>

<div id="ft"></div>
</div>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.fancybox-1.2.1.pack.js"></script>
<script type="text/javascript" charset="utf-8">
$(".fb").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false });
</script>
</body>
</html>
<?PHP include('inc/footer.inc.php'); ?>
Loading

0 comments on commit fcfb338

Please sign in to comment.