altocompta/doc/developper/html/classfiche.html
2006-07-12 21:24:48 +00:00

1507 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: fiche Class 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>
<h1>fiche Class Reference</h1><!-- doxytag: class="fiche" -->define Class fiche and fiche def, those class are using class attribut
<a href="#_details">More...</a>
<p>
<p>Inheritance diagram for fiche:
<p><center><img src="classfiche.png" usemap="#fiche_map" border="0" alt=""></center>
<map name="fiche_map">
<area href="classAdmin.html" alt="Admin" shape="rect" coords="0,56,65,80">
<area href="classcontact.html" alt="contact" shape="rect" coords="75,56,140,80">
<area href="classCustomer.html" alt="Customer" shape="rect" coords="150,56,215,80">
<area href="classSupplier.html" alt="Supplier" shape="rect" coords="225,56,290,80">
</map>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#a0">fiche</a> ($p_cn, $p_id=0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#a1">GetByQCode</a> ($p_qcode, $p_all=true)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Retrieve a card thx his quick_code complete the object. <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="classfiche.html#a2">getAttribut</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">get all the attribute of a card, add missing ones and sort the array ($this-&gt;attribut) by ad_id <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="classfiche.html#a3">size</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">give the size of a card object <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="classfiche.html#a4">GetByType</a> ($p_fd_id)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get all the card where the fiche_def.fd_id is given in parameter. <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="classfiche.html#a5">CountByDef</a> ($p_frd_id, $p_search=&quot;&quot;, $p_sql=&quot;&quot;)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return array of card from the frd family. <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="classfiche.html#a6">GetByDef</a> ($p_frd_id, $p_offset=-1, $p_search=&quot;&quot;)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return array of card from the frd family. <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="classfiche.html#a7">ShowTable</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#a8">strAttribut</a> ($p_ad_id)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">return the string of the given attribute (attr_def.ad_id) <a href="#a8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#a9">blank</a> ($p_fiche_def)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">insert a new record show a blank card to be filled <a href="#a9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#a10">Display</a> ($p_readonly)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Display object instance, getAttribute sort the attribute and add missing ones. <a href="#a10"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#a11">Save</a> ($p_fiche_def=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Save a card, call insert or update. <a href="#a11"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#a12">insert</a> ($p_fiche_def)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">insert a new record <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="classfiche.html#a13">update</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">update a card <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="classfiche.html#a14">remove</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">remove a card <a href="#a14"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#a15">getName</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">return the name of a card <a href="#a15"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#a16">Get</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Synonum of <a class="el" href="classfiche.html#a2">fiche::getAttribut</a>. <a href="#a16"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#a17">GetAll</a> ($p_offset=-1, $p_search=&quot;&quot;)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">get all the card thanks the <a class="el" href="classfiche__def__ref.html">fiche_def_ref</a> <a href="#a17"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Data Fields</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#o0">$cn</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#o1">$id</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#o2">$fiche_def</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#o3">$attribut</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfiche.html#o4">$fiche_def_ref</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
define Class fiche and fiche def, those class are using class attribut
<p>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00148">148</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="a0"></a><!-- doxytag: member="fiche::fiche" ref="a0" args="($p_cn, $p_id=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">fiche::fiche </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_cn</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_id</em> = <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>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00155">155</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="user__update_8php-source.html#l00032">$p_id</a>.
<p>
Referenced by <a class="el" href="class__admin_8php-source.html#l00049">Admin::Admin()</a>, <a class="el" href="class__contact_8php-source.html#l00036">contact::contact()</a>, <a class="el" href="class__customer_8php-source.html#l00049">Customer::Customer()</a>, <a class="el" href="class__fiche_8php-source.html#l00317">GetByDef()</a>, <a class="el" href="class__fiche_8php-source.html#l00260">GetByType()</a>, <a class="el" href="class__contact_8php-source.html#l00050">contact::Summary()</a>, and <a class="el" href="class__supplier_8php-source.html#l00049">Supplier::Supplier()</a>.<div class="fragment"><pre class="fragment"><a name="l00155"></a>00155 {
<a name="l00156"></a>00156 $this-&gt;cn=$p_cn;
<a name="l00157"></a>00157 $this-&gt;<span class="keywordtype">id</span>=<a class="code" href="user__update_8php.html#a1">$p_id</a>;
<a name="l00158"></a>00158 }
</pre></div>
<p>
</td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a9"></a><!-- doxytag: member="fiche::blank" ref="a9" args="($p_fiche_def)" --><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">fiche::blank </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_fiche_def</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>
insert a new record show a blank card to be filled
<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_fiche_def</em>&nbsp;</td><td>is the fiche_def.fd_id</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>HTML Code</dd></dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00399">399</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="balance_8php-source.html#l00113">$a</a>, <a class="el" href="recherche_8php-source.html#l00066">$array</a>, <a class="el" href="pref_8inc_8php-source.html#l00139">$label</a>, <a class="el" href="pref_8inc_8php-source.html#l00096">$msg</a>, <a class="el" href="bank_8inc_8php-source.html#l00237">$r</a>, <a class="el" href="tva_8inc_8php-source.html#l00065">$ret_sql</a>, <a class="el" href="bank_8inc_8php-source.html#l00169">$sql</a>, <a class="el" href="admin_8inc_8php-source.html#l00116">$w</a>, <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>, <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>, and <a class="el" href="balance_8php-source.html#l00071">table</a>.<div class="fragment"><pre class="fragment"><a name="l00400"></a>00400 {
<a name="l00401"></a>00401 <span class="comment">// array = array of attribute object sorted on ad_id</span>
<a name="l00402"></a>00402 $f=<span class="keyword">new</span> <a class="code" href="classfiche__def.html">fiche_def</a>($this-&gt;cn,$p_fiche_def);
<a name="l00403"></a>00403 <a class="code" href="recherche_8php.html#a4">$array</a>=$f-&gt;getAttribut();
<a name="l00404"></a>00404 <a class="code" href="bank_8inc_8php.html#a29">$r</a>='&lt;<a class="code" href="balance_8php.html#a3">table</a>&gt;';
<a name="l00405"></a>00405 foreach ($array as $attr)
<a name="l00406"></a>00406 {
<a name="l00407"></a>00407 <a class="code" href="pref_8inc_8php.html#a4">$msg</a>=<span class="stringliteral">""</span>;
<a name="l00408"></a>00408 <span class="keywordflow">if</span> ( $attr-&gt;ad_id == <a class="code" href="constant_8php.html#a55">ATTR_DEF_ACCOUNT</a>)
<a name="l00409"></a>00409 {
<a name="l00410"></a>00410 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.=<a class="code" href="constant_8php.html#a79">JS_SEARCH_POSTE</a>;
<a name="l00411"></a>00411 <a class="code" href="admin_8inc_8php.html#a4">$w</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"js_search_poste"</span>);
<a name="l00412"></a>00412 <span class="comment">// account created automatically</span>
<a name="l00413"></a>00413 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select account_auto($p_fiche_def)"</span>;
<a name="l00414"></a>00414 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"class_fiche"</span>,__LINE__,$sql);
<a name="l00415"></a>00415 <a class="code" href="tva_8inc_8php.html#a6">$ret_sql</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00416"></a>00416 <a class="code" href="balance_8php.html#a10">$a</a>=pg_fetch_array($ret_sql,0);
<a name="l00417"></a>00417 <span class="keywordflow">if</span> ( $a['account_auto'] == <span class="charliteral">'t'</span> )
<a name="l00418"></a>00418 <a class="code" href="pref_8inc_8php.html#a4">$msg</a>=<span class="stringliteral">"&lt;TD&gt; &lt;font color=\"red\"&gt;Rappel: Poste cr<63><72> automatiquement !&lt;/font&gt;&lt;/TD&gt; "</span>;
<a name="l00419"></a>00419
<a name="l00420"></a>00420 }
<a name="l00421"></a>00421 elseif ( $attr-&gt;ad_id == <a class="code" href="constant_8php.html#a59">ATTR_DEF_TVA</a>)
<a name="l00422"></a>00422 {
<a name="l00423"></a>00423 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.=<a class="code" href="constant_8php.html#a88">JS_TVA</a>;
<a name="l00424"></a>00424 <a class="code" href="admin_8inc_8php.html#a4">$w</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"js_tva"</span>);
<a name="l00425"></a>00425 }
<a name="l00426"></a>00426 elseif ( $attr-&gt;ad_id == <a class="code" href="constant_8php.html#a67">ATTR_DEF_COMPANY</a> )
<a name="l00427"></a>00427 {
<a name="l00428"></a>00428 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.=<a class="code" href="constant_8php.html#a85">JS_SEARCH_CARD</a>;
<a name="l00429"></a>00429 <a class="code" href="admin_8inc_8php.html#a4">$w</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"js_search"</span>);
<a name="l00430"></a>00430 <span class="comment">// filter on frd_id</span>
<a name="l00431"></a>00431 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;extra=<a class="code" href="constant_8php.html#a69">FICHE_TYPE_CLIENT</a>.<span class="charliteral">','</span>.<a class="code" href="constant_8php.html#a71">FICHE_TYPE_FOURNISSEUR</a>.<span class="charliteral">','</span>.<a class="code" href="constant_8php.html#a74">FICHE_TYPE_ADM_TAX</a>;
<a name="l00432"></a>00432 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;extra2=0; <span class="comment">// jrn = 0</span>
<a name="l00433"></a>00433 <a class="code" href="pref_8inc_8php.html#a6">$label</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"span"</span>);
<a name="l00434"></a>00434 <a class="code" href="pref_8inc_8php.html#a6">$label</a>-&gt;name=<span class="stringliteral">"av_text"</span>.$attr-&gt;ad_id.<span class="stringliteral">"_label"</span>;
<a name="l00435"></a>00435 <a class="code" href="pref_8inc_8php.html#a4">$msg</a>=<a class="code" href="pref_8inc_8php.html#a6">$label</a>-&gt;IOValue();
<a name="l00436"></a>00436 }
<a name="l00437"></a>00437 <span class="keywordflow">else</span>
<a name="l00438"></a>00438 {
<a name="l00439"></a>00439 <a class="code" href="admin_8inc_8php.html#a4">$w</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"text"</span>);
<a name="l00440"></a>00440 }
<a name="l00441"></a>00441 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;table=1;
<a name="l00442"></a>00442 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;label=$attr-&gt;ad_text;
<a name="l00443"></a>00443 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;name=<span class="stringliteral">"av_text"</span>.$attr-&gt;ad_id;
<a name="l00444"></a>00444
<a name="l00445"></a>00445 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.=<span class="stringliteral">"&lt;TR&gt;"</span>.$w-&gt;IOValue().<span class="stringliteral">"$msg &lt;/TR&gt;"</span>;
<a name="l00446"></a>00446 }
<a name="l00447"></a>00447 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.= '&lt;/<a class="code" href="balance_8php.html#a3">table</a>&gt;';
<a name="l00448"></a>00448 <span class="keywordflow">return</span> <a class="code" href="bank_8inc_8php.html#a29">$r</a>;
<a name="l00449"></a>00449 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a5"></a><!-- doxytag: member="fiche::CountByDef" ref="a5" args="($p_frd_id, $p_search=&quot;&quot;, $p_sql=&quot;&quot;)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">fiche::CountByDef </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_frd_id</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_search</em> = <code>&quot;&quot;</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_sql</em> = <code>&quot;&quot;</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Return array of card from the frd family.
<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>the</em>&nbsp;</td><td><a class="el" href="fiche__def_8inc_8php.html#a1">fiche_def_ref.frd_id</a> </td></tr>
<tr><td valign="top"></td><td valign="top"><em>p_search</em>&nbsp;</td><td>is a filter on the name </td></tr>
<tr><td valign="top"></td><td valign="top"><em>p_sql</em>&nbsp;</td><td>extra sql condition</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>array of fiche object</dd></dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00291">291</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.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>, <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>, and <a class="el" href="ac__common_8php-source.html#l00206">FormatString()</a>.
<p>
Referenced by <a class="el" href="class__supplier_8php-source.html#l00083">Supplier::Summary()</a>, <a class="el" href="class__customer_8php-source.html#l00195">Customer::Summary()</a>, <a class="el" href="class__contact_8php-source.html#l00050">contact::Summary()</a>, and <a class="el" href="class__admin_8php-source.html#l00065">Admin::Summary()</a>.<div class="fragment"><pre class="fragment"><a name="l00291"></a>00291 {
<a name="l00292"></a>00292 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select * </span>
<a name="l00293"></a>00293 <span class="stringliteral"> from</span>
<a name="l00294"></a>00294 <span class="stringliteral"> fiche join fiche_Def using (fd_id)</span>
<a name="l00295"></a>00295 <span class="stringliteral"> where frd_id="</span>.$p_frd_id;
<a name="l00296"></a>00296 <span class="keywordflow">if</span> ( $p_search != <span class="stringliteral">""</span> )
<a name="l00297"></a>00297 {
<a name="l00298"></a>00298 <a class="code" href="balance_8php.html#a10">$a</a>=<a class="code" href="ac__common_8php.html#a9">FormatString</a>($p_search);
<a name="l00299"></a>00299 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select * from vw_fiche_attr where frd_id="</span>.$p_frd_id.
<a name="l00300"></a>00300 <span class="stringliteral">" and vw_name ~* '$p_search'"</span>;
<a name="l00301"></a>00301 }
<a name="l00302"></a>00302
<a name="l00303"></a>00303 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql.$p_sql);
<a name="l00304"></a>00304
<a name="l00305"></a>00305 <span class="keywordflow">return</span> pg_NumRows($Ret) ;
<a name="l00306"></a>00306 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a10"></a><!-- doxytag: member="fiche::Display" ref="a10" args="($p_readonly)" --><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">fiche::Display </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_readonly</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>
Display object instance, getAttribute sort the attribute and add missing ones.
<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_readonly</em>&nbsp;</td><td>true= if can not modify, otherwise false</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>string to display</dd></dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00461">461</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="balance_8php-source.html#l00113">$a</a>, <a class="el" href="pref_8inc_8php-source.html#l00139">$label</a>, <a class="el" href="pref_8inc_8php-source.html#l00096">$msg</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="tva_8inc_8php-source.html#l00065">$ret_sql</a>, <a class="el" href="bank_8inc_8php-source.html#l00169">$sql</a>, <a class="el" href="admin_8inc_8php-source.html#l00116">$w</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="l00462"></a>00462 {
<a name="l00463"></a>00463 $this-&gt;GetAttribut();
<a name="l00464"></a>00464 $attr=$this-&gt;attribut;
<a name="l00465"></a>00465
<a name="l00466"></a>00466 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>=<span class="stringliteral">"&lt;table&gt;"</span>;
<a name="l00467"></a>00467
<a name="l00468"></a>00468 foreach ( $attr as $r)
<a name="l00469"></a>00469 {
<a name="l00470"></a>00470 <a class="code" href="pref_8inc_8php.html#a4">$msg</a>=<span class="stringliteral">""</span>;
<a name="l00471"></a>00471 <span class="keywordflow">if</span> ( $p_readonly)
<a name="l00472"></a>00472 {
<a name="l00473"></a>00473 <a class="code" href="admin_8inc_8php.html#a4">$w</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"text"</span>);
<a name="l00474"></a>00474 }
<a name="l00475"></a>00475 <span class="keywordflow">if</span> ($p_readonly==<span class="keyword">false</span>)
<a name="l00476"></a>00476 {
<a name="l00477"></a>00477 <span class="keywordflow">if</span> ( $r-&gt;ad_id == <a class="code" href="constant_8php.html#a55">ATTR_DEF_ACCOUNT</a>)
<a name="l00478"></a>00478 {
<a name="l00479"></a>00479 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>.=<a class="code" href="constant_8php.html#a79">JS_SEARCH_POSTE</a>;
<a name="l00480"></a>00480 <a class="code" href="admin_8inc_8php.html#a4">$w</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"js_search_poste"</span>);
<a name="l00481"></a>00481 <span class="comment">// account created automatically</span>
<a name="l00482"></a>00482 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select account_auto($this-&gt;fiche_def)"</span>;
<a name="l00483"></a>00483 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"class_fiche"</span>,__LINE__,$sql);
<a name="l00484"></a>00484 <a class="code" href="tva_8inc_8php.html#a6">$ret_sql</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00485"></a>00485 <a class="code" href="balance_8php.html#a10">$a</a>=pg_fetch_array($ret_sql,0);
<a name="l00486"></a>00486 <span class="keywordflow">if</span> ( $a['account_auto'] == <span class="charliteral">'t'</span> )
<a name="l00487"></a>00487 <a class="code" href="pref_8inc_8php.html#a4">$msg</a>=<span class="stringliteral">"&lt;TD&gt; &lt;font color=\"red\"&gt;si vide le Poste sera cr<63>er automatiquement&lt;/font&gt;&lt;/TD&gt; "</span>;
<a name="l00488"></a>00488 }
<a name="l00489"></a>00489 elseif ( $r-&gt;ad_id == <a class="code" href="constant_8php.html#a59">ATTR_DEF_TVA</a>)
<a name="l00490"></a>00490 {
<a name="l00491"></a>00491 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>.=<a class="code" href="constant_8php.html#a88">JS_TVA</a>;
<a name="l00492"></a>00492 <a class="code" href="admin_8inc_8php.html#a4">$w</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"js_tva"</span>);
<a name="l00493"></a>00493 }
<a name="l00494"></a>00494 elseif ( $r-&gt;ad_id == <a class="code" href="constant_8php.html#a67">ATTR_DEF_COMPANY</a> )
<a name="l00495"></a>00495 {
<a name="l00496"></a>00496 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>.=<a class="code" href="constant_8php.html#a85">JS_SEARCH_CARD</a>;
<a name="l00497"></a>00497 <a class="code" href="admin_8inc_8php.html#a4">$w</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"js_search"</span>);
<a name="l00498"></a>00498 <span class="comment">// filter on frd_id</span>
<a name="l00499"></a>00499 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;extra=<a class="code" href="constant_8php.html#a69">FICHE_TYPE_CLIENT</a>.<span class="charliteral">','</span>.<a class="code" href="constant_8php.html#a71">FICHE_TYPE_FOURNISSEUR</a>.<span class="charliteral">','</span>.<a class="code" href="constant_8php.html#a74">FICHE_TYPE_ADM_TAX</a>;
<a name="l00500"></a>00500 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;extra2=0; <span class="comment">// jrn = 0</span>
<a name="l00501"></a>00501 <a class="code" href="pref_8inc_8php.html#a6">$label</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"span"</span>);
<a name="l00502"></a>00502 <a class="code" href="pref_8inc_8php.html#a6">$label</a>-&gt;name=<span class="stringliteral">"av_text"</span>.$r-&gt;ad_id.<span class="stringliteral">"_label"</span>;
<a name="l00503"></a>00503 <a class="code" href="pref_8inc_8php.html#a4">$msg</a>=<a class="code" href="pref_8inc_8php.html#a6">$label</a>-&gt;IOValue();
<a name="l00504"></a>00504 }
<a name="l00505"></a>00505
<a name="l00506"></a>00506 <span class="keywordflow">else</span>
<a name="l00507"></a>00507 {
<a name="l00508"></a>00508 <a class="code" href="admin_8inc_8php.html#a4">$w</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"text"</span>);
<a name="l00509"></a>00509 }
<a name="l00510"></a>00510 }
<a name="l00511"></a>00511 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;label=<a class="code" href="bank_8inc_8php.html#a29">$r</a>-&gt;ad_text;
<a name="l00512"></a>00512 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;value=<a class="code" href="bank_8inc_8php.html#a29">$r</a>-&gt;av_text;
<a name="l00513"></a>00513 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;name=<span class="stringliteral">"av_text"</span>.$r-&gt;ad_id;
<a name="l00514"></a>00514 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;readonly=$p_readonly;
<a name="l00515"></a>00515 <a class="code" href="admin_8inc_8php.html#a4">$w</a>-&gt;table=1;
<a name="l00516"></a>00516
<a name="l00517"></a>00517 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>.=<span class="stringliteral">"&lt;TR&gt;"</span>.$w-&gt;IOValue().<span class="stringliteral">"$msg &lt;/TR&gt;"</span>;
<a name="l00518"></a>00518 }
<a name="l00519"></a>00519 <a class="code" href="impress__bilan_8php.html#a0">$ret</a>.=<span class="stringliteral">"&lt;/table&gt;"</span>;
<a name="l00520"></a>00520 <span class="keywordflow">return</span> <a class="code" href="impress__bilan_8php.html#a0">$ret</a>;
<a name="l00521"></a>00521 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a16"></a><!-- doxytag: member="fiche::Get" ref="a16" 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">fiche::Get </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>
Synonum of <a class="el" href="classfiche.html#a2">fiche::getAttribut</a>.
<p>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00770">770</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>, and <a class="el" href="class__fiche_8php-source.html#l00190">getAttribut()</a>.<div class="fragment"><pre class="fragment"><a name="l00771"></a>00771 {
<a name="l00772"></a>00772 <a class="code" href="debug_8php.html#a0">echo_debug</a>('class_client',__LINE__,'<a class="code" href="classfiche.html#a16">Get</a>');
<a name="l00773"></a>00773 <a class="code" href="classfiche.html#a2">fiche::getAttribut</a>();
<a name="l00774"></a>00774 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a17"></a><!-- doxytag: member="fiche::GetAll" ref="a17" args="($p_offset=-1, $p_search=&quot;&quot;)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">fiche::GetAll </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_offset</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_search</em> = <code>&quot;&quot;</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
get all the card thanks the <a class="el" href="classfiche__def__ref.html">fiche_def_ref</a>
<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_offset</em>&nbsp;</td><td>(default =-1) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$p_search</em>&nbsp;</td><td>sql condition </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><a class="el" href="classfiche.html#a6">fiche::GetByDef</a></dd></dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00780">780</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="class__fiche_8php-source.html#l00317">GetByDef()</a>.
<p>
Referenced by <a class="el" href="class__supplier_8php-source.html#l00083">Supplier::Summary()</a>, <a class="el" href="class__customer_8php-source.html#l00195">Customer::Summary()</a>, <a class="el" href="class__contact_8php-source.html#l00050">contact::Summary()</a>, and <a class="el" href="class__admin_8php-source.html#l00065">Admin::Summary()</a>.<div class="fragment"><pre class="fragment"><a name="l00781"></a>00781 {
<a name="l00782"></a>00782 <span class="keywordflow">return</span> <a class="code" href="classfiche.html#a6">fiche::GetByDef</a>($this-&gt;fiche_def_ref,$p_offset,$p_search);
<a name="l00783"></a>00783 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a2"></a><!-- doxytag: member="fiche::getAttribut" ref="a2" 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">fiche::getAttribut </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>
get all the attribute of a card, add missing ones and sort the array ($this-&gt;attribut) by ad_id
<p>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00190">190</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="impress__fiche_8php-source.html#l00082">$e</a>, <a class="el" href="setup_8php-source.html#l00269">$flag</a>, <a class="el" href="balance_8php-source.html#l00118">$i</a>, <a class="el" href="setup_8php-source.html#l00397">$Max</a>, <a class="el" href="line__update_8php-source.html#l00070">$Ret</a>, <a class="el" href="argenta__be_8inc_8php-source.html#l00044">$row</a>, <a class="el" href="bank_8inc_8php-source.html#l00169">$sql</a>, <a class="el" href="impress__rapport_8php-source.html#l00062">$t</a>, <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>, <a class="el" href="impress__listing__client_8php-source.html#l00059">return</a>, and <a class="el" href="class__attribut_8php-source.html#l00050">SortAttributeById()</a>.
<p>
Referenced by <a class="el" href="class__fiche_8php-source.html#l00770">Get()</a>, and <a class="el" href="class__fiche_8php-source.html#l00167">GetByQCode()</a>.<div class="fragment"><pre class="fragment"><a name="l00190"></a>00190 {
<a name="l00191"></a>00191 <span class="keywordflow">if</span> ( $this-&gt;id == 0){
<a name="l00192"></a>00192 <span class="keywordflow">return</span>;
<a name="l00193"></a>00193 }
<a name="l00194"></a>00194 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select * </span>
<a name="l00195"></a>00195 <span class="stringliteral"> from jnt_fic_att_value </span>
<a name="l00196"></a>00196 <span class="stringliteral"> natural join fiche </span>
<a name="l00197"></a>00197 <span class="stringliteral"> natural join attr_value</span>
<a name="l00198"></a>00198 <span class="stringliteral"> left join attr_def using (ad_id) where f_id="</span>.$this-&gt;id.
<a name="l00199"></a>00199 <span class="stringliteral">" order by ad_id"</span>;
<a name="l00200"></a>00200
<a name="l00201"></a>00201 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00202"></a>00202 <span class="keywordflow">if</span> ( ($Max=pg_NumRows($Ret)) == 0 )
<a name="l00203"></a>00203 <a class="code" href="impress__listing__client_8php.html#a2">return</a> ;
<a name="l00204"></a>00204 <span class="keywordflow">for</span> ($i=0;$i&lt;$Max;$i++) {
<a name="l00205"></a>00205 <a class="code" href="argenta__be_8inc_8php.html#a2">$row</a>=pg_fetch_array($Ret,$i);
<a name="l00206"></a>00206 $this-&gt;<a class="code" href="classfiche__def.html">fiche_def</a>=<a class="code" href="argenta__be_8inc_8php.html#a2">$row</a>['fd_id'];
<a name="l00207"></a>00207 <a class="code" href="impress__rapport_8php.html#a3">$t</a>=<span class="keyword">new</span> <a class="code" href="classAttribut.html">Attribut</a> ($row['ad_id']);
<a name="l00208"></a>00208 <a class="code" href="impress__rapport_8php.html#a3">$t</a>-&gt;ad_text=<a class="code" href="argenta__be_8inc_8php.html#a2">$row</a>['ad_text'];
<a name="l00209"></a>00209 <a class="code" href="impress__rapport_8php.html#a3">$t</a>-&gt;av_text=<a class="code" href="argenta__be_8inc_8php.html#a2">$row</a>['av_text'];
<a name="l00210"></a>00210 $this-&gt;attribut[<a class="code" href="balance_8php.html#a12">$i</a>]=<a class="code" href="impress__rapport_8php.html#a3">$t</a>;
<a name="l00211"></a>00211 }
<a name="l00212"></a>00212 <a class="code" href="impress__fiche_8php.html#a10">$e</a>=<span class="keyword">new</span> Fiche_def($this-&gt;cn,$this-&gt;fiche_def);
<a name="l00213"></a>00213 <a class="code" href="impress__fiche_8php.html#a10">$e</a>-&gt;GetAttribut();
<a name="l00214"></a>00214
<a name="l00215"></a>00215 <span class="keywordflow">if</span> ( <span class="keyword">sizeof</span>($this-&gt;attribut) != <span class="keyword">sizeof</span>($e-&gt;attribut ) ) {
<a name="l00216"></a>00216
<a name="l00217"></a>00217 <span class="comment">// !!! Missing attribute</span>
<a name="l00218"></a>00218 foreach ($e-&gt;attribut as $f ) {
<a name="l00219"></a>00219 <a class="code" href="setup_8php.html#a4">$flag</a>=0;
<a name="l00220"></a>00220 foreach ($this-&gt;attribut as $g ) {
<a name="l00221"></a>00221 <span class="keywordflow">if</span> ( $g-&gt;ad_id == $f-&gt;ad_id )
<a name="l00222"></a>00222 <a class="code" href="setup_8php.html#a4">$flag</a>=1;
<a name="l00223"></a>00223 }
<a name="l00224"></a>00224 <span class="keywordflow">if</span> ( $flag == 0 ) {
<a name="l00225"></a>00225 <span class="comment">// there's a missing one, we insert it</span>
<a name="l00226"></a>00226 <a class="code" href="impress__rapport_8php.html#a3">$t</a>=<span class="keyword">new</span> <a class="code" href="classAttribut.html">Attribut</a> ($f-&gt;ad_id);
<a name="l00227"></a>00227 <a class="code" href="impress__rapport_8php.html#a3">$t</a>-&gt;av_text=<span class="stringliteral">""</span>;
<a name="l00228"></a>00228 <a class="code" href="impress__rapport_8php.html#a3">$t</a>-&gt;ad_text=$f-&gt;ad_text;
<a name="l00229"></a>00229 $this-&gt;attribut[<a class="code" href="setup_8php.html#a11">$Max</a>]=<a class="code" href="impress__rapport_8php.html#a3">$t</a>;
<a name="l00230"></a>00230 <a class="code" href="setup_8php.html#a11">$Max</a>++;
<a name="l00231"></a>00231 } <span class="comment">// if flag == 0</span>
<a name="l00232"></a>00232
<a name="l00233"></a>00233 }<span class="comment">// foreach </span>
<a name="l00234"></a>00234 $this-&gt;attribut=<a class="code" href="class__attribut_8php.html#a0">SortAttributeById</a>($this-&gt;attribut);
<a name="l00235"></a>00235
<a name="l00236"></a>00236
<a name="l00237"></a>00237 }<span class="comment">//missing attribut</span>
<a name="l00238"></a>00238 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a6"></a><!-- doxytag: member="fiche::GetByDef" ref="a6" args="($p_frd_id, $p_offset=-1, $p_search=&quot;&quot;)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">fiche::GetByDef </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_frd_id</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>$&nbsp;</td>
<td class="mdname" nowrap> <em>p_offset</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_search</em> = <code>&quot;&quot;</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Return array of card from the frd family.
<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>the</em>&nbsp;</td><td><a class="el" href="fiche__def_8inc_8php.html#a1">fiche_def_ref.frd_id</a> </td></tr>
<tr><td valign="top"></td><td valign="top"><em>p_search</em>&nbsp;</td><td>is an optional filter</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>array of fiche object</dd></dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00317">317</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="commercial_8php-source.html#l00035">$_SESSION</a>, <a class="el" href="fiche__def_8inc_8php-source.html#l00037">$all</a>, <a class="el" href="balance_8php-source.html#l00118">$i</a>, <a class="el" href="jrn__pdf_8php-source.html#l00071">$limit</a>, <a class="el" href="line__update_8php-source.html#l00070">$Ret</a>, <a class="el" href="argenta__be_8inc_8php-source.html#l00044">$row</a>, <a class="el" href="bank_8inc_8php-source.html#l00169">$sql</a>, <a class="el" href="impress__rapport_8php-source.html#l00062">$t</a>, <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>, <a class="el" href="facture_8inc_8php-source.html#l00227">f_id</a>, <a class="el" href="class__fiche_8php-source.html#l00155">fiche()</a>, and <a class="el" href="impress__listing__client_8php-source.html#l00059">return</a>.
<p>
Referenced by <a class="el" href="class__fiche_8php-source.html#l00780">GetAll()</a>.<div class="fragment"><pre class="fragment"><a name="l00317"></a>00317 {
<a name="l00318"></a>00318 <span class="keywordflow">if</span> ( $p_offset == -1 )
<a name="l00319"></a>00319 {
<a name="l00320"></a>00320 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select * </span>
<a name="l00321"></a>00321 <span class="stringliteral"> from</span>
<a name="l00322"></a>00322 <span class="stringliteral"> fiche join fiche_Def using (fd_id)</span>
<a name="l00323"></a>00323 <span class="stringliteral"> where frd_id="</span>.$p_frd_id.<span class="stringliteral">" $p_search order by f_id"</span>;
<a name="l00324"></a>00324 }
<a name="l00325"></a>00325 <span class="keywordflow">else</span>
<a name="l00326"></a>00326 {
<a name="l00327"></a>00327 <a class="code" href="jrn__pdf_8php.html#a9">$limit</a>=<a class="code" href="commercial_8php.html#a0">$_SESSION</a>['g_pagesize'];
<a name="l00328"></a>00328 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select * </span>
<a name="l00329"></a>00329 <span class="stringliteral"> from</span>
<a name="l00330"></a>00330 <span class="stringliteral"> fiche join fiche_Def using (fd_id)</span>
<a name="l00331"></a>00331 <span class="stringliteral"> where frd_id="</span>.$p_frd_id.<span class="stringliteral">" $p_search order by f_id</span>
<a name="l00332"></a>00332 <span class="stringliteral"> limit "</span>.<a class="code" href="jrn__pdf_8php.html#a9">$limit</a>.<span class="stringliteral">" offset "</span>.$p_offset;
<a name="l00333"></a>00333
<a name="l00334"></a>00334 }
<a name="l00335"></a>00335
<a name="l00336"></a>00336 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00337"></a>00337 <span class="keywordflow">if</span> ( ($Max=pg_NumRows($Ret)) == 0 )
<a name="l00338"></a>00338 <a class="code" href="impress__listing__client_8php.html#a2">return</a> ;
<a name="l00339"></a>00339 <a class="code" href="fiche__def_8inc_8php.html#a5">$all</a>[0]=<span class="keyword">new</span> <a class="code" href="classfiche.html#a0">fiche</a>($this-&gt;cn);
<a name="l00340"></a>00340
<a name="l00341"></a>00341 <span class="keywordflow">for</span> ($i=0;$i&lt;$Max;$i++) {
<a name="l00342"></a>00342 <a class="code" href="argenta__be_8inc_8php.html#a2">$row</a>=pg_fetch_array($Ret,$i);
<a name="l00343"></a>00343 <a class="code" href="impress__rapport_8php.html#a3">$t</a>=<span class="keyword">new</span> <a class="code" href="classfiche.html#a0">fiche</a>($this-&gt;cn,$row['<a class="code" href="facture_8inc_8php.html#a26">f_id</a>']);
<a name="l00344"></a>00344 <a class="code" href="impress__rapport_8php.html#a3">$t</a>-&gt;getAttribut();
<a name="l00345"></a>00345 <a class="code" href="fiche__def_8inc_8php.html#a5">$all</a>[<a class="code" href="balance_8php.html#a12">$i</a>]=<a class="code" href="impress__rapport_8php.html#a3">$t</a>;
<a name="l00346"></a>00346
<a name="l00347"></a>00347 }
<a name="l00348"></a>00348 <span class="keywordflow">return</span> <a class="code" href="fiche__def_8inc_8php.html#a5">$all</a>;
<a name="l00349"></a>00349 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a1"></a><!-- doxytag: member="fiche::GetByQCode" ref="a1" args="($p_qcode, $p_all=true)" --><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">fiche::GetByQCode </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname" nowrap> <em>p_qcode</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_all</em> = <code>true</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>
Retrieve a card thx his quick_code complete the object.
<p>
GetByQCode($p_qcode) <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_qcode</em>&nbsp;</td><td>quick_code (ad_id=23) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>$p_all</em>&nbsp;</td><td>retrieve all the attribut of the card, possible value are true false </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>0 success 1 error not found</dd></dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00167">167</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="bank_8inc_8php-source.html#l00237">$r</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="debug_8php-source.html#l00034">echo_debug()</a>, <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>, <a class="el" href="facture_8inc_8php-source.html#l00227">f_id</a>, <a class="el" href="ac__common_8php-source.html#l00206">FormatString()</a>, <a class="el" href="class__fiche_8php-source.html#l00190">getAttribut()</a>, and <a class="el" href="class__fiche_8php-source.html#l00246">size()</a>.<div class="fragment"><pre class="fragment"><a name="l00168"></a>00168 {
<a name="l00169"></a>00169
<a name="l00170"></a>00170 $p_qcode=<a class="code" href="ac__common_8php.html#a9">FormatString</a>($p_qcode);
<a name="l00171"></a>00171 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select f_id from jnt_fic_att_value join attr_value </span>
<a name="l00172"></a>00172 <span class="stringliteral"> using (jft_id) where ad_id=23 and av_text='"</span>.$p_qcode.<span class="stringliteral">"'"</span>;
<a name="l00173"></a>00173 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00174"></a>00174 <a class="code" href="bank_8inc_8php.html#a29">$r</a>=pg_fetch_all($Res);
<a name="l00175"></a>00175 <a class="code" href="debug_8php.html#a0">echo_debug</a>('<a class="code" href="classfiche.html">fiche</a>',__LINE__,'result:'.var_export($r,<span class="keyword">true</span>).'<a class="code" href="classfiche.html#a3">size</a> '.<span class="keyword">sizeof</span>($r));
<a name="l00176"></a>00176 <span class="keywordflow">if</span> ( $r == null )
<a name="l00177"></a>00177 <span class="keywordflow">return</span> 1;
<a name="l00178"></a>00178 $this-&gt;<span class="keywordtype">id</span>=<a class="code" href="bank_8inc_8php.html#a29">$r</a>[0]['<a class="code" href="facture_8inc_8php.html#a26">f_id</a>'];
<a name="l00179"></a>00179 <a class="code" href="debug_8php.html#a0">echo_debug</a>('class_fiche',__LINE__,'<a class="code" href="facture_8inc_8php.html#a26">f_id</a> = '.$this-&gt;id);
<a name="l00180"></a>00180
<a name="l00181"></a>00181 <span class="keywordflow">if</span> ( $p_all )
<a name="l00182"></a>00182 $this-&gt;<a class="code" href="classfiche.html#a2">getAttribut</a>();
<a name="l00183"></a>00183 <span class="keywordflow">return</span> 0;
<a name="l00184"></a>00184 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a4"></a><!-- doxytag: member="fiche::GetByType" ref="a4" args="($p_fd_id)" --><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">fiche::GetByType </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_fd_id</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>
Get all the card where the fiche_def.fd_id is given in parameter.
<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_fd_id</em>&nbsp;</td><td>= fiche_def.fd_id</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>double array (f_id,fd_id)</dd></dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00260">260</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="fiche__def_8inc_8php-source.html#l00037">$all</a>, <a class="el" href="balance_8php-source.html#l00118">$i</a>, <a class="el" href="line__update_8php-source.html#l00070">$Ret</a>, <a class="el" href="argenta__be_8inc_8php-source.html#l00044">$row</a>, <a class="el" href="bank_8inc_8php-source.html#l00169">$sql</a>, <a class="el" href="impress__rapport_8php-source.html#l00062">$t</a>, <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>, <a class="el" href="facture_8inc_8php-source.html#l00227">f_id</a>, <a class="el" href="class__fiche_8php-source.html#l00155">fiche()</a>, and <a class="el" href="impress__listing__client_8php-source.html#l00059">return</a>.<div class="fragment"><pre class="fragment"><a name="l00260"></a>00260 {
<a name="l00261"></a>00261 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select * </span>
<a name="l00262"></a>00262 <span class="stringliteral"> from</span>
<a name="l00263"></a>00263 <span class="stringliteral"> fiche </span>
<a name="l00264"></a>00264 <span class="stringliteral"> where fd_id="</span>.$p_fd_id;
<a name="l00265"></a>00265
<a name="l00266"></a>00266
<a name="l00267"></a>00267 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00268"></a>00268 <span class="keywordflow">if</span> ( ($Max=pg_NumRows($Ret)) == 0 )
<a name="l00269"></a>00269 <a class="code" href="impress__listing__client_8php.html#a2">return</a> ;
<a name="l00270"></a>00270 <a class="code" href="fiche__def_8inc_8php.html#a5">$all</a>[0]=<span class="keyword">new</span> <a class="code" href="classfiche.html#a0">fiche</a>($this-&gt;cn);
<a name="l00271"></a>00271
<a name="l00272"></a>00272 <span class="keywordflow">for</span> ($i=0;$i&lt;$Max;$i++) {
<a name="l00273"></a>00273 <a class="code" href="argenta__be_8inc_8php.html#a2">$row</a>=pg_fetch_array($Ret,$i);
<a name="l00274"></a>00274 <a class="code" href="impress__rapport_8php.html#a3">$t</a>=<span class="keyword">new</span> <a class="code" href="classfiche.html#a0">fiche</a>($this-&gt;cn,$row['<a class="code" href="facture_8inc_8php.html#a26">f_id</a>']);
<a name="l00275"></a>00275 <a class="code" href="impress__rapport_8php.html#a3">$t</a>-&gt;getAttribut();
<a name="l00276"></a>00276 <a class="code" href="fiche__def_8inc_8php.html#a5">$all</a>[<a class="code" href="balance_8php.html#a12">$i</a>]=<a class="code" href="impress__rapport_8php.html#a3">$t</a>;
<a name="l00277"></a>00277
<a name="l00278"></a>00278 }
<a name="l00279"></a>00279 <span class="keywordflow">return</span> <a class="code" href="fiche__def_8inc_8php.html#a5">$all</a>;
<a name="l00280"></a>00280 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a15"></a><!-- doxytag: member="fiche::getName" ref="a15" 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">fiche::getName </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 the name of a card
<p>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00758">758</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="bank_8inc_8php-source.html#l00237">$r</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>, and <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>.<div class="fragment"><pre class="fragment"><a name="l00759"></a>00759 {
<a name="l00760"></a>00760 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select av_text from jnt_fic_att_value join attr_value </span>
<a name="l00761"></a>00761 <span class="stringliteral"> using (jft_id) where ad_id=1 and f_id="</span>.$this-&gt;id;
<a name="l00762"></a>00762 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00763"></a>00763 <a class="code" href="bank_8inc_8php.html#a29">$r</a>=pg_fetch_all($Res);
<a name="l00764"></a>00764 <span class="keywordflow">if</span> ( <span class="keyword">sizeof</span>($r) == 0 )
<a name="l00765"></a>00765 <span class="keywordflow">return</span> 1;
<a name="l00766"></a>00766 <span class="keywordflow">return</span> <a class="code" href="bank_8inc_8php.html#a29">$r</a>[0]['av_text'];
<a name="l00767"></a>00767 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a12"></a><!-- doxytag: member="fiche::insert" ref="a12" args="($p_fiche_def)" --><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">fiche::insert </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_fiche_def</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>
insert a new record
<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_fiche_def</em>&nbsp;</td><td>fiche_def.fd_id</td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00542">542</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="impress__fiche_8php-source.html#l00038">$fiche_id</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>, <a class="el" href="postgres_8php-source.html#l00263">Commit()</a>, <a class="el" href="postgres_8php-source.html#l00222">CountSql()</a>, <a class="el" href="debug_8php-source.html#l00034">echo_debug()</a>, <a class="el" href="postgres_8php-source.html#l00099">ExecSql()</a>, <a class="el" href="ac__common_8php-source.html#l00206">FormatString()</a>, <a class="el" href="ac__common_8php-source.html#l00076">isNumber()</a>, <a class="el" href="action_8inc_8php-source.html#l00240">name</a>, <a class="el" href="postgres_8php-source.html#l00251">NextSequence()</a>, <a class="el" href="postgres_8php-source.html#l00257">StartSql()</a>, and <a class="el" href="action_8inc_8php-source.html#l00241">value</a>.
<p>
Referenced by <a class="el" href="class__fiche_8php-source.html#l00528">Save()</a>.<div class="fragment"><pre class="fragment"><a name="l00543"></a>00543 {
<a name="l00544"></a>00544 <a class="code" href="impress__fiche_8php.html#a3">$fiche_id</a>=<a class="code" href="postgres_8php.html#a13">NextSequence</a>($this-&gt;cn,'s_fiche');
<a name="l00545"></a>00545 $this-&gt;<span class="keywordtype">id</span>=<a class="code" href="impress__fiche_8php.html#a3">$fiche_id</a>;
<a name="l00546"></a>00546 <span class="comment">// first we create the card</span>
<a name="l00547"></a>00547 <a class="code" href="postgres_8php.html#a14">StartSql</a>($this-&gt;cn);
<a name="l00548"></a>00548 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=sprintf(<span class="stringliteral">"insert into fiche(f_id,fd_id)"</span>.
<a name="l00549"></a>00549 <span class="stringliteral">" values (%d,%d)"</span>,
<a name="l00550"></a>00550 $fiche_id,$p_fiche_def);
<a name="l00551"></a>00551 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00552"></a>00552 <span class="comment">// parse the $_POST array</span>
<a name="l00553"></a>00553 foreach ($_POST as $<a class="code" href="action_8inc_8php.html#a18">name</a>=&gt;$<a class="code" href="action_8inc_8php.html#a19">value</a> )
<a name="l00554"></a>00554 {
<a name="l00555"></a>00555 <a class="code" href="debug_8php.html#a0">echo_debug</a> (<span class="stringliteral">"class_fiche"</span>,__LINE__,<span class="stringliteral">"Name = $name value $value"</span>) ;
<a name="l00556"></a>00556 list ($<span class="keywordtype">id</span>) = sscanf ($<a class="code" href="action_8inc_8php.html#a18">name</a>,<span class="stringliteral">"av_text%d"</span>);
<a name="l00557"></a>00557 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == null ) <span class="keywordflow">continue</span>;
<a name="l00558"></a>00558 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"class_fiche"</span>,__LINE__,<span class="stringliteral">"add $id"</span>);
<a name="l00559"></a>00559
<a name="l00560"></a>00560 <span class="comment">// Special traitement</span>
<a name="l00561"></a>00561 <span class="comment">// quickcode</span>
<a name="l00562"></a>00562 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == <a class="code" href="constant_8php.html#a78">ATTR_DEF_QUICKCODE</a>)
<a name="l00563"></a>00563 {
<a name="l00564"></a>00564 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"Modify ATTR_DEF_QUICKCODE"</span>);
<a name="l00565"></a>00565 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=sprintf(<span class="stringliteral">"select insert_quick_code(%d,'%s')"</span>,
<a name="l00566"></a>00566 $fiche_id,<a class="code" href="ac__common_8php.html#a9">FormatString</a>($<a class="code" href="action_8inc_8php.html#a19">value</a>));
<a name="l00567"></a>00567 <a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00568"></a>00568 <span class="keywordflow">continue</span>;
<a name="l00569"></a>00569 }
<a name="l00570"></a>00570 <span class="comment">// name</span>
<a name="l00571"></a>00571 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == <a class="code" href="constant_8php.html#a56">ATTR_DEF_NAME</a> )
<a name="l00572"></a>00572 {
<a name="l00573"></a>00573 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"Modify ATTR_DEF_NAME"</span>);
<a name="l00574"></a>00574 <span class="keywordflow">if</span> ( strlen(trim($<a class="code" href="action_8inc_8php.html#a19">value</a>)) == 0 )
<a name="l00575"></a>00575 $value=<span class="stringliteral">"pas de nom"</span>;
<a name="l00576"></a>00576
<a name="l00577"></a>00577 }
<a name="l00578"></a>00578 <span class="comment">// account</span>
<a name="l00579"></a>00579 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == <a class="code" href="constant_8php.html#a55">ATTR_DEF_ACCOUNT</a> )
<a name="l00580"></a>00580 {
<a name="l00581"></a>00581 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"Modify ATTR_DEF_ACCOUNT"</span>);
<a name="l00582"></a>00582 $v=<a class="code" href="ac__common_8php.html#a9">FormatString</a>($<a class="code" href="action_8inc_8php.html#a19">value</a>);
<a name="l00583"></a>00583 <span class="keywordflow">if</span> ( <a class="code" href="ac__common_8php.html#a2">isNumber</a>($v) == 1 )
<a name="l00584"></a>00584 {
<a name="l00585"></a>00585 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=sprintf(<span class="stringliteral">"select account_insert(%d,%d)"</span>,
<a name="l00586"></a>00586 $this-&gt;id,$v);
<a name="l00587"></a>00587 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00588"></a>00588 }
<a name="l00589"></a>00589 <span class="keywordflow">if</span> ( strlen(trim($v))==0 )
<a name="l00590"></a>00590 {
<a name="l00591"></a>00591 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=sprintf(<span class="stringliteral">"select account_insert(%d,null)"</span>,
<a name="l00592"></a>00592 $this-&gt;id);
<a name="l00593"></a>00593 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00594"></a>00594 }
<a name="l00595"></a>00595
<a name="l00596"></a>00596 <span class="keywordflow">continue</span>;
<a name="l00597"></a>00597 }
<a name="l00598"></a>00598 <span class="comment">// TVA</span>
<a name="l00599"></a>00599 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == <a class="code" href="constant_8php.html#a59">ATTR_DEF_TVA</a> )
<a name="l00600"></a>00600 {
<a name="l00601"></a>00601 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"Modify ATTR_DEF_TVA"</span>);
<a name="l00602"></a>00602 <span class="comment">// Verify if the rate exists, if not then do not update</span>
<a name="l00603"></a>00603 <span class="keywordflow">if</span> ( strlen(trim($<a class="code" href="action_8inc_8php.html#a19">value</a>)) != 0 )
<a name="l00604"></a>00604 {
<a name="l00605"></a>00605 <span class="keywordflow">if</span> ( <a class="code" href="postgres_8php.html#a10">CountSql</a>($this-&gt;cn,<span class="stringliteral">"select * from tva_rate where tva_id="</span>.$value) == 0)
<a name="l00606"></a>00606 {
<a name="l00607"></a>00607 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"class_fiche"</span>,__LINE__,<span class="stringliteral">"Tva invalide $value"</span>);
<a name="l00608"></a>00608 <span class="keywordflow">continue</span>;
<a name="l00609"></a>00609 }
<a name="l00610"></a>00610 }
<a name="l00611"></a>00611 }
<a name="l00612"></a>00612 <span class="comment">// The contact has a company attribut</span>
<a name="l00613"></a>00613 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == <a class="code" href="constant_8php.html#a67">ATTR_DEF_COMPANY</a> )
<a name="l00614"></a>00614 {
<a name="l00615"></a>00615 $exist=<a class="code" href="postgres_8php.html#a10">CountSql</a>($this-&gt;cn,<span class="stringliteral">"select f_id from fiche join fiche_def using (fd_id) "</span>.
<a name="l00616"></a>00616 <span class="stringliteral">" join jnt_fic_att_value using (f_id) join attr_value using (jft_id) "</span>.
<a name="l00617"></a>00617 <span class="stringliteral">" where frd_id in (8,9,14) and ad_id="</span>.ATTR_DEF_QUICKCODE.
<a name="l00618"></a>00618 <span class="stringliteral">" and av_text='"</span>.FormatString($<a class="code" href="action_8inc_8php.html#a19">value</a>).<span class="stringliteral">"'"</span>);
<a name="l00619"></a>00619 <span class="keywordflow">if</span> ( $exist == 0 )
<a name="l00620"></a>00620 {
<a name="l00621"></a>00621 $value=<span class="stringliteral">"Attention : pas de soci<63>t<EFBFBD> "</span>;
<a name="l00622"></a>00622 }
<a name="l00623"></a>00623 }
<a name="l00624"></a>00624 <span class="comment">// Normal traitement</span>
<a name="l00625"></a>00625 $value2=<a class="code" href="ac__common_8php.html#a9">FormatString</a>($<a class="code" href="action_8inc_8php.html#a19">value</a>);
<a name="l00626"></a>00626
<a name="l00627"></a>00627 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=sprintf(<span class="stringliteral">"select attribut_insert(%d,%d,'%s')"</span>,
<a name="l00628"></a>00628 $fiche_id,$<span class="keywordtype">id</span>,$value2);
<a name="l00629"></a>00629 <a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00630"></a>00630 }
<a name="l00631"></a>00631 <a class="code" href="postgres_8php.html#a16">Commit</a>($this-&gt;cn);
<a name="l00632"></a>00632 <span class="keywordflow">return</span>;
<a name="l00633"></a>00633
<a name="l00634"></a>00634
<a name="l00635"></a>00635 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a14"></a><!-- doxytag: member="fiche::remove" ref="a14" 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">fiche::remove </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>
remove a card
<p>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00738">738</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</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="l00739"></a>00739 {
<a name="l00740"></a>00740 <span class="keywordflow">if</span> ( $this-&gt;id==0 ) <span class="keywordflow">return</span>;
<a name="l00741"></a>00741 <span class="comment">// verify if that card has not been used is a ledger</span>
<a name="l00742"></a>00742 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select fiche_used("</span>.$this-&gt;id.<span class="stringliteral">") as result"</span>;
<a name="l00743"></a>00743 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00744"></a>00744
<a name="l00745"></a>00745 <span class="comment">// fetch the result</span>
<a name="l00746"></a>00746 list($result)=pg_fetch_row($Res,0);
<a name="l00747"></a>00747
<a name="l00748"></a>00748 <span class="keywordflow">if</span> ( $result == 0 )
<a name="l00749"></a>00749 {
<a name="l00750"></a>00750 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select fiche_delete ("</span>.$this-&gt;id.<span class="stringliteral">")"</span>;
<a name="l00751"></a>00751 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00752"></a>00752 <span class="keywordflow">return</span> 0;
<a name="l00753"></a>00753 }
<a name="l00754"></a>00754 <span class="keywordflow">return</span> 1;
<a name="l00755"></a>00755 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a11"></a><!-- doxytag: member="fiche::Save" ref="a11" args="($p_fiche_def=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">fiche::Save </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_fiche_def</em> = <code>0</code> </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>
Save a card, call insert or update.
<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_fiche_def</em>&nbsp;</td><td>(default 0)</td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00528">528</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="class__fiche_8php-source.html#l00542">insert()</a>, and <a class="el" href="class__fiche_8php-source.html#l00642">update()</a>.<div class="fragment"><pre class="fragment"><a name="l00529"></a>00529 {
<a name="l00530"></a>00530 <span class="comment">// new card or only a update ?</span>
<a name="l00531"></a>00531 <span class="keywordflow">if</span> ( $this-&gt;id == 0 )
<a name="l00532"></a>00532 $this-&gt;<a class="code" href="classfiche.html#a12">insert</a>($p_fiche_def);
<a name="l00533"></a>00533 <span class="keywordflow">else</span>
<a name="l00534"></a>00534 $this-&gt;<a class="code" href="classfiche.html#a13">update</a>();
<a name="l00535"></a>00535 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a7"></a><!-- doxytag: member="fiche::ShowTable" ref="a7" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">fiche::ShowTable </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>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00350">350</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.<div class="fragment"><pre class="fragment"><a name="l00350"></a>00350 {
<a name="l00351"></a>00351 echo <span class="stringliteral">"&lt;TR&gt;&lt;TD&gt; "</span>.
<a name="l00352"></a>00352 $this-&gt;<span class="keywordtype">id</span>.<span class="stringliteral">"&lt;/TD&gt;"</span>.
<a name="l00353"></a>00353 <span class="stringliteral">"&lt;TR&gt; &lt;TD&gt;"</span>.
<a name="l00354"></a>00354 $this-&gt;attribut_value.<span class="stringliteral">"&lt;/TD&gt;"</span>.
<a name="l00355"></a>00355 <span class="stringliteral">"&lt;TR&gt; &lt;TD&gt;"</span>.
<a name="l00356"></a>00356 $this-&gt;attribut_def.<span class="stringliteral">"&lt;/TD&gt;&lt;/TR&gt;"</span>;
<a name="l00357"></a>00357 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a3"></a><!-- doxytag: member="fiche::size" 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">fiche::size </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>
give the size of a card object
<p>
<dl compact><dt><b>Returns:</b></dt><dd>size</dd></dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00246">246</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
Referenced by <a class="el" href="class__fiche_8php-source.html#l00167">GetByQCode()</a>.<div class="fragment"><pre class="fragment"><a name="l00246"></a>00246 {
<a name="l00247"></a>00247 <span class="keywordflow">if</span> ( isset ($this-&gt;ad_id))
<a name="l00248"></a>00248 <span class="keywordflow">return</span> <span class="keyword">sizeof</span>($this-&gt;ad_id);
<a name="l00249"></a>00249 <span class="keywordflow">else</span>
<a name="l00250"></a>00250 <span class="keywordflow">return</span> 0;
<a name="l00251"></a>00251 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a8"></a><!-- doxytag: member="fiche::strAttribut" ref="a8" args="($p_ad_id)" --><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">fiche::strAttribut </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">$&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>p_ad_id</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>
return the string of the given attribute (attr_def.ad_id)
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>the</em>&nbsp;</td><td>AD_ID from attr_def.ad_id </td></tr>
</table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="constant_8php.html">constant.php</a> </dd></dl>
<dl compact><dt><b>Returns:</b></dt><dd>string</dd></dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00366">366</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="impress__fiche_8php-source.html#l00082">$e</a>, <a class="el" href="depense_8inc_8php-source.html#l00077">$Res</a>, <a class="el" href="argenta__be_8inc_8php-source.html#l00044">$row</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="l00367"></a>00367 {
<a name="l00368"></a>00368 <span class="keywordflow">if</span> ( <span class="keyword">sizeof</span> ($this-&gt;attribut) == 0 )
<a name="l00369"></a>00369 {
<a name="l00370"></a>00370 <span class="keywordflow">if</span> ($this-&gt;id==0) <span class="keywordflow">return</span> '- <a class="code" href="constant_8php.html#a43">ERROR</a> -';
<a name="l00371"></a>00371 <span class="comment">// object is not in memory we need to look into the database</span>
<a name="l00372"></a>00372 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select av_text from attr_value join jnt_fic_att_value using(jft_id)</span>
<a name="l00373"></a>00373 <span class="stringliteral"> where f_id="</span>.$this-&gt;id.<span class="stringliteral">" and ad_id="</span>.$p_ad_id;
<a name="l00374"></a>00374 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00375"></a>00375 <a class="code" href="argenta__be_8inc_8php.html#a2">$row</a>=pg_fetch_all($Res);
<a name="l00376"></a>00376 <span class="comment">// if not found return error</span>
<a name="l00377"></a>00377 <span class="keywordflow">if</span> ( $row == <span class="keyword">false</span> )
<a name="l00378"></a>00378 <span class="keywordflow">return</span> ' - <a class="code" href="constant_8php.html#a43">ERROR</a> -';
<a name="l00379"></a>00379
<a name="l00380"></a>00380 <span class="keywordflow">return</span> <a class="code" href="argenta__be_8inc_8php.html#a2">$row</a>[0]['av_text'];
<a name="l00381"></a>00381 }
<a name="l00382"></a>00382
<a name="l00383"></a>00383 foreach ($this-&gt;attribut as $e)
<a name="l00384"></a>00384 {
<a name="l00385"></a>00385 <span class="keywordflow">if</span> ( $e-&gt;ad_id == $p_ad_id )
<a name="l00386"></a>00386 <span class="keywordflow">return</span> <a class="code" href="impress__fiche_8php.html#a10">$e</a>-&gt;av_text;
<a name="l00387"></a>00387 }
<a name="l00388"></a>00388 <span class="keywordflow">return</span> '- <a class="code" href="constant_8php.html#a43">ERROR</a> -';
<a name="l00389"></a>00389 }
</pre></div>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a13"></a><!-- doxytag: member="fiche::update" ref="a13" 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">fiche::update </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>
update a card
<p>
<dl compact><dt><b><a class="el" href="todo.html#_todo000011">Todo:</a></b></dt><dd>add a check to return an error and rollback operation </dd></dl>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00642">642</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>.
<p>
References <a class="el" href="line__update_8php-source.html#l00070">$Ret</a>, <a class="el" href="bank_8inc_8php-source.html#l00169">$sql</a>, <a class="el" href="show__document__modele_8php-source.html#l00050">$tmp</a>, <a class="el" href="postgres_8php-source.html#l00222">CountSql()</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="ac__common_8php-source.html#l00206">FormatString()</a>, <a class="el" href="ac__common_8php-source.html#l00076">isNumber()</a>, <a class="el" href="action_8inc_8php-source.html#l00240">name</a>, and <a class="el" href="action_8inc_8php-source.html#l00241">value</a>.
<p>
Referenced by <a class="el" href="class__fiche_8php-source.html#l00528">Save()</a>.<div class="fragment"><pre class="fragment"><a name="l00643"></a>00643 {
<a name="l00644"></a>00644 <span class="comment">// parse the $_POST array</span>
<a name="l00645"></a>00645 foreach ($_POST as $<a class="code" href="action_8inc_8php.html#a18">name</a>=&gt;$<a class="code" href="action_8inc_8php.html#a19">value</a> )
<a name="l00646"></a>00646 {
<a name="l00647"></a>00647 <a class="code" href="debug_8php.html#a0">echo_debug</a> (<span class="stringliteral">"class_fiche"</span>,__LINE__,<span class="stringliteral">"Name = $name value $value"</span>) ;
<a name="l00648"></a>00648 list ($<span class="keywordtype">id</span>) = sscanf ($<a class="code" href="action_8inc_8php.html#a18">name</a>,<span class="stringliteral">"av_text%d"</span>);
<a name="l00649"></a>00649 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == null ) <span class="keywordflow">continue</span>;
<a name="l00650"></a>00650 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"class_fiche"</span>,__LINE__,<span class="stringliteral">"modify $id"</span>);
<a name="l00651"></a>00651
<a name="l00652"></a>00652 <span class="comment">// retrieve jft_id to update table attr_value</span>
<a name="l00653"></a>00653 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">" select jft_id from jnt_fic_att_value where ad_id=$id and f_id=$this-&gt;id"</span>;
<a name="l00654"></a>00654 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00655"></a>00655 <span class="keywordflow">if</span> ( pg_NumRows($Ret) != 1 ) {
<a name="l00656"></a>00656 <a class="code" href="ac__common_8php.html#a0">echo_error</a> (<span class="stringliteral">"class_fiche "</span>.__LINE__.<span class="stringliteral">" INVALID ID !!! "</span>);
<a name="l00657"></a>00657 <span class="keywordflow">return</span>;
<a name="l00658"></a>00658 }
<a name="l00659"></a>00659 <a class="code" href="show__document__modele_8php.html#a5">$tmp</a>=pg_fetch_array($Ret,0);
<a name="l00660"></a>00660 $jft_id=<a class="code" href="show__document__modele_8php.html#a5">$tmp</a>['jft_id'];
<a name="l00661"></a>00661
<a name="l00662"></a>00662 <span class="comment">// Special traitement</span>
<a name="l00663"></a>00663 <span class="comment">// quickcode</span>
<a name="l00664"></a>00664 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == <a class="code" href="constant_8php.html#a78">ATTR_DEF_QUICKCODE</a>)
<a name="l00665"></a>00665 {
<a name="l00666"></a>00666 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"Modify ATTR_DEF_QUICKCODE"</span>);
<a name="l00667"></a>00667 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=sprintf(<span class="stringliteral">"select update_quick_code(%d,'%s')"</span>,
<a name="l00668"></a>00668 $jft_id,<a class="code" href="ac__common_8php.html#a9">FormatString</a>($<a class="code" href="action_8inc_8php.html#a19">value</a>));
<a name="l00669"></a>00669 <a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00670"></a>00670 <span class="keywordflow">continue</span>;
<a name="l00671"></a>00671 }
<a name="l00672"></a>00672 <span class="comment">// name</span>
<a name="l00673"></a>00673 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == <a class="code" href="constant_8php.html#a56">ATTR_DEF_NAME</a> )
<a name="l00674"></a>00674 {
<a name="l00675"></a>00675 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"Modify ATTR_DEF_NAME"</span>);
<a name="l00676"></a>00676 <span class="keywordflow">if</span> ( strlen(trim($<a class="code" href="action_8inc_8php.html#a19">value</a>)) == 0 )
<a name="l00677"></a>00677 <span class="keywordflow">continue</span>;
<a name="l00678"></a>00678
<a name="l00679"></a>00679 }
<a name="l00680"></a>00680 <span class="comment">// account</span>
<a name="l00681"></a>00681 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == <a class="code" href="constant_8php.html#a55">ATTR_DEF_ACCOUNT</a> )
<a name="l00682"></a>00682 {
<a name="l00683"></a>00683 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"Modify ATTR_DEF_ACCOUNT"</span>);
<a name="l00684"></a>00684 $v=<a class="code" href="ac__common_8php.html#a9">FormatString</a>($<a class="code" href="action_8inc_8php.html#a19">value</a>);
<a name="l00685"></a>00685 <span class="keywordflow">if</span> ( <a class="code" href="ac__common_8php.html#a2">isNumber</a>($v) == 1 )
<a name="l00686"></a>00686 {
<a name="l00687"></a>00687 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=sprintf(<span class="stringliteral">"select account_update(%d,%d)"</span>,
<a name="l00688"></a>00688 $this-&gt;id,$v);
<a name="l00689"></a>00689 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00690"></a>00690 }
<a name="l00691"></a>00691 <span class="keywordflow">if</span> ( strlen (trim($v)) == 0 )
<a name="l00692"></a>00692 {
<a name="l00693"></a>00693 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=sprintf(<span class="stringliteral">"select account_update(%d,null)"</span>,
<a name="l00694"></a>00694 $this-&gt;id);
<a name="l00695"></a>00695 <a class="code" href="line__update_8php.html#a8">$Ret</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00696"></a>00696 <span class="keywordflow">continue</span>;
<a name="l00697"></a>00697 }
<a name="l00698"></a>00698 }
<a name="l00699"></a>00699 <span class="comment">// TVA</span>
<a name="l00700"></a>00700 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == <a class="code" href="constant_8php.html#a59">ATTR_DEF_TVA</a> )
<a name="l00701"></a>00701 {
<a name="l00702"></a>00702 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"Modify ATTR_DEF_TVA"</span>);
<a name="l00703"></a>00703 <span class="comment">// Verify if the rate exists, if not then do not update</span>
<a name="l00704"></a>00704 <span class="keywordflow">if</span> ( strlen(trim($<a class="code" href="action_8inc_8php.html#a19">value</a>)) != 0 )
<a name="l00705"></a>00705 {
<a name="l00706"></a>00706 <span class="keywordflow">if</span> ( <a class="code" href="postgres_8php.html#a10">CountSql</a>($this-&gt;cn,<span class="stringliteral">"select * from tva_rate where tva_id="</span>.$value) == 0)
<a name="l00707"></a>00707 {
<a name="l00708"></a>00708 <a class="code" href="debug_8php.html#a0">echo_debug</a>(<span class="stringliteral">"class_fiche"</span>,__LINE__,<span class="stringliteral">"Tva invalide $value"</span>);
<a name="l00709"></a>00709 <span class="keywordflow">continue</span>;
<a name="l00710"></a>00710 }
<a name="l00711"></a>00711 }
<a name="l00712"></a>00712 }
<a name="l00713"></a>00713 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == <a class="code" href="constant_8php.html#a67">ATTR_DEF_COMPANY</a> )
<a name="l00714"></a>00714 {
<a name="l00715"></a>00715 $exist=<a class="code" href="postgres_8php.html#a10">CountSql</a>($this-&gt;cn,<span class="stringliteral">"select f_id from fiche join fiche_def using (fd_id) "</span>.
<a name="l00716"></a>00716 <span class="stringliteral">" join jnt_fic_att_value using (f_id) join attr_value using (jft_id) "</span>.
<a name="l00717"></a>00717 <span class="stringliteral">" where frd_id in (8,9,14) and ad_id="</span>.ATTR_DEF_QUICKCODE.
<a name="l00718"></a>00718 <span class="stringliteral">" and av_text='"</span>.FormatString($<a class="code" href="action_8inc_8php.html#a19">value</a>).<span class="stringliteral">"'"</span>);
<a name="l00719"></a>00719
<a name="l00720"></a>00720
<a name="l00721"></a>00721 <span class="keywordflow">if</span> ( $exist == 0 )
<a name="l00722"></a>00722 {
<a name="l00723"></a>00723 $value=<span class="stringliteral">"Attention : pas de soci<63>t<EFBFBD> "</span>;
<a name="l00724"></a>00724 }
<a name="l00725"></a>00725 }
<a name="l00726"></a>00726
<a name="l00727"></a>00727 <span class="comment">// Normal traitement</span>
<a name="l00728"></a>00728 $value2=<a class="code" href="ac__common_8php.html#a9">FormatString</a>($<a class="code" href="action_8inc_8php.html#a19">value</a>);
<a name="l00729"></a>00729 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=sprintf(<span class="stringliteral">"update attr_value set av_text='%s' where jft_id=%d"</span>,
<a name="l00730"></a>00730 $value2,$jft_id);
<a name="l00731"></a>00731 <a class="code" href="postgres_8php.html#a2">ExecSql</a>($this-&gt;cn,$sql);
<a name="l00732"></a>00732 }
<a name="l00733"></a>00733 <span class="keywordflow">return</span>;
<a name="l00734"></a>00734
<a name="l00735"></a>00735 }
</pre></div>
<p>
</td>
</tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="o3"></a><!-- doxytag: member="fiche::$attribut" ref="o3" 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">fiche::$attribut </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
array of attribut object
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00152">152</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>. </td>
</tr>
</table>
<a class="anchor" name="o0"></a><!-- doxytag: member="fiche::$cn" ref="o0" 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">fiche::$cn </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
database connection
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00149">149</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>. </td>
</tr>
</table>
<a class="anchor" name="o2"></a><!-- doxytag: member="fiche::$fiche_def" ref="o2" 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">fiche::$<a class="el" href="classfiche__def.html">fiche_def</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
fd_id
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00151">151</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>. </td>
</tr>
</table>
<a class="anchor" name="o4"></a><!-- doxytag: member="fiche::$fiche_def_ref" ref="o4" 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">fiche::$<a class="el" href="classfiche__def__ref.html">fiche_def_ref</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Type of the card here always FICHE_TYPE_CONTACT
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00153">153</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>. </td>
</tr>
</table>
<a class="anchor" name="o1"></a><!-- doxytag: member="fiche::$id" ref="o1" 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">fiche::$<a class="el" href="impress__fiche_8php.html#a6">id</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
<a class="el" href="facture_8inc_8php.html#a26">fiche.f_id</a>
<p>
Definition at line <a class="el" href="class__fiche_8php-source.html#l00150">150</a> of file <a class="el" href="class__fiche_8php-source.html">class_fiche.php</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="class__fiche_8php-source.html">class_fiche.php</a></ul>
</BODY>
</HTML>