selectByCustomer($id_cliente);
$index = $customersetting -> get_index();
$lingua_default = $customersetting -> get_lingua_default();
$customer_has_fax = count($customersetting -> get_account_fax()) >0;
//______________________________________________________
$utente = new userareariservata($_LANG);
$utente ->select($id_utente); fwrite($f, print_r($utente, true));
//dati utente_____________
$nome_utente = $utente -> get_nome();
$cognome_utente = $utente -> get_cognome();
$email_utente = $utente -> get_email();
$telefono_utente = $utente -> get_telefono();
//_______________________________________________________
//SELEZIONE DOCUMENTO____________________________________
$id_attachment = $_REQUEST['id_documento'];
if(isset($_REQUEST['ck_articolo'])&&$_REQUEST['ck_articolo']==1)
{
$allegato = get_allegato_from_id($id_attachment);
$document = (object) array("id"=>$allegato['id'],"name"=>$allegato['descrizione'],"type"=>$allegato['type'],"url"=>"/var/www/thewoice/woice/articles/allegati_articoli/".$allegato['id'].".".$allegato['ext'],"mod_send"=>$allegato['mod_send']);
}
else
$document = $utente ->get_attachment($id_attachment) ;
//_______________________________________________________
if(isset($_REQUEST['SEND_DOC'])&& $_REQUEST['SEND_DOC']==1)
{ /*Utilizzo il parametro SEND_DOC per distinguere la parte
di effetivo invio dalla parte di recupero delle informazioni
relative alla modalita di invio del doc*/
//__________GESTIONE VCD_________________________________
if($document->type == 'vcd')
{
$pathinfo = pathinfo($document->url);
$fileext = $pathinfo['extension'];
$filename = $pathinfo['filename'];
$dirname = $pathinfo['dirname'];
$dirname = $index;
$pdfmaker = new pdf_filler($_LANG);
$pdfmaker ->set_id_woice_customer($id_cliente);
$pdfmaker ->set_id_area_riservata_user($id_utente);
$pdfmaker ->set_module($filename.".".$fileext);
$fdf_data_names = array();
$fields_hidden = array();
$fields_readonly = array();
$fdf_data_strings = $pdfmaker ->prepare_fdf_data_string();//prepara la stringa
$vcd_file = $pdfmaker ->make_pdf($fdf_data_strings, $fdf_data_names, $fields_hidden, $fields_readonly, $pdf_original);
$doc_att = SYS_ROOT_INT_DIR.$dirname."pdf_results/".$vcd_file;
}
else{
$doc_att = $document->url;
}
//_______________________________________________________
//___________________IN CASO DI INVIO FAX________________
if(isset($_REQUEST['num_fax'])&& $_REQUEST['num_fax']!="" && $_REQUEST['num_fax']!="null" )
{
$invio_fax =true;
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_URL, "http://localhost/thewoice/woice/modules/fax/faxengine.php");
$post_vars = array("num_fax" => $_REQUEST['num_fax'],"id_customer" => $id_cliente, "uploadedfile" => $doc_att , "lang" => $etc_ln);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post_vars);
$esito = (curl_exec($ch)? encodephpversion($config['user_page']['esito_fax_ok']) : encodephpversion($config['user_page']['esito_fax_errore']));
curl_close($ch);
}
//______________________IN CASO DI INVIO MAIL____________
if(isset($_REQUEST['e_mail'])&& $_REQUEST['e_mail']!="" && $_REQUEST['e_mail']!="null")
{
$mail_text = "Invio del documento.";
$mail_Subject = "NOTIFICA INVIO DOCUMENTO.";
$mail_text = "Invio del documento.";
$mail_Subject = "NOTIFICA INVIO DOCUMENTO.";
$esito = (sendMail($id_cliente,$_REQUEST['e_mail'],$mail_Subject,$mail_text,2,$doc_att)? encodephpversion($config['user_page']['esito_mail_ok']) : encodephpversion($config['user_page']['esito_mail_errore']));
}
//______________________________________________________________________________________________________________
}
else{//Parte relativa alla gestione del recupero modalita invio del documento
/*_______________________________________________________
Se la modalita di invio comprende il fax ma l'utente non
ha un account modifico la modalita
//_______________________________________________________*/
$mod_send = $document->mod_send;
if($mod_send!=1 && !$customer_has_fax)
$mod_send = 1;
}
print('
');
if(isset($_REQUEST['SEND_DOC'])&& $_REQUEST['SEND_DOC']==1)
{ //INTERFACCIA RELATIVA ALL INVIO AVVENUTO DEL DOCUMENTO
echo '
';
}
else
{//INTERFACCIA RELATIVA ALLA GESTIONE DELLA ODALITA DI INVIO DEL DOCUMENTO
echo '
';
switch ($mod_send)
{
case 3 :
echo '
';
break;
case 2 :
echo ' ';
break;
case 1 :
echo ' ';
break;
default:
echo "";
break;
}
echo '';
echo '';
?>