Commit 1146f44e authored by Raph El's avatar Raph El
Browse files

Amélioration gestion mails + interface admin

parent cc7d9192
......@@ -521,6 +521,14 @@
"id":"btn-mailerror",
"href":"javascript:;",
"icon":"envelope"
},
"notsendmail" :{
"label":"Not send mail",
"super":true,
"class":"text-red",
"id":"btn-notsendmail",
"href":"javascript:;",
"icon":"envelope"
}
},
"element":{
......
......@@ -15,12 +15,31 @@
<h4 id="errormsg"></h4>
</div>
</div>
<div class="pageTable col-md-12 col-sm-12 col-xs-12 padding-20 text-center"></div>
<div class="panel-body">
<div>
<table class="table table-striped table-bordered table-hover directoryTable" id="panelAdmin">
<thead>
<tr>
<th>Email</th>
<th>Date</th>
</tr>
</thead>
<tbody class="directoryLines">
</tbody>
</table>
</div>
</div>
<div class="pageTable col-md-12 col-sm-12 col-xs-12 padding-20"></div>
</div>
<script type="text/javascript">
var results = <?php echo json_encode($results) ?>;
jQuery(document).ready(function() {
setTitle("Not send mail","cog");
initViewTable(results);
$("#btn-valider").off().on( "click", function(){
$("#success").addClass("hidden");
......@@ -38,23 +57,58 @@ jQuery(document).ready(function() {
dataType: "json",
data : param,
success: function(data){
console.log("data", data);
if (data.result) {
toastr.success(data.msg);
$("#email").val("");
$("#success").removeClass("hidden");
$("#error").addClass("hidden");
if (data.res.result) {
toastr.success(data.res.msg);
location.reload();
} else {
$("#error").removeClass("hidden");
$("#success").addClass("hidden");
toastr.error(data.msg);
$("#errormsg").html(data.msg);
toastr.error(data.res.msg);
$("#errormsg").html(data.res.msg);
}
}
});
});
});
function initViewTable(data){
$('#panelAdmin .directoryLines').html("");
$.each(data,function(key,values){
entry=buildDirectoryLine(key, values );
$("#panelAdmin .directoryLines").append(entry);
});
//bindAdminBtnEvents();
}
function buildDirectoryLine(key, e ){
mylog.log("here", e);
strHTML="";
});
\ No newline at end of file
actions = "";
classes = "";
strHTML += '<tr id="'+key+'">';
strHTML += '<td>'+e.target.email+'</td>';
strHTML += '<td class="center status">'+moment(e.date).local().format("DD-MM-YYYY HH:mm");
strHTML += '</td>';
/* **************************************
* ACTIONS
***************************************** */
// if(searchAdmin.mode=="source"){
// action='<button data-id="'+id+'" data-type="'+type+'" data-action="remove" data-setkey="source" class="margin-right-5 setSourceAdmin btn bg-red text-white"><i class="fa fa-ban"></i> Remove from source</button>';
// }else if (searchAdmin.mode=="reference"){
// action='<button data-id="'+id+'" data-type="'+type+'" data-action="remove" data-setkey="reference" class="margin-right-5 setSourceAdmin btn bg-red text-white"><i class="fa fa-ban"></i> Remove from reference</button> ';
// }
// else if (searchAdmin.mode=="open"){
// action='<button data-id="'+id+'" data-type="'+type+'" data-action="add" data-setkey="reference" class="margin-right-5 setSourceAdmin btn bg-green text-white"><i class="fa fa-plus"></i> Add as reference</button>';
// }
// strHTML += '<td class="center">';
// strHTML += '<div class="btn-group">'+action
// '</div>';
// strHTML += '</td>';
strHTML += '</tr>';
return strHTML;
}
\ No newline at end of file
......@@ -67,6 +67,7 @@ $layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
<?php foreach ($typeDirectory as $value) { ?>
<a href="javascript:;" onclick="applyStateFilter('<?php echo $value ?>')" class="filter<?php echo $value ?> btn btn-xs btn-default active btncountsearch"> <?php echo $value ?> <span class="badge badge-warning countPeople" id="count<?php echo $value ?>"> <?php echo @$results["count"][$value] ?></span></a>
<?php } ?>
<a href="<?php echo Yii::app()->request->baseUrl. '/dda/co/getproposals/format/csv'; ?> " target="_blank" id="csv"><i class='fa fa-2x fa-table text-green'></i></a></span>
</div>
<div class="pageTable col-md-12 col-sm-12 col-xs-12 padding-20 text-center"></div>
<div class="panel-body">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment