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

1520 lines
100 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: postgres.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>postgres.php File Reference</h1>Contains the procedure for connecting to postgresql. <a href="#_details">More...</a>
<p>
<p>
<a href="postgres_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="postgres_8php.html#a0">ShowDossier</a> ($p_type, $p_first=0, $p_max=10, $p_Num=0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a1">DbConnect</a> ($p_db=-1, $p_type='dossier')</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">connect to the database <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="postgres_8php.html#a2">ExecSql</a> ($p_connection, $p_string)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">send a sql string to the database <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="postgres_8php.html#a3">GetAllUser</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return all the users as an array. <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="postgres_8php.html#a4">GetUid</a> ($p_uid)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Check if the User is valid and return an array with his property. <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="postgres_8php.html#a5">GetPriv</a> ($p_dossier, $p_login)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the privilege of an user on a folder. <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="postgres_8php.html#a6">ExisteJnt</a> ($p_dossier, $p_user)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the number of rows from table jnt_use_dos where $p_dossier = dos_id and use_id=$p_user. <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="postgres_8php.html#a7">ExistePriv</a> ($p_jntid)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a8">GetJnt</a> ($p_dossier, $p_user)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a9">GetDbId</a> ($p_name)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a10">CountSql</a> ($p_conn, $p_sql)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a11">GetDossierName</a> ($p_dossier)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a12">GetSequence</a> ($p_cn, $p_seq)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">get the current sequence <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="postgres_8php.html#a13">NextSequence</a> ($p_cn, $p_seq)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">get the current sequence <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="postgres_8php.html#a14">StartSql</a> ($p_cn)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a15">EndSql</a> ($p_cn)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a16">Commit</a> ($p_cn)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a17">Rollback</a> ($p_cn)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a18">AlterSequence</a> ($p_cn, $p_name, $<a class="el" href="poste_8inc_8php.html#a2">p_value</a>)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a19">GetLogin</a> ($p_uid)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a20">SyncRight</a> ($p_dossier, $p_user)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Synchronize les droits par d<>faut avec les journaux existants. <a href="#a20"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a21">GetUserProperty</a> ($p_cn, $p_user)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the properties of an user it means theme, profile, admin... <a href="#a21"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a22">GetModeleId</a> ($p_cn, $p_modname)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Give the mod_id from modeledef. <a href="#a22"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a23">GetArray</a> ($p_cn, $p_sql)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">purpose return the result of a sql statment in a array <a href="#a23"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a24">save_upload_document</a> ($cn, $seq)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Save a "piece justificative". <a href="#a24"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="postgres_8php.html#a25">getDbValue</a> ($p_cn, $sql)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">return the value of the sql, the sql will return only one value with the value <a href="#a25"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Contains the procedure for connecting to postgresql.
<p>
<p>
Definition in file <a class="el" href="postgres_8php-source.html">postgres.php</a>.<hr><h2>Function Documentation</h2>
<a class="anchor" name="a18"></a><!-- doxytag: member="postgres.php::AlterSequence" ref="a18" args="($p_cn, $p_name, $p_value)" --><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">AlterSequence </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_name</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_value</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>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00269">269</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.<div class="fragment"><pre class="fragment"><a name="l00269"></a>00269 {
<a name="l00270"></a>00270
<a name="l00271"></a>00271 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,<span class="stringliteral">"alter sequence $p_name restart $p_value"</span>);
<a name="l00272"></a>00272 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a16"></a><!-- doxytag: member="postgres.php::Commit" ref="a16" args="($p_cn)" --><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">Commit </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_cn</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>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00263">263</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.
<p>
Referenced by <a class="el" href="central__inc_8php-source.html#l00036">Centralise()</a>, <a class="el" href="class__document__modele_8php-source.html#l00179">Document_modele::Delete()</a>, <a class="el" href="class__document_8php-source.html#l00079">Document::Generate()</a>, <a class="el" href="class__document__modele_8php-source.html#l00204">Document_modele::Get()</a>, <a class="el" href="import__inc_8php-source.html#l00037">ImportCSV()</a>, <a class="el" href="class__fiche_8php-source.html#l00542">fiche::insert()</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="class__document__modele_8php-source.html#l00103">Document_modele::Save()</a>, <a class="el" href="class__document_8php-source.html#l00256">Document::SaveGenerated()</a>, <a class="el" href="class__document_8php-source.html#l00355">Document::Send()</a>, <a class="el" href="import__inc_8php-source.html#l00090">TransferCSV()</a>, and <a class="el" href="class__document_8php-source.html#l00289">Document::Upload()</a>.<div class="fragment"><pre class="fragment"><a name="l00263"></a>00263 {
<a name="l00264"></a>00264 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,<span class="stringliteral">"commit"</span>);
<a name="l00265"></a>00265 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a10"></a><!-- doxytag: member="postgres.php::CountSql" ref="a10" args="($p_conn, $p_sql)" --><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">CountSql </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_conn</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"></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>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00222">222</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.
<p>
Referenced by <a class="el" href="class__user_8php-source.html#l00158">cl_user::AccessJrn()</a>, <a class="el" href="fiche__inc_8php-source.html#l00038">AddFiche()</a>, <a class="el" href="class__user_8php-source.html#l00143">cl_user::Admin()</a>, <a class="el" href="check__priv_8php-source.html#l00192">CheckDossier()</a>, <a class="el" href="check__priv_8php-source.html#l00167">CheckIsAdmin()</a>, <a class="el" href="check__priv_8php-source.html#l00046">CheckJrn()</a>, <a class="el" href="user__common_8php-source.html#l00727">DeleteRapt()</a>, <a class="el" href="class__action_8php-source.html#l00101">action::Display()</a>, <a class="el" href="user__form__ach_8php-source.html#l00269">form_verify_input()</a>, <a class="el" href="user__form__ods_8php-source.html#l00045">FormODS()</a>, <a class="el" href="user__form__ven_8php-source.html#l00425">FormVenteView()</a>, <a class="el" href="fiche__inc_8php-source.html#l01450">GetParent()</a>, <a class="el" href="impress__inc_8php-source.html#l00616">GetRappel()</a>, <a class="el" href="class__fiche_8php-source.html#l00119">fiche_def::HasAttribute()</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__common_8php-source.html#l00322">ListJrn()</a>, <a class="el" href="class__action_8php-source.html#l00638">action::myList()</a>, <a class="el" href="jrn_8php-source.html#l00930">NextJrn()</a>, <a class="el" href="fiche__inc_8php-source.html#l00938">Remove()</a>, <a class="el" href="postgres_8php-source.html#l00032">ShowDossier()</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>, and <a class="el" href="fiche__inc_8php-source.html#l00394">ViewFiche()</a>.<div class="fragment"><pre class="fragment"><a name="l00223"></a>00223 {
<a name="l00224"></a>00224 $r_sql=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_conn,$p_sql);
<a name="l00225"></a>00225 <span class="keywordflow">return</span> pg_NumRows($r_sql);
<a name="l00226"></a>00226
<a name="l00227"></a>00227 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a1"></a><!-- doxytag: member="postgres.php::DbConnect" ref="a1" args="($p_db=-1, $p_type='dossier')" --><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">DbConnect </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_db</em> = <code>-1</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_type</em> = <code>'dossier'</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>
connect to 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>:</em>&nbsp;</td><td>p_db : db_name </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>the connection</dd></dl>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00072">72</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="balance_8php-source.html#l00113">$a</a>, and <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>.
<p>
Referenced by <a class="el" href="class__user_8php-source.html#l00143">cl_user::Admin()</a>, <a class="el" href="class__user_8php-source.html#l00085">cl_user::Check()</a>, <a class="el" href="check__priv_8php-source.html#l00146">CheckAction()</a>, <a class="el" href="check__priv_8php-source.html#l00192">CheckDossier()</a>, <a class="el" href="check__priv_8php-source.html#l00167">CheckIsAdmin()</a>, <a class="el" href="check__priv_8php-source.html#l00046">CheckJrn()</a>, <a class="el" href="class__user_8php-source.html#l00040">cl_user::cl_user()</a>, <a class="el" href="postgres_8php-source.html#l00168">ExisteJnt()</a>, <a class="el" href="postgres_8php-source.html#l00179">ExistePriv()</a>, <a class="el" href="postgres_8php-source.html#l00117">GetAllUser()</a>, <a class="el" href="user__menu_8php-source.html#l00090">GetAvailableFolder()</a>, <a class="el" href="postgres_8php-source.html#l00201">GetDbId()</a>, <a class="el" href="postgres_8php-source.html#l00232">GetDossierName()</a>, <a class="el" href="user__menu_8php-source.html#l00186">GetFirstJrnIdForJrnType()</a>, <a class="el" href="postgres_8php-source.html#l00190">GetJnt()</a>, <a class="el" href="jrn_8php-source.html#l00549">GetJrnProp()</a>, <a class="el" href="postgres_8php-source.html#l00273">GetLogin()</a>, <a class="el" href="poste_8php-source.html#l00062">GetNumberLine()</a>, <a class="el" href="poste_8php-source.html#l00036">GetPosteLibelle()</a>, <a class="el" href="postgres_8php-source.html#l00147">GetPriv()</a>, <a class="el" href="postgres_8php-source.html#l00134">GetUid()</a>, <a class="el" href="ac__common_8php-source.html#l00133">html_page_start()</a>, <a class="el" href="user__common_8php-source.html#l00322">ListJrn()</a>, <a class="el" href="user__menu_8php-source.html#l00630">MenuJrn()</a>, <a class="el" href="impress__inc_8php-source.html#l00726">ParseFormula()</a>, <a class="el" href="jrn_8php-source.html#l00038">RecordJrn()</a>, <a class="el" href="postgres_8php-source.html#l00032">ShowDossier()</a>, <a class="el" href="user__menu_8php-source.html#l00683">ShowMenuComptaForm()</a>, <a class="el" href="user__menu_8php-source.html#l00527">ShowMenuFiche()</a>, <a class="el" href="user__menu_8php-source.html#l00213">ShowMenuJrnUser()</a>, <a class="el" href="postgres_8php-source.html#l00289">SyncRight()</a>, and <a class="el" href="jrn_8php-source.html#l00583">ViewJrn()</a>.<div class="fragment"><pre class="fragment"><a name="l00072"></a>00072 {
<a name="l00073"></a>00073 <span class="keywordflow">if</span> ( $p_db==-1)
<a name="l00074"></a>00074 $l_dossier=sprintf(<span class="stringliteral">"%saccount_repository"</span>,<a class="code" href="constant_8php.html#a1">domaine</a>);
<a name="l00075"></a>00075 <span class="keywordflow">else</span> {
<a name="l00076"></a>00076 <span class="keywordflow">if</span> ( $p_db == -2 )
<a name="l00077"></a>00077 $l_dossier=$p_type;
<a name="l00078"></a>00078 <span class="keywordflow">else</span>
<a name="l00079"></a>00079 <span class="keywordflow">switch</span> ($p_type) {
<a name="l00080"></a>00080 <span class="keywordflow">case</span> 'dossier':
<a name="l00081"></a>00081 $l_dossier=sprintf(<span class="stringliteral">"%sdossier%d"</span>,<a class="code" href="constant_8php.html#a1">domaine</a>,$p_db);
<a name="l00082"></a>00082 <span class="keywordflow">break</span>;
<a name="l00083"></a>00083 <span class="keywordflow">case</span> 'mod':
<a name="l00084"></a>00084 $l_dossier=sprintf(<span class="stringliteral">"%smod%d"</span>,<a class="code" href="constant_8php.html#a1">domaine</a>,$p_db);
<a name="l00085"></a>00085 <span class="keywordflow">break</span>;
<a name="l00086"></a>00086 }
<a name="l00087"></a>00087 }
<a name="l00088"></a>00088 $password=<a class="code" href="constant_8php.html#a0">phpcompta_password</a>;
<a name="l00089"></a>00089 <a class="code" href="balance_8php.html#a10">$a</a>=pg_connect(<span class="stringliteral">"dbname=$l_dossier host=127.0.0.1 user='phpcompta' password='$password'"</span>);
<a name="l00090"></a>00090 <a class="code" href="debug_8php.html#a0">echo_debug</a> ('postgres.php',__LINE__,<span class="stringliteral">"connect to $p_db dbname $l_dossier"</span>);
<a name="l00091"></a>00091 <span class="keywordflow">return</span> <a class="code" href="balance_8php.html#a10">$a</a>;
<a name="l00092"></a>00092 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a15"></a><!-- doxytag: member="postgres.php::EndSql" ref="a15" args="($p_cn)" --><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">EndSql </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_cn</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>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00260">260</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.
<p>
Referenced by <a class="el" href="central__inc_8php-source.html#l00036">Centralise()</a>.<div class="fragment"><pre class="fragment"><a name="l00260"></a>00260 {
<a name="l00261"></a>00261 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,<span class="stringliteral">"end transaction"</span>);
<a name="l00262"></a>00262 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a2"></a><!-- doxytag: member="postgres.php::ExecSql" ref="a2" args="($p_connection, $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">ExecSql </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_connection</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_string</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>
send a sql string to 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_connection</em>&nbsp;</td><td>db connection </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$p_string</em>&nbsp;</td><td>sql string </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>false if error otherwise true</dd></dl>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00099">99</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="impress__bilan_8php-source.html#l00032">$ret</a>, <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>, <a class="el" href="ac__common_8php-source.html#l00036">echo_error()</a>, and <a class="el" href="balance_8php-source.html#l00036">exit</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="postgres_8php-source.html#l00269">AlterSequence()</a>, <a class="el" href="class__fiche_8php-source.html#l00399">fiche::blank()</a>, <a class="el" href="class__document_8php-source.html#l00049">Document::blank()</a>, <a class="el" href="central__inc_8php-source.html#l00036">Centralise()</a>, <a class="el" href="class__user_8php-source.html#l00236">cl_user::CheckAction()</a>, <a class="el" href="check__priv_8php-source.html#l00146">CheckAction()</a>, <a class="el" href="check__priv_8php-source.html#l00046">CheckJrn()</a>, <a class="el" href="postgres_8php-source.html#l00263">Commit()</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="postgres_8php-source.html#l00222">CountSql()</a>, <a class="el" href="class__document__modele_8php-source.html#l00179">Document_modele::Delete()</a>, <a class="el" href="form__inc_8php-source.html#l00134">DeleteForm()</a>, <a class="el" href="user__common_8php-source.html#l00727">DeleteRapt()</a>, <a class="el" href="class__fiche_8php-source.html#l00461">fiche::Display()</a>, <a class="el" href="fiche__inc_8php-source.html#l01390">DisplayDetailModele()</a>, <a class="el" href="fiche__inc_8php-source.html#l00225">EncodeFiche()</a>, <a class="el" href="postgres_8php-source.html#l00260">EndSql()</a>, <a class="el" href="setup_8php-source.html#l00104">ExecuteScript()</a>, <a class="el" href="postgres_8php-source.html#l00168">ExisteJnt()</a>, <a class="el" href="postgres_8php-source.html#l00179">ExistePriv()</a>, <a class="el" href="preference_8php-source.html#l00071">FormPeriode()</a>, <a class="el" href="preference_8php-source.html#l00037">FormPeriodeMult()</a>, <a class="el" href="class__document_8php-source.html#l00079">Document::Generate()</a>, <a class="el" href="class__poste_8php-source.html#l00100">poste::get()</a>, <a class="el" href="class__parm__code_8php-source.html#l00141">parm_code::Get()</a>, <a class="el" href="class__fiche__def_8php-source.html#l00131">fiche_def_ref::Get()</a>, <a class="el" href="class__fiche_8php-source.html#l00074">fiche_def::Get()</a>, <a class="el" href="class__document__type_8php-source.html#l00043">Document_type::get()</a>, <a class="el" href="class__document__modele_8php-source.html#l00204">Document_modele::Get()</a>, <a class="el" href="class__action_8php-source.html#l00315">action::get()</a>, <a class="el" href="fiche__inc_8php-source.html#l01181">Get_attr_def()</a>, <a class="el" href="fiche__inc_8php-source.html#l01149">Get_attr_min()</a>, <a class="el" href="fiche__inc_8php-source.html#l01115">Get_fiche_def_ref()</a>, <a class="el" href="class__fiche_8php-source.html#l00094">fiche_def::GetAll()</a>, <a class="el" href="postgres_8php-source.html#l00117">GetAllUser()</a>, <a class="el" href="jrn_8php-source.html#l00814">GetAmount()</a>, <a class="el" href="postgres_8php-source.html#l00353">GetArray()</a>, <a class="el" href="class__fiche_8php-source.html#l00190">fiche::getAttribut()</a>, <a class="el" href="class__fiche_8php-source.html#l00051">fiche_def::GetAttribut()</a>, <a class="el" href="user__menu_8php-source.html#l00090">GetAvailableFolder()</a>, <a class="el" href="fiche__inc_8php-source.html#l00352">GetBaseFiche()</a>, <a class="el" href="fiche__inc_8php-source.html#l00374">GetBaseFicheDefault()</a>, <a class="el" href="class__fiche_8php-source.html#l00317">fiche::GetByDef()</a>, <a class="el" href="class__fiche_8php-source.html#l00167">fiche::GetByQCode()</a>, <a class="el" href="class__fiche_8php-source.html#l00260">fiche::GetByType()</a>, <a class="el" href="fiche__inc_8php-source.html#l01313">GetClass()</a>, <a class="el" href="user__common_8php-source.html#l00758">GetConcerned()</a>, <a class="el" href="fiche__inc_8php-source.html#l01214">GetCreateAccount()</a>, <a class="el" href="jrn_8php-source.html#l00711">GetData()</a>, <a class="el" href="form__inc_8php-source.html#l00149">GetDataForm()</a>, <a class="el" href="impress__inc_8php-source.html#l00582">GetDataGrpt()</a>, <a class="el" href="impress__inc_8php-source.html#l00308">GetDataJrn()</a>, <a class="el" href="jrn_8php-source.html#l00973">GetDataJrnJrId()</a>, <a class="el" href="impress__inc_8php-source.html#l00423">GetDataJrnPdf()</a>, <a class="el" href="fiche__inc_8php-source.html#l00895">GetDataModele()</a>, <a class="el" href="impress__inc_8php-source.html#l00267">GetDataPoste()</a>, <a class="el" href="postgres_8php-source.html#l00201">GetDbId()</a>, <a class="el" href="postgres_8php-source.html#l00414">getDbValue()</a>, <a class="el" href="class__jrn_8php-source.html#l00321">jrn::GetDefLine()</a>, <a class="el" href="postgres_8php-source.html#l00232">GetDossierName()</a>, <a class="el" href="preference_8php-source.html#l00168">GetExercice()</a>, <a class="el" href="class__user_8php-source.html#l00345">cl_user::getExercice()</a>, <a class="el" href="fiche__inc_8php-source.html#l01474">getFicheAttribut()</a>, <a class="el" href="fiche__inc_8php-source.html#l01282">GetFicheDef()</a>, <a class="el" href="fiche__inc_8php-source.html#l01038">getFicheDefName()</a>, <a class="el" href="fiche__inc_8php-source.html#l01251">GetFicheDefRef()</a>, <a class="el" href="fiche__inc_8php-source.html#l01057">GetFicheJrn()</a>, <a class="el" href="fiche__inc_8php-source.html#l00988">getFicheName()</a>, <a class="el" href="fiche__inc_8php-source.html#l01010">getFicheNameById()</a>, <a class="el" href="stock__inc_8php-source.html#l00111">getFicheNameCode()</a>, <a class="el" href="user__menu_8php-source.html#l00186">GetFirstJrnIdForJrnType()</a>, <a class="el" href="form__inc_8php-source.html#l00195">GetFormName()</a>, <a class="el" href="impress__inc_8php-source.html#l00814">GetFormulaValue()</a>, <a class="el" href="class__supplier_8php-source.html#l00057">Supplier::GetFromPoste()</a>, <a class="el" href="class__customer_8php-source.html#l00057">Customer::GetFromPoste()</a>, <a class="el" href="class__user_8php-source.html#l00256">cl_user::GetGlobalPref()</a>, <a class="el" href="user__common_8php-source.html#l00789">GetGrpt()</a>, <a class="el" href="jrn_8php-source.html#l00793">GetInternal()</a>, <a class="el" href="postgres_8php-source.html#l00190">GetJnt()</a>, <a class="el" href="jrn_8php-source.html#l00907">GetJrnName()</a>, <a class="el" href="jrn_8php-source.html#l00549">GetJrnProp()</a>, <a class="el" href="jrn_8php-source.html#l00523">GetJrnProperty()</a>, <a class="el" href="postgres_8php-source.html#l00273">GetLogin()</a>, <a class="el" href="postgres_8php-source.html#l00340">GetModeleId()</a>, <a class="el" href="class__jrn_8php-source.html#l00034">jrn::GetName()</a>, <a class="el" href="class__fiche_8php-source.html#l00758">fiche::getName()</a>, <a class="el" href="fiche__inc_8php-source.html#l00462">GetNextFiche()</a>, <a class="el" href="form__inc_8php-source.html#l00180">GetNumberLine()</a>, <a class="el" href="preference_8php-source.html#l00125">GetPeriode()</a>, <a class="el" href="ac__common_8php-source.html#l00353">getPeriodeFromDate()</a>, <a class="el" href="ac__common_8php-source.html#l00333">getPeriodeFromMonth()</a>, <a class="el" href="poste_8php-source.html#l00036">GetPosteLibelle()</a>, <a class="el" href="class__user_8php-source.html#l00204">cl_user::GetPreferences()</a>, <a class="el" href="postgres_8php-source.html#l00147">GetPriv()</a>, <a class="el" href="stock__inc_8php-source.html#l00276">GetQuantity()</a>, <a class="el" href="impress__inc_8php-source.html#l00616">GetRappel()</a>, <a class="el" href="class__rapport_8php-source.html#l00053">rapport::GetRow()</a>, <a class="el" href="class__poste_8php-source.html#l00048">poste::GetRow()</a>, <a class="el" href="class__jrn_8php-source.html#l00065">jrn::GetRow()</a>, <a class="el" href="class__balance_8php-source.html#l00053">Balance::GetRow()</a>, <a class="el" href="class__jrn_8php-source.html#l00243">jrn::GetRowSimple()</a>, <a class="el" href="postgres_8php-source.html#l00242">GetSequence()</a>, <a class="el" href="poste_8php-source.html#l00114">GetSolde()</a>, <a class="el" href="class__poste_8php-source.html#l00119">poste::GetSolde()</a>, <a class="el" href="class__poste_8php-source.html#l00141">poste::GetSoldeDetail()</a>, <a class="el" href="user__common_8php-source.html#l00211">GetTvaPoste()</a>, <a class="el" href="user__common_8php-source.html#l00040">GetTvaRate()</a>, <a class="el" href="postgres_8php-source.html#l00134">GetUid()</a>, <a class="el" href="postgres_8php-source.html#l00315">GetUserProperty()</a>, <a class="el" href="setup_8php-source.html#l00087">GetVersion()</a>, <a class="el" href="ac__common_8php-source.html#l00133">html_page_start()</a>, <a class="el" href="impress__inc_8php-source.html#l00119">ImpHtml()</a>, <a class="el" href="class__fiche_8php-source.html#l00542">fiche::insert()</a>, <a class="el" href="class__user_8php-source.html#l00298">cl_user::insert_default_global_pref()</a>, <a class="el" href="user__common_8php-source.html#l00288">InsertJrn()</a>, <a class="el" href="user__common_8php-source.html#l00244">InsertJrnx()</a>, <a class="el" href="fiche__inc_8php-source.html#l01343">InsertModeleLine()</a>, <a class="el" href="user__common_8php-source.html#l00699">InsertRapt()</a>, <a class="el" href="user__common_8php-source.html#l00596">InsertStockGoods()</a>, <a class="el" href="central__inc_8php-source.html#l00159">isCentralize()</a>, <a class="el" href="fiche__inc_8php-source.html#l01514">IsFicheOfJrn()</a>, <a class="el" href="user__common_8php-source.html#l00831">isValid()</a>, <a class="el" href="user__common_8php-source.html#l00322">ListJrn()</a>, <a class="el" href="class__parm__code_8php-source.html#l00052">parm_code::LoadAll()</a>, <a class="el" href="class__fiche__def_8php-source.html#l00051">fiche_def_ref::LoadAll()</a>, <a class="el" href="ac__common_8php-source.html#l00280">make_array()</a>, <a class="el" href="user__menu_8php-source.html#l00630">MenuJrn()</a>, <a class="el" href="class__document_8php-source.html#l00751">Document::MoveDocumentPj()</a>, <a class="el" href="class__document__modele_8php-source.html#l00049">Document_modele::myList()</a>, <a class="el" href="class__action_8php-source.html#l00638">action::myList()</a>, <a class="el" href="fiche__new_8php-source.html#l00060">new_fiche()</a>, <a class="el" href="postgres_8php-source.html#l00251">NextSequence()</a>, <a class="el" href="class__own_8php-source.html#l00031">Own::Own()</a>, <a class="el" href="impress__inc_8php-source.html#l00726">ParseFormula()</a>, <a class="el" href="preference_8php-source.html#l00146">PeriodeClosed()</a>, <a class="el" href="poste_8php-source.html#l00087">PosteForm()</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="jrn_8php-source.html#l00038">RecordJrn()</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__fiche_8php-source.html#l00738">fiche::remove()</a>, <a class="el" href="class__document_8php-source.html#l00740">Document::remove()</a>, <a class="el" href="postgres_8php-source.html#l00266">Rollback()</a>, <a class="el" href="class__parm__code_8php-source.html#l00076">parm_code::Save()</a>, <a class="el" href="class__fiche__def_8php-source.html#l00117">fiche_def_ref::Save()</a>, <a class="el" href="class__document__modele_8php-source.html#l00103">Document_modele::Save()</a>, <a class="el" href="class__document_8php-source.html#l00063">Document::save()</a>, <a class="el" href="postgres_8php-source.html#l00371">save_upload_document()</a>, <a class="el" href="class__document_8php-source.html#l00256">Document::SaveGenerated()</a>, <a class="el" href="fiche__inc_8php-source.html#l01364">SaveModeleName()</a>, <a class="el" href="class__action_8php-source.html#l00504">action::SaveStage2()</a>, <a class="el" href="class__document_8php-source.html#l00355">Document::Send()</a>, <a class="el" href="jrn_8php-source.html#l00949">SetInternalCode()</a>, <a class="el" href="class__user_8php-source.html#l00178">cl_user::SetPeriode()</a>, <a class="el" href="preference_8php-source.html#l00185">ShowDevise()</a>, <a class="el" href="postgres_8php-source.html#l00032">ShowDossier()</a>, <a class="el" href="user__menu_8php-source.html#l00683">ShowMenuComptaForm()</a>, <a class="el" href="user__menu_8php-source.html#l00527">ShowMenuFiche()</a>, <a class="el" href="user__menu_8php-source.html#l00300">ShowMenuJrn()</a>, <a class="el" href="user__menu_8php-source.html#l00213">ShowMenuJrnUser()</a>, <a class="el" href="preference_8php-source.html#l00224">ShowPeriode()</a>, <a class="el" href="postgres_8php-source.html#l00257">StartSql()</a>, <a class="el" href="class__fiche_8php-source.html#l00366">fiche::strAttribut()</a>, <a class="el" href="postgres_8php-source.html#l00289">SyncRight()</a>, <a class="el" href="import__inc_8php-source.html#l00090">TransferCSV()</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="class__user_8php-source.html#l00330">cl_user::update_global_pref()</a>, <a class="el" href="user__common_8php-source.html#l00811">UpdateComment()</a>, <a class="el" href="import__inc_8php-source.html#l00060">UpdateCSV()</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__document_8php-source.html#l00289">Document::Upload()</a>, <a class="el" href="class__customer_8php-source.html#l00084">Customer::VatListing()</a>, <a class="el" href="import__inc_8php-source.html#l00067">VerifImport()</a>, <a class="el" href="stock__inc_8php-source.html#l00147">ViewDetailStock()</a>, <a class="el" href="fiche__inc_8php-source.html#l00394">ViewFiche()</a>, <a class="el" href="fiche__inc_8php-source.html#l00492">ViewFicheDetail()</a>, <a class="el" href="jrn_8php-source.html#l00583">ViewJrn()</a>, and <a class="el" href="stock__inc_8php-source.html#l00035">ViewStock()</a>.<div class="fragment"><pre class="fragment"><a name="l00099"></a>00099 {
<a name="l00100"></a>00100 <a class="code" href="debug_8php.html#a0">echo_debug</a>('postgres.php',__LINE__,<span class="stringliteral">"SQL = $p_string"</span>);
<a name="l00101"></a>00101 <span class="comment">// probl. with Ubuntu &amp; UTF8</span>
<a name="l00102"></a>00102 <span class="comment">//----</span>
<a name="l00103"></a>00103 pg_set_client_encoding($p_connection,'latin1');
<a name="l00104"></a>00104 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>=pg_query($p_connection,$p_string);
<a name="l00105"></a>00105 <span class="keywordflow">if</span> ( $ret == <span class="keyword">false</span> ) {
<a name="l00106"></a>00106 <a class="code" href="ac__common_8php.html#a0">echo_error</a> (<span class="stringliteral">"SQL ERROR ::: $p_string"</span>);
<a name="l00107"></a>00107 <a class="code" href="balance_8php.html#a0">exit</a>(<span class="stringliteral">" Operation cancelled due to error : $p_string"</span>);
<a name="l00108"></a>00108 }
<a name="l00109"></a>00109
<a name="l00110"></a>00110 <span class="keywordflow">return</span> <a class="code" href="impress__bilan_8php.html#a0">$ret</a>;
<a name="l00111"></a>00111 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a6"></a><!-- doxytag: member="postgres.php::ExisteJnt" ref="a6" args="($p_dossier, $p_user)" --><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">ExisteJnt </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_dossier</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_user</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>
Get the number of rows from table jnt_use_dos where $p_dossier = dos_id and use_id=$p_user.
<p>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00168">168</a> of file <a class="el" href="postgres_8php-source.html">postgres.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="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="l00169"></a>00169 {
<a name="l00170"></a>00170 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>();
<a name="l00171"></a>00171 <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 * from jnt_use_dos where dos_id="</span>.$p_dossier.<span class="stringliteral">" and use_id="</span>.$p_user);
<a name="l00172"></a>00172 <span class="keywordflow">return</span> pg_NumRows($Res);
<a name="l00173"></a>00173 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a7"></a><!-- doxytag: member="postgres.php::ExistePriv" ref="a7" args="($p_jntid)" --><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">ExistePriv </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_jntid</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>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00179">179</a> of file <a class="el" href="postgres_8php-source.html">postgres.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="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="l00180"></a>00180 {
<a name="l00181"></a>00181 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>();
<a name="l00182"></a>00182 <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 * from priv_user where priv_jnt="</span>.$p_jntid);
<a name="l00183"></a>00183 <span class="keywordflow">return</span> pg_NumRows($Res);
<a name="l00184"></a>00184 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a3"></a><!-- doxytag: member="postgres.php::GetAllUser" ref="a3" 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">GetAllUser </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>
Return all the users as an array.
<p>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00117">117</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="impress__fiche_8php-source.html#l00026">$cn</a>, <a class="el" href="fortis__be_8inc_8php-source.html#l00076">$Num</a>, <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, <a class="el" href="bank_8inc_8php-source.html#l00169">$sql</a>, <a class="el" href="user__action__ach_8php-source.html#l00164">$User</a>, <a class="el" href="postgres_8php-source.html#l00072">DbConnect()</a>, <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.<div class="fragment"><pre class="fragment"><a name="l00117"></a>00117 {
<a name="l00118"></a>00118 <a class="code" href="debug_8php.html#a0">echo_debug</a>('postgres.php',__LINE__,<span class="stringliteral">"GetUser"</span>);
<a name="l00119"></a>00119 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>();
<a name="l00120"></a>00120 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select * from ac_users where use_login!='phpcompta'"</span>;
<a name="l00121"></a>00121 <a class="code" href="debug_8php.html#a0">echo_debug</a>('postgres.php',__LINE__,<span class="stringliteral">"ExecSql"</span>);
<a name="l00122"></a>00122 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($cn,$sql);
<a name="l00123"></a>00123 <a class="code" href="fortis__be_8inc_8php.html#a9">$Num</a>=pg_NumRows($Res);
<a name="l00124"></a>00124 <span class="keywordflow">if</span> ( $Num == 0 ) <span class="keywordflow">return</span> null;
<a name="l00125"></a>00125 <span class="keywordflow">for</span> ($i=0;$i &lt; $Num; $i++) {
<a name="l00126"></a>00126 <a class="code" href="user__action__ach_8php.html#a9">$User</a>[]=pg_fetch_array($Res,$i);
<a name="l00127"></a>00127 }
<a name="l00128"></a>00128 <span class="keywordflow">return</span> <a class="code" href="user__action__ach_8php.html#a9">$User</a>;
<a name="l00129"></a>00129 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a23"></a><!-- doxytag: member="postgres.php::GetArray" ref="a23" args="($p_cn, $p_sql)" --><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">GetArray </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"></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>
purpose return the result of a sql statment in a array
<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_sql</em>&nbsp;</td><td>sql query</td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00353">353</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="recherche_8php-source.html#l00066">$array</a>, <a class="el" href="bank_8inc_8php-source.html#l00237">$r</a>, <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.
<p>
Referenced by <a class="el" href="user__form__ach_8php-source.html#l00044">FormAchInput()</a>, and <a class="el" href="user__form__ven_8php-source.html#l00043">FormVenInput()</a>.<div class="fragment"><pre class="fragment"><a name="l00353"></a>00353 {
<a name="l00354"></a>00354 <a class="code" href="debug_8php.html#a0">echo_debug</a>('postgres.php',__LINE__,<span class="stringliteral">"GetArray"</span>);
<a name="l00355"></a>00355 <a class="code" href="bank_8inc_8php.html#a29">$r</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,$p_sql);
<a name="l00356"></a>00356 <span class="keywordflow">if</span> ( ($Max= pg_NumRows($r)) == 0 ) <span class="keywordflow">return</span> null;
<a name="l00357"></a>00357 <a class="code" href="recherche_8php.html#a4">$array</a>=pg_fetch_all($r);
<a name="l00358"></a>00358 <a class="code" href="debug_8php.html#a0">echo_debug</a>('postgres.php',__LINE__,var_export($array,<span class="keyword">true</span>));
<a name="l00359"></a>00359 <span class="keywordflow">return</span> <a class="code" href="recherche_8php.html#a4">$array</a>;
<a name="l00360"></a>00360 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a9"></a><!-- doxytag: member="postgres.php::GetDbId" ref="a9" args="($p_name)" --><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">GetDbId </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_name</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>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00201">201</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="impress__fiche_8php-source.html#l00026">$cn</a>, <a class="el" href="jrn__add_8php-source.html#l00181">$num</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="l00202"></a>00202 {
<a name="l00203"></a>00203 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>();
<a name="l00204"></a>00204 $r_sql=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($cn,<span class="stringliteral">"select dos_id from ac_dossier</span>
<a name="l00205"></a>00205 <span class="stringliteral"> where dos_name='"</span>.$p_name.<span class="stringliteral">"'"</span>);
<a name="l00206"></a>00206 <a class="code" href="jrn__add_8php.html#a17">$num</a>=pg_NumRows($r_sql);
<a name="l00207"></a>00207 <span class="keywordflow">if</span> ( $num == 0 ) {
<a name="l00208"></a>00208 <span class="keywordflow">return</span> 0;
<a name="l00209"></a>00209 } <span class="keywordflow">else</span> {
<a name="l00210"></a>00210 $l_db=pg_fetch_array($r_sql,0);
<a name="l00211"></a>00211 <span class="keywordflow">return</span> $l_db['dos_id'];
<a name="l00212"></a>00212 }
<a name="l00213"></a>00213
<a name="l00214"></a>00214 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a25"></a><!-- doxytag: member="postgres.php::getDbValue" ref="a25" args="($p_cn, $sql)" --><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">getDbValue </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>sql</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 value of the sql, the sql will return only one value with the value
<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_sql</em>&nbsp;</td><td>the sql stmt example :select s_value from document_state where s_id=2 </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>only the first value</dd></dl>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00414">414</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="bank_8inc_8php-source.html#l00237">$r</a>, <a class="el" href="impress__bilan_8php-source.html#l00032">$ret</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.
<p>
Referenced by <a class="el" href="class__action_8php-source.html#l00101">action::Display()</a>.<div class="fragment"><pre class="fragment"><a name="l00415"></a>00415 {
<a name="l00416"></a>00416 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,$sql);
<a name="l00417"></a>00417 <span class="keywordflow">if</span> ( pg_NumRows($ret) == 0 ) <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
<a name="l00418"></a>00418 <a class="code" href="bank_8inc_8php.html#a29">$r</a>=pg_fetch_row($ret,0);
<a name="l00419"></a>00419 <span class="keywordflow">return</span> <a class="code" href="bank_8inc_8php.html#a29">$r</a>[0];
<a name="l00420"></a>00420 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a11"></a><!-- doxytag: member="postgres.php::GetDossierName" ref="a11" args="($p_dossier)" --><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">GetDossierName </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_dossier</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>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>of a dossier </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Name of the dossier</dd></dl>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00232">232</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="impress__fiche_8php-source.html#l00026">$cn</a>, <a class="el" href="bank_8inc_8php-source.html#l00237">$r</a>, <a class="el" href="line__update_8php-source.html#l00070">$Ret</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="l00233"></a>00233 {
<a name="l00234"></a>00234 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>();
<a name="l00235"></a>00235 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($cn,<span class="stringliteral">"select dos_name from ac_dossier where dos_id="</span>.$p_dossier);
<a name="l00236"></a>00236 <a class="code" href="bank_8inc_8php.html#a29">$r</a>= pg_fetch_array($Ret,0);
<a name="l00237"></a>00237 <span class="keywordflow">return</span> <a class="code" href="bank_8inc_8php.html#a29">$r</a>['dos_name'];
<a name="l00238"></a>00238 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a8"></a><!-- doxytag: member="postgres.php::GetJnt" ref="a8" args="($p_dossier, $p_user)" --><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">GetJnt </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_dossier</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_user</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>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00190">190</a> of file <a class="el" href="postgres_8php-source.html">postgres.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="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="l00191"></a>00191 {
<a name="l00192"></a>00192 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>();
<a name="l00193"></a>00193 <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 jnt_id from jnt_use_dos where dos_id="</span>.$p_dossier.<span class="stringliteral">" and use_id="</span>.$p_user);
<a name="l00194"></a>00194 $R=pg_fetch_array($Res,0);
<a name="l00195"></a>00195 <span class="keywordflow">return</span> $R['jnt_id'];
<a name="l00196"></a>00196 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a19"></a><!-- doxytag: member="postgres.php::GetLogin" ref="a19" args="($p_uid)" --><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">GetLogin </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_uid</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>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00273">273</a> of file <a class="el" href="postgres_8php-source.html">postgres.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="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="l00274"></a>00274 {
<a name="l00275"></a>00275 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>();
<a name="l00276"></a>00276 <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 use_login from ac_users where use_id=$p_uid"</span>);
<a name="l00277"></a>00277 <span class="keywordflow">if</span> ( pg_NumRows($Res) == 0 ) <span class="keywordflow">return</span> null;
<a name="l00278"></a>00278 $a_login=pg_fetch_array($Res,0);
<a name="l00279"></a>00279 <span class="keywordflow">return</span> $a_login['use_login'];
<a name="l00280"></a>00280 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a22"></a><!-- doxytag: member="postgres.php::GetModeleId" ref="a22" args="($p_cn, $p_modname)" --><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">GetModeleId </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_modname</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>
Give the mod_id from modeledef.
<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 (repository) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$p_modname</em>&nbsp;</td><td>template name </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>template id or 0 if not found</dd></dl>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00340">340</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.<div class="fragment"><pre class="fragment"><a name="l00340"></a>00340 {
<a name="l00341"></a>00341 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,<span class="stringliteral">"select mod_id from modeledef where mod_name='$p_modname'"</span>);
<a name="l00342"></a>00342 <span class="keywordflow">if</span> (pg_NumRows($Res) == 0) <span class="keywordflow">return</span> 0;
<a name="l00343"></a>00343 $name=pg_fetch_array($Res,0);
<a name="l00344"></a>00344 <span class="keywordflow">return</span> $name['mod_id'];
<a name="l00345"></a>00345 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a5"></a><!-- doxytag: member="postgres.php::GetPriv" ref="a5" args="($p_dossier, $p_login)" --><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">GetPriv </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_dossier</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_login</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>
Get the privilege of an user on a folder.
<p>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00147">147</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="impress__fiche_8php-source.html#l00026">$cn</a>, <a class="el" href="balance_8php-source.html#l00118">$i</a>, <a class="el" href="fortis__be_8inc_8php-source.html#l00076">$Num</a>, <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, <a class="el" href="postgres_8php-source.html#l00072">DbConnect()</a>, <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.
<p>
Referenced by <a class="el" href="postgres_8php-source.html#l00289">SyncRight()</a>.<div class="fragment"><pre class="fragment"><a name="l00148"></a>00148 {
<a name="l00149"></a>00149 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>();
<a name="l00150"></a>00150 <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 priv_priv </span>
<a name="l00151"></a>00151 <span class="stringliteral"> from priv_user left join jnt_use_dos on jnt_id=priv_jnt</span>
<a name="l00152"></a>00152 <span class="stringliteral"> inner join ac_users on ac_users.use_id=jnt_use_dos.use_id</span>
<a name="l00153"></a>00153 <span class="stringliteral"> where use_login='$p_login' and dos_id=$p_dossier"</span>);
<a name="l00154"></a>00154 <a class="code" href="fortis__be_8inc_8php.html#a9">$Num</a>=pg_NumRows($Res);
<a name="l00155"></a>00155 <a class="code" href="debug_8php.html#a0">echo_debug</a>('postgres.php',__LINE__,<span class="stringliteral">"Found "</span>.$Num.<span class="stringliteral">" rows in GetPriv"</span>);
<a name="l00156"></a>00156 <span class="keywordflow">if</span> ( $Num==0) { <span class="keywordflow">return</span> 0;}
<a name="l00157"></a>00157 <span class="keywordflow">for</span>(<a class="code" href="balance_8php.html#a12">$i</a>=0;<a class="code" href="balance_8php.html#a12">$i</a> &lt; <a class="code" href="fortis__be_8inc_8php.html#a9">$Num</a>;<a class="code" href="balance_8php.html#a12">$i</a>++) {
<a name="l00158"></a>00158 $Right=pg_fetch_array($Res,$i);
<a name="l00159"></a>00159 $Priv[]=$Right['priv_priv'];
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161 <span class="keywordflow">return</span> $Priv;
<a name="l00162"></a>00162 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a12"></a><!-- doxytag: member="postgres.php::GetSequence" ref="a12" args="($p_cn, $p_seq)" --><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">GetSequence </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_seq</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>
get the current sequence
<p>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00242">242</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, <a class="el" href="annulation_8php-source.html#l00136">$seq</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</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#l00288">InsertJrn()</a>, <a class="el" href="user__common_8php-source.html#l00244">InsertJrnx()</a>, and <a class="el" href="class__document_8php-source.html#l00256">Document::SaveGenerated()</a>.<div class="fragment"><pre class="fragment"><a name="l00243"></a>00243 {
<a name="l00244"></a>00244 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,<span class="stringliteral">"select currval('$p_seq') as seq"</span>);
<a name="l00245"></a>00245 <a class="code" href="annulation_8php.html#a4">$seq</a>=pg_fetch_array($Res,0);
<a name="l00246"></a>00246 <span class="keywordflow">return</span> <a class="code" href="annulation_8php.html#a4">$seq</a>['seq'];
<a name="l00247"></a>00247 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a4"></a><!-- doxytag: member="postgres.php::GetUid" ref="a4" args="($p_uid)" --><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">GetUid </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_uid</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 User is valid and return an array with his property.
<p>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00134">134</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="impress__fiche_8php-source.html#l00026">$cn</a>, <a class="el" href="fortis__be_8inc_8php-source.html#l00076">$Num</a>, <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</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 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>();
<a name="l00136"></a>00136 <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 * from ac_users where use_id="</span>.$p_uid);
<a name="l00137"></a>00137 <a class="code" href="fortis__be_8inc_8php.html#a9">$Num</a>=pg_NumRows($Res);
<a name="l00138"></a>00138 <span class="keywordflow">if</span> ( $Num == 0 ) { <span class="keywordflow">return</span> <span class="keyword">false</span>; }
<a name="l00139"></a>00139 <span class="keywordflow">for</span> ($i=0;$i &lt; $Num; $i++) {
<a name="l00140"></a>00140 $Prop[]=pg_fetch_array($Res,$i);
<a name="l00141"></a>00141 }
<a name="l00142"></a>00142 <span class="keywordflow">return</span> $Prop;
<a name="l00143"></a>00143 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a21"></a><!-- doxytag: member="postgres.php::GetUserProperty" ref="a21" args="($p_cn, $p_user)" --><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">GetUserProperty </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_user</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>
Get the properties of an user it means theme, profile, admin...
<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_user</em>&nbsp;</td><td>user login </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$p_cn</em>&nbsp;</td><td>connection</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>an array containing<ul>
<li>use_admin</li><li>use_usertype</li><li>g_theme</li><li>use_name</li><li>use_login</li></ul>
</dd></dl>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00315">315</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="balance_8php-source.html#l00113">$a</a>, <a class="el" href="line__update_8php-source.html#l00070">$Ret</a>, <a class="el" href="bank_8inc_8php-source.html#l00169">$sql</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.<div class="fragment"><pre class="fragment"><a name="l00316"></a>00316 {
<a name="l00317"></a>00317 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select use_login,use_first_name,use_name,use_admin,use_usertype,g_theme</span>
<a name="l00318"></a>00318 <span class="stringliteral"> from ac_users where use_login='$p_user'"</span>;
<a name="l00319"></a>00319 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,$sql);
<a name="l00320"></a>00320 <span class="keywordflow">if</span> ( pg_NumRows($Ret) == 0)
<a name="l00321"></a>00321 <span class="keywordflow">return</span> array('use_first_name'=&gt;<span class="charliteral">'?'</span>,
<a name="l00322"></a>00322 'use_name'=&gt;'Unknown',
<a name="l00323"></a>00323 'use_admin'=&gt;0,
<a name="l00324"></a>00324 'use_usertype'=&gt;'user',
<a name="l00325"></a>00325 'g_theme'=&gt;'classic',
<a name="l00326"></a>00326 'use_login'=&gt;$p_user);
<a name="l00327"></a>00327
<a name="l00328"></a>00328 <a class="code" href="balance_8php.html#a10">$a</a>=pg_fetch_array($Ret,0);
<a name="l00329"></a>00329 <span class="keywordflow">return</span> <a class="code" href="balance_8php.html#a10">$a</a>;
<a name="l00330"></a>00330 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a13"></a><!-- doxytag: member="postgres.php::NextSequence" ref="a13" args="($p_cn, $p_seq)" --><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">NextSequence </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_seq</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>
get the current sequence
<p>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00251">251</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, <a class="el" href="annulation_8php-source.html#l00136">$seq</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.
<p>
Referenced by <a class="el" href="class__document_8php-source.html#l00049">Document::blank()</a>, <a class="el" href="class__document_8php-source.html#l00079">Document::Generate()</a>, <a class="el" href="class__fiche_8php-source.html#l00542">fiche::insert()</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="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="jrn_8php-source.html#l00949">SetInternalCode()</a>, and <a class="el" href="import__inc_8php-source.html#l00090">TransferCSV()</a>.<div class="fragment"><pre class="fragment"><a name="l00252"></a>00252 {
<a name="l00253"></a>00253 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,<span class="stringliteral">"select nextval('$p_seq') as seq"</span>);
<a name="l00254"></a>00254 <a class="code" href="annulation_8php.html#a4">$seq</a>=pg_fetch_array($Res,0);
<a name="l00255"></a>00255 <span class="keywordflow">return</span> <a class="code" href="annulation_8php.html#a4">$seq</a>['seq'];
<a name="l00256"></a>00256 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a17"></a><!-- doxytag: member="postgres.php::Rollback" ref="a17" args="($p_cn)" --><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">Rollback </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_cn</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>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00266">266</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.
<p>
Referenced by <a class="el" href="setup_8php-source.html#l00104">ExecuteScript()</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="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__document_8php-source.html#l00256">Document::SaveGenerated()</a>, <a class="el" href="import__inc_8php-source.html#l00090">TransferCSV()</a>, and <a class="el" href="class__document_8php-source.html#l00289">Document::Upload()</a>.<div class="fragment"><pre class="fragment"><a name="l00266"></a>00266 {
<a name="l00267"></a>00267 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,<span class="stringliteral">"rollback"</span>);
<a name="l00268"></a>00268 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a24"></a><!-- doxytag: member="postgres.php::save_upload_document" ref="a24" args="($cn, $seq)" --><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">save_upload_document </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>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>seq</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>
Save a "piece justificative".
<p>
save_upload_document<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>database connection </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$seq</em>&nbsp;</td><td>jr_grpt_id </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>$oid of the lob file if success null if a error occurs</dd></dl>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00371">371</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="modify__op_8php-source.html#l00125">$old_oid</a>, <a class="el" href="bank_8inc_8php-source.html#l00237">$r</a>, <a class="el" href="impress__bilan_8php-source.html#l00032">$ret</a>, <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>, <a class="el" href="ac__common_8php-source.html#l00036">echo_error()</a>, <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>, <a class="el" href="action_8inc_8php-source.html#l00240">name</a>, and <a class="el" href="postgres_8php-source.html#l00266">Rollback()</a>.
<p>
Referenced by <a class="el" href="user__form__ven_8php-source.html#l00627">RecordInvoice()</a>, and <a class="el" href="user__form__ach_8php-source.html#l00661">RecordSell()</a>.<div class="fragment"><pre class="fragment"><a name="l00371"></a>00371 {
<a name="l00372"></a>00372
<a name="l00373"></a>00373 $new_name=tempnam('/tmp<span class="charliteral">','</span>pj');
<a name="l00374"></a>00374 <a class="code" href="debug_8php.html#a0">echo_debug</a>('postgres.php',__LINE__,<span class="stringliteral">"new name="</span>.$new_name);
<a name="l00375"></a>00375 <span class="keywordflow">if</span> ( strlen ($_FILES['pj']['tmp_name']) != 0 ) {
<a name="l00376"></a>00376 <span class="keywordflow">if</span> (move_uploaded_file($_FILES['pj']['tmp_name'],
<a name="l00377"></a>00377 $new_name)) {
<a name="l00378"></a>00378 <span class="comment">// echo "Image saved";</span>
<a name="l00379"></a>00379
<a name="l00380"></a>00380 $oid= pg_lo_import($cn,$new_name);
<a name="l00381"></a>00381 <span class="keywordflow">if</span> ( $oid == <span class="keyword">false</span> ) {
<a name="l00382"></a>00382 <a class="code" href="ac__common_8php.html#a0">echo_error</a>('postgres.php',__LINE__,<span class="stringliteral">"cannot upload document"</span>);
<a name="l00383"></a>00383 <a class="code" href="postgres_8php.html#a17">Rollback</a>($cn);
<a name="l00384"></a>00384 <span class="keywordflow">return</span>;
<a name="l00385"></a>00385 }
<a name="l00386"></a>00386 <a class="code" href="debug_8php.html#a0">echo_debug</a>('postgres.php',__LINE__,<span class="stringliteral">"Loading document"</span>);
<a name="l00387"></a>00387 <span class="comment">// Remove old document</span>
<a name="l00388"></a>00388 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($cn,<span class="stringliteral">"select jr_pj from jrn where jr_grpt_id=$seq"</span>);
<a name="l00389"></a>00389 <span class="keywordflow">if</span> (pg_num_rows($ret) != 0) {
<a name="l00390"></a>00390 <a class="code" href="bank_8inc_8php.html#a29">$r</a>=pg_fetch_array($ret,0);
<a name="l00391"></a>00391 <a class="code" href="modify__op_8php.html#a6">$old_oid</a>=<a class="code" href="bank_8inc_8php.html#a29">$r</a>['jr_pj'];
<a name="l00392"></a>00392 <span class="keywordflow">if</span> (strlen($old_oid) != 0)
<a name="l00393"></a>00393 pg_lo_unlink($cn,$old_oid);
<a name="l00394"></a>00394 }
<a name="l00395"></a>00395 <span class="comment">// Load new document</span>
<a name="l00396"></a>00396 <a class="code" href="postgres_8php.html#a2">ExecSql</a>($cn,<span class="stringliteral">"update jrn set jr_pj="</span>.$oid.<span class="stringliteral">", jr_pj_name='"</span>.$_FILES['pj']['<a class="code" href="action_8inc_8php.html#a18">name</a>'].<span class="stringliteral">"', "</span>.
<a name="l00397"></a>00397 <span class="stringliteral">"jr_pj_type='"</span>.$_FILES['pj']['type'].<span class="stringliteral">"' where jr_grpt_id=$seq"</span>);
<a name="l00398"></a>00398 <span class="keywordflow">return</span> $oid;
<a name="l00399"></a>00399
<a name="l00400"></a>00400 } <span class="keywordflow">else</span> {
<a name="l00401"></a>00401 echo <span class="stringliteral">"&lt;H1&gt;Error&lt;/H1&gt;"</span>;
<a name="l00402"></a>00402 <a class="code" href="postgres_8php.html#a17">Rollback</a>($cn);
<a name="l00403"></a>00403 <span class="keywordflow">return</span> null;
<a name="l00404"></a>00404 }
<a name="l00405"></a>00405 }
<a name="l00406"></a>00406
<a name="l00407"></a>00407 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a0"></a><!-- doxytag: member="postgres.php::ShowDossier" ref="a0" args="($p_type, $p_first=0, $p_max=10, $p_Num=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">ShowDossier </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_type</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_first</em> = <code>0</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_max</em> = <code>10</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_Num</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>
<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_type</em>&nbsp;</td><td>string : all for all dossiers lim for only the dossier where we've got rights</td></tr>
</table>
</dl>
Show the folder where user have access. Return : nothing ++
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00032">32</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="commercial_8php-source.html#l00035">$_SESSION</a>, <a class="el" href="impress__fiche_8php-source.html#l00026">$cn</a>, <a class="el" href="setup_8php-source.html#l00395">$Max</a>, <a class="el" href="argenta__be_8inc_8php-source.html#l00028">$row</a>, <a class="el" href="postgres_8php-source.html#l00222">CountSql()</a>, <a class="el" href="postgres_8php-source.html#l00072">DbConnect()</a>, <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.<div class="fragment"><pre class="fragment"><a name="l00032"></a>00032 {
<a name="l00033"></a>00033 $l_user=<a class="code" href="commercial_8php.html#a0">$_SESSION</a>['g_user'];
<a name="l00034"></a>00034 <span class="keywordflow">if</span> ( $p_max == 0 ) {
<a name="l00035"></a>00035 $l_step=<span class="stringliteral">""</span>;
<a name="l00036"></a>00036 } <span class="keywordflow">else</span> {
<a name="l00037"></a>00037 $l_step=<span class="stringliteral">"LIMIT $p_max OFFSET $p_first"</span>;
<a name="l00038"></a>00038 }
<a name="l00039"></a>00039 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>();
<a name="l00040"></a>00040 <span class="keywordflow">if</span> ( $p_type == <span class="stringliteral">"all"</span>) {
<a name="l00041"></a>00041 $l_sql=<span class="stringliteral">"select *, 'W' as priv_priv from ac_dossier ORDER BY dos_name "</span>;
<a name="l00042"></a>00042 $p_Num=<a class="code" href="postgres_8php.html#a10">CountSql</a>($cn,$l_sql);
<a name="l00043"></a>00043 } <span class="keywordflow">else</span> {
<a name="l00044"></a>00044 $l_sql=<span class="stringliteral">"select * from jnt_use_dos </span>
<a name="l00045"></a>00045 <span class="stringliteral"> natural join ac_dossier </span>
<a name="l00046"></a>00046 <span class="stringliteral"> natural join ac_users </span>
<a name="l00047"></a>00047 <span class="stringliteral"> inner join priv_user on priv_jnt=jnt_id where </span>
<a name="l00048"></a>00048 <span class="stringliteral"> use_login='"</span>.$l_user.<span class="stringliteral">"' and priv_priv !='NO'</span>
<a name="l00049"></a>00049 <span class="stringliteral"> order by dos_name "</span>;
<a name="l00050"></a>00050 $p_Num=<a class="code" href="postgres_8php.html#a10">CountSql</a>($cn,$l_sql);
<a name="l00051"></a>00051 }
<a name="l00052"></a>00052 $l_sql=$l_sql.$l_step;
<a name="l00053"></a>00053 $p_res=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($cn,$l_sql);
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <a class="code" href="debug_8php.html#a0">echo_debug</a>('postgres.php',__LINE__,<span class="stringliteral">"ShowDossier:"</span>.$p_res.<span class="stringliteral">" Line = $p_Num"</span>);
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <a class="code" href="setup_8php.html#a11">$Max</a>=pg_NumRows($p_res);
<a name="l00058"></a>00058 <span class="keywordflow">if</span> ( $Max == 0 ) <span class="keywordflow">return</span> null;
<a name="l00059"></a>00059 <span class="keywordflow">for</span> ( $i=0;$i&lt;$Max; $i++) {
<a name="l00060"></a>00060 <span class="comment">// echo_debug ("i = $i");</span>
<a name="l00061"></a>00061 <a class="code" href="argenta__be_8inc_8php.html#a0">$row</a>[]=pg_fetch_array($p_res,$i);
<a name="l00062"></a>00062 <span class="comment">//echo $row[dossier];</span>
<a name="l00063"></a>00063 }
<a name="l00064"></a>00064 <span class="keywordflow">return</span> <a class="code" href="argenta__be_8inc_8php.html#a0">$row</a>;
<a name="l00065"></a>00065 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a14"></a><!-- doxytag: member="postgres.php::StartSql" ref="a14" args="($p_cn)" --><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">StartSql </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_cn</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>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00257">257</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.
<p>
Referenced by <a class="el" href="central__inc_8php-source.html#l00036">Centralise()</a>, <a class="el" href="class__document__modele_8php-source.html#l00179">Document_modele::Delete()</a>, <a class="el" href="class__document_8php-source.html#l00079">Document::Generate()</a>, <a class="el" href="class__document__modele_8php-source.html#l00204">Document_modele::Get()</a>, <a class="el" href="import__inc_8php-source.html#l00037">ImportCSV()</a>, <a class="el" href="class__fiche_8php-source.html#l00542">fiche::insert()</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="class__document__modele_8php-source.html#l00103">Document_modele::Save()</a>, <a class="el" href="class__document_8php-source.html#l00256">Document::SaveGenerated()</a>, <a class="el" href="class__document_8php-source.html#l00355">Document::Send()</a>, <a class="el" href="import__inc_8php-source.html#l00090">TransferCSV()</a>, and <a class="el" href="class__document_8php-source.html#l00289">Document::Upload()</a>.<div class="fragment"><pre class="fragment"><a name="l00257"></a>00257 {
<a name="l00258"></a>00258 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,<span class="stringliteral">"start transaction"</span>);
<a name="l00259"></a>00259 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a20"></a><!-- doxytag: member="postgres.php::SyncRight" ref="a20" args="($p_dossier, $p_user)" --><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">SyncRight </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_dossier</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_user</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>
Synchronize les droits par d<>faut avec les journaux existants.
<p>
SyncRight <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_dossier</em>&nbsp;</td><td>dossier id </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$p_user</em>&nbsp;</td><td>user id</td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="postgres_8php-source.html#l00289">289</a> of file <a class="el" href="postgres_8php-source.html">postgres.php</a>.
<p>
References <a class="el" href="impress__fiche_8php-source.html#l00026">$cn</a>, <a class="el" href="priv__user_8php-source.html#l00189">$priv</a>, <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, <a class="el" href="user__sec_8php-source.html#l00175">$right</a>, <a class="el" href="bank_8inc_8php-source.html#l00169">$sql</a>, <a class="el" href="postgres_8php-source.html#l00072">DbConnect()</a>, <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>, and <a class="el" href="postgres_8php-source.html#l00147">GetPriv()</a>.<div class="fragment"><pre class="fragment"><a name="l00289"></a>00289 {
<a name="l00290"></a>00290 <a class="code" href="priv__user_8php.html#a13">$priv</a>=<a class="code" href="postgres_8php.html#a5">GetPriv</a>($p_dossier,$p_user);
<a name="l00291"></a>00291 <a class="code" href="user__sec_8php.html#a15">$right</a>=<a class="code" href="priv__user_8php.html#a13">$priv</a>[0];
<a name="l00292"></a>00292
<a name="l00293"></a>00293 <a class="code" href="impress__fiche_8php.html#a0">$cn</a>=<a class="code" href="postgres_8php.html#a1">DbConnect</a>($p_dossier);
<a name="l00294"></a>00294
<a name="l00295"></a>00295 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"insert into user_sec_jrn(uj_login,uj_jrn_id,uj_priv) "</span>.
<a name="l00296"></a>00296 <span class="stringliteral">"select '"</span>.$p_user.<span class="stringliteral">"',jrn_def_id,'"</span>.<a class="code" href="user__sec_8php.html#a15">$right</a>.<span class="stringliteral">"' from jrn_def "</span>.
<a name="l00297"></a>00297 <span class="stringliteral">"where jrn_def_id not in "</span>.
<a name="l00298"></a>00298 <span class="stringliteral">"(select uj_jrn_id from user_sec_jrn where uj_login='"</span>.$p_user.<span class="stringliteral">"')"</span>;
<a name="l00299"></a>00299 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($cn,$sql);
<a name="l00300"></a>00300 }
</pre></div>
<p>
</td>
</tr>
</table>
</BODY>
</HTML>