jeux/application/views/dashbord.php

106 lines
5.7 KiB
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<title>iLinkWorld</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="<?php echo base_url('dist/images/logo.ico')?>"/>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link href="<?php echo base_url('dist/css/main_dash.css') ?>" rel="stylesheet" id="css">
<link href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src="<?php echo base_url('dist/js/paging.js') ?>"></script>
<!------ Include the above in your HEAD tag ---------->
</head>
<body>
<div class="container login-container">
<div class="row">
<div style="text-align: center" class="col-md-6 login-form-1">
<img width="300" height="85" class="col-xs-12" src="<?php echo base_url('dist/images/logo_2.png')?>" alt="IMG">
<h3 style="height:100; text-align:center;" id="challenge">Challenge</h3>
<p style="text-align:center;"><span style="font-size:40px;"><?php echo $this->session->userdata('user'); ?></span><span style="font-size:10px;"></span><?php echo ' /'.$this->session->userdata('pays'); ?></span></p>
<p style="text-align:center;"><span style="font-size:90px;"><?php echo $this->session->userdata('total'); ?></span><span style="font-size:10px;"></span>personnes</span></p>
<h3 id="add-code" style="text-align:center;">Ajouter un code</h3>
<form action="<?php echo base_url('index.php/Users/add_member') ?>" method="post">
<div class="form-group">
<input type="text" name="code" class="form-control" style="text-align:center;" placeholder="Code de validation" value="" />
</div>
<div class="form-group">
<input type="submit" class="btnSubmit" value="Valider" />
</div>
</form>
</div>
<div class="col-md-6 login-form-2 parent">
<div style="text-align: center;" class="center">
<?php
$membres = $membre;
if($membres!=false){
?>
<table style="background-color: white;" id="tab" class="table table-bordered table-sm" cellspacing="0" width="100%">
<thead style="text-align:center;">
<tr>
<th class="th-sm">Nom</th>
<th class="th-sm">Code</th>
</tr>
</thead>
<tbody style="text-align:center;">
<?php foreach($membres->result() as $row) {
echo "<tr><td>".$row->lastname."</td>";
echo "<td>".$row->validation_code."</td></tr>";
}
?>
</tbody>
</table>
<?php
}else{
echo "Aucun membre";
}
?>
<button class="btnPage2 btnSubmit" onclick="location.href = '<?php echo base_url('index.php/Users/logout') ?>';">Me déconnecter</button>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="info" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" data-show="true" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">information</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p id="message"><?php echo $message; ?></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
</div>
</div>
</div>
</div>
</body>
<script>
$(document).ready(function () {
if($('#message').text()!==""){
$('#minfo').modal('show');
alert($('#message').text());
}
$('#tab').paging(
{
limit: 5,
rowDisplayStyle: 'block',
activePage: 0,
rows: []
}
);
});
</script>
</html>