//
// $Id$
+/// Formulario para entrar al sistema.
function admin_form_login($id = '')
{
?>
<?php
}
-function admin_form_asociarse($admin = false, $id = '', $email = '')
+/// Formulario para asociar a un nuevo integrante.
+function admin_form_asociarse($admin = false, $id = '', $email = '', $foto = '')
{
?>
<form name="admin_asociarse" action="<?php echo $_SERVER['PHP_SELF'] ?>"
- method="post" onSubmit="return admin_validar_asociarse(this);">
+ method="post" onSubmit="return admin_validar_asociarse(this);"
+ enctype="multipart/form-data">
<script type="text/javascript" language="JavaScript">
<!--
function admin_validar_asociarse(f)
if (!check_iguales(f.admin_pass1, f.admin_pass2, 'Contraseña')) return false;
if (!check_vacio(f.admin_email, 'E-Mail')) return false;
if (!check_email(f.admin_email, 'E-Mail')) return false;
+ if (!check_vacio(f.admin_foto, 'Foto')) return false;
return true;
}
-->
Contraseña (repítala 2 veces): <input type="password" name="admin_pass1" />
<input type="password" name="admin_pass2" /><br />
E-Mail: <input type="text" name="admin_email" value="<?php echo $email ?>" /><br />
+ <input type="hidden" name="MAX_FILE_SIZE" value="50000">
+ Foto: <input type="file" name="admin_foto" value="<?php echo $foto ?>"
+ accept="image/png;image/jpeg;image/gif" /><br />
<input type="submit" value="Asociarse" /><br />
+ <?php if (!$admin) { ?>
<a href="admin.login.php">Ingresar</a>
+ <?php } ?>
+ </p>
+ </form>
+<?php
+}
+
+/// Formulario para cambiar la fecha desde la cual mostrar el log.
+function admin_form_log_desde($anio = null, $mes = null, $dia = null, $action = 'admin.log.php')
+{
+?>
+ <form name="admin_log_desde" action="<?php echo $action ?>"
+ method="get">
+ <p>
+ <input type="submit" name="admin_todo" value="Ver todo" /> o
+ <input type="submit" value="Ver" /> desde el
+ <select name="admin_anio">
+ <?php foreach (range(2000, 2005) as $a)
+ {
+ $s = ($a == $anio) ? ' selected="selected"' : '';
+ echo "<option$s>$a</option>\n";
+ } ?>
+ </select>
+ <select name="admin_mes">
+ <?php foreach (range(1, 12) as $m)
+ {
+ $s = ($m == $mes) ? ' selected="selected"' : '';
+ echo "<option$s>$m</option>\n";
+ } ?>
+ </select>
+ <select name="admin_dia">
+ <?php foreach (range(1, 31) as $d)
+ {
+ $s = ($d == $dia) ? ' selected="selected"' : '';
+ echo "<option$s>$d</option>\n";
+ } ?>
+ </select>
+ </p>
+ </form>
+<?php
+}
+
+/// Formulario para asociar a un nuevo integrante.
+function admin_form_creditos($users, $user = '', $creditos = 1, $action = 'admin.creditos.php')
+{
+?>
+ <form name="admin_creditos" action="<?php echo $action ?>"
+ method="post" onSubmit="return admin_validar_creditos(this);">
+ <script type="text/javascript" language="JavaScript">
+ <!--
+ function admin_validar_creditos(f)
+ {
+ if (!check_numero(f.admin_cred, 'Creditos')) return false;
+ if (!check_vacio(f.admin_cred_pass, 'Contraseña')) return false;
+ return true;
+ }
+ -->
+ </script>
+ <p>
+ <input type="submit" value="Agregar" />
+ <input type="text" name="admin_cred" size="1" maxlength="1" value="<?php echo $creditos ?>" />
+ créditos a
+ <select name="admin_cred_user">
+ <?php foreach ($users as $u)
+ {
+ printf("<option value=\"%s\"%s>%s %s (%d)</option>\n",
+ $u->getId(), ($u->getId() == $user) ? ' selected="selected"' : '',
+ $u->getNombre(), $u->getApellido(), $u->getCreditos());
+ } ?>
+ </select><br />
+ Contraseña: <input type="password" name="admin_cred_pass" /> (esta operación requiere contraseña)
</p>
</form>
<?php