<?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="alert alert-info"><i class="fa fa-info-circle"></i> <?php echo $text_cwkj_wxts; ?></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="rtwolw" value="<?php echo $rtwolw; ?>" placeholder="<?php echo $entry_rtwolw; ?>" id="input-rtwolw" class="form-control" />
            </div>
			<div class="col-sm-4">
              <input type="text" name="rtwolh" value="<?php echo $rtwolh; ?>" placeholder="<?php echo $entry_rtwolh; ?>" id="input-rtwolh" class="form-control" />
            </div>
			<div class="col-sm-4">
			<div id="cp2" class="input-group colorpicker-component colorpicker-element">
              <input type="text" name="rtwolc" value="<?php echo $rtwolc; ?>" placeholder="<?php echo $entry_rtwolc; ?>" id="input-rtwolc" class="color form-control" />
            <span class="input-group-addon"><i></i></span>
			</div>
			</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 required">
            <label class="col-sm-2 control-label" for="input-image"><?php echo $entry_image; ?></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" />
              <?php if ($error_image) { ?>
              <div class="text-danger"><?php echo $error_image; ?></div>
              <?php } ?>
            </div>
          </div>
          <div class="form-group required">
            <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 required">
            <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-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="rorow" value="<?php echo $rorow; ?>"  placeholder="<?php echo $entry_rorow; ?>" id="input-rorow" 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-main"><?php echo $entry_main; ?></label>
            <div class="col-sm-10">
              <select name="main" id="input-main" class="form-control">
                <?php if ($main) { ?>
                <option value="container" selected="selected"><?php echo $text_mainc; ?></option>
                <option value="fullwidth"><?php echo $text_mainfw; ?></option>
                <?php } else { ?>
                <option value="container"><?php echo $text_mainc; ?></option>
                <option value="fullwidth" selected="selected"><?php echo $text_mainfw; ?></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-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-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-bgcolor"><?php echo $entry_bgcolortitle; ?></label>
            <div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
			<div id="cp3" class="input-group colorpicker-component colorpicker-element">
              <input type="text" name="bgcolor" value="<?php echo $bgcolor; ?>"  placeholder="<?php echo $entry_bgcolor; ?>" id="input-bgcolor" class="color form-control"  />
              <span class="input-group-addon"><i></i></span>
			  </div>
			  </div>
            <div class="col-sm-2">
			<div id="cp4" class="input-group colorpicker-component colorpicker-element">
              <input type="text" name="bgcolorcss" value="<?php echo $bgcolorcss; ?>"  placeholder="<?php echo $entry_bgcolorcss; ?>" id="input-bgcolorcss" class="color form-control"  />
              <span class="input-group-addon"><i></i></span>
			  </div>
			  </div>
            <div class="col-sm-2">
			<div id="cp6" class="input-group colorpicker-component colorpicker-element">
              <input type="text" name="titlecss" value="<?php echo $titlecss; ?>"  placeholder="<?php echo $entry_titlejbcss; ?>" id="input-titlecss" class="color form-control"  />
              <span class="input-group-addon"><i></i></span>
			  </div>
			  </div>
            <div class="col-sm-2">
			<div id="cp7" class="input-group colorpicker-component colorpicker-element">
              <input type="text" name="bordercss" value="<?php echo $bordercss; ?>"  placeholder="<?php echo $entry_bordercss; ?>" id="input-bordercss" class="color form-control"  />
              <span class="input-group-addon"><i></i></span>
			  </div>
			  </div>
            <div class="col-sm-2">
              <input type="text" name="rptop" value="<?php echo $rptop; ?>"  placeholder="<?php echo $entry_rptop; ?>" id="input-rptop" class="form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="rpbuttom" value="<?php echo $rpbuttom; ?>"  placeholder="<?php echo $entry_rpbuttom; ?>" id="input-rpbuttom" class="form-control"  />
              </div>
            </div>
			</div>
          </div>          
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-mm"><?php echo $entry_mm; ?></label>
            <div class="col-sm-10">
			<div class="row">
            <div class="col-sm-2">
			<div id="cp8" class="input-group colorpicker-component colorpicker-element">
              <input type="text" name="mbgcolor" value="<?php echo $mbgcolor; ?>"  placeholder="<?php echo $entry_mbgcolor; ?>" id="input-mbgcolor" class="color form-control"  />
              <span class="input-group-addon"><i></i></span>
			  </div>
			  </div>
            <div class="col-sm-2">
			<div id="cp9" class="input-group colorpicker-component colorpicker-element">
              <input type="text" name="mbgcolorjb" value="<?php echo $mbgcolorjb; ?>"  placeholder="<?php echo $entry_mbgcolorjb; ?>" id="input-mbgcolorjb" class="color form-control"  />
              <span class="input-group-addon"><i></i></span>
			  </div>
			  </div>
            <div class="col-sm-2">
			<div id="cp10" class="input-group colorpicker-component colorpicker-element">
              <input type="text" name="mtitle" value="<?php echo $mtitle; ?>"  placeholder="<?php echo $entry_mtitle ?>" id="input-mtitle" class="color form-control"  />
              <span class="input-group-addon"><i></i></span>
			  </div>
			  </div>
            <div class="col-sm-2">
              <input type="text" name="mpppa" value="<?php echo $mpppa; ?>"  placeholder="<?php echo $entry_mpppa; ?>" id="input-mpppa" class="form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="mpa" value="<?php echo $mpa; ?>"  placeholder="<?php echo $entry_mpa; ?>" id="input-mpa" class="form-control"  />
              </div>
            <div class="col-sm-2">
              <input type="text" name="mborder" value="<?php echo $mborder; ?>"  placeholder="<?php echo $entry_mborder; ?>" id="input-mborder" class="form-control"  />
              </div>
            <div class="col-sm-2">
			<div id="cp11" class="input-group colorpicker-component colorpicker-element">
              <input type="text" name="mbcolor" value="<?php echo $mbcolor; ?>"  placeholder="<?php echo $entry_mbcolor; ?>" id="input-mbcolor" class="color form-control"  />
              <span class="input-group-addon"><i></i></span>
			  </div>
			  </div>
            <div class="col-sm-2">
              <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-2">
              <input type="text" name="boxposition" value="<?php echo $boxposition; ?>"  placeholder="<?php echo $entry_boxposition; ?>" id="input-boxposition" class="form-control"  />
              </div>
            <div class="col-sm-2">
              <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-2">
              <input type="text" name="boxshadowhover" value="<?php echo $boxshadowhover; ?>"  placeholder="<?php echo $entry_boxshadowhover; ?>" id="input-boxshadowhover" class="form-control"  />
              </div> 		  
            <div class="col-sm-2">
			<div id="cp12" class="input-group colorpicker-component colorpicker-element">
              <input type="text" name="linkcolor" value="<?php echo $linkcolor; ?>"  placeholder="<?php echo $entry_linkcolor; ?>" id="input-linkcolor" class="color form-control"  />
              <span class="input-group-addon"><i></i></span>
			  </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_link; ?></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; ?>][link]" value="<?php echo $service['link']; ?>" placeholder="<?php echo $entry_link; ?>" class="form-control" /></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="3"></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 + '][link]" value="" placeholder="<?php echo $entry_link; ?>" 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">
		$(function () {
		    $('#cp5').colorpicker({
		      format: "rgba"
		    });
		    $('#cp2, #cp3, #cp4, #cp6, #cp7, #cp8, #cp9, #cp10, #cp11, #cp12, #cp13').colorpicker();
		  });
	</script>
 <link href="view/javascript/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
 <script src="view/javascript/colorpicker/js/bootstrap-colorpicker.min.js"></script>
<?php echo $footer; ?>
</div>