# HG changeset patch # User viric@vicerveza # Date 1147988823 -7200 # Node ID c270c8b5ddea95421708bd8eefd4f62d8edb4f57 Initial release. Usable. diff -r 000000000000 -r c270c8b5ddea .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,1 @@ +\.mo$ diff -r 000000000000 -r c270c8b5ddea classes.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classes.inc Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,292 @@ +hora, $this->minut, 0, $this->mes, $this->dia, + $this->any); +} + +function setData($data) +{ + $this->dia = date('d',$data); + $this->mes = date('m',$data); + $this->any = date('Y',$data); + $this->hora = date('H',$data); + $this->minut = date('i',$data); +} + +function DBAfegir($connexio) +{ + $query = "INSERT INTO ingressos + (data,data_modif,rao,quantitat, + butxaca,comentari) + VALUES("; + $query .= "FROM_UNIXTIME(" . mktime($this->hora, + $this->minut, + 0, + $this->mes, + $this->dia, + $this->any) . "), "; + $query .= "FROM_UNIXTIME(". time() . "), "; + $query .= "'" . strtosql( $this->rao) . "', "; + if($this->tipus == "ingres") + $query .= $this->diners . ", "; + else + $query .= "-". $this->diners . ", "; + $query .= $this->butxaca . ", "; + $query .= "'" . strtosql( $this->comentari) . "'); "; + + + $resultat = mysql_query($query, $connexio); + + if (!$resultat) + { + echo mysql_errno().": ".mysql_error()."
"; + return 1; + } + + return 0; +} + +function DBModificar($connexio, $data_vella) +{ + $query = "UPDATE ingressos SET "; + $query .= "data=FROM_UNIXTIME(" . $this->data() . "), "; + $query .= "data_modif=FROM_UNIXTIME(". time() . "), "; + $query .= "rao='" . strtosql( $this->rao) . "', "; + $query .= "quantitat="; + if($this->tipus == "ingres") + $query .= $this->diners . ", "; + else + $query .= "-". $this->diners . ", "; + $query .= "butxaca=" . $this->butxaca . ", "; + $query .= "comentari='" . strtosql( $this->comentari) . "' "; + $query .= "WHERE data=FROM_UNIXTIME(" . $data_vella . ");"; + + + $resultat = mysql_query($query, $connexio); + + if (!$resultat) + { + echo mysql_errno().": ".mysql_error()."
"; + return 1; + } + + return 0; +} + +function DBBorrar($connexio) +{ + $query = "DELETE FROM ingressos WHERE UNIX_TIMESTAMP(data) = "; + $query .= $this->data() . ";"; + + $resultat = mysql_query($query,$connexio); + if (!$resultat) + { + echo mysql_errno().": ".mysql_error()."
"; + return 1; + } + return 0; + +} + +function ingres($connexio=-1, $data=0) +{ + // De nul + if ($connexio==-1) + { + $this->dia = date('d'); + $this->mes = date('m'); + $this->any = date('Y'); + $this->hora = date('H'); + $this->minut = date('i'); + $this->rao = ""; + $this->butxaca = -1; + $this->tipus = "despesa"; + $this->diners = 0; + $this->comentari = ""; + } + else + { + $query = "SELECT UNIX_TIMESTAMP(data), + UNIX_TIMESTAMP(data_modif), rao, butxaca, quantitat, + comentari FROM ingressos WHERE UNIX_TIMESTAMP(data) = "; + $query .= $data . ";"; + + $resultat = mysql_query($query,$connexio); + if (!$resultat) + { + echo mysql_errno().": ".mysql_error()."
"; + return 1; // Què passa amb un return aquí? + } + + // Només hi haurà un resultat + $fila = mysql_fetch_row($resultat); + + settype($fila[4], float); + + $this->dia = date('d',$fila[0]); + $this->mes = date('m',$fila[0]); + $this->any = date('Y',$fila[0]); + $this->hora = date('H',$fila[0]); + $this->minut = date('i',$fila[0]); + $this->modificat = $fila[1]; + $this->rao = $fila[2]; + $this->butxaca = $fila[3]; + if ($fila[4] > 0) + $this->tipus = "ingres"; + else + $this->tipus = "despesa"; + $this->diners = abs($fila[4]); + $this->comentari = $fila[5]; + + } +} + +} + +class moviment +{ +var $dia; +var $mes; +var $any; +var $hora; +var $minut; +var $modificat; // Timestamp +var $rao; +var $butxaca_origen; +var $butxaca_desti; +var $diners; +var $comentari; + + +function data() +{ + return mktime($this->hora, $this->minut, 0, $this->mes, $this->dia, + $this->any); +} +function setData($data) +{ + $this->dia = date('d',$data); + $this->mes = date('m',$data); + $this->any = date('Y',$data); + $this->hora = date('H',$data); + $this->minut = date('i',$data); +} + +function DBAfegir($connexio) +{ + $query = "INSERT INTO moviments + (data,data_modif,rao,quantitat, + butxaca_origen,butxaca_desti,comentari) + VALUES("; + $query .= "FROM_UNIXTIME(" . $this->data() . "), "; + $query .= "FROM_UNIXTIME(". time() . "), "; + $query .= "'" . strtosql( $this->rao) . "', "; + $query .= $this->diners . ", "; + $query .= $this->butxaca_origen . ", "; + $query .= $this->butxaca_desti . ", "; + $query .= "'" . strtosql( $this->comentari) . "'); "; + + + $resultat = mysql_query($query, $connexio); + + if (!$resultat) + { + echo mysql_errno().": ".mysql_error()."
"; + return 1; + } + + return 0; +} + +function DBBorrar($connexio) +{ + $query = "DELETE FROM moviments WHERE UNIX_TIMESTAMP(data) = "; + $query .= mktime($this->hora, + $this->minut, + 0, + $this->mes, + $this->dia, + $this->any) . ";"; + + $resultat = mysql_query($query,$connexio); + if (!$resultat) + { + echo mysql_errno().": ".mysql_error()."
"; + return 1; + } + return 0; + +} + +function moviment($connexio=-1, $data=0) +{ + // De nul + if ($connexio==-1) + { + $this->dia = date('d'); + $this->mes = date('m'); + $this->any = date('Y'); + $this->hora = date('H'); + $this->minut = date('i'); + $this->rao = ""; + $this->butxaca_origen = -1; + $this->butxaca_desti = -1; + $this->diners = 0; + $this->comentari = ""; + } + else + { + $query = "SELECT UNIX_TIMESTAMP(data), + UNIX_TIMESTAMP(data_modif), rao, butxaca_origen, butxaca_desti, + quantitat, + comentari FROM moviments WHERE UNIX_TIMESTAMP(data) = "; + $query .= $data . ";"; + + $resultat = mysql_query($query,$connexio); + if (!$resultat) + { + echo mysql_errno().": ".mysql_error()."
"; + return 1; // Què passa amb un return aquí? + } + + // Només hi haurà un resultat + $fila = mysql_fetch_row($resultat); + + settype($fila[4], float); + + $this->dia = date('d',$fila[0]); + $this->mes = date('m',$fila[0]); + $this->any = date('Y',$fila[0]); + $this->hora = date('H',$fila[0]); + $this->minut = date('i',$fila[0]); + $this->modificat = $fila[1]; + $this->rao = $fila[2]; + $this->butxaca_origen = $fila[3]; + $this->butxaca_desti = $fila[4]; + $this->diners = abs($fila[5]); + $this->comentari = $fila[6]; + + } +} + +} + +?> diff -r 000000000000 -r c270c8b5ddea db-config.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db-config.inc Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,6 @@ + diff -r 000000000000 -r c270c8b5ddea db.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/db.sql Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,44 @@ +-- use prova_pis; +drop table if exists moviments ; +drop table if exists ingressos ; +drop table if exists butxaques ; + +CREATE TABLE butxaques ( + id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, + nom VARCHAR(50) NOT NULL, + principal BOOL, + + PRIMARY KEY (id) + ) TYPE = InnoDB; + +-- ingressos i despeses +CREATE TABLE ingressos ( + data TIMESTAMP NOT NULL, + data_modif TIMESTAMP NOT NULL, + rao TINYTEXT NULL, + quantitat DECIMAL(18,10) SIGNED NOT NULL, + butxaca MEDIUMINT UNSIGNED NOT NULL, + comentari TEXT, + + PRIMARY KEY (data), + INDEX (butxaca), + FOREIGN KEY (butxaca) REFERENCES butxaques (id) + ) TYPE = InnoDB; + +-- moviments de diners entre butxaques +CREATE TABLE moviments ( + data TIMESTAMP NOT NULL, + data_modif TIMESTAMP NOT NULL, + rao TINYTEXT NOT NULL, + quantitat DECIMAL(18,10) SIGNED NOT NULL, + comentari TEXT, + butxaca_origen MEDIUMINT UNSIGNED NOT NULL, + butxaca_desti MEDIUMINT UNSIGNED NOT NULL, + + PRIMARY KEY (data), + INDEX (butxaca_origen), + INDEX (butxaca_desti), + FOREIGN KEY (butxaca_origen) REFERENCES butxaques (id), + FOREIGN KEY (butxaca_desti) REFERENCES butxaques (id) + ) TYPE = InnoDB; + diff -r 000000000000 -r c270c8b5ddea getdb.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/getdb.inc Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,55 @@ + +

ERROR: Error al obtenir + gent!

+"; + } + + while ($fila = mysql_fetch_row($resultat)) + $butxaques[$fila[0]] = $fila[1]; + return $butxaques; + } + + // FUNCIONS PER GENERAR CODI HTML + + function select_butxaques($variable, $default=-1) + { + global $butxaques; + + echo ""; + } + + function strforquotes($cadena) + { + $new= ereg_replace("\"", ""es;", $cadena); + + return $new; + } + + function strfromquotes($cadena) + { + $new= ereg_replace(""es;", "\"", $cadena); + + return $new; + } + +?> diff -r 000000000000 -r c270c8b5ddea index.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/index.php Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,49 @@ + + + + +<?php echo _("Control de butxaques") . " - " . _("Nou ingrés/despesa");?> + + + + +" . _("Control de butxaques") . "\n"; +echo "\n"; +?> +
+ + + + + +
+ + +
+ + +
+ + +
+
+
+ + + + diff -r 000000000000 -r c270c8b5ddea llista-butxaques.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/llista-butxaques.php Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,39 @@ + + + + +<?php echo _("Control de butxaques")." - ". + _("Llista de butxaques");?> + + + + + +" . _("Control de butxaques") . "\n"; +echo "

" . _("Llista de butxaques") . "

\n"; + + include("getdb.inc"); + include("llistes.inc"); + + // Fem la connexió + $connexio = mysql_connect($mysql_server, $mysql_user, + $mysql_password); + mysql_select_db($mysql_db, $connexio); + + llistes::LlistaButxaques($connexio); + +?> + + +

+ + + diff -r 000000000000 -r c270c8b5ddea llista-ingressos.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/llista-ingressos.php Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,42 @@ + + + + +<?php echo _("Control de butxaques")." - ". + _("Llista d'ingressos/despeses");?> + + + + + +" . _("Control de butxaques") . "\n"; +echo "

" . _("Llista d'ingressos/despeses") . "

\n"; + + include("getdb.inc"); + include("llistes.inc"); + + // Fem la connexió + $connexio = mysql_connect($mysql_server, $mysql_user, + $mysql_password); + mysql_select_db($mysql_db, $connexio); + + if (isset($_GET["ordre"])) + llistes::LlistaIngressos($connexio, $_GET["ordre"]); + else + llistes::LlistaIngressos($connexio); + +?> + + +

+ + + diff -r 000000000000 -r c270c8b5ddea llista-moviments.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/llista-moviments.php Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,42 @@ + + + + +<?php echo _("Control de butxaques")." - ". + _("Llista de moviments");?> + + + + + +" . _("Control de butxaques") . "\n"; +echo "

" . _("Llista de moviments") . "

\n"; + + include("getdb.inc"); + include("llistes.inc"); + + // Fem la connexió + $connexio = mysql_connect($mysql_server, $mysql_user, + $mysql_password); + mysql_select_db($mysql_db, $connexio); + + if (isset($_GET["ordre"])) + llistes::LlistaMoviments($connexio, $_GET["ordre"]); + else + llistes::LlistaMoviments($connexio); + +?> + + +

+ + + diff -r 000000000000 -r c270c8b5ddea llistes.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/llistes.inc Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,236 @@ + + + +
+ +\n"; + echo "\t" . $i . "\n"; + echo "\t" . strtohtml($butxaques[$i]) . "\n"; + } + + +?> + +
+ + + + \n"; + echo "\t
+ + + + + +"; + return 1; + } + + while ($fila = mysql_fetch_row($resultat)) + { + echo "
" . date("d/m/Y H:i",$fila[0]) . + "\n"; + echo "\t". date("d/m/Y H:i",$fila[1]) ."\n"; + echo "\t" . strtohtml($butxaques[$fila[2]]) . "\n"; + echo "\t" . strtohtml($butxaques[$fila[3]]) . "\n"; + echo "\t" . sprintf("%.2f", $fila[4]) . "\n"; + echo "\t" . strtohtml($fila[5]) . "\n"; + } + + +?> + +
+ + + + \n"; + echo "\t
+ + + + +"; + return 1; + } + + while ($fila = mysql_fetch_row($resultat)) + { + echo "
" . date("d/m/Y H:i",$fila[0]) . + "\n"; + echo "\t". date("d/m/Y H:i",$fila[1]) ."\n"; + echo "\t" . strtohtml($butxaques[$fila[2]]) . "\n"; + echo "\t" . pricetohtml( $fila[3]) . "\n"; + echo "\t" . strtohtml($fila[4]) . "\n"; + "\n"; + } + + +?> + +
+ + + + \n"; + echo "
+ + + + + +"; + echo "" . $butxaques[$i]. "\n"; + + // Ingressos + $query ="SELECT SUM(quantitat) FROM ingressos WHERE + butxaca =" . $i. " AND quantitat > 0;"; + $resultat = mysql_query($query, $connexio); + + if (!$resultat) + { + echo mysql_errno().": ".mysql_error()."
"; + return 1; + } + + $fila = mysql_fetch_row($resultat); + $ingressos = $fila[0]; + echo "
" . pricetohtml($fila[0]). "\n"; + + // Despeses + $query ="SELECT SUM(quantitat) FROM ingressos WHERE + butxaca =" . $i. " AND quantitat < 0;"; + $resultat = mysql_query($query, $connexio); + + if (!$resultat) + { + echo mysql_errno().": ".mysql_error()."
"; + return 1; + } + + $fila = mysql_fetch_row($resultat); + echo "
" . pricetohtml($fila[0]). "\n"; + $ingressos = $ingressos + $fila[0]; + + // Moviments negatius + $query ="SELECT SUM(quantitat) FROM moviments WHERE + butxaca_origen =" . $i. ";"; + $resultat = mysql_query($query, $connexio); + + if (!$resultat) + { + echo mysql_errno().": ".mysql_error()."
"; + return 1; + } + + $fila = mysql_fetch_row($resultat); + echo "
" . pricetohtml(-$fila[0]). "\n"; + $ingressos = $ingressos - $fila[0]; + + // Moviments positius + $query ="SELECT SUM(quantitat) FROM moviments WHERE + butxaca_desti =" . $i. ";"; + $resultat = mysql_query($query, $connexio); + + if (!$resultat) + { + echo mysql_errno().": ".mysql_error()."
"; + return 1; + } + + $fila = mysql_fetch_row($resultat); + echo "
" . pricetohtml($fila[0]). "\n"; + $ingressos = $ingressos + $fila[0]; + + echo "" . pricetohtml($ingressos) . "\n"; + $total = $total + $ingressos; + } + + echo "
". _("Total"). "" . pricetohtml($total). + "\n"; + + +?> + +
+ diff -r 000000000000 -r c270c8b5ddea locale/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locale/Makefile Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,3 @@ +SOURCE=../index.php ../llista-butxaques.php ../llista-ingressos.php ../llista-moviments.php ../llistes.inc ../strings.inc ../classes.inc ../status-butxaques.php ../update-butxaca.php ../update-ingres.php ../update-moviment.php +butxaques.po: $(SOURCE) + xgettext -L PHP --from-code utf-8 -o butxaques.po $(SOURCE) diff -r 000000000000 -r c270c8b5ddea locale/butxaques.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locale/butxaques.po Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,268 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-28 12:49+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../index.php:12 ../index.php:18 ../llista-butxaques.php:12 +#: ../llista-butxaques.php:20 ../llista-ingressos.php:12 +#: ../llista-ingressos.php:20 ../llista-moviments.php:12 +#: ../llista-moviments.php:20 ../status-butxaques.php:12 +#: ../status-butxaques.php:20 ../update-butxaca.php:12 +#: ../update-butxaca.php:19 ../update-ingres.php:12 ../update-ingres.php:19 +#: ../update-moviment.php:12 ../update-moviment.php:19 +msgid "Control de butxaques" +msgstr "" + +#: ../index.php:12 ../index.php:19 ../update-ingres.php:12 +#: ../update-ingres.php:37 +msgid "Nou ingrés/despesa" +msgstr "" + +#: ../index.php:24 +msgid "Ingressos/Despeses" +msgstr "" + +#: ../index.php:25 +msgid "Moviments entre butxaques" +msgstr "" + +#: ../index.php:26 +msgid "Butxaques" +msgstr "" + +#: ../index.php:29 +msgid "Nou Ingrés/Despesa" +msgstr "" + +#: ../index.php:31 +msgid "Nou Moviment" +msgstr "" + +#: ../index.php:33 +msgid "Nova Butxaca" +msgstr "" + +#: ../index.php:36 +msgid "Llista d'Ingressos/Despeses" +msgstr "" + +#: ../index.php:38 +msgid "Llista de Moviments" +msgstr "" + +#: ../index.php:40 +msgid "Llista de Butxaques" +msgstr "" + +#: ../index.php:43 ../status-butxaques.php:13 ../status-butxaques.php:21 +msgid "Estat de les butxaques" +msgstr "" + +#: ../llista-butxaques.php:13 ../llista-butxaques.php:21 +msgid "Llista de butxaques" +msgstr "" + +#: ../llista-butxaques.php:36 ../llista-ingressos.php:39 +#: ../llista-moviments.php:39 ../status-butxaques.php:36 +#: ../update-butxaca.php:70 ../update-ingres.php:187 +#: ../update-moviment.php:176 +msgid "Tornar al menú principal" +msgstr "" + +#: ../llista-ingressos.php:13 ../llista-ingressos.php:21 +msgid "Llista d'ingressos/despeses" +msgstr "" + +#: ../llista-moviments.php:13 ../llista-moviments.php:21 +msgid "Llista de moviments" +msgstr "" + +#: ../llistes.inc:13 +msgid "ID" +msgstr "" + +#: ../llistes.inc:14 +msgid "Nom" +msgstr "" + +#: ../llistes.inc:39 ../llistes.inc:93 ../update-ingres.php:51 +#: ../update-moviment.php:51 +msgid "Data" +msgstr "" + +#: ../llistes.inc:40 ../llistes.inc:94 +msgid "Modificat" +msgstr "" + +#: ../llistes.inc:41 +msgid "Orígen" +msgstr "" + +#: ../llistes.inc:42 +msgid "Destí" +msgstr "" + +#: ../llistes.inc:43 ../llistes.inc:96 ../update-ingres.php:102 +#: ../update-moviment.php:91 +msgid "Diners" +msgstr "" + +#: ../llistes.inc:44 ../llistes.inc:97 ../update-ingres.php:106 +#: ../update-moviment.php:95 +msgid "Raó" +msgstr "" + +#: ../llistes.inc:95 ../llistes.inc:143 ../update-ingres.php:86 +msgid "Butxaca" +msgstr "" + +#: ../llistes.inc:144 +msgid "Ingressos" +msgstr "" + +#: ../llistes.inc:145 +msgid "Despeses" +msgstr "" + +#: ../llistes.inc:146 +msgid "Moviments negatius" +msgstr "" + +#: ../llistes.inc:147 +msgid "Moviments positius" +msgstr "" + +#: ../llistes.inc:148 ../llistes.inc:224 +msgid "Total" +msgstr "" + +#: ../update-butxaca.php:12 ../update-butxaca.php:20 +msgid "Nova butxaca" +msgstr "" + +#: ../update-butxaca.php:31 +msgid "Nom de la butxaca" +msgstr "" + +#: ../update-butxaca.php:35 +msgid "Afegir butxaca" +msgstr "" + +#: ../update-butxaca.php:36 ../update-ingres.php:130 +#: ../update-moviment.php:119 +msgid "Ressetejar formulari" +msgstr "" + +#: ../update-butxaca.php:60 +msgid "ERROR: Error al actualitzar" +msgstr "" + +#: ../update-butxaca.php:61 +#, php-format +msgid "les dades a %s!" +msgstr "" + +#: ../update-butxaca.php:66 +msgid "

Inserció efectuada correctament.

" +msgstr "" + +#: ../update-ingres.php:41 +msgid "Modificar ingrés/despesa" +msgstr "" + +#: ../update-ingres.php:46 +msgid "Dades de l'ingrés/despesa" +msgstr "" + +#: ../update-ingres.php:63 ../update-moviment.php:63 +msgid "Hora" +msgstr "" + +#: ../update-ingres.php:80 ../update-moviment.php:79 +msgid "Data de la última modificació" +msgstr "" + +#: ../update-ingres.php:90 +msgid "Ingrés o despesa" +msgstr "" + +#: ../update-ingres.php:94 +msgid "Ingrés" +msgstr "" + +#: ../update-ingres.php:100 +msgid "Despesa" +msgstr "" + +#: ../update-ingres.php:110 ../update-moviment.php:99 +msgid "Comentari" +msgstr "" + +#: ../update-ingres.php:120 ../update-moviment.php:109 +msgid "Modificar" +msgstr "" + +#: ../update-ingres.php:126 ../update-moviment.php:115 +msgid "Afegir" +msgstr "" + +#: ../update-ingres.php:150 ../update-moviment.php:139 +msgid "Inserció efectuada correctament" +msgstr "" + +#: ../update-ingres.php:152 ../update-moviment.php:141 +msgid "Error insertant." +msgstr "" + +#: ../update-ingres.php:170 ../update-moviment.php:161 +msgid "Modificació efectuada correctament" +msgstr "" + +#: ../update-ingres.php:172 ../update-moviment.php:163 +msgid "Error modificant." +msgstr "" + +#: ../update-ingres.php:180 ../update-moviment.php:169 +msgid "Entrada eliminada correctament" +msgstr "" + +#: ../update-ingres.php:182 ../update-moviment.php:171 +msgid "Error eliminant." +msgstr "" + +#: ../update-ingres.php:193 ../update-moviment.php:182 +msgid "[ELIMINAR]" +msgstr "" + +#: ../update-moviment.php:12 ../update-moviment.php:37 +msgid "Nou moviment" +msgstr "" + +#: ../update-moviment.php:41 +msgid "Modificar moviment" +msgstr "" + +#: ../update-moviment.php:46 +msgid "Dades del moviment" +msgstr "" + +#: ../update-moviment.php:85 +msgid "Butxaca origen" +msgstr "" + +#: ../update-moviment.php:88 +msgid "Butxaca destí" +msgstr "" diff -r 000000000000 -r c270c8b5ddea locale/ca/LC_MESSAGES/butxaques.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locale/ca/LC_MESSAGES/butxaques.po Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,24 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-27 11:56+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../prova.php:12 ../prova.php:16 +msgid "Control de butxaques" +msgstr "" + +#: ../prova.php:21 +msgid "Ingressos" +msgstr "" diff -r 000000000000 -r c270c8b5ddea locale/eo/LC_MESSAGES/butxaques.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locale/eo/LC_MESSAGES/butxaques.po Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,268 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: butxaques 0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2005-09-28 12:49+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Lluís Batlle \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../index.php:12 ../index.php:18 ../llista-butxaques.php:12 +#: ../llista-butxaques.php:20 ../llista-ingressos.php:12 +#: ../llista-ingressos.php:20 ../llista-moviments.php:12 +#: ../llista-moviments.php:20 ../status-butxaques.php:12 +#: ../status-butxaques.php:20 ../update-butxaca.php:12 +#: ../update-butxaca.php:19 ../update-ingres.php:12 ../update-ingres.php:19 +#: ../update-moviment.php:12 ../update-moviment.php:19 +msgid "Control de butxaques" +msgstr "Poŝkontrolo" + +#: ../index.php:12 ../index.php:19 ../update-ingres.php:12 +#: ../update-ingres.php:37 +msgid "Nou ingrés/despesa" +msgstr "Nova enspezo/elspezo" + +#: ../index.php:24 +msgid "Ingressos/Despeses" +msgstr "Enspezoj/Elspezoj" + +#: ../index.php:25 +msgid "Moviments entre butxaques" +msgstr "Movoj inter poŝoj" + +#: ../index.php:26 +msgid "Butxaques" +msgstr "Poŝoj" + +#: ../index.php:29 +msgid "Nou Ingrés/Despesa" +msgstr "Nova Enspezo/Elspezo" + + +#: ../index.php:31 +msgid "Nou Moviment" +msgstr "Nova Movo" + +#: ../index.php:33 +msgid "Nova Butxaca" +msgstr "Nova Poŝo" + +#: ../index.php:36 +msgid "Llista d'Ingressos/Despeses" +msgstr "Listo de Enspezoj/Elspezoj" + +#: ../index.php:38 +msgid "Llista de Moviments" +msgstr "Listo de Movoj" + +#: ../index.php:40 +msgid "Llista de Butxaques" +msgstr "Listo de Poŝoj" + +#: ../index.php:43 ../status-butxaques.php:13 ../status-butxaques.php:21 +msgid "Estat de les butxaques" +msgstr "Stato de la poŝoj" + +#: ../llista-butxaques.php:13 ../llista-butxaques.php:21 +msgid "Llista de butxaques" +msgstr "Listo de poŝoj" + +#: ../llista-butxaques.php:36 ../llista-ingressos.php:39 +#: ../llista-moviments.php:39 ../status-butxaques.php:36 +#: ../update-butxaca.php:70 ../update-ingres.php:187 +#: ../update-moviment.php:176 +msgid "Tornar al menú principal" +msgstr "Reiri al ĉefa menuo" + +#: ../llista-ingressos.php:13 ../llista-ingressos.php:21 +msgid "Llista d'ingressos/despeses" +msgstr "Listo de enspezoj/Elspezoj" + +#: ../llista-moviments.php:13 ../llista-moviments.php:21 +msgid "Llista de moviments" +msgstr "Listo de movoj" + +#: ../llistes.inc:13 +msgid "ID" +msgstr "ID" + +#: ../llistes.inc:14 +msgid "Nom" +msgstr "Nomo" + +#: ../llistes.inc:39 ../llistes.inc:93 ../update-ingres.php:51 +#: ../update-moviment.php:51 +msgid "Data" +msgstr "Dato" + +#: ../llistes.inc:40 ../llistes.inc:94 +msgid "Modificat" +msgstr "Modifita" + +#: ../llistes.inc:41 +msgid "Orígen" +msgstr "El" + +#: ../llistes.inc:42 +msgid "Al" +msgstr "" + +#: ../llistes.inc:43 ../llistes.inc:96 ../update-ingres.php:102 +#: ../update-moviment.php:91 +msgid "Diners" +msgstr "Mono" + +#: ../llistes.inc:44 ../llistes.inc:97 ../update-ingres.php:106 +#: ../update-moviment.php:95 +msgid "Raó" +msgstr "Kialo" + +#: ../llistes.inc:95 ../llistes.inc:143 ../update-ingres.php:86 +msgid "Butxaca" +msgstr "Poŝo" + +#: ../llistes.inc:144 +msgid "Ingressos" +msgstr "Enspezoj" + +#: ../llistes.inc:145 +msgid "Despeses" +msgstr "Elspezoj" + +#: ../llistes.inc:146 +msgid "Moviments negatius" +msgstr "Negativaj movoj" + +#: ../llistes.inc:147 +msgid "Moviments positius" +msgstr "Pozitivaj movoj" + +#: ../llistes.inc:148 ../llistes.inc:224 +msgid "Total" +msgstr "Ĉiome" + +#: ../update-butxaca.php:12 ../update-butxaca.php:20 +msgid "Nova butxaca" +msgstr "Nova poŝo" + +#: ../update-butxaca.php:31 +msgid "Nom de la butxaca" +msgstr "Nomo de la poŝo" + +#: ../update-butxaca.php:35 +msgid "Afegir butxaca" +msgstr "Aldoni poŝon" + +#: ../update-butxaca.php:36 ../update-ingres.php:130 +#: ../update-moviment.php:119 +msgid "Ressetejar formulari" +msgstr "Vakuigi la enketon" + +#: ../update-butxaca.php:60 +msgid "ERROR: Error al actualitzar" +msgstr "" + +#: ../update-butxaca.php:61 +#, php-format +msgid "les dades a %s!" +msgstr "" + +#: ../update-butxaca.php:66 +msgid "

Inserció efectuada correctament.

" +msgstr "" + +#: ../update-ingres.php:41 +msgid "Modificar ingrés/despesa" +msgstr "" + +#: ../update-ingres.php:46 +msgid "Dades de l'ingrés/despesa" +msgstr "" + +#: ../update-ingres.php:63 ../update-moviment.php:63 +msgid "Hora" +msgstr "" + +#: ../update-ingres.php:80 ../update-moviment.php:79 +msgid "Data de la última modificació" +msgstr "" + +#: ../update-ingres.php:90 +msgid "Ingrés o despesa" +msgstr "" + +#: ../update-ingres.php:94 +msgid "Ingrés" +msgstr "" + +#: ../update-ingres.php:100 +msgid "Despesa" +msgstr "" + +#: ../update-ingres.php:110 ../update-moviment.php:99 +msgid "Comentari" +msgstr "" + +#: ../update-ingres.php:120 ../update-moviment.php:109 +msgid "Modificar" +msgstr "" + +#: ../update-ingres.php:126 ../update-moviment.php:115 +msgid "Afegir" +msgstr "" + +#: ../update-ingres.php:150 ../update-moviment.php:139 +msgid "Inserció efectuada correctament" +msgstr "" + +#: ../update-ingres.php:152 ../update-moviment.php:141 +msgid "Error insertant." +msgstr "" + +#: ../update-ingres.php:170 ../update-moviment.php:161 +msgid "Modificació efectuada correctament" +msgstr "" + +#: ../update-ingres.php:172 ../update-moviment.php:163 +msgid "Error modificant." +msgstr "" + +#: ../update-ingres.php:180 ../update-moviment.php:169 +msgid "Entrada eliminada correctament" +msgstr "" + +#: ../update-ingres.php:182 ../update-moviment.php:171 +msgid "Error eliminant." +msgstr "" + +#: ../update-ingres.php:193 ../update-moviment.php:182 +msgid "[ELIMINAR]" +msgstr "[FORIGI]" + +#: ../update-moviment.php:12 ../update-moviment.php:37 +msgid "Nou moviment" +msgstr "Nova movo" + +#: ../update-moviment.php:41 +msgid "Modificar moviment" +msgstr "" + +#: ../update-moviment.php:46 +msgid "Dades del moviment" +msgstr "" + +#: ../update-moviment.php:85 +msgid "Butxaca origen" +msgstr "" + +#: ../update-moviment.php:88 +msgid "Butxaca destí" +msgstr "" diff -r 000000000000 -r c270c8b5ddea readme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/readme.txt Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,21 @@ +Instruccions per a instal·lar-ho... + +Crees un usuari de mysql, que tingui accés a una base de dades. +Aquesta mateixa configuració l'escrius en un fitxer així, anomenat +db-config.inc: + + +(sense línies en blanc abans i després) + +Llavors, crees les taules així: +mysql -u usuari -p base_de_dades < db.sql + +i ja pots fer servir el programa. Primer crees una 'Butxaca'. I llavors ja va +tot. + +Apa! diff -r 000000000000 -r c270c8b5ddea status-butxaques.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/status-butxaques.php Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,39 @@ + + + + +<?php echo _("Control de butxaques")." - ". + _("Estat de les butxaques");?> + + + + + +" . _("Control de butxaques") . "\n"; +echo "

" . _("Estat de les butxaques") . "

\n"; + + include("getdb.inc"); + include("llistes.inc"); + + // Fem la connexió + $connexio = mysql_connect($mysql_server, $mysql_user, + $mysql_password); + mysql_select_db($mysql_db, $connexio); + + llistes::StatusButxaques($connexio); + +?> + + +

+ + + diff -r 000000000000 -r c270c8b5ddea strings.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/strings.inc Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,24 @@ +]", ">'", $cadena); + $new= ereg_replace("[&]", "&'", $cadena); + + return $new; +} + +function strtosql($cadena) +{ + return ereg_replace("'", "'", $cadena); +} + +function pricetohtml($price) +{ + if ($price < 0) + return sprintf("%.2f", $price); + else + return sprintf("%.2f", $price); + +} +?> diff -r 000000000000 -r c270c8b5ddea update-butxaca.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/update-butxaca.php Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,73 @@ + + + + +<?php echo _("Control de butxaques")." - "._("Nova butxaca");?> + + + + + +" . _("Control de butxaques") . "\n"; +echo "

" . _("Nova butxaca") . "

\n"; + +include ("./strings.inc"); + +if (!isset($_POST["afegir"])) +{ +?> + +
+ + +
+ +
+
+" name=afegir> +"> +
+
+"; + echo sprintf(_("ERROR: Error al actualitzar" . + "les dades a %s!"), "butxaques"); + echo "

"; + echo mysql_errno().": ".mysql_error()."
"; + } + else + echo _("

Inserció efectuada correctament.

"); +} +?> + +

+ + + diff -r 000000000000 -r c270c8b5ddea update-ingres.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/update-ingres.php Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,209 @@ + + + + +<?php echo _("Control de butxaques")." - "._("Nou ingrés/despesa");?> + + + + + +" . _("Control de butxaques") . "\n"; + +include("./getdb.inc"); +include("./classes.inc"); + +// Fem la connexió +$connexio = mysql_connect($mysql_server, $mysql_user, +$mysql_password); +mysql_select_db($mysql_db, $connexio); + +$butxaques = obtenir_butxaques($connexio); + +if (!isset($_POST["afegir"]) && !isset($_GET["eliminar"]) && + !isset($_POST["modificar"])) +{ + if (!isset($_GET["id"])) + { + $formulari = new ingres(); + echo "

" . _("Nou ingrés/despesa") . "

\n"; + } + else + { + echo "

" . _("Modificar ingrés/despesa") . "

\n"; + $formulari = new ingres($connexio, $_GET["id"]); + } +?> + +

+ +
+ + + +\n"; + echo " + + + + + +
+ + + + +
+ + + + +data(). "\">"; + echo "
". _("Data de la última modificació"). "\n"; + echo "" . date("d/m/Y H:i", $formulari->modificat) . "\n"; + } +?> + +
+ butxaca);?> + +
+ tipus == "ingres") + echo "checked"; ?>> +
+ tipus != "ingres") + echo "checked"; ?>> +
+ +
+ +
+ +
+
+"; + } + else + { + echo ""; + } +?> +"> +
+ +dia = $_POST[dia]; + $formulari->mes = $_POST[mes]; + $formulari->any = $_POST[any]; + $formulari->hora = $_POST[hora]; + $formulari->minut = $_POST[minut]; + $formulari->rao = $_POST[rao]; + $formulari->comentari = $_POST[comentari]; + $formulari->tipus = $_POST[tipus]; + $formulari->diners = $_POST[diners]; + $formulari->butxaca = $_POST[butxaca]; + + if ($formulari->diners == 0) + { + echo "

". _("Error: La quantitat de diners ha de ser diferent de zero.") . "

"; + } + else + if($formulari->DBAfegir($connexio) == 0) + echo "

". _("Inserció efectuada correctament") . "

"; + else + echo "

". _("Error insertant.") . "

"; +} +elseif (isset($_POST["modificar"])) +{ + + $formulari = new ingres($connexio, $_POST["data_vella"]); + $formulari->dia = $_POST[dia]; + $formulari->mes = $_POST[mes]; + $formulari->any = $_POST[any]; + $formulari->hora = $_POST[hora]; + $formulari->minut = $_POST[minut]; + $formulari->rao = $_POST[rao]; + $formulari->comentari = $_POST[comentari]; + $formulari->diners = $_POST[diners]; + $formulari->tipus = $_POST[tipus]; + $formulari->butxaca = $_POST[butxaca]; + + if ($formulari->diners == 0) + { + echo "

". _("Error: La quantitat de diners ha de ser diferent de zero.") . "

"; + } + else + if($formulari->DBModificar($connexio,$_POST["data_vella"]) == 0) + echo "

". _("Modificació efectuada correctament") . "

"; + else + echo "

". _("Error modificant.") . "

"; + + +} +elseif (isset($_GET["eliminar"])) // if eliminar, borrem +{ + $formulari = new ingres($connexio, $_GET["id"]); + if ($formulari->DBBorrar($connexio) == 0) + echo "

". _("Entrada eliminada correctament") . "

"; + else + echo "

". _("Error eliminant.") . "

"; +} +mysql_close($connexio); +?> + +

+data(). "\">"; + echo _("[ELIMINAR]"); + echo "

"; + } +?> + + + diff -r 000000000000 -r c270c8b5ddea update-moviment.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/update-moviment.php Thu May 18 23:47:03 2006 +0200 @@ -0,0 +1,198 @@ + + + + +<?php echo _("Control de butxaques")." - "._("Nou moviment");?> + + + + + +" . _("Control de butxaques") . "\n"; + +include("./getdb.inc"); +include("./classes.inc"); + +// Fem la connexió +$connexio = mysql_connect($mysql_server, $mysql_user, +$mysql_password); +mysql_select_db($mysql_db, $connexio); + +$butxaques = obtenir_butxaques($connexio); + +if (!isset($_POST["afegir"]) && !isset($_GET["eliminar"]) && + !isset($_POST["modificar"])) +{ + if (!isset($_GET["id"])) + { + $formulari = new moviment(); + echo "

" . _("Nou moviment") . "

\n"; + } + else + { + echo "

" . _("Modificar moviment") . "

\n"; + $formulari = new moviment($connexio, $_GET["id"]); + } +?> + +

+ + + + + +\n"; + echo " + + + + +
+ + + + +
+ + + +data(). "\">"; + echo "
". _("Data de la última modificació"). "\n"; + echo "" . date("d/m/Y H:i", $formulari->modificat) . "\n"; + } +?> + +
+ butxaca_origen);?> +
+ butxaca_desti);?> +
+ +
+ +
+ +
+
+"; + } + else + { + echo ""; + } +?> +"> +
+ +dia = $_POST[dia]; + $formulari->mes = $_POST[mes]; + $formulari->any = $_POST[any]; + $formulari->hora = $_POST[hora]; + $formulari->minut = $_POST[minut]; + $formulari->rao = $_POST[rao]; + $formulari->comentari = $_POST[comentari]; + $formulari->diners = $_POST[diners]; + $formulari->butxaca_origen = $_POST[butxaca_origen]; + $formulari->butxaca_desti = $_POST[butxaca_desti]; + + if ($formulari->diners == 0) + { + echo "

". _("Error: La quantitat de diners ha de ser diferent de zero.") . "

"; + } + else + if ($formulari->butxaca_origen == $formulari->butxaca_desti) + { + echo "

". _("Error: Les butxaques orígen i destí han de ser diferents.") . "

"; + } + else + if($formulari->DBAfegir($connexio) == 0) + echo "

". _("Inserció efectuada correctament") . "

"; + else + echo "

". _("Error insertant.") . "

"; + + +} +elseif (isset($_POST["modificar"])) +{ + + $formulari = new moviment($connexio, $_POST["data_vella"]); + $formulari->dia = $_POST[dia]; + $formulari->mes = $_POST[mes]; + $formulari->any = $_POST[any]; + $formulari->hora = $_POST[hora]; + $formulari->minut = $_POST[minut]; + $formulari->rao = $_POST[rao]; + $formulari->comentari = $_POST[comentari]; + $formulari->diners = $_POST[diners]; + $formulari->butxaca_origen = $_POST[butxaca_origen]; + $formulari->butxaca_desti = $_POST[butxaca_desti]; + + if($formulari->DBModificar($connexio,$_POST["data_vella"]) == 0) + echo "

". _("Modificació efectuada correctament") . "

"; + else + echo "

". _("Error modificant.") . "

"; +} +elseif (isset($_GET["eliminar"])) // if eliminar, borrem +{ + $formulari = new moviment($connexio, $_GET["id"]); + if ($formulari->DBBorrar($connexio) == 0) + echo "

". _("Entrada eliminada correctament") . "

"; + else + echo "

". _("Error eliminant.") . "

"; +} +mysql_close($connexio); +?> + +

+data(). "\">"; + echo _("[ELIMINAR]"); + echo "

"; + } +?> + + +