diff --git a/html/fiche.php b/html/fiche.php
index e3504280d..abf2aae54 100644
--- a/html/fiche.php
+++ b/html/fiche.php
@@ -18,9 +18,9 @@
*/
/* $Revision$ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
-/* $Revision$ */
-include_once ("ac_common.php");
+include_once ("ac_common.php");
+//phpinfo();
html_page_start($g_UserProperty['use_theme']);
if ( ! isset ( $g_dossier ) ) {
@@ -47,7 +47,10 @@ include_once("fiche_inc.php");
$l_Db=sprintf("dossier%d",$g_dossier);
$cn=DbConnect($l_Db);
+// Creation of a new model of card
+// in the database
if ( isset($_POST['add_modele']) ) {
+ // insert the model of card in database
AddModele($cn,$HTTP_POST_VARS);
}
@@ -66,25 +69,31 @@ if ( $g_UserProperty['use_admin'] == 0 ) {
ShowMenuComptaLeft($g_dossier,MENU_FICHE);
if ( isset ( $_GET["action"]) ) {
$action=$_GET["action"];
+ // View the details of the selected cat. of cards
if ( isset ($_GET["fiche"]) && $action=="vue" ) {
echo '
';
UpdateModele($cn,$_GET["fiche"],$search);
+ echo '';
}
+ // delete a card
if ($action== "delete" ) {
echo '
';
Remove($cn,$_GET["fiche_id"]);
@@ -93,43 +102,41 @@ if ( isset ( $_GET["action"]) ) {
echo "
";
}
}
-if (isset( $_POST["update_modele"] )) {
+// Add a line in the card model
+if ( isset ($_GET["add_ligne"] )) {
echo '
';
- SaveModele($cn,$HTTP_POST_VARS);
- echo '
';
-}
-
-if ( isset ($_POST["record_model"]) ){
- echo '
';
- if ( strlen(trim($_POST["nom_mod"])) == 0 ) {
- EncodeModele($search);
- }else {
- DefModele($search,$HTTP_POST_VARS);
- }
- echo '
';
-}
-if ( isset ($_POST["add_ligne"] )) {
- echo '
';
- DefModele($search,$HTTP_POST_VARS,$_POST["inc"]+1);
+ SaveModeleName($cn,$_GET["fd_id"],$_GET["label"]);
+ InsertModeleLine($cn,$_GET["fd_id"],$_GET["ad_id"]);
+ UpdateModele($cn,$_GET["fd_id"],$search);
+ echo '
';
+}
+// Change the name of the card model
+if ( isset ($_GET["change_name"] )) {
+ echo '
';
+ SaveModeleName($cn,$_GET["fd_id"],$_GET["label"]);
+ UpdateModele($cn,$_GET["fd_id"],$search);
echo '
';
}
+// Display a blank card from the selected category
if ( isset ($_POST["fiche"]) && isset ($_POST["add"]) ) {
echo '
';
EncodeFiche($cn,$_POST["fiche"]);
echo '
';
}
-
+// Add the data (attribute) of the card
if ( isset ($_POST["add_fiche"]) ) {
echo '
';
AddFiche($cn,$_POST["fiche"],$HTTP_POST_VARS);
ViewFiche($cn,$_POST["fiche"]);
echo '
';
}
+// Update a card
if ( isset ($_POST["update_fiche"])) {
echo '
';
$a=UpdateFiche($cn,$HTTP_POST_VARS);
- ViewFiche($cn,$_POST["f_fd_id"]);
+ $fd_id=GetFicheDef($cn,$_POST["f_id"]);
+ ViewFiche($cn,$fd_id);
echo '
';
}
diff --git a/html/jrn_add.php b/html/jrn_add.php
index b1b14239c..ed7d2c022 100644
--- a/html/jrn_add.php
+++ b/html/jrn_add.php
@@ -171,7 +171,7 @@ echo '';
// Get all the fiches
echo '
Fiches (profile user) |
';
-$Res=ExecSql($cn,"select fd_id,fd_label from fichedef order by fd_label");
+$Res=ExecSql($cn,"select fd_id,fd_label from fiche_def order by fd_label");
$num=pg_NumRows($Res);
diff --git a/html/jrn_detail.php b/html/jrn_detail.php
index 0ee9b2f5b..a932e1016 100644
--- a/html/jrn_detail.php
+++ b/html/jrn_detail.php
@@ -193,7 +193,7 @@ echo "
| Code | ".$l_line['jrn_def_code']." |
";
echo '';
// Get all the fiches
echo '
Fiches (profile user)
';
-$Res=ExecSql($cn,"select fd_id,fd_label from fichedef order by fd_label");
+$Res=ExecSql($cn,"select fd_id,fd_label from fiche_def order by fd_label");
$num=pg_NumRows($Res);
$rdeb=split(',',$l_line['jrn_def_fiche_deb']);