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 if (!defined('ALLOWED'))
00024 die('Appel direct ne sont pas permis');
00025 ob_start();
00026
00027 $ag_id=HtmlInput::default_value_get("ag_id", "0");
00028
00029 if ($ag_id == 0 ) throw new Exception('ag_id is null');
00030
00031 require_once('class_acc_ledger.php');
00032 $r=HtmlInput::title_box(_("Détail fiche"), 'search_card');
00033
00034 $r.='<form id="search_card1_frm" method="GET" onsubmit="action_add_concerned_card(this);return false;">';
00035 $q=new IText('query');
00036 $q->value=(isset($query))?$query:'';
00037 $r.='<span style="margin-left:50px">';
00038 $r.=_('Fiche contenant').HtmlInput::infobulle(19);
00039 $r.=$q->input();
00040 $r.=HtmlInput::submit('fs', _('Recherche'), "", "smallbutton");
00041 $r.='</span>';
00042 $r.=dossier::hidden().HtmlInput::hidden('op', 'add_concerned_card');
00043 $r.=HtmlInput::request_to_hidden(array('ag_id'));
00044 $r.='</form>';
00045 $query=HtmlInput::default_value_get("query", "");
00046 $sql_array['query']=$query;
00047 $sql_array['typecard']='all';
00048
00049 $fiche=new Fiche($cn);
00050
00051 $sql=$fiche->build_sql($sql_array);
00052
00053
00054
00055 $sql=$sql.' order by vw_name limit '.MAX_SEARCH_CARD;
00056 $a=$cn->get_array($sql);
00057 for ($i=0; $i<count($a); $i++)
00058 {
00059 $array[$i]['quick_code']=$a[$i]['quick_code'];
00060 $array[$i]['name']=h($a[$i]['vw_name']);
00061 $array[$i]['accounting']=$a[$i]['accounting'];
00062 $array[$i]['first_name']=h($a[$i]['vw_first_name']);
00063 $array[$i]['description']=h($a[$i]['vw_description']);
00064 $array[$i]['javascript']=sprintf("action_save_concerned(%d,'%s','%s')",$gDossier,$a[$i]['f_id'],$ag_id);
00065 }
00066
00067
00068 echo $r;
00069 require_once('template/card_result.php');
00070 $response=ob_get_contents();
00071 ob_end_clean();
00072
00073
00074 $html=escape_xml($response);
00075 if ( !headers_sent() ) { header('Content-type: text/xml; charset=UTF-8');} else {echo $response;echo $html;}
00076 echo <<<EOF
00077 <?xml version="1.0" encoding="UTF-8"?>
00078 <data>
00079 <ctl>unused</ctl>
00080 <code>$html</code>
00081 </data>
00082 EOF;
00083 ?>