@extends('layouts.admin_layout')

@section('content')



<main class="h-full pb-16 overflow-y-auto">
          <div class="container grid px-6 mx-auto">
            <br><br>
            <h2
              class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200"
            >
            <span class="text-blue-500">Edit</span> System Variables
            </h2>
            <!-- CTA -->
            <a
              class="flex items-center justify-between p-4 mb-8 text-sm font-semibold bg-blue-600 shadow-md focus:outline-none focus:shadow-outline-green"
              href="{{ url('/') }}" style="color: #fff;"
            >
              <div class="flex items-center">
                <svg
                  class="w-5 h-5 mr-2"
                  fill="currentColor"
                  viewBox="0 0 20 20"
                >
                  <path
                    d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
                  ></path>
                </svg>
                <span>Go to website</span>
              </div>
              <span>View &RightArrow;</span>
            </a>

            <!-- General elements -->
            <h4
              class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
            >
            <span class="text-blue-500">System</span> Variables
            </h4>
            <div
              class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"
            >
            <x-alert/>
            <form method="post" action="{{ route('admin.site_update') }}" class="mt-4">
            @csrf
            
            <div class="flex items-center mb-4">
              <label class="block w-full mb-5 mr-3 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">Min Withdrawal On Main Balance ($)</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                  placeholder="Enter Amount" name="min_main_withdraw" type="number" value="{{ $min_main_withdraw->description }}"
                />
              </label>

              
              <label class="block w-full mb-5 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">Min Withdrawal On Rebate Balance ($)</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                  placeholder="Enter Amount" name="min_rebates_withdraw" type="number" value="{{ $min_rebates_withdraw->description }}"
                />
              </label>
            </div>

            <div class="flex items-center mb-4">
              <label class="block w-full mb-5 mr-3 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">Charge On Main Balance Withdrawal (%)</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Enter Percentage" name="main_charge" type="number" value="{{ $main_charge->description }}"
                />
              </label>

              
              <label class="block w-full mb-5 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">Charge On Rebate Withdrawal (%)</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Enter Percentage" name="rebate_charge" type="number" value="{{ $rebate_charge->description }}"
                />
              </label>
            </div>


            <div class="flex items-center mb-4">
              <label class="block w-full mb-5 mr-3 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">Dropoff Location</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Enter Drop Off Location" name="dropoff_location" type="text" value="{{ $dropoff_location->description }}"
                />
              </label>
            </div>
            
            <div class="flex items-center mb-4">
              <label class="block w-full mb-5 mr-3 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">Deposits Allowed</span>
                <select
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Deposits Allowed" name="is_deposit_paused"
                >
                    <option value="0" @if($is_deposit_paused->description == 0) {{ 'selected' }} @endif>Yes</option>
                    <option value="1" @if($is_deposit_paused->description == 1) {{ 'selected' }} @endif>No</option>
                </select>
              </label>
            </div>
            
            <div class="flex items-center mb-4">
              <label class="block w-full mb-5 mr-3 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">Promo Start Date(For Rebate Bonus)</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Enter Promo Start Date" name="promo_start_date" type="text" value="{{ $promo_start_date->description }}"
                />
              </label>
            </div>
            
            <div class="flex items-center mb-4">
              <label class="block w-full mb-5 mr-3 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">No. of referrals for promo bonus:</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Leave as 0 if you need no promo bonus per referral" name="num_of_reff_per_bonus" type="number" value="{{ $num_of_reff_per_bonus->description }}"
                />
              </label>

              
              <label class="block w-full mb-5 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">Promo referral bonus amount ($)</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Enter amount" name="reff_bonus_amount" type="number" step="0.1" min="0" value="{{ $reff_bonus_amount->description }}"
                />
              </label>
            </div>
            
            <div class="flex items-center mb-4">
              <label class="block w-full mb-5 mr-3 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">KYC Promo</span>
                <select
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="KYC Promo" name="is_kyc_promo"
                >
                    <option value="1" @if($is_kyc_promo->description == 1) {{ 'selected' }} @endif>Yes</option>
                    <option value="0" @if($is_kyc_promo->description == 0) {{ 'selected' }} @endif>No</option>
                </select>
              </label>

              
              <label class="block w-full mb-5 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">KYC Promo amount ($)</span>
                <input
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Enter amount" name="kyc_promo_amount" type="number" value="{{ $kyc_promo_amount->description }}"
                />
              </label>
            </div>
            
            <div class="flex items-center mb-4">
              <label class="block w-full mb-5 mr-3 text-sm">
                <span class="font-semibold text-gray-700 dark:text-gray-400">Withdrawal Threshold</span>
                <select
                  class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
                   placeholder="Withdrawal Threshold" name="withdrawal_threshold"
                >
                    <option value="1" @if($withdrawal_threshold->description == 1) {{ 'selected' }} @endif>Yes</option>
                    <option value="0" @if($withdrawal_threshold->description == 0) {{ 'selected' }} @endif>No</option>
                </select>
              </label>
            </div>
              

              <div class="mx-auto mt-4">
              <button
                  class="px-5 py-3 font-medium leading-5 text-white transition-colors duration-150 bg-blue-600 border border-transparent active:bg-green-500 hover:bg-green-700 focus:outline-none focus:shadow-outline-green"
                  type="submit" style="color: #fff;"
                >
                  Update Info
                </button>
              </div>
            </form>

        </div>
      </div>                      
    </div>
</main>



@endsection