Rework nuove librerie mongo

Signed-off-by: Riccardo Di Dato <r.didato@asdynamics.it>
This commit is contained in:
Riccardo Di Dato
2017-08-17 14:58:02 +02:00
parent 542e94fd4d
commit ec7ebe7974
44 changed files with 403 additions and 238 deletions
+6 -4
View File
@@ -30,7 +30,8 @@ try {
$tmp->fromName = "I Fatti di Napoli - Newsletter";
$tmp->subject = "";
$tmp->body = "";
$tmp->date = new MongoDate();
// $tmp->date = new MongoDate();
$tmp->date = new MongoDB\BSON\UTCDateTime( time() * 1000 );
$mail = new MailTemplateModel($tmp);
@@ -54,7 +55,8 @@ try {
if(!preg_match("/^[0-9]{2}[-][0-9]{2}[-][0-9]{4} [0-9]{2}[:][0-9]{2}$/", $dateString)){
throw new GUIException("Il formato della data inserita non è corretto. Per favore segui il seguente formato Date: dd-mm-yyyy hh:ii");
}
$tmp->date = new MongoDate(strtotime($dateString));
// $tmp->date = new MongoDate(strtotime($dateString));
$tmp->date = new MongoDB\BSON\UTCDateTime(strtotime($dateString) * 1000);
GlobalVariables::get("dao")->save($mail);
@@ -98,11 +100,11 @@ if (strcmp($mailBody, "")==0){
</div>
<div>
<span class="label">Giorno</span>
<input type="text" id="datepicker" name="data" value="<?php echo ($edit)? date("d-m-Y",$mail->date->sec):date("d-m-Y");?>">
<input type="text" id="datepicker" name="data" value="<?php echo ($edit)? date("d-m-Y",$mail->date->toDateTime()->getTimestamp()):date("d-m-Y");?>">
</div>
<div>
<span class="label">Ora</span>
<input type="text" id="timepicker" name="time" value="<?php echo ($edit)? date("H:i",$mail->date->sec):date("H:i");?>">
<input type="text" id="timepicker" name="time" value="<?php echo ($edit)? date("H:i",$mail->date->toDateTime()->getTimestamp()):date("H:i");?>">
</div>
<div>
<!-- <div style="margin:auto;width:1024px;" contenteditable="true"><?php echo $mailBody;?></div>-->