Continue work for user profile

This commit is contained in:
sparkyx 2003-11-30 13:19:28 +00:00
parent b92c637d0d
commit 41d34ad290
8 changed files with 221 additions and 56 deletions

View file

@ -24,7 +24,7 @@ include_once("debug.php");
include_once("constant.php");
function echo_error ($p_log) {
$fdebug=fopen("/tmp/wcompta_error.log","a+");
$fdebug=fopen("/tmp/phpcompta_error.log","a+");
if ( $fdebug != false ) {
fwrite($fdebug,date("Ymd H:i:s").$p_log."\n");
fclose($fdebug);
@ -138,7 +138,7 @@ $bg="";
</HEAD>";
echo "<BODY $bg class=\"defaut\" $p_script>";
}
/* function
/* function html_page_stop()
* Purpose :
*
* parm :
@ -152,7 +152,7 @@ function html_page_stop()
echo "</BODY>";
echo "</HTML>";
}
/* function
/* function html_button_logout
* Purpose :
*
* parm :
@ -165,7 +165,7 @@ function html_page_stop()
function html_button_logout() {
echo "<A class=\"mtitle\" HREF=logout.php> Logout </A>";
}
/* function
/* function NoAccess
* Purpose :
*
* parm :
@ -185,7 +185,7 @@ function NoAccess() {
exit -1;
}
/* function
/* function FormatString($p_string)
* Purpose :
*
* parm :
@ -207,21 +207,14 @@ function FormatString($p_string)
$p_string=str_replace("'","\'",$p_string);
return $p_string;
}
/* function
* Purpose :
/* function GetUserType
* Purpose : get the type of an user (compta,developper or user)
*
* parm :
* -
* - param $p_user user_login
* gen :
* -
* return:
*/
/* GetUserType
* purpose : get the type of an user (compta,developper or user)
* param $p_user user_login
* return : the type of the user
* - none
* return: the type of the user
*/
function GetUserType($p_user)
{
@ -242,8 +235,6 @@ function GetUserType($p_user)
* - none
* return: none
*/
function Redirect($p_profile,$php_session) {
include_once("debug.php");
echo_debug("Session is $php_session");
@ -287,5 +278,19 @@ function ShowItem($p_array,$p_dir='V')
$ret.="</TABLE>";
return $ret;
}
/* function echo_warning
* Purpose : warns
*
* parm :
* - string
* gen :
* - none
* return:
* - none
*/
function echo_warning($p_string)
{
echo '<H2 class="info">'.$p_string."</H2>";
}
?>

View file

@ -24,15 +24,25 @@
// securite correspond a la table
// action
// access aux journaux
define ("ENCJRN",1);
// création facture
define("FACT",2);
// création aux fiche
define ("FICHE",3);
// Impression
define ("IMP",4);
//formulaire
define("FORM",5);
// Modif du Plan Comptable
define ("MPCMN",6);
// Gestion des journaux
define ("GJRN",7);
// Gestion des paramètres globaux
define ("PARM",8);
// Gestion de la sécurité
define ("SECU",9);
// Access à la centralisation
define ("CENTRALIZE",10);
define ("VEN",11);
define ("BQE",12);

View file

@ -183,9 +183,9 @@ function ViewFiche($p_cn,$p_type) {
for ( $i = 0; $i < $Max; $i++) {
$l_line=pg_fetch_array($Res,$i);
$div="<DIV>";
$span_mod='<span class="mtitle"><A class="mtitle" href="fiche.php?action=detail&fiche_id='.$l_line['f_id'].'"> Modifie</A></SPAN>';
$span_mod='<span class="mtitle"><A class="mtitle2" href="fiche.php?action=detail&fiche_id='.$l_line['f_id'].'"> Modifie</A></SPAN>';
$span_del='<span class="mtitle2" ALIGN="left">'.
'<A class="mtitle" href="fiche.php?f_fd_id='.$p_type.'&action=delete&fiche_id='.$l_line['f_id'].
'<A class="mtitle2" href="fiche.php?f_fd_id='.$p_type.'&action=delete&fiche_id='.$l_line['f_id'].
'"> delete</A></SPAN>';
$span_id='<SPAN style="background-color:lightgrey;">'.$l_line['f_id']."</SPAN>";
if ( $i %2 == 0 )
@ -389,15 +389,16 @@ function DefModele ($p_js,$p_array=null,$p_ligne=1)
echo '<FORM>';
}
/* function
* Purpose :
/* function AddModele
* Purpose : Add a modele into the database
*
* parm :
* -
* - connection
* - array
* gen :
* -
* - none
* return:
* -
* - none
*
*/
function AddModele($p_cn,$p_array) {
@ -458,15 +459,17 @@ function UpdateModele($p_cn,$p_fiche,$p_js) {
DefModele($p_js,$array,$array['ligne']);
}
/* function
* Purpose :
/* function GetDataModele
* Purpose : Return the info of an fiche identified by
* p_fiche
*
* parm :
* -
* - connection
* - fiche id
* gen :
* -
* - none
* return:
* -
* - array with all the data
*
*/
function GetDataModele($p_cn,$p_fiche) {
@ -594,5 +597,55 @@ function getFicheName($p_cn,$p_id) {
$st=pg_fetch_array($Res,0);
return $st['fd_label'];
}
/* function GetFicheJrn
* Purpose : Get all the fiche related to a "journal"
*
* parm :
* - p_cn connextion
* - j_jrn journal_id
* - $p_type : deb or cred
* gen :
* - none
* return: array containing the fiche(f_id),fiche(f_label)
*/
function GetFicheJrn($p_cn,$p_jrn,$p_type)
{
$get="";
if ( $p_type == 'deb' ) {
$get='jrn_def_fiche_deb';
}
if ( $p_type == 'cred' ) {
$get='jrn_def_fiche_cred';
}
if ( $get == "" ) {
echo_error("Invalid p_type function GetFicheJrn($p_cn,$p_jrn,$p_type)");
exit -1;
}
$Res=ExecSql($p_cn,"select $get as fiche from jrn_def where jrn_def_id=$p_jrn");
$Max=pg_NumRows($Res);
if ( $Max==0) {
echo_warning("No rows");
return null;
}
// Normally Max must be == 1
$list=pg_fetch_array($Res,0);
if ( $list['fiche']=="") {
echo_warning("No fiche");
return null;
}
$sql="select f_id, f_label from fiche where f_fd_id in (".$list['fiche'].") order by f_label";
$Res=ExecSql($p_cn,$sql);
$Max=pg_NumRows($Res);
if ($Max==0 ) return null;
// Get The result and put it into an array
for ($i=0;$i<$Max;$i++) {
$line=pg_fetch_array($Res,$i);
$f_id=$line['f_id'];
$f_label=$line['f_label'];
$a[$i]=array($f_id,$f_label);
}
return $a;
}
?>

View file

@ -589,7 +589,8 @@ function GetJrnProp($p_dossier,$p_jrn)
$l_dossier=sprintf("dossier%d",$p_dossier);
$cn=DbConnect($l_dossier);
$Res=ExecSql($cn,"select jrn_Def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_def_type,
jrn_deb_max_line,jrn_cred_max_line,jrn_def_ech,jrn_def_ech_lib,jrn_def_code
jrn_deb_max_line,jrn_cred_max_line,jrn_def_ech,jrn_def_ech_lib,jrn_def_code,
jrn_def_fiche_deb,jrn_def_fiche_deb
from jrn_Def
where jrn_def_id=$p_jrn");
$Count=pg_NumRows($Res);
@ -800,15 +801,16 @@ function ViewJrn($p_dossier,$p_user,$p_jrn,$p_array=null) {
function isClosed($p_cn,$p_period) {
return false;
}
/* function
* Purpose :
/* function GetData
* Purpose : Get data from jrnx where p_grpt=jrnx(j_grpt)
*
* parm :
* -
* - connection
* - p_grpt
* gen :
* -
* - none
* return:
* -
* - return array
*
*/
function GetData ($p_cn,$p_grpt) {