[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r409 - in trunk/rapport_avance/include: . template
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r409 - in trunk/rapport_avance/include: . template |
Date: |
Sat, 22 Sep 2012 03:32:18 +0200 (CEST) |
Author: danydb
Date: 2012-09-22 03:32:17 +0200 (Sat, 22 Sep 2012)
New Revision: 409
Modified:
trunk/rapport_avance/include/class_rapav_formulaire.php
trunk/rapport_avance/include/formulaire.inc.php
trunk/rapport_avance/include/template/formulaire_listing.php
Log:
Add new form : definition + param
Modified: trunk/rapport_avance/include/class_rapav_formulaire.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_formulaire.php 2012-09-22
00:51:52 UTC (rev 408)
+++ trunk/rapport_avance/include/class_rapav_formulaire.php 2012-09-22
01:32:17 UTC (rev 409)
@@ -56,7 +56,7 @@
function load_definition()
{
$f = new Formulaire_Param_Sql();
- $ret = $f->seek(" order by p_order ");
+ $ret = $f->seek(" where f_id=".sql_string($this->f_id) ." order
by p_order ");
$max = Database::num_row($ret);
for ($i = 0; $i < $max; $i++)
@@ -143,6 +143,7 @@
$form_param->p_type = $p_array['p_type'][$i];
$form_param->p_order = $p_array['p_order'][$i];
$form_param->t_id = $p_array['t_id'][$i];
+ $form_param->f_id = $p_array['f_id'];
// update or insert the row
if ($p_array['p_id'][$i] == -1)
$form_param->insert();
Modified: trunk/rapport_avance/include/formulaire.inc.php
===================================================================
--- trunk/rapport_avance/include/formulaire.inc.php 2012-09-22 00:51:52 UTC
(rev 408)
+++ trunk/rapport_avance/include/formulaire.inc.php 2012-09-22 01:32:17 UTC
(rev 409)
@@ -36,6 +36,13 @@
{
RAPAV_Formulaire::save_parameter($_POST);
}
+if (isset ($_POST['add_form']))
+{
+ $form= new RAPAV_Formulaire();
+ $form->f_title=trim($_POST['titre']);
+ $form->f_description=trim($_POST['description']);
+ $form->insert();
+}
RAPAV_formulaire::listing();
-var_dump($_POST);
+
?>
Modified: trunk/rapport_avance/include/template/formulaire_listing.php
===================================================================
--- trunk/rapport_avance/include/template/formulaire_listing.php
2012-09-22 00:51:52 UTC (rev 408)
+++ trunk/rapport_avance/include/template/formulaire_listing.php
2012-09-22 01:32:17 UTC (rev 409)
@@ -55,7 +55,21 @@
<? endfor; ?>
</table>
+ <?
+ echo HtmlInput::button("add_form_bt","Ajout d'un
formulaire",'onclick="$(\'add_form_div\').show();$(\'add_form_bt\').hide()"');
+echo '<div id="add_form_div" style="display:none">';
+echo '<form method="POST">';
+$name=new IText("titre");
+$description=new IText("description");
+echo '<table>';
+echo tr(td("Titre : ").td($name->input()));
+echo tr(td('Description').td($description->input()));
+echo '</table>';
+echo HtmlInput::submit ("add_form","Sauver");
+echo '</form>';
+?>
</div>
+</div>
<div id="form_mod_div">
</div>
\ No newline at end of file
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r409 - in trunk/rapport_avance/include: . template,
phpcompta-dev <=