Example #1
0
     $ret .= '<div class="content">';
     $ret .= h2(_("Ajout d'un poste analytique"));
     $ret .= '<form method="post">';
     $ret .= dossier::hidden();
     $ret .= $po->form();
     $ret .= $wSa;
     $ret .= HtmlInput::submit("add", _("Ajout"));
     $ret .= "</form>";
     $ret .= "</div>";
 }
 // record the poste
 if ($sa == "po_write") {
     //		var_dump($_POST);
     $po = new Anc_Account($cn);
     $po->get_from_array($_POST);
     $po->add();
     $sa = "pa_detail";
 }
 /* delete pa */
 if ($sa == "pa_delete") {
     $delete = new Anc_Plan($cn, $_GET['pa_id']);
     $delete->delete();
     $sa = "anc_menu";
 }
 /* po detail
  *---> in ajax : montre detail d'un poste analytique
  * 
  */
 if ($sa == "po_detail") {
     $ret .= h2(_('Modification'));
     $po = new Anc_Account($cn, $_GET['po_id']);
 static function test_me()
 {
     $cn = new Database(dossier::id());
     $pa_id = $cn->get_value("select max(pa_id) from plan_analytique");
     $o = new Anc_Account($cn);
     echo "<h1>Poste_Analytique</h1>";
     echo "<h2>get_list</h2>";
     $ee = $o->get_list();
     print_r($ee);
     //var_dump($ee);
     echo "<h2>Add some </h2>";
     $o->pa_id = $pa_id;
     $o->name = "test1";
     $o->add();
     $o->name = "test2";
     $o->add();
     $o->name = "test3";
     $o->add();
     $o->name = "test4";
     $o->add();
     $o->name = "test5";
     $o->add();
     echo "<h2> remove test1</h2>";
     $o->get_by_name("test1");
     $o->delete();
     $o->display_list();
     $o->get_by_name("test4");
     echo "<hr>" . $o->id . "<hr>";
     $o->name = "Test Four";
     $o->update();
     $o->display_list();
     $o->delete();
     $o->display_list();
 }