Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sandunf committed May 9, 2014
2 parents e29c3b7 + 5984e20 commit 3526f0e
Show file tree
Hide file tree
Showing 10 changed files with 331 additions and 54 deletions.
110 changes: 110 additions & 0 deletions admin.batches.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?php
require_once './global.inc.php';
session_start();
if (!oauth_session_exists()) {
header('Location: ' . '404.php');
}
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<?php require_once './head.inc.php'; ?>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

<?php require_once './nav.inc.php'; ?>

<div class="container clearfix">

<div id="bannerArea" class="clearfix">
<div id="bannerLeft">

<div id="example-two">


<div class="list-wrap noborder">

<div id="featured2">

<table id="usertable">
<thead>
<tr>
<th>Id</th>
<th>Display Name</th>
<th>Course</th>
<th>Year</th>
</tr>
</thead>
<tbody>
<?php
$batchTools = new BatchTools();
$batches = $batchTools->getAllBatches();

foreach ($batches as $batch)


{
?>
<tr>
<td><?= $batch->id?></td>
<td><?= $batch->year?></td>
<td><?= $batch->course?></td>
<td><?= $batch->display_name?></td>
</tr>
<?php
}
?>

</tbody>
</table>
</div>

</div> <!-- END List Wrap -->

</div>

</div>
<div id="rightSide">

<ul id="legend">
<li class=" clearfix">
<a href="admin.users.php">Manage Users</a>
</li>
<li class=" clearfix">
<a href="admin.company.php">Manage Companies</a>
</li>
<li class=" clearfix">
<a href="#">Manage Batches</a>
</li>
<li class=" clearfix">
<a href="admin.events.php">Manage Events</a>
</li>
</ul>



</div>
</div>

</div>



<?php include_once 'scripts.inc.php'; ?>
<script type="text/javascript" src="js/admin.user.js"></script>

<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<!--<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X');ga('send','pageview');
</script>-->
</body>
</html>
96 changes: 96 additions & 0 deletions admin.company.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php
require_once './global.inc.php';
session_start();
if (!oauth_session_exists()) {
header('Location: ' . '404.php');
}
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<?php require_once './head.inc.php'; ?>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

<?php require_once './nav.inc.php'; ?>

<div class="container clearfix">

<div id="bannerArea" class="clearfix">
<div id="bannerLeft">

<div id="example-two">


<div class="list-wrap noborder">

<div id="featured2">

<table id="usertable" >
<thead>
<tr>
<th>Id</th>
<th>Name</th>

</tr>
</thead>
<tbody>
<?php

$companyTools = new CompanyTools();
$companies = $companyTools->getAllCompanies();
foreach ($companies as $company)
{
?>
<tr>
<td><?= $company->id ?></td>
<td><?= $company->name ?></td>

</tr>
<?php
}
?>
</tbody>
</table>
</div>

</div> <!-- END List Wrap -->

</div>

</div>

<div id="rightSide">

<ul id="legend">
<li class=" clearfix">
<a href="admin.users.php">Manage Users</a>
</li>
<li class=" clearfix">
<a href="admin.company.php">Manage Companies</a>
</li>
<li class=" clearfix">
<a href="admin.batches.php">Manage Batches</a>
</li>
<li class=" clearfix">
<a href="admin.events.php">Manage Events</a>
</li>
</ul>



</div>
</div>

</div>
<?php include_once 'scripts.inc.php'; ?>

<script type="text/javascript" src="js/admin.user.js"></script>

</body>
</html>

4 changes: 2 additions & 2 deletions admin.events.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@
<a href="admin.users.php">Manage Users</a>
</li>
<li class=" clearfix">
<a href="#">Manage Companies</a>
<a href="admin.company.php">Manage Companies</a>
</li>
<li class=" clearfix">
<a href="#">Manage Batches</a>
<a href="admin.batches.php">Manage Batches</a>
</li>
<li class=" clearfix">
<a href="#">Manage Events</a>
Expand Down
33 changes: 20 additions & 13 deletions admin.users.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,21 @@
</tr>
</thead>
<tbody>
<?php
$userTools = new UserTools();
$users = $userTools->getAll();
foreach ($users as $user) {
?>
<tr>
<?php
$userTools = new UserTools();
$users = $userTools->getAll();

foreach ($users as $user)


{
?>
<tr>
<td><?= $user->id ?></td>
<td><?= $user->name ?></td>
<td><?= $user->linkedin_id ?></td>
<td><a href="" class="companylink" data-companyid="<?= $user->company_id ?>" data-id="<?= $user->id ?>" ><?= $user->getOrganization()->name ?></a></td>
</tr>
</tr>
<?php
}
?>
Expand All @@ -71,10 +75,10 @@
<a href="#">Manage Users</a>
</li>
<li class=" clearfix">
<a href="#">Manage Companies</a>
<a href="admin.company.php">Manage Companies</a>
</li>
<li class=" clearfix">
<a href="#">Manage Batches</a>
<a href="admin.batches.php">Manage Batches</a>
</li>
<li class=" clearfix">
<a href="admin.events.php">Manage Events</a>
Expand All @@ -87,17 +91,20 @@
</div>

</div>

<div id="dialog-form" title="Change Company">

<form id="create_form" method="post" action="user.create.php">
<fieldset>
<input id="userId" name="userId" type="hidden" />
<select name="companyId" id="companylist" size="10" style="width:100%" >
<select name="companyId" id="companylist" size="10" style="width:100%" >


<?php
$companyTools = new CompanyTools();
$companies = $companyTools->getAllCompanies();
foreach ($companies as $company) {
foreach ($companies as $company)
{
echo '<option value="' . $company->id . '">' . $company->name . '</option>';
}
?>
Expand Down
4 changes: 3 additions & 1 deletion classes/CompanyTools.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ function __construct() {
}

function getAllCompanies(){
$results = $this->db->select("companies", "1=1");

$db = new DB();
$results = $this->db->select("companies", "true");
$companies = array();
foreach ($results as $result){
array_push($companies, new Company($result));
Expand Down
Loading

0 comments on commit 3526f0e

Please sign in to comment.