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 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00026 require_once("class_iselect.php");
00027 require_once("class_icheckbox.php");
00028 require_once("class_ihidden.php");
00029 require_once('class_database.php');
00030 require_once('ac_common.php');
00031 require_once('class_pre_operation.php');
00032
00033
00034
00035
00036 $request_jrn=HtmlInput::default_value_request("jrn", -1);
00037 $request_ac=HtmlInput::default_value_request("ac", "");
00038 $request_sa=HtmlInput::default_value_request("sa", "");
00039 $get_jrn=HtmlInput::default_value_get('jrn',-1);
00040
00041 echo '<div class="content">';
00042 echo '<form method="GET">';
00043 $sel=new ISelect();
00044 $sel->name="jrn";
00045 $sel->value=$cn->make_array("select jrn_def_id,jrn_def_name from ".
00046 " jrn_def where jrn_def_type in ('VEN','ACH','ODS') order by jrn_def_name");
00047
00048 $sel->selected=$request_jrn;
00049 echo 'Choississez un journal '.$sel->input();
00050
00051 echo dossier::hidden();
00052 $hid=new IHidden();
00053 echo $hid->input("sa","jrn");
00054 echo $hid->input("ac",$request_ac);
00055 echo '<hr>';
00056 echo HtmlInput::submit('Accepter','Accepter');
00057 echo '</form>';
00058
00059
00060 if ( $request_sa == 'del')
00061 {
00062 $op=new Pre_operation($cn);
00063 $op->od_id=$_REQUEST['od_id'];
00064 $op->delete();
00065 $request_sa='jrn';
00066 }
00067
00068
00069
00070 if ( $request_sa== 'jrn' )
00071 {
00072 $op=new Pre_operation($cn);
00073 $op->set_jrn($get_jrn);
00074 $is_ods = $cn->get_value("select count(*)
00075 from jrn_def where
00076 jrn_def_id=$1
00077 and jrn_def_type='ODS'", array($get_jrn));
00078 $op->od_direct = ($is_ods > 0) ? 't' : 'f';
00079 $array = $op->get_list_ledger();
00080 if (empty($array) == true)
00081 {
00082 echo _("Aucun enregistrement");
00083 exit();
00084 }
00085
00086 echo '<table>';
00087 $count=0;
00088 foreach ($array as $row )
00089 {
00090
00091 if ( $count %2 == 0 )
00092 echo '<tr class="odd">';
00093 else
00094 echo '<tr class="even">';
00095 $count++;
00096
00097 echo '<td>'.h($row['od_name']).'</td>';
00098 echo '<td>'.h($row['od_description']).'</td>';
00099 echo '<td>';
00100 echo '<form method="POST" class="print" style="margin:0px;padding:0px;">';
00101 echo dossier::hidden();
00102 echo $hid->input("sa","del");
00103 echo $hid->input("ac",$request_ac);
00104 echo $hid->input("del","");
00105 echo $hid->input("od_id",$row['od_id']);
00106 echo $hid->input("jrn",$get_jrn);
00107
00108 $b='<input type="submit" class="smallbutton" value="'._("Effacer").'"'.
00109 ' onClick="return confirm(\''._("Voulez-vous vraiment effacer cette operation ?").'\');" >';
00110 echo $b;
00111 echo '</form>';
00112
00113 echo '</td>';
00114 $b=HtmlInput::button('mod'.$row['od_id'],"Modifier","onclick=\"mod_predf_op('".dossier::id()."','".$row['od_id']."');\"");
00115 echo td($b);
00116 echo '</tr>';
00117
00118 }
00119 echo '</table>';
00120 }
00121 echo '</div>';
00122 ?>