@extends('layouts.app') @section('content')

{{ ($senddata->id != '') ? 'Edit' : 'Add' }} Product

{!! Form::model($senddata, ['route' => $route, 'method' => $method, 'id'=>'product_form' , 'files' => true,'class' => 'form']) !!}
{!! Form::select('mc_id',$main_category,($senddata->id != '') ? $senddata->mc_id : '',['class' => 'form-control get_pro_cate','placeholder'=>'Please Select Main Product Category','id'=>'mc_id']) !!}
@if($senddata->id)
{!! Form::select('pc_id',$product_category,($senddata->id != '') ? $senddata->pc_id : '',['class' => 'form-control','placeholder'=>'Please Select Product Category','id'=>'pc_id']) !!}
@else
@endif
{{ Form::text('p_name',($senddata->id != '') ? $senddata->p_name : old('p_name'),['class' => 'form-control','data-error' => 'Enter Product Name','placeholder'=>'Enter Product Name'] ) }}
id == '') ? 'required' : '' }} >

id == '') ? 'required' : '' }} >

@if ($senddata->id) @if(count($unit)>0) @php $cnt1=1; @endphp @foreach($unit as $datas)
{!! Form::select('unit[unit_type][]',$unit_type,($senddata->id != '') ? $datas->unit_type : '',['class' => 'form-control','placeholder'=>'Please Select Unit Type','id'=>'unit_type']) !!}
@php $cnt1++; @endphp @endforeach @endif @endif
{!! Form::select('unit[unit_type][]',$unit_type,($senddata->id != '') ? $senddata->unit_type : '',['class' => 'form-control','placeholder'=>'Please Select Unit Type','id'=>'unit_id']) !!}
@if ($senddata->id) @if(count($prices)>0) @php $cntp=1; @endphp @foreach($prices as $price)
{{ Form::text('price[offer_in_perc][]',($senddata->id != '') ? $price->offer_in_perc : old('offer_in_perc'),['class' => 'form-control','data-error' => 'Enter Offer Percentage','placeholder'=>'Enter Offer Percentage'] ) }}
{{ Form::text('price[mrp_price][]',($senddata->id != '') ? $price->mrp_price : old('mrp_price'),['class' => 'form-control','data-error' => 'Enter MRP Price','placeholder'=>'Enter MRP Price'] ) }}
{{ Form::text('price[stock_availability][]',($senddata->id != '') ? $price->stock_availability : old('stock_availability'),['class' => 'form-control','data-error' => 'Enter Product Quantity','placeholder'=>'Enter Quantity of Product'] ) }}
@php $cntp++; @endphp @endforeach @endif @endif
@if ($senddata->id)
{!! Form::select('status',['1'=>'Active','0'=>'In Active'],($senddata->id != '') ? $senddata->status : '',['class' => 'form-control']) !!}
@endif
Cancel
{!! Form::close() !!}
@endsection @section('javascript') @endsection