<?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-service" 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-service" class="form-horizontal">
		<div class="alert alert-danger"><i class="fa fa-info-circle"></i> <?php echo $text_qq_open_signup; ?><button type="button" class="close" data-dismiss="alert">&times;</button></div>
          <ul class="nav nav-tabs">
            <li class="active"><a href="#tab-general" data-toggle="tab">常规</a></li>
            <li><a href="#tab-fticons" data-toggle="tab">图标</a></li>
          </ul>
          <div class="tab-content">
            <div class="tab-pane active" id="tab-general">
          <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">
            <label class="col-sm-2 control-label" for="input-powered"><?php echo $entry_powered; ?></label>
            <div class="col-sm-10">
			<div class="row">
			<div class="col-sm-6">
              <input type="text" name="powered" value="<?php echo $powered; ?>"  placeholder="<?php echo $entry_powered; ?>" id="input-powered" class="form-control"  />
            </div>
			<div class="col-sm-6">
              <input type="text" name="poweredlink" value="<?php echo $poweredlink; ?>"  placeholder="<?php echo $entry_poweredlink; ?>" id="input-poweredlink" class="form-control"  />
            </div>
			</div>
			</div>
          </div>  
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-miit"><?php echo $entry_miit; ?></label>
            <div class="col-sm-10">
              <input type="text" name="miit" value="<?php echo $miit; ?>"  placeholder="<?php echo $entry_miit; ?>" id="input-miit" class="form-control"  />
			</div>
          </div>
		  <div class="form-group">
            <label class="col-sm-2 control-label" for="input-mobilestyle">手机端样式</label>
            <div class="col-sm-10">
              <select name="mobilestyle" id="input-mobilestyle" class="form-control">
				<?php if ($mobilestyle == 'none') { ?>
                <option value="none" selected="selected">默认(不隐藏)</option>
				<?php } else { ?>
                <option value="none">默认(不隐藏)</option>
				<?php } ?>
				<?php if ($mobilestyle == 'g-hidden-xs-down') { ?>
                <option value="g-hidden-xs-down" selected="selected">手机端隐藏</option>
				<?php } else { ?>
				<option value="g-hidden-xs-down">手机端隐藏</option>
                <?php } ?>
              </select>
            </div>
          </div>	
          <div class="form-group  required">
            <label class="col-sm-2 control-label" for="input-columns"><span data-toggle="tooltip" title="<?php echo $help_columns; ?>"><?php echo $entry_columns; ?></span></label>
			<div class="col-sm-10">
			<div class="row">
            <div class="col-sm-4">
              <input type="text" name="columnone" value="<?php echo $columnone; ?>" placeholder="<?php echo $entry_columnone; ?>" id="input-columnone" class="form-control" />
              <?php if ($error_columnone) { ?>
              <div class="text-danger"><?php echo $error_columnone; ?></div>
              <?php } ?>
			</div>
            <div class="col-sm-4">
              <input type="text" name="columntwo" value="<?php echo $columntwo; ?>" placeholder="<?php echo $entry_columntwo; ?>" id="input-columntwo" class="form-control" />
              <?php if ($error_columntwo) { ?>
              <div class="text-danger"><?php echo $error_columntwo; ?></div>
              <?php } ?>
			</div>
            <div class="col-sm-4">
              <input type="text" name="columnthree" value="<?php echo $columnthree; ?>" placeholder="<?php echo $entry_columnthree; ?>" id="input-columnthree" class="form-control" />
              <?php if ($error_columnthree) { ?>
              <div class="text-danger"><?php echo $error_columnthree; ?></div>
              <?php } ?>
			</div>
			</div>
			</div>
          </div> 
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-image"><?php echo $entry_imagelogo; ?></label>
            <div class="col-sm-10">
              <a href="" id="thumb-image" data-toggle="image" class="img-thumbnail"><img src="<?php echo $thumb; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a>
              <input type="hidden" name="image" value="<?php echo $image; ?>" id="input-image" />
            </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" />
            </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" />
            </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="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-3">
              <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-3">
              <input type="text" name="footerpy" value="<?php echo $footerpy; ?>"  placeholder="<?php echo $entry_footerpy; ?>" id="input-footerpy" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="footerpx" value="<?php echo $footerpx; ?>"  placeholder="<?php echo $entry_footerpx; ?>" id="input-footerpx" class="form-control"  />
              </div>
              </div>
            </div>
          </div>      
          </div>
		  <div class="tab-pane" id="tab-fticons">
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-href"><?php echo $entry_ftsetone; ?></label>
			<div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="ftnameone" value="<?php echo $ftnameone; ?>" placeholder="<?php echo $entry_ftnameone; ?>" id="input-ftnameone" class="form-control" />
            </div>
            <div class="col-sm-3">
              <input type="text" name="fticonone" value="<?php echo $fticonone; ?>" placeholder="<?php echo $entry_fticonone; ?>" id="input-fticonone" class="form-control" />
            </div>
            <div class="col-sm-7">
              <input type="text" name="ftlinkone" value="<?php echo $ftlinkone; ?>" placeholder="<?php echo $entry_ftlinkone; ?>" id="input-ftlinkone" class="form-control" />
            </div>
			</div>
			</div>
          </div>  
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-href"><?php echo $entry_ftsettwo; ?></label>
			<div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="ftnametwo" value="<?php echo $ftnametwo; ?>" placeholder="<?php echo $entry_ftnametwo; ?>" id="input-ftnametwo" class="form-control" />
            </div>
            <div class="col-sm-3">
              <input type="text" name="fticontwo" value="<?php echo $fticontwo; ?>" placeholder="<?php echo $entry_fticontwo; ?>" id="input-fticontwo" class="form-control" />
            </div>
            <div class="col-sm-7">
              <input type="text" name="ftlinktwo" value="<?php echo $ftlinktwo; ?>" placeholder="<?php echo $entry_ftlinktwo; ?>" id="input-ftlinktwo" class="form-control" />
            </div>
			</div>
			</div>
          </div> 
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-href"><?php echo $entry_ftsetthree; ?></label>
			<div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="ftnamethree" value="<?php echo $ftnamethree; ?>" placeholder="<?php echo $entry_ftnamethree; ?>" id="input-ftnamethree" class="form-control" />
            </div>
            <div class="col-sm-3">
              <input type="text" name="fticonthree" value="<?php echo $fticonthree; ?>" placeholder="<?php echo $entry_fticonthree; ?>" id="input-fticonthree" class="form-control" />
            </div>
            <div class="col-sm-7">
              <input type="text" name="ftlinkthree" value="<?php echo $ftlinkthree; ?>" placeholder="<?php echo $entry_ftlinkthree; ?>" id="input-ftlinkthree" class="form-control" />
            </div>
			</div>
			</div>
          </div> 
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-href"><?php echo $entry_ftsetfour; ?></label>
			<div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="ftnamefour" value="<?php echo $ftnamefour; ?>" placeholder="<?php echo $entry_ftnamefour; ?>" id="input-ftnamefour" class="form-control" />
            </div>
            <div class="col-sm-3">
              <input type="text" name="fticonfour" value="<?php echo $fticonfour; ?>" placeholder="<?php echo $entry_fticonfour; ?>" id="input-fticonfour" class="form-control" />
            </div>
            <div class="col-sm-7">
              <input type="text" name="ftlinkfour" value="<?php echo $ftlinkfour; ?>" placeholder="<?php echo $entry_ftlinkfour; ?>" id="input-ftlinkfour" class="form-control" />
            </div>
			</div>
			</div>
          </div> 
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-href"><?php echo $entry_ftsetfive; ?></label>
			<div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="ftnamefive" value="<?php echo $ftnamefive; ?>" placeholder="<?php echo $entry_ftnamefive; ?>" id="input-ftnamefive" class="form-control" />
            </div>
            <div class="col-sm-3">
              <input type="text" name="fticonfive" value="<?php echo $fticonfive; ?>" placeholder="<?php echo $entry_fticonfive; ?>" id="input-fticonfive" class="form-control" />
            </div>
            <div class="col-sm-7">
              <input type="text" name="ftlinkfive" value="<?php echo $ftlinkfive; ?>" placeholder="<?php echo $entry_ftlinkfive; ?>" id="input-ftlinkfive" class="form-control" />
            </div>
			</div>
			</div>
          </div> 
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-href"><?php echo $entry_ftsetsix; ?></label>
			<div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="ftnamesix" value="<?php echo $ftnamesix; ?>" placeholder="<?php echo $entry_ftnamesix; ?>" id="input-ftnamesix" class="form-control" />
            </div>
            <div class="col-sm-3">
              <input type="text" name="fticonsix" value="<?php echo $fticonsix; ?>" placeholder="<?php echo $entry_fticonsix; ?>" id="input-fticonsix" class="form-control" />
            </div>
            <div class="col-sm-7">
              <input type="text" name="ftlinksix" value="<?php echo $ftlinksix; ?>" placeholder="<?php echo $entry_ftlinksix; ?>" id="input-ftlinksix" class="form-control" />
            </div>
			</div>
			</div>
          </div> 
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-stbgcolor"><?php echo $entry_ftstyle; ?></label>
            <div class="col-sm-10">
			<div class="row">
            <div class="col-sm-3">
              <input type="text" name="ftbj" value="<?php echo $ftbj; ?>"  placeholder="<?php echo $entry_ftbj; ?>" id="input-ftbj" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="ftcolor" value="<?php echo $ftcolor; ?>"  placeholder="<?php echo $entry_ftcolor; ?>" id="input-ftcolor" class="color {required:false,hash:true} form-control"  />
              </div>	
            <div class="col-sm-3">
              <input type="text" name="ftround" value="<?php echo $ftround; ?>"  placeholder="<?php echo $entry_ftround; ?>" id="input-ftround" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="ftsize" value="<?php echo $ftsize; ?>"  placeholder="<?php echo $entry_ftsize; ?>" id="input-ftsize" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="ftborder" value="<?php echo $ftborder; ?>"  placeholder="<?php echo $entry_ftborder; ?>" id="input-ftborder" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="ftbc" value="<?php echo $ftbc; ?>"  placeholder="<?php echo $entry_ftbc; ?>" id="input-ftbc" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="ftwidth" value="<?php echo $ftwidth; ?>"  placeholder="<?php echo $entry_ftwidth; ?>" id="input-ftwidth" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="ftheight" value="<?php echo $ftheight; ?>"  placeholder="<?php echo $entry_ftheight; ?>" id="input-ftheight" class="form-control"  />
              </div>	
            <div class="col-sm-3">
              <input type="text" name="blog" value="<?php echo $blog; ?>" placeholder="<?php echo $entry_blog; ?>" id="input-blog" class="form-control" />
            </div>			  
            </div>
			</div>
          </div> 		  
		  </div>
          </div>		  
          <table id="images" class="table table-striped table-bordered table-hover">
            <thead>
              <tr>
                <td class="text-left"><?php echo $entry_title; ?></td>
				<td class="text-left"><?php echo $entry_fticon; ?></td>
				<td class="text-left"><?php echo $entry_image; ?></td>
                <td class="text-right"><?php echo $entry_sort_order; ?></td>
                <td></td>
              </tr>
            </thead>
            <tbody>
              <?php $service_row = 0; ?>
              <?php foreach ($services as $service) { ?>
              <tr id="service-row<?php echo $service_row; ?>">
                <td class="text-left"><?php foreach ($languages as $language) { ?>
                    <input type="text" name="service[<?php echo $service_row; ?>][title][<?php echo $language['language_id']; ?>]" value="<?php echo isset($service['title'][$language['language_id']]) ? $service['title'][$language['language_id']] : ''; ?>" placeholder="<?php echo $entry_title; ?>" class="form-control" />
                  <?php if (isset($error_service[$service_row][$language['language_id']])) { ?>
                  <div class="text-danger"><?php echo $error_service[$service_row][$language['language_id']]; ?></div>
                  <?php } ?>
                  <?php } ?></td>
                <td class="text-left"><input type="text" name="service[<?php echo $service_row; ?>][fticon]" value="<?php echo $service['fticon']; ?>" placeholder="<?php echo $entry_fticon; ?>" class="form-control" /></td>  
                <td class="text-left"><a href="" id="thumb-image<?php echo $service_row; ?>" data-toggle="image" class="img-thumbnail"><img src="<?php echo $service['thumb']; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a>
                  <input type="hidden" name="service[<?php echo $service_row; ?>][image]" value="<?php echo $service['image']; ?>" id="input-image<?php echo $service_row; ?>" /></td>
                <td class="text-right" style="width: 10%;"><input type="text" name="service[<?php echo $service_row; ?>][sort_order]" value="<?php echo $service['sort_order']; ?>" placeholder="<?php echo $entry_sort_order; ?>" class="form-control" /></td>
                <td class="text-left"><button type="button" onclick="$('#service-row<?php echo $service_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 $service_row++; ?>
              <?php } ?>
            </tbody>
            <tfoot>
              <tr>
                <td colspan="4"></td>
                <td class="text-left"><button type="button" onclick="addService();" 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 service_row = <?php echo $service_row; ?>;

function addService() {
  html  = '<tr id="service-row' + service_row + '">';
  html += '  <td class="text-left">';
  <?php foreach ($languages as $language) { ?>
  html += '      <input type="text" name="service[' + service_row + '][title][<?php echo $language['language_id']; ?>]" value="" placeholder="<?php echo $entry_title; ?>" class="form-control" />';
  <?php } ?>
  html += '  </td>';
  html += '  <td class="text-left"><input type="text" name="service[' + service_row + '][fticon]" value="" placeholder="<?php echo $entry_fticon; ?>" class="form-control" /></td>';   
  html += '  <td class="text-left"><a href="" id="thumb-image' + service_row + '" data-toggle="image" class="img-thumbnail"><img src="<?php echo $placeholder; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a><input type="hidden" name="service[' + service_row + '][image]" value="" id="input-image' + service_row + '" /></td>';
  html += '  <td class="text-right" style="width: 10%;"><input type="text" name="service[' + service_row + '][sort_order]" value="" placeholder="<?php echo $entry_sort_order; ?>" class="form-control" /></td>';
  html += '  <td class="text-left"><button type="button" onclick="$(\'#service-row' + service_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);

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

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