-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepartments.php
104 lines (89 loc) · 5.14 KB
/
departments.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
<?php include_once('security.php'); ?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>List Of Subscriptions | Activspaces Manager (ASM)</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php include_once('header_links.php'); ?>
</head>
<body>
<?php include_once('side_bar.php'); ?>
<?php include_once('nav_bar.php'); ?>
<br><br><br><br>
<div class="product-status mg-b-15">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="product-status-wrap drp-lst">
<h2 class="m-0 font-weight-bold text-primary">Liste des abonnements</h2>
<!-- <div class="add-product">
<a href="add-department.php">Ajouter un abonnement</a>
</div> -->
<div class="asset-inner">
<?php
try{
$connection = new PDO("mysql:host=localhost;dbname=activspace_database", "root", "");
}
catch(Exception $e){
die('Erreur : '.$e->getMessage());
}
?>
<table>
<?php
$query_run = $connection->query("SELECT name_of_service FROM services") or die(print_r($connection->errorInfo()));
echo "<tr><th>Période d'abonnement</th>";
while ($query = $query_run->fetch()) {
echo '<th>' .$query['name_of_service']. '</th>';
}
$query_run->closeCursor();
if(isset($_POST['bill_submitbtn'])){
$reponse4 = $connection->prepare('ALTER TABLE services ADD COLUMN :periode INT(100) NULL') or die(print_r( $connection->errorInfo()));
$reponse4->execute(array(
'periode' => $_POST['periode']
));
//echo 'Bonjour' .$_POST['periode'];
$reponse4->closeCursor();
}
$query_run = $connection->query("SELECT daily_price, weekly_price, monthly_price FROM services") or die(print_r($connection->errorInfo()));
$i = 0;
while($query = $query_run->fetch()){
$row['daily_price'][$i] = $query['daily_price'];
$row['weekly_price'][$i] = $query['weekly_price'];
$row['monthly_price'][$i] = $query['monthly_price'];
$i = $i + 1;
}
$query_run->closeCursor();
echo '<tr>
<td>Mensuelle</td>';
for($i=0; $i< COUNT($row["monthly_price"]); $i++){
echo '<td>' .$row["monthly_price"][$i]. '</td>';}
echo '<td>
</td>
</tr>
<tr>
<td>Hebdomadaire</td>';
for($i=0; $i< COUNT($row["weekly_price"]); $i++){
echo '<td>' .$row["weekly_price"][$i]. '</td>';}
echo '<td>
</td>
</tr>
<tr>
<td>Journalière</td>';
for($i=0; $i< COUNT($row["daily_price"]); $i++){
echo '<td>' .$row["daily_price"][$i]. '</td>';}
?>
</table>
</div>
</div>
</div>
</div>
</div>
</div><br><br><br>
<?php include_once('footer.php'); ?>
</div>
<?php include_once('footer_links.php'); ?>
</body>
</html>