check(true);$user->check_dossier($gDossier,true); $html=var_export($_REQUEST,true); switch($op) { // display new calendar case 'cal': require_once('class_calendar.php'); /* others report */ $cal=new Calendar(); $cal->set_periode($per); $html=""; $html=$cal->display(); $html=escape_xml($html); header('Content-type: text/xml; charset=UTF-8'); echo << $html EOF; break; /* remove a cat of document */ case 'rem_cat_doc': require_once('class_document_type.php'); // if user can not return error message if( $user->check_action(PARCATDOC)==0 ) { $html="nok"; header('Content-type: text/xml; charset=UTF-8'); echo << $html EOF; return; } // remove the cat if no action $count_md=$cn->get_value('select count(*) from document_modele where md_type=$1',array($dt_id)); $count_a=$cn->get_value('select count(*) from action_gestion where ag_type=$1',array($dt_id)); if ( $count_md != 0 || $count_a != 0 ) { $html="nok"; header('Content-type: text/xml; charset=UTF-8'); echo << $html EOF; exit; } $cn->exec_sql('delete from document_type where dt_id=$1',array($dt_id)); $html=$dt_id; header('Content-type: text/xml; charset=UTF-8'); echo << $html EOF; return; break; case 'dsp_tva': $cn=new Database($gDossier); $Res=$cn->exec_sql("select * from tva_rate order by tva_rate desc"); $Max=Database::num_row($Res); $r=""; $r='
'; $r= ""; $r.=th(''); $r.=th(_('code')); $r.=th(_('Taux')); $r.=th(_('Symbole')); $r.=th(_('Explication')); for ($i=0;$i<$Max;$i++) { $row=Database::fetch_array($Res,$i); if ( ! isset($code)) { $script="onclick=\"$('$ctl').value='".$row['tva_id']."';hideIPopup('".$popup."');\""; } else { $script="onclick=\"$('$ctl').value='".$row['tva_id']."';set_value('$code','".$row['tva_label']."');hideIPopup('".$popup."');\""; } $set= ''; $r.=''; $r.=td($set); $r.=td($row['tva_id']); $r.=td($row['tva_rate']); $r.=td($row['tva_label']); $r.=td($row['tva_comment']); $r.=''; } $r.='
'; $r.='
'; $html=escape_xml($r); header('Content-type: text/xml; charset=UTF-8'); echo << $html $popup EOF; break; case 'label_tva': $cn=new Database($gDossier); if ( isNumber($id) == 0 ) $value = _('tva inconnue'); else { $Res=$cn->get_array("select * from tva_rate where tva_id = $1",array($id)); if ( count($Res) == 0 ) $value=_('tva inconnue'); else $value=$Res[0]['tva_label']; } header('Content-type: text/xml; charset=UTF-8'); echo << $code $value EOF; break; }