2009-03-26 19:22:07 +00:00
< ? php
$tribunal = ( isset ( $_REQUEST [ 'tribunal' ]) ? $_REQUEST [ 'tribunal' ] : '' );
?>
< label > Opposition </ label >
2009-03-27 08:34:36 +00:00
< input type = " text " name = " test " value = " " >
2009-03-26 19:22:07 +00:00
< input type = " hidden " name = " jugement[oppo] " value = " " >
< span class = " left " >< a id = " lienOppositionEdit " 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 = " lienOppositionAdd " href = " ./pages_saisie/mandataire.php?width=650&height=500&tribunal=<?php print $tribunal ; ?> " title = " Ajouter un andataire " class = " thickbox " > Ajouter un mandataire </ a ></ p >
2009-03-26 19:22:07 +00:00
< script type = " text/javascript " >
2009-03-27 08:34:36 +00:00
$ ( document ) . ready ( function (){
2009-04-09 11:05:36 +00:00
$ ( " [name=test] " ) . autocomplete ( " ./pages_saisie/searchMandataires.php " ,
{
delay : 800 ,
minChars : 3 ,
cacheLength : 1 ,
formatItem : formatItem ,
width : 400
}
);
2009-03-26 19:22:07 +00:00
2009-03-27 08:34:36 +00:00
$ ( " [name=test] " ) . result ( function ( event , data , formatted ) {
var tribunal = $ ( " #tribunal option:selected " ) . val ();
var idMandataire = data [ 1 ];
$ ( " [name=jugement[oppo]] " ) . val ( idMandataire );
$ ( '#lienOppositionEdit' ) . attr ( 'href' , './pages_saisie/mandataire.php?width=650&height=500&tribunal=' + tribunal + '&id=' + idMandataire );
});
function formatItem ( row ) { return row [ 0 ] + " (id: " + row [ 1 ] + " ) " ; }
});
</ script >