Commit fc373e34 authored by Chrystel Moreau's avatar Chrystel Moreau
Browse files

debut dashboard Participant v2

parent 1b550fc0
......@@ -96,7 +96,5 @@
<script src="js/inscription.js"></script>
<script src="js/connexion.js"></script>
<script src="js/new_passwd.min.js"></script>
<!--<script src="https://cdnjs.com/libraries/Chart.js"></script>-->
<script src="js/participant.js"></script>
</body>
</html>
......@@ -73,17 +73,15 @@
<script src="https://cdn.datatables.net/buttons/1.2.4/js/dataTables.buttons.min.js"></script>
<script src="http://cdn.datatables.net/buttons/1.2.4/js/buttons.html5.min.js"></script>
<script src="http:////cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
<script src="https://cdn.datatables.net/select/1.2.1/js/dataTables.select.min.js"></script>
<script src="bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!--<script src="js/inscription.js"></script>-->
<script src="js/connexion.js"></script>
<script src="js/new_passwd.min.js"></script>
<script src="js/admin.js"></script>
<script src="js/clo_admin.js"></script>
<script src="js/clo_admin.js"></script>
<!--
<script src="js/Chart.js"></script>
<script src="js/participant.js"></script>
-->
</body>
</html>
......@@ -3,7 +3,7 @@
{% block title %}Participant{% endblock %}
{% block content %}
<div class="container">
<!--
<nav class="hidden-xs hidden-sm navbar-dashboard">
<h3 class="navbar-dashboard-item-title">Dashboard Menu</h3>
<ul class="navbar-dashboard-item-list">
......@@ -18,7 +18,7 @@
</li>
</ul>
</nav>
-->
{% block content_dashboard %}{% endblock %}
......
......@@ -17,22 +17,16 @@
Pour vous inscrire, vous devez selectionner une demi-journée.<p>
<table width='100%'>
<tr>
<td>04 Juillet 2017</td>
<td>05 Juillet 2017</td>
<td>06 Juillet 2017</td>
<td>07 Juillet 2017</td>
<td><a id="seance04-am" href = "#" class="btn btn-info btn-sm btn-block" role ="button">04 Juillet 2017 - Matin</a></td>
<td><a id="seance05-am" href = "#" class="btn btn-info btn-sm btn-block" role ="button">05 Juillet 2017 - Matin</a></td>
<td><a id="seance06-am" href = "#" class="btn btn-info btn-sm btn-block" role ="button">07 Juillet 2017 - Matin</a></td>
<td><a id="seance07-am" href = "#" class="btn btn-info btn-sm btn-block" role ="button">08 Juillet 2017 - Matin</a></td>
</tr>
<tr>
<td><a id="seance04-am" href = "#" class="btn btn-info btn-sm btn-block" role ="button">Matin</a></td>
<td><a id="seance05-am" href = "#" class="btn btn-info btn-sm btn-block" role ="button">Matin</a></td>
<td><a id="seance06-am" href = "#" class="btn btn-info btn-sm btn-block" role ="button">Matin</a></td>
<td><a id="seance07-am" href = "#" class="btn btn-info btn-sm btn-block" role ="button">Matin</a></td>
</tr>
<tr>
<td><a id="seance04-pm" href = "#" class="btn btn-primary btn-sm btn-block" role ="button">Matin</a></td>
<td><a id="seance05-pm" href = "#" class="btn btn-primary btn-sm btn-block" role ="button">Matin</a></td>
<td><a id="seance06-pm" href = "#" class="btn btn-primary btn-sm btn-block" role ="button">Matin</a></td>
<td><a id="seance07-pm" href = "#" class="btn btn-primary btn-sm btn-block" role ="button">Matin</a></td>
<td><a id="seance04-pm" href = "#" class="btn btn-primary btn-sm btn-block" role ="button">04 Juillet 2017 - Matin</a></td>
<td><a id="seance05-pm" href = "#" class="btn btn-primary btn-sm btn-block" role ="button">05 Juillet 2017 - Matin</a></td>
<td><a id="seance06-pm" href = "#" class="btn btn-primary btn-sm btn-block" role ="button">06 Juillet 2017 - Matin</a></td>
<td><a id="seance07-pm" href = "#" class="btn btn-primary btn-sm btn-block" role ="button">07 Juillet 2017 - Matin</a></td>
</tr>
</table>
......@@ -43,67 +37,10 @@
<div class="panel panel-default">
<div class="panel-heading">Inscription /Atelier</div>
<div class="panel-body">
<div id="js-legend" class="chart-legend"></div>
<canvas id="pinscription" data-type="Line" width="500" height="350"></canvas>
<canvas id="plot" data-type="Line" width="500" height="350"></canvas>
</div>
</div>
<div class="modal" id="participant_inscription" tabindex="-1" role="dialog" aria-labelledby="Login" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="titre_modal">Inscription</h4>
</div>
<div class="modal-body">
<form id="FormInscriptionAtelier" method="post" class="form-horizontal add" novalidate>
<div class="form-group">
<div class="col-xs-3">
<input type="hidden" class="form-control" id="id_participant" name="id_participant" value="" >
<input type="hidden" class="form-control" id="id_atelier" name="id_atelier" value="">
<input type="hidden" class="form-control" id="date_pres_inscription" name="date_pres_inscription" value="" >
<input type="hidden" class="form-control" id="date_inscription" name="date_inscription" value="" >
<input type="hidden" class="form-control" id="active" name="active" required="" value="0">
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label">Nom prénom :</label>
</div>
<div class="form-group">
<label class="col-xs-3 control-label"></label>
<div class="col-xs-5">
<span id='atelier_nom'></span>
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label"></label> <span id='quota'></span>
</div>
<div class="form-group">
<label class="col-xs-3 control-label"></label> <span id='inscrits'></span>
</div>
<div class="form-group">
<div class="col-xs-5 col-xs-offset-3">
<button type="submit" class="btn btn-success" id='btn_inscrir' >je m'incrit</button>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<div class="col-xs-5 col-xs-offset-3">
<button type="reset" class="btn btn-error">je ne m'incris pas</button>
</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
</div>
{% endblock %}
\ No newline at end of file
$(document).ready(function(){
var mydata_graph;
var myPieChart=null;
var objChart=document.getElementById("graph_general");
var ctx = document.getElementById("plot");
// Get Atelier
// SELECT distinct atelier.id AS atelier_id, atelier.nom AS atelier_nom,
// SUM( inscrire.id_participant ) AS inscrits,
// SUM( salle.quota_officiel ) AS quota,
// SUM( salle.quota_physique ) AS PC
// FROM inscrire, atelier, salle
// WHERE inscrire.id_atelier=atelier.id and salle.id = atelier.id_salle
var data=[1,'T1.a2',25,30,30];
var T_inscrits =[];
var T_quota =[];
var T_backcolor=[];
var T_labels=[];
for(var i=0;i<data.length ;i++)
{
valeur_test=percent(output.data[i].inscrits,output.data[i].quota);
if (valeur_test>100) valeur_test=100;
T_inscrits.push(valeur_test);
T_quota.push(100-valeur_test);
if(valeur_test<25)
{
T_backcolor.push('rgba(0, 255, 0, 0.9)');
}
else if(valeur_test<50)
{
T_backcolor.push('rgba(255, 153, 0, 0.9)');
}
else{
T_backcolor.push('rgba(255, 0, 0, 0.9)');
};
T_labels.push(output.data[i].atelier_nom+' ('+output.data[i].inscrits+'/'+output.data[i].quota+')');
}
var barChartData = {
labels:T_labels,
datasets: [{
label: 'Inscrits ',
// backgroundColor: "rgba(220,220,220,0.5)",
data: T_inscrits,
backgroundColor:T_backcolor,
borderColor:T_backcolor
}, {
label: 'Quota',
backgroundColor: "rgba(151,187,205,0.5)",
data: T_quota
}]
};
var ctx = document.getElementById("pinscription");
var myChart = new Chart(ctx, {
type: 'horizontalBar',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
labels: ["T1-a2"],
datasets: [{
label: '# of Votes',
label: 'Inscrits',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
......@@ -40,6 +77,8 @@ $(document).ready(function(){
}
}
});
});
......@@ -66,8 +66,8 @@
}
.content-dashboard {
//margin-left: 190px;
margin-left: 0px;
margin-left: 190px;
//margin-left: 0px;
}
.content-dashboard-admin {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment