22/05/2011, 18:59
|
(Desactivado) | | Fecha de Ingreso: septiembre-2010
Mensajes: 498
Antigüedad: 14 años, 4 meses Puntos: 5 | |
Respuesta: tengo un formulario de usuario y password <td width="350" height="15">
<form id="adduser" name="adduser" action="adduser.php" method="post">
<?php
if (isset($_POST["username"]) and $_POST["badduser"] == "Add user and stay" and $userexists == "false" and $nouserpass == "false" and $clearfields == "false" and $createpassword == "false") {
print("<font color=\"#347C2C\">User ".$_POST["username"]." successfully added!</font><br><br>");
}
if ($userexists == "true" and $createpassword == "false") {
print("<font color=\"#FF0000\">El Usuario ya Existe!</font><br><br>");
}
if ($nouserpass == "true") {
print("<font color=\"#FF0000\">Debe introducir un nombre de usuario y una contraseña!</font><br><br>");
}
?>
Nombre:<br>
<input type="text" name="username" size="20" tabindex="1" value="<?php if ($userexists == "true" or $nouserpass == "true" or $username<>"") { print($username); } ?>" > <?php if($hidehelp == "0") { print("<img src=\"images/help.png\" onMouseover=\"document.getElementById('cspinfo').i nnerHTML = '".$infoname."';\" onMouseout=\"document.getElementById('cspinfo').in nerHTML = '';\">"); } ?><br><br>
Contraseña:<br>
<input type="text" name="password" size="20" tabindex="2" value="<?php if ($userexists == "true" or $nouserpass == "true" or $password<>"") { print($password); } ?>"> <?php if($hidehelp == "0") { print("<img src=\"images/help.png\" onMouseover=\"document.getElementById('cspinfo').i nnerHTML = '".$infopassword."';\" onMouseout=\"document.getElementById('cspinfo').in nerHTML = '';\">"); } ?><br><br>
Nombre del Cliente:<br>
<input type="text" name="displayname" size="20" tabindex="3" value="<?php if ($userexists == "true" or $nouserpass == "true" or $displayname<>"") { print($displayname); } ?>"> <?php if($hidehelp == "0") { print("<img src=\"images/help.png\" onMouseover=\"document.getElementById('cspinfo').i nnerHTML = '".$infodisplayname."';\" onMouseout=\"document.getElementById('cspinfo').in nerHTML = '';\">"); } ?><br><br>
Correo:<br>
<input type="text" name="email" size="20" tabindex="5" value="<?php if ($userexists == "true" or $nouserpass == "true" or $email<>"") { print($email); } ?>"> <?php if($hidehelp == "0") { print("<img src=\"images/help.png\" onMouseover=\"document.getElementById('cspinfo').i nnerHTML = '".$infoemail."';\" onMouseout=\"document.getElementById('cspinfo').in nerHTML = '';\">"); } ?><br><br>
Meses: <b><font color="#FF0000"><u>1</u></font></b> Mes <br><br>
<fieldset>
<legend class="addedit">Servicios(s): <?php if($hidehelp == "0") { print("<img src=\"images/help.png\" onMouseover=\"document.getElementById('cspinfo').i nnerHTML = '".$infoprofiles."';\" onMouseout=\"document.getElementById('cspinfo').in nerHTML = '';\">"); } ?><br></legend>
<table width="100%" valign="top" cellpadding="0" cellspacing="0">
<?php
if ($usedefaults == "true" and $userexists == "false") {
$lr = "0";
$conn2 = @mysql_connect($dbhost,$dbuser,$dbpass) or die ("Error connecting to database");
mysql_select_db($dbname, $conn2);
$sql2 = mysql_query("SELECT * FROM cmum_profiles") or die ("Error selecting database");
$sql3 = mysql_query("SELECT * FROM cmum_settings WHERE id='1'") or die ("Error selecting database");
$numprof = mysql_num_rows($sql2);
$line3=mysql_fetch_array($sql3);
while($line2=mysql_fetch_array($sql2)) {
if ($lr == "0") {
$dbprof = unserialize($line3["def_profiles"]);
if ($dbprof <> "") {
$checked = "";
foreach($dbprof as $printprof) {
if ($printprof == $line2["id"]) {
$checked = "checked=\"checked\"";
}
}
} else {
$checked = "";
}
print("<tr width=\"100%\" valign=\"top\"><td width=\"50%\" valign=\"top\"><input type=\"checkbox\" name=\"profiles[]\" tabindex=\"12\" value=\"".$line2["id"]."\" ".$checked."/>".$line2["name"]."</td>");
$lr = "1";
} else {
$dbprof = unserialize($line3["def_profiles"]);
if ($dbprof <> "") {
$checked = "";
foreach($dbprof as $printprof) {
if ($printprof == $line2["id"]) {
$checked = "checked=\"checked\"";
}
}
} else {
$checked = "";
}
print("<td width=\"50%\" valign=\"top\"><input type=\"checkbox\" name=\"profiles[]\" tabindex=\"12\" value=\"".$line2["id"]."\" ".$checked."/>".$line2["name"]."</td></tr>");
$lr = "0";
}
}
mysql_close($conn2);
}
if ($userexists == "true" and $usedefaults == "false") {
$lr = "0";
$conn2 = @mysql_connect($dbhost,$dbuser,$dbpass) or die ("Error connecting to database");
mysql_select_db($dbname, $conn2);
$sql2 = mysql_query("SELECT * FROM cmum_profiles") or die ("Error selecting database");
$numprof = mysql_num_rows($sql2);
while($line2=mysql_fetch_array($sql2)) {
if ($lr == "0") {
$dbprof = unserialize($profiles);
if ($dbprof <> "") {
$checked = "";
foreach($dbprof as $printprof) {
if ($printprof == $line2["id"]) {
$checked = "checked=\"checked\"";
}
}
} else {
$checked = "";
}
print("<tr width=\"100%\" valign=\"top\"><td width=\"50%\" valign=\"top\"><input type=\"checkbox\" name=\"profiles[]\" tabindex=\"12\" value=\"".$line2["id"]."\" ".$checked."/>".$line2["name"]."</td>");
$lr = "1";
} else {
$dbprof = unserialize($profiles);
if ($dbprof <> "") {
$checked = "";
foreach($dbprof as $printprof) {
if ($printprof == $line2["id"]) {
$checked = "checked=\"checked\"";
}
}
} else {
$checked = "";
}
print("<td width=\"50%\" valign=\"top\"><input type=\"checkbox\" name=\"profiles[]\" tabindex=\"12\" value=\"".$line2["id"]."\" ".$checked."/>".$line2["name"]."</td></tr>");
$lr = "0";
}
}
mysql_close($conn2);
}
if ($userexists == "true" and $usedefaults == "true") {
$lr = "0";
$conn2 = @mysql_connect($dbhost,$dbuser,$dbpass) or die ("Error connecting to database");
mysql_select_db($dbname, $conn2);
$sql2 = mysql_query("SELECT * FROM cmum_profiles") or die ("Error selecting database");
$numprof = mysql_num_rows($sql2);
while($line2=mysql_fetch_array($sql2)) {
if ($lr == "0") {
$dbprof = unserialize($profiles);
if ($dbprof <> "") {
$checked = "";
foreach($dbprof as $printprof) {
if ($printprof == $line2["id"]) {
$checked = "checked=\"checked\"";
}
}
} else {
$checked = "";
}
print("<tr width=\"100%\" valign=\"top\"><td width=\"50%\" valign=\"top\"><input type=\"checkbox\" name=\"profiles[]\" tabindex=\"12\" value=\"".$line2["id"]."\" ".$checked."/>".$line2["name"]."</td>");
$lr = "1";
} else {
$dbprof = unserialize($profiles);
if ($dbprof <> "") {
$checked = "";
foreach($dbprof as $printprof) {
if ($printprof == $line2["id"]) {
$checked = "checked=\"checked\"";
}
}
} else {
$checked = "";
}
print("<td width=\"50%\" valign=\"top\"><input type=\"checkbox\" name=\"profiles[]\" tabindex=\"12\" value=\"".$line2["id"]."\" ".$checked."/>".$line2["name"]."</td></tr>");
$lr = "0";
}
}
mysql_close($conn2);
}
if ($userexists == "false" and $usedefaults == "false") {
$lr = "0";
$conn2 = @mysql_connect($dbhost,$dbuser,$dbpass) or die ("Error connecting to database");
mysql_select_db($dbname, $conn2);
$sql2 = mysql_query("SELECT * FROM cmum_profiles") or die ("Error selecting database");
$numprof = mysql_num_rows($sql2);
while($line2=mysql_fetch_array($sql2)) {
if ($lr == "0") {
print("<tr width=\"100%\" valign=\"top\"><td width=\"50%\" valign=\"top\"><input type=\"checkbox\" name=\"profiles[]\" tabindex=\"12\" value=\"".$line2["id"]."\"/>".$line2["name"]."</td>");
$lr = "1";
} else {
print("<td width=\"50%\" valign=\"top\"><input type=\"checkbox\" name=\"profiles[]\" tabindex=\"12\" value=\"".$line2["id"]."\"/>".$line2["name"]."</td></tr>");
$lr = "0";
}
}
mysql_close($conn2);
}
?>
</table>
<?php
if ($numprof == 0) {
print("No profiles added!");
} else {
print("<br><input type=\"checkbox\" name=\"allprof\" onClick=\"checkedAll(adduser)\">Todos");
}
?>
</fieldset>
Comentario:<br>
<textarea name="comment" cols="50" rows="6" tabindex="14"><?php if ($userexists == "true" or $nouserpass == "true" or $comment<>"") { print($comment); } ?></textarea>
<br><br>
<input type="submit" name="badduser" value="Agregar" tabindex="15" class="submit" accesskey="s" title="(ALT+S)">
<input type="submit" name="badduser" value="Limpiar" tabindex="19" class="submit" accesskey="c" title="(ALT+C)" onClick="focus();adduser.username.focus()">
</form>
<?php
$conn = @mysql_connect($dbhost,$dbuser,$dbpass) or die ("Error connecting to database");
mysql_select_db($dbname, $conn);
$sql2 = mysql_query("SELECT * FROM cmum_dealer WHERE username='".$_SESSION["loginuser"]."'");
$cred=mysql_fetch_array($sql2);
mysql_close($conn);
?>Creditos Disponibles: <b><font color="#FF0000">( <u><?php print($cred["creditos"]); ?></u> )</font> </b>
</td>
<td width="370" height="20" valign="top"><div id="cspinfo" style="width: 230px"></div></td>
<td width="12" height="20" valign="top"> </td> |