Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hackathonUTC/myutc-app
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiroy committed Nov 29, 2015
2 parents b99324d + c06d061 commit 2d68652
Show file tree
Hide file tree
Showing 11 changed files with 204 additions and 33 deletions.
19 changes: 13 additions & 6 deletions codeliste.html
Expand Up @@ -6,17 +6,24 @@
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<style>
.navbar-brand {
font-family: arial;
font-weight: bolder;
font-size: 30;
}
</style>
</head>
<body data-spy="scroll" data-target=".navbar" data-offset="100">
<nav class="navbar navbar-inverse navbar-fixed-top" style="background-color:#2196F3">
<nav class="navbar navbar-inverse navbar-fixed-top" style="background-color:#FACC2E">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" style="color:#fff">MYUTC</a>
</div>
<div class="col-xs-3">
<button type="button" class="btn btn-link" style="color:#fff">Retour</button>
<button type="button" class="btn btn-default" style="color:#fff; background-color:#61380B; border-color:#FACC2E">Retour</button>
</div>
<div class="col-xs-3"><a src="" type="button" class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" style="background-color:#2196F3">Login
<div class="col-xs-3"><a src="" type="button" class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" style="background-color:#61380B; border-color:#FACC2E">Login
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
Expand All @@ -38,13 +45,13 @@
</thead>
<tbody>
<tr>
<td><img src="https://i.gyazo.com/592adf3420b792e26e74c16b600b113c.png" class="img-rounded" width=100 height=100></td>
<td><img src="https://i.gyazo.com/592adf3420b792e26e74c16b600b113c.png" class="img-rounded" width=60% style="max-width:450px; min-width:100px" height=width></td>
<td style="text-align:left">asso1</td>
<td><button type="button" class="btn btn-success">ajouter</button></td>
</tr>
<tr>
<td><img src="https://i.gyazo.com/592adf3420b792e26e74c16b600b113c.png" class="img-rounded" width=100 height=100></td>
<td style="text-align:left">asso2</td>
<td><img src="https://i.gyazo.com/592adf3420b792e26e74c16b600b113c.png" class="img-rounded" width=60% style="max-width:450px; min-width:100px" height=width></td>
<td style="text-align:left">asso 2</td>
<td><button type="button" class="btn btn-success">ajouter</button></td>
</tr>
</tbody>
Expand Down
20 changes: 0 additions & 20 deletions codelogin.html

This file was deleted.

2 changes: 2 additions & 0 deletions footer.html
@@ -0,0 +1,2 @@
</body>
</html>
40 changes: 40 additions & 0 deletions header_tuiles.html
@@ -0,0 +1,40 @@
<head>
<style>
th, td
{padding: 10px;}
input[type="text"]
{
padding:3px;
border:1px solid #848484;
border-radius:5px;
box-shadow:1px 1px 2px #C0C0C0 inset;
}
.affix {
top: 0;
width: 100%;
}
.affix + .container-fluid {
padding-top: 80px;
}
.navbar-brand {
font-family: arial black; aharoni;
font-size: 30;
}
</style>
</head>
<body data-spy="scroll" data-spy="affix" data-target=".navbar" style="background-color:#848484">
<nav class="navbar navbar-inverse navbar-fixed-top" style="background-color:#FACC2E">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" style="color:#fff;text-align:left" href="index.php" class="btn btn-info" role="button">MYUTC</a>
</div>
<div class="col-xs-3"><a src="" type="button" class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" style="background-color:#61380B; border-color:#FACC2E">Login
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#">Déconnexion</a></li>
<li><a href="#">Profil</a></li>
</ul>
</div>
</div>
</nav>
3 changes: 2 additions & 1 deletion iframe_module.html
Expand Up @@ -24,7 +24,8 @@
padding-top: 80px;
}
.navbar-brand {
font-family: arial black; aharoni;
font-family: arial;
font-weight: bolder;
font-size: 30;
}
</style>
Expand Down
60 changes: 60 additions & 0 deletions includes/functions.php
@@ -0,0 +1,60 @@
<?php

function mix_modules($my_modules, $every_modules){
//MIXE LES MODULES EN AJOUTANT UN ATTRIBUT "ISADDED"; => permet d'etre reutilisé
$modules = array();

foreach ($every_modules as $module) {
if (in_array($module, $my_modules)){
$module['isAdded'] = 1;
}
else $module['isAdded'] = 0;
$modules[] = $module;
}

return $modules;
}


function get_modules() {
//get every modules in the data base
$sql = "SELECT * FROM module ORDER BY id";
$conn = new connection();
$conn->Connect();
$response = $conn->Conn->query($sql);

$retour = array();
while ( $vResult = $response->fetch()) {
$module = array();
$module[titre] = $vResult['titre'];
$module[description] = $vResult['description'];
$module[lien] = $vResult['lien'];
$module[id] = $vResult['id'];
$retour[] = $module;
}
return $retour;
}


function get_user_modules($login) {
//get every module added by the user
$sql = "SELECT *
FROM module INNER JOIN menu_utilisateur
ON module.id = menu_utilisateur.module
WHERE menu_utilisateur.utilisateur = '".phpCAS::getUser()."';";
$conn = new connection();
$conn->Connect();
$response = $conn->Conn->query($sql);

$retour = array();
while ( $vResult = $response->fetch()) {
$module = array();
$module[titre] = $vResult['titre'];
$module[description] = $vResult['description'];
$module[lien] = $vResult['lien'];
$module[id] = $vResult['id'];
$retour[] = $module;
}
return $retour;
}
?>
Empty file removed index.html
Empty file.
15 changes: 9 additions & 6 deletions interface1.2.html
Expand Up @@ -24,7 +24,8 @@
padding-top: 150px;
}
.navbar-brand {
font-family: arial black; aharoni;
font-family: arial;
font-weight: bolder;
font-size: 30;
}
</style>
Expand All @@ -50,20 +51,22 @@
</div>
</nav>
<div class="container-fluid">
<table cellpadding=2 cellspacing=2>
<center>
<table cellpadding=5 cellspacing=5>
<tbody>
<tr>
<td><center><img src="http://www.apptamin.com/wp-content/uploads/2012/08/iOS-Icon.png" class="img-rounded" width="90%" height="90%"></center></td>
<td><center><img src="http://www.apptamin.com/wp-content/uploads/2012/08/iOS-Icon.png" class="img-rounded" width="90%" height="90%"></center></td>
<td><center><img src="http://www.apptamin.com/wp-content/uploads/2012/08/iOS-Icon.png" class="img-rounded" width="90%" style="max-width:450px" height="width"></center></td>
<td><center><img src="http://www.apptamin.com/wp-content/uploads/2012/08/iOS-Icon.png" class="img-rounded" width="90%" style="max-width:450px" height="width"></center></td>
</tr>
<tr>
<td><center><img src="http://www.apptamin.com/wp-content/uploads/2012/08/iOS-Icon.png" class="img-rounded" width="90%" height="90%"></center></td>
<td><center><img src="http://www.apptamin.com/wp-content/uploads/2012/08/iOS-Icon.png" class="img-rounded" width="90%" height="90%"></center></td>
<td><center><img src="http://www.apptamin.com/wp-content/uploads/2012/08/iOS-Icon.png" class="img-rounded" width="90%" style="max-width:450px" height="width"></center></td>
<td><center><img src="http://www.apptamin.com/wp-content/uploads/2012/08/iOS-Icon.png" class="img-rounded" width="90%" style="max-width:450px" height="width"></center></td>
</tr>
</tbody>
</table>
</div>
</table>
</center>
</div>
</body>
</html>
73 changes: 73 additions & 0 deletions my-menu-edit.php
@@ -0,0 +1,73 @@
<?php

require_once 'check-cas-connection.php';
require_once "class/connection.php";
require_once "includes/functions.php";




//phpCAS::getUser();

//USER
$my_modules = get_user_modules(phpCAS::getUser());
$every_modules = get_modules();

$modules = mix_modules($my_modules, $every_modules);

display_modules($modules);

function display_modules($modules) {
?>
<br>
<br>
<br>
<div class="container">
<table class="table table-striped">
<thead>
<tr>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<?php
$n=count($modules);
$i=0;
while($i<$n){
write_module($modules[$i]);
$i++;
} ?>
</table>
<?php
}
function write_module($module){
?>
<tr>
<td><img src="<?php echo $module['img']; ?>" class="img-rounded" width=60% style="max-width:450px; min-width:100px" height=width></td>
<td><table style="width:100%">
<thead>
<tr>
<th><?php echo $module['titre']; ?></th>
<th><?php if ($module['isAdded']==0) {
?>
<button type="button" class="btn btn-success">Ajouter</button></th>

<?php
}
else { ?>
<button type="button" class="btn btn-danger">Supprimer</button></th>
<?php } ?>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo $module['description'];?></td>
</tr>
</tbody>
</table>
</td>
</tr>
<?php
}
?>
5 changes: 5 additions & 0 deletions my-menu.php
Expand Up @@ -22,11 +22,15 @@

echo 'Vous êtes connecté avec le login : '. phpCAS::getUser().'<br>';

echo "<pre>";
var_dump(get_user_modules(phpCAS::getUser()));

?>




<?php
function get_user_modules($login) {
$sql = "SELECT *
FROM module INNER JOIN menu_utilisateur
Expand All @@ -42,6 +46,7 @@ function get_user_modules($login) {
$module[titre] = $vResult['titre'];
$module[description] = $vResult['description'];
$module[lien] = $vResult['lien'];
$module[id] = $vResult['id'];
$retour[] = $module;
}
return $retour;
Expand Down
Binary file added src/img/1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2d68652

Please sign in to comment.