Example #1
0
     $ret .= dossier::hidden();
     $ret .= $po->form();
     $ret .= HtmlInput::hidden('sa', 'po_update');
     $ret .= HtmlInput::submit('Correction', 'Correction');
     $ret .= sprintf('<input type="button" class="smallbutton" value="Efface" onClick="return confirm_box(\'anchor_del\',\' Voulez-vous vraiment effacer cette activité\',' . 'function () { window.location=\'do.php?ac=' . $_REQUEST['ac'] . '&sa=po_delete&po_id=%s&pa_id=%s&' . $str_dossier . '\'}) ;"', $po->id, $_REQUEST['pa_id']);
     $ret .= '</form>';
     $ret .= '</div>';
     $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();
 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();
 }