@php($company = $company ?? null)
@extends('layouts.app')
@section('title', __('nav.companies'))
@section('content')
<form method="post" action="{{ $company ? route('companies.update',$company) : route('companies.store') }}" class="card card-body">
@csrf @if($company)@method('PUT')@endif
<div class="row g-3">
<div class="col-md-6"><label class="form-label">{{ __('messages.name') }}</label><input class="form-control" name="name" value="{{ old('name', $company?->name) }}" required></div>
<div class="col-md-6"><label class="form-label">{{ __('messages.code') }}</label><input class="form-control" name="code" value="{{ old('code', $company?->code) }}" required></div>
<div class="col-md-6"><label class="form-label">{{ __('messages.phone') }}</label><input class="form-control" name="phone" value="{{ old('phone', $company?->phone) }}"></div>
<div class="col-md-6"><label class="form-label">{{ __('messages.email') }}</label><input class="form-control" name="email" value="{{ old('email', $company?->email) }}"></div>
<div class="col-md-6"><label class="form-label">{{ __('messages.contact_person') }}</label><input class="form-control" name="contact_person" value="{{ old('contact_person', $company?->contact_person) }}"></div>
<div class="col-md-6"><label class="form-label">{{ __('messages.status') }}</label><select class="form-select" name="status"><option value="active">{{ __('status.active') }}</option><option value="inactive">{{ __('status.inactive') }}</option></select></div>
<div class="col-12"><label class="form-label">{{ __('messages.address') }}</label><textarea class="form-control" name="address">{{ old('address', $company?->address) }}</textarea></div>
<div class="col-12"><label class="form-label">{{ __('messages.notes') }}</label><textarea class="form-control" name="notes">{{ old('notes', $company?->notes) }}</textarea></div>
</div>
<button class="btn btn-success mt-3">{{ __('messages.save') }}</button>
</form>
@endsection
