<?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="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="etlinew" value="<?php echo $etlinew; ?>" placeholder="<?php echo $entry_etlinew; ?>" id="input-etlinew" class="form-control" />
            </div>
			<div class="col-sm-4">
              <input type="text" name="etlineh" value="<?php echo $etlineh; ?>" placeholder="<?php echo $entry_etlineh; ?>" id="input-etlineh" class="form-control" />
            </div>
			<div class="col-sm-4">
              <input type="text" name="etlinec" value="<?php echo $etlinec; ?>" placeholder="<?php echo $entry_etlinec; ?>" id="input-etlinec" 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>
            </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-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="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-3">
              <input type="text" name="etncolor" value="<?php echo $etncolor; ?>"  placeholder="<?php echo $entry_etncolor; ?>" id="input-etncolor" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="edcolor" value="<?php echo $edcolor; ?>"  placeholder="<?php echo $entry_edcolor; ?>" id="input-edcolor" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="eotop" value="<?php echo $eotop; ?>"  placeholder="<?php echo $entry_eotop; ?>" id="input-eotop" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="eob" value="<?php echo $eob; ?>"  placeholder="<?php echo $entry_eob; ?>" id="input-eob" class="form-control"  />
              </div>
            </div>
			</div>
          </div> 
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-bgcolor"><?php echo $entry_eocss; ?></label>
            <div class="col-sm-10">
			<div class="row">
            <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="positioncss" value="<?php echo $positioncss; ?>"  placeholder="<?php echo $entry_positioncss; ?>" id="input-positioncss" class="color {required:false,hash:true} form-control"  />
              </div>
            <div class="col-sm-3">
              <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>
			</div>
          </div> 
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-box"><?php echo $entry_slidestyle; ?></label>
            <div class="col-sm-10">
			<div class="row">
            <div class="col-sm-3">
              <input type="text" name="slidewidth" value="<?php echo $slidewidth; ?>"  placeholder="<?php echo $entry_slidewidth; ?>" id="input-slidewidth" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="slideheight" value="<?php echo $slideheight; ?>"  placeholder="<?php echo $entry_slideheight; ?>" id="input-slideheight" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="slideradius" value="<?php echo $slideradius; ?>"  placeholder="<?php echo $entry_slideradius ?>" id="input-slideradius" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="slidebjcolor" value="<?php echo $slidebjcolor; ?>"  placeholder="<?php echo $entry_slidebjcolor; ?>" id="input-slidebjcolor" class="color {required:false,hash:true} form-control"  />
			  </div>
            <div class="col-sm-3">
              <input type="text" name="sliderborderw" value="<?php echo $sliderborderw; ?>"  placeholder="<?php echo $entry_sliderborderw ?>" id="input-sliderborderw" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="bjcolorafter" value="<?php echo $bjcolorafter; ?>"  placeholder="<?php echo $entry_bjcolorafter; ?>" id="input-bjcolorafter" class="color {required:false,hash:true} form-control"  />
            </div>
            <div class="col-sm-3">
              <input type="text" name="sliderborderrd" value="<?php echo $sliderborderrd; ?>"  placeholder="<?php echo $entry_sliderborderrd ?>" id="input-sliderborderrd" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="sliderborder" value="<?php echo $sliderborder; ?>"  placeholder="<?php echo $entry_sliderborder ?>" id="input-sliderborder" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="sliderhkc" value="<?php echo $sliderhkc; ?>"  placeholder="<?php echo $entry_sliderhkc; ?>" id="input-sliderhkc" class="color {required:false,hash:true} form-control"  /> 
            </div>
            <div class="col-sm-3">
              <input type="text" name="sliderpadding" value="<?php echo $sliderpadding; ?>"  placeholder="<?php echo $entry_sliderpadding ?>" id="input-sliderpadding" class="form-control"  />
              </div>			  
			</div>
			</div>
          </div> 		  
          <div class="form-group">
            <label class="col-sm-2 control-label" for="input-imgmm"><?php echo $entry_imgmm; ?></label>
            <div class="col-sm-10">
			<div class="row">
            <div class="col-sm-3">
              <input type="text" name="imground" value="<?php echo $imground; ?>"  placeholder="<?php echo $entry_imground; ?>" id="input-imground" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="imgthumb" value="<?php echo $imgthumb; ?>"  placeholder="<?php echo $entry_imgthumb; ?>" id="input-imgthumb" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="imgshadow" value="<?php echo $imgshadow; ?>"  placeholder="<?php echo $entry_imgshadow; ?>" id="input-imgshadow" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="imgpadding" value="<?php echo $imgpadding; ?>"  placeholder="<?php echo $entry_imgpadding; ?>" id="input-imgpadding" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="imgborder" value="<?php echo $imgborder; ?>"  placeholder="<?php echo $entry_imgborder; ?>" id="input-imgborder" class="form-control"  />
              </div>
            <div class="col-sm-3">
              <input type="text" name="imgcolor" value="<?php echo $imgcolor; ?>"  placeholder="<?php echo $entry_imgcolor; ?>" id="input-imgcolor" class="color {required:false,hash:true} 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_other; ?></td>
                <td class="text-left"><?php echo $entry_text; ?></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"><?php foreach ($languages as $language) { ?>
                    <input type="text" name="service[<?php echo $service_row; ?>][other][<?php echo $language['language_id']; ?>]" value="<?php echo isset($service['other'][$language['language_id']]) ? $service['other'][$language['language_id']] : ''; ?>" placeholder="<?php echo $entry_other; ?>" 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) { ?>
                    <textarea name="service[<?php echo $service_row; ?>][text][<?php echo $language['language_id']; ?>]"  placeholder="<?php echo $entry_text; ?>" rows="5" class="form-control" /><?php echo isset($service['text'][$language['language_id']]) ? $service['text'][$language['language_id']] : ''; ?></textarea>
                  <?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"><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="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">';
  <?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">';
  <?php foreach ($languages as $language) { ?>
  html += '      <input type="text" name="service[' + service_row + '][other][<?php echo $language['language_id']; ?>]" value="" placeholder="<?php echo $entry_other; ?>" class="form-control" />';
  <?php } ?>
  html += '  </td>';
  html += '  <td class="text-left">';
  <?php foreach ($languages as $language) { ?>
  html += '      <textarea name="service[' + service_row + '][text][<?php echo $language['language_id']; ?>]" value="" placeholder="<?php echo $entry_text; ?>" rows="5" class="form-control" />';
  <?php } ?>
  html += '  </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>