-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_creditos.php
143 lines (121 loc) · 5.45 KB
/
admin_creditos.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
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
<?php require_once('Connections/local.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "index.php?error=2";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
mysql_select_db($database_local, $local);
$query_usuarios = "SELECT * FROM empresas ";
$usuarios = mysql_query($query_usuarios, $local) or die(mysql_error());
$row_usuarios = mysql_fetch_assoc($usuarios);
$totalRows_usuarios = mysql_num_rows($usuarios);
?><!DOCTYPE html>
<html>
<head>
<title>tured.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="js/jquery.mobile-1.2.1.css" />
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/jquery.mobile-1.2.1.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
</head>
<style>
.nav-glyphish-example .ui-btn .ui-btn-inner { padding-top: 40px !important; }
.nav-glyphish-example .ui-btn .ui-icon { width: 30px!important; height: 30px!important; margin-left: -15px !important; box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important; }
#chat .ui-icon { background: url(glyphish-icons/119-piggy-bank.png) 50% 50% no-repeat; }
#email .ui-icon { background: url(glyphish-icons/190-bank.png) 50% 50% no-repeat;}
#login .ui-icon { background: url(glyphish-icons/30-key.png) 50% 50% no-repeat; }
#beer .ui-icon { background: url(glyphish-icons/02-redo.png) 50% 50% no-repeat; }
#coffee .ui-icon { background: url(glyphish-icons/16-line-chart.png) 50% 50% no-repeat;}
#skull .ui-icon { background: url(glyphish-icons/112-group.png) 50% 50% no-repeat; }
</style>
<body>
<!-- Start of first page: #one -->
<div data-role="page">
<div data-role="header" data-theme="e">
<a href="logout.php" data-icon="delete" rel="external">Salir</a>
<h1>TuRed.com - Panel de Administración</h1>
<div class="ui-body-b ui-body">
<div data-role="navbar" class="nav-glyphish-example" data-grid="c" >
<ul>
<li><a href="admin_empresa.php" id="email" data-icon="custom" rel="external">Empresas</a></li>
<li><a href="admin_cuentas.php" id="skull" data-icon="custom" rel="external">Cuentas</a></li>
<li><a href="admin_creditos" id="beer" data-icon="custom" rel="external">Agregar Creditos</a></li>
<li><a href="admin_reportes.php" id="coffee" data-icon="custom" rel="external">Reportes</a></li>
</ul>
</div>
<div class="ui-body-d ui-body" >
</div><!-- /navbar -->
</div></div>
<div data-role="content">
<script>
$(function() {
var availableTags = [
<?php do { ?> "<?php echo $row_usuarios['empresa_nombre']; ?> <?php echo $row_usuarios['empresa_rif']; ?>#<?php echo $row_usuarios['empresa_id']; ?>",
<?php } while ($row_usuarios = mysql_fetch_assoc($usuarios)); ?>" "
];
$( "#tags" ).autocomplete({
source: availableTags
});
});
</script>
<div>
<form action="add_creditos_do.php" method="get" data-ajax="false" class="ui-body ui-body-a ui-corner-all" id="registerForm">
<h3>Datos de la Empresa</h3>
<?php if ($_GET['error']==1) {echo "<h3>Verifique los datos del cliente!!!</h3>";}?>
<input id="tags" type="text" value="" name="nombresx" placeholder="ingrese cualquier dato de la empresa (nombre o rif)..." />
<input id="monto" type="text" value="" name="monto" placeholder="Ingrese la Cantidad de Creditos a agregar" />
<button type="submit" data-theme="b" name="submit" value="submit-value">Continuar</button>
</form>
<br>
</div><!-- /content -->
<div data-role="footer" class="footer-docs" data-theme="b" align="center">
<p class="jqm-version"></p>
<p>tured.com 2013</p>
</div>
</div>
<!-- /page -->
</body>
</html>
<?php
mysql_free_result($usuarios);
?>