كلاس انشاء نموذج html جاهزة بواسطة php
1
/**************************************************** | Created : 05/10/2007 | 21:01:23 GMT | Update : 18/04/2008 | 12:47:00 GMT | Category : (PHP Files) WEB Langauges | Title : My php Langauge (Class Files) | Subject : Forms & All Accessories Tool | Groups : Classes | Author : OJOpc (2007) E-mail:
هذا البريد الالكتروني محمى من المتطفلين , يجب عليك تفعيل الجافا سكر يبت لرؤيته
| Company : (C) tinyhost ****************************************************/ class c_form { var $nameform = 'form'; var $method = 'post'; var $etype; var $extra; var $codes; var $rollover; var $setclass = "style='padding: 4px;'"; var $legclass = "style='color: blue';"; function c_form() { $nameform = ''; } /* function print_c() { echo $this->codes; }*/ function closeform() { echo ""; } # ========= write form Tag function form($action, $css = '', $onsubmit = '', $targt = "target='_self'") { echo "nameform' method='$this->method' $targt"; echo "$this->extra style='margin:0;'"; if($action != '') echo " action=\"$action\""; if($css != '') echo " class='$css'"; if($this->etype != '') echo " enctype='$this->etype'"; if($onsubmit != '') echo " onsubmit='$onsubmit'"; echo ">"; }
# ========= type text function pliantext($n, $size = 44, $value = '', $putid = '', $event = '') { echo "; if($value != '') echo " value='$value'"; if($putid != '') echo " class='$css'"; if($event != '') echo " $event"; echo " /> "; } function textReadonly($n, $size = 44, $value = '', $putid) { echo "; if($value != '') echo " value='$value'"; if($putid != '') echo " id='$putid'"; echo " />"; }
function hidden($n, $value, $putid = '') { echo ""; } # ========= type Buttons function submit($n, $value, $event = '') { echo " ; if($event != '') echo " $event"; echo " /> "; }
function clear($n, $value, $extra = '') { echo " ; echo " $extra/> "; } function other($type = 'button', $n, $value, $event = '') { echo "; if($event != '') echo " $event"; echo " />"; }
# ========= (type=multiple) function singlecheckbox($n, $label, $val, $act = 0, $onclick = '') { echo "; if($act == 1) $act = " checked='' "; else $act = ''; if($onclick != '') echo " onclick='$onclick' ";
echo "$act/>$label "; } function multicheckbox($n, $length, $labelz, $valbox, $act) { for($z = 0; $z < $length; $z++) { echo "; if($act[$z] == 1) $act[$z] = " checked='' "; else $act[$z] = ''; echo "$actbox[$z]/>$labelz[$z] "; } } function singleradio($n, $label, $val, $act = 0, $isbr = 0) { echo "; if($act == 1) $act = " checked='' "; else $act = ' '; echo "$act/>$label "; if($isbr == 1) echo ""; }
function select($n, $firstoption = '', $length, $vals, $labelz, $active = '', $size = '', $onchange = '') { echo " ; if($size != '') echo " size='$size'"; if($onchange != '') echo " onchange=\"$onchange\""; echo ">"; if($firstoption != '') echo "$firstoption "; for($i = 0; $i < $length; $i++) { echo ";
if($active == $vals[$i]) echo " selected=''";
echo ">$labelz[$i] "; } echo " "; }
# ========= Textareas function plaintextarea($n, $col, $row, $value = '', $putid = '', $ro = 0, $_br = 1) { echo "; if($putid != '') echo " id='$putid'"; if($ro == 1) $ro = " readonly=''"; else $ro = ''; echo "$ro>$value"; if($_br == 1) echo ""; }
# ========= Filearea function filebrowse($n, $size = 50, $dirct, $event = '') { echo "; if($dirct != '') echo " dir='$dirct'"; if($event != '') echo " $event"; echo "/>"; }
function multifilebrowse($n, $files, $size = 50, $dirct = 'ltr', $event = '') { $maxcolum = 0; for($i = 1; $i <= $files; $i++) { $filebrowse = "; if($dirct != '') $filebrowse .= " dir='$dirct'"; if($event != '') $filebrowse .= " $event"; $filebrowse .= "/> "; // print the input echo $filebrowse; if($maxcolum < 1) $maxcolum++; else { echo ""; $maxcolum = 0; } } }
} //E class ?>
|