).(!empty($tip) ? ' onmouseover="tip(this,\''.$tip.'\')"':'').' />'.(!empty($legend) ? '':''); } function select($name, $options, $width=false, $disabled=false, $OCH_action=false, $id=false, $js_default_value=false) { if(!empty($disabled)) $if_dis=' disabled="disabled"'; if(!empty($OCH_action)) $if_OCH=' onchange="'.$OCH_action.'"'; if(!empty($width)) $if_width=' style="width:'.$width.'px;"'; if(!empty($js_default_value)) $js_default_value=' default_value="'.$js_default_value.'"'; if(empty($id)) $id=$name; return ''; } function multiselect($name, $options, $width=false, $size=0, $disabled=false, $id=false) { if(!empty($disabled)) $if_dis=' disabled="disabled"'; if(!empty($width)) $if_width=' style="width:'.$width.'px;"'; if(empty($id)) $id=$name; if(!is_numeric($size)) $size=5; $count=count(explode(' $count) $size=$count; if($count<1) $size=1; return '
'; } function multiselect2($name, $width, $size, $all_options, $selected_options=false, $selected_values=false, $separator=false, $max_limit=false) { global $CS; $CS->JS_HEAD[]=JS.'/jquery.mselect.js'; if($size>$max_limit && !empty($max_limit)) $size=$max_limit; if(empty($separator)) $separator=','; return '
'.$this->hidden($name.'_limit', $max_limit).' '.$this->hidden($name, @implode($separator,$selected_values)).' '; // '.$max_limit.' } function select_get_options($query, $selected=false) { global $CS; $cols=explode(',', $CS->STRING->textbetween('SELECT','FROM',$query)); $val=trim($cols[0]); $txt=trim($cols[1]); $sql=$CS->DB->query($query); while($dane=$CS->DB->fetch_array($sql)) { $html.=''; } return $html; } function select_dis($name, $value, $root, $table, $title_col) { global $CS; $dane = $CS->DB->single(' SELECT '.$title_col.' FROM '.$table.' WHERE id="'.$value.'" '); if(empty($dane)) $dane=$root; return $CS->FORM->hidden($name, $value).''.$dane.''; } function multiselect_js($name, $options, $width=false, $disabled=false, $OCH_action=false) { if(!empty($disabled)) $if_dis=' disabled="disabled"'; if(!empty($OCH_action)) $if_OCH=' onchange="'.$OCH_action.'"'; if(!empty($width)) $if_width=' style="width:'.$width.'px;"'; global $CS; $CS->JS_HEAD[]=JS.'/jquery.multiselect/multiselect.js'; $CS->CSS_HEAD[]=JS.'/jquery.multiselect/multiselect.css'; return ' '; } // TEXT ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function input_id($name, $id, $width=200, $value=false, $readonly=false, $disabled=false, $maxlen=false, $mask=false, $default_value=false, $center=false) { if(!empty($mask)) { global $CS; $CS->JS_HEAD[]=JS.'/jquery.mask.js'; $autoexec='$("#'.$id.'").mask("'.$mask.'");'; $mask=''; } if(!empty($default_value)) $default_value=' default_value="'.$default_value.'"'; if(!empty($center)) $center=' text-align:center;'; return 'interactive('input').' style="width:'.$width.'px;'.$center.'"'.(!empty($autoexec) ? ' autoexec=\''.$autoexec.'\'':'').($readonly==true ? ' readonly="readonly"':'').($disabled==true ? ' disabled="disabled"':'').($maxlen>0 ? ' maxlength="'.$maxlen.'"':'').$default_value.' />'.$mask; } function input($name, $width=200, $value=false, $readonly=false, $disabled=false, $maxlen=false, $mask=false, $default_value=false) { return $this->input_id($name, $name, $width, $value, $readonly, $disabled, $maxlen, $mask, $default_value); } function input_center($name, $width=200, $value=false, $readonly=false, $disabled=false, $maxlen=false, $mask=false, $default_value=false) { return $this->input_id($name, $name, $width, $value, $readonly, $disabled, $maxlen, $mask, $default_value, true); } function password_id($name, $id, $width=200, $value=false, $readonly=false, $disabled=false, $maxlen=false) { return 'interactive('input').' style="width:'.$width.'px" '.($readonly==true ? ' readonly="readonly"':'').($disabled==true ? ' disabled="disabled"':'').($maxlen>0 ? ' maxlength="'.$maxlen.'"':'').' />'; } function password($name, $width=200, $value=false, $readonly=false, $disabled=false, $maxlen=false) { return $this->password_id($name, $name, $width, $value, $readonly, $disabled, $maxlen); } // TEXTAREA & FORMATED /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function textarea_id($name, $id, $width=200, $height=63, $value=false, $readonly=false, $disabled=false, $maxlength=false, $nonresize=false, $row_tool=false) { if($maxlength>0) $maxlength=' maxlength="'.$maxlength.'" onkeyup="return isMaxLength(this)" onpaste="return isMaxLength(this)"'; if(!empty($row_tool)) $row_tool='
'.$row_tool.'
'; $t=''; if($nonresize==true) return $t; if(ADMIN===true) { return '
'.$t.'
'; } // UTILS /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function link_js($href, $anchor, $img_before=false, $img_after=false) { if(!empty($img_before)) $img_before=''; if(!empty($img_after)) $img_after=''; return $img_before.''.$anchor.''.$img_after; } function link_potwierdzenie($link, $anchor, $tekst=false) { if(empty($tekst)) $tekst='Na pewno?'; return ''.$anchor.''; } function focus($field) { return ''; } function tip($value,$width=false) { if(empty($value)) return false; $value=str_replace(' ','
',$value); $value=str_replace('"','"',$value); return 'onmouseover="tip(this,\''.$value.'\',false,'.($width>0 ? $width : 'false').')"'; } function label($value, $width=false, $center=false) { return ''.$value.''; } function info($tip, $img=false) { global $CS; if(empty($img)) $img=ICONS.'/form/info.gif'; return 'FORM->tip($tip).' />'; } function tr() { $html.=''; for($i=0;$i'; $html.=''; return $html; } function tr_array($cols=false) { $html.=''; foreach($cols as $c) $html.=''.$c.''; $html.=''; return $html; } function tr_sep($p=5) { return '
'; } } $this->FORM = new cs_form(); $this->FORM->_PATH = C_PATH.'/'.cs_form; $this->FORM->PATH = C_PATH.'/'.cs_form; $this->FORM->_DIR = C_DIR.'/'.cs_form; $this->FORM->DIR = C_DIR.'/'.cs_form; ?>