@extends('layouts.master') @section('title') {{ translate('add product') }} @endsection @section('content')
{{ translate('add product') }}
{!! Form::open(array('url' => url('product/'.$product->id.'/update'), 'method' => 'post','class'=>'', 'name' => 'form',"enctype"=>"multipart/form-data")) !!}
{!! Form::label('name',translate('name'),array('class'=>'')) !!} {!! Form::text('name',$product->name, array('class' => 'form-control', 'placeholder'=>"",'required'=>'required')) !!}
{!! Form::label('code',translate('code'),array('class'=>'')) !!} {!! Form::text('code',$product->code, array('class' => 'form-control', 'placeholder'=>"",''=>'')) !!}
{!! Form::label('cost_price',translate('cost_price'),array('class'=>'')) !!} {!! Form::text('cost_price',$product->cost_price, array('class' => 'form-control touchspin', 'placeholder'=>"",'required'=>'required')) !!}
{!! Form::label('selling_price',translate('selling_price'),array('class'=>'')) !!} {!! Form::text('selling_price',$product->selling_price, array('class' => 'form-control touchspin', 'placeholder'=>"",''=>'')) !!}
{!! Form::label('qty',translate('qty'),array('class'=>'')) !!} {!! Form::number('qty',$product->qty, array('class' => 'form-control', 'placeholder'=>"",'id'=>'qty')) !!}
{!! Form::label('alert_qty',translate('alert').' '.translate('qty'),array('class'=>'')) !!} {!! Form::number('alert_qty',$product->alert_qty, array('class' => 'form-control', 'placeholder'=>"",'id'=>'alert_qty')) !!}
{!! Form::label('notes',translate('description'),array('class'=>'')) !!} {!! Form::textarea('notes',$product->notes, array('class' => 'form-control tinymce','rows'=>'3')) !!}

{{translate('custom_field')}}

@foreach($custom_fields as $key)
{!! Form::label($key->id,$key->name,array('class'=>'')) !!} @if($key->field_type=="number") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$product->id)->where('category','products')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$product->id)->where('category','products')->first()->name}} @endif"> @endif @if($key->field_type=="textfield") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$product->id)->where('category','products')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$product->id)->where('category','products')->first()->name}} @endif"> @endif @if($key->field_type=="date") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$product->id)->where('category','products')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$product->id)->where('category','products')->first()->name}} @endif"> @endif @if($key->field_type=="textarea") @endif @if($key->field_type=="decimal") required==1) required @endif value="@if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$product->id)->where('category','products')->first())){{\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$product->id)->where('category','products')->first()->name}} @endif"> @endif @if($key->field_type=="select") @endif @if($key->field_type=="radiobox") @foreach(explode(',',$key->radio_box_values) as $v)
@endforeach @endif @if($key->field_type=="checkbox") @if(!empty(\App\Models\CustomFieldMeta::where('custom_field_id',$key->id)->where('parent_id',$product->id)->where('category','products')->first()))