protected function action() { $userMail = filter_var($_POST['email'], FILTER_SANITIZE_STRING); $msg = new SysMsg(); if ($this->checkEmailAddress($userMail)) { $user = new Utente(); $user->setEmail($userMail); $pwd = $user->getForgottenPassword(); if ($pwd != '') { $msg = 'Salve, abbiamo recuperato la sua password: '******'Servizio'); $mail->setCognome('Support'); $mail->setEmailFrom('*****@*****.**'); $mail->setEmailTo($userMail); $mail->setEmailReplyTo('*****@*****.**'); $mail->setOggetto('Recupero password.'); $mail->setMessaggio($msg); $mail->sendMail(); Session::setObj(Session::SYSMSG, $msg->setMessage('La password è stata inviata a: ' . $userMail)->setType(SysMsg::MSG_OK)); } else { Session::setObj(Session::SYSMSG, $msg->setMessage('Spiacente, non siamo riusciti a recuperare la sua password.')->setType(SysMsg::MSG_CRITICAL)); } } else { Session::setObj(Session::SYSMSG, $msg->setMessage('Spiacente, email errata.')->setType(SysMsg::MSG_ALERT)); } //*** $this->redirect = "message"; }
public function stampTutto() { $n = parent::stampTutto(); $n = $n . $this->numCel; $n = $n . "<br />"; return $n; }
/** * @var $utente Utente * @param string $utenteid * @var $user CWebUser */ public function actionUtente($utenteid = null) { // if the action come from a cration of new utente or modify utente if ($utenteid == null) { $utente = new Utente(); } else { $utente = Utente::GetUtenteByPk($utenteid); } // var_dump($_POST); if (Yii::app()->getRequest()->isPostRequest) { $isNew = $utente->isNewRecord; //setAttributes must be have "false", like second params, to save all the inputs field, with true it save only for safe attrbiutes ( required input ) $utente->setAttributes($_POST['Utente']); try { if ($utente->save()) { $user = Yii::app()->user; if ($isNew) { // messagge flash $user->setFlash('success', 'Utente creato!!'); // redirect to new utente page return $this->redirect('utente/' . Yii::app()->db->lastInsertID); } else { $user->setFlash('success', 'Utente modificato!!'); return $this->refresh(); } } } catch (CDbException $ex) { // cacthare l'esatto codice di errore mysql per dare il corretto messaggio di errore Yii::app()->user->setFlash('error', "Errore: " . $ex->getMessage()); } } $this->render('utente', array("utente" => $utente)); // var_dump($utente); }
public function firmatario() { if ($this->pFirma) { return Utente::id($this->pFirma); } else { return false; } }
/** * * @param type $email identifica l' utente * @param type $passwd chiave per accedere * @return type array nome & cognome se andata a buon fine, boolan false se fallisce */ public function LogIn($email, $passwd) { // parametri provvisori!!!!!!!!!!!! //$email= mysql_escape_string($_POST['email']); //$passwd= mysql_escape_string($_POST['password']); $Log = false; $UtenteDAO = new FUtente(); if ($UtenteDAO->VerificaEmail($email)) { if ($UtenteDAO->VerificaPassword($email, $passwd)) { $AttrUtente = $UtenteDAO->GetUtenteByMail($email); $Utente = new Utente($AttrUtente[0]["Nome"], $AttrUtente[0]["Cognome"], $AttrUtente[0]["Password"], $AttrUtente[0]["Email"], $AttrUtente[0]["Prodottiosservati"]); $_SESSION['oggetto_utente_loggato'] = $Utente; $_SESSION['stato_log'] = 'in'; $Log = array(); $Log['Nome'] = $Utente->getNome(); $Log['Cognome'] = $Utente->getCognome(); } } return $Log['Nome']; }
public function postAct() { $apagar = Utente::find(Input::get('id')); $apagar->nome = Input::get('nome'); $apagar->bi_nuit = Input::get('identificacao'); $apagar->data_nasc = Input::get('dataNasc'); $apagar->sexo = Input::get('sexo'); $apagar->bairro = Input::get('bairro'); $apagar->distrito = Input::get('distrito'); $apagar->update(); $utentes = Utente::all(); return View::make('Utente.utenteVisu')->with('utentes', $utentes); }
protected function action() { //Autenticazione Utente $msg = new SysMsg(); $user = new Utente(Session::getObj(Session::NETWORKER)->getId()); $user->setNome(filter_var(ucfirst($_POST['nome']), FILTER_SANITIZE_STRING)); $user->setCognome(filter_var(ucfirst($_POST['cognome']), FILTER_SANITIZE_STRING)); $user->setEmail(filter_var($_POST['email'], FILTER_SANITIZE_STRING)); $user->setUsername(filter_var($_POST['username'], FILTER_SANITIZE_STRING)); $user->setPassword(filter_var($_POST['password'], FILTER_SANITIZE_STRING)); $user->update() ? Session::setObj(Session::SYSMSG, $msg->setMessage("Utente aggiornato correttamente.")->setType(SysMsg::MSG_OK)) : Session::setObj(Session::SYSMSG, $msg->setMessage("Aggiornamento utente fallito.")->setType(SysMsg::MSG_CRITICAL)); //*** Session::destroyObj(Session::NETWORKER); $this->redirect = "user/fancymessage"; }
protected function action() { $this->showContentOnly = TRUE; try { $idntwrkr = $this->uriPath[count($this->uriPath) - 4]; $fullname = $this->uriPath[count($this->uriPath) - 3] . ' ' . $this->uriPath[count($this->uriPath) - 2]; $avatar = Utente::decode($this->uriPath[count($this->uriPath) - 1]); } catch (Exception $exc) { $idntwrkr = NULL_PARENT_ROOT; $fullname = NON_DEFINITO; $avatar = Utente::getDefaultAvatarUrl(); } $this->addParameter('idntwrkr', $idntwrkr); $this->addParameter('fullname', $fullname); $this->addParameter('avatar', $avatar); $this->pageToView = "addntwrkrsale"; parent::action(); }
protected function action() { $this->showContentOnly = TRUE; try { $parent = $this->uriPath[count($this->uriPath) - 4]; $sponsor = $this->uriPath[count($this->uriPath) - 3] . ' ' . $this->uriPath[count($this->uriPath) - 2]; $avatar = Utente::decode($this->uriPath[count($this->uriPath) - 1]); } catch (Exception $exc) { $parent = NULL_PARENT_ROOT; $sponsor = NON_DEFINITO; $avatar = Utente::getDefaultAvatarUrl(); } $this->addParameter('parent', $parent); $this->addParameter('sponsor', $sponsor); $this->addParameter('avatar', $avatar); $this->pageToView = "newuser"; parent::action(); }
protected function action() { //Autenticazione Utente $msg = new SysMsg(); $user = new Utente(Session::getObj(Session::UTENTE)->getId()); $user->setNome(filter_var($_POST['nome'], FILTER_SANITIZE_STRING)); $user->setCognome(filter_var($_POST['cognome'], FILTER_SANITIZE_STRING)); $user->setEmail(filter_var($_POST['email'], FILTER_SANITIZE_STRING)); $user->setUsername(filter_var($_POST['username'], FILTER_SANITIZE_STRING)); $user->setPassword(filter_var($_POST['password'], FILTER_SANITIZE_STRING)); if ($user->update()) { //Pone in sessione user Session::setObj(Session::UTENTE, $user); Session::setObj(Session::SYSMSG, $msg->setMessage("Utente aggiornato correttamente.")->setType(SysMsg::MSG_OK)); } else { Session::setObj(Session::SYSMSG, $msg->setMessage("Aggiornamento utente fallito.")->setType(SysMsg::MSG_CRITICAL)); } //*** $this->redirect = "user/fancymessage"; }
public function __construct($fbid = 0) { parent::__construct(); $this->fbid = $fbid; $this->datecreated = NULL; //Create query $dbQuery = "SELECT * FROM fb_customers "; $dbQuery .= "WHERE fb_id = " . $fbid; $fbuser = $this->access->select($dbQuery); if ($fbuser) { $this->fbid = $fbid; $this->id = $fbuser[0]['rp_id']; $this->nome = $fbuser[0]['fb_firstname']; $this->cognome = $fbuser[0]['fb_lastname']; $this->email = $fbuser[0]['fb_email']; $this->avatarUrl = 'https://graph.facebook.com/' . $fbid . '/picture'; $this->datecreated = $fbuser[0]['date_created']; } }
public function __construct($goid = 0) { parent::__construct(); $this->goid = $goid; $this->datecreated = NULL; //Create query $dbQuery = "SELECT * FROM go_utenti "; $dbQuery .= "WHERE go_id = '" . $goid . "'"; $gouser = $this->access->select($dbQuery); if ($gouser) { $this->goid = $goid; $this->id = $gouser[0]['rp_id']; $this->nome = $gouser[0]['go_firstname']; $this->cognome = $gouser[0]['go_lastname']; $this->email = $gouser[0]['go_email']; $this->avatarUrl = $gouser[0]['go_avatar']; $this->datecreated = $gouser[0]['date_created']; } }
protected function action() { $msg = new SysMsg(); $rdrct = "user/message"; if ($_POST['username'] != "" && $_POST['password'] != "") { //Autenticazione Utente $user = new Utente(); $user->setUsername(filter_var($_POST['username'], FILTER_SANITIZE_STRING)); $user->setPassword(filter_var($_POST['password'], FILTER_SANITIZE_STRING)); $user->login(); //Pone in sessione user (se autenticato)e message if ($user->isAutenticated()) { Session::setObj(Session::UTENTE, $user); Session::setObj(Session::SYSMSG, $msg->setMessage('Benvenuto ' . $user->getNome() . ' ' . $user->getCognome())->setType(SysMsg::MSG_OK)->addParameter('useravatar', $user->getAvatarUrl())); $rdrct = "user/welcome"; } else { Session::setObj(Session::SYSMSG, $msg->setMessage('Username/Password errati. Login fallito.')->setType(SysMsg::MSG_CRITICAL)); } } else { Session::setObj(Session::SYSMSG, $msg->setMessage('Username/Password non inseriti. Login fallito.')->setType(SysMsg::MSG_ALERT)); } //*** $this->redirect = $rdrct; }
$lezione->fine = $fine->getTimestamp(); } if ($inizio->getTimestamp() != $lezione->inizio) { if ($inizio < $fine && $inizio->getTimestamp() > time()) { $lezione->inizio = $inizio->getTimestamp(); } else { redirect("formazione.corsibase.lezioni&id={$_GET['id']}&date&in"); } } if ($fine->getTimestamp() != $lezione->fine) { if ($inizio < $fine && $fine->getTimestamp() > time()) { $lezione->fine = $fine->getTimestamp(); } else { redirect("formazione.corsibase.lezioni&id={$_GET['id']}&date&fi"); } } if (isset($_POST["assenti_{$lezione}"])) { foreach ($_POST["assenti_{$lezione}"] as $_r) { $_r = Utente::id($_r); if ($lezione->assente($_r)) { continue; } $a = new AssenzaLezione(); $a->utente = $_r; $a->lezione = $lezione; $a->pConferma = $me; $a->tConferma = time(); } } } redirect("formazione.corsibase.lezioni&id={$_GET['id']}");
</div> </div> <hr /> <table class="table table-striped table-bordered" id="tabellaUtenti"> <thead> <th>Nome</th> <th>Cognome</th> <th>Codice Fiscale</th> <th>Azione</th> </thead> <?php $comitati = $me->comitatiApp([APP_SOCI, APP_PRESIDENTE]); foreach ($comitati as $comitato) { foreach ($comitato->tesseriniNonRiconsegnati() as $v) { $v = Utente::id($v); ?> <tr> <td><?php echo $v->nome; ?> </td> <td><?php echo $v->cognome; ?> </td> <td><?php echo $v->codiceFiscale; ?> </td> <td>
<?php session_start(); if (!isset($_SESSION['login']) || $_SESSION['login'] == FALSE) { header("Location: ../index.html"); exit; } $id_utente = $_SESSION['id_utente']; // inclusione del file di funzione include_once 'includes/functions.php'; $obj = new Utente(); $permessi = array(); $permessi = $obj->controlla_permesso($id_utente, 1); $pNews = $permessi['pNews']; $pCurriculum = $permessi['pCurriculum']; $pStatuto = $permessi['pStatuto']; $pFaq = $permessi['pFaq']; $pPresenze = $permessi['pPresenze']; include_once 'includes/connessione_db.php'; ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title> <?php echo strtoupper(basename(__FILE__, '.php')); ?> | Gestionale</title> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<?php /* * ©2014 Croce Rossa Italiana */ paginaPrivata(); controllaParametri(['id']); $admin = $me->admin(); $i = 0; $corso = CorsoBase::id($_GET['corso']); paginaCorsoBase($corso); if (!$corso->modificabileDa($me)) { redirect("formazione.corsibase.scheda&id={$_GET['corso']}"); } $utente = Utente::id($_GET['id']); ?> <h2 class="allinea-centro text-success"><i class="icon-calendar"></i> Elenco assenze</h2> <h3 class="allinea-centro"><?php echo $utente->nomeCompleto(); ?> </h3> <hr /> <div class="row-fluid"> <table class="table table-striped table-bordered"> <thead> <th>Nome della lezione</th> <th>Inizio lezione</th> <th>Fine della lezione</th>
/** * Invia l'email usando configurazione attuale * @param callback|null $callback Eventuale callback da chiamare dopo ogni invio */ public function invia($callback = null) { global $conf; // Ottiene un mailer $y = $this->_mailer(); // Imposta il mittente $y->From = '*****@*****.**'; $y->FromName = 'Croce Rossa Italiana'; // Configurazione del mittente if ($this->mittente_id) { $u = Utente::id($this->mittente_id); $y->addReplyTo($u->email(), $u->nomeCompleto()); } else { // Se non specificato, rispondi al Supporto $y->addReplyTo('*****@*****.**', 'Supporto Gaia'); } // Configurazione oggetto e corpo $y->Subject = $this->oggetto; $y->isHTML(true); $y->Body = $this->corpo; $y->CharSet = 'UTF-8'; // Configurazione degli allegati foreach ($this->allegati() as $allegato) { try { // Cerca file dell'allegato... $a = File::id($allegato['allegato_id']); } catch (Errore $e) { // Se allegato mancante, salta... continue; } $y->addAttachment($a->percorso(), $a->nome); } // Imposta invio inizio... $this->_inizia_invio(); $riuscito = false; // Se non ci sono destinatari... $destinatari = $this->destinatari(); if (!(bool) $destinatari) { /* $y->AddAddress( '*****@*****.**', 'Supporto Gaia' ); */ $y->AddAddress('*****@*****.**', 'GAIA'); $y->AddAddress('*****@*****.**', 'GAIA'); $riuscito = (bool) $y->send(); } else { $riuscito = true; // Per ogni destinatario... foreach ($destinatari as $dest) { // Salta se gia' inviato! if ($dest['inviato'] && $dest['ok']) { continue; } $utente = Utente::id($dest['dest']); // Destinatario non esistente if (!$utente) { $this->_errore_invio($dest['dest']); continue; } // Invia l'email in questione /* $y->AddAddress( $utente->email, $utente->nomeCompleto() ); */ $y->AddAddress('*****@*****.**', 'GAIA'); $y->AddAddress('*****@*****.**', 'GAIA'); $stato = $y->send(); $this->_stato_invio($dest['dest'], $stato, $y->ErrorInfo); $riuscito = $riuscito && $stato; $y->ClearAllRecipients(); if (is_callable($callback)) { call_user_func($callback); } } } if ($riuscito) { $this->_termina_invio(); } return $riuscito; }
function cronjobSettimanale() { global $log, $db; $ok = true; cronjobEsegui("Invio reminder patenti CRI in scadenza nei prossimi 15gg", function () { $patenti = TitoloPersonale::inScadenza(2700, 2709, 15); // Minimo id titolo, Massimo id titolo, Giorni $n = 0; $giaInsultati = []; foreach ($patenti as $patente) { $_v = $patente->volontario(); if (in_array($_v->id, $giaInsultati)) { continue; // Il prossimo... } $giaInsultati[] = $_v->id; $m = new Email('patenteScadenza', 'Avviso patente CRI in scadenza'); $m->a = $_v; $m->_NOME = $_v->nome; $m->_SCADENZA = date('d-m-Y', $patente->fine); $m->invia(); $n++; } return "Inviate {$n} notifiche di scadenza patente"; }, $log, $ok); cronjobEsegui("Invio reminder patenti civili in scadenza nei prossimi 15gg", function () { $patenti = TitoloPersonale::inScadenza(70, 77, 15); // Minimo id titolo, Massimo id titolo, Giorni $n = 0; $giaInsultati = []; foreach ($patenti as $patente) { $_v = $patente->volontario(); if (in_array($_v->id, $giaInsultati)) { continue; // Il prossimo... } $giaInsultati[] = $_v->id; $m = new Email('patenteScadenzaCivile', 'Avviso patente Civile in scadenza'); $m->a = $_v; $m->_NOME = $_v->nome; $m->_SCADENZA = date('d-m-Y', $patente->fine); $m->invia(); $n++; } return "Inviate {$n} notifiche di scadenza patente civili"; }, $log, $ok); cronjobEsegui("Invio del riepilogo per i presidenti", function () { $n = 0; foreach (Comitato::elenco() as $comitato) { $a = count($comitato->appartenenzePendenti()); $b = count($comitato->titoliPendenti()); $c = count($comitato->fototesserePendenti()); $z = $a + $b + $c; if ($z == 0) { continue; } foreach ($comitato->volontariPresidenti() as $presidente) { $m = new Email('riepilogoPresidente', "Promemoria: Ci sono {$c} azioni in sospeso"); $m->a = $presidente; $m->_NOME = $presidente->nomeCompleto(); $m->_COMITATO = $comitato->nomeCompleto(); $m->_APPPENDENTI = $a; $m->_TITPENDENTI = $b; $m->_FOTPENDENTI = $c; $m->invia(); $n++; } } return "Inviati {$n} promemoria ai presidenti"; }, $log, $ok); cronjobEsegui("Invio reminder anniversario riserva a breve", function () { $n = 0; foreach (Riserva::inScadenza() as $r) { $n++; $m = new Email('promemoriaScadenzaRiserva', "Promemoria: Riserva in scadenza tra pochi giorni"); $m->a = $r->volontario(); $m->_NOME = $r->volontario()->nome; $m->_SCADENZA = date('d-m-Y', $r->fine); $m->invia(); } return "Notificate {$n} riserve in scadenza"; }, $log, $ok); cronjobEsegui("Invio reminder scadenza estensione a breve", function () { $n = 0; foreach (Estensione::inScadenza() as $e) { $n++; $m = new Email('promemoriaScadenzaEstensione', "Promemoria: Estensione in scadenza tra pochi giorni"); $m->a = $e->volontario(); $m->_NOME = $e->volontario()->nome; $m->_COMITATO = $e->appartenenza()->comitato()->nomeCompleto(); $m->_SCADENZA = date('d-m-Y', $e->appartenenza()->fine); $m->invia(); } return "Notificate {$n} estensioni in scadenza"; }, $log, $ok); cronjobEsegui("Controllo aspiranti, promemoria e cancellazione", function () use($db) { $n = $c = 0; $query = "\n SELECT aspiranti.utente,\n COUNT(corsibase.geo),\n aspiranti.id\n FROM aspiranti, corsibase\n WHERE utente NOT IN (\n SELECT volontario\n FROM partecipazioniBase\n WHERE stato >= 10\n )\n AND ST_DISTANCE( corsibase.geo, aspiranti.geo ) < aspiranti.raggio\n AND corsibase.stato = 30\n AND corsibase.inizio >= UNIX_TIMESTAMP()\n GROUP BY aspiranti.utente\n "; $query = $db->query($query); while ($r = $query->fetch(PDO::FETCH_NUM)) { try { $u = Utente::id($r[0]); } catch (Errore $e) { $c++; $a = Aspirante::id($r[2]); $a->cancella(); continue; } $n++; $m = new Email('promemoriaCorsiBase', "Entra in CRI: Ci sono {$r[1]} Corsi Base vicino a te"); $m->a = $u; $m->_NOME = $u->nome; $m->_NUMERO = $r[1]; $m->accoda(); } return "Inviati {$n} promemoria ad Aspiranti, cancellati {$c} aspiranti invalidi"; }, $log, $ok); return $ok; }
/** * Restituisce il volontario di una validazione * @return volontario */ public function utente() { return Utente::id($this->volontario); }
<?php /* * ©2013 Croce Rossa Italiana */ controllaParametri(array('id'), 'us.dash&err'); $id = $_GET['id']; $v = Utente::id($id); if (!$v->modificabileDa($me)) { redirect('us.dash&err'); } proteggiDatiSensibili($v, [APP_SOCI, APP_PRESIDENTE]); /* * Controllo se ordinario o attivo * e recupero valore della quota minima */ $attivo = false; if ($v->stato == VOLONTARIO) { $attivo = true; } if (!($t = Tesseramento::attivo())) { redirect('us.quoteNo&err'); } $quotaMin = $attivo ? $t->attivo : $t->ordinario; ?> <form action="?p=us.quote.nuova.ok" method="POST"> <input type="hidden" name="vol" value="<?php echo $id; ?> " /> <div class="modal fade automodal">
<?php /* * ©2014 Croce Rossa Italiana */ paginaAdmin(); controllaParametri(['id']); $id = $_GET['id']; $u = Utente::id($id); if ($u->admin) { redirect('errore.permessi&cattivo'); } if ($u->stato != PERSONA) { redirect('errore.permessi&cattivo'); } $app = $u->appartenenzaAttuale(); $ora = time(); $comitato = $app->comitato; $app->fine = $ora; $u->stato = VOLONTARIO; $nuovaApp = new Appartenenza(); $nuovaApp->volontario = $u; $nuovaApp->comitato = $comitato; $nuovaApp->stato = MEMBRO_VOLONTARIO; $nuovaApp->inizio = $ora; $nuovaApp->timestamp = time(); $nuovaApp->comferma = $me; redirect("presidente.utente.visualizza&innalzato&id={$id}");
/** * Ottiene l'utente collegato all'oggetto aspirante * @return Utente */ public function utente() { return Utente::id($this->utente); }
<?php /* * ©2014 Croce Rossa Italiana */ controllaParametri(array('id', 'asp'), 'formazione.corsibase'); paginaPrivata(); paginaModale(); $part = PartecipazioneBase::id($_GET['id']); $corso = $part->corsoBase(); $comitato = $corso->organizzatore(); $u = Utente::id($_GET['asp']); paginaCorsoBase($corso); if (!$corso->iniziato()) { redirect("formazione.corsibase.scheda&id={$corso}&err"); } $comitati = new RamoGeoPolitico($comitato, ESPLORA_SOLO_FOGLIE, EST_UNITA); ?> <script type="text/javascript"><?php require './assets/js/formazione.corsibase.scheda.js'; ?> </script> <div class="modal fade automodal"> <div class="modal-header"> <h3><i class="icon-group muted"></i> Stai iscrivendo <?php echo $u->nome; ?> come Socio Ordinario</h3> </div> <div class="modal-body">
<?php /* * ©2014 Croce Rossa Italiana */ /*da sistemare tutto */ paginaApp([APP_SOCI, APP_PRESIDENTE]); controllaParametri(['id'], 'us.dash&err'); $f = $_GET['id']; $v = Utente::id($f); /* Verifico di poter lavorare sull'utente */ proteggiDatiSensibili($v, [APP_SOCI, APP_PRESIDENTE]); $elenco = $me->comitatiApp([APP_SOCI, APP_PRESIDENTE]); if (!$v->modificabileDa($me)) { redirect('errore.permessi&cattivo'); } /* Al momento oscurato ordinario */ if ($v->ordinario()) { redirect('errore.permessi&cattivo'); } $app = $v->appartenenzaAttuale(); if (!$app || !in_array($app->comitato()->id, $elenco)) { redirect('errore.permessi&cattivo'); } /* Verifico esistenza di un tesserino valido e che la richiesta di duplicato non sia già stata fatta */ $gia = true; $t = TesserinoRichiesta::filtra([['volontario', $v]]); foreach ($t as $tesserino) { if ($tesserino->stato < INVALIDATO && $tesserino->stato != RIFIUTATO) { $gia = false; }
<?php /* * ©2014 Croce Rossa Italiana */ paginaPrivata(); if (isset($_GET['single'])) { controllaParametri(array('id', 'corso'), 'errore.fatale'); $iscritto = $_GET['id']; $corso = $_GET['corso']; $iscritto = Utente::id($iscritto); $corso = CorsoBase::id($corso); $f = $corso->generaScheda($iscritto); $f->download(); } else { controllaParametri(array('id'), 'errore.fatale'); $corso = $_GET['id']; $corso = CorsoBase::id($corso); $zip = new Zip(); $tabella = '<table border="1" style="width:100%"> <tbody> <tr> <td align="center"><b>Cognome e Nome</b></td> <td align="center"><b>Luogo di nascita</b></td> <td align="center"><b>Data di nascita</b></td> <td align="center"><b>Esito</b></td> </tr>'; $x = 0; foreach ($corso->partecipazioni(ISCR_SUPERATO) as $pb) { $iscritto = $pb->utente(); $dataNascita = date('d/m/Y', $iscritto->dataNascita);
} paginaPrivata(); controllaParametri(['inputEmail', 'inputEmail2'], 'nuovaAnagraficaContatti&err'); /* * Normalizzazione dei dati */ $email = minuscolo($_POST['inputEmail']); $email2 = minuscolo($_POST['inputEmail2']); $cell = normalizzaNome($_POST['inputCellulare']); $cells = normalizzaNome(@$_POST['inputCellulareServizio']); $sessione->email = $email; $sessione->email2 = $email2; $sessione->cell = $cell; $sessione->cells = $cells; /* Cerca eventuali utenti con la stessa email... */ $e = Utente::by('email', $email); if ($e and $e->password) { /* Se l'utente esiste, ed ha già pure una password */ redirect('nuovaAnagraficaContatti&email'); } if ($email != $email2) { redirect('nuovaAnagraficaContatti&match'); } if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { redirect('nuovaAnagraficaContatti&emailnon'); } if (strlen($_POST['inputPassword']) < 8 || strlen($_POST['inputPassword']) > 15) { redirect('nuovaAnagraficaContatti&e'); } if ($_POST['inputPassword'] != $_POST['inputPassword2']) { redirect('nuovaAnagraficaContatti&dis');
$n = 0; $s = 0; $anagrafiche = Utente::conta([]); $volontari = Utente::filtra([['stato', VOLONTARIO]]); $sesso = ['M' => 0, 'F' => 0]; $eta = [[[0, 30], 0], [[30, 41], 0], [[41, 51], 0], [[51, 66], 0], [[66, 999], 0]]; $anzianita = [[[0, 1], 0], [[1, 5], 0], [[5, 10], 0], [[10, 21], 0], [[21, 30], 0], [[30, 999], 0]]; $ora = new DateTime(); foreach ($volontari as $v) { $ingresso = $v->ingresso(); if (!$ingresso) { $s++; continue; } $n++; $sesso[Utente::sesso($v->codiceFiscale)]++; foreach ($eta as &$_e) { $min = $_e[0][0]; $max = $_e[0][1]; $e = $v->eta(); if ($e >= $min && $e < $max) { $_e[1]++; } } foreach ($anzianita as &$_e) { $min = $_e[0][0]; $max = $_e[0][1]; $diff = $ora->diff($ingresso); if ($diff->y >= $min && $diff->y < $max) { $_e[1]++; }
<?php /* * ©2013 Croce Rossa Italiana */ $parametri = array('inputEmail', 'inputCodiceFiscale'); controllaParametri($parametri, 'recuperaPassword&err'); $codiceFiscale = $_POST['inputCodiceFiscale']; $codiceFiscale = maiuscolo($codiceFiscale); $email = $_POST['inputEmail']; $p = Utente::by('codiceFiscale', $codiceFiscale); if (!$p) { redirect('recuperaPassword&cf'); } elseif ($p->email != $email) { redirect('recuperaPassword&email'); } /* Genera codice di validazione */ $codice = Validazione::generaValidazione($p, VAL_PASS); if (!$codice) { redirect('recuperaPassword&gia'); } $e = new Email('recuperaPassword', 'Richiesta reimpostazione password'); $e->a = $p; $e->_NOME = $p->nome; $e->_DATA = date('d-m-Y H:i'); $e->_CODICE = $codice; $e->invia(); redirect('recuperaPassword.step');
public function annullatore() { return Utente::id($this->pAnnullata); }