Commit 9fd4c18f authored by Sarun Mungthanya's avatar Sarun Mungthanya
Browse files

issue serverlicense creaet

parent 5fc7bb44
......@@ -10,11 +10,12 @@ use Livewire\Component;
use GuzzleHttp\Client;
use App\Models\ConfServerLicense;
use Illuminate\Support\Facades\DB;
class ServerLicenseCreate extends Component
{
public $phpVersions = [];
public $teams ;
public $teams;
public $sizings = [];
public $customerTypes = [];
public $dbTypes = [];
......@@ -37,8 +38,6 @@ class ServerLicenseCreate extends Component
public $hscodeMethod = 1;
public $customerUrl;
public $contact;
public $contactCustomerName;
protected $rules = [
'serverKey' => 'required|string|max:255',
......@@ -62,7 +61,29 @@ class ServerLicenseCreate extends Component
];
public function mount()
{
$this->phpVersionId = DB::table('master_php_ver')
->orderBy('id', 'asc')
->first()->id;
$this->teamId = DB::table('master_team')
->orderBy('id', 'asc')
->first()->id;
$this->customerSize = DB::table('master_size')
->orderBy('id', 'asc')
->first()->id;
$this->customerType = DB::table('master_sizeType')
->orderBy('id', 'asc')
->first()->id;
$this->databaseType = DB::table('master_dbtype')
->orderBy('id', 'asc')
->first()->id;
$this->ownerType = DB::table('conf_server_ownertype')
->orderBy('owntypeid', 'asc')
->first()->id;
}
......@@ -124,6 +145,7 @@ class ServerLicenseCreate extends Component
$this->ownerTypes = DB::table('conf_server_ownertype')
->orderBy('owntypeid', 'asc')
->get();
return view('livewire.pages.server-license.server-license-create');
}
}
......@@ -30,7 +30,6 @@
<div class="flex flex-col w-3/4">
<select id="teamId" wire:model.defer="teamId"
class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($teams as $team)
<option value="{{ $team->id }}">{{ $team->teamName }}</option>
@endforeach
......@@ -48,7 +47,6 @@
<div class="flex flex-col w-3/4">
<select id="customerSize" wire:model.defer="customerSize"
class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($sizings as $size)
<option value="{{ $size->id }}">{{ $size->sizeName }}</option>
@endforeach
......@@ -66,7 +64,6 @@
<div class="flex flex-col w-3/4">
<select id="customerType" wire:model.defer="customerType"
class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($customerTypes as $type)
<option value="{{ $type->id }}">{{ $type->sizeTypeName }}</option>
@endforeach
......@@ -142,7 +139,6 @@
<div class="flex flex-col w-3/4">
<select id="phpVersionId" wire:model.defer="phpVersionId"
class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($phpVersions as $version)
<option value="{{ $version->id }}">{{ $version->version }}</option>
@endforeach
......@@ -199,7 +195,6 @@
<div class="flex flex-col w-3/4">
<select id="databaseType" wire:model.defer="databaseType"
class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($dbTypes as $db)
<option value="{{ $db->id }}">{{ $db->dbName }}</option>
@endforeach
......@@ -217,7 +212,6 @@
<div class="flex flex-col w-3/4">
<select id="ownerType" wire:model.defer="ownerType"
class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($ownerTypes as $owner)
<option value="{{ $owner->owntype_code }}">{{ $owner->owntype_description }}
</option>
......@@ -236,7 +230,6 @@
<div class="flex flex-col w-3/4">
<select id="hscodeMethod" wire:model.defer="hscodeMethod"
class=" p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
<option value="1" {{ $hscodeMethod == '1' ? 'selected' : '' }}>Patch</option>
<option value="2" {{ $hscodeMethod == '2' ? 'selected' : '' }}>Run script
</option>
......
......@@ -91,8 +91,8 @@
<!-- Server Key -->
<div class="mb-4 flex items-center">
<label for="serverKey" class="w-1/4 text-gray-700">Server Key</label>
<input type="text" id="serverKey" class="w-3/4 p-2 border border-gray-300 rounded-md"
wire:model.defer="serverKey">
<input type="text" id="serverKey"
class="w-3/4 p-2 border border-gray-300 rounded-md" wire:model.defer="serverKey">
</div>
<!-- Team -->
......@@ -100,7 +100,6 @@
<label for="teamId" class="w-1/4 text-gray-700">Team</label>
<select id="teamId" wire:model.defer="teamId"
class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($teams as $team)
<option value="{{ is_object($team) ? $team->id : $team['id'] }}">
{{ is_object($team) ? $team->teamName : $team['teamName'] }}</option>
......@@ -113,7 +112,6 @@
<label for="customerSize" class="w-1/4 text-gray-700">Customer Sizing</label>
<select id="customerSize" wire:model.defer="customerSize"
class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($sizings as $size)
<option value="{{ is_object($size) ? $size->id : $size['id'] }}">
{{ is_object($size) ? $size->sizeName : $size['sizeName'] }}</option>
......@@ -126,7 +124,6 @@
<label for="customerType" class="w-1/4 text-gray-700">Customer Type</label>
<select id="customerType" wire:model.defer="customerType"
class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($customerTypes as $type)
<option value="{{ is_object($type) ? $type->id : $type['id'] }}">
{{ is_object($type) ? $type->sizeTypeName : $type['sizeTypeName'] }}
......@@ -177,7 +174,6 @@
<label for="phpVersionId" class="w-1/4 text-gray-700">PHP Version</label>
<select id="phpVersionId" wire:model.defer="phpVersionId"
class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($phpVersions as $version)
<option value="{{ is_object($version) ? $version->id : $version['id'] }}">
{{ is_object($version) ? $version->version : $version['version'] }}</option>
......@@ -211,7 +207,6 @@
<label for="databaseType" class="w-1/4 text-gray-700">Database Type</label>
<select id="databaseType" wire:model.defer="databaseType"
class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($dbTypes as $db)
<option value="{{ is_object($db) ? $db->id : $db['id'] }}">
{{ is_object($db) ? $db->dbName : $db['dbName'] }}</option>
......@@ -224,7 +219,6 @@
<label for="ownerType" class="w-1/4 text-gray-700">Server of</label>
<select id="ownerType" wire:model.defer="ownerType"
class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
@foreach ($ownerTypes as $owner)
<option
value="{{ is_object($owner) ? $owner->owntype_code : $owner['owntype_code'] }}">
......@@ -238,7 +232,6 @@
<label for="hscodeMethod" class="w-1/4 text-gray-700">HSCODE 2017 Method</label>
<select id="hscodeMethod" wire:model.defer="hscodeMethod"
class="w-3/4 p-2 border border-gray-300 rounded-md">
<option value="">Please Select</option>
<option value="1" {{ $hscodeMethod == '1' ? 'selected' : '' }}>Patch</option>
<option value="2" {{ $hscodeMethod == '2' ? 'selected' : '' }}>Run script
</option>
......@@ -328,9 +321,7 @@
</div>
<div x-show="activeTab === 'historyPatch'">
@if ($tab === 'historyPatch')
@include('livewire.pages.server-license.history-patch', [
'historyPatchList' => $historyPatchList,
])
@include('livewire.pages.server-license.history-patch', ['historyPatchList' => $historyPatchList])
@endif
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment