-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproto_main.php
More file actions
160 lines (153 loc) · 7.19 KB
/
proto_main.php
File metadata and controls
160 lines (153 loc) · 7.19 KB
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
158
159
160
<?php
/*
* Proton esittely
*
* @package SLS-Prototracker
* @license http://opensource.org/licenses/GPL-2.0
* @author Mauri "mos" Sahlberg
* */
require_once("globals.php");
require_once("$basepath/helpers/common.php");
require_once("$basepath/helpers/database.php");
require_once("$basepath/classes/protot.php");
require_once("$basepath/helpers/minrights.php");
$protoid = isset($_REQUEST["protoid"]) ? $_REQUEST["protoid"] : false;
if($protoid == false) {
header("Location: $baseurl/index.php");
die();
}
$_SESSION["protoid"]=$protoid;
$_SESSION["p_virhe"]="";
$proto = new PROTOT($db);
$tiedot = $proto->haeProto($protoid);
if($tiedot===false) {
die("Ei proton haku mätti $protoid");
header("Location: $baseurl/index.php");
die();
}
$_SESSION["p_metodi"]="muuta";
require_once("$basepath/html_base.html");
?>
<title><?php echo _("Proto");?></title>
<script type="text/javascript">
$(document).ready(function() {
// Protot-taulu
$('#scores').dataTable( {
"processing" : true,
"serverSide" : true,
"responsive" : true,
"orderMulti" : true,
"search" : {
"regex" : true,
"casInsensitive" : true,
"smart" : true
},
"ajax" : "<?php echo "$baseurl/json_protoscores.php";?>",
<?php include("$basepath/datatables_language.js");?>
}
);
$("#scores tbody").on('click','tr', function () {
console.log($(this).children("td:nth-child(1)").html());
console.log($(this).children("td:nth-child(2)").html());
});
$("#muokkaa").on('click',function() {
window.location="<?php echo $baseurl;?>/forms/proto.php";
})
});
</script>
</head>
<body>
<?php include_once("navbar.html");?>
<section class="container">
<div class="row">
<section class="col-xs-12 col-sm-6 col-md-6">
<h2><?php echo _("Proto");?></h2>
<table class="table-striped table-bordered">
<caption><?php $tiedot["nimi"];?></caption>
<tbody>
<?php
$a = array("nimi"=>_("Nimi"), "omistaja"=>_("Omistaja"), "luotu"=>_("Luotu"),
"muokattu"=>_("Muokattu"),"kuvaus"=>_("Kuvaus"), "suunnittelijat"=>_("Suunnittelijat"),
"minimipelaajamaara"=>_("Minimipelaajamäärä"), "maksimipelaajamaara"=>_("Maksimipelaajamäärä"),
"saannot"=>_("Säännöt"), "kohdeyleiso"=>_("Kohdeyleisö"),
"luoja"=>_("Luoja"), "omistaja_ktunnus"=>_("Omistajan käyttäjätunnus"), "status"=>_("Status"),
"sijainti"=>_("Sijainti"), "fiilis"=>_("Fiilis"),
"uutuus"=>_("Uutuus"), "mekaniikka"=>_("Mekaniikka"), "idea"=>_("Idea"), "score"=>_("Pisteet"),
"sosiaalisuus"=>_("Sosiaalisuus"),"tuuri"=>("Tuuri"), "taktiikka"=>_("Taktiikka"),
"strategia"=>_("Strategia"), "id"=>_("Id"));
foreach($tiedot as $k=>$v) {
switch($k) {
case "minimipelaajamaara":
$_SESSION["p_minp"]=$v;
break;
case "maksimipelaajamaara":
$_SESSION["p_maxp"]=$v;
break;
case "kohdeyleiso":
$_SESSION["p_kohde"]=$v;
break;
default:
$_SESSION["p_".$k]=$v;
}
printf("<tr><th>%s</th><td>%s</td></tr>\n", $a[$k], $v);
}?>
</tbody>
</table>
<button type="button" class="btn" id="muokkaa" value="muuta"><?php echo _("Muuokkaa");?></button>
<table id="scores">
<caption><?php echo _("Pelaajien arviot");?></caption>
<thead>
<tr>
<th><?php echo _("Sessio");?></th>
<th><?php echo _("Numero");?></th>
<th><?php echo _("Pisteet");?></th>
<th><?php echo _("Fiilis");?></th>
<th><?php echo _("Mekaniikka");?>
<th><?php echo _("Idea");?></th>
<th><?php echo _("Uutuus");?></th>
<th><?php echo _("Sosiaalisuus");?></th>
<th><?php echo _("Tuuri");?></th>
<th><?php echo _("Taktiikka");?></th>
<th><?php echo _("Strategia");?></th>
<th><?php echo _("Ostaistiko");?></th>
<th><?php echo _("Pelaisitko");?></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
<tfoot>
<tr>
<th><?php echo _("Sessio");?></th>
<th><?php echo _("Numero");?></th>
<th><?php echo _("Pisteet");?></th>
<th><?php echo _("Fiilis");?></th>
<th><?php echo _("Mekaniikka");?>
<th><?php echo _("Idea");?></th>
<th><?php echo _("Uutuus");?></th>
<th><?php echo _("Sosiaalisuus");?></th>
<th><?php echo _("Tuuri");?></th>
<th><?php echo _("Taktiikka");?></th>
<th><?php echo _("Strategia");?></th>
<th><?php echo _("Ostaistiko");?></th>
<th><?php echo _("Pelaisitko");?></th>
</tr>
</tfoot>
</table>
</section>
</div>
</section>
<?php include_once("$basepath/footer.html");?>
</body>
</html>