<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-image" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
        <a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
      <h1><?php echo $heading_title; ?></h1>
      <ul class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
        <?php } ?>
      </ul>
    </div>
  </div>
  <div class="container-fluid">
    <?php if ($error_warning) { ?>
    <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_edit; ?></h3>
      </div>
      <div class="panel-body">
        <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-image" class="form-horizontal">
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-status"><?php echo $entry_status; ?></label>
            <div class="col-sm-10">
              <select name="status" id="input-status" class="form-control">
                <?php if ($status) { ?>
                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                <option value="0"><?php echo $text_disabled; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_enabled; ?></option>
                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                <?php } ?>
              </select>
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-name"><?php echo $entry_name; ?></label>
            <div class="col-sm-10">
              <input type="text" name="name" value="<?php echo $name; ?>" placeholder="<?php echo $entry_name; ?>" id="input-name" class="form-control" />
              <?php if ($error_name) { ?>
              <div class="text-danger"><?php echo $error_name; ?></div>
              <?php } ?>
            </div>
          </div>
          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-sectionid"><span data-toggle="tooltip" title="" data-original-title="仅限数字，且任意模块值为唯一的"><?php echo $entry_sectionid; ?></span></label>
            <div class="col-sm-10">
              <input type="text" name="sectionid" value="<?php echo $sectionid; ?>" placeholder="<?php echo $entry_sectionid; ?>" id="input-sectionid" class="form-control" />
              <?php if ($error_sectionid) { ?>
              <div class="text-danger"><?php echo $error_sectionid; ?></div>
              <?php } ?>
			</div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-sectiontab"><span data-toggle="tooltip" title="" data-original-title="适用于单页，和导航模块组合使用，如此处设置为about，导航中需设置为#about"><?php echo $entry_sectiontab; ?></span></label>
            <div class="col-sm-10">
              <input type="text" name="sectiontab" value="<?php echo $sectiontab; ?>" placeholder="<?php echo $entry_sectiontab; ?>" id="input-sectiontab" class="form-control" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-titlename"><?php echo $entry_titlename; ?></label>
            <div class="col-sm-10">
              <input type="text" name="titlename" value="<?php echo $titlename; ?>" placeholder="<?php echo $entry_titlename; ?>" id="input-titlename" class="form-control" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-segmentingline"><?php echo $entry_segmentingline; ?></label>
            <div class="col-sm-10">
			<div class="row">
			<div class="col-sm-4">
              <input type="text" name="iplinew" value="<?php echo $iplinew; ?>" placeholder="<?php echo $entry_iplinew; ?>" id="input-iplinew" class="form-control" />
            </div>
			<div class="col-sm-4">
              <input type="text" name="iplineh" value="<?php echo $iplineh; ?>" placeholder="<?php echo $entry_iplineh; ?>" id="input-iplineh" class="form-control" />
            </div>
			<div class="col-sm-4">
              <input type="text" name="iplinec" value="<?php echo $iplinec; ?>" placeholder="<?php echo $entry_iplinec; ?>" id="input-iplinec" class="color {required:false,hash:true} form-control" />
            </div>
			</div>
			</div>
          </div> 
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-describe"><?php echo $entry_describe; ?></label>
            <div class="col-sm-10">
              <textarea name="describe" placeholder="<?php echo $entry_describe; ?>" id="input-describe" class="form-control" /><?php echo $describe; ?></textarea>
              <?php if ($error_describe) { ?>
              <div class="text-danger"><?php echo $error_describe; ?></div>
              <?php } ?>
            </div>
          </div> 
		  <div class="form-group">
            <label class="col-sm-2 control-label" for="input-main"><?php echo $entry_main; ?></label>
            <div class="col-sm-10">
              <select name="main" id="input-main" class="form-control">
				<?php if ($main == 'container') { ?>
                <option value="container" selected="selected"><?php echo $text_mainc; ?></option>
				<?php } else { ?>
                <option value="container"><?php echo $text_mainc; ?></option>
				<?php } ?>
				<?php if ($main == 'fullwidth') { ?>
                <option value="fullwidth" selected="selected"><?php echo $text_mainfw; ?></option>
				<?php } else { ?>
				<option value="fullwidth"><?php echo $text_mainfw; ?></option>
                <?php } ?>
              </select>
            </div>
          </div>
		  <div class="form-group">
            <label class="col-sm-2 control-label" for="input-autoplay"><?php echo $entry_autoplay; ?></label>
            <div class="col-sm-10">
              <select name="autoplay" id="input-autoplay" class="form-control">
                <?php if ($autoplay) { ?>
                <option value="1" selected="selected"><?php echo $text_yes; ?></option>
                <option value="0"><?php echo $text_no; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_yes; ?></option>
                <option value="0" selected="selected"><?php echo $text_no; ?></option>
                <?php } ?>
              </select>
            </div>
          </div>
		  <div class="form-group">
            <label class="col-sm-2 control-label" for="input-fade"><?php echo $entry_fade; ?></label>
            <div class="col-sm-10">
              <select name="fade" id="input-fade" class="form-control">
                <?php if ($fade) { ?>
                <option value="1" selected="selected"><?php echo $text_yes; ?></option>
                <option value="0"><?php echo $text_no; ?></option>
                <?php } else { ?>
                <option value="1"><?php echo $text_yes; ?></option>
                <option value="0" selected="selected"><?php echo $text_no; ?></option>
                <?php } ?>
              </select>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-speed"><?php echo $entry_speed; ?></label>
            <div class="col-sm-10">
              <input type="text" name="speed" value="<?php echo $speed; ?>" placeholder="<?php echo $entry_speed; ?>" id="input-speed" class="form-control" />
            </div>
          </div>  		  
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-column"><span data-toggle="tooltip" title="<?php echo $help_column; ?>"><?php echo $entry_columns; ?></span></label>
            <div class="col-sm-10">
			<div class="row">
			<div class="col-sm-4">
              <input type="text" name="column" value="<?php echo $column; ?>" placeholder="<?php echo $entry_column; ?>" id="input-column" class="form-control" />
			</div>
			<div class="col-sm-4">
              <input type="text" name="rows" value="<?php echo $rows; ?>"  placeholder="<?php echo $entry_rows; ?>" id="input-rows" class="form-control"  />
			  </div>
	            <div class="col-sm-4">
              <input type="text" name="scroll" value="<?php echo $scroll; ?>" placeholder="<?php echo $entry_scroll; ?>" id="input-scroll" class="form-control" />
            </div>
			</div>
			</div>
          </div>  	  		  
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-bgcolor"><?php echo $entry_bgcolortitle; ?></label>
            <div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="bgcolor" value="<?php echo $bgcolor; ?>"  placeholder="<?php echo $entry_bgcolor; ?>" id="input-bgcolor" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="bgcolorcss" value="<?php echo $bgcolorcss; ?>"  placeholder="<?php echo $entry_bgcolorcss; ?>" id="input-bgcolorcss" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="titlecss" value="<?php echo $titlecss; ?>"  placeholder="<?php echo $entry_titlejbcss; ?>" id="input-titlecss" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="titlesmcss" value="<?php echo $titlesmcss; ?>"  placeholder="<?php echo $entry_titlejbsmcss; ?>" id="input-titlesmcss" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="topp" value="<?php echo $topp; ?>"  placeholder="<?php echo $entry_topp; ?>" id="input-topp" class="form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="buttonp" value="<?php echo $buttonp; ?>"  placeholder="<?php echo $entry_buttonp; ?>" id="input-buttonp" class="form-control"  />
              </div>
            </div>
			</div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-bgcolor"><?php echo $entry_bgcolortitle; ?></label>
            <div class="col-sm-10">
			<div class="row">
            <div class="col-sm-3">
              <input type="text" name="picpa" value="<?php echo $picpa; ?>"  placeholder="<?php echo $entry_picpa; ?>" id="input-picpa" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="boxborder" value="<?php echo $boxborder; ?>"  placeholder="<?php echo $entry_boxborder; ?>" id="input-boxborder" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="boxcolor" value="<?php echo $boxcolor; ?>"  placeholder="<?php echo $entry_boxcolor; ?>" id="input-boxcolor" class="color {required:false,hash:true} form-control"  />
			  </div>
            <div class="col-sm-3">
              <input type="text" name="boxround" value="<?php echo $boxround; ?>"  placeholder="<?php echo $entry_boxround; ?>" id="input-boxround" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="boxshadow" value="<?php echo $boxshadow; ?>"  placeholder="<?php echo $entry_boxshadow; ?>" id="input-boxshadow" class="form-control"  />
              </div> 
            <div class="col-sm-3">
              <input type="text" name="boxshadowhover" value="<?php echo $boxshadowhover; ?>"  placeholder="<?php echo $entry_boxshadowhover; ?>" id="input-boxshadowhover" class="form-control"  />
              </div> 
            </div>
			</div>
          </div> 		         
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-width"><?php echo $entry_width; ?></label>
            <div class="col-sm-10">
              <input type="text" name="width" value="<?php echo $width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-width" class="form-control" />
              <?php if ($error_width) { ?>
              <div class="text-danger"><?php echo $error_width; ?></div>
              <?php } ?>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-height"><?php echo $entry_height; ?></label>
            <div class="col-sm-10">
              <input type="text" name="height" value="<?php echo $height; ?>" placeholder="<?php echo $entry_height; ?>" id="input-height" class="form-control" />
              <?php if ($error_height) { ?>
              <div class="text-danger"><?php echo $error_height; ?></div>
              <?php } ?>
            </div>
          </div>
		  <div class="form-group">
            <label class="col-sm-2 control-label" for="input-imagepicstyle">鼠标滑过图片样式</label>
            <div class="col-sm-10">
              <select name="imagepicstyle" id="input-imagepicstyle" class="form-control">
				<?php if ($imagepicstyle == 'none') { ?>
                <option value="none" selected="selected">默认(无样式)</option>
				<?php } else { ?>
                <option value="none">默认(无样式)</option>
				<?php } ?>
				<?php if ($imagepicstyle == 'u-block-hover__main--zoom-v1') { ?>
                <option value="u-block-hover__main--zoom-v1" selected="selected">等比例图片放大</option>
				<?php } else { ?>
				<option value="u-block-hover__main--zoom-v1">等比例图片放大</option>
                <?php } ?>
				<?php if ($imagepicstyle == 'u-block-hover__main--mover-down') { ?>
                <option value="u-block-hover__main--mover-down" selected="selected">图片从顶部缩小</option>
				<?php } else { ?>
                <option value="u-block-hover__main--mover-down">图片从顶部缩小</option>
				<?php } ?>
				<?php if ($imagepicstyle == 'u-block-hover__main--mover-up') { ?>
                <option value="u-block-hover__main--mover-up" selected="selected">图片从低部缩小</option>
				<?php } else { ?>
                <option value="u-block-hover__main--mover-up">图片从低部缩小</option>
				<?php } ?>
				<?php if ($imagepicstyle == 'u-block-hover__main--mover-right') { ?>
                <option value="u-block-hover__main--mover-right" selected="selected">图片从左滑道右边</option>
				<?php } else { ?>
                <option value="u-block-hover__main--mover-right">图片从左滑道右边</option>
				<?php } ?>
				<?php if ($imagepicstyle == 'u-block-hover__main--mover-left') { ?>
                <option value="u-block-hover__main--mover-left" selected="selected">图片从左滑道右边</option>
				<?php } else { ?>
                <option value="u-block-hover__main--mover-left">图片从右滑道左边</option>
				<?php } ?>
				<?php if ($imagepicstyle == 'u-block-hover__main--magnifier-top-right') { ?>
                <option value="u-block-hover__main--magnifier-top-right" selected="selected">图片向左下滑动</option>
				<?php } else { ?>
                <option value="u-block-hover__main--magnifier-top-right">图片向左下滑动</option>
				<?php } ?>
				<?php if ($imagepicstyle == 'u-block-hover__main--magnifier-top-left') { ?>
                <option value="u-block-hover__main--magnifier-top-left" selected="selected">图片向右下滑动</option>
				<?php } else { ?>
                <option value="u-block-hover__main--magnifier-top-left">图片向右下滑动</option>
				<?php } ?>
				<?php if ($imagepicstyle == 'u-block-hover__main--magnifier-bottom-right') { ?>
                <option value="u-block-hover__main--magnifier-bottom-right" selected="selected">图片向左上滑动</option>
				<?php } else { ?>
                <option value="u-block-hover__main--magnifier-bottom-right">图片向左上滑动</option>
				<?php } ?>
				<?php if ($imagepicstyle == 'u-block-hover__main--magnifier-bottom-left') { ?>
                <option value="u-block-hover__main--magnifier-bottom-left" selected="selected">图片向右上滑动</option>
				<?php } else { ?>
                <option value="u-block-hover__main--magnifier-bottom-left">图片向右上滑动</option>
				<?php } ?>
				<?php if ($imagepicstyle == 'g-transform-scale-1_1--parent-hover g-transition-0_3 g-transition--ease-in') { ?>
                <option value="g-transform-scale-1_1--parent-hover g-transition-0_3 g-transition--ease-in" selected="selected">图片放大样式二</option>
				<?php } else { ?>
				<option value="g-transform-scale-1_1--parent-hover g-transition-0_3 g-transition--ease-in">图片放大样式二</option>
                <?php } ?>
				<?php if ($imagepicstyle == 'g-transform-scale-1_2--parent-hover g-transition-0_3 g-transition--ease-in') { ?>
                <option value="g-transform-scale-1_2--parent-hover g-transition-0_3 g-transition--ease-in" selected="selected">图片放大样式三</option>
				<?php } else { ?>
				<option value="g-transform-scale-1_2--parent-hover g-transition-0_3 g-transition--ease-in">图片放大样式三</option>
                <?php } ?>
				<?php if ($imagepicstyle == 'u-block-hover__main--grayscale g-opacity-0_3 g-opacity-1--hover g-cursor-pointer') { ?>
                <option value="u-block-hover__main--grayscale g-opacity-0_3 g-opacity-1--hover g-cursor-pointer" selected="selected">图片灰色鼠标滑过点亮</option>
				<?php } else { ?>
				<option value="u-block-hover__main--grayscale g-opacity-0_3 g-opacity-1--hover g-cursor-pointer">图片灰色鼠标滑过点亮</option>
                <?php } ?>
				<?php if ($imagepicstyle == 'g-opacity-0_3 g-opacity-1--hover g-cursor-pointer') { ?>
                <option value="g-opacity-0_3 g-opacity-1--hover g-cursor-pointer" selected="selected">图片白色鼠标滑过点亮</option>
				<?php } else { ?>
				<option value="g-opacity-0_3 g-opacity-1--hover g-cursor-pointer">图片白色鼠标滑过点亮</option>
                <?php } ?>
				<?php if ($imagepicstyle == 'u-block-hover u-block-hover__additional--jump g-transition-0_3') { ?>
                <option value="u-block-hover u-block-hover__additional--jump g-transition-0_3" selected="selected">鼠标滑过上移</option>
				<?php } else { ?>
				<option value="u-block-hover u-block-hover__additional--jump g-transition-0_3">鼠标滑过上移</option>
                <?php } ?>
              </select>
            </div>
          </div>
          <table id="images" class="table table-striped table-bordered table-hover">
            <thead>
              <tr>
                <td class="text-left"><?php echo $entry_image; ?></td>
                <td class="text-left"><?php echo $entry_link; ?></td>
                <td class="text-right"><?php echo $entry_sort_order; ?></td>
                <td style="width: 10%;"></td>
              </tr>
            </thead>
            <tbody>
              <?php $image_row = 0; ?>
              <?php foreach ($images as $image) { ?>
              <tr id="image-row<?php echo $image_row; ?>">
                <td class="text-left"><a href="" id="thumb-image<?php echo $image_row; ?>" data-toggle="image" class="img-thumbnail"><img src="<?php echo $image['thumb']; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a>
                  <input type="hidden" name="image[<?php echo $image_row; ?>][image]" value="<?php echo $image['image']; ?>" id="input-image<?php echo $image_row; ?>" /></td>
                <td class="text-left"><input type="text" name="image[<?php echo $image_row; ?>][link]" value="<?php echo $image['link']; ?>" placeholder="<?php echo $entry_link; ?>" class="form-control" /></td>
                <td class="text-right" style="width: 10%;"><input type="text" name="image[<?php echo $image_row; ?>][sort_order]" value="<?php echo $image['sort_order']; ?>" placeholder="<?php echo $entry_sort_order; ?>" class="form-control" /></td>
                <td class="text-left"><button type="button" onclick="$('#image-row<?php echo $image_row; ?>, .tooltip').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
              </tr>
              <?php $image_row++; ?>
              <?php } ?>
            </tbody>
            <tfoot>
              <tr>
                <td colspan="3"></td>
                <td class="text-left"><button type="button" onclick="addImage();" data-toggle="tooltip" title="<?php echo $button_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
              </tr>
            </tfoot>
          </table>
        </form>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript"><!--
var image_row = <?php echo $image_row; ?>;

function addImage() {
  html  = '<tr id="image-row' + image_row + '">';
  html += '  <td class="text-left"><a href="" id="thumb-image' + image_row + '" data-toggle="image" class="img-thumbnail"><img src="<?php echo $placeholder; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a><input type="hidden" name="image[' + image_row + '][image]" value="" id="input-image' + image_row + '" /></td>';
  html += '  <td class="text-left"><input type="text" name="image[' + image_row + '][link]" value="" placeholder="<?php echo $entry_link; ?>" class="form-control" /></td>';
  html += '  <td class="text-right" style="width: 10%;"><input type="text" name="image[' + image_row + '][sort_order]" value="" placeholder="<?php echo $entry_sort_order; ?>" class="form-control" /></td>';
  html += '  <td class="text-left"><button type="button" onclick="$(\'#image-row' + image_row  + '\').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
  html += '</tr>';

  $('#images tbody').append(html);

  image_row++;
}
//--></script>
 <script type="text/javascript" src="view/javascript/jscolor/jscolor.js"></script>

<?php echo $footer; ?>
</div>