altocompta/doc/developper/html/ac__common_8php.html
2006-07-06 21:11:40 +00:00

1094 lines
62 KiB
HTML
Raw Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>phpcompta: ac_common.php File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.4 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">include</a></div>
<h1>ac_common.php File Reference</h1>common utilities for a lot of procedure, classe <a href="#_details">More...</a>
<p>
<p>
<a href="ac__common_8php-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a0">echo_error</a> ($p_log)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">log error into the /tmp/phpcompta_error.log it doesn't work on windows <a href="#a0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a1">cmpDate</a> ($p_date, $p_date_oth)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compare 2 dates. <a href="#a1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a2">isNumber</a> ($p_int)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">check if the argument is a number <a href="#a2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a3">isDate</a> ($p_date)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Verifie qu'une date est bien format<61> en d.m.y et est valable. <a href="#a3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a4">formatDate</a> ($p_date)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">call cmpDate <a href="#a4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a5">html_page_start</a> ($p_theme=&quot;&quot;, $p_script=&quot;&quot;, $p_script2=&quot;&quot;)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default page header for each page. <a href="#a5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a6">html_page_stop</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">end tag <a href="#a6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a7">html_button_logout</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Button logout. <a href="#a7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a8">NoAccess</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Echo no access and stop. <a href="#a8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a9">FormatString</a> ($p_string)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Fix the problem with the quote char for the database. <a href="#a9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a10">ShowItem</a> ($p_array, $p_dir='V', $class=&quot;mtitle&quot;, $class_ref=&quot;mtitle&quot;, $default=&quot;&quot;, $p_extra=&quot;&quot;)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">store the string which print <a href="#a10"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a11">echo_warning</a> ($p_string)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">warns <a href="#a11"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a12">make_array</a> ($p_cn, $p_sql, $p_null=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">make a array with the sql <a href="#a12"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a13">getPeriodeName</a> ($p_cn, $p_id, $pos='p_start')</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Show the periode which found thanks its id. <a href="#a13"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a14">getPeriodeFromMonth</a> ($p_cn, $p_date)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the period corresponding to the date. <a href="#a14"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a15">getPeriodeFromDate</a> ($p_cn, $p_date)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the period corresponding to the date. <a href="#a15"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ac__common_8php.html#a16">Decode</a> ($p_html)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Decode the html for the widegt richtext and remove newline. <a href="#a16"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
common utilities for a lot of procedure, classe
<p>
<p>
Definition in file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.<hr><h2>Function Documentation</h2>
<a class="anchor" name="a1"></a><!-- doxytag: member="ac_common.php::cmpDate" ref="a1" args="($p_date, $p_date_oth)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">cmpDate </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_date</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_date_oth</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Compare 2 dates.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>date</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>date2</em>&nbsp;</td><td></td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><ul>
<li>== 0 les dates sont identiques</li><li>&gt; 0 date1 &gt; date2</li><li>&lt; 0 date1 &lt; date2</li></ul>
</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00053">53</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="ac__common_8php-source.html#l00097">isDate()</a>.
<p>
Referenced by <a class="el" href="jrn_8php-source.html#l00834">VerifData()</a>, and <a class="el" href="user__common_8php-source.html#l00654">VerifyOperationDate()</a>.<div class="fragment"><pre class="fragment"><a name="l00053"></a>00053 {
<a name="l00054"></a>00054 $l_date=<a class="code" href="ac__common_8php.html#a3">isDate</a>($p_date);
<a name="l00055"></a>00055 $l2_date=<a class="code" href="ac__common_8php.html#a3">isDate</a>($p_date_oth);
<a name="l00056"></a>00056 <span class="keywordflow">if</span> ($l_date == null || $l2_date == null ) {
<a name="l00057"></a>00057 echo <span class="stringliteral">"erreur date"</span>;
<a name="l00058"></a>00058 <span class="keywordflow">return</span> null;
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060 $l_adate=explode(<span class="stringliteral">"."</span>,$l_date);
<a name="l00061"></a>00061 $l2_adate=explode(<span class="stringliteral">"."</span>,$l2_date);
<a name="l00062"></a>00062 $l_mkdate=mktime(0,0,0,$l_adate[1],$l_adate[0],$l_adate[2]);
<a name="l00063"></a>00063 $l2_mkdate=mktime(0,0,0,$l2_adate[1],$l2_adate[0],$l2_adate[2]);
<a name="l00064"></a>00064 <span class="comment">// si $p_date &gt; $p_date_oth return &gt; 0</span>
<a name="l00065"></a>00065 <span class="keywordflow">return</span> $l_mkdate-$l2_mkdate;
<a name="l00066"></a>00066 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a16"></a><!-- doxytag: member="ac_common.php::Decode" ref="a16" args="($p_html)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">Decode </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_html</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Decode the html for the widegt richtext and remove newline.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$p_html</em>&nbsp;</td><td>string to decode </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>the html code without new line</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00369">369</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.<div class="fragment"><pre class="fragment"><a name="l00369"></a>00369 {
<a name="l00370"></a>00370 $p_html=str_replace('%0D<span class="charliteral">','</span>',$p_html);
<a name="l00371"></a>00371 $p_html=str_replace('%0A<span class="charliteral">','</span>',$p_html);
<a name="l00372"></a>00372 $p_html=urldecode($p_html);
<a name="l00373"></a>00373 <span class="keywordflow">return</span> $p_html;
<a name="l00374"></a>00374 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a0"></a><!-- doxytag: member="ac_common.php::echo_error" ref="a0" args="($p_log)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">echo_error </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_log</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
log error into the /tmp/phpcompta_error.log it doesn't work on windows
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>log</em>&nbsp;</td><td>message</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>nothing</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00036">36</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>.
<p>
Referenced by <a class="el" href="fiche__inc_8php-source.html#l00038">AddFiche()</a>, <a class="el" href="form__inc_8php-source.html#l00267">AddForm()</a>, <a class="el" href="fiche__inc_8php-source.html#l00761">AddModele()</a>, <a class="el" href="user__common_8php-source.html#l00727">DeleteRapt()</a>, <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>, <a class="el" href="user__form__ach_8php-source.html#l00269">form_verify_input()</a>, <a class="el" href="user__form__ach_8php-source.html#l00044">FormAchInput()</a>, <a class="el" href="user__form__ach_8php-source.html#l00471">FormAchView()</a>, <a class="el" href="ac__common_8php-source.html#l00206">FormatString()</a>, <a class="el" href="user__form__fin_8php-source.html#l00146">FormFin()</a>, <a class="el" href="user__form__ods_8php-source.html#l00045">FormODS()</a>, <a class="el" href="user__form__ven_8php-source.html#l00043">FormVenInput()</a>, <a class="el" href="user__form__ven_8php-source.html#l00425">FormVenteView()</a>, <a class="el" href="fiche__inc_8php-source.html#l01057">GetFicheJrn()</a>, <a class="el" href="ac__common_8php-source.html#l00313">getPeriodeName()</a>, <a class="el" href="user__common_8php-source.html#l00211">GetTvaPoste()</a>, <a class="el" href="impress__inc_8php-source.html#l00097">Imp()</a>, <a class="el" href="user__common_8php-source.html#l00699">InsertRapt()</a>, <a class="el" href="user__common_8php-source.html#l00831">isValid()</a>, <a class="el" href="fiche__inc_8php-source.html#l00938">Remove()</a>, <a class="el" href="class__document__modele_8php-source.html#l00103">Document_modele::Save()</a>, <a class="el" href="postgres_8php-source.html#l00371">save_upload_document()</a>, <a class="el" href="class__fiche_8php-source.html#l00642">fiche::update()</a>, <a class="el" href="fiche__inc_8php-source.html#l00530">UpdateFiche()</a>, <a class="el" href="jrn_8php-source.html#l00282">UpdateJrn()</a>, <a class="el" href="fiche__inc_8php-source.html#l00869">UpdateModele()</a>, <a class="el" href="jrn_8php-source.html#l00834">VerifData()</a>, and <a class="el" href="user__common_8php-source.html#l00654">VerifyOperationDate()</a>.<div class="fragment"><pre class="fragment"><a name="l00036"></a>00036 {
<a name="l00037"></a>00037 $fdebug=fopen(<span class="stringliteral">"/tmp/phpcompta_error.log"</span>,<span class="stringliteral">"a+"</span>);
<a name="l00038"></a>00038 fwrite($fdebug,date(<span class="stringliteral">"Ymd H:i:s"</span>).$p_log.<span class="stringliteral">"\n"</span>);
<a name="l00039"></a>00039 fclose($fdebug);
<a name="l00040"></a>00040 <a class="code" href="debug_8php.html#a0">echo_debug</a>($p_log);
<a name="l00041"></a>00041 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a11"></a><!-- doxytag: member="ac_common.php::echo_warning" ref="a11" args="($p_string)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">echo_warning </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_string</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
warns
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>:</em>&nbsp;</td><td><ul>
<li>string gen :</li><li>none </li></ul>
</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>:<ul>
<li>none</li></ul>
</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00267">267</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
Referenced by <a class="el" href="fiche__inc_8php-source.html#l01057">GetFicheJrn()</a>, and <a class="el" href="fiche__inc_8php-source.html#l01514">IsFicheOfJrn()</a>.<div class="fragment"><pre class="fragment"><a name="l00268"></a>00268 {
<a name="l00269"></a>00269 echo '&lt;H2 <span class="keyword">class</span>=<span class="stringliteral">"info"</span>&gt;'.$p_string.<span class="stringliteral">"&lt;/H2&gt;"</span>;
<a name="l00270"></a>00270 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a4"></a><!-- doxytag: member="ac_common.php::formatDate" ref="a4" args="($p_date)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">formatDate </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_date</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
call cmpDate
<p>
<dl compact><dt><b>Returns:</b></dt><dd>the date or the quoted string null</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00120">120</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="ac__common_8php-source.html#l00097">isDate()</a>.<div class="fragment"><pre class="fragment"><a name="l00120"></a>00120 {
<a name="l00121"></a>00121 <span class="keywordflow">if</span> ( <a class="code" href="ac__common_8php.html#a3">isDate</a>($p_date)== null) <span class="keywordflow">return</span> <span class="stringliteral">"null"</span>;
<a name="l00122"></a>00122 <span class="keywordflow">return</span> <span class="stringliteral">"'"</span>.$p_date.<span class="stringliteral">"'"</span>;
<a name="l00123"></a>00123 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a9"></a><!-- doxytag: member="ac_common.php::FormatString" ref="a9" args="($p_string)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">FormatString </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_string</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Fix the problem with the quote char for the database.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$p_string</em>&nbsp;</td><td></td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>a string which won't let strange char for the database</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00206">206</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="ac__common_8php-source.html#l00036">echo_error()</a>.
<p>
Referenced by <a class="el" href="fiche__inc_8php-source.html#l00038">AddFiche()</a>, <a class="el" href="form__inc_8php-source.html#l00267">AddForm()</a>, <a class="el" href="fiche__inc_8php-source.html#l00761">AddModele()</a>, <a class="el" href="class__action_8php-source.html#l00364">action::Confirm()</a>, <a class="el" href="class__fiche_8php-source.html#l00291">fiche::CountByDef()</a>, <a class="el" href="class__action_8php-source.html#l00101">action::Display()</a>, <a class="el" href="class__fiche_8php-source.html#l00167">fiche::GetByQCode()</a>, <a class="el" href="class__fiche_8php-source.html#l00542">fiche::insert()</a>, <a class="el" href="user__common_8php-source.html#l00288">InsertJrn()</a>, <a class="el" href="user__common_8php-source.html#l00322">ListJrn()</a>, <a class="el" href="user__form__fin_8php-source.html#l00358">RecordFin()</a>, <a class="el" href="user__form__ven_8php-source.html#l00627">RecordInvoice()</a>, <a class="el" href="user__form__ach_8php-source.html#l00661">RecordSell()</a>, <a class="el" href="fiche__inc_8php-source.html#l00938">Remove()</a>, <a class="el" href="class__parm__code_8php-source.html#l00076">parm_code::Save()</a>, <a class="el" href="class__document__modele_8php-source.html#l00103">Document_modele::Save()</a>, <a class="el" href="class__action_8php-source.html#l00504">action::SaveStage2()</a>, <a class="el" href="action_8inc_8php-source.html#l00039">ShowActionList()</a>, <a class="el" href="class__supplier_8php-source.html#l00083">Supplier::Summary()</a>, <a class="el" href="class__customer_8php-source.html#l00195">Customer::Summary()</a>, <a class="el" href="class__contact_8php-source.html#l00050">contact::Summary()</a>, <a class="el" href="class__admin_8php-source.html#l00065">Admin::Summary()</a>, <a class="el" href="class__fiche_8php-source.html#l00642">fiche::update()</a>, <a class="el" href="class__action_8php-source.html#l00795">action::Update()</a>, <a class="el" href="user__common_8php-source.html#l00811">UpdateComment()</a>, <a class="el" href="fiche__inc_8php-source.html#l00530">UpdateFiche()</a>, <a class="el" href="form__inc_8php-source.html#l00208">UpdateForm()</a>, <a class="el" href="class__own_8php-source.html#l00051">Own::UpdateRow()</a>, and <a class="el" href="jrn_8php-source.html#l00583">ViewJrn()</a>.<div class="fragment"><pre class="fragment"><a name="l00207"></a>00207 {
<a name="l00208"></a>00208 <span class="keywordflow">if</span> ( !isset ($p_string) ) {
<a name="l00209"></a>00209 <a class="code" href="ac__common_8php.html#a0">echo_error</a>(<span class="stringliteral">"ac_common.php FormatString p_string empty"</span>);
<a name="l00210"></a>00210 <span class="keywordflow">return</span> null;
<a name="l00211"></a>00211 }
<a name="l00212"></a>00212 $p_string=trim($p_string);
<a name="l00213"></a>00213 <span class="keywordflow">if</span> (strlen($p_string) == 0 ) <span class="keywordflow">return</span> null;
<a name="l00214"></a>00214 $p_string=str_replace(<span class="stringliteral">"\'"</span>,<span class="stringliteral">"'"</span>,$p_string);
<a name="l00215"></a>00215 $p_string=str_replace(<span class="stringliteral">"''"</span>,<span class="stringliteral">"'"</span>,$p_string);
<a name="l00216"></a>00216 $p_string=str_replace(<span class="stringliteral">"'"</span>,<span class="stringliteral">"\'"</span>,$p_string);
<a name="l00217"></a>00217 <span class="keywordflow">return</span> $p_string;
<a name="l00218"></a>00218 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a15"></a><!-- doxytag: member="ac_common.php::getPeriodeFromDate" ref="a15" args="($p_cn, $p_date)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">getPeriodeFromDate </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_cn</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_date</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Return the period corresponding to the date.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>:</em>&nbsp;</td><td><ul>
<li>p_cn database connection</li></ul>
</td></tr>
</table>
</dl>
<ul>
<li>the date 'DD.MM.YYYY' <dl compact><dt><b>Returns:</b></dt><dd>: parm_periode.p_id</dd></dl>
</li></ul>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00353">353</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="balance_8php-source.html#l00113">$a</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.<div class="fragment"><pre class="fragment"><a name="l00353"></a>00353 {
<a name="l00354"></a>00354 $R=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,<span class="stringliteral">"select p_id from parm_periode where</span>
<a name="l00355"></a>00355 <span class="stringliteral"> p_start &lt;= to_date('$p_date','DD.MM.YYYY')</span>
<a name="l00356"></a>00356 <span class="stringliteral"> and p_end &gt;= to_date('$p_date','DD.MM.YYYY')</span>
<a name="l00357"></a>00357 <span class="stringliteral"> "</span>);
<a name="l00358"></a>00358 <span class="keywordflow">if</span> ( pg_NumRows($R) == 0 )
<a name="l00359"></a>00359 <span class="keywordflow">return</span> -1;
<a name="l00360"></a>00360 <a class="code" href="balance_8php.html#a10">$a</a>=pg_fetch_array($R,0);
<a name="l00361"></a>00361
<a name="l00362"></a>00362 <span class="keywordflow">return</span> <a class="code" href="balance_8php.html#a10">$a</a>['p_id'];
<a name="l00363"></a>00363 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a14"></a><!-- doxytag: member="ac_common.php::getPeriodeFromMonth" ref="a14" args="($p_cn, $p_date)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">getPeriodeFromMonth </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_cn</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_date</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Return the period corresponding to the date.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>p_cn</em>&nbsp;</td><td>database connection </td></tr>
<tr><td valign="top"></td><td valign="top"><em>the</em>&nbsp;</td><td>month + year 'MM.YYYY'</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>: parm_periode.p_id</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00333">333</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="balance_8php-source.html#l00113">$a</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.
<p>
Referenced by <a class="el" href="impress__inc_8php-source.html#l00726">ParseFormula()</a>.<div class="fragment"><pre class="fragment"><a name="l00333"></a>00333 {
<a name="l00334"></a>00334 $R=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,<span class="stringliteral">"select p_id from parm_periode where</span>
<a name="l00335"></a>00335 <span class="stringliteral"> to_char(p_start,'DD.MM.YYYY') = '01.$p_date'"</span>);
<a name="l00336"></a>00336 <span class="keywordflow">if</span> ( pg_NumRows($R) == 0 )
<a name="l00337"></a>00337 <span class="keywordflow">return</span> -1;
<a name="l00338"></a>00338 <a class="code" href="balance_8php.html#a10">$a</a>=pg_fetch_array($R,0);
<a name="l00339"></a>00339
<a name="l00340"></a>00340 <span class="keywordflow">return</span> <a class="code" href="balance_8php.html#a10">$a</a>['p_id'];
<a name="l00341"></a>00341 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a13"></a><!-- doxytag: member="ac_common.php::getPeriodeName" ref="a13" args="($p_cn, $p_id, $pos='p_start')" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">getPeriodeName </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_cn</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_id</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>pos</em> = <code>'p_start'</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Show the periode which found thanks its id.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$p_cn</em>&nbsp;</td><td>database connection </td></tr>
<tr><td valign="top"></td><td valign="top"><em>p_id</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>Start</em>&nbsp;</td><td>or end</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>: string</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00313">313</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="balance_8php-source.html#l00113">$a</a>, <a class="el" href="impress__bilan_8php-source.html#l00032">$ret</a>, and <a class="el" href="ac__common_8php-source.html#l00036">echo_error()</a>.<div class="fragment"><pre class="fragment"><a name="l00313"></a>00313 {
<a name="l00314"></a>00314 <span class="keywordflow">if</span> ( $pos != 'p_start' and
<a name="l00315"></a>00315 $pos != 'p_end')
<a name="l00316"></a>00316 <a class="code" href="ac__common_8php.html#a0">echo_error</a>('ac_common.php'.<span class="stringliteral">"-"</span>.__LINE__.' UNDEFINED <a class="code" href="constant_8php.html#a13">PERIODE</a>');
<a name="l00317"></a>00317 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>=execSql($p_cn,<span class="stringliteral">"select to_char($pos,'Mon YYYY') as t from parm_periode where p_id=$p_id"</span>);
<a name="l00318"></a>00318 <span class="keywordflow">if</span> (pg_NumRows($ret) == 0) <span class="keywordflow">return</span> null;
<a name="l00319"></a>00319 <a class="code" href="balance_8php.html#a10">$a</a>=pg_fetch_array($ret,0);
<a name="l00320"></a>00320 <span class="keywordflow">return</span> <a class="code" href="balance_8php.html#a10">$a</a>[<span class="charliteral">'t'</span>];
<a name="l00321"></a>00321 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a7"></a><!-- doxytag: member="ac_common.php::html_button_logout" ref="a7" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">html_button_logout </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Button logout.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>nothing</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00182">182</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.<div class="fragment"><pre class="fragment"><a name="l00182"></a>00182 {
<a name="l00183"></a>00183 echo <span class="stringliteral">"&lt;A class=\"mtitle\" HREF=logout.php&gt; Logout &lt;/A&gt;"</span>;
<a name="l00184"></a>00184 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a5"></a><!-- doxytag: member="ac_common.php::html_page_start" ref="a5" args="($p_theme=&quot;&quot;, $p_script=&quot;&quot;, $p_script2=&quot;&quot;)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">html_page_start </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_theme</em> = <code>&quot;&quot;</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_script</em> = <code>&quot;&quot;</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_script2</em> = <code>&quot;&quot;</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Default page header for each page.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>default</em>&nbsp;</td><td>theme </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$p_script</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>$p_script2</em>&nbsp;</td><td>another js script</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>none</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00133">133</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="impress__fiche_8php-source.html#l00026">$cn</a>, <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, <a class="el" href="pref_8inc_8php-source.html#l00063">$style</a>, <a class="el" href="postgres_8php-source.html#l00072">DbConnect()</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.<div class="fragment"><pre class="fragment"><a name="l00134"></a>00134 {
<a name="l00135"></a>00135 include_once (<span class="stringliteral">"postgres.php"</span>);
<a name="l00136"></a>00136 ini_set('magic_quotes_gpc<span class="charliteral">','</span>Off');
<a name="l00137"></a>00137
<a name="l00138"></a>00138 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>();
<a name="l00139"></a>00139 <span class="keywordflow">if</span> ( $p_theme != <span class="stringliteral">""</span>) {
<a name="l00140"></a>00140 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($cn,<span class="stringliteral">"select the_filestyle from theme</span>
<a name="l00141"></a>00141 <span class="stringliteral"> where the_name='"</span>.$p_theme.<span class="stringliteral">"'"</span>);
<a name="l00142"></a>00142 <span class="keywordflow">if</span> (pg_NumRows($Res)==0)
<a name="l00143"></a>00143 <a class="code" href="pref_8inc_8php.html#a2">$style</a>=<span class="stringliteral">"style.css"</span>;
<a name="l00144"></a>00144 <span class="keywordflow">else</span> {
<a name="l00145"></a>00145 $s=pg_fetch_array($Res,0);
<a name="l00146"></a>00146 <a class="code" href="pref_8inc_8php.html#a2">$style</a>=$s['the_filestyle'];
<a name="l00147"></a>00147 }
<a name="l00148"></a>00148 }<span class="keywordflow">else</span> {
<a name="l00149"></a>00149 <a class="code" href="pref_8inc_8php.html#a2">$style</a>=<span class="stringliteral">"style.css"</span>;
<a name="l00150"></a>00150 } <span class="comment">// end if</span>
<a name="l00151"></a>00151 echo '&lt;!DOCTYPE HTML PUBLIC <span class="stringliteral">"-//W3C//DTD HTML 3.2 FINAL//EN"</span>&gt;';
<a name="l00152"></a>00152 echo <span class="stringliteral">"&lt;HTML&gt;"</span>;
<a name="l00153"></a>00153
<a name="l00154"></a>00154 <span class="keywordflow">if</span> ( $p_script2 != <span class="stringliteral">""</span> )
<a name="l00155"></a>00155 $p_script2='&lt;script src=<span class="stringliteral">"'.$p_script2.'"</span> type=<span class="stringliteral">"text/javascript"</span>&gt;&lt;/script&gt;';
<a name="l00156"></a>00156
<a name="l00157"></a>00157 echo <span class="stringliteral">"&lt;HEAD&gt; </span>
<a name="l00158"></a>00158 <span class="stringliteral"> &lt;TITLE&gt;PhpCompta&lt;/TITLE&gt;</span>
<a name="l00159"></a>00159 <span class="stringliteral"> &lt;META http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\"&gt;</span>
<a name="l00160"></a>00160 <span class="stringliteral"> &lt;LINK REL=\"stylesheet\" type=\"text/css\" href=\"$style\" media=\"screen\"&gt;</span>
<a name="l00161"></a>00161 <span class="stringliteral"> &lt;link rel=\"stylesheet\" type=\"text/css\" href=\"style-print.css\" media=\"print\"&gt;"</span>.
<a name="l00162"></a>00162 $p_script2. <span class="stringliteral">"</span>
<a name="l00163"></a>00163 <span class="stringliteral"> &lt;/HEAD&gt;&lt;script src=\"scripts.js\" type=\"text/javascript\"&gt;&lt;/script&gt;"</span>;
<a name="l00164"></a>00164 echo <span class="stringliteral">"&lt;BODY $p_script&gt;"</span>;
<a name="l00165"></a>00165 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a6"></a><!-- doxytag: member="ac_common.php::html_page_stop" ref="a6" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">html_page_stop </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
end tag
<p>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00170">170</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.<div class="fragment"><pre class="fragment"><a name="l00171"></a>00171 {
<a name="l00172"></a>00172 echo <span class="stringliteral">"&lt;/BODY&gt;"</span>;
<a name="l00173"></a>00173 echo <span class="stringliteral">"&lt;/HTML&gt;"</span>;
<a name="l00174"></a>00174 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a3"></a><!-- doxytag: member="ac_common.php::isDate" ref="a3" args="($p_date)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">isDate </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_date</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Verifie qu'une date est bien format<61> en d.m.y et est valable.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$p_date</em>&nbsp;</td><td></td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><ul>
<li>null si la date est invalide ou malformat<61></li></ul>
</dd></dl>
<ul>
<li>$p_date si tout est bon</li></ul>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00097">97</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>.
<p>
Referenced by <a class="el" href="ac__common_8php-source.html#l00053">cmpDate()</a>, <a class="el" href="class__action_8php-source.html#l00364">action::Confirm()</a>, <a class="el" href="user__form__ach_8php-source.html#l00269">form_verify_input()</a>, <a class="el" href="ac__common_8php-source.html#l00120">formatDate()</a>, <a class="el" href="user__common_8php-source.html#l00322">ListJrn()</a>, <a class="el" href="jrn_8php-source.html#l00834">VerifData()</a>, <a class="el" href="user__common_8php-source.html#l00654">VerifyOperationDate()</a>, and <a class="el" href="jrn_8php-source.html#l00583">ViewJrn()</a>.<div class="fragment"><pre class="fragment"><a name="l00097"></a>00097 {
<a name="l00098"></a>00098 <span class="keywordflow">if</span> ( strlen (trim($p_date)) == 0 ) <span class="keywordflow">return</span> null;
<a name="l00099"></a>00099 <span class="keywordflow">if</span> (! ereg (<span class="stringliteral">"^[0-9]{1,2}\.[0-9]{1,2}\.20[0-9]{2}"</span>,$p_date) ) {
<a name="l00100"></a>00100
<a name="l00101"></a>00101 <span class="keywordflow">return</span> null;
<a name="l00102"></a>00102 } <span class="keywordflow">else</span> {
<a name="l00103"></a>00103 $l_date=explode(<span class="stringliteral">"."</span>,$p_date);
<a name="l00104"></a>00104 <span class="keywordflow">if</span> ( $l_date[2] &gt; 2020 ) {
<a name="l00105"></a>00105 <span class="keywordflow">return</span> null;
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107 <a class="code" href="debug_8php.html#a0">echo_debug</a>('ac_common.php',__LINE__,' date = '.var_export($l_date,<span class="keyword">true</span>));
<a name="l00108"></a>00108 <span class="keywordflow">if</span> ( checkdate ($l_date[1],$l_date[0],$l_date[2]) == <span class="keyword">false</span>) {
<a name="l00109"></a>00109 <span class="keywordflow">return</span> null;
<a name="l00110"></a>00110 }
<a name="l00111"></a>00111
<a name="l00112"></a>00112 }<span class="comment">// !ereg</span>
<a name="l00113"></a>00113 <span class="keywordflow">return</span> $p_date;
<a name="l00114"></a>00114 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a2"></a><!-- doxytag: member="ac_common.php::isNumber" ref="a2" args="($p_int)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">isNumber </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_int</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
check if the argument is a number
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$p_int</em>&nbsp;</td><td>number to test</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><ul>
<li>1 it's a number</li><li>0 it is not</li></ul>
</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00076">76</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
Referenced by <a class="el" href="fiche__inc_8php-source.html#l00038">AddFiche()</a>, <a class="el" href="fiche__inc_8php-source.html#l00761">AddModele()</a>, <a class="el" href="user__common_8php-source.html#l00069">ComputeTotalVat()</a>, <a class="el" href="user__common_8php-source.html#l00172">ComputeVat()</a>, <a class="el" href="user__common_8php-source.html#l00727">DeleteRapt()</a>, <a class="el" href="user__form__ach_8php-source.html#l00269">form_verify_input()</a>, <a class="el" href="user__form__ach_8php-source.html#l00044">FormAchInput()</a>, <a class="el" href="user__form__ach_8php-source.html#l00471">FormAchView()</a>, <a class="el" href="user__form__ods_8php-source.html#l00045">FormODS()</a>, <a class="el" href="user__form__ven_8php-source.html#l00043">FormVenInput()</a>, <a class="el" href="user__form__ven_8php-source.html#l00425">FormVenteView()</a>, <a class="el" href="class__fiche_8php-source.html#l00542">fiche::insert()</a>, <a class="el" href="user__common_8php-source.html#l00699">InsertRapt()</a>, <a class="el" href="user__form__fin_8php-source.html#l00358">RecordFin()</a>, <a class="el" href="user__form__ven_8php-source.html#l00627">RecordInvoice()</a>, <a class="el" href="user__form__ods_8php-source.html#l00247">RecordODS()</a>, <a class="el" href="user__form__ach_8php-source.html#l00661">RecordSell()</a>, <a class="el" href="fiche__inc_8php-source.html#l00938">Remove()</a>, <a class="el" href="class__document__modele_8php-source.html#l00103">Document_modele::Save()</a>, and <a class="el" href="class__fiche_8php-source.html#l00642">fiche::update()</a>.<div class="fragment"><pre class="fragment"><a name="l00076"></a>00076 {
<a name="l00077"></a>00077 <span class="keywordflow">if</span> ( strlen (trim($p_int)) == 0 ) <span class="keywordflow">return</span> 0;
<a name="l00078"></a>00078 $p_int=trim($p_int);
<a name="l00079"></a>00079 <span class="keywordflow">if</span> (! ereg (<span class="stringliteral">"^-{0,1}[0-9]+.{0,1}[0-9]*$"</span>,$p_int) ) {
<a name="l00080"></a>00080 <span class="keywordflow">return</span> 0;
<a name="l00081"></a>00081 } <span class="keywordflow">else</span> {
<a name="l00082"></a>00082 <span class="keywordflow">return</span> 1;
<a name="l00083"></a>00083 }<span class="comment">// !ereg</span>
<a name="l00084"></a>00084 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a12"></a><!-- doxytag: member="ac_common.php::make_array" ref="a12" args="($p_cn, $p_sql, $p_null=0)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">make_array </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_cn</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_sql</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_null</em> = <code>0</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
make a array with the sql
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>$cn</em>&nbsp;</td><td>dbatabase connection </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$sql</em>&nbsp;</td><td>related sql</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>: a double array [value,label]</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00280">280</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="balance_8php-source.html#l00113">$a</a>, <a class="el" href="balance_8php-source.html#l00118">$i</a>, <a class="el" href="bank_8inc_8php-source.html#l00237">$r</a>, <a class="el" href="argenta__be_8inc_8php-source.html#l00028">$row</a>, <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>, <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>, <a class="el" href="balance_8php-source.html#l00076">label</a>, and <a class="el" href="action_8inc_8php-source.html#l00241">value</a>.
<p>
Referenced by <a class="el" href="class__action_8php-source.html#l00364">action::Confirm()</a>, <a class="el" href="class__action_8php-source.html#l00101">action::Display()</a>, <a class="el" href="class__document__modele_8php-source.html#l00252">Document_modele::form()</a>, <a class="el" href="user__form__ach_8php-source.html#l00044">FormAchInput()</a>, <a class="el" href="user__form__ven_8php-source.html#l00043">FormVenInput()</a>, <a class="el" href="user__form__ven_8php-source.html#l00425">FormVenteView()</a>, and <a class="el" href="import__inc_8php-source.html#l00174">ShowFormTransfert()</a>.<div class="fragment"><pre class="fragment"><a name="l00280"></a>00280 {
<a name="l00281"></a>00281 <a class="code" href="debug_8php.html#a0">echo_debug</a>('ac_common',__LINE__,$p_sql);
<a name="l00282"></a>00282 <a class="code" href="balance_8php.html#a10">$a</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,$p_sql);
<a name="l00283"></a>00283 $max=pg_NumRows($a);
<a name="l00284"></a>00284 <span class="keywordflow">if</span> ( $max==0) <span class="keywordflow">return</span> null;
<a name="l00285"></a>00285 <span class="keywordflow">for</span> ($i=0;$i&lt;$max;$i++) {
<a name="l00286"></a>00286 <a class="code" href="argenta__be_8inc_8php.html#a0">$row</a>=pg_fetch_row($a);
<a name="l00287"></a>00287 <a class="code" href="bank_8inc_8php.html#a29">$r</a>[<a class="code" href="balance_8php.html#a12">$i</a>]['<a class="code" href="action_8inc_8php.html#a19">value</a>']=<a class="code" href="argenta__be_8inc_8php.html#a0">$row</a>[0];
<a name="l00288"></a>00288 <a class="code" href="bank_8inc_8php.html#a29">$r</a>[<a class="code" href="balance_8php.html#a12">$i</a>]['<a class="code" href="balance_8php.html#a6">label</a>']=<a class="code" href="argenta__be_8inc_8php.html#a0">$row</a>[1];
<a name="l00289"></a>00289 }
<a name="l00290"></a>00290 <span class="comment">// add a blank item ?</span>
<a name="l00291"></a>00291 <span class="keywordflow">if</span> ( $p_null == 1 ) {
<a name="l00292"></a>00292 <span class="keywordflow">for</span> ($i=$max;$i!=0;$i--) {
<a name="l00293"></a>00293 <a class="code" href="bank_8inc_8php.html#a29">$r</a>[<a class="code" href="balance_8php.html#a12">$i</a>]['<a class="code" href="action_8inc_8php.html#a19">value</a>']= <a class="code" href="bank_8inc_8php.html#a29">$r</a>[<a class="code" href="balance_8php.html#a12">$i</a>-1]['<a class="code" href="action_8inc_8php.html#a19">value</a>'];
<a name="l00294"></a>00294 <a class="code" href="bank_8inc_8php.html#a29">$r</a>[<a class="code" href="balance_8php.html#a12">$i</a>]['<a class="code" href="balance_8php.html#a6">label</a>']= <a class="code" href="bank_8inc_8php.html#a29">$r</a>[<a class="code" href="balance_8php.html#a12">$i</a>-1]['<a class="code" href="balance_8php.html#a6">label</a>'];
<a name="l00295"></a>00295 }
<a name="l00296"></a>00296 <a class="code" href="bank_8inc_8php.html#a29">$r</a>[0]['<a class="code" href="action_8inc_8php.html#a19">value</a>']=-1;
<a name="l00297"></a>00297 <a class="code" href="bank_8inc_8php.html#a29">$r</a>[0]['<a class="code" href="balance_8php.html#a6">label</a>']=<span class="stringliteral">" "</span>;
<a name="l00298"></a>00298 } <span class="comment">// if ( $p_null == 1 ) </span>
<a name="l00299"></a>00299
<a name="l00300"></a>00300 <span class="keywordflow">return</span> <a class="code" href="bank_8inc_8php.html#a29">$r</a>;
<a name="l00301"></a>00301 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a8"></a><!-- doxytag: member="ac_common.php::NoAccess" ref="a8" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">NoAccess </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Echo no access and stop.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>nothing</dd></dl>
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00192">192</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="balance_8php-source.html#l00036">exit</a>.<div class="fragment"><pre class="fragment"><a name="l00193"></a>00193 {
<a name="l00194"></a>00194 echo <span class="stringliteral">"&lt;script&gt;"</span>;
<a name="l00195"></a>00195 echo <span class="stringliteral">"alert ('Cette action ne vous est pas autoris<69>e Contactez votre responsable');"</span>;
<a name="l00196"></a>00196 echo <span class="stringliteral">"&lt;/script&gt;"</span>;
<a name="l00197"></a>00197 <a class="code" href="balance_8php.html#a0">exit</a> -1;
<a name="l00198"></a>00198 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a10"></a><!-- doxytag: member="ac_common.php::ShowItem" ref="a10" args="($p_array, $p_dir='V', $class=&quot;mtitle&quot;, $class_ref=&quot;mtitle&quot;, $default=&quot;&quot;, $p_extra=&quot;&quot;)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">ShowItem </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_array</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_dir</em> = <code>'V'</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>class</em> = <code>&quot;mtitle&quot;</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>class_ref</em> = <code>&quot;mtitle&quot;</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>default</em> = <code>&quot;&quot;</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_extra</em> = <code>&quot;&quot;</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
store the string which print
<p>
/*
<p>
Definition at line <a class="el" href="ac__common_8php-source.html#l00226">226</a> of file <a class="el" href="ac__common_8php-source.html">ac_common.php</a>.
<p>
References <a class="el" href="impress__bilan_8php-source.html#l00032">$ret</a>.
<p>
Referenced by <a class="el" href="user__menu_8php-source.html#l00557">MenuAdmin()</a>, <a class="el" href="user__menu_8php-source.html#l00503">ShowJrn()</a>, <a class="el" href="user__menu_8php-source.html#l00477">ShowMenuAdvanced()</a>, <a class="el" href="user__menu_8php-source.html#l00132">ShowMenuCompta()</a>, <a class="el" href="user__menu_8php-source.html#l00577">ShowMenuDocument()</a>, and <a class="el" href="user__menu_8php-source.html#l00597">ShowMenuParam()</a>.<div class="fragment"><pre class="fragment"><a name="l00227"></a>00227 {
<a name="l00228"></a>00228 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>=<span class="stringliteral">"&lt;TABLE $p_extra&gt;"</span>;
<a name="l00229"></a>00229 <span class="comment">// direction Vertical</span>
<a name="l00230"></a>00230 <span class="keywordflow">if</span> ( $p_dir == <span class="charliteral">'V'</span>) {
<a name="l00231"></a>00231 foreach ($p_array as $all=&gt;$href){
<a name="l00232"></a>00232 $title=<span class="stringliteral">""</span>;
<a name="l00233"></a>00233 <span class="keywordflow">if</span> ( isset ($href[2] ))
<a name="l00234"></a>00234 $title=$href[2];
<a name="l00235"></a>00235 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>.='&lt;TR&gt;&lt;TD CLASS=<span class="stringliteral">"'.$class.'"</span>&gt;&lt;A <span class="keyword">class</span>=<span class="stringliteral">"'.$class_ref.'"</span> HREF=<span class="stringliteral">"'.$href[0].'"</span> title=<span class="stringliteral">"'.$title.'"</span>&gt;'.$href[1].'&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;';
<a name="l00236"></a>00236 }
<a name="l00237"></a>00237 }
<a name="l00238"></a>00238 <span class="comment">//direction Horizontal</span>
<a name="l00239"></a>00239 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( $p_dir == <span class="charliteral">'H'</span> ) {
<a name="l00240"></a>00240 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>.=<span class="stringliteral">"&lt;TR&gt;"</span>;
<a name="l00241"></a>00241 foreach ($p_array as $all=&gt;$href){
<a name="l00242"></a>00242 $title=<span class="stringliteral">""</span>;
<a name="l00243"></a>00243 <span class="keywordflow">if</span> ( isset ($href[2] ))
<a name="l00244"></a>00244 $title=$href[2];
<a name="l00245"></a>00245 <span class="keywordflow">if</span> ( $<span class="keywordflow">default</span>== $href[0]) {
<a name="l00246"></a>00246 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>.='&lt;TD CLASS=<span class="stringliteral">"selectedcell"</span>&gt;'.$href[1].'&lt;/TD&gt;';
<a name="l00247"></a>00247
<a name="l00248"></a>00248 } <span class="keywordflow">else</span> {
<a name="l00249"></a>00249 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>.='&lt;TD CLASS=<span class="stringliteral">"'.$class.'"</span>&gt;&lt;A <span class="keyword">class</span>=<span class="stringliteral">"'.$class_ref.'"</span> HREF=<span class="stringliteral">"'.$href[0].'"</span> title=<span class="stringliteral">"'.$title.'"</span>&gt;'.$href[1].'&lt;/A&gt;&lt;/TD&gt;';
<a name="l00250"></a>00250 }
<a name="l00251"></a>00251 }
<a name="l00252"></a>00252 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>.=<span class="stringliteral">"&lt;/TR&gt;"</span>;
<a name="l00253"></a>00253 }
<a name="l00254"></a>00254 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>.=<span class="stringliteral">"&lt;/TABLE&gt;"</span>;
<a name="l00255"></a>00255 <span class="keywordflow">return</span> <a class="code" href="impress__bilan_8php.html#a0">$ret</a>;
<a name="l00256"></a>00256 }
</pre></div>
<p>
</td>
</tr>
</table>
</BODY>
</HTML>