diff --git a/html/search_ca.php b/html/search_ca.php new file mode 100644 index 000000000..89410fdcd --- /dev/null +++ b/html/search_ca.php @@ -0,0 +1,98 @@ +'; +$texte=new widget("text"); +echo ' Recherche :'; +echo $texte->IOValue('label'); +echo ''; +echo dossier::hidden(); +$hid=new widget("hidden"); +echo $hid->IOValue("c1",$_REQUEST['c1']); +echo $hid->IOValue("c2",$_REQUEST['c2']); +echo $hid->IOValue("go"); +echo $hid->Submit("go","Recherche"); +echo ''; +//------------- FORM ---------------------------------- +if ( isset($_REQUEST['go'])) { + $cn=DbConnect(dossier::id()); + print_r($_REQUEST['c2']); + $plan=new PlanAnalytic($cn,$_REQUEST['c2']); + $plan->pa_id=$_REQUEST['c2']; + if ( $plan->exist()==false) + exit("Ce plan n'existe pas"); + + $sql="select po_name , po_description from poste_analytique ". + "where pa_id=".$_REQUEST['c2']." and ". + " upper (po_name) like upper('%".pg_escape_string($_REQUEST['label'])."%') order by po_name"; + print_r($sql); + $res=ExecSql($cn,$sql); + $array=pg_fetch_all($res); + if (empty($array) == true) + { + echo "Désolé aucun poste trouvé"; + return; + } + $button=new widget("button"); + $button->name="Choix"; + $button->label="Choix"; + + echo ''; + foreach ($array as $line) + { + $button->javascript=sprintf("ca_set_child('%s','%s')", + $_REQUEST['c1'], + $line['po_name']); + echo ''. + ''. + ''; + } + echo '
'. + $button->IOValue(). + ''. + $line['po_name']. + ''. + $line['po_description']. + '
'; + }