<?php if (isset($component)) { $__componentOriginal69dc84650370d1d4dc1b42d016d7226b = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal69dc84650370d1d4dc1b42d016d7226b = $attributes; } ?>
<?php $component = App\View\Components\GuestLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('guest-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\GuestLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <?php $__env->startSection('title', 'Install CMS | ' . ($settings->site_name ?? config('app.name', 'Saleem Sial Analytics'))); ?>
    <?php $__env->startSection('meta_description', 'Run the browser installer for the Saleem Sial Analytics CMS.'); ?>

    <div class="space-y-6">
        <div class="space-y-3">
            <span class="inline-flex rounded-full bg-[#123262] px-3 py-1 text-xs font-semibold uppercase tracking-[0.22em] text-white">Browser installer</span>
            <div>
                <h2 class="text-3xl font-semibold tracking-tight text-[#123262]">Install this CMS</h2>
                <p class="mt-2 max-w-2xl text-sm leading-7 text-[#224672]">
                    Use this page to save the server settings, prepare the database, run migrations, seed the CMS, and make the admin login ready even when cPanel Terminal is not available.
                </p>
            </div>
        </div>

        <?php if($errors->any()): ?>
            <div class="rounded-2xl border border-[#F5AF00]/40 bg-[#FFF6E5] px-4 py-3 text-sm text-[#224672]">
                <ul class="space-y-1">
                    <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><?php echo e($error); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>

        <?php if(session('success')): ?>
            <div class="rounded-2xl border border-[#D5E9A4] bg-[#EAF5EA] px-4 py-3 text-sm text-[#224672]">
                <?php echo e(session('success')); ?>

            </div>
        <?php endif; ?>

        <?php if(session('error')): ?>
            <div class="rounded-2xl border border-[#F5AF00]/40 bg-[#FFF6E5] px-4 py-3 text-sm text-[#224672]">
                <?php echo e(session('error')); ?>

            </div>
        <?php endif; ?>

        <div class="grid gap-4 sm:grid-cols-2">
            <div class="rounded-3xl border border-[#B4CAE3] bg-[#F7FBFF] p-5">
                <p class="text-xs font-semibold uppercase tracking-[0.18em] text-[#14599E]">Database connection</p>
                <p class="mt-2 text-lg font-semibold text-[#123262]"><?php echo e(strtoupper($installerStatus['database_connection'])); ?></p>
                <p class="mt-1 text-sm text-[#224672]"><?php echo e($installerStatus['database_ready'] ? 'Connection looks ready.' : 'Database still needs setup.'); ?></p>
            </div>

            <div class="rounded-3xl border border-[#D5E9A4] bg-[#FBFEEB] p-5">
                <p class="text-xs font-semibold uppercase tracking-[0.18em] text-[#94C62D]">Application key</p>
                <p class="mt-2 text-lg font-semibold text-[#123262]"><?php echo e($installerStatus['app_key_configured'] ? 'Configured' : 'Missing'); ?></p>
                <p class="mt-1 text-sm text-[#224672]">The installer generates it automatically when needed.</p>
            </div>

            <div class="rounded-3xl border border-[#B4CAE3] bg-[#F7FBFF] p-5">
                <p class="text-xs font-semibold uppercase tracking-[0.18em] text-[#14599E]">Storage link</p>
                <p class="mt-2 text-lg font-semibold text-[#123262]"><?php echo e($installerStatus['storage_link_exists'] ? 'Ready' : 'Missing'); ?></p>
                <p class="mt-1 text-sm text-[#224672]">Used for public uploads and media files.</p>
            </div>

            <div class="rounded-3xl border border-[#D5E9A4] bg-[#FBFEEB] p-5">
                <p class="text-xs font-semibold uppercase tracking-[0.18em] text-[#94C62D]">Tables</p>
                <p class="mt-2 text-lg font-semibold text-[#123262]"><?php echo e($installerStatus['tables_installed'] ? 'Installed' : 'Not installed yet'); ?></p>
                <p class="mt-1 text-sm text-[#224672]">Migrations and seeders can be run from this page.</p>
            </div>
        </div>

        <?php if(session('install_steps')): ?>
            <div class="rounded-3xl border border-[#B4CAE3] bg-white p-5">
                <p class="text-sm font-semibold uppercase tracking-[0.18em] text-[#14599E]">Last run</p>
                <ul class="mt-3 space-y-2 text-sm text-[#224672]">
                    <?php $__currentLoopData = session('install_steps', []); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $step): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><?php echo e($step); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>

        <div class="rounded-3xl border border-[#B4CAE3] bg-white p-6 shadow-sm">
            <?php if($installerStatus['web_installer_locked'] && ! app()->environment('local')): ?>
                <p class="text-lg font-semibold text-[#123262]">Installation completed</p>
                <p class="mt-2 text-sm leading-7 text-[#224672]">
                    The live browser installer is now locked for safety. You can log in below. If you ever need to reopen this installer on the server, delete <code>storage/app/install.lock</code>.
                </p>

                <div class="mt-5 flex flex-col gap-3 sm:flex-row sm:items-center">
                    <a href="<?php echo e(route('login')); ?>" class="inline-flex min-h-[3.25rem] items-center justify-center rounded-2xl border-0 bg-[#94C62D] px-6 py-3 text-sm font-semibold uppercase tracking-[0.16em] text-[#123262] transition hover:bg-[#7fb121]">
                        Open login
                    </a>
                </div>
            <?php else: ?>
                <p class="text-lg font-semibold text-[#123262]">Run installer</p>
                <p class="mt-2 text-sm leading-7 text-[#224672]">
                    Enter the site URL and cPanel database details below. This installer writes the <code>.env</code> file, creates the database when credentials allow it, clears cached Laravel state, creates the storage link, and runs migrations with seed data.
                </p>

                <form method="POST" action="<?php echo e(route('install.run')); ?>" class="mt-5 space-y-5">
                    <?php echo csrf_field(); ?>

                    <div class="grid gap-4 sm:grid-cols-2">
                        <label class="block">
                            <span class="text-sm font-semibold text-[#123262]">Site name</span>
                            <input
                                type="text"
                                name="app_name"
                                value="<?php echo e(old('app_name', $installForm['app_name'])); ?>"
                                class="mt-2 w-full rounded-2xl border border-[#B4CAE3] px-4 py-3 text-sm text-[#123262] shadow-sm focus:border-[#14599E] focus:outline-none focus:ring-0"
                                required
                            >
                        </label>

                        <label class="block">
                            <span class="text-sm font-semibold text-[#123262]">Site URL</span>
                            <input
                                type="url"
                                name="app_url"
                                value="<?php echo e(old('app_url', $installForm['app_url'])); ?>"
                                class="mt-2 w-full rounded-2xl border border-[#B4CAE3] px-4 py-3 text-sm text-[#123262] shadow-sm focus:border-[#14599E] focus:outline-none focus:ring-0"
                                placeholder="https://your-domain.com"
                                required
                            >
                        </label>

                        <label class="block">
                            <span class="text-sm font-semibold text-[#123262]">Database type</span>
                            <select
                                name="db_connection"
                                class="mt-2 w-full rounded-2xl border border-[#B4CAE3] px-4 py-3 text-sm text-[#123262] shadow-sm focus:border-[#14599E] focus:outline-none focus:ring-0"
                                required
                            >
                                <?php $__currentLoopData = ['mysql' => 'MySQL', 'mariadb' => 'MariaDB']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($value); ?>" <?php if(old('db_connection', $installForm['db_connection']) === $value): echo 'selected'; endif; ?>><?php echo e($label); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </label>

                        <label class="block">
                            <span class="text-sm font-semibold text-[#123262]">Database host</span>
                            <input
                                type="text"
                                name="db_host"
                                value="<?php echo e(old('db_host', $installForm['db_host'])); ?>"
                                class="mt-2 w-full rounded-2xl border border-[#B4CAE3] px-4 py-3 text-sm text-[#123262] shadow-sm focus:border-[#14599E] focus:outline-none focus:ring-0"
                                placeholder="localhost"
                                required
                            >
                        </label>

                        <label class="block">
                            <span class="text-sm font-semibold text-[#123262]">Database port</span>
                            <input
                                type="number"
                                name="db_port"
                                value="<?php echo e(old('db_port', $installForm['db_port'])); ?>"
                                class="mt-2 w-full rounded-2xl border border-[#B4CAE3] px-4 py-3 text-sm text-[#123262] shadow-sm focus:border-[#14599E] focus:outline-none focus:ring-0"
                                placeholder="3306"
                                required
                            >
                        </label>

                        <label class="block">
                            <span class="text-sm font-semibold text-[#123262]">Database name</span>
                            <input
                                type="text"
                                name="db_database"
                                value="<?php echo e(old('db_database', $installForm['db_database'])); ?>"
                                class="mt-2 w-full rounded-2xl border border-[#B4CAE3] px-4 py-3 text-sm text-[#123262] shadow-sm focus:border-[#14599E] focus:outline-none focus:ring-0"
                                required
                            >
                        </label>

                        <label class="block">
                            <span class="text-sm font-semibold text-[#123262]">Database username</span>
                            <input
                                type="text"
                                name="db_username"
                                value="<?php echo e(old('db_username', $installForm['db_username'])); ?>"
                                class="mt-2 w-full rounded-2xl border border-[#B4CAE3] px-4 py-3 text-sm text-[#123262] shadow-sm focus:border-[#14599E] focus:outline-none focus:ring-0"
                                required
                            >
                        </label>

                        <label class="block sm:col-span-2">
                            <span class="text-sm font-semibold text-[#123262]">Database password</span>
                            <input
                                type="password"
                                name="db_password"
                                value="<?php echo e(old('db_password', '')); ?>"
                                class="mt-2 w-full rounded-2xl border border-[#B4CAE3] px-4 py-3 text-sm text-[#123262] shadow-sm focus:border-[#14599E] focus:outline-none focus:ring-0"
                            >
                        </label>
                    </div>

                    <div class="rounded-2xl border border-[#D5E9A4] bg-[#EAF5EA] px-4 py-3 text-sm text-[#224672]">
                        <p><strong>Admin login:</strong> <code>admin@example.com</code></p>
                        <p class="mt-1"><strong>Password:</strong> <code>password</code></p>
                        <p class="mt-2">Upload the full project, including the <code>vendor</code> folder, before running the browser installer on cPanel.</p>
                    </div>

                    <div class="flex flex-col gap-3 sm:flex-row sm:items-center">
                        <button type="submit" class="inline-flex min-h-[3.25rem] items-center justify-center rounded-2xl border-0 bg-[#94C62D] px-6 py-3 text-sm font-semibold uppercase tracking-[0.16em] text-[#123262] transition hover:bg-[#7fb121]">
                            Install now
                        </button>
                        <a href="<?php echo e(route('login')); ?>" class="inline-flex min-h-[3.25rem] items-center justify-center rounded-2xl border border-[#B4CAE3] px-6 py-3 text-sm font-semibold text-[#14599E] transition hover:border-[#14599E] hover:text-[#123262]">
                            Open login
                        </a>
                    </div>
                </form>
            <?php endif; ?>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal69dc84650370d1d4dc1b42d016d7226b)): ?>
<?php $attributes = $__attributesOriginal69dc84650370d1d4dc1b42d016d7226b; ?>
<?php unset($__attributesOriginal69dc84650370d1d4dc1b42d016d7226b); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal69dc84650370d1d4dc1b42d016d7226b)): ?>
<?php $component = $__componentOriginal69dc84650370d1d4dc1b42d016d7226b; ?>
<?php unset($__componentOriginal69dc84650370d1d4dc1b42d016d7226b); ?>
<?php endif; ?>
<?php /**PATH C:\xampp\htdocs\saleemsailAna.com\resources\views/install/index.blade.php ENDPATH**/ ?>