Skip to content

Commit

Permalink
Order create fix page -- custom design
Browse files Browse the repository at this point in the history
  • Loading branch information
Raccoon254 committed Jun 10, 2024
1 parent 9a270eb commit f43d1df
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 28 deletions.
2 changes: 1 addition & 1 deletion resources/views/components/text-input.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@props(['disabled' => false])

<input {{ $disabled ? 'disabled' : '' }} {!! $attributes->merge(['class' => 'w-full p-2 border border-gray-300 rounded-lg rounded-md shadow-sm']) !!}>
<input {{ $disabled ? 'disabled' : '' }} {!! $attributes->merge(['class' => 'w-full p-2 border border-gray-300 rounded-lg rounded-md']) !!}>
68 changes: 41 additions & 27 deletions resources/views/livewire/auto-order-create.blade.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
<div class="max-w-7xl mx-auto py-10 sm:px-6 lg:px-8">
<h1 class="text-3xl font-bold mb-6">Create Order</h1>
<div class="p-2 md:p-0 md:py-4">
<x-slot name="header">
<h2 class="text-gray-800 flex items-center gap-4 leading-tight">
<i class="fas text-blue-500 fa-home"></i>
{{ __('Create Order') }}
</h2>
</x-slot>
<div class="max-w-7xl text-black/80 relative h-full mx-auto">
<div class="flex sm:mx-3 lg:mx-4 flex-col h-full md:flex-row">
<div class="w-full md:w-2/3 md:pr-2 flex-col">
<div class="rounded-lg relative p-4 w-full bg-white">
<h1 class="text-3xl font-bold mb-6">Create Order</h1>

<form method="POST" action="">
@csrf
<form method="POST" action="">
@csrf

<div class="mb-4">
<label for="title" class="block text-gray-700 font-bold mb-2">Title</label>
<input type="text" name="title" id="title" class="form-input w-full" value="{{ $orderData['title'] ?? '' }}">
</div>
<div class="mb-4">
<label for="title" class="block text-gray-700 font-bold mb-2">Title</label>
<x-text-input type="text" name="title" id="title" class="w-full"
value="{{ $orderData['title'] ?? '' }}"/>
</div>

<div class="mb-4">
<label for="description" class="block text-gray-700 font-bold mb-2">Description</label>
<textarea name="description" id="description" class="form-textarea w-full" rows="3">{{ $orderData['description'] ?? '' }}</textarea>
</div>
<div class="mb-4">
<label for="description" class="block text-gray-700 font-bold mb-2">Description</label>
<textarea name="description" id="description"
class="border border-gray-300 rounded-lg w-full"
rows="3">{{ $orderData['description'] ?? '' }}</textarea>
</div>

@php
$totalPrice = $orderData['total_price'] ?? 0;
@endphp
<div class="mb-4">
<label for="total_price" class="block text-gray-700 font-bold mb-2">Total Price</label>
<input type="number" name="total_price" id="total_price" class="form-input w-full" value="{{ $totalPrice }}" readonly>
</div>
@php
$totalPrice = $orderData['total_price'] ?? 0;
@endphp
<div class="mb-4">
<label for="total_price" class="block text-gray-700 font-bold mb-2">Total Price</label>
<x-text-input type="number" name="total_price" id="total_price" class="w-full"
value="{{ $totalPrice }}" readonly/>
</div>

<div class="mb-4">
<label for="status" class="block text-gray-700 font-bold mb-2">Status</label>
<input type="text" name="status" id="status" class="form-input w-full" value="{{ $orderData['status'] ?? 'pending' }}" readonly>
<button type="submit"
class="custom-btn">
Create Order
</button>
</form>
</div>
</div>
</div>

<button type="submit" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Create Order
</button>
</form>
</div>
</div>

0 comments on commit f43d1df

Please sign in to comment.