-
Notifications
You must be signed in to change notification settings - Fork 0
/
listas_detalle.php
112 lines (99 loc) · 3.84 KB
/
listas_detalle.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
<?php
// Codificar pagina en ANSI
// Codificar contenidos en UTF8 con utf8_encode
// En aplicación usa como UTF8 con guard let
$u = 'root';
$p = 'r1r7C1h6ZG4ZVWF';
$d = 'defensa';
$link = mysqli_connect("sscl-db-instance.chapmhehekr9.us-east-1.rds.amazonaws.com", $u, $p) or die(mysqli_error());
mysqli_select_db($link, $d) or die(mysqli_error());
$lista_id = $_GET["l"];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="favicon.ico">
<title>Mailist Defensa</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="starter-template.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Mailist Defensa</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="./index.php">Inicio</a></li>
<li><a href="./contactos.php">Contactos</a></li>
<li><a href="./listas.php">Listas</a></li>
<li><a href="./write.php">Escribir</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<p></p>
<div class="panel panel-primary">
<div class="panel-heading">Detalle Lista</div>
<!--
<div class="panel-body">
</div>
-->
<table class="table">
<thead>
<tr> <th>#</th> <th>Nombre</th><th>Cargo</th> <th>Departamento</th> <th>Empresa</th> <th>Correo</th> </tr>
</thead>
<tbody>
<?php
$q = "SELECT ml_destinatarios.id as id, nombres, cargo, departamento, empresa, email FROM ml_destinatarios, ml_listas_detalle where ml_listas_detalle.lista_id = $lista_id AND ml_listas_detalle.destinatario_id=ml_destinatarios.id;";
$resultado = mysqli_query($link, $q) or die(mysqli_error());
if (mysqli_num_rows($resultado) >= 1) {
while ($row = mysqli_fetch_array($resultado)) {
?>
<tr>
<th scope="row"><?php echo $row["id"];?></th>
<td><?php echo utf8_encode($row["nombres"]);?></td>
<td><?php echo utf8_encode($row["cargo"]);?></td>
<td><?php echo utf8_encode($row["departamento"]);?></td>
<td><?php echo utf8_encode($row["empresa"]);?></td>
<td><?php echo $row["email"];?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div><!-- /.container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
<?php
mysqli_close($link) or die(mysqli_error());
?>