Skip to content

Commit

Permalink
poursuite mise en palce
Browse files Browse the repository at this point in the history
Structure
pages de vue
add en cours
  • Loading branch information
machine62 committed Oct 26, 2018
1 parent 37c837c commit 6cf9b65
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 8 deletions.
2 changes: 1 addition & 1 deletion model/oversight.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function getPlayer()

while ($tPlayer = $db->sql_fetch_row($result))
{
$Tretour[$tPlayer["id_player"]] = array($tPlayer["id_player"],$tPlayer["name_player"],$tPlayer["status"]);
$Tretour[$tPlayer["id_player"]] = array("id_player" => $tPlayer["id_player"],"name_player"=>$tPlayer["name_player"],"status"=>$tPlayer["status"]);

}
return $Tretour;
Expand Down
35 changes: 30 additions & 5 deletions oversight.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
<?php
if (!defined('IN_SPYOGAME')) die("Hacking attempt");
include_once("mod/oversight/common.php");
$data=array();
$data["titre"] = "Oversight";
$data["menu"]=array();
$data["menu"][]=array("nom" => "Liste", "url" => "list" );
$data["menu"][]=array("nom" => "Mise en surveillance", "url" => "add");

$data["players"] = getPlayer();

include_once(FOLDER_VIEW."header.php");

var_dump(getPlayer());
// vue par defaut
switch ($pub_page) {
case "list":
$data["menuactif"]="list";
include_once(FOLDER_VIEW . "header.php");
include_once(FOLDER_VIEW . "menu.php");
include_once(FOLDER_VIEW . "list.php");
include_once(FOLDER_VIEW . "footer.php");
break;
case "add":
$data["menuactif"]="add";
include_once(FOLDER_VIEW . "header.php");
include_once(FOLDER_VIEW . "menu.php");
include_once(FOLDER_VIEW . "add.php");
include_once(FOLDER_VIEW . "footer.php");
break;
default:
$data["menuactif"]="list";
include_once(FOLDER_VIEW . "header.php");
include_once(FOLDER_VIEW . "menu.php");
include_once(FOLDER_VIEW . "list.php");
include_once(FOLDER_VIEW . "footer.php");
break;

}



include_once(FOLDER_VIEW."footer.php");
83 changes: 83 additions & 0 deletions view/add.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
if (!defined('IN_SPYOGAME')) die("Hacking attempt");
global $data;
$px=100;
?>

<h2> AJOUT</h2>

<form action="/index.php?action=oversight" id="add">
<select name="selectPlayer">
<?php foreach ($data["players"] as $player) : ?>
<option value="<?php echo $player["id_player"]; ?>">
<?php echo $player["name_player"]; ?>
</option>
<?php endforeach; ?>
</select>
<input type="submit">
</form>
<br />
<table>
<thead>
<tr>
<th class="c">
Filtre :
</th>
<td width="<?php echo $px;?>px" class="c Filtre_status" data-status="status_">
None
</td>
<td width="<?php echo $px;?>px" class="c Filtre_status" data-status="status_a">
a
</td>
<td width="<?php echo $px;?>px" class="c Filtre_status" data-status="status_I">
I
</th>
<td width="<?php echo $px;?>px" class="c Filtre_status" data-status="status_v">
v
</th>
<td width="<?php echo $px;?>px" class="c Filtre_status" data-status="status_vI">
vI
</th>
<td width="<?php echo $px;?>px" class="c Filtre_status" data-status="status_vIb">
vIb
</th>
<td width="<?php echo $px;?>px" class="c Filtre_status" data-status="status_b">
b
</th>
</tr>
</thead>
</table>

<br />
<table>
<thead>
<tr>
<th>
Nom
</th>
<th>
status
</th>
<th>

</th>
</tr>
</thead>
<?php foreach ($data["players"] as $player) : ?>
<tr class="id_player_<?php echo $player["id_player"]; ?> status_<?php echo $player["status"]; ?>">
<td class="c">
<?php echo $player["name_player"]; ?>
</td>
<td class="c">
<?php echo $player["status"]; ?>
</td>
<td class="c">
<a>Mise en Surveillance</a>
</td>
</tr>

<?php endforeach; ?>


</table>

5 changes: 3 additions & 2 deletions view/header.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php
if (!defined('IN_SPYOGAME')) die("Hacking attempt");
require_once("views/page_header.php");
global $data;
?>

<h1>Oversight</h1>
<h2><?php echo $data["titre"];?></h2>
<?php if (!superapixinstalled()) : ?>
<div class"alert">
<p> Attention, le mod superapix est requis</p>
<p> Attention, le mod superapix est requis</p>
</div>
<?php endif; ?>
3 changes: 3 additions & 0 deletions view/list.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
if (!defined('IN_SPYOGAME')) die("Hacking attempt");?>
<h2> defaut : liste</h2>
23 changes: 23 additions & 0 deletions view/menu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
if (!defined('IN_SPYOGAME')) die("Hacking attempt");
global $data;
?>
<table>
<tbody>
<tr align="center">
<?php foreach ($data["menu"] as $key) : ?>
<?php if ($data["menuactif"] == $key["url"]) : ?>
<th>
<?php echo $key["nom"]; ?></php>
</th>
<?php else : ?>
<td class="c">
<a href="index.php?action=oversight&page=<?php echo $key["url"]; ?>">
<?php echo $key["nom"]; ?></php>
</a>
</td>
<?php endif; ?>
<?php endforeach; ?>
</tr>
</tbody>
</table>

0 comments on commit 6cf9b65

Please sign in to comment.