111 lines
3.1 KiB
PHP
111 lines
3.1 KiB
PHP
<?php
|
|
|
|
|
|
|
|
include_once(__DIR__."/../../core.php");
|
|
|
|
|
|
$idanagrafica = save($_GET['idanagrafica']);
|
|
$id_record = save($_GET['idanagrafica']);
|
|
$id_module = save($_GET['id_module']);
|
|
|
|
|
|
//Mi ricavo l'email del cliente
|
|
$q = "SELECT email ,ragione_sociale FROM an_anagrafiche_prospect WHERE id='".$idanagrafica."'";
|
|
$rs_ana = $dbo->fetchArray($q);
|
|
$mail_destinatario = $rs_ana[0]['email'];
|
|
$ragione_sociale = $rs_ana[0]['ragione_sociale'];
|
|
|
|
|
|
$oggetto = "";
|
|
$testo1="";
|
|
|
|
|
|
echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"".$rootdir."/lib/ckeditor/ckeditor.js\"></script>\n";
|
|
|
|
|
|
echo "<form id=\"sendemail_web\" action=\"".$rootdir."/editor.php?id_module=$id_module&id_record=$id_record\" onsubmit=\"return check_submit()\" method=\"post\">\n";
|
|
echo " <input type='hidden' name='backto' value='record-edit'>\n";
|
|
echo " <input type='hidden' name='op' value='sendemail_web'>\n";
|
|
echo " <input type='hidden' name='id_record' value='".$id_record."'>\n";
|
|
|
|
|
|
|
|
|
|
echo " <div class='row form-group'>\n";
|
|
echo " <div class='col-md-2'>\n";
|
|
echo " <span><b>Destinatario:</b><span>";
|
|
echo " </div>\n";
|
|
echo " <div class='col-md-8'>\n";
|
|
echo " <input type=\"text\" name=\"destinatario\" id=\"destinatario\" maxlength=\"255\" value=\"".$mail_destinatario."\" class=\"form-control\" />\n";
|
|
echo " </div>\n";
|
|
echo " </div>\n";
|
|
|
|
// oggetto
|
|
echo " <div class='row form-group'>\n";
|
|
echo " <div class='col-md-2'>\n";
|
|
echo " <span><b>Oggetto:</b><span>";
|
|
echo " </div>\n";
|
|
echo " <div class='col-md-8'>\n";
|
|
echo " <input type=\"text\" name=\"oggetto\" id=\"oggetto\" maxlength=\"255\" value=\"".$oggetto."\" class=\"form-control\" />\n";
|
|
echo " </div>\n";
|
|
echo " </div>\n";
|
|
|
|
|
|
// destinatario
|
|
echo " <div class='row form-group'>\n";
|
|
echo " <div class='col-md-12'>\n";
|
|
echo " <textarea placeholder=\"\" class=\"form-control\" id=\"body\" name=\"body\">$testo1</textarea>\n";
|
|
echo " </div>\n";
|
|
echo " </div>\n";
|
|
|
|
|
|
echo " <button type='button' class='btn btn-primary pull-right' onclick=\"$('#sendemail_web').submit();\"><i class=\"fa fa-envelope\"></i> Invia E-mail</button>\n";
|
|
|
|
echo "</form>\n";
|
|
echo "<div class='clearfix'></div>\n";
|
|
?>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
function check_submit(){
|
|
|
|
if( $('#destinatario').val()!='' && $('#oggetto').val()!='' ){
|
|
|
|
if( confirm('inviare e-mail?') )
|
|
return true;
|
|
else
|
|
return false;
|
|
|
|
} else {
|
|
alert("impostare destinatario ed oggetto!");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
// autocompletamento destinatario
|
|
$(document).load("ajax_autocomplete.php?module=Anagrafiche&op=getemail&idanagrafica=<?php echo $idanagrafica ?>", function(response){
|
|
$("#destinatario").autocomplete({source: response.split("|")});
|
|
|
|
} );
|
|
|
|
|
|
CKEDITOR.replace( 'body', {
|
|
toolbar: [
|
|
{ name: 'document', items: [ 'NewPage', 'Preview', '-', 'Templates' ] },
|
|
['Bold','Italic','Underline','Superscript','-','NumberedList','BulletedList','Outdent','Indent','Blockquote','-','Format',], // Defines toolbar group without name.
|
|
|
|
]
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|