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 require_once("class_ibutton.php");
00026 require_once("class_ihidden.php");
00027 require_once("class_iselect.php");
00028 require_once("class_itext.php");
00029 require_once("class_anc_plan.php");
00030 require_once ("user_common.php");
00031
00032
00033
00034
00035
00036
00037 class Anc_Operation
00038 {
00039 var $db;
00040 var $row;
00041 var $list;
00042 var $id;
00043 var $po_id;
00044 var $oa_amount;
00045 var $oa_description;
00046 var $oa_debit;
00047 var $j_id;
00048
00049 var $oa_group;
00050 var $oa_date;
00051 var $pa_id;
00052
00053
00054
00055
00056
00057 var $oa_jrnx_id_source;
00058
00059
00060
00061 var $oa_positive;
00062
00063
00064
00065
00066 function Anc_Operation ($p_cn,$p_id=0)
00067 {
00068 $this->db=$p_cn;
00069 $this->id=$p_id;
00070 $this->oa_jrnx_id_source=null;
00071 $this->oa_positive='Y';
00072 }
00073
00074
00075
00076
00077
00078 function add($p_seq=0)
00079 {
00080
00081 if ( $this->oa_group == 0)
00082 {
00083 $this->oa_group=$this->db->get_next_seq('s_oa_group');
00084 }
00085
00086 if ( $this->j_id == 0 )
00087 {
00088 $this->j_id=null;
00089 }
00090
00091
00092
00093 if ( $this->oa_amount == 0 || $this->po_id==-1)
00094 return;
00095
00096 if ( $this->oa_amount< 0)
00097 {
00098 $this->oa_debit=($this->oa_debit=='t')?'f':'t';
00099 $this->oa_positive='N';
00100 }
00101
00102 $oa_row=(isset($this->oa_row))?$this->oa_row:null;
00103 $sql="insert into operation_analytique (
00104 po_id,
00105 oa_amount,
00106 oa_description,
00107 oa_debit,
00108 oa_group,
00109 j_id,
00110 oa_date,
00111 oa_row,
00112 oa_jrnx_id_source,
00113 oa_positive
00114 ) values ($1,$2,$3,$4,$5,$6,to_date($7,'DD.MM.YYYY'),$8,$9,$10)";
00115
00116 $this->db->exec_sql($sql,array(
00117 $this->po_id,
00118 abs($this->oa_amount),
00119 $this->oa_description,
00120 $this->oa_debit,
00121 $this->oa_group,
00122 $this->j_id,
00123 $this->oa_date,
00124 $oa_row,
00125 $this->oa_jrnx_id_source,
00126 $this->oa_positive
00127 ));
00128
00129 }
00130
00131
00132
00133 function delete()
00134 {
00135 $sql="delete from operation_analytique where oa_id=$1";
00136
00137 $this->db->exec_sql($sql,array($this->oa_id));
00138 }
00139
00140
00141
00142 function get_list($p_from,$p_to,$p_from_poste="",$p_to_poste="")
00143 {
00144 $cond="";
00145 $cond_poste="";
00146
00147 if ($p_from!="")
00148 $cond="and jr_date >= to_date('$p_from','DD.MM.YYYY') ";
00149 if ( $p_to!="" )
00150 $cond.="and jr_date <=to_date('$p_to','DD.MM.YYYY')";
00151
00152 if ($p_from_poste != "" )
00153 $cond_poste=" and upper(po_name) >= upper('".$p_from_poste."')";
00154 if ($p_to_poste != "" )
00155 $cond_poste.=" and upper(po_name) <= upper('".$p_to_poste."')";
00156 $pa_id_cond="";
00157 if ( isset ( $this->pa_id) && $this->pa_id !='')
00158 $pa_id_cond= "pa_id=".$this->pa_id." and";
00159 $sql="
00160 select oa_id,
00161 po_name,
00162 oa_description,
00163 po_description,
00164 oa_debit,
00165 to_char(jr_date,'DD.MM.YYYY') as oa_date,
00166 oa_amount,
00167 oa_group,
00168 j_id ,
00169 jr_internal,
00170 jr_id,
00171 jr_comment,
00172 j_poste,
00173 jrnx.f_id,
00174 ( select ad_value from fiche_Detail where f_id=jrnx.f_id and ad_id=23) as qcode
00175 from operation_analytique as B join poste_analytique using(po_id)
00176 left join jrnx using (j_id)
00177 left join jrn on (j_grpt=jr_grpt_id)
00178 where $pa_id_cond oa_amount <> 0.0 $cond $cond_poste
00179 order by jr_date,oa_group,oa_debit desc,oa_id";
00180
00181 $RetSql=$this->db->exec_sql($sql);
00182
00183 $array=Database::fetch_all($RetSql);
00184 return $array;
00185 }
00186
00187
00188
00189 function html_table($p_from)
00190 {
00191 if ($p_from=="")
00192 {
00193 $from="";
00194 $to="";
00195 }
00196 else
00197 {
00198 $p=new Periode($this->db);
00199 list($from,$to)=$p->get_date_limit($p_from);
00200 }
00201
00202 $array=$this->get_list($from,$to);
00203 if ( empty($array) )
00204 return "Pas d'enregistrement trouvé";
00205
00206
00207 $step=$_SESSION['g_pagesize'];
00208 $page=(isset($_GET['offset']))?$_GET['page']:1;
00209 $offset=(isset($_GET['offset']))?$_GET['offset']:0;
00210 $bar=navigation_bar($offset+1,count($array),$step,$page);
00211
00212 if ( $step !=-1)
00213 $view=array_splice($array,$offset,$step);
00214 else
00215 $view=$array;
00216
00217 $gDossier=dossier::id();
00218 $ret="";
00219 $ret.=$bar;
00220
00221 $count=0;
00222 $group=0;
00223 $oldgroup=0;
00224 $oldjrid=0;
00225
00226 foreach ($view as $row)
00227 {
00228 $group=$row['oa_group'];
00229 if ( $group !=$oldgroup )
00230 {
00231 if ( $oldgroup!=0 )
00232 {
00233
00234 $efface=new IButton();
00235 $efface->javascript="anc_remove_operation(".$gDossier.",".$oldgroup.")";
00236 $efface->name="Efface";
00237 $efface->label="Efface";
00238 $ret.="<td>".$efface->input()."</td>";
00239
00240 $this->oa_group=$oldgroup;
00241 $jr_id=$this->get_jrid();
00242
00243 if ( $jr_id != 0)
00244 {
00245
00246 $detail=new IButton();
00247 $detail->javascript="viewOperation($jr_id,$gDossier)";
00248 $detail->name="Detail";
00249 $detail->label="Detail";
00250 $ret.="<td>".$detail->input()."</td>";
00251 }
00252 $ret.='</table>';
00253
00254 }
00255 $ret.='<table id="'.$row['oa_group'].'" style="margin-bottom:2px;border: 1px solid blue; width: 90%;">';
00256
00257 $ret.="<th>".
00258 $row['oa_date'].
00259 "</th>".
00260 "<th>".
00261 h($row['oa_description']).
00262 "</th>";
00263
00264 $ret.="<th>".
00265 "Groupe id : ".$row['oa_group'].
00266 "</th>";
00267
00268 $oldgroup=$group;
00269
00270 }
00271
00272 $class=($count%2==0)?"odd":"even";
00273 $count++;
00274 $cred= ( $row['oa_debit'] == 'f')?"CREDIT":"DEBIT";
00275 $ret.="<tr class=\"$class\">";
00276 $ret.= "<td>".
00277 h($row['po_name']).
00278 "</td>";
00279
00280 $ret.=td(h($row['po_description']));
00281
00282 $ret.='<td class="num">'. nbm($row['oa_amount']).
00283 "</td>".
00284 "<td>".
00285 $cred.
00286 "</td>".
00287
00288 "</tr>";
00289 }
00290
00291
00292 $efface=new IButton();
00293 $efface->javascript="anc_remove_operation("."$gDossier,".$oldgroup.")";
00294 $efface->name="Efface";
00295 $efface->label="Efface";
00296 $ret.="<td>".$efface->input()."</td>";
00297
00298 $this->oa_group=$oldgroup;
00299 $jr_id=$this->get_jrid();
00300 if ( $jr_id != 0 )
00301 {
00302 $detail=new IButton();
00303 $detail->javascript="modifyOperation($jr_id,'".$gDossier."')";
00304 $detail->name="Detail";
00305 $detail->label="Detail";
00306 $ret.="<td>".$detail->input()."</td>";
00307 }
00308 $ret.='</table>';
00309 $ret.=$bar;
00310 return $ret;
00311 }
00312
00313
00314
00315
00316 function get_by_jid($p_jid)
00317 {
00318 $sql="select distinct oa_id,
00319 po_id,
00320 oa_amount,
00321 oa_description,
00322 oa_debit,
00323 j_id,
00324 oa_group,
00325 oa_date,
00326 pa_id,
00327 oa_row,
00328 oa_positive
00329 from operation_analytique join poste_analytique using (po_id)
00330 where
00331 j_id=$p_jid order by j_id,oa_row,pa_id";
00332 $ret=$this->db->exec_sql($sql);
00333 $res=Database::fetch_all($ret);
00334 if ( $res== false) return null;
00335
00336 foreach ($res as $row)
00337 {
00338 $a=new Anc_Operation($this->db);
00339 foreach ( $row as $attr=>$value )
00340 {
00341 $a->$attr=$row[$attr];
00342 }
00343 $array[]=clone $a;
00344 }
00345 return $array;
00346 }
00347
00348
00349
00350 function update_from_jrnx($p_po_id)
00351 {
00352 $a=$this->get_by_jid($this->j_id);
00353 if ( $a == null )
00354 {
00355
00356 $sql="select jr_date,j_montant,j_debit from jrnx ".
00357 " join jrn on (jr_grpt_id = j_grpt) ".
00358 "where j_id=".$this->j_id;
00359 $res=$this->db->exec_sql($sql);
00360 if (Database::num_row($res) == 0 ) return;
00361 $row=Database::fetch_array($res,0);
00362 $this->oa_amount=$row['j_amount'];
00363 $this->oa_date=$row['jr_date'];
00364 $this->oa_debit=$row['j_debit'];
00365 $this->oa_description=$row['jr_comment'];
00366 $this->add();
00367 }
00368 else
00369 {
00370 foreach ($a as $row )
00371 {
00372 if ( $row->pa_id == $this->pa_id )
00373 {
00374 $row->po_id=$p_po_id;
00375 $row->update();
00376 }
00377 }
00378 }
00379 }
00380
00381 function get_jrid()
00382 {
00383 $sql="select distinct jr_id from jrn join jrnx on (j_grpt=jr_grpt_id) join operation_analytique using (j_id) where j_id is not null and oa_group=".$this->oa_group;
00384 $res=$this->db->exec_sql($sql);
00385 if ( Database::num_row($res) == 0 ) return 0;
00386 $ret=Database::fetch_all($res);
00387 return $ret[0]['jr_id'];
00388 }
00389
00390
00391
00392
00393
00394 function get_balance($p_from,$p_to,$p_plan_id)
00395 {
00396
00397 $cond=sql_filter_per($this->db,$p_from,$p_to,'p_id','j_date');
00398 $sql="select oa_id, po_id, oa_amount, oa_debit, j_date from jrnx join operation_analytique using (j_id)
00399 join poste_analytique using (po_id)
00400 where
00401 $cond and j_id is not null and pa_id=$p_plan_id";
00402
00403
00404 $cond=sql_filter_per($this->db,$p_from,$p_to,'p_id','oa_date');
00405 $sql="union select oa_id, po_id, oa_amount, oa_debit,oa_date from
00406 operation_analytique
00407 join poste_analytique using (po_id)
00408 where j_id is null and
00409 $cond and pa_id=$p_plan_id ";
00410 try
00411 {
00412 $res=$this->db->exec_sql($sql);
00413 $array=Database::fetch_all($res);
00414 }
00415 catch (Exception $e)
00416 {
00417 var_dump($e);
00418 }
00419 }
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457 function display_form_plan($p_array,$p_null,$p_mode,$p_seq,$p_amount,$p_id='')
00458 {
00459 if ( $p_array != null)
00460 extract ($p_array);
00461 $result="";
00462 $plan=new Anc_Plan($this->db);
00463 $a_plan=$plan->get_list(" order by pa_id ");
00464 if ( empty ($a_plan) ) return "";
00465 $table_id="t".$p_seq;
00466 $hidden=new IHidden();
00467
00468 $readonly=($p_mode==1)?false:true;
00469
00470 $result.=$hidden->input('amount_'.$table_id,$p_amount);
00471 if ( $p_mode==1 )
00472 $result.='<table id="'.$p_id.$table_id.'">';
00473 else
00474 $result.='<table>';
00475 $result.="<tr>".$plan->header()."<th>montant</th></tr>";
00476
00477
00478 $nb_row=(isset($val[$p_seq]))?count($val[$p_seq]):1;
00479 $count=0;
00480
00481 $remain=$p_amount;
00482 $ctrl_remain="remain".$table_id;
00483
00484 for ( $i=0; $i < $nb_row;$i++)
00485 {
00486 $result.='<tr>';
00487
00488 foreach ($a_plan as $r_plan)
00489 {
00490
00491 $array=$this->db->make_array(
00492 "select po_id as value,".
00493 " html_quote(po_name) as label from poste_analytique ".
00494 " where pa_id = ".$r_plan['id'].
00495 " order by po_name",$p_null);
00496 $select =new ISelect("hplan[".$p_seq."][]",$array);
00497 $select->table=0;
00498
00499 if ( $p_mode==1 )
00500 {
00501
00502 $select->readonly=false;
00503 if ( isset($hplan) && isset($hplan[$p_seq][$count]) ){
00504 $select->selected=$hplan[$p_seq][$count];
00505
00506 }
00507 }
00508 else
00509 {
00510 if ( isset($hplan) && isset($hplan[$p_seq][$count]) ){
00511 $select->selected=$hplan[$p_seq][$count];
00512 }
00513
00514 $select->readOnly=true;
00515 }
00516 if ($p_mode==1)
00517 $result.='<td>'.$select->input().'</td>';
00518 else
00519 $result.='<td>'.$select->display().'</td>';
00520 $count++;
00521
00522
00523 }
00524 $value=new INum();
00525 $value->javascript='onchange="format_number(this);anc_refresh_remain(\''.$table_id.'\',\''.$p_seq.'\')"';
00526 $value->name="val[".$p_seq."][]";
00527 $value->size=6;
00528 $value->value=(isset($val[$p_seq][$i]))?$val[$p_seq][$i]:$p_amount;
00529 $value->readOnly=($p_mode==1)?false:true;
00530 $remain=bcsub($remain,$value->value);
00531 $result.='<td>'.$value->input().'</td>';
00532
00533 $result.="</tr>";
00534 }
00535
00536 $result.="</table>";
00537 if ( $p_mode == 1 )
00538 {
00539 $style_remain=($remain==0)?'style="color:green"':' style="color:red"';
00540 $result.=" Reste à imputer = ".
00541 '<span class="remain" '.$style_remain.' id="'.$ctrl_remain.'">'.
00542 $remain.'</span>';
00543
00544 // add a button to add a row
00545 $button=new IButton();
00546 $button->javascript="add_row('".$p_id."$table_id',$p_seq);";
00547 $button->name="js".$p_id.$p_seq;
00548 $button->label="Nouvelle ligne";
00549
00550 $result.="<br>".$button->input();
00551 }
00552
00553 return $result;
00554 }
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565 function save_form_plan_vat_nd($p_array,$p_item,$p_j_id,$p_nd)
00566 {
00567 bcscale(4);
00568 extract($p_array);
00569 if (! isset ($hplan) ) return;
00570
00571 if ( ! isset(${'amount_t'.$p_item}) )
00572 throw new Exception ('amount not set');
00573
00574 $tot=0;
00575 /* variable for in array
00576 pa_id array of existing pa_id
00577 hplan double array with the pa_id (column)
00578 val double array by row with amount
00579 op contains sequence
00580 p_item is used to identify what op is concerned
00581 */
00582 /* echo "j_id = $j_id p_item = $p_item hplan=".var_export($hplan[$p_item],true)." val = ".var_export($val[$p_item],true).'<br>'; */
00583 /* for each row */
00584 // for ($i=0;$i<count($val[$p_item]);$i++) {
00585 $idx_pa_id=0;
00586 $row=0;
00587 $a_Anc_Operation=array();
00588 // foreach col PA
00589 for ($e=0;$e<count($hplan[$p_item]);$e++)
00590 {
00591 if ( $idx_pa_id == count($pa_id))
00592 {
00593 $idx_pa_id=0;
00594 $row++;
00595 }
00596 if ($hplan[$p_item][$e] != -1 && $val[$p_item][$row] != '')
00597 {
00598 $op=new Anc_Operation($this->db);
00599 $op->po_id=$hplan[$p_item][$e];
00600 $op->oa_group=$this->oa_group;
00601 $op->j_id=$p_j_id;
00602 $ratio=bcdiv($val[$p_item][$row],${"amount_t".$p_item});
00603 $amount= bcmul($p_nd, $ratio);
00604 $op->oa_amount=abs(round($amount,2));
00605 $op->oa_debit=$this->oa_debit;
00606 $op->oa_date=$this->oa_date;
00607
00608 $op->oa_description=$this->oa_description;
00609 $op->oa_row=$row;
00610 $op->oa_jrnx_id_source=$this->oa_jrnx_id_source;
00611 $a_Anc_Operation[]=clone $op;
00612 }
00613 $idx_pa_id++;
00614 }
00615 $nb_op=count($a_Anc_Operation);
00616 bcscale(2);
00617 for ($i=0;$i<$nb_op;$i++)
00618 {
00619 $tot=bcadd($tot,$a_Anc_Operation[$i]->oa_amount);
00620 }
00621 if ( $tot != $p_nd )
00622 {
00623 $diff= bcsub($tot, $p_nd);
00624 $a_Anc_Operation[0]->oa_amount=bcsub($a_Anc_Operation[0]->oa_amount,$diff);
00625 }
00626 for ($i=0;$i<$nb_op;$i++)
00627 {
00628 $a_Anc_Operation[$i]->add();
00629 }
00630 }
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652 function save_form_plan($p_array,$p_item,$p_j_id)
00653 {
00654 extract($p_array);
00655 if (! isset ($hplan) ) return;
00656 /* variable for in array
00657 pa_id array of existing pa_id
00658 hplan double array with the pa_id (column)
00659 val double array by row with amount
00660 op contains sequence
00661 p_item is used to identify what op is concerned
00662 */
00663 /* echo "j_id = $j_id p_item = $p_item hplan=".var_export($hplan[$p_item],true)." val = ".var_export($val[$p_item],true).'<br>'; */
00664 /* for each row */
00665 // for ($i=0;$i<count($val[$p_item]);$i++) {
00666 $idx_pa_id=0;
00667 $row=0;
00668 // foreach col PA
00669 for ($e=0;$e<count($hplan[$p_item]);$e++)
00670 {
00671 if ( $idx_pa_id == count($pa_id))
00672 {
00673 $idx_pa_id=0;
00674 $row++;
00675 }
00676 if ($hplan[$p_item][$e] != -1 && $val[$p_item][$row] != '')
00677 {
00678 $op=new Anc_Operation($this->db);
00679 $op->po_id=$hplan[$p_item][$e];
00680 $op->oa_group=$this->oa_group;
00681 $op->j_id=$p_j_id;
00682 $op->oa_amount=$val[$p_item][$row];
00683 $op->oa_debit=$this->oa_debit;
00684 $op->oa_date=$this->oa_date;
00685
00686 $op->oa_description=$this->oa_description;
00687 $op->oa_row=$row;
00688 $op->add();
00689 }
00690 $idx_pa_id++;
00691 }
00692 // }
00693 }
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705 function save_update_form($p_array)
00706 {
00707 extract($p_array);
00708 for ($i = 0; $i < count($op); $i++)
00709 {
00710 /* clean jrnx */
00711 $this->db->exec_sql('delete from operation_analytique where j_id=$1', array($op[$i]));
00712
00713 /* get missing data for adding */
00714 $a_missing = $this->db->get_array("select to_char(jr_date,'DD.MM.YYYY') as mdate,j_montant,j_debit,jr_comment from jrnx join jrn on (j_grpt=jr_grpt_id) where j_id=$1", array($op[$i]));
00715 $missing = $a_missing[0];
00716 $this->oa_debit = $missing['j_debit'];
00717 $this->oa_description = $missing['jr_comment'];
00718 $this->j_id = $op[$i];
00719 $group = $this->db->get_next_seq("s_oa_group");
00720 $this->oa_group = $group;
00721 $this->oa_date = $missing['mdate'];
00722 $this->save_form_plan($p_array, $i, $op[$i]);
00723
00724
00725 $a_nd = $this->db->get_array('select j_id from operation_analytique
00726 where oa_jrnx_id_source=$1', array($op[$i]));
00727 if (count($a_nd) > 0)
00728 {
00729
00730 for ($e=0;$e<count($a_nd);$e++)
00731 {
00732 $this->db->exec_sql('delete from operation_analytique where j_id=$1', array($a_nd[$e]['j_id']));
00733
00734 $a_missing_vat = $this->db->get_array("select to_char(jr_date,'DD.MM.YYYY') as mdate,j_montant,j_debit,jr_comment from jrnx join jrn on (j_grpt=jr_grpt_id) where j_id=$1", array($a_nd[$e]['j_id']));
00735 $missing_vat = $a_missing_vat[0];
00736 $this->oa_debit = $missing_vat['j_debit'];
00737 $this->oa_description = $missing_vat['jr_comment'];
00738 $this->j_id = $op[$i];
00739 $group = $this->db->get_next_seq("s_oa_group");
00740 $this->oa_group = $group;
00741 $this->oa_date = $missing_vat['mdate'];
00742 $this->oa_jrnx_id_source=$op[$i];
00743 $p_array['amount_t'.$i]=$missing['j_montant'];
00744 $this->save_form_plan_vat_nd($p_array, $i, $a_nd[$e]['j_id'],$missing_vat['j_montant']);
00745 }
00746 }
00747 }
00748 }
00749
00750
00751
00752
00753
00754
00755
00756 function to_request ($p_array,$p_line)
00757 {
00758 $result=array();
00759 $result[]=array('op'=>$this->j_id);
00760 $pa_id=array();
00761
00762
00763 for ($i=0;$i < count($p_array);$i++)
00764 {
00765 if ( in_array($p_array[$i]->pa_id,$pa_id)==false)
00766 $pa_id[]=$p_array[$i]->pa_id;
00767 }
00768 $result['pa_id']=$pa_id;
00769
00770
00771 $seq=0;
00772 for ($i=0;$i < count($p_array);$i++)
00773 {
00774 $hplan[$p_line][$i]=$p_array[$i]->po_id;
00775 }
00776 $result['hplan']=$hplan;
00777
00778 $idx_pa=0;
00779 for ($i=0;$i < count($p_array);$i++)
00780 {
00781 $val[$p_line][$p_array[$i]->oa_row]=($p_array[$i]->oa_positive=='Y')?$p_array[$i]->oa_amount:($p_array[$i]->oa_amount*(-1));
00782 }
00783 $result['val']=$val;
00784 return $result;
00785 }
00786
00787
00788
00789
00790
00791
00792 function delete_by_jid($p_jid)
00793 {
00794 $sql="delete from operation_analytique where j_id=$p_jid";
00795 $this->db->exec_sql($sql);
00796 }
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806 function display_table($p_mode,$p_amount,$p_id)
00807 {
00808 static $seq=-1;
00809 $seq++;
00810
00811 $array=$this->get_by_jid($this->j_id) ;
00812 if ( $array != null )
00813 {
00814 $request=$this->to_request($array,$seq);
00815 return "<td>".$this->display_form_plan($request,1,$p_mode,$seq,$p_amount,$p_id)."</td>";
00816 }
00817 else
00818 {
00819 return '<td>'.$this->display_form_plan(null,1,$p_mode,$seq,$p_amount,$p_id)."</TD>";
00820 }
00821 return "";
00822
00823 }
00824
00825
00826
00827
00828
00829
00830
00831
00832 function test_me()
00833 {
00834 $cn=new Database(dossier::id());
00835 $anco=new Anc_Operation($cn);
00836 $j_id=200;
00837 $anco->j_id=$j_id;
00838 $array=$anco->get_by_jid($j_id);
00839 $a=$anco->to_request($array,1);
00840 echo '<form>';
00841 echo dossier::hidden();
00842 echo HtmlInput::hidden('j_id',$j_id);
00843 echo HtmlInput::hidden('test_select',$_REQUEST['test_select']);
00844 echo $anco->display_table(1,15002,0);
00845 echo '<input type="submit" name="save">';
00846 echo '</form>';
00847 if ( isset($_REQUEST['save']))
00848 {
00849 echo "to_save";
00850 var_dump($_REQUEST);
00851 }
00852 var_dump($a);
00853
00854 }
00855
00856 }