2016-03-25 01:18:05 -07:00
|
|
|
@if($model->fieldset)
|
|
|
|
@foreach($model->fieldset->fields AS $field)
|
2016-08-25 18:35:28 -07:00
|
|
|
<div class="form-group{{ $errors->has($field->db_column_name()) ? ' has-error' : '' }}">
|
|
|
|
<label for="{{ $field->db_column_name() }}" class="col-md-3 control-label">{{ $field->name }} </label>
|
|
|
|
<div class="col-md-7 col-sm-12{{ ($field->pivot->required=='1') ? ' required' : '' }}">
|
|
|
|
|
|
|
|
@if ($field->element!='text')
|
2016-08-25 21:03:24 -07:00
|
|
|
<!-- Listbox -->
|
2016-08-25 18:35:28 -07:00
|
|
|
@if ($field->element=='listbox')
|
2016-08-29 23:49:23 -07:00
|
|
|
{{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(),
|
2016-11-29 01:59:18 -08:00
|
|
|
Input::old($field->db_column_name(),(isset($item) ? $item->{$field->db_column_name()} : "")), ['class'=>'format select2 form-control']) }}
|
2016-08-25 18:35:28 -07:00
|
|
|
|
2016-08-25 21:03:24 -07:00
|
|
|
@elseif ($field->element=='checkbox')
|
|
|
|
<!-- Checkboxes -->
|
2016-08-25 18:35:28 -07:00
|
|
|
@foreach ($field->formatFieldValuesAsArray() as $key => $value)
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<label>
|
2016-08-25 21:03:24 -07:00
|
|
|
<input type="checkbox" value="1" name="{{ $field->db_column_name() }}[]" class="minimal" {{ Input::old($field->db_column_name()) != '' ? ' checked="checked"' : '' }}> key: {{ $key }} value: {{ $value }}
|
2016-08-25 18:35:28 -07:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
@endforeach
|
|
|
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
|
|
@else
|
2016-11-29 01:59:18 -08:00
|
|
|
<!-- Date field -->
|
2016-08-25 21:03:24 -07:00
|
|
|
|
2016-10-25 05:16:41 -07:00
|
|
|
@if ($field->format=='DATE')
|
|
|
|
<div class="input-group col-md-4" style="padding-left: 0px;">
|
2016-11-29 01:59:18 -08:00
|
|
|
|
|
|
|
<input type="text" value="{{ Input::old($field->db_column_name(),(isset($item) ? \App\Helpers\Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : "")) }}" id="{{ $field->db_column_name() }}" class="datepicker form-control col-md-4" name="{{ $field->db_column_name() }}" data-date-format="yyyy-mm-dd" placeholder="yyyy-mm-dd">
|
2016-10-25 05:16:41 -07:00
|
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
|
|
</div>
|
2016-08-25 21:03:24 -07:00
|
|
|
@else
|
2016-10-25 05:16:41 -07:00
|
|
|
@if (($field->field_encrypted=='0') || (Gate::allows('admin')))
|
2016-11-29 01:59:18 -08:00
|
|
|
<input type="text" value="{{ Input::old($field->db_column_name(),(isset($item) ? \App\Helpers\Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : "")) }}" id="{{ $field->db_column_name() }}" class="form-control" name="{{ $field->db_column_name() }}" placeholder="Enter {{ strtolower($field->format) }} text">
|
2016-10-25 05:16:41 -07:00
|
|
|
@else
|
|
|
|
<input type="text" value="{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}" class="form-control disabled" disabled>
|
|
|
|
@endif
|
|
|
|
@endif
|
2016-08-25 18:35:28 -07:00
|
|
|
|
|
|
|
@endif
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
|
|
|
$errormessage=$errors->first($field->db_column_name());
|
|
|
|
if ($errormessage) {
|
|
|
|
$errormessage=preg_replace('/ snipeit /', '', $errormessage);
|
|
|
|
print('<span class="alert-msg"><i class="fa fa-times"></i> '.$errormessage.'</span>');
|
2016-12-29 14:02:18 -08:00
|
|
|
}
|
2016-03-25 01:18:05 -07:00
|
|
|
?>
|
|
|
|
</div>
|
2016-08-25 21:03:24 -07:00
|
|
|
|
|
|
|
@if ($field->field_encrypted)
|
|
|
|
<div class="col-md-1 col-sm-1 text-left">
|
|
|
|
<i class="fa fa-lock" data-toggle="tooltip" data-placement="top" title="{{ trans('admin/custom_fields/general.value_encrypted') }}"></i>
|
|
|
|
</div>
|
|
|
|
@endif
|
2016-03-25 01:18:05 -07:00
|
|
|
</div>
|
|
|
|
@endforeach
|
|
|
|
@endif
|