2009-03-26 19:22:07 +00:00
< ? php
$tribunal = ( isset ( $_REQUEST [ 'tribunal' ]) ? $_REQUEST [ 'tribunal' ] : '' );
?>
< label > Mandataire < font color = " Red " >*</ font ></ label >
< input type = " text " name = " mand " value = " " >
< input type = " hidden " name = " jugement[mand] " value = " " >
< span class = " left " >< a id = " lienMandataireEdit " title = " Editer le mandataire " class = " thickbox " href = " ./pages_saisie/mandataire.php " >< img src = " ../img/edit1.gif " alt = " Edition mandataire " /></ a ></ span >
2009-03-27 08:34:36 +00:00
< p >< a id = " lienMandataireAdd " href = " ./pages_saisie/mandataire.php?width=650&height=500&tribunal=<?php print $tribunal ; ?> " title = " Ajouter un mandataire " class = " thickbox " > Ajouter un mandataire </ a ></ p >
2009-03-26 19:22:07 +00:00
2009-03-27 08:34:36 +00:00
< script type = " text/javascript " >
$ ( document ) . ready ( function (){
$ ( " [name=mand] " ) . autocomplete ( " ./pages_saisie/searchMandataires.php " ,
2009-04-09 11:05:36 +00:00
{
delay : 800 ,
minChars : 3 ,
cacheLength : 1 ,
formatItem : formatItem ,
2009-04-28 10:28:20 +00:00
width : 400 ,
2009-04-28 15:54:10 +00:00
max : 40
2009-04-09 11:05:36 +00:00
}
);
2009-03-26 19:22:07 +00:00
2009-03-27 08:34:36 +00:00
$ ( " [name=mand] " ) . result ( function ( event , data , formatted ) {
var tribunal = $ ( " #tribunal option:selected " ) . val ();
var idMandataire = data [ 1 ];
$ ( " [name=jugement[mand]] " ) . val ( idMandataire );
$ ( '#lienMandataireEdit' ) . attr ( 'href' , './pages_saisie/mandataire.php?width=650&height=500&tribunal=' + tribunal + '&id=' + idMandataire );
});
function formatItem ( row ) { return row [ 0 ] + " (id: " + row [ 1 ] + " ) " ; }
2009-03-26 19:22:07 +00:00
});
</ script >