public static function initialize($idU, $idS, $isMatricules = false, $isWeb = false) { $OU = UsuarisPeer::retrieveByPK($idU); if (!$OU instanceof Usuaris) { $OU = new Usuaris(); $OU->setSiteId($idS); $OU->setActiu(true); $OU->setNivellsIdnivells(NivellsPeer::REGISTRAT); $OU->setHabilitat(true); } if ($isMatricules) { return new UsuarisMatriculesForm($OU); } elseif ($isWeb) { return new ClientUsuarisForm($OU); } else { return new UsuarisForm($OU); } }
/** * Declares an association between this object and a Usuaris object. * * @param Usuaris $v * @return Incidencies The current object (for fluent API support) * @throws PropelException */ public function setUsuarisRelatedByQuiresol(Usuaris $v = null) { if ($v === null) { $this->setQuiresol(NULL); } else { $this->setQuiresol($v->getUsuariid()); } $this->aUsuarisRelatedByQuiresol = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Usuaris object, it will not be re-added. if ($v !== null) { $v->addIncidenciesRelatedByQuiresol($this); } return $this; }
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param Usuaris $value A Usuaris object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(Usuaris $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getUsuariid(); } // if key === null self::$instances[$key] = $obj; } }
/** * Declares an association between this object and a Usuaris object. * * @param Usuaris $v * @return UsuarisSites The current object (for fluent API support) * @throws PropelException */ public function setUsuaris(Usuaris $v = null) { if ($v === null) { $this->setUsuariId(NULL); } else { $this->setUsuariId($v->getUsuariid()); } $this->aUsuaris = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Usuaris object, it will not be re-added. if ($v !== null) { $v->addUsuarisSites($this); } return $this; }
function IteratorReserves($RESERVES, $ESTAT) { $RET = ""; foreach ($RESERVES as $R) { if ($R->getEstat() == $ESTAT) { $OU = $R->getUsuaris(); if (!$OU instanceof Usuaris) { $OU = new Usuaris(); $OU->setNom('Error'); } $RET .= '<TR><TD>' . link_to($R->getCodi(), 'gestio/gReserves?accio=E&IDR=' . $R->getReservaespaiid()) . '</td> <TD>' . $R->getNom() . '</TD> <TD><a href="#" class="tt2"><span>' . $OU->getDades() . '</span>' . $OU->getNomComplet() . '</a></TD> <TD>' . $R->getDataalta('d/m/Y H:i') . '</TD> <TD>' . $R->getEstatText() . '<TD> </TR>'; } } return $RET; }
<?php session_start(); require_once '../Logica/Connexio.php'; require_once '../Logica/Usuaris.php'; require_once '../Logica/SolicitudAmistat.php'; $Connexio = new Connexio(); $Connexio->connectar(); $usuario = new Usuaris(); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> <script type="text/javascript"> $(document).ready(function() { $("#form").bind("submit", function() { $.fancybox.showActivity(); $.ajax({ type : "POST", cache : false, url : "cercaAmistats.php", data : $(this).serializeArray(), success: function(data) { $.fancybox(data); } }); return false;
<?php require_once '../Logica/Connexio.php'; require_once '../Logica/Usuaris.php'; if ($_POST) { $Connexio = new Connexio(); $Connexio->connectar(); $Connexio->selectdb("socialtravel"); $usuari = new Usuaris(); $usuari->setUsuari($_POST[nom], $_POST[cognom], $_POST[dni], $_POST[usuari], $_POST[pass]); echo "Regitrado!!"; } // echo "<pre>"; // print_r($_POST); // echo "</pre>"; ?> <html> <head> <script type="text/javascript"> $(document).ready(function() { $("#form").bind("submit", function() { $.fancybox.showActivity(); $.ajax({ type : "POST", cache : false, url : "registre.php", data : $(this).serializeArray(), success: function(data) { $.fancybox(data); } });
<?php session_start(); require_once '../Logica/Connexio.php'; require_once '../Logica/SolicitudAmistat.php'; require_once '../Logica/Usuaris.php'; $Connexio = new Connexio(); $Connexio->connectar(); $solAmistad = new SolicitudAmistat(); $usuario = new Usuaris(); if ($_GET['idEliminar']) { $solAmistad->setRebutjarSolicitut($_GET['idEliminar']); } if ($_GET['idAceptar']) { $solAmistad->setAcceptarSolicitut($_GET['idAceptar']); } ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> <script type="text/javascript"> $(document).ready(function() { $(".iframes").fancybox({ maxWidth : 800, maxHeight : 600, fitToView : false, width : '70%', height : '70%', autoSize : false,
cache : false, url : "dades.php", data : $(this).serializeArray(), success: function(data) { $.fancybox(data); } }); return false; }); }); </script> </head> <body> <?php if (@$_POST) { $usuari = new Usuaris(); $usuari->updateUsuari($_POST[nom], $_POST[cognom], $_POST[dni], $_POST[usuari], $_POST[pass]); echo "<p><B>Datos modificados correctamente</B></p>"; } else { $result = $usuari->getUsuariByName(@$_SESSION[usuario]); echo "<p style='text-align:left; font-size:14px'><B>Datos personales:</B></p>"; echo "<form id='form' method='POST'>"; echo "<table border=0 style='font-size:12px'>"; echo "<tr>"; echo "<td>Nombre:</td>"; echo '<td><input type="text" name="nom" value="' . mysql_result($result, 0, 1) . '"></td>'; echo "</tr>"; echo "<td>Apellido:</td>"; echo '<td><input type="text" name="cognom" value="' . mysql_result($result, 0, 2) . '"></td>'; echo "</tr>"; echo "<td>DNI:</td>";
success: function(data) { $.fancybox(data); } }); return false; }); }); </script> </head> <body> <?php if ($_POST) { $Connexio = new Connexio(); $Connexio->connectar(); $Connexio->selectdb("socialtravel"); $usuari = new Usuaris(); if (@$usuari->autentificarUsuari($_POST[usuario], $_POST[password])) { @($_SESSION[usuario] = $_POST[usuario]); $result = $usuari->getUsuariByName(@$_SESSION[usuario]); @($_SESSION[idUsuario] = mysql_result($result, 0, 0)); $notificacions = new SolicitudAmistat(); $result = $notificacions->getSolicitutByUser($_SESSION[idUsuario]); echo "<p><b>Bienvenido " . @$_POST[usuario] . " !</b></p>"; echo "<p><b>Tienes " . mysql_num_rows($result) . " notificaciones!</b></p>"; echo "<meta http-equiv='Refresh' content='1;url=index.php'>"; } else { echo "<img src='../Vista/img/error.png' align='center'/>"; echo "<p class='error'>Usuario/Password incorrectos</p>"; } } else { ?>
<?php session_start(); require_once '../Logica/Connexio.php'; require_once '../Logica/SolicitudAmistat.php'; require_once '../Logica/Usuaris.php'; $Connexio = new Connexio(); $Connexio->connectar(); $Connexio->selectdb("socialtravel"); $solAmistad = new SolicitudAmistat(); $usuario = new Usuaris(); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> <script type="text/javascript"> $(document).ready(function() { $('a.idAceptar').click(function(){ var txt=$(this).attr("rel"); $("#contenedor_preferencias").load("amistats.php?idAceptar="+txt); }); $('a.idEliminar').click(function(){ var txt=$(this).attr("rel"); $("#contenedor_preferencias").load("amistats.php?idEliminar="+txt); }); }); </script> <style type="text/css"> table.hovertable {
function IteratorReserves($RESERVES, $ESTAT) { $RET = "<table class=\"DADES\">"; foreach ($RESERVES[$ESTAT] as $R) { $OU = $R->getUsuaris(); if (!$OU instanceof Usuaris) { $OU = new Usuaris(); $OU->setNom('Error'); } $RET .= '<TR><TD>' . link_to($R->getCodi(), 'gestio/gReserves?accio=E&IDR=' . $R->getReservaespaiid()) . '</td> <TD>' . $R->getNom() . '</TD> <TD><a href="#" class="tt2"><span>' . $OU->getDades() . '</span>' . $OU->getNomComplet() . '</a><br /><span style="font-size:8px; color: gray;">' . $OU->getEmail() . '</span></TD> <TD>' . $R->getDataalta('d/m/Y') . '</TD> </TR>'; } return $RET . '</table>'; }