<?php

namespace amaze;

class form
{
    /**
    *  添加文本框
    * @param $name
    * @param $postname
    * @param $other
    * @param $ads
    * @return void
     */
    public function text($name,$postname,$other=null,$ads=null,$type='text'){
        print_r('<div class="am-g am-margin-top">
            <div class="am-u-sm-4 am-u-md-2 am-text-right">
              '.$name.'
            </div>
            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
              <input type="'.$type.'" name="'.$postname.'" class="am-input-sm" '.$other.'>
            </div>
            <div class="am-hide-sm-only am-u-md-6">'.$ads.'</div>
          </div>');
    }

    /**
 * 添加文本域
* @param $name
* @param $postname
* @param $other
* @param $ads
* @return void
 */
    public function textarea($name,$postname,$other=null,$ads=null){
        print_r('<div class="am-g am-margin-top-sm">
                            <div class="am-u-sm-12 am-u-md-2 am-text-right admin-form-text">
                                '.$name.'
                            </div>
                            <div class="am-u-sm-12 am-u-md-10">
                                <textarea rows="10" name="'.$postname.'" placeholder="'.$ads.'"  '.$other.'></textarea>
                            </div>
                        </div>');
    }

    /**
 * 选择题开始结束标识
* @param string $name  （name==end界定结束）
* @return void
 */
    public function opition($name){
        if ($name=='end'){
            ?>
            </div></div></div>
            <?php
        }else{
        ?>
        <div class="am-g am-margin-top">
            <div class="am-u-sm-4 am-u-md-2 am-text-right"><?=$name?></div>
            <div class="am-u-sm-8 am-u-md-10">
                <div class="am-btn-group" data-am-button>
        <?php
        }
    }

    public function opition_body($postname,$value,$valuename){
        ?>
        <label class="am-btn am-btn-default am-btn-xs">
            <input type="radio" name="<?=$postname?>" value="<?=$value?>" id="option1"> <?=$valuename?>
        </label>
        <?php
    }
}