registration finita, in testing
inizio styling categorySummary
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
require_once(dirname(__FILE__)."/load.php");
|
||||
|
||||
try{
|
||||
|
||||
// AnalyticsHelper::logPageImpression();
|
||||
|
||||
GUIHandler::generateHtmlHeaders();
|
||||
|
||||
$category = PostHandler::get("category");
|
||||
$category = NotiziaModel::CATEGORY_CRONACA;
|
||||
|
||||
if(!is_null($category) || ($category!=0)){
|
||||
$notizie = GlobalVariables::get("dao")->query("NotiziaModel",
|
||||
array('$and'=>array(array("status"=>NotiziaModel::STATUS_ACCEPTED),array("category"=>$category))),
|
||||
array("sort"=>array("about.data"=>-1),"limit"=>10)
|
||||
);
|
||||
}
|
||||
else{
|
||||
GUIHandler::redirect("index.php");
|
||||
}
|
||||
|
||||
|
||||
}catch(GUIException $ex){
|
||||
$error = $ex->getMessage();
|
||||
}catch (Exception $exec){
|
||||
$msg = LogModel::fromException($exec);
|
||||
GlobalVariables::get("dao")->save($msg);
|
||||
|
||||
GUIHandler::redirect("index.php");
|
||||
}
|
||||
?>
|
||||
<div style="width:1000px;margin-left:auto;margin-right:auto;">
|
||||
<?php
|
||||
GUIHandler::generateHeadPublic();
|
||||
GUIHandler::generateMenu();?>
|
||||
<div class="categorySummaryContainer">
|
||||
<?php
|
||||
foreach ($notizie as $notizia){
|
||||
$stringTitolo = (strlen($notizia->titolo) > 103) ? substr($notizia->titolo,0,100).'...' : $notizia->titolo;
|
||||
$stringSottotitolo = (strlen($notizia->sottotitolo) > 73) ? substr($notizia->sottotitolo,0,70).'...' : $notizia->sottotitolo;
|
||||
$stringTesto = (strlen($notizia->testo) > 33) ? substr($notizia->testo,0,30).'...' : $notizia->testo;
|
||||
$media = DaoMediaHandler::getMainMediaFromModel($notizia);
|
||||
?>
|
||||
<div class="notiziaContainer">
|
||||
<div class="notiziaImage mediaContent"><?php (!is_null($media))?$media->renderMedia(array("size"=>MediaRenderer::SIZE_SMALL)):"" ;?></div>
|
||||
<div class="notiziaInfo">
|
||||
<div class="notiziaTitolo"><?php echo $stringTitolo;?></div>
|
||||
<div class="notiziaSottotitolo"><?php echo$stringSottotitolo;?></div>
|
||||
<div class="notiziaTesto"><?php echo $stringTesto;?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="summaryRightBar"></div>
|
||||
|
||||
<?php
|
||||
// GUIHandler::generateFooter();?>
|
||||
</div>
|
||||
+14
-13
@@ -28,16 +28,17 @@ function openRegistrationModal(){
|
||||
}
|
||||
|
||||
function sendRegistration(){
|
||||
$.ajax({
|
||||
method:'POST',
|
||||
url:'sendRegistrationBackend.php',
|
||||
dataType:'html',
|
||||
data:$("#regForm").serialize(),
|
||||
success: function(data){
|
||||
|
||||
},
|
||||
error:function(data){
|
||||
$(".modalError").html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
$.ajax({
|
||||
method:'POST',
|
||||
url:'sendRegistrationBackend.php',
|
||||
dataType:'html',
|
||||
data:$('#regForm').serialize(),
|
||||
success: function(data){
|
||||
// $("#regForm").remove();
|
||||
$(".modalResponse").html(data);
|
||||
/* Verificare se si possa eliminare la form in caso di registrazione avvenuta con successo assegnando un parametro
|
||||
* allo span di avvenuta registrazione*/
|
||||
// $(".modalError").html("");
|
||||
}
|
||||
});
|
||||
}
|
||||
+6
-26
@@ -4,43 +4,23 @@ require_once(dirname(__FILE__)."/load.php");
|
||||
|
||||
try {
|
||||
?>
|
||||
<div class="topReg"><span></span><div><a class="close" href='javascript:$("#floating").hide();'>x</a></div></div>
|
||||
<div class="topReg"><span></span><div><a class="close" href="javascript:$('#floating').hide();">x</a></div></div>
|
||||
<div class="modalBody">
|
||||
<div class="modalError"></div>
|
||||
<div class="modalResponse"></div>
|
||||
<form id="regForm">
|
||||
<div>Email: <input type="text" name="email" value="" /></div>
|
||||
<div>Username: <input type="text" name="username" value=""/></div>
|
||||
<div>Password: <input type="password" name="pass" value="" /></div>
|
||||
<div>Conferma password: <input type="password" name="passwordConfirm" value="" /></div>
|
||||
<div>Vuoi iscriverti alla newsletter? <input type="checkbox" name="newsletter" value="true" checked /></div>
|
||||
<div class="regMe"><a href="javascript:sendRegistration();">Registrami</a></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="regMe"><a href="javascript:sendRegistration();">Registrami</a></div>
|
||||
|
||||
<?php
|
||||
}catch (Exception $exec){
|
||||
$msg = LogModel::fromException($exec);
|
||||
GlobalVariables::get("dao")->save($msg);
|
||||
}
|
||||
echo "zzzzzzzzzzzzzzzzzzzzzz";
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function (){
|
||||
function sendRegistration(){
|
||||
$.ajax({
|
||||
method:'POST',
|
||||
url:'sendRegistrationBackend.php',
|
||||
dataType:'html',
|
||||
data:$('#regForm').serialize(),
|
||||
success: function(data){
|
||||
// $("#regForm").remove();
|
||||
// $(".modalError").html(data);
|
||||
alert("pene");
|
||||
},
|
||||
error:function(data){
|
||||
// $(".modalError").html(data);
|
||||
alert("capocchia");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
// echo "zzzzzzzzzzzzzzzzzzzzzz";
|
||||
?>
|
||||
@@ -13,24 +13,39 @@ try {
|
||||
}
|
||||
|
||||
|
||||
echo "invitao ";
|
||||
if(strcmp($pass, $confPass)==0){
|
||||
// GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName));
|
||||
// GlobalVariables::get("dao")->getFirst("UserModel",array("email"=>$email));
|
||||
// GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName));
|
||||
$user = new stdClass();
|
||||
$user->email = $email;
|
||||
$user->password = sha1($pass);
|
||||
$user->username = $userName;
|
||||
$user->newsletter = $newsletter;
|
||||
|
||||
|
||||
$userModel = new UserModel($user);
|
||||
// GlobalVariables::get("dao")->save($userModel);
|
||||
echo "salvataggio riuscito";
|
||||
$notEmail = GlobalVariables::get("dao")->getFirst("UserModel",array("email"=>$email));
|
||||
$notUser = GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName));
|
||||
|
||||
if(is_null($notEmail) || strcmp($email, $notEmail)!=0){
|
||||
if(is_null($notUser) || strcmp($userName, $notUser)!=0){
|
||||
if(strcmp($pass, $confPass)==0){
|
||||
|
||||
// GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName));
|
||||
// GlobalVariables::get("dao")->getFirst("UserModel",array("email"=>$email));
|
||||
// GlobalVariables::get("dao")->getFirst("UserModel",array("username"=>$userName));
|
||||
$user = new stdClass();
|
||||
$user->email = $email;
|
||||
$user->password = sha1($pass);
|
||||
$user->username = $userName;
|
||||
$user->newsletter = $newsletter;
|
||||
|
||||
|
||||
$userModel = new UserModel($user);
|
||||
// GlobalVariables::get("dao")->save($userModel);
|
||||
echo 'Registrazione avvenuta con successo.A breve riceverai una mail per confermare la tua registrazione';
|
||||
}
|
||||
else{
|
||||
// trigger_error("Le due password non coincidono (trigger)");
|
||||
echo '<span style="color:red;">Le due password non coincidono</span>';
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
echo '<span style="color:red;">Questo username è già in uso da un altro utente.</span>';
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo "Le due password non coincidono";
|
||||
echo '<span style="color:red;">Questa email risulta già in utilizzo.<span>';
|
||||
}
|
||||
|
||||
}catch(Exception $exec){
|
||||
|
||||
+12
-2
@@ -87,7 +87,7 @@ body{font-family:lato, arial;}
|
||||
*/
|
||||
|
||||
#floating{
|
||||
background-color:green;
|
||||
background-color:#ceecf4;
|
||||
z-index:4;
|
||||
padding:5px 10px;
|
||||
}
|
||||
@@ -98,7 +98,8 @@ body{font-family:lato, arial;}
|
||||
.close{vertical-align:top;color:white;}
|
||||
|
||||
.modalBody{text-align:right;}
|
||||
.modalError{text-algin:center;color:red;font-weight:bold;}
|
||||
.regMe{text-align:left;}
|
||||
.modalResponse{text-align:center;color:aqua;font-weight:bold;}
|
||||
#modalBlock{}/*
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
@@ -321,3 +322,12 @@ body{font-family:lato, arial;}
|
||||
.rotoBanner{}
|
||||
.reader{}
|
||||
.notRotoBanner{}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.categorySummaryContainer{width:600px;padding:5px 10px;vertical-align:top;}
|
||||
.notiziaContainer > .notiziaImage{display:inline-block;}
|
||||
.notiziaContainer > .notiziaInfo{display:inline-block;width:430px;padding:10px;}
|
||||
.summaryRightBar{width:300px;padding:5px;vertical-align:top;}
|
||||
Reference in New Issue
Block a user