222 |
function ListJrn($p_cn,$p_jrn,$p_where="",$p_array=null) |
function ListJrn($p_cn,$p_jrn,$p_where="",$p_array=null) |
223 |
{ |
{ |
224 |
|
|
|
//TODO add a print button but only if type of jrn is VEN !! |
|
225 |
include_once("central_inc.php"); |
include_once("central_inc.php"); |
226 |
if ( $p_array == null ) { |
if ( $p_array == null ) { |
227 |
$sql="select jr_id , |
$sql="select jr_id , |
308 |
if ( $l_poste != null ) { |
if ( $l_poste != null ) { |
309 |
$sql.=$l_and." jr_grpt_id in (select j_grpt |
$sql.=$l_and." jr_grpt_id in (select j_grpt |
310 |
from jrnx where j_poste = $l_poste) "; |
from jrnx where j_poste = $l_poste) "; |
311 |
|
$l_and=" and "; |
312 |
|
} |
313 |
|
// if not admin check filter |
314 |
|
$User=new cl_user(DbConnect()); |
315 |
|
$User->Check(); |
316 |
|
if ( $User->admin == 0 ) { |
317 |
|
$sql.=$l_and." jr_def_id in ( select uj_jrn_id ". |
318 |
|
" from user_sec_jrn where ". |
319 |
|
" uj_login='".$_SESSION['g_user']."'". |
320 |
|
" and uj_priv in ('R','W'))"; |
321 |
} |
} |
322 |
$sql.=" order by jr_date_order asc"; |
$sql.=" order by jr_date_order asc"; |
323 |
}// p_array != null |
}// p_array != null |