| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2003-01-03 06:46 UTC] gregoire dot roland at edfgdf dot fr
 PHP WIN32 4.3.0 + APACHE 2.2.43 + WINNT 4 SP6A FR
Does a DrWatson (Stack OverFlow)
The Script :
<?php
class pcode_analyzer {
	var $fichier_export;		/* Fichier d'entr?e d'export du pcode */
	var $fichier_sql;			/* Fichier g?n?r? des appel sql */
	var $fichier_appel;			/* Fichier g?n?r? des appel de fonction */
	var $fichier_definition;	/* Fichier g?n?r? des d?finitions de fonction */
	var $debug;					/* Variable de debugage */
	/* 
	 * Constructeur
	 * Parametres :
	 * 		$_f_export : Fichier d'entr?e d'export du pcode
	 * 		$_f_sql    : Fichier g?n?r? des appel sql
	 *      $_f_appel  : Fichier g?n?r? des appel de fonction
	 *      $_f_def    : Fichier g?n?r? des d?finitions de fonction
	 */
	function pcode_analyzer ($_f_export, $_f_sql, $_f_appel, $_f_def, $_debug) {	 
		$this->fichier_export     = $_f_export;
		$this->fichier_sql        = $_f_sql;
		$this->fichier_appel      = $_f_appel;
		$this->fichier_definition = $_f_def;
		
		$this->debug = $_debug;
		
	}
	function trace($s) {
		if ($this->debug) {
			echo "==> Trace : $s <==<br>";
			flush;	
		}
	}
	
	/*
	 * Fonction extrait_sql : Extrait le code SQL d'une instruction PCode SQLExec
	 * Parametre :
	 * 		$code : une instruction Pcode
	 */  
	function extrait_sql(&$code) {
		$this->trace("Avant extrait_sql");
		$regs = array();
		/*
		 * Matche la chaine sqlexec(" et r?cup?re la chaine jusqu'a "
		 */
		$this->trace("$code");
/* =============== Crash Here ===================*/		
if (preg_match('/sqlexec\(\"(.*?)\"/i',$code,$regs)) {
				echo "sql : $regs[1]<br>";
		}
		
		$this->trace("Apr?s extrait_sql");
	}	
	/*
	 * Fonction extrait_fonction : Extrait le nom des fonction d?clar? 
	 * 							   et utilis? dans une liste d'instruction Pcode
	 * Parametres :
	 * 		$instruction : Liste des instructions Pcode
	 * 		$code        : Instruction Pcode ? analyser
	 */ 
	function extrait_fonction(&$instruction,&$code) {
		
		$this->trace("Avant extrait_fonction");
		
		/*
		 * Matche le declare et le peoplecode dans l'instruction ? analyser
		 * et r?cup?re le prototype de la fonction
		 */ 
		if (preg_match("/declare (.*) peoplecode (.*)/i",$code,$regs)) {
			/*
			 * Match le mot clef function et recupere
			 * le nom de la fonction
			 */
			preg_match("/function (.*)\(/i",$regs[1],$nom);
			/*
			 * Verifie pour chaque instruction si le nom pr?cedement trouv?
			 * est utilis? dans les instructions Pcode, en ignorant la ligne de d?claration
			 */  
			foreach ($instruction as $key => $value) {
				if (!preg_match("/declare (.*) peoplecode (.*)/i",$value) && preg_match("/" . $nom[1] . "/i",$value)) {
				    $use = true;
					break;
				}
			}
			if ($use) {
			    echo "fct : $regs[2] => $regs[1] => $nom[1]<br>";
			}
		}
		
		$this->trace("Apr?s extrait_fonction");
	}
	/* 
	 * Fonction analyse_definition : analyse la d?finition d'une fonction
	 * Parametre : 
	 * 		$definition : Liste d'instruction Pcode contenant la definition de fonction
	 */ 
	function analyse_definition (&$definition) {
		$this->trace("Avant analyse_definition");
		
		/*
		 * Macthe les mots clefs "declare fonction " et recup?re le nom de 
		 *  la fonction analys?e
		 */ 
		preg_match("/declare function (.*?) /i",$definition[0],$regs);
		echo "fct : $regs[1]<br>";
		
		/*
		 *  Extrait le SQL sur chaque instruction de la d?finition
		 */ 
		foreach($definition as $key => $val) {
			$this->extrait_sql($val);
		}
	
		$this->trace("Apr?s analyse_definition");
	}	
	
	
	/*
	 * Fonction efface_commenataire : efface les commentaire du Pcode
	 * Parametre : 
	 * 		$code : chaine de Pcode
	 */ 
	function efface_commentaire(&$code) {
		$this->trace("Avant efface_commentaire");
		
		/*
		 *  Tant que les commentaire sont match? :
		 */ 
		while (preg_match("/(\/\*((.|\n)+?)\*\/)/i",$code,$reg)) {
			/*
			 *  Remplace les commentaire par chaine vide
			 */ 
			$code = preg_replace('/(\/\*((.|\n)+?)\*\/)/','',$code);
		}
		$this->trace("Apres efface_commentaire");
	}	
	
	
	/* 
	 * Fonction analyse_evenement : analyse le code d'un evenement Pcode
	 * Parametres :
	 * 		$record : Record de l'evenement
	 * 		$field  : Champ de l'evenement
	 * 		$event  : nom de l'evenement
	 * 		$code   : Code de l'evenement
	 */
	function analyse_evenement (&$record, &$field, &$event, &$code) {
		$this->trace("Debut Analyse Evenement [$record.$field.$event]");
		
		/*
		 * Efface les commentaires du code
		 */ 
		$this->efface_commentaire($code);	    
		
		/*
		 * S?pare le code en instruction suivant les points virgules
		 * On cree le tableau instruction sans def
		 */ 
		$this->trace("Avant split");
		$instruction = split(";",$code);		
		$instruction_sans_def = $instruction;
		$this->trace("Apr?s efface_commentaire");
		/*
		 * Pour chaque instructions :
		 */ 
		foreach ($instruction as $key => $val) {
			/*
			 * Si on matche le mot clef "declare"
			 * c'est peut ?tre un d?but de d?finition de fonction
			 */ 
			if (preg_match("/declare/i",$val,$regs)) {
				$def = array();
				/*
				 * On stocke les instructions dans un tableau contenant les instructions
				 * de d?finition
				 */ 
				array_push($def,$val);
				/*
				 * Pour chaque instruction suivante
				 */ 
				for($i = $key + 1; $i < sizeof($instruction); ++$i) {
					/*
					 * On stocke l'instruction dans le tableau de definition
					 */ 
					array_push($def,$instruction[$i]);
					
					/*
					 *  Si on matche un declare, ce n'etait pas une definition
					 */
					if (preg_match("/declare/i",$instruction[$i])) {
						break;
					}	
					
					/*
					 * Si on matche un end-fun c'est une definition, on l'analyse
					 * et on la supprime du tableau instruction_sans_def
					 */ 
					if (preg_match("/end-fun/i",$instruction[$i])) {
						$this->analyse_definition($def);
						$instruction_sans_def = array_diff($instruction_sans_def,$def);
						break;
					}
				}
			}
		}
		
		/*
		 * On extrait le SQL et les declaration de fonction du reste des instructions
		 */ 
		foreach ($instruction_sans_def as $key => $val) {
			$this->extrait_sql($val);
			$this->extrait_fonction($instruction,$val);
		}	
			
		$this->trace("Fin Analyse Evenement");
	}
	
	/*
	 * Fonction analyse : analyse le fichier d'export du pcode 
	 * 
	 */
	function analyze () {	
		
		$this->trace("<b>Debut Analyse</b>");
		
		/*
		 * Ouvre le fichier d'export du pcode
		 */
		$fin  = fopen($this->fichier_export, "r");
		
		/*
		 *  Lit la premiere ligne du fichier
		 */ 
		$buffer = fgets($fin);
		do {
			$evt = "";	
			/* 
			 * D?but de evt : recup?rer les lignes du fichier jusqu'au record prochain
			 * Matche la chaine record.field.event => d?but d'evenement
			 */ 
			if (preg_match("/\[(\S+)\.(\S+)\.(\S+)\]/i",$buffer,$regs)) {
				$buffer = "";
				/*
				 *  Lit l'evenement jusqu'au suivant
				 */ 
				do {
					$evt .= $buffer; 
					$buffer = fgets($fin);
				} while(!feof($fin) && !preg_match("/\[(\S+)\.(\S+)\.(\S+)\]/i",$buffer));	
				/*
				 * Effectue l'analyse de l'evenement ssi perimetre IEG (record commen?ant par "EG_"
				 */ 
				if ( strtoupper(substr($regs[1],0,3)) == "EG_") {
					$this->analyse_evenement($regs[1], $regs[2], $regs[3], $evt);
				}
			}
		} while(!feof($fin));
		fclose($fin);
		
		$this->trace("<b>Fin Analyse</b>");
		
	}
		
}
$pa = new pcode_analyzer("export_pcode.txt","","","",true);
$pa->analyze();
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 10:00:02 2025 UTC | 
function extrait_sql(&$code) { $this->trace("Avant extrait_sql"); $regs = array(); /* * Matche la chaine sqlexec(" et r?cup?re la chaine jusqu'a " */ $this->trace("$code"); /* =============== Crash Here ===================*/ if (preg_match('/sqlexec\(\"(.*?)\"/i',$code,$regs)) { echo "sql : $regs[1]<br>"; } $this->trace("Apr?s extrait_sql"); } This function is crashing after about 300 calls. It does a DrWatson (Stack Overflow).This code is crashig : DrWatson Stack Overflow. <?php function extrait_sql(&$code) { if (preg_match('/(\/\*(.|\n)*?\*\/)/', $code)) { $code = preg_replace('/(\/\*(.|\n)*?\*\/)/', '', $code); } } $le_code = '/*-------------------------------------------------------------*/ /* EG_LSTJ_200201_Evolution Adresse et centre de rattachement */ /*-------------------------------------------------------------*/ /*Declare Function EG_CST_COD_FORCAGE_RENTE PeopleCode EG_FLW_CONSTANT.EG_CONSTANTES FieldFormula;*/ /*Declare Function EG_CST_AVANCE_PREVI PeopleCode EG_FLW_CONSTANT.EG_CONSTANTES FieldFormula; */ /*Declare Function EG_CST_CAN_REN PeopleCode EG_FLW_CONSTANT.EG_CONSTANTES FieldFormula; */ /*Declare Function EG_CST_CAS_REN PeopleCode EG_FLW_CONSTANT.EG_CONSTANTES FieldFormula; */ /*Local date &D_DATE_PLUS_REC; */ /*Local number &N_NB_PREST; */ /*Local number &N_NB_PREST_RG_OU_R; */ /*Local number &N_I; */ /*Local string &S_CAS; */ /* EG_BLLA_02071999_ Contr?le la saisie des champs CAN CAS si les dates sont renseign?es et */ /* inversement. */ /*If %PanelGroup = PANELGROUP.EG_CREA_OD Or */ /* %PanelGroup = PANELGROUP.EG_CREA_AD Then */ /* &B_TROUVE = False; */ /* For &N_I = 1 To ActiveRowCount(RECORD.EG_PRESTAT_R) */ /* &S_STATUT = FetchValue(RECORD.EG_PRESTAT_R, &N_I, EG_PRESTAT_R.EG_STATUT_DOS1); */ /* If &S_STATUT = "ACT" And */ /* ActiveRowCount(RECORD.EG_PRESTAT_R) = 1 Then */ /* &B_TROUVE = True; */ /* End-If; */ /* End-For; */ /* If &B_TROUVE = False Then */ /* If (None(EG_COD_UNIT_CAN) And */ /* All(EG_DAT_RAT_CAN)) Or */ /* (All(EG_COD_UNIT_CAN) And */ /* None(EG_DAT_RAT_CAN)) Or */ /* (None(EG_COD_UNIT_CAS) And */ /* All(EG_DAT_RAT_CAS)) Or */ /* (All(EG_COD_UNIT_CAS) And */ /* None(EG_DAT_RAT_CAS)) Then */ /* SetCursorPos(PANEL.EG_CREA_ADR_PNL, EG_COD_UNIT_CAN, CurrentRowNumber()); */ /* Error (MsgGet(20002, 10, "Message non trouv? dans le catalogue de messages")); */ /* End-If; */ /* End-If; */ /* EG_BLLA_28091999_ Correction suite ? Fiche Ano n? 27 : contr?le sur le bon sens de la saisie */ /*du code for?age. */ /* EG_SVTC_09022000_ Correction suite ? fiche anomalie 179 : c\'est un avertissement */ /* EG_LSTJ_15012001 Evolution adresse et centre de rattachement */ /* D?sormais les Etrnagers n\'ont plus besoin de motif de for?age */ /* If (COUNTRY <> "F" And */ /* COUNTRY <> "B") And */ /* &B_TROUVE = False And */ /* (None(EG_COD_CAS_FIXE) Or */ /* EG_COD_CAS_FIXE <> "ETR") Then */ /* Warning (MsgGet(20002, 23, "Message non trouv? dans le catalogue de messages")); */ /* End-If; */ /* EG_BLLA_28091999_ FIN */ /*End-If; */ /* EG_LSTJ_15012001_ FIN */ /*If (%PanelGroup = PANELGROUP.EG_AFFILIA_OD_IDEN Or */ /* %PanelGroup = PANELGROUP.EG_NUMERO_AD_GRP) And */ /* PERSONAL_DATA.EG_TYP_POP <> "SECI" Then */ /* &B_TROUVE = False; */ /* For &N_I = 1 To ActiveRowCount(RECORD.EG_PRESTAT_R) */ /* &S_STATUT = FetchValue(RECORD.EG_PRESTAT_R, &N_I, EG_PRESTAT_R.EG_STATUT_DOS1); */ /* If &S_STATUT = "ACT" And */ /* ActiveRowCount(RECORD.EG_PRESTAT_R) = 1 Then */ /* &B_TROUVE = True; */ /* End-If; */ /* End-For; */ /* EG_SVTC_19111999_ Correction suite ? fiche anomalie 117 : contr?le sur le ligne courante et */ /* non sur l\'historique) */ /* &D_EFFDT = FetchValue(RECORD.EG_ADRESSE_R, 1, EFFDT); */ /* &N_LIGNE = 1; */ /* For &N_I = 2 To ActiveRowCount(RECORD.EG_ADRESSE_R) */ /* &D_DAT = FetchValue(RECORD.EG_ADRESSE_R, &N_I, EFFDT); */ /* If &D_EFFDT < &D_DAT Then */ /* &D_EFFDT = &D_DAT; */ /* &N_LIGNE = &N_I; */ /* End-If; */ /* End-For; */ /* If &B_TROUVE = False And */ /* EFFDT = &D_EFFDT Then */ /* If (None(EG_COD_UNIT_CAN) And */ /* All(EG_DAT_RAT_CAN)) Or */ /* (All(EG_COD_UNIT_CAN) And */ /* None(EG_DAT_RAT_CAN)) Or */ /* (None(EG_COD_UNIT_CAS) And */ /* All(EG_DAT_RAT_CAS)) Or */ /* (All(EG_COD_UNIT_CAS) And */ /* None(EG_DAT_RAT_CAS)) Then */ /* SetCursorPos(PANEL.EG_ADR_PREST_PNL, EG_COD_UNIT_CAN, CurrentRowNumber()); */ /* Error (MsgGet(20002, 10, "Message non trouv? dans le catalogue de messages")); */ /* End-If; */ /* End-If; */ /* EG_BLLA_28091999_ Correction suite ? Fiche Ano n? 27 : contr?le sur le bon sens de la saisie */ /* du code for?age. */ /* EG_SVTC_09022000_ Correction suite ? fiche anomalie 179 : c\'est un avertissement */ /* EG_LSTJ_15012001 Evolution adresse et centre de rattachement */ /* D?sormais les Etrangers n\'ont plus besoin de motif de for?age */ /* If (COUNTRY <> "F" And */ /* COUNTRY <> "B") And */ /* (EFFDT = &D_EFFDT) And */ /* &B_TROUVE = False And */ /* (None(EG_COD_CAS_FIXE) Or */ /* EG_COD_CAS_FIXE <> "ETR") Then */ /* Warning (MsgGet(20002, 23, "Message non trouv? dans le catalogue de messages")); */ /* End-If; */ /* EG_BLLA_28091999_ FIN */ /* EG_LSTJ_152012001_ FIN */ /*End-If; */ /* EG_BLLA_02071999_ FIN */ /* EG_SVTC_19111999_ Correction suite ? fiche anomalie 124 : s?paration du cas r?viser Prestataire */ /*If %PanelGroup = PANELGROUP.EG_DOS_ADM_GRP And */ /* PERSONAL_DATA.EG_TYP_POP <> "SECI" Then */ /* &B_TROUVE = False; */ /* For &N_I = 1 To ActiveRowCount(RECORD.EG_PRESTAT_R) */ /* &S_STATUT = FetchValue(RECORD.EG_PRESTAT_R, &N_I, EG_PRESTAT_R.EG_STATUT_DOS1); */ /* If &S_STATUT = "ACT" And */ /* ActiveRowCount(RECORD.EG_PRESTAT_R) = 1 Then */ /* &B_TROUVE = True; */ /* End-If; */ /* End-For; */ /* EG_SVTC_19111999_ Correction suite ? fiche anomalie 117 : */ /*contr?le sur le ligne courante et non sur l\'historique) */ /* &D_EFFDT = FetchValue(RECORD.EG_ADRESSE_R, 1, EFFDT); */ /* &N_LIGNE = 1; */ /* For &N_I = 2 To ActiveRowCount(RECORD.EG_ADRESSE_R) */ /* &D_DAT = FetchValue(RECORD.EG_ADRESSE_R, &N_I, EFFDT); */ /* If &D_EFFDT < &D_DAT Then */ /* &D_EFFDT = &D_DAT; */ /* &N_LIGNE = &N_I; */ /* End-If; */ /* End-For; */ /* If &B_TROUVE = False And */ /* EFFDT = &D_EFFDT Then */ /* If (None(EG_COD_UNIT_CAN) And */ /* All(EG_DAT_RAT_CAN)) Or */ /* (All(EG_COD_UNIT_CAN) And */ /* None(EG_DAT_RAT_CAN)) */ /* (None(EG_COD_UNIT_CAS) And */ /* All(EG_DAT_RAT_CAS)) Or */ /* (All(EG_COD_UNIT_CAS) And */ /* None(EG_DAT_RAT_CAS)) Then */ /* SetCursorPos(PANEL.EG_ADR_PREST_PNL, EG_COD_UNIT_CAN, CurrentRowNumber()); */ /* Error (MsgGet(20002, 10, "Message non trouv? dans le catalogue de messages")); */ /* End-If; */ /* End-If; */ /* EG_BLLA_28091999_ Correction suite ? Fiche Ano n? 27 : contr?le sur le bon sens de la saisie */ /* du code for?age. */ /* &B_SEC_TROUVE = False; */ /* For &B_I = 1 To ActiveRowCount(RECORD.EG_PRESTAT_R) */ /* &S_STATUT_DOS_REC = FetchValue(RECORD.EG_PRESTAT_R, &B_I, EG_PRESTAT_R.EG_STATUT_DOS1); */ /* If PERSONAL_DATA.EG_TYP_POP = "AD" And */ /* (&S_STATUT_DOS_REC = "SEC" Or */ /* &S_STATUT_DOS_REC = "PPF") Then */ /* &B_SEC_TROUVE = True; */ /* End-If; */ /* End-For; */ /* EG_LSTJ_15012001 D?sormais les Etrangers n\'ont plus besoin de motif de for?age */ /*If (COUNTRY <> "F" And */ /* COUNTRY <> "B") And */ /* EFFDT = &D_EFFDT And */ /* &B_TROUVE = False And */ /* &B_SEC_TROUVE = False And */ /* (None(EG_COD_CAS_FIXE) Or */ /* EG_COD_CAS_FIXE <> "ETR") Then */ /* Warning (MsgGet(20002, 23, "Message non trouv? dans le catalogue de messages")); */ /*End-If; */ /*End-If; */ /* EG_SVTC_19111999_FIN */ /*If %PanelGroup = PANELGROUP.EG_AFFILIA_OD_IDEN Or*/ /* (%PanelGroup = PANELGROUP.EG_DOS_ADM_GRP And*/ /* PERSONAL_DATA.EG_TYP_POP <> "SECI") Or*/ /* %PanelGroup = PANELGROUP.EG_NUMERO_AD_GRP Then*/ /* &D_DATE_PLUS_REC = Date(19000101);*/ /* For &N_I = 1 To ActiveRowCount(RECORD.EG_ADRESSE_R)*/ /* If &D_DATE_PLUS_REC < FetchValue(RECORD.EG_ADRESSE_R, &N_I, EFFDT) Then*/ /* &D_DATE_PLUS_REC = FetchValue(RECORD.EG_ADRESSE_R, &N_I, EFFDT)*/ /* End-If;*/ /* End-For;*/ /* If EFFDT = &D_DATE_PLUS_REC Then*/ /* If None(EG_COD_CAS_FIXE) Or*/ /* None(EG_COD_CAN_FIXE) Then*/ /* Recherche si cet agent n\'a que des prestations RG ou Rentes */ /* &N_NB_PREST = 0;*/ /* &N_NB_PREST_RG_OU_R = 0;*/ /* SQLExec("SELECT distinct sum(1) FROM Ps_eg_s_pst_r P WHERE P.eg_s_dat_jou <= SYSDATE AND (0 = (SELECT count(1) FROM ps_eg_s_op_pst_r O WHERE O.emplid = P.emplid AND O.eg_no_affilie = P.eg_no_affilie AND O.eg_s_cod_pst = P.eg_s_cod_pst AND O.eg_s_dat_eff_ope<= SYSDATE) OR 1 <= (Select count(1) FROM ps_eg_s_op_pst_r O2 WHERE O2.emplid = P.emplid AND O2.eg_no_affilie = P.eg_no_affilie AND O2.eg_s_cod_pst = P.eg_s_cod_pst AND O2.eg_s_dat_eff_ope<= SYSDATE AND O2.eg_s_dat_eff_ope = (SELECT max(O3.eg_s_dat_eff_ope) FROM ps_eg_s_op_pst_r O3 WHERE O3.emplid = O2.emplid AND O3.eg_no_affilie = O2.eg_no_affilie AND O3.eg_s_cod_pst = O2.eg_s_cod_pst AND O3.eg_s_cod_op = O2.eg_s_cod_op) )) AND emplid =:1 AND eg_no_affilie=:2 GROUP BY P.emplid, P.eg_no_affilie", PERSONAL_DATA.EMPLID, EG_PREST_H.EG_NO_AFFILIE_XX, &N_NB_PREST);*/ /* SQLExec("SELECT distinct sum(1) FROM Ps_eg_s_pst_r P WHERE P.eg_s_dat_jou <= SYSDATE AND ( 0 = (SELECT count(1) FROM ps_eg_s_op_pst_r O WHERE O.emplid = P.emplid AND O.eg_no_affilie = P.eg_no_affilie AND O.eg_s_cod_pst = P.eg_s_cod_pst AND O.eg_s_dat_eff_ope<= SYSDATE) OR 1 <= (Select count(1) FROM ps_eg_s_op_pst_r O2 WHERE O2.emplid = P.emplid AND O2.eg_no_affilie = P.eg_no_affilie AND O2.eg_s_cod_pst = P.eg_s_cod_pst AND O2.eg_s_dat_eff_ope<= SYSDATE AND O2.eg_s_dat_eff_ope = (SELECT max(O3.eg_s_dat_eff_ope) FROM ps_eg_s_op_pst_r O3 WHERE O3.emplid = O2.emplid AND O3.eg_no_affilie = O2.eg_no_affilie AND O3.eg_s_cod_pst = O2.eg_s_cod_pst AND O3.eg_s_cod_op = O2.eg_s_cod_op) ) ) AND emplid =:1 AND eg_no_affilie=:2 AND (P.eg_s_cod_pst like \'E%\' or P.eg_s_cod_pst like \'B%\') GROUP BY P.emplid, P.eg_no_affilie", PERSONAL_DATA.EMPLID, EG_PREST_H.EG_NO_AFFILIE_XX, &N_NB_PREST_RG_OU_R);*/ /* If &N_NB_PREST = &N_NB_PREST_RG_OU_R And*/ /* &N_NB_PREST <> 0 Then*/ /* Cet agent n\'a que des prestations RG ou RENTE */ /* If EG_COD_CAN_FIXE = "" Then*/ /* EG_COD_CAN_FIXE = EG_CST_COD_FORCAGE_RENTE();*/ /* EG_COD_UNIT_CAN = EG_CST_CAN_REN();*/ /* EG_DAT_RAT_CAN = Date("");*/ /* End-If;*/ /* If EG_COD_CAS_FIXE = "" Then*/ /* EG_COD_CAS_FIXE = EG_CST_COD_FORCAGE_RENTE();*/ /* EG_COD_UNIT_CAS = EG_CST_CAS_REN();*/ /* EG_DAT_RAT_CAS = Date("");*/ /* End-If;*/ /* End-If;*/ /* End-If;*/ /* If EG_COD_CAS_FIXE <> EG_CST_AVANCE_PREVI() Then*/ /* Recherche si cet agent a une Invalidit? en Avance Provisionnelle */ /* &N_NB_PREST = 0;*/ /* SQLExec("SELECT sum(1) FROM ( SELECT distinct O.EMPLID FROM Ps_eg_s_op_pst_r O WHERE O.eg_s_cod_pst = \'C2I\' AND O.eg_s_dat_eff_ope<= SYSDATE AND O.eg_s_dat_eff_ope = (SELECT max(O2.eg_s_dat_eff_ope) FROM ps_eg_s_op_pst_r O2 WHERE O.emplid = O2.emplid AND O.eg_no_affilie = O2.eg_no_affilie AND O.eg_s_cod_pst = O2.eg_s_cod_pst AND O.eg_s_cod_op = O2.eg_s_cod_op) ) OP, (SELECT distinct Adresse.emplid, Adresse.effdt, Adresse.eg_cod_cas_fixe, Adresse.eg_cod_unit_cas FROM PS_EG_ADRESSE_R Adresse Where Adresse.effdt = (SELECT max(Adr2.effdt) FROM ps_eg_adresse_r Adr2 Where Adr2.emplid = Adresse.emplid) ) A WHERE A.eg_cod_cas_fixe != \'C2AP\' AND A.emplid = :1 AND OP.emplid = :1 ", PERSONAL_DATA.EMPLID, &N_NB_PREST);*/ /* If &N_NB_PREST <> 0 Then*/ /* Cet agent a une prestation Invalidit? en Avance Provisionnelle */ /* If None(EG_COD_CAS_FIXE) Then*/ /* SQLExec("SELECT distinct eg_cod_unit_cas From Ps_eg_unite_t WHERE eg_cod_unit =:1", PERSONAL_DATA.EG_COD_UA, &S_CAS);*/ /* If &S_CAS = "" Then*/ /* MessageBox(16, "", 20002, 39, "Message non trouv? dans le catalogue");*/ /* Else*/ /* EG_COD_CAS_FIXE = EG_CST_AVANCE_PREVI();*/ /* EG_COD_UNIT_CAS = &S_CAS;*/ /* &S_DAT = String(EFFDT);*/ /* &S_MONTH = Substring(&S_DAT, 6, 2);*/ /* &N_YEAR = Year(EFFDT);*/ /* &S_DATE = String(&N_YEAR) | (&S_MONTH) | "01";*/ /* &N_DATE = Value(&S_DATE);*/ /* &D_DATE = Date(&N_DATE);*/ /* EG_DAT_RAT_CAS = &D_DATE;*/ /* End-If;*/ /* Else*/ /* MessageBox(48, "", 20002, 40, "Message non trouv? dans le catalogue");*/ /* End-If;*/ /* End-If;*/ /* End-If;*/ /* End-If;*/ /*End-If;*/ /* EG_LSTJ_050201_FIN */ /**/'; extrait_sql($le_code); echo "Noveau code : $le_code<br>"; ?>