<?php echo $__env->make('admin::layouts.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<main id="main-container">
        <div class="bg-body-light">
          <div class="content content-full">
            <div class="d-flex flex-column flex-sm-row justify-content-sm-between align-items-sm-center">
              <h1 class="flex-grow-1 fs-3 fw-semibold my-2 my-sm-3">System Settings</h1>
              <nav class="flex-shrink-0 my-2 my-sm-0 ms-sm-3" aria-label="breadcrumb">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item">Dashboard</li>
                  <li class="breadcrumb-item">System</li>
                  <li class="breadcrumb-item active" aria-current="page">System Settings</li>
                </ol>
              </nav>
            </div>
          </div>
        </div>

        <div class="content">
          <div class="block block-rounded">
            <div class="block-header block-header-default">
              <h3 class="block-title">System Settings</h3>
            </div>
            <div class="block-content">
            <?php if(Session::has('success')): ?> <div class="alert alert-success mt-2 mb-2"><?php echo e(Session::get('success')); ?></div><?php endif; ?>
            <?php if(Session::has('fail')): ?> <div class="alert alert-danger mt-2 mb-2"><?php echo e(Session::get('fail')); ?></div><?php endif; ?>
            
            <div class="row">
            <div class="col-md-7 mb-3">
            <form class="row" action="" method="POST" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>
                    <div class="col-md-6 mb-3">
                      <label class="form-label">Company Name</label>
                      <input type="text" class="form-control" name="company_name" value="<?php echo e($settings->company_name); ?>" id="company_name">
                      <?php if($errors->has("company_name")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('company_name')); ?></div><?php endif; ?>
                    </div>
                    <div class="col-md-6 mb-3">
                      <label class="form-label">Address</label>
                      <input type="text" class="form-control" name="address" value="<?php echo e($settings->address); ?>" id="address">
                      <?php if($errors->has("address")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('address')); ?></div><?php endif; ?>
                    </div>
                    <div class="col-md-6 mb-3">
                      <label class="form-label">Company Phone Number</label>
                      <input type="text" class="form-control" name="company_phone" value="<?php echo e($settings->phone_number); ?>" id="company_phone">
                      <?php if($errors->has("company_phone")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('company_phone')); ?></div><?php endif; ?>
                    </div>
                    <div class="col-md-6 mb-3">
                      <label class="form-label">Company Email</label>
                      <input type="email" class="form-control" name="company_email" value="<?php echo e($settings->email); ?>" id="company_email">
                      <?php if($errors->has("company_email")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('company_email')); ?></div><?php endif; ?>
                    </div>
                    <div class="col-md-6 mb-3">
                      <label class="form-label">Company Logo</label>
                      <input class="form-control" type="file" id="company_logo" name="company_logo" accept="image/*">
                      <div class="valid-feedback d-block">You can use this site to compress image size if needed <a href="https://tinypng.com/" target="_blank">https://tinypng.com/</a></div>
                      <a href="<?php echo e(url('admin/remove-logo')); ?>"><button type="button" class="btn btn-danger">Remove Logo</button></a>
                        <?php if($errors->has("company_logo")): ?><div class="alert alert-danger mt-2"><?php echo e($errors->first('company_logo')); ?></div><?php endif; ?>
                    </div>
                    
                    <div>
                      <button type="submit" class="btn btn-primary">Save</button>
                     
                    </div>
            </form>
            </div>
            <div class="col-md-5 mb-3 text-center">
              <div style="border:1px solid;padding:15px;">
              <img id="logo_preview" src="<?php echo e(asset('db_files/other/'.$settings->logo.'')); ?>" style="width:75px;" alt="Company Logo">
              <p class="mb-0" id="preview_company_name"><?php echo e($settings->company_name); ?></p>
              <p class="mb-0" id="preview_address"><?php echo e($settings->address); ?></p>
              <p class="mb-0" id="preview_phone_number"><?php echo e($settings->phone_number); ?></p>
              <p class="mb-0" id="preview_email"><?php echo e($settings->email); ?></p>
              <div style="text-align:left;margin-top:25px;">
                <p><b>Receipt No: </b>INV00000000</p>
                <p style="margin:0;">Date: 2025/01/01 Time:00:00:0</p>
                <p style="margin:0;">Cashier: Cashier Name</p>
                <p style="margin:0;">Customer: Customer Name</p>
                <!-- <p style="margin:0;">Mobile No: <?php echo e($other_details->phone ?? '-'); ?></p> -->
            </div>
              <table style="width:100%;border-top:1px solid;margin-top:15px;">

                  <tr>
                      <td style="width:70%; text-align:left;">
                      <p style="margin:0;">Product Name<br>2x Rs. 1000.00</p>
                      </td>
                      <td style="width:30%; text-align:right;">
                      <p style="margin:0;">Rs.2000.00</p>
                      </td>
                  </tr>

              </table>
              </div>
            </div>
            </div>
          </div>
        </div>
</main>
<?php echo $__env->make('admin::layouts.footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<script>
  document.getElementById('company_name').addEventListener('input', function() {
    document.getElementById('preview_company_name').textContent = this.value;
  });
  document.getElementById('address').addEventListener('input', function() {
    document.getElementById('preview_address').textContent = this.value;
  });
  document.getElementById('company_phone').addEventListener('input', function() {
    document.getElementById('preview_phone_number').textContent = this.value;
  });
  document.getElementById('company_email').addEventListener('input', function() {
    document.getElementById('preview_email').textContent = this.value;
  });
  document.getElementById('company_logo').addEventListener('change', function(event) {
    const reader = new FileReader();
    reader.onload = function() {
      document.getElementById('logo_preview').src = reader.result;
    };
    if (event.target.files[0]) {
      reader.readAsDataURL(event.target.files[0]);
    }
  });
</script>
<?php /**PATH D:\Part Time Work\erp-demo-site\Modules/Admin\resources/views/user/system_settings.blade.php ENDPATH**/ ?>