'bblier', 'pass' => 'maarch', 'timeout' => '600'); $wsdl = new SOAP_WSDL('http://127.0.0.1/maarch/ws_server.php?WSDL', $proxy, false); $client = $wsdl->getProxy(); session_start(); if (isset($_REQUEST['view']) || !empty($_REQUEST['viewID'])) { /*********************** view Maarch document ***********************/ if (!empty($_REQUEST['viewID'])) { $viewID = $_REQUEST['viewID']; $viewID = ((int)$viewID); //echo 'La facture d\'ID '.$viewID.' n\'existe pas !
Retour'; $fileContentArray = array(); $fileContentArray = $client->viewResource( $viewID, 'res_x', 'adr_x', true); if($fileContentArray->status == "ok") { $fileContent = base64_decode($fileContentArray->file_content); $Fnm = $fileContentArray->tmp_path.DIRECTORY_SEPARATOR.rand()."_".md5($fileContent).".".strtolower($fileContentArray->ext); $inF = fopen($Fnm, "w"); fwrite($inF, $fileContent); fclose($inF); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Type: ".strtolower($fileContentArray->mime_type)); header("Content-Disposition: inline; filename=".basename('maarch.'.strtolower($fileContentArray->ext)).";"); header("Content-Transfer-Encoding: binary"); readfile($Fnm); exit(); /* var_dump($fileContentArray); exit; */ } else { echo $fileContentArray->error; } } else { if (isset($_SESSION['lang'])) { if ($_SESSION['lang'] == 'fr') { $idLang = 'ID de la facture'; $consulterLang = 'Consulter'; } elseif ($_SESSION['lang'] == 'en') { $idLang = 'Invoice ID'; $consulterLang = 'Consult'; } } else { $idLang='Invoice ID'; $consulterLang= 'Consult'; } echo '
'.$idLang.'
'; } } elseif (isset($_REQUEST['store']) || (!empty($_REQUEST['custom_t3Form']) && !empty($FILES['fileForm']) && !empty($_REQUEST['subjectForm']))) { if (!empty($_REQUEST['custom_t3Form']) && !empty($_FILES['fileForm']) && !empty($_REQUEST['subjectForm'])) { $file = $_FILES['fileForm']['tmp_name']; $fileContent = file_get_contents($file, FILE_BINARY); $encodedContent = base64_encode($fileContent); $aujourdhui = date('Y-m-d H:i:s'); $custom_t3Form = $_REQUEST['custom_t3Form']; $data = array(); array_push($data, array('column' => 'destination', 'value' => 'DRH', 'type' => 'string')); array_push($data, array('column' => 'custom_t3', 'value' => $custom_t3Form, 'type' => 'string')); array_push($data, array('column' => 'doc_date', 'value' => $aujourdhui, 'type' => 'string')); array_push($data, array('column' => 'type_id', 'value' => '70', 'type' => 'string')); array_push($data, array('column' => 'subject', 'value' => $_REQUEST['subjectForm'], 'type' => 'string')); $collID = 'res_coll'; $table = 'res_x'; $fileFormat = 'pdf'; $status = 'NEW'; $fileStoreResource = array(); $fileStoreResource = $client->storeResource ( $encodedContent, $data, $collID, $table, $fileFormat, $status); echo $fileStoreResource; exit; } else { if (isset($_SESSION['lang'])) { if ($_SESSION['lang'] == 'fr') { $objetLang = 'Objet'; $paysLang = 'Pays'; $ajouterLang = 'Ajouter'; } elseif ($_SESSION['lang'] == 'en') { $objetLang = 'Subject'; $paysLang = 'Country'; $ajouterLang = 'Add'; } } else { $objetLang='Subject'; $paysLang = 'Country'; $ajouterLang = 'Add'; } echo '
'.$objetLang.'
'.$paysLang.'
'; } } elseif (isset($_REQUEST['search']) || (!empty($_REQUEST['country']) && !empty($_REQUEST['docDate_jour']) && !empty($_REQUEST['docDate_mois']) && !empty($_REQUEST['docDate_annee']))) { if (!empty($_REQUEST['country']) && !empty($_REQUEST['docDate_jour']) && !empty($_REQUEST['docDate_mois']) && !empty($_REQUEST['docDate_annee'])) { $docDateForm = $_REQUEST['docDate_annee'].'-'.$_REQUEST['docDate_mois'].'-'.$_REQUEST['docDate_jour']; $countryForm = $_REQUEST['country']; $searchParamsForm = array("countryForm" => $countryForm, "docDateForm" => $docDateForm); //$searchResource = array(); $searchResource = $client->Demo_searchResources( $searchParamsForm ); $searchResult = ''; $searchResult .= '
'; if (isset($_SESSION['lang'])) { if ($_SESSION['lang'] == 'fr') { $searchResult .= 'Liste des factures dont le pays est "'.$_REQUEST['country'].'" et la date de versement est plus récente que "'.$docDateForm.'"

'; } elseif ($_SESSION['lang'] == 'en') { $searchResult .= 'Invoices list where country is "'.$_REQUEST['country'].'" and adding date is newer than "'.$docDateForm.'"

'; } } else { $searchResult .= 'Invoices list where country is "'.$_REQUEST['country'].'" and adding date is newer than "'.$docDateForm.'"

'; } $searchResult .= ''; $cpt1=0; $arrayResource1 = ((array)$searchResource); $cptMax1 = (count($arrayResource1[value]) - 1); while ($cpt1 <= $cptMax1) { $modulo = $cpt1%2; if ($modulo == 0) { $bgcolor = '#A1B6FF'; } else { $bgcolor = '#5665A7'; } $result[$cpt1] = ((array)$arrayResource1[value][$cpt1]); $searchResult .= ''; $searchResult .= ''; $searchResult .= ''; $searchResult .= ''; $searchResult .= ''; $cpt1++; } $searchResult .= '
IDObjetDate
'.$result[$cpt1][resid].''.$result[$cpt1][subject].''.$result[$cpt1][docdate].'
'; $searchResult .= '
'; } else { $cptjour = 1; $jour = ''; while ($cptjour <= 31) { $cptjourFormat = $cptjour; if ($cptjour == date('d')) { $selectedjour = ' selected'; } else { $selectedjour = ''; } if ($cptjour < 10) { $cptjourFormat = '0'.$cptjour; } else { $cptjourFormat = $cptjour; } $jour .= '