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

340 lines
18 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_new.php File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.4 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<div class="nav">
<a class="el" href="dir_000001.html">html</a></div>
<h1>fiche_new.php File Reference</h1>Create a new card in a popup window. <a href="#_details">More...</a>
<p>
<p>
<a href="fiche__new_8php-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fiche__new_8php.html#a8">new_fiche</a> ($p_cn, $p_type)</td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fiche__new_8php.html#a0">$rep</a> = DbConnect()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fiche__new_8php.html#a1">$User</a> = new <a class="el" href="classcl__user.html">cl_user</a>($rep)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fiche__new_8php.html#a2">return</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fiche__new_8php.html#a3">$Res</a> = ExecSql($cn,$sql)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fiche__new_8php.html#a4">$Max</a> = pg_NumRows($Res)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fiche__new_8php.html#a5">$n</a> = pg_NumRows($Res)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fiche__new_8php.html#a6">$e</a> [$i] = $f['fd_id']</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fiche__new_8php.html#a7">$list</a> ['<a class="el" href="classfiche.html">fiche</a>'] = join(',',$e)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Create a new card in a popup window.
<p>
<p>
Definition in file <a class="el" href="fiche__new_8php-source.html">fiche_new.php</a>.<hr><h2>Function Documentation</h2>
<a class="anchor" name="a8"></a><!-- doxytag: member="fiche_new.php::new_fiche" ref="a8" args="($p_cn, $p_type)" --><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">new_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_type</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="fiche__new_8php-source.html#l00060">60</a> of file <a class="el" href="fiche__new_8php-source.html">fiche_new.php</a>.
<p>
References <a class="el" href="jrn__detail_8php-source.html#l00124">$l_line</a>, <a class="el" href="setup_8php-source.html#l00397">$Max</a>, <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="action_8inc_8php-source.html#l00240">name</a>, and <a class="el" href="action_8inc_8php-source.html#l00241">value</a>.<div class="fragment"><pre class="fragment"><a name="l00060"></a>00060 {
<a name="l00061"></a>00061 $ch_col=<span class="stringliteral">"&lt;/TD&gt;&lt;TD&gt;"</span>;
<a name="l00062"></a>00062 $ch_li='&lt;/TR&gt;&lt;TR&gt;';
<a name="l00063"></a>00063 <a class="code" href="bank_8inc_8php.html#a29">$r</a>='&lt;<a class="code" href="constant_8php.html#a7">FORM</a> <a class="code" href="classaction.html">action</a>=<span class="stringliteral">"fiche_new.php"</span> method=<span class="stringliteral">"post"</span>&gt;';
<a name="l00064"></a>00064 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.='&lt;INPUT TYPE=<span class="stringliteral">"HIDDEN"</span> <a class="code" href="action_8inc_8php.html#a18">name</a>=<span class="stringliteral">"fiche"</span> <a class="code" href="action_8inc_8php.html#a19">value</a>=<span class="stringliteral">"'.$p_type.'"</span>&gt;';
<a name="l00065"></a>00065 $l_sessid=(isset ($_POST[<span class="stringliteral">"PHPSESSID"</span>]))?$_POST[<span class="stringliteral">"PHPSESSID"</span>]:$_GET[<span class="stringliteral">"PHPSESSID"</span>];
<a name="l00066"></a>00066
<a name="l00067"></a>00067 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.=<a class="code" href="constant_8php.html#a80">JS_SHOW_TVA</a>;
<a name="l00068"></a>00068 <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="l00069"></a>00069 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.=<span class="stringliteral">"&lt;TABLE&gt;"</span>;
<a name="l00070"></a>00070 echo '&lt;H2 <span class="keyword">class</span>=<span class="stringliteral">"info"</span>&gt;New &lt;/H2&gt;';
<a name="l00071"></a>00071 $p_f_id=<span class="stringliteral">""</span>;
<a name="l00072"></a>00072 <a class="code" href="debug_8php.html#a0">echo_debug</a>('fiche_new.php',__LINE__,<span class="stringliteral">"Array is null"</span>);
<a name="l00073"></a>00073 <span class="comment">// Find all the attribute of the existing cards</span>
<a name="l00074"></a>00074 <span class="comment">// --&gt; Get_attr_def </span>
<a name="l00075"></a>00075 <a class="code" href="bank_8inc_8php.html#a20">$sql</a>=<span class="stringliteral">"select frd_id,ad_id,ad_text from fiche_def join jnt_fic_attr using (fd_id)</span>
<a name="l00076"></a>00076 <span class="stringliteral"> join attr_def using (ad_id) where fd_id="</span>.$p_type.<span class="stringliteral">" order by ad_id"</span>;
<a name="l00077"></a>00077
<a name="l00078"></a>00078 <a class="code" href="depense_8inc_8php.html#a4">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($p_cn,$sql);
<a name="l00079"></a>00079 <a class="code" href="setup_8php.html#a11">$Max</a>=pg_NumRows($Res);
<a name="l00080"></a>00080 <span class="comment">// Put the card modele id (fiche_def.fd_id)</span>
<a name="l00081"></a>00081 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.='&lt;INPUT TYPE=<span class="stringliteral">"HIDDEN"</span> <a class="code" href="action_8inc_8php.html#a18">name</a>=<span class="stringliteral">"fd_id"</span> <a class="code" href="action_8inc_8php.html#a19">value</a>=<span class="stringliteral">"'.$p_type.'"</span>&gt;';
<a name="l00082"></a>00082 <span class="keywordflow">for</span> ($i=0;$i &lt; $Max;$i++) {
<a name="l00083"></a>00083 <a class="code" href="jrn__detail_8php.html#a11">$l_line</a>=pg_fetch_array($Res,$i);
<a name="l00084"></a>00084
<a name="l00085"></a>00085 <span class="comment">// The number of the attribute</span>
<a name="l00086"></a>00086 $Hid=sprintf('&lt;INPUT TYPE=<span class="stringliteral">"HIDDEN"</span> <a class="code" href="action_8inc_8php.html#a18">name</a>=<span class="stringliteral">"ad_id%d"</span> <a class="code" href="action_8inc_8php.html#a19">value</a>=<span class="stringliteral">"%s"</span>&gt;',
<a name="l00087"></a>00087 $i,$l_line['ad_id']);
<a name="l00088"></a>00088
<a name="l00089"></a>00089 $but_search_poste=<span class="stringliteral">""</span>;
<a name="l00090"></a>00090 <span class="comment">// Javascript for searching the account</span>
<a name="l00091"></a>00091 <span class="keywordflow">if</span> ( $l_line ['ad_id'] == <a class="code" href="constant_8php.html#a55">ATTR_DEF_ACCOUNT</a> ) {
<a name="l00092"></a>00092 $but_search_poste='&lt;INPUT TYPE=<span class="stringliteral">"BUTTON"</span> VALUE=<span class="stringliteral">"Cherche"</span> OnClick=<span class="stringliteral">"SearchPoste(\''.$l_sessid.'\',\'av_text'.$i.'\')"</span>&gt;';
<a name="l00093"></a>00093 }
<a name="l00094"></a>00094 <span class="comment">// Javascript for showing the tva</span>
<a name="l00095"></a>00095 <span class="keywordflow">if</span> ( $l_line ['ad_id'] == <a class="code" href="constant_8php.html#a59">ATTR_DEF_TVA</a> ) {
<a name="l00096"></a>00096 $but_search_poste='&lt;INPUT TYPE=<span class="stringliteral">"BUTTON"</span> VALUE=<span class="stringliteral">"Montre"</span> OnClick=<span class="stringliteral">"ShowTva(\''.$l_sessid.'\',\'av_text'.$i.'\')"</span>&gt;';
<a name="l00097"></a>00097 }
<a name="l00098"></a>00098 <span class="comment">// content of the attribute</span>
<a name="l00099"></a>00099 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.= sprintf('&lt;TR&gt;&lt;TD&gt; %s &lt;/TD&gt;&lt;TD&gt;&lt;INPUT TYPE=<span class="stringliteral">"TEXT"</span> NAME=<span class="stringliteral">"av_text%d"</span>&gt;%s %s&lt;/TD&gt;&lt;/TR&gt;',
<a name="l00100"></a>00100 $l_line['ad_text'], $i,$Hid,$but_search_poste);
<a name="l00101"></a>00101 }
<a name="l00102"></a>00102 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.=<span class="stringliteral">"&lt;/TABLE&gt;"</span>;
<a name="l00103"></a>00103 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.='&lt;INPUT TYPE=<span class="stringliteral">"SUBMIT"</span> <a class="code" href="action_8inc_8php.html#a18">name</a>=<span class="stringliteral">"add_fiche"</span> <a class="code" href="action_8inc_8php.html#a19">value</a>=<span class="stringliteral">"Mis <20> jour"</span>&gt;';
<a name="l00104"></a>00104 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.= '&lt;INPUT TYPE=<span class="stringliteral">"HIDDEN"</span> <a class="code" href="action_8inc_8php.html#a18">name</a>=<span class="stringliteral">"inc"</span> <a class="code" href="action_8inc_8php.html#a19">value</a>=<span class="stringliteral">"'.$Max.'"</span>&gt;';
<a name="l00105"></a>00105 <a class="code" href="bank_8inc_8php.html#a29">$r</a>.='&lt;/<a class="code" href="constant_8php.html#a7">FORM</a>&gt;';
<a name="l00106"></a>00106 <span class="keywordflow">return</span> <a class="code" href="bank_8inc_8php.html#a29">$r</a>;
<a name="l00107"></a>00107 }
</pre></div>
<p>
</td>
</tr>
</table>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="a6"></a><!-- doxytag: member="fiche_new.php::$e" ref="a6" args="[$i]" --><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">$e[$i] = $f['fd_id'] </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="fiche__new_8php-source.html#l00134">134</a> of file <a class="el" href="fiche__new_8php-source.html">fiche_new.php</a>. </td>
</tr>
</table>
<a class="anchor" name="a7"></a><!-- doxytag: member="fiche_new.php::$list" ref="a7" args="['fiche']" --><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">$list['<a class="el" href="classfiche.html">fiche</a>'] = join(',',$e) </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="fiche__new_8php-source.html#l00136">136</a> of file <a class="el" href="fiche__new_8php-source.html">fiche_new.php</a>.
<p>
Referenced by <a class="el" href="user__form__ach_8php-source.html#l00044">FormAchInput()</a>, <a class="el" href="user__form__ven_8php-source.html#l00043">FormVenInput()</a>, <a class="el" href="fiche__inc_8php-source.html#l01057">GetFicheJrn()</a>, <a class="el" href="fiche__inc_8php-source.html#l01514">IsFicheOfJrn()</a>, and <a class="el" href="class_8pdf_8php-source.html#l01417">Cpdf::selectFont()</a>. </td>
</tr>
</table>
<a class="anchor" name="a4"></a><!-- doxytag: member="fiche_new.php::$Max" ref="a4" 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">$Max = pg_NumRows($Res) </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="fiche__new_8php-source.html#l00126">126</a> of file <a class="el" href="fiche__new_8php-source.html">fiche_new.php</a>. </td>
</tr>
</table>
<a class="anchor" name="a5"></a><!-- doxytag: member="fiche_new.php::$n" ref="a5" 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">$n = pg_NumRows($Res) </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="fiche__new_8php-source.html#l00131">131</a> of file <a class="el" href="fiche__new_8php-source.html">fiche_new.php</a>.
<p>
Referenced by <a class="el" href="form__inc_8php-source.html#l00267">AddForm()</a>, <a class="el" href="class_8ezpdf_8php-source.html#l00497">Cezpdf::ezPrvtTableDrawLines()</a>, and <a class="el" href="user__common_8php-source.html#l00758">GetConcerned()</a>. </td>
</tr>
</table>
<a class="anchor" name="a0"></a><!-- doxytag: member="fiche_new.php::$rep" ref="a0" 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">$rep = DbConnect() </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="fiche__new_8php-source.html#l00029">29</a> of file <a class="el" href="fiche__new_8php-source.html">fiche_new.php</a>. </td>
</tr>
</table>
<a class="anchor" name="a3"></a><!-- doxytag: member="fiche_new.php::$Res" 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">$Res = ExecSql($cn,$sql) </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="fiche__new_8php-source.html#l00124">124</a> of file <a class="el" href="fiche__new_8php-source.html">fiche_new.php</a>. </td>
</tr>
</table>
<a class="anchor" name="a1"></a><!-- doxytag: member="fiche_new.php::$User" ref="a1" 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">$User = new <a class="el" href="classcl__user.html">cl_user</a>($rep) </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="fiche__new_8php-source.html#l00031">31</a> of file <a class="el" href="fiche__new_8php-source.html">fiche_new.php</a>. </td>
</tr>
</table>
<a class="anchor" name="a2"></a><!-- doxytag: member="fiche_new.php::return" 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"><a class="el" href="priv__user_8php.html#a2">return</a> </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="fiche__new_8php-source.html#l00116">116</a> of file <a class="el" href="fiche__new_8php-source.html">fiche_new.php</a>. </td>
</tr>
</table>
</BODY>
</HTML>