コード例 #1
0
ファイル: juego_update.php プロジェクト: nyangara/--ngara
require 'include/pre.php';
function select_opts($name, $range, $now, $format, $print_empty)
{
    $r = '<select name="' . $name . '">';
    if ($print_empty) {
        $r .= '<option value=""></option>';
    }
    foreach ($range as $i) {
        $r .= sprintf('<option value="' . $format . '"%s>' . $format . '</option>', $i, $i === $now ? ' selected="selected"' : '', $i);
    }
    return $r . "</select>";
}
if (has_auth('admin') && array_key_exists('id', $_GET)) {
    $j = UIFacade::select('Juego', array('id' => $_GET['id']));
    $equipos = UIFacade::retrieveAll('Equipo');
    $estadios = UIFacade::retrieveAll('Estadio');
    ?>
<div id="contenido_interno" style="height: auto">
  <div>
    <form action="controller" method="post">
      <input type="hidden" name="goto" value="calendario"/>
      <table width="100%" border="0" cellspacing="5" cellpadding="5" align="left">
        <tr>
          <th style="border: 2px solid #cccccc">
            Agregar juego
          </th>
        </tr>
        <tr>
          <td style="border: 1px solid #cccccc">
            Introduzca la fecha y hora de inicio:
            <input type="text" name="inicio" value="<?php 
コード例 #2
0
ファイル: usuarios.php プロジェクト: nyangara/--ngara
<?php

require 'include/pre.php';
?>
<h2>Usuarios</h2>
<?php 
if (has_auth('user')) {
    foreach (UIFacade::retrieveAll('Usuario') as $u) {
        $img = $u->get('URL del avatar') or $img = 'generico.jpg';
        if ($img and !filter_var($img, FILTER_VALIDATE_URL)) {
            $img = 'static/images/usuario/' . $img;
        }
        ?>
<div style="border: 1em">
  <form action="usuario_detail" method="get">
    <input type="hidden" name="id" value="<?php 
        echo $u->get('id');
        ?>
"/>
    <img src="<?php 
        echo $img;
        ?>
" style="float: left; clear: both"/>
    <p>Usuario: <?php 
        echo $u->get('username');
        ?>
</p>
    <p>Nombre:  <?php 
        echo $u->get('nombre completo');
        ?>
</p>
コード例 #3
0
ファイル: equipos.php プロジェクト: nyangara/--ngara
<?php

require 'include/pre.php';
?>
<h2>Equipos</h2>
<?php 
if (has_auth('admin')) {
    ?>
<form id="form" action="equipo_insert.php" method="get">
  <button type="submit">Agregar equipo</button>
</form>
<?php 
}
foreach (UIFacade::retrieveAll('Equipo') as $e) {
    $img = $e->get('URL del logo') or $img = 'generico.jpg';
    if ($img and !filter_var($img, FILTER_VALIDATE_URL)) {
        $img = 'static/images/equipo/' . $img;
    }
    ?>
<div>
  <img src="<?php 
    echo $img;
    ?>
"/>
  <br/>
  <h3>
    <?php 
    echo $e->get('nombre completo');
    ?>
 (<?php 
    echo $e->get('siglas');
コード例 #4
0
ファイル: equipo_insert.php プロジェクト: nyangara/--ngara
    <p><input name="nombre completo" type="text"/></p>
    <p>Nombre corto:</p>
    <p><input name="nombre corto" type="text"/></p>
    <p>Siglas:</p>
    <p><input name="siglas" type="text"/></p>
    <p>Año de fundación:</p>
    <p><?php 
$y = date('Y');
echo select_opts('año de fundación', range($y, $y - 150), $y, '%d');
?>
</p>
    <p>Ciudad:</p>
    <p><input name="ciudad" type="text"/></p>
    <p>Estado:</p>
    <p><input name="estado" type="text"/></p>
    <p>Estadio principal:</p>
    <p><?php 
echo select_objs('estadio principal', UIFacade::retrieveAll('Estadio'), 'id', 'nombre');
?>
</p>
    <p>Logo:</p>
    <p><input name="imagen" type="file"/></p>
    <p>Precio: </p>
    <p><input name="precio" type="text"/></p>

    <input type="hidden" name="goto" value="equipos"/>
    <button type="submit" name="action" value="equipo_insert">Agregar</button>
  </form>
</div>
<?php 
require 'include/post.html';
コード例 #5
0
ファイル: roster.php プロジェクト: nyangara/--ngara
        $Equipo_Roster[] = $ul;
    }
}
$EquipoR = null;
if (!empty($Equipo_Roster)) {
    $EquipoR = UIFacade::select('Equipo', array('id' => $Equipo_Roster[0]->get('id')));
}
$Jugadores_Roster = array();
foreach (UIFacade::retrieveAll('TieneJugador') as $uj) {
    if ($uj->get('usuario') == userdata()->get('id')) {
        $Jugadores_Roster[] = $uj;
    }
}
$JugadoresR = $Jugadores_Roster;
$Jugadores = UIFacade::retrieveAll('Jugador');
$Equipos = UIFacade::retrieveAll('Equipo');
$Usados = array();
foreach ($Jugadores_Roster as $J_R) {
    $Tmp = UIFacade::select('Jugador', array('id' => $J_R->get('id')));
    $Aux[$J_R->get('posición')] = '<a class="irA' . $J_R->get('posición') . '"><img src="' . $Tmp->get('URL de la foto') . '"  width="50" height="50" /></a>';
    $Usados[] = $J_R->get('posición');
}
error_log(var_export($Usados, true));
error_log(var_export($Aux, true));
$Aux['DEF'] = '<a class="irADEF"><img src="assets/images/Fotos_Roster/JugadorDefault.jpg"  width="50" height="50" /></a>';
//Seleccion de Posicion Disponible;
$Todos = array('C', '1B', '2B', '3B', 'SS', 'LF', 'CF', 'RF');
$k = 0;
$Disponibles = array();
for ($i = 0; $i < count($Todos); $i++) {
    for ($j = 0; $j < count($Usados); $j++) {
コード例 #6
0
ファイル: estadios.php プロジェクト: nyangara/--ngara
<?php

require 'include/pre.php';
?>
<h2>Estadios</h2>
<?php 
if (has_auth('admin')) {
    ?>
<form action="estadio_insert" method="get">
  <button type="submit">Agregar Estadio</button>
</form>
<?php 
}
$show = array('ciudad', 'estado', 'capacidad', 'año de fundación', 'tipo de terreno', 'propietario', 'medida del left field', 'medida del center field', 'medida del right field', 'descripción');
foreach (UIFacade::retrieveAll('Estadio') as $s) {
    $img = $s->get('URL de la foto') or $img = 'generico.jpg';
    if ($img and !filter_var($img, FILTER_VALIDATE_URL)) {
        $img = 'static/images/estadio/' . $img;
    }
    ?>
<div>
  <h3><?php 
    echo $s->get('nombre');
    ?>
</h3>
  <br/>
  <img src="<?php 
    echo $img;
    ?>
"/>
<?php