所有FORM改为horizontal式
This commit is contained in:
parent
65cd826be2
commit
52b889ab97
@ -7,7 +7,7 @@
|
|||||||
private $method;
|
private $method;
|
||||||
private $action=null;
|
private $action=null;
|
||||||
|
|
||||||
private $style_class="form-inline";
|
private $style_class="form-horizontal";
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@ -53,6 +53,7 @@
|
|||||||
|
|
||||||
public function start()
|
public function start()
|
||||||
{
|
{
|
||||||
|
echo '<div class="container">';
|
||||||
echo '<form name="'.$this->name.'" method="'.$this->method.'" ';
|
echo '<form name="'.$this->name.'" method="'.$this->method.'" ';
|
||||||
|
|
||||||
if($this->action !=null)echo 'action="' .$this->action .'" ';
|
if($this->action !=null)echo 'action="' .$this->action .'" ';
|
||||||
@ -67,11 +68,13 @@
|
|||||||
{
|
{
|
||||||
echo '<input type="submit" value="'.$submit_name.'" class="btn btn-primary"/>';
|
echo '<input type="submit" value="'.$submit_name.'" class="btn btn-primary"/>';
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
echo '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function end()
|
public function end()
|
||||||
{
|
{
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
echo '</div>';
|
||||||
}
|
}
|
||||||
};//class UIForm
|
};//class UIForm
|
||||||
|
|
||||||
|
@ -1,60 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class UIEditBox
|
function CreateInputGroup()
|
||||||
{
|
{
|
||||||
private $type=null;
|
$type =func_get_arg(0);
|
||||||
private $id=null;
|
$id =func_get_arg(1);
|
||||||
private $size=null;
|
$label =func_get_arg(2);
|
||||||
|
$size =func_get_arg(3);
|
||||||
|
|
||||||
public function __construct($t,$i,$s)
|
echo '<div class="form-group">
|
||||||
{
|
<label class="control-label col-sm-2">'.$label.'</label>
|
||||||
$this->type=$t;
|
<div class="col-sm-10">
|
||||||
$this->id=$i;
|
<input type="'.$type.'" class="form-control" id="'.$type.'" size="'.$size.'">';
|
||||||
$this->size=$s;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function echo()
|
if(func_num_args()==5)
|
||||||
{
|
{
|
||||||
echo '<input type="'.$this->type.'" class="form-control" name="'.$this->id.'" size="'.$this->size.'">';
|
$right_label=func_get_arg(4);
|
||||||
}
|
echo '<label class="control-label">'.$right_label.'</label>';
|
||||||
};//class UIEditBox
|
}
|
||||||
|
|
||||||
class UIInputGroup extends UIEditBox
|
echo '</div></div>';
|
||||||
{
|
|
||||||
private $addon_front=null;
|
|
||||||
private $addon_back=null;
|
|
||||||
|
|
||||||
public function __construct($t,$i,$s)
|
|
||||||
{
|
|
||||||
parent::__construct($t,$i,$s);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function SetAddonFront($text)
|
|
||||||
{
|
|
||||||
$this->addon_front='<span class="input-group-addon">'.$text.'</span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function SetAddonBack($text)
|
|
||||||
{
|
|
||||||
$this->addon_back='<span class="input-group-addon">'.$text.'</span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function echo()
|
|
||||||
{
|
|
||||||
echo '<div class="input-group">';
|
|
||||||
echo $this->addon_front;
|
|
||||||
parent::echo();
|
|
||||||
echo $this->addon_back;
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
};//class UIInputGroup
|
|
||||||
|
|
||||||
function CreateInputGroup($type,$id,$label,$size)
|
|
||||||
{
|
|
||||||
$but=new UIInputGroup($type,$id,$size);
|
|
||||||
$but->SetAddonFront($label);
|
|
||||||
$but->echo();
|
|
||||||
|
|
||||||
return $but;
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -1,44 +1,35 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class UISelect
|
function create_select()//$label,$name,$selected,$items)
|
||||||
{
|
|
||||||
private $name;
|
|
||||||
private $selected;
|
|
||||||
private $items;
|
|
||||||
|
|
||||||
public function __construct($n,$s,$i)
|
|
||||||
{
|
|
||||||
$this->name=$n;
|
|
||||||
$this->selected=$s;
|
|
||||||
$this->items=$i;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function SetSelected($s)
|
|
||||||
{
|
|
||||||
$this->selected=$s;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function out_html()
|
|
||||||
{
|
|
||||||
echo '<select name="'.$this->name.'">';
|
|
||||||
|
|
||||||
foreach($this->items as $value=>$text)
|
|
||||||
{
|
|
||||||
if($this->selected==$value)
|
|
||||||
echo '<option value="'.$value.'" selected="selected">'.$text.'</option>';
|
|
||||||
else
|
|
||||||
echo '<option value="'.$value.'">'.$text.'</option>';
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '</select>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_select($n,$s,$i)
|
|
||||||
{
|
{
|
||||||
$ui=new UISelect($n,$s,$i);
|
$label =func_get_arg(0);
|
||||||
|
$name =func_get_arg(1);
|
||||||
|
$selected =func_get_arg(2);
|
||||||
|
$items =func_get_arg(3);
|
||||||
|
|
||||||
$ui->out_html();
|
echo '<div class="form-group">
|
||||||
return;
|
<label class="control-label col-sm-2">'.$label.'</label>
|
||||||
|
<div class="col-sm-10">';
|
||||||
|
|
||||||
|
echo '<select name="'.$name.'">';
|
||||||
|
|
||||||
|
foreach($items as $value=>$text)
|
||||||
|
{
|
||||||
|
if($selected==$value)
|
||||||
|
echo '<option value="'.$value.'" selected="selected">'.$text.'</option>';
|
||||||
|
else
|
||||||
|
echo '<option value="'.$value.'">'.$text.'</option>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</select>';
|
||||||
|
|
||||||
|
if(func_num_args()==5)
|
||||||
|
{
|
||||||
|
$right_label=func_get_arg(4);
|
||||||
|
echo '<label class="control-label">'.$right_label.'</label>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</div>';
|
||||||
|
echo '</div>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
13
tools.php
13
tools.php
@ -34,29 +34,24 @@
|
|||||||
<title>'.$title.'</title>
|
<title>'.$title.'</title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0, width=device-width" />
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0, width=device-width" />';
|
||||||
';
|
|
||||||
|
|
||||||
include_jquery();
|
include_jquery();
|
||||||
include_font_awesome();
|
include_font_awesome();
|
||||||
include_bootstrap();
|
include_bootstrap();
|
||||||
//include_jsgird();
|
//include_jsgird();
|
||||||
|
|
||||||
echo '
|
echo '</head><body>';
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function echo_page_header($header,$subtext)
|
function echo_page_header($header,$subtext)
|
||||||
{
|
{
|
||||||
echo '<div class="page-header" style="margin-bottom: 0px; padding-bottom: 0px; margin-top: 0px;"><h1>'.$header.'<small> '.$subtext.'</small></h1></div>';
|
echo '<div class="page-header" style="margin-bottom: 10px; padding-bottom: 0px; margin-top: 0px;"><h1>'.$header.'<small> '.$subtext.'</small></h1></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function echo_html_end()
|
function echo_html_end()
|
||||||
{
|
{
|
||||||
echo '
|
echo '</body></html>';
|
||||||
</body></html>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function echo_div($id)
|
function echo_div($id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user