348 |
$a=pg_fetch_array($ret,0); |
$a=pg_fetch_array($ret,0); |
349 |
return $a['t']; |
return $a['t']; |
350 |
} |
} |
351 |
|
/* function getPeriodeFromDate |
352 |
|
************************************************** |
353 |
|
* Purpose : Return the period corresponding to the |
354 |
|
* date |
355 |
|
* |
356 |
|
* parm : |
357 |
|
* - p_cn database connection |
358 |
|
* - the date 'MM.YYYY' |
359 |
|
* gen : |
360 |
|
* - none |
361 |
|
* |
362 |
|
* return: |
363 |
|
* parm_periode.p_id |
364 |
|
*/ |
365 |
|
function getPeriodeFromDate($p_cn,$p_date) { |
366 |
|
$R=ExecSql($p_cn,"select p_id from parm_periode where |
367 |
|
to_char(p_start,'DD.MM.YYYY') = '01.$p_date'"); |
368 |
|
if ( pg_NumRows($R) == 0 ) |
369 |
|
return -1; |
370 |
|
$a=pg_fetch_array($R,0); |
371 |
|
|
372 |
|
return $a['p_id']; |
373 |
|
} |
374 |
|
|
375 |
?> |
?> |