Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00031 require_once("class_itext.php");
00032 require_once("class_ihidden.php");
00033 require_once("class_ibutton.php");
00034 require_once ('class_database.php');
00035 require_once ("ac_common.php");
00036 require_once ('class_dossier.php');
00037 require_once ('class_anc_account.php');
00038 require_once ('class_anc_plan.php');
00039 require_once('function_javascript.php');
00040
00041 echo HtmlInput::title_box(_("Recherche activité"), $ctl);
00042
00043
00044 echo '<FORM id="anc_search_form" METHOD="GET" onsubmit="search_anc_form(this);return false">';
00045 echo '<span>'._('Recherche').':';
00046
00047 $texte=new IText('plabel');
00048 $texte->value=HtmlInput::default_value('plabel',"", $_GET);
00049 echo $texte->input();
00050 echo '</span>';
00051 echo dossier::hidden();
00052 $hid=new IHidden();
00053 echo $hid->input("c1",$_REQUEST['c1']);
00054 echo $hid->input("c2",$_REQUEST['c2']);
00055 echo $hid->input("go");
00056 echo HtmlInput::submit("go",_("Recherche"));
00057 echo '</form>';
00058
00059 if ( isset($_REQUEST['go']))
00060 {
00061 $cn=Dossier::connect();
00062 $plan=new Anc_Plan($cn,$_REQUEST['c2']);
00063 $plan->pa_id=$_REQUEST['c2'];
00064 if ( $plan->exist()==false)
00065 exit(_("Ce plan n'existe pas"));
00066
00067 $sql="select po_name , po_description from poste_analytique ".
00068 "where pa_id=$1 and ".
00069 " (po_name ~* $2 or po_description ~* $3) order by po_name";
00070 $array=$cn->get_array($sql,array($_REQUEST['c2'],$_REQUEST['plabel'],$_REQUEST['plabel']));
00071
00072 if (empty($array) == true)
00073 {
00074 echo _("Aucun poste trouvé");
00075 return;
00076 }
00077 $button=new IButton();
00078 $button->name=_("Choix");
00079 $button->label=_("Choix");
00080
00081 echo '<table>';
00082 foreach ($array as $line)
00083 {
00084 $button->javascript=sprintf("$('%s').value='%s';removeDiv('%s')",
00085 $_REQUEST['c1'],
00086 $line['po_name'],$ctl);
00087 echo '<tr>'.
00088 '<td>'.
00089 $button->input().
00090 '</td>'.
00091 '<td>'.
00092 h($line['po_name']).
00093 '</td><td>'.
00094 h($line['po_description']).
00095 '</tr>';
00096 }
00097 echo '</table>';
00098 }