Пример #1
0
     $sa = "";
 }
 /**
  * mise à jour po 
  */
 if ($sa == "po_update") {
     $po = new Anc_Account($cn);
     $po->get_from_array($_POST);
     $po->update();
     $sa = "pa_detail";
 }
 /**
  * Efface po
  */
 if ($sa == "po_delete") {
     $po = new Anc_Account($cn, $_REQUEST['po_id']);
     $po->delete();
     $sa = "pa_detail";
 }
 // show the detail
 if ($sa == "pa_detail") {
     $new = new Anc_Plan($cn, $_GET['pa_id']);
     $wSa = HtmlInput::hidden("sa", "pa_update");
     $new->get();
     $ret .= '<div class="content">';
     $ret .= '<h2 class="info">' . _("Mise à jour") . '</h2>';
     $ret .= '<form method="post">';
     $ret .= dossier::hidden();
     $ret .= $new->form();
     $ret .= $wSa;
     $ret .= HtmlInput::submit("submit", _("Enregistre"));
Пример #2
0
 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();
 }