63 |
echo '<DIV CLASS="u_redcontent">'; |
echo '<DIV CLASS="u_redcontent">'; |
64 |
/* Analyse ce qui est demandé */ |
/* Analyse ce qui est demandé */ |
65 |
/* Effacement d'une ligne */ |
/* Effacement d'une ligne */ |
66 |
if (isset ($action)) { |
if (isset ($_GET['action'])) { |
67 |
if ( $action=="del" ) { |
if ( $_GET['action']=="del" ) { |
68 |
if ( isset ($l) ) { |
if ( isset ($_GET['l']) ) { |
69 |
/* Ligne a enfant*/ |
/* Ligne a enfant*/ |
70 |
$R=ExecSql($cn,"select pcm_val from tmp_pcmn where pcm_val_parent=$l"); |
$R=ExecSql($cn,"select pcm_val from tmp_pcmn where pcm_val_parent=".$_GET['l']); |
71 |
if ( pg_NumRows($R) != 0 ) { |
if ( pg_NumRows($R) != 0 ) { |
72 |
echo "<SCRIPT> alert(\"Ne peut pas effacer le poste: d'autres postes en dépendent\");</SCRIPT>"; |
echo "<SCRIPT> alert(\"Ne peut pas effacer le poste: d'autres postes en dépendent\");</SCRIPT>"; |
73 |
} else { |
} else { |
74 |
/* Vérifier que le poste n'est pas utilisé qq part dans les journaux */ |
/* Vérifier que le poste n'est pas utilisé qq part dans les journaux */ |
75 |
$Res=ExecSql($cn,"select * from jrnx where j_poste=$l"); |
$Res=ExecSql($cn,"select * from jrnx where j_poste=".$_GET['l']); |
76 |
if ( pg_NumRows($R) != 0 ) { |
if ( pg_NumRows($R) != 0 ) { |
77 |
echo "<SCRIPT> alert(\"Ne peut pas effacer le poste: il est utilisé dans les journaux\");</SCRIPT>"; |
echo "<SCRIPT> alert(\"Ne peut pas effacer le poste: il est utilisé dans les journaux\");</SCRIPT>"; |
78 |
} |
} |
79 |
else { |
else { |
80 |
$Del=ExecSql($cn,"delete from tmp_pcmn where pcm_val=$l"); |
$Del=ExecSql($cn,"delete from tmp_pcmn where pcm_val=".$_GET['l']); |
81 |
} // if pg_NumRows |
} // if pg_NumRows |
82 |
} // if pg_NumRows |
} // if pg_NumRows |
83 |
} // isset ($l) |
} // isset ($l) |