ladogton2010 commited on
Commit
4b1dd4e
1 Parent(s): f90c167
Files changed (2) hide show
  1. app/config.php +1 -1
  2. app/index.php +85 -0
app/config.php CHANGED
@@ -12,7 +12,7 @@
12
  define('DB_HOST', $_ENV['DB_HOST']);
13
 
14
  $conn = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD1, DB_NAME);
15
- echo("<h1>DATA</h1>");
16
  if (!$conn) {
17
  die('Could not connect:' . mysqli_connect_error());
18
  }
 
12
  define('DB_HOST', $_ENV['DB_HOST']);
13
 
14
  $conn = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD1, DB_NAME);
15
+ # echo("<h1>DATA</h1>");
16
  if (!$conn) {
17
  die('Could not connect:' . mysqli_connect_error());
18
  }
app/index.php CHANGED
@@ -57,6 +57,91 @@
57
  mysqli_error($conn);
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  mysqli_close($conn);
61
  ?>
62
  </div>
 
57
  mysqli_error($conn);
58
  }
59
 
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+ $sql = "SELECT * FROM referencias";
71
+ $response = @mysqli_query($conn, $sql);
72
+
73
+ if ($response){
74
+ echo '<table>
75
+ <tr>
76
+ <th>ID</th>
77
+ <th>Descripci贸n</th>
78
+ </tr>';
79
+
80
+ while ($row = mysqli_fetch_array($response)){
81
+ echo '<tr>
82
+ <td>' . $row['id'] .' </td>
83
+ <td>' . $row['descripcion'] .' </td>
84
+ <td><a href="editar.php?id='. $row['id'] .'">Editar</a></td>
85
+ <td><a href="eliminar.php?id='. $row['id'] .'">Eliminar</a></td>
86
+
87
+
88
+ </tr>';
89
+ }
90
+ echo '</table>';
91
+ }
92
+
93
+ else{
94
+ echo
95
+ "Cound not get a response from database " .
96
+ mysqli_error($conn);
97
+ }
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+ $sql = "SELECT * FROM cita_referencia";
110
+ $response = @mysqli_query($conn, $sql);
111
+
112
+ if ($response){
113
+ echo '<table>
114
+ <tr>
115
+ <th>ID</th>
116
+ <th>Descripci贸n</th>
117
+ <th>P谩gina</th>
118
+ </tr>';
119
+
120
+ while ($row = mysqli_fetch_array($response)){
121
+ echo '<tr>
122
+ <td>' . $row['id'] .' </td>
123
+ <td>' . $row['id_cita'] .' </td>
124
+ <td>' . $row['id_referencia'] .' </td>
125
+ <td><a href="editar.php?id='. $row['id'] .'">Editar</a></td>
126
+ <td><a href="eliminar.php?id='. $row['id'] .'">Eliminar</a></td>
127
+
128
+
129
+ </tr>';
130
+ }
131
+ echo '</table>';
132
+ }
133
+
134
+ else{
135
+ echo
136
+ "Cound not get a response from database " .
137
+ mysqli_error($conn);
138
+ }
139
+
140
+
141
+
142
+
143
+
144
+
145
  mysqli_close($conn);
146
  ?>
147
  </div>