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 '
'.$esito.'
'; } else {//INTERFACCIA RELATIVA ALLA GESTIONE DELLA ODALITA DI INVIO DEL DOCUMENTO echo ' '; switch ($mod_send) { case 3 : echo '
'. encodephpversion($config['user_page']['scelta_invio']).' 1out="1" 2out="2"
'.($utente->get_fax()=="" ? '' : '' ).'
'.($utente->get_email()=="" ? '' : '' ).'
'; break; case 2 : echo '
'.($utente->get_fax()=="" ? '' : '' ).'
'; break; case 1 : echo '
'.($utente->get_email()=="" ? '' : '' ).'
'; break; default: echo ""; break; } echo '
'. str_replace("[N]",(is_object($utente) ? $utente->get_fax() : "" ),encodephpversion($config['poll']['invio_fax'])).'
'; echo '
'. encodephpversion($config['poll']['domanda_fax']).' '.encodephpversion($config['user_page']['hai_detto']).': \number=code ? premi un tasto per Confermare. '; echo '
'. str_replace("[EMAIL]",(is_object($utente) ? $utente->get_email() : "" ),encodephpversion($config['user_page']['invio_mail'])).'
'; if(!$ck_dtmf){ echo '
'. encodephpversion($config['user_page']['domanda_mail']).' '.encodephpversion($config['user_page']['hai_detto']).' ? Confermi? '; } echo '
' ; } echo '
'; ?>