54 $this->Lang=parse_ini_file($LangName);
64 function MakeForm($Add,$KeyValue,$WrongFields,$cmdAbort)
68 $msg=
'<h2 align=center>'.$this->Lang[
'NewRow'].
'</h2>';
70 $msg=
'<h2 align=center>'.$this->Lang[
'ModifyRow'].
'</h2>';
72 <table border=1 cellpadding=0 cellspacing=0 align=center>
77 <form action='.$_SERVER[
'PHP_SELF'].
' method=post >';
79 $msg.=
'<input type=hidden name=ev value=YAP_DOSAVEROW>';
81 $msg.=
'<input type=hidden name=ev value=YAP_DOMODIFY>';
83 $msg.=
'<input type=hidden name=id value=\''.htmlentities($KeyValue,ENT_QUOTES).
'\'>
';
85 $js=''; // javascript code
86 foreach($this->Controls as $Key => $obj)
88 $js.=$obj->GetJsCode();
89 // I don't ask the autoincrement field, and the key field
if i
'm updating the row
90 // and the preset field (hidden field)
91 if((($Key!=$this->modify_info['keyfield
']&&!$Add)||$Add)
92 && !$obj->GetInfo('autoincrement
')
96 $msg.='<tr><td>
'.$Key.'</td><td>
';
97 $msg.=$obj->Draw(false);
98 // Show some text if the current field has a wrong value (i.e from a previous input form)
99 if(array_key_exists($Key,$WrongFields))
100 $msg.=$WrongFields[$Key];
101 $msg.='</td><td>
'.$obj->GetInfo('type
').'</td></tr>
';
103 // Draw the hidden field (it writes <input type hidden....)
105 $msg.=$obj->Draw(false);
108 $msg.='<tr><td> </td><td>
';
109 $msg.=$this->_SubmitButton();
110 $msg.=$this->_AbortButton($cmdAbort);
114 $msg.='<script>
'.$js.'</script>
';
115 $msgbox=new CYapBox($msg);
120 function _SubmitButton()
122 return('<input type=submit value=\
''.$this->Lang[
'Run'].
'\'>
');
125 function _AbortButton($cmdAbort)
127 return('<input type=button value=\
''.$this->Lang[
'Abort'].
'\' onclick=
"'.$cmdAbort.'">
');