-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtandasView.php
More file actions
115 lines (74 loc) · 1.83 KB
/
tandasView.php
File metadata and controls
115 lines (74 loc) · 1.83 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
<?php
/**
* Created by PhpStorm.
* User: enriqueohernandez
* Date: 10/3/15
* Time: 9:47 PM
*/
/*
try {
$DBH = new PDO("mysql:host=104.236.217.175;dbname=mxhacks", "root", "0"); //5o4G3oPFec
} catch (PDOException $e) {
echo $e->getMessage();
exit;
}
$result = $DBH->query("SELECT id_tanda, name, FROM Tanda WHERE id_user = 1");
$row = $result->fetch(PDO::FETCH_ASSOC);
echo $signo." | ";
echo $row['prediccion'];
*/
// /*
// /*
include('./includes/conn.php');
$mysqli = con_start();
$ret = [];
$count = 0;
//$id = 1;
$smtp = $mysqli->prepare("SELECT id_tanda, name FROM Tanda WHERE id_user = 1");
//$smtp->bind_param("i", $id);
$smtp->execute();
$smtp->store_result();
$smtp->bind_result($id_tanda, $name);
while ($smtp->fetch()) {
$ret[$count][0] = $id_tanda;
$ret[$count][1] = $name;
$count++;
}
//echo "test 3"
$smtp->free_result();
$smtp->close();
?>
<?php
$titulo = "Elegir Tandas";
include ("head.php")
?>
<div class="container">
<p> </p>
<p> </p>
<p> </p>
<h1>Crear una tanda</h1>
<form action="tandas.php">
<button name="tipo" value="nueva" type="submit" class="btn btn-primary btn-lg btn-block"> Crear una nueva tanda</button>
</form>
<p> </p>
<p> </p>
<h1>Selecciona el numero de tabla</h1>
<div class="form-group">
<?php
foreach($ret as $tandas){
echo '<form action="tandasSelect.php">';
echo '<button name="tipo" value="'.$tandas[0].'" type="submit" class="btn btn-secondary btn-lg btn-block">'.$tandas[1].'</button>';
echo '</form>';
echo '<p> </p>';
}
?>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#tandasView').addClass("active");
});
</script>
<?php
include ("foot.php")
?>