Server IP : 103.119.228.120 / Your IP : 3.145.115.139 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/hendraso/public_html/Library/ |
Upload File : |
<?php class GenerateForm extends Controller { protected static $header = false; public static function load () { return new GenerateForm; } function buildForm($arrForm, $header = false) { self::$header = $header; $form = ""; foreach ($arrForm as $key => $val) { $type = (isset($val['type'])) ? $val['type'] : ""; $name = (isset($val['name'])) ? $val['name'] : ""; $field = (isset($val['field'])) ? $val['field'] : ""; $require = (isset($val['validation'])) ? $val['validation'] : ""; $class = (isset($val['class'])) ? $val['class'] : ""; $display = (isset($val['display'])) ? $val['display'] : ""; $disable = (isset($val['disable'])) ? $val['disable'] : ""; $event = (isset($val['event'])) ? $val['event'] : ""; $prefix = (isset($val['prefix'])) ? $val['prefix'] : ""; $suffix = (isset($val['suffix'])) ? $val['suffix'] : ""; $desc = (isset($val['desc'])) ? $val['desc'] : " - "; $arrData = (isset($val['data']) && !empty($val['data'])) ? $val['data'] : ""; switch ($type) { /* for input type hidden */ case "hidden" : $form .= $this->hidden($field); break; /* for input type */ case "input" : $form .= $this->input($name, $field, $require, $class, $display, $disable, $event, $desc, $prefix, $suffix); break; /* for combo select */ case "combo" : $form .= $this->combo($arrData, $name, $field, $require, $display, $disable, $event, $desc); break; /* for checkbox */ case "cbox" : $form .= $this->cbox($arrData, $name, $field, $require, $display, $disable, $event, $desc); break; /* for radio button */ case "rbutton" : $form .= $this->rbutton($arrData, $name, $field, $require, $display, $disable, $event, $desc); break; /* for multiple combo */ case "mcombo" : $form .= $this->mcombo($arrData, $name, $field, $require, $display, $disable, $event, $desc); break; /* for datepicker */ case "dpicker" : $form .= $this->dpicker($name, $field, $require, $display, $disable, $event, $desc); break; /* for datepicker */ case "dpickertime" : $form .= $this->dpickertime($name, $field, $require, $display, $disable, $event, $desc); break; /* for timepicker */ case "tpicker" : $form .= $this->tpicker($name, $field, $require, $display, $disable, $event, $desc); break; /* for uploadfile */ case "ufile" : $form .= $this->ufile($name, $field, $require, $display, $disable, $event, $desc); break; /* for uploadimage */ case "uimg" : $form .= $this->uimg($name, $field, $require, $display, $disable, $event, $desc); break; /* for textarea */ case "txtarea" : $form .= $this->txtarea($name, $field, $require, $display, $disable, $event, $desc); break; /* for tinymce */ case "tiny" : $form .= $this->tiny($name, $field, $require, $display, $disable, $event, $desc); break; } } return $form; } function hidden($field) { $form = '<input type="hidden" name="'.$field.'" id="'.$field.'">'; /* $menu = Generaldb::instance() ->table('menu') ->column(array('menuId'=>'', 'menuName'=>'')) ->executeArr();*/ return $form; } function input($name, $field, $require = false, $classAmount = "", $event = false, $display = false, $disable = false, $desc = false, $prefix = false, $suffix = false) { $class = (self::$header) ? 'span4' : ''; $indicator = ""; $msg = ""; $f_prefix = ""; $f_suffix = ""; if(!empty($require)) { $indicator = '<i class="font-weight-bold text-danger">*</i>'; $msg = "'.$name.' is required"; } if(!empty($prefix)) { $f_prefix = '<div class="input-group-prepend"> <span class="input-group-text" id="inputGroup-sizing-default">'.$prefix.'</span> </div>'; } if(!empty($suffix)) { $f_suffix = '<div class="input-group-append"> <span class="input-group-text" id="inputGroup-sizing-default">'.$suffix.'</span> </div>'; } $form = '<div class="form-group listForm row' . $class . '"> <label class="formLabel control-label col-lg-2 col-md-2">' . $name . ' ' . $indicator . '</label> <div class="input-group col-lg-6 col-md-6"> '.$f_prefix.' <input type="text" name="'.$field.'" id="'.$field.'" class="inputBox form-control ' . $classAmount . '" ' . $require . '> '.$f_suffix.' </div> <div class="invalid-feedback">'.$msg.'</div> </div>'; /*$form = '<div class="form-group listForm col-lg-4 col-md-4' . $class . '"> <label class="formLabel control-label">' . $name . ' ' . $indicator . '</label> <input type="text" name="'.$field.'" id="'.$field.'" class="inputBox form-control ' . $classAmount . '" ' . $require . '> <div class="invalid-feedback">'.$msg.'</div> </div>';*/ return $form; } public function replaceSpace($value) { $value= trim($value); while( strpos($value, ' ') ){ $value = str_replace(' ' , '', $value); } return $value; } function combo($arrData, $name, $field, $require = false, $event = false, $display = false, $disable = false, $desc = false) { $class = (self::$header) ? 'span4' : ''; $indicator = ""; if(!empty($require)) { $indicator = '<i class="font-weight-bold text-danger">*</i>'; //$require = 'data-bvalidator="required"'; } if(is_array($arrData)) { $arrCombo = $arrData; }else{ $arrCombo = $this->generateArrData($arrData); } $formCombo = GeneralFunction::build()->generateCombo($arrCombo, $field, true, false, false, true); $form = '<div class="form-group listForm row' . $class . '"> <label class="formLabel control-label col-lg-2 col-md-2">' . $name . ' ' . $indicator . '</label> <div class="col-lg-6 col-md-6">'.$formCombo.'</div> </div>'; return $form; } function cbox($arrData, $name, $field, $require = false, $minselect = false, $event = false, $display = false, $disable = false, $desc = false) { $class = (self::$header) ? 'span4' : ''; $indicator = ""; $min = ""; $msg = ""; if($minselect) { $min = 'min[2],'; } if(!empty($require)) { $indicator = '<span class="requiredIndicator">*</span>'; //$require = 'data-bvalidator="' . $min . ' required"'; $msg = 'data-bvalidator-msg="Select at least two checkboxes"'; } if(is_array($arrData)) { $arrData = $arrData; }else{ $arrData = $this->generateArrData($arrData); } /* $form = '<div class="form-group listForm ' . $class . ' ' . $require . '"> <label for="recipient-name" class="formLabel control-label">' . $name . ' ' . $indicator . '</label>'; foreach ($arrData as $ckValue => $ckName) { $form .= '<label class="radioLabel"> <input name="' . $field . '[]" value="' . $ckValue . '" type="checkbox" class="radioButton form-control"> <span>' . $ckName . '</span> <div class="clearfix"></div> </label>'; } $form .='</div>';*/ $form = '<div class="form-group listForm row' . $class . ' ' . $require . ' "> <label class="formLabel control-label col-lg-2 col-md-2">' . $name . ' ' . $indicator . ' </label><div class="col-lg-6 col-md-6">'; foreach ($arrData as $ckValue => $ckName) { $form .= ' <label> <input type="checkbox" name="' . $field . '[]" value="'.$ckValue.'" id="'.$field.$ckValue.'" class="options getData mr-2"/> '.$ckName.' </label>'; } $form .='</div></div>'; return $form; } function rbutton($arrData, $name, $field, $require = false, $event = false, $display = false, $disable = false, $desc = false) { $class = (self::$header) ? 'span4' : ''; $indicator = ""; $min = ""; $msg = ""; if(!empty($require)) { $indicator = '<span class="requiredIndicator">*</span>'; //$require = 'data-bvalidator="required"'; $msg = 'data-bvalidator-msg="Select at least two checkboxes"'; } if(is_array($arrData)) { $arrData = $arrData; }else{ $arrData = $this->generateArrData($arrData); } $form = '<div class="form-group listForm row ' . $class . ' ' . $require . ' "> <label class="formLabel control-label col-lg-2 col-md-2">' . $name . ' ' . $indicator . ' </label><div class="col-lg-6 col-md-6">'; foreach ($arrData as $ckValue => $ckName) { $form .= '<label> <input type="radio" name="' . $field . '" value="'.$ckValue.'" id="'.$field.$ckValue.'" class="options getData mr-2"/> '.$ckName.' </label>'; } $form .='</div></div>'; return $form; } function mcombo($arrData, $name, $field, $require = false, $event = false, $display = false, $disable = false, $desc = false) { $class = (self::$header) ? 'span4' : ''; $indicator = ""; if(!empty($require)) { $indicator = '<span class="requiredIndicator">*</span>'; ///$require = 'data-bvalidator="required"'; } if(is_array($arrData)) { $arrCombo = $arrData; }else{ $arrCombo = $this->generateArrData($arrData); } $field = str_replace("[]", "", $field) . "[]"; $formCombo = GeneralFunction::build()->generateCombo($arrCombo, $field, false, false, true); $form = '<div class="form-group listForm row ' . $class . ' ' . $require . '"> <label class="formLabel control-label col-lg-2 col-md-2">' . $name . ' ' . $indicator . '</label> <div class="col-lg-6 col-md-6">'.$formCombo.'</div> </div>'; return $form; } function dpicker($name, $field, $require = false, $event = false, $display = false, $disable = false, $desc = false) { $class = (self::$header) ? 'span4' : ''; $indicator = ""; if(!empty($require)) { $indicator = '<span class="requiredIndicator">*</span>'; $require = 'data-bvalidator="required,date[dd-mm-yyyy]"'; } $form = '<div class="form-group listForm row icoDpicker ' . $class . '"> <label class="formLabel control-label col-lg-2 col-md-2">' . $name . ' ' . $indicator . '</label> <div class="col-lg-6 col-md-6"><input type="text" name="'.$field.'" id="'.$field.'" class="inputBox small datePickerSingle form-control" ' . $require . ' ></div> </div>'; return $form; } function dpickertime($name, $field, $require = false, $event = false, $display = false, $disable = false, $desc = false) { $class = (self::$header) ? 'span4' : ''; $indicator = ""; if(!empty($require)) { $indicator = '<span class="requiredIndicator">*</span>'; $require = 'data-bvalidator="required,date[dd-mm-yyyy]"'; } $form = '<div class="form-group listForm row icoDPiker ' . $class . '"> <label class="formLabel control-label col-lg-2 col-md-2">' . $name . ' ' . $indicator . '</label> <div class="col-lg-6 col-md-6"><input type="text" name="'.$field.'" id="'.$field.'" class="inputBox small datePickerTime form-control" ' . $require . ' ></div> </div>'; return $form; } function tpicker($name, $field, $require = false, $event = false, $display = false, $disable = false) { $class = (self::$header) ? 'span4' : ''; $indicator = ""; if(!empty($require)) { $indicator = '<span class="requiredIndicator">*</span>'; $require = 'data-bvalidator="required"'; } $form = '<div class="form-group listForm row icoTPiker ' . $class . '"> <label class="formLabel control-label col-lg-2 col-md-2">' . $name . ' ' . $indicator . '</label> <div class="col-lg-6 col-md-6"><input type="text" name="' . $field . '" class="inputBox small timePicker form-control" id="' . $field . '" ' . $require . ' /></div> </div>'; return $form; } function ufile($name, $field, $require = false, $event = false, $display = false, $disable = false, $desc) { $class = (self::$header) ? 'span4' : ''; $indicator = ""; if(!empty($require)) { $indicator = '<span class="requiredIndicator">*</span>'; //$require = 'data-bvalidator="required"'; } $form = '<div class="form-group listForm row ' . $class . ' ' . $require . '"> <label class="formLabel control-label col-lg-2 col-md-2">' . $name . ' ' . $indicator . '</label> <div class="fileupload col-lg-6 col-md-6"> <div class="custom-file"> <input type="file" name="' . $field . '" id="inputFile'.$field.'" class="inputFile inputBox form-control"> <label class="custom-file-label" for="inputFile'.$field.'">Choose file</label> </div> <div id="filePreview'.$field.'"></div> </div> </div>'; return $form; } function uimg($name, $field, $require = false, $msg = false, $event = false, $display = false, $disable = false, $desc = false) { $indicator = ""; $msg = ""; $class = (self::$header) ? 'span4' : ''; if(!empty($require)) { $indicator = '<span class="requiredIndicator">*</span>'; //$require = 'data-bvalidator="required,extension[jpg:png:jpeg]"'; $msg = 'data-bvalidator-msg="File extension must be .jpg or .png"'; } $form = '<div class="form-group listForm row ' . $class . ' ' . $require . '"> <label class="formLabel control-label col-lg-2 col-md-2">' . $name . ' ' . $indicator . '</label> <div class="fileupload col-lg-6 col-md-6"> <div class="custom-file"> <input type="file" name="' . $field . '" id="inputImage'.$field.'" class="inputImage form-control" accept="image/*" ' . $msg . '> <label class="custom-file-label" for="inputImage'.$field.'">Choose file</label> </div> <div id="imagePreview'.$field.'" class="imgContBig"></div> </div> </div>'; return $form; } function txtarea($name, $field, $require = false, $event = false, $display = false, $disable = false, $desc = '-') { $class = (self::$header) ? 'span4' : ''; $indicator = ""; $msg = ""; if(!empty($require)) { $indicator = '<span class="requiredIndicator">*</span>'; //$require = 'data-bvalidator="required"'; $msg = 'data-bvalidator-msg="'.$name.' is required"'; } $form = '<div class="form-group listForm row ' . $class . ' ' . $require . '"> <label class="formLabel control-label col-lg-2 col-md-2">' . $name . ' ' . $indicator . '</label> <div class="col-lg-6 col-md-6"><textarea rows="5" class="textArea form-control" name="'.$field.'" id="'.$field.'" '.$msg.'></textarea></div> </div>'; return $form; } function tiny($name, $field, $require = false, $event = false, $display = false, $disable = false, $desc = false) { $class = (self::$header) ? 'span4' : ''; $indicator = ""; $msg = ""; if(!empty($require)) { $indicator = '<span class="requiredIndicator">*</span>'; //$require = 'data-bvalidator="required"'; $msg = 'data-bvalidator-msg="'.$name.' is required"'; } $form = '<div class="form-group listForm row ' . $class . ' ' . $require . '"> <label class="formLabel control-label col-lg-2 col-lg-2">' . $name . ' ' . $indicator . '</label> <div class="col-lg-10 col-lg-10"><textarea rows="10" class="textArea customTextArea" name="'.$field.'" id="'.$field.'" " '.$msg.'></textarea></div> </div>'; return $form; } function generateArrData ($arrData) { $elm = explode('|', $arrData); if(isset($elm[1])) { $tableName = $elm[0]; $tableFieldId = $elm[1]; $tableFieldName = $elm[2]; $where = isset($elm[3]) ? $elm[3] : ""; $order = isset($elm[4]) ? $elm[4] : ""; $sql = "SELECT ".$tableFieldId.", ".$tableFieldName." FROM ".$tableName." ".$where." ".$order; $data = Database::build()->getSelect($sql); $arrIsiData = array(); foreach($data as $item) { $arrIsiData[$item[$tableFieldId]] = $item[$tableFieldId] . " - " . $item[$tableFieldName]; } return $arrIsiData; } } }