<?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>
          <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-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="linew" value="<?php echo $linew; ?>" placeholder="<?php echo $entry_linew; ?>" id="input-linew" class="form-control" />
            </div>
			<div class="col-sm-4">
              <input type="text" name="lineh" value="<?php echo $lineh; ?>" placeholder="<?php echo $entry_lineh; ?>" id="input-lineh" class="form-control" />
            </div>
			<div class="col-sm-4">
              <input type="text" name="linec" value="<?php echo $linec; ?>" placeholder="<?php echo $entry_linec; ?>" id="input-linec" 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" rows="2" placeholder="<?php echo $entry_describe; ?>" id="input-describe" class="form-control" /><?php echo $describe; ?></textarea>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-section"><?php echo $entry_section; ?></label>
            <div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="sectionbj" value="<?php echo $sectionbj; ?>"  placeholder="<?php echo $entry_sectionbj; ?>" id="input-sectionbj" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="sectionjbbj" value="<?php echo $sectionjbbj; ?>"  placeholder="<?php echo $entry_sectionjbbj; ?>" id="input-sectionjbbj" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="sectiontitle" value="<?php echo $sectiontitle; ?>"  placeholder="<?php echo $entry_sectiontitle; ?>" id="input-sectiontitle" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="sectiondescribe" value="<?php echo $sectiondescribe; ?>"  placeholder="<?php echo $entry_sectiondescribe; ?>" id="input-sectiondescribe" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="sectionptop" value="<?php echo $sectionptop; ?>"  placeholder="<?php echo $entry_sectionptop; ?>" id="input-sectionptop" class="form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="sectionpbuttom" value="<?php echo $sectionpbuttom; ?>"  placeholder="<?php echo $entry_sectionpbuttom; ?>" id="input-sectionpbuttom" class="form-control"  />
              </div>
            </div>
			</div>
          </div>   
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-acordion"><?php echo $entry_acordion; ?></label>
            <div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="acordionbj" value="<?php echo $acordionbj; ?>"  placeholder="<?php echo $entry_acordionbj; ?>" id="input-acordionbj" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="acordiontit" value="<?php echo $acordiontit; ?>"  placeholder="<?php echo $entry_acordiontit; ?>" id="input-acordiontit" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="acordionbjhover" value="<?php echo $acordionbjhover; ?>"  placeholder="<?php echo $entry_acordionbjhover; ?>" id="input-acordionbjhover" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="acordiontithover" value="<?php echo $acordiontithover; ?>"  placeholder="<?php echo $entry_acordiontithover; ?>" id="input-acordiontithover" 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-href"><?php echo $entry_button1; ?></label>
			<div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="buttonname1" value="<?php echo $buttonname1; ?>" placeholder="<?php echo $entry_buttonname1; ?>" id="input-buttonname1" class="form-control" />
            </div>
             <div class="col-sm-2">
              <input type="text" name="qq1" value="<?php echo $qq1; ?>" placeholder="<?php echo $entry_qq1; ?>" id="input-qq1" class="form-control" />
            </div>
             <div class="col-sm-2">
              <input type="text" name="alww1" value="<?php echo $alww1; ?>" placeholder="<?php echo $entry_alww1; ?>" id="input-alww1" class="form-control" />
            </div>
             <div class="col-sm-2">
              <input type="text" name="link1" value="<?php echo $link1; ?>" placeholder="<?php echo $entry_link1; ?>" id="input-link1" class="form-control" />
            </div>
             <div class="col-sm-2">
              <input type="text" name="buttoncolor1" value="<?php echo $buttoncolor1; ?>" placeholder="<?php echo $entry_buttoncolor1; ?>" id="input-buttoncolor1" class="form-control" />
            </div>
			</div>
			</div>
          </div>  
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-href"><?php echo $entry_button2; ?></label>
			<div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="buttonname2" value="<?php echo $buttonname2; ?>" placeholder="<?php echo $entry_buttonname2; ?>" id="input-buttonname2" class="form-control" />
            </div>
             <div class="col-sm-2">
              <input type="text" name="qq2" value="<?php echo $qq2; ?>" placeholder="<?php echo $entry_qq2; ?>" id="input-qq2" class="form-control" />
            </div>
             <div class="col-sm-2">
              <input type="text" name="alww2" value="<?php echo $alww2; ?>" placeholder="<?php echo $entry_alww2; ?>" id="input-alww2" class="form-control" />
            </div>
            <div class="col-sm-2">
              <input type="text" name="link2" value="<?php echo $link2; ?>" placeholder="<?php echo $entry_link2; ?>" id="input-link2" class="form-control" />
            </div>
             <div class="col-sm-2">
              <input type="text" name="buttoncolor2" value="<?php echo $buttoncolor2; ?>" placeholder="<?php echo $entry_buttoncolor2; ?>" id="input-buttoncolor2" class="form-control" />
            </div>
			</div>
			</div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-box"><?php echo $entry_buttonstyle; ?></label>
            <div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
              <input type="text" name="buttonsize" value="<?php echo $buttonsize; ?>"  placeholder="<?php echo $entry_buttonsize; ?>" id="input-buttonsize" class="form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="buttoninset" value="<?php echo $buttoninset; ?>"  placeholder="<?php echo $entry_buttoninset; ?>" id="input-buttoninset" class="form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="buttonborder" value="<?php echo $buttonborder; ?>"  placeholder="<?php echo $entry_buttonborder ?>" id="input-buttonborder" class="form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="buttonround" value="<?php echo $buttonround; ?>"  placeholder="<?php echo $entry_buttonround; ?>" id="input-buttonround" class="form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="buttonhover" value="<?php echo $buttonhover; ?>"  placeholder="<?php echo $entry_buttonhover; ?>" id="input-buttonhover" class="form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="buttond" value="<?php echo $buttond; ?>"  placeholder="<?php echo $entry_buttond; ?>" id="input-buttond" class="form-control"  />
              </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_text; ?></td>
                <td class="text-left"><?php echo $entry_icon; ?></td>
				<td class="text-left"><span data-toggle="tooltip" title="<?php echo $help_qiehuan; ?>"><?php echo $entry_qiehuan; ?></span></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" style="width: 25%;"><?php foreach ($languages as $language) { ?>
                    <input type="text" name="service[<?php echo $service_row; ?>][title1][<?php echo $language['language_id']; ?>]" value="<?php echo isset($service['title1'][$language['language_id']]) ? $service['title1'][$language['language_id']] : ''; ?>" placeholder="<?php echo $entry_title1; ?>" 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" style="width: 40%;"><?php foreach ($languages as $language) { ?>
                    <input type="text" name="service[<?php echo $service_row; ?>][text1][<?php echo $language['language_id']; ?>]" value="<?php echo isset($service['text1'][$language['language_id']]) ? $service['text1'][$language['language_id']] : ''; ?>" placeholder="<?php echo $entry_text1; ?>" 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" style="width: 15%;"><?php foreach ($languages as $language) { ?>
                    <input type="text" name="service[<?php echo $service_row; ?>][icon1][<?php echo $language['language_id']; ?>]" value="<?php echo isset($service['icon1'][$language['language_id']]) ? $service['icon1'][$language['language_id']] : ''; ?>" placeholder="<?php echo $entry_icon1; ?>" 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" style="width: 10%;"><?php foreach ($languages as $language) { ?>
                    <input type="text" name="service[<?php echo $service_row; ?>][qiehuan1][<?php echo $language['language_id']; ?>]" value="<?php echo isset($service['qiehuan1'][$language['language_id']]) ? $service['qiehuan1'][$language['language_id']] : ''; ?>" placeholder="<?php echo $entry_qiehuan1; ?>" 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-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="5"></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" style="width: 25%;">';
  <?php foreach ($languages as $language) { ?>
  html += '      <input type="text" name="service[' + service_row + '][title1][<?php echo $language['language_id']; ?>]" value="" placeholder="<?php echo $entry_title1; ?>" class="form-control" />';
  <?php } ?>
  html += '  </td>';
  html += '  <td class="text-left" style="width: 40%;">';
  <?php foreach ($languages as $language) { ?>
  html += '      <input type="text" name="service[' + service_row + '][text1][<?php echo $language['language_id']; ?>]" value="" placeholder="<?php echo $entry_text1; ?>" class="form-control" />';
  <?php } ?>
  html += '  </td>';
  html += '  <td class="text-left" style="width: 15%;"><input type="text" name="service[' + service_row + '][icon1]" value="" placeholder="<?php echo $entry_icon1; ?>" class="form-control" /></td>';
  html += '  <td class="text-left" style="width: 10%;"><input type="text" name="service[' + service_row + '][qiehuan1]" value="" placeholder="<?php echo $entry_qiehuan1; ?>" class="form-control" /></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>