'bblier', 'pass' => 'maarch', 'timeout' => '600'); $wsdl = new SOAP_WSDL('http://127.0.0.1/maarch_entreprise/ws_server.php?WSDL', $proxy, false); $client = $wsdl->getProxy(); session_start(); if ( isset($_REQUEST['Afficher']) && $_REQUEST['Afficher'] == 'Afficher la liste de contacts' ) { //Le formulaire a été validé if ( !empty($_REQUEST['contact_id']) || !empty($_REQUEST['lastname']) || !empty($_REQUEST['firstname']) || !empty($_REQUEST['society']) || !empty($_REQUEST['function']) || !empty($_REQUEST['address_num']) || !empty($_REQUEST['address_street']) || !empty($_REQUEST['address_complement']) || !empty($_REQUEST['address_town']) || !empty($_REQUEST['address_postal_code']) || !empty($_REQUEST['address_country']) || !empty($_REQUEST['email']) || !empty($_REQUEST['phone']) || !empty($_REQUEST['other_data']) || !empty($_REQUEST['is_corporate_preson']) || !empty($_REQUEST['user_id']) || !empty($_REQUEST['title']) || !empty($_REQUEST['enabled']) ) { $finalWhereClause = ''; $andAffiche = 0; if (!empty($_REQUEST['methodSearch'])) { if ($_REQUEST['methodSearch'] == 'and') { $methodSearch = 'AND'; } elseif ($_REQUEST['methodSearch'] == 'or') { $methodSearch = 'OR'; } else { $methodSearch = 'AND'; } } else { $methodSearch = 'AND'; } if ( !empty($_REQUEST['contact_id']) ) { $finalWhereClause .= 'contact_id='; $finalWhereClause .= '\''.$_REQUEST['contact_id'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['lastname']) ) { $finalWhereClause .= 'lastname LIKE '; $finalWhereClause .= '\''.$_REQUEST['lastname'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['firstname']) ) { $finalWhereClause .= 'firstname LIKE '; $finalWhereClause .= '\''.$_REQUEST['firstname'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['society']) ) { $finalWhereClause .= 'society LIKE '; $finalWhereClause .= '\''.$_REQUEST['society'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['function']) ) { $finalWhereClause .= 'function LIKE '; $finalWhereClause .= '\''.$_REQUEST['function'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['address_num']) ) { $finalWhereClause .= 'address_num LIKE '; $finalWhereClause .= '\''.$_REQUEST['address_num'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['address_street']) ) { $finalWhereClause .= 'address_street LIKE '; $finalWhereClause .= '\''.$_REQUEST['address_street'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['address_complement']) ) { $finalWhereClause .= 'address_complement LIKE '; $finalWhereClause .= '\''.$_REQUEST['address_complement'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['address_town']) ) { $finalWhereClause .= 'address_town LIKE '; $finalWhereClause .= '\''.$_REQUEST['address_town'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['address_postal_code']) ) { $finalWhereClause .= 'address_postal_code LIKE '; $finalWhereClause .= '\''.$_REQUEST['address_postal_code'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['address_country']) ) { $finalWhereClause .= 'address_country LIKE '; $finalWhereClause .= '\''.$_REQUEST['address_country'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['email']) ) { $finalWhereClause .= 'email LIKE '; $finalWhereClause .= '\''.$_REQUEST['email'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['phone']) ) { $finalWhereClause .= 'phone LIKE '; $finalWhereClause .= '\''.$_REQUEST['phone'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['other_data']) ) { $finalWhereClause .= 'other_data LIKE '; $finalWhereClause .= '\''.$_REQUEST['other_data'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['is_corporate_person']) ) { $finalWhereClause .= 'is_corporate_person LIKE '; $finalWhereClause .= '\''.$_REQUEST['is_corporate_person'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['user_id']) ) { $finalWhereClause .= 'user_id LIKE '; $finalWhereClause .= '\''.$_REQUEST['user_id'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['title']) ) { $finalWhereClause .= 'title LIKE '; $finalWhereClause .= '\''.$_REQUEST['title'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ( !empty($_REQUEST['enabled']) ) { $finalWhereClause .= 'enabled LIKE '; $finalWhereClause .= '\''.$_REQUEST['enabled'].'\''; $andAffiche++; } if ($andAffiche != 0) { $finalWhereClause .= ' '.$methodSearch.' '; $andAffiche--; } if ($methodSearch == 'AND') { $finalWhereClauseTemp = substr($finalWhereClause, 0, -5); } elseif ($methodSearch == 'OR') { $finalWhereClauseTemp = substr($finalWhereClause, 0, -4); } else { $finalWhereClauseTemp = substr($finalWhereClause, 0, -4); } $finalWhereClause = $finalWhereClauseTemp; } elseif ( !empty($_REQUEST['clause']) ) { $finalWhereClause = $_REQUEST['clause']; } else { $finalWhereClause = '1=1'; } $searchParamsForm = array("whereClause" => $finalWhereClause); $listContacts = $client->listContacts($searchParamsForm); /* TESTS & DEBUG */ /* $debug = 'finalWhereClause : '.$finalWhereClause.'
'; $debug .= 'whereClauseFormRecu :
'; $debug .= '
'.print_r($searchParamsForm, true).'
'; $debug .= '
'; $debug .= '
'.print_r($client, true).'
'; $debug .= '
'.print_r($listContacts, true).'
'; $debug .= '
'.print_r($listContacts->value[0]->contact_id, true).'
'; */ $contactResult = ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $cpt = 0; $cptMax = count($listContacts->value); if (empty($listContacts->value)) { $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; } else { while ($cpt < $cptMax) { $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $contactResult .= ''; $cpt++; } } $contactResult .= '
'; $contactResult .= 'contact_id'; $contactResult .= '
'; $contactResult .= '(Id)'; $contactResult .= '
'; $contactResult .= 'lastname'; $contactResult .= '
'; $contactResult .= '(Nom de famille)'; $contactResult .= '
'; $contactResult .= 'firstname'; $contactResult .= '
'; $contactResult .= '(Prénom)'; $contactResult .= '
'; $contactResult .= 'society'; $contactResult .= '
'; $contactResult .= '(Société)'; $contactResult .= '
'; $contactResult .= 'function'; $contactResult .= '
'; $contactResult .= '(Poste)'; $contactResult .= '
'; $contactResult .= 'address_num'; $contactResult .= '
'; $contactResult .= '(Numéro)'; $contactResult .= '
'; $contactResult .= 'address_street'; $contactResult .= '
'; $contactResult .= '(Rue)'; $contactResult .= '
'; $contactResult .= 'address_complement'; $contactResult .= '
'; $contactResult .= '(Complément d\'adresse)'; $contactResult .= '
'; $contactResult .= 'address_town'; $contactResult .= '
'; $contactResult .= '(Ville)'; $contactResult .= '
'; $contactResult .= 'address_postal_code'; $contactResult .= '
'; $contactResult .= '(Code postal)'; $contactResult .= '
'; $contactResult .= 'address_country'; $contactResult .= '
'; $contactResult .= '(Pays)'; $contactResult .= '
'; $contactResult .= 'email'; $contactResult .= '
'; $contactResult .= '(email)'; $contactResult .= '
'; $contactResult .= 'phone'; $contactResult .= '
'; $contactResult .= '(Téléphone)'; $contactResult .= '
'; $contactResult .= 'other_data'; $contactResult .= '
'; $contactResult .= '(Autre)'; $contactResult .= '
'; $contactResult .= 'is_corporate_person'; $contactResult .= '
'; $contactResult .= '(Interne)'; $contactResult .= '
'; $contactResult .= 'user_id'; $contactResult .= '
'; $contactResult .= '(ID utilisateur)'; $contactResult .= '
'; $contactResult .= 'title'; $contactResult .= '
'; $contactResult .= '(Titre)'; $contactResult .= '
'; $contactResult .= 'enabled'; $contactResult .= '
'; $contactResult .= '(Activé)'; $contactResult .= '
'; $contactResult .= 'Aucune corréspondance'; $contactResult .= '
'; $contactResult .= $listContacts->value[$cpt]->contact_id; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->lastname;; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->firstname; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->society; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->function; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->address_num; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->address_street; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->address_complement; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->address_town; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->address_postal_code; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->address_country; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->email; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->phone; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->other_data; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->is_corporate_person; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->user_id; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->title; $contactResult .= ''; $contactResult .= $listContacts->value[$cpt]->enabled; $contactResult .= '
'; $contactResult .= '
'; $contactResult .= ''; $contactResult .= 'Nouvelle recherche'; $contactResult .= ''; /* 'contact_id'=>'long', 'lastname'=>'string', 'firstname'=>'string', 'society'=>'string', 'function'=>'string', 'address_num'=>'string', 'address_street'=>'string', 'address_complement'=>'string', 'address_town'=>'string', 'address_postal_code'=>'string', 'address_country'=>'string', 'email'=>'string', 'phone'=>'string', 'other_data'=>'string', 'is_corporate_person'=>'string', 'user_id'=>'string', 'title'=>'string', 'enabled'=>'string' */ } else { $whereClauseForm = '
'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= 'Laissez vide tous les champs pour avoir la liste complète'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= '

'; $whereClauseForm .= 'OU'; $whereClauseForm .= '

'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= 'Exemples de WHERE clause
'; $whereClauseForm .= 'Si l\'on recherche des habitant de Cergy dont l\'id est 100 :
'; $whereClauseForm .= '
'; $whereClauseForm .= 'address_town=\'Cergy\' AND contact_id=\'100\''; $whereClauseForm .= '
'; $whereClauseForm .= 'Si l\'on recherche des habitant dont le code postal commence par 95 ou par 75 ou n\'est pas en France :
'; $whereClauseForm .= '
'; $whereClauseForm .= 'address_postal_code LIKE \'95%\' OR address_postal_code LIKE \'75%\' OR address_country NOT LIKE \'France\''; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= '

'; $whereClauseForm .= 'OU'; $whereClauseForm .= '

'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= 'Remplissez les champs qui vous intéressent et laissez vide les autres'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'contact_id'; $whereClauseForm .= ''; $whereClauseForm .= ' = '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'lastname'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'firstname'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'society'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'function'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'address_num'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'address_street'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'address_complement'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'address_town'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'address_postal_code'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'address_country'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'email'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'phone'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'other_data'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'is_corporate_person'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'user_id'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'title'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= 'enabled'; $whereClauseForm .= ''; $whereClauseForm .= ' LIKE '; $whereClauseForm .= ''; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= 'Méthode de recherche'; $whereClauseForm .= '
'; $whereClauseForm .= '"et" : '; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= '"ou" : '; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= '
'; $whereClauseForm .= ''; $whereClauseForm .= '
'; $whereClauseForm .= '
'; } ?> WS Service > Liste de Contacts

Debug


'.$debug; } ?>