testlara/resources/views/document/create.blade.php

73 lines
2.6 KiB
PHP
Raw Normal View History

2023-10-27 19:59:05 +03:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document create</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-2">
<div class="row">
<div class="col-lg-12 margin-tb">
<div class="pull-left mb-2">
<h2>Add Document</h2>
</div>
<div class="pull-right">
<a class="btn btn-primary" href="{{ route('documents.show') }}"> Back</a>
</div>
</div>
</div>
@if(session('status'))
<div class="alert alert-success mb-1 mt-1">
{{ session('status') }}
</div>
@endif
<form action="{{ route('documents.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<strong>Document date:</strong>
<input type="date" name="date" class="form-control" placeholder="Product date">
@error('date')
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
@enderror
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<strong>Document type:</strong>
<select class="form-control" name="type">
@foreach(\App\Models\Document::getTitlesOfTypes() as $k => $value)
<option value="{{$k}}">{{$value}}</option>
@endforeach
</select>
</div>
</div>
<div class="row" style="padding-top: 20px">
<div class="col-xs-12 col-sm-12 col-md-12">
<label>Product quantity</label>
<input type="number" name="quantity" class="form-control">
@error('quantity')
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
@enderror
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<label>Product article</label>
<select class="form-control" name="product_id">
@foreach(\App\Models\Product::all() as $product)
<option value="{{$product->id}}">{{$product->article}}</option>
@endforeach
</select>
</div>
</div>
<button type="submit" class="btn btn-primary ml-3">Submit</button>
</form>
</div>
</body>
</html>