/[phpcompta]/phpcompta/include/ac_common.php
ViewVC logotype

Diff of /phpcompta/include/ac_common.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.36 by sparkyx, Sat Sep 3 07:18:31 2005 UTC revision 1.37 by sparkyx, Tue Sep 27 16:14:57 2005 UTC
# Line 355  function getPeriodeName($p_cn,$p_id,$pos Line 355  function getPeriodeName($p_cn,$p_id,$pos
355    $a=pg_fetch_array($ret,0);    $a=pg_fetch_array($ret,0);
356    return $a['t'];    return $a['t'];
357  }  }
358    /* function getPeriodeFromMonth
359     **************************************************
360     * Purpose : Return the period corresponding to the
361     *           date
362     *        
363     * parm :
364     *      - p_cn database connection
365     *      - the month + year 'MM.YYYY'
366     * gen :
367     *      - none
368     *
369     * return:
370     *       parm_periode.p_id
371     */
372    function getPeriodeFromMonth($p_cn,$p_date) {
373      $R=ExecSql($p_cn,"select p_id from parm_periode where
374                  to_char(p_start,'DD.MM.YYYY') = '01.$p_date'");
375      if ( pg_NumRows($R) == 0 )
376        return -1;
377      $a=pg_fetch_array($R,0);
378    
379      return $a['p_id'];
380    }
381  /* function getPeriodeFromDate  /* function getPeriodeFromDate
382   **************************************************   **************************************************
383   * Purpose : Return the period corresponding to the   * Purpose : Return the period corresponding to the
# Line 362  function getPeriodeName($p_cn,$p_id,$pos Line 385  function getPeriodeName($p_cn,$p_id,$pos
385   *           *        
386   * parm :   * parm :
387   *      - p_cn database connection   *      - p_cn database connection
388   *      - the date 'MM.YYYY'   *      - the date 'DD.MM.YYYY'
389   * gen :   * gen :
390   *      - none   *      - none
391   *   *
# Line 371  function getPeriodeName($p_cn,$p_id,$pos Line 394  function getPeriodeName($p_cn,$p_id,$pos
394   */   */
395  function getPeriodeFromDate($p_cn,$p_date) {  function getPeriodeFromDate($p_cn,$p_date) {
396    $R=ExecSql($p_cn,"select p_id from parm_periode where    $R=ExecSql($p_cn,"select p_id from parm_periode where
397                to_char(p_start,'DD.MM.YYYY') = '01.$p_date'");                p_start <= to_date('$p_date','DD.MM.YYYY')
398               and p_end  >= to_date('$p_date','DD.MM.YYYY')
399               ");
400    if ( pg_NumRows($R) == 0 )    if ( pg_NumRows($R) == 0 )
401      return -1;      return -1;
402    $a=pg_fetch_array($R,0);    $a=pg_fetch_array($R,0);

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26