-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
157 lines (153 loc) · 5.53 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
require_once __DIR__ . '/app/controller.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>PayRoll</title>
<link rel="stylesheet" href="bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="datatables.min.css">
</head>
<body>
<div class="container text-center">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<h1>Resuelve FC Payroll</h1>
</div>
</div>
<br>
<div class="row">
<h4>General dashboard</h4>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<table id="main" class="table">
<thead>
<tr>
<td>Team</td>
<td>Complete name</td>
<td>Level</td>
<td>Goals scored</td>
<td>Salary</td>
<td>Bonus</td>
<td>Ind. %</td>
<td>Mean %</td>
<td>Total</td>
</tr>
</thead>
<tbody>
<?php
foreach ($players->data['jugadores'] as $item => $value): ?>
<tr>
<td><?= $value['equipo']; ?></td>
<td><?= $value['nombre']; ?></td>
<td><?= $value['nivel']; ?></td>
<td><?= $value['goles']; ?></td>
<td>$<?= number_format($value['sueldo'],2); ?></td>
<td>$<?= number_format($value['bono'],2); ?></td>
<td><?= $value['productivity']; ?> %</td>
<td><?= $value['mean'];?> %</td>
<td>$ <?=number_format($value['sueldo_completo'],2);?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<br>
<div class="row">
<h4>Goal Summary</h4>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<table class="table" id="summary">
<thead>
<tr>
<td>Team</td>
<td>Total goals to achieve</td>
<td>Total goals scored</td>
<td>Team %</td>
</tr>
</thead>
<tbody>
<?php foreach ($players->teamSummary as $item => $value): ?>
<tr>
<td><?= $item ?></td>
<td><?= $value['goals'] ?></td>
<td><?= $value['scored'] ?></td>
<td><?= $value['productivity'] ?> %</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6"></div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<strong>By Carlos M. Gómez</strong>
<?php // ___($players->teamSummary) ?>
</div>
</div>
</div>
<form id="frm-response" action="/app/response.php" method="post">
<input type="hidden" name="data" value='<?php echo json_encode($players->data)?>'>
</form>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script type="text/javascript" src="bootstrap.min.js"></script>
<script type="text/javascript" src="datatables.min.js"></script>
<script>
$(document).ready(function () {
let _data = '';
$('#main').DataTable({
paging: false,
pageLength: 10,
dom: '<"html5buttons"B>lTfgitp',
buttons: [{
extend: 'copy',
className: 'btn btn-primary btn-sm pull-right'
},
{
extend: 'csv',
className: 'btn btn-primary btn-sm pull-right'
},
{
extend: 'excel',
title: 'Resuelve PayRoll',
className: 'btn btn-primary btn-sm pull-right'
},
{
extend: 'pdf',
title: 'Resuelve PayRoll',
className: 'btn btn-primary btn-sm pull-right'
},
{
extend: 'print',
className: 'btn btn-primary btn-sm pull-right',
customize: function (win) {
$(win.document.body).addClass('white-bg');
$(win.document.body).css('font-size', '10px');
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
},
{
text: 'JSON',
action: function () {
$('#frm-response').submit();
},
className: 'btn btn-primary btn-sm pull-right'
}
]
});
$('#summary').DataTable({
paging: false,
});
const jsonExport = function (){
return new Promise((resolve,reject) =>{
})
}
});
</script>
</body>
</html>