

<?php $__env->startSection('title', 'مرجع داده و مالی'); ?>

<?php $__env->startSection('content'); ?>
<?php
    $tabs = [
        ['id' => 'cities', 'title' => 'شهرها', 'icon' => 'fa-city'],
        ['id' => 'cargo-items', 'title' => 'انواع کالا', 'icon' => 'fa-box'],
        ['id' => 'fleet-types', 'title' => 'انواع ناوگان', 'icon' => 'fa-truck-moving'],
        ['id' => 'route-types', 'title' => 'انواع مسیر', 'icon' => 'fa-road'],
        ['id' => 'transport-routes', 'title' => 'مسیرهای حمل', 'icon' => 'fa-route'],
        ['id' => 'financial-coefficients', 'title' => 'ضرایب مالی', 'icon' => 'fa-percent'],
        ['id' => 'financial-items', 'title' => 'اقلام مالی', 'icon' => 'fa-wallet'],
    ];
?>

<style>
    .master-nav .nav-link {
        border-radius: 12px;
        padding: 0.85rem 1rem;
        color: #334155;
        border: 1px solid #e2e8f0;
        background: #fff;
        font-weight: 600;
    }
    .master-nav .nav-link.active {
        background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
        color: #1d4ed8;
        border-color: #93c5fd;
    }
    .master-table thead th {
        white-space: nowrap;
        font-size: 13px;
    }
    .master-table tbody td {
        font-size: 13px;
        vertical-align: middle;
    }
    .master-actions {
        white-space: nowrap;
    }
</style>

<div class="card mb-4">
    <div class="card-header d-flex justify-content-between align-items-center">
        <div>
            <h5 class="mb-1">مرجع داده و مالی</h5>
            <small class="text-muted">مدیریت 7 گروه داده با جدول کامل و افزودن/ویرایش از طریق مدال</small>
        </div>
        <span class="badge bg-primary-subtle text-primary border border-primary-subtle">7 زیرمنو</span>
    </div>
    <div class="card-body">
        <div class="row g-2 nav nav-pills master-nav" role="tablist">
            <?php $__currentLoopData = $tabs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $tab): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="col-md col-6">
                    <button
                        class="nav-link w-100 <?php echo e($index === 0 ? 'active' : ''); ?>"
                        data-bs-toggle="pill"
                        data-bs-target="#<?php echo e($tab['id']); ?>-pane"
                        type="button"
                    >
                        <i class="fas <?php echo e($tab['icon']); ?> me-2"></i>
                        <?php echo e($tab['title']); ?>

                    </button>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
</div>

<div class="tab-content">
    <div class="tab-pane fade show active" id="cities-pane">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h5 class="mb-0">شهرها</h5>
                <button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#cityCreateModal">افزودن شهر</button>
            </div>
            <div class="card-body table-responsive">
                <table class="table table-hover master-table">
                    <thead><tr><th>#</th><th>نام شهر</th><th>استان</th><th>وضعیت</th><th>عملیات</th></tr></thead>
                    <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($city->id); ?></td>
                            <td><?php echo e($city->name); ?></td>
                            <td><?php echo e($city->province ?: '-'); ?></td>
                            <td><span class="badge <?php echo e($city->is_active ? 'bg-success' : 'bg-secondary'); ?>"><?php echo e($city->is_active ? 'فعال' : 'غیرفعال'); ?></span></td>
                            <td class="master-actions">
                                <button class="btn btn-outline-primary btn-sm" data-bs-toggle="modal" data-bs-target="#cityEditModal-<?php echo e($city->id); ?>">ویرایش</button>
                                <form method="POST" action="<?php echo e(route('admin.master-data.cities.destroy', $city)); ?>" class="d-inline"><?php echo csrf_field(); ?><button class="btn btn-outline-danger btn-sm" onclick="return confirm('شهر حذف شود؟')">حذف</button></form>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="5" class="text-center text-muted py-4">هیچ شهری ثبت نشده است.</td></tr>
                    <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="tab-pane fade" id="cargo-items-pane">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h5 class="mb-0">انواع کالا</h5>
                <button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#cargoCreateModal">افزودن کالا</button>
            </div>
            <div class="card-body table-responsive">
                <table class="table table-hover master-table">
                    <thead><tr><th>#</th><th>کد</th><th>نام</th><th>واحد</th><th>خطرناک</th><th>وضعیت</th><th>عملیات</th></tr></thead>
                    <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $cargoItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($item->id); ?></td>
                            <td><?php echo e($item->code); ?></td>
                            <td><?php echo e($item->name); ?></td>
                            <td><?php echo e($item->unit); ?></td>
                            <td><span class="badge <?php echo e($item->is_hazardous ? 'bg-warning text-dark' : 'bg-light text-dark'); ?>"><?php echo e($item->is_hazardous ? 'بله' : 'خیر'); ?></span></td>
                            <td><span class="badge <?php echo e($item->is_active ? 'bg-success' : 'bg-secondary'); ?>"><?php echo e($item->is_active ? 'فعال' : 'غیرفعال'); ?></span></td>
                            <td class="master-actions">
                                <button class="btn btn-outline-primary btn-sm" data-bs-toggle="modal" data-bs-target="#cargoEditModal-<?php echo e($item->id); ?>">ویرایش</button>
                                <form method="POST" action="<?php echo e(route('admin.master-data.cargo-items.destroy', $item)); ?>" class="d-inline"><?php echo csrf_field(); ?><button class="btn btn-outline-danger btn-sm" onclick="return confirm('نوع کالا حذف شود؟')">حذف</button></form>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="7" class="text-center text-muted py-4">هیچ نوع کالایی ثبت نشده است.</td></tr>
                    <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="tab-pane fade" id="fleet-types-pane">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h5 class="mb-0">انواع ناوگان</h5>
                <button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#fleetCreateModal">افزودن ناوگان</button>
            </div>
            <div class="card-body table-responsive">
                <table class="table table-hover master-table">
                    <thead><tr><th>#</th><th>کد</th><th>نام</th><th>یخچالی</th><th>وضعیت</th><th>عملیات</th></tr></thead>
                    <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $fleetTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $fleet): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($fleet->id); ?></td>
                            <td><?php echo e($fleet->code); ?></td>
                            <td><?php echo e($fleet->name); ?></td>
                            <td><span class="badge <?php echo e($fleet->is_refrigerated ? 'bg-info' : 'bg-light text-dark'); ?>"><?php echo e($fleet->is_refrigerated ? 'بله' : 'خیر'); ?></span></td>
                            <td><span class="badge <?php echo e($fleet->is_active ? 'bg-success' : 'bg-secondary'); ?>"><?php echo e($fleet->is_active ? 'فعال' : 'غیرفعال'); ?></span></td>
                            <td class="master-actions">
                                <button class="btn btn-outline-primary btn-sm" data-bs-toggle="modal" data-bs-target="#fleetEditModal-<?php echo e($fleet->id); ?>">ویرایش</button>
                                <form method="POST" action="<?php echo e(route('admin.master-data.fleet-types.destroy', $fleet)); ?>" class="d-inline"><?php echo csrf_field(); ?><button class="btn btn-outline-danger btn-sm" onclick="return confirm('نوع ناوگان حذف شود؟')">حذف</button></form>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="6" class="text-center text-muted py-4">هیچ نوع ناوگانی ثبت نشده است.</td></tr>
                    <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="tab-pane fade" id="route-types-pane">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h5 class="mb-0">انواع مسیر</h5>
                <button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#routeTypeCreateModal">افزودن نوع مسیر</button>
            </div>
            <div class="card-body table-responsive">
                <table class="table table-hover master-table">
                    <thead><tr><th>#</th><th>کد</th><th>نام</th><th>کوهستانی</th><th>صعب</th><th>بین‌المللی</th><th>وضعیت</th><th>عملیات</th></tr></thead>
                    <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $routeTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $routeType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($routeType->id); ?></td>
                            <td><?php echo e($routeType->code); ?></td>
                            <td><?php echo e($routeType->name); ?></td>
                            <td><?php echo e($routeType->is_mountainous ? 'بله' : 'خیر'); ?></td>
                            <td><?php echo e($routeType->is_hard_path ? 'بله' : 'خیر'); ?></td>
                            <td><?php echo e($routeType->is_international ? 'بله' : 'خیر'); ?></td>
                            <td><span class="badge <?php echo e($routeType->is_active ? 'bg-success' : 'bg-secondary'); ?>"><?php echo e($routeType->is_active ? 'فعال' : 'غیرفعال'); ?></span></td>
                            <td class="master-actions">
                                <button class="btn btn-outline-primary btn-sm" data-bs-toggle="modal" data-bs-target="#routeTypeEditModal-<?php echo e($routeType->id); ?>">ویرایش</button>
                                <form method="POST" action="<?php echo e(route('admin.master-data.route-types.destroy', $routeType)); ?>" class="d-inline"><?php echo csrf_field(); ?><button class="btn btn-outline-danger btn-sm" onclick="return confirm('نوع مسیر حذف شود؟')">حذف</button></form>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="8" class="text-center text-muted py-4">هیچ نوع مسیری ثبت نشده است.</td></tr>
                    <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="tab-pane fade" id="transport-routes-pane">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h5 class="mb-0">مسیرهای حمل</h5>
                <button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#transportRouteCreateModal">افزودن مسیر حمل</button>
            </div>
            <div class="card-body table-responsive">
                <table class="table table-hover master-table">
                    <thead><tr><th>#</th><th>مبدا</th><th>مقصد</th><th>نوع مسیر</th><th>مسافت</th><th>وضعیت</th><th>عملیات</th></tr></thead>
                    <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $transportRoutes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $route): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($route->id); ?></td>
                            <td><?php echo e($route->originCity->name ?? '-'); ?></td>
                            <td><?php echo e($route->destinationCity->name ?? '-'); ?></td>
                            <td><?php echo e($route->routeType->name ?? 'بدون نوع'); ?></td>
                            <td><?php echo e(number_format($route->distance_km, 2)); ?></td>
                            <td><span class="badge <?php echo e($route->is_active ? 'bg-success' : 'bg-secondary'); ?>"><?php echo e($route->is_active ? 'فعال' : 'غیرفعال'); ?></span></td>
                            <td class="master-actions">
                                <button class="btn btn-outline-primary btn-sm" data-bs-toggle="modal" data-bs-target="#transportRouteEditModal-<?php echo e($route->id); ?>">ویرایش</button>
                                <form method="POST" action="<?php echo e(route('admin.master-data.transport-routes.destroy', $route)); ?>" class="d-inline"><?php echo csrf_field(); ?><button class="btn btn-outline-danger btn-sm" onclick="return confirm('مسیر حمل حذف شود؟')">حذف</button></form>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="7" class="text-center text-muted py-4">هیچ مسیر حملی ثبت نشده است.</td></tr>
                    <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="tab-pane fade" id="financial-coefficients-pane">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h5 class="mb-0">ضرایب مالی</h5>
                <button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#financialCoefficientCreateModal">افزودن ضریب مالی</button>
            </div>
            <div class="card-body table-responsive">
                <table class="table table-hover master-table">
                    <thead><tr><th>#</th><th>گروه</th><th>کد</th><th>عنوان</th><th>مقدار</th><th>ترتیب</th><th>وضعیت</th><th>عملیات</th></tr></thead>
                    <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $financialCoefficients; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $coefficient): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($coefficient->id); ?></td>
                            <td><?php echo e($coefficient->coefficient_group); ?></td>
                            <td><?php echo e($coefficient->code); ?></td>
                            <td><?php echo e($coefficient->title); ?></td>
                            <td><?php echo e($coefficient->value); ?></td>
                            <td><?php echo e($coefficient->sort_order); ?></td>
                            <td><span class="badge <?php echo e($coefficient->is_active ? 'bg-success' : 'bg-secondary'); ?>"><?php echo e($coefficient->is_active ? 'فعال' : 'غیرفعال'); ?></span></td>
                            <td class="master-actions">
                                <button class="btn btn-outline-primary btn-sm" data-bs-toggle="modal" data-bs-target="#financialCoefficientEditModal-<?php echo e($coefficient->id); ?>">ویرایش</button>
                                <form method="POST" action="<?php echo e(route('admin.master-data.financial-coefficients.destroy', $coefficient)); ?>" class="d-inline"><?php echo csrf_field(); ?><button class="btn btn-outline-danger btn-sm" onclick="return confirm('ضریب مالی حذف شود؟')">حذف</button></form>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="8" class="text-center text-muted py-4">هیچ ضریب مالی ثبت نشده است.</td></tr>
                    <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div class="tab-pane fade" id="financial-items-pane">
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h5 class="mb-0">اقلام مالی</h5>
                <button class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#financialItemCreateModal">افزودن قلم مالی</button>
            </div>
            <div class="card-body table-responsive">
                <table class="table table-hover master-table">
                    <thead><tr><th>#</th><th>کد</th><th>عنوان</th><th>نوع</th><th>مقدار</th><th>وضعیت</th><th>عملیات</th></tr></thead>
                    <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $financialItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($item->id); ?></td>
                            <td><?php echo e($item->code); ?></td>
                            <td><?php echo e($item->title); ?></td>
                            <td><?php echo e($item->value_type); ?></td>
                            <td><?php echo e($item->value); ?></td>
                            <td><span class="badge <?php echo e($item->is_active ? 'bg-success' : 'bg-secondary'); ?>"><?php echo e($item->is_active ? 'فعال' : 'غیرفعال'); ?></span></td>
                            <td class="master-actions">
                                <button class="btn btn-outline-primary btn-sm" data-bs-toggle="modal" data-bs-target="#financialItemEditModal-<?php echo e($item->id); ?>">ویرایش</button>
                                <form method="POST" action="<?php echo e(route('admin.master-data.financial-items.destroy', $item)); ?>" class="d-inline"><?php echo csrf_field(); ?><button class="btn btn-outline-danger btn-sm" onclick="return confirm('قلم مالی حذف شود؟')">حذف</button></form>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="7" class="text-center text-muted py-4">هیچ قلم مالی ثبت نشده است.</td></tr>
                    <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="cityCreateModal" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.cities.store')); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">افزودن شهر</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-12"><label class="form-label">نام شهر</label><input class="form-control" name="name" required></div><div class="col-12"><label class="form-label">استان</label><input class="form-control" name="province"></div><div class="col-12 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" checked id="city-create-active"><label class="form-check-label" for="city-create-active">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">انصراف</button><button class="btn btn-primary">ثبت</button></div></form></div></div></div>
<?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="modal fade" id="cityEditModal-<?php echo e($city->id); ?>" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.cities.update', $city)); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">ویرایش شهر</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-12"><label class="form-label">نام شهر</label><input class="form-control" name="name" value="<?php echo e($city->name); ?>" required></div><div class="col-12"><label class="form-label">استان</label><input class="form-control" name="province" value="<?php echo e($city->province); ?>"></div><div class="col-12 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" <?php echo e($city->is_active ? 'checked' : ''); ?> id="city-edit-active-<?php echo e($city->id); ?>"><label class="form-check-label" for="city-edit-active-<?php echo e($city->id); ?>">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">بستن</button><button class="btn btn-primary">ذخیره</button></div></form></div></div></div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

<div class="modal fade" id="cargoCreateModal" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.cargo-items.store')); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">افزودن نوع کالا</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">کد</label><input class="form-control" name="code" required></div><div class="col-md-6"><label class="form-label">نام</label><input class="form-control" name="name" required></div><div class="col-md-6"><label class="form-label">واحد</label><input class="form-control" name="unit" value="ton" required></div><div class="col-md-6 d-flex gap-4 align-items-center pt-4"><div class="form-check"><input class="form-check-input" type="checkbox" name="is_hazardous" value="1" id="cargo-create-hazardous"><label class="form-check-label" for="cargo-create-hazardous">خطرناک</label></div><div class="form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" checked id="cargo-create-active"><label class="form-check-label" for="cargo-create-active">فعال</label></div></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">انصراف</button><button class="btn btn-primary">ثبت</button></div></form></div></div></div>
<?php $__currentLoopData = $cargoItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="modal fade" id="cargoEditModal-<?php echo e($item->id); ?>" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.cargo-items.update', $item)); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">ویرایش نوع کالا</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">کد</label><input class="form-control" name="code" value="<?php echo e($item->code); ?>" required></div><div class="col-md-6"><label class="form-label">نام</label><input class="form-control" name="name" value="<?php echo e($item->name); ?>" required></div><div class="col-md-6"><label class="form-label">واحد</label><input class="form-control" name="unit" value="<?php echo e($item->unit); ?>" required></div><div class="col-md-6 d-flex gap-4 align-items-center pt-4"><div class="form-check"><input class="form-check-input" type="checkbox" name="is_hazardous" value="1" <?php echo e($item->is_hazardous ? 'checked' : ''); ?> id="cargo-edit-hazardous-<?php echo e($item->id); ?>"><label class="form-check-label" for="cargo-edit-hazardous-<?php echo e($item->id); ?>">خطرناک</label></div><div class="form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" <?php echo e($item->is_active ? 'checked' : ''); ?> id="cargo-edit-active-<?php echo e($item->id); ?>"><label class="form-check-label" for="cargo-edit-active-<?php echo e($item->id); ?>">فعال</label></div></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">بستن</button><button class="btn btn-primary">ذخیره</button></div></form></div></div></div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

<div class="modal fade" id="fleetCreateModal" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.fleet-types.store')); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">افزودن نوع ناوگان</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">کد</label><input class="form-control" name="code" required></div><div class="col-md-6"><label class="form-label">نام</label><input class="form-control" name="name" required></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_refrigerated" value="1" id="fleet-create-refrigerated"><label class="form-check-label" for="fleet-create-refrigerated">یخچالی</label></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" checked id="fleet-create-active"><label class="form-check-label" for="fleet-create-active">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">انصراف</button><button class="btn btn-primary">ثبت</button></div></form></div></div></div>
<?php $__currentLoopData = $fleetTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $fleet): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="modal fade" id="fleetEditModal-<?php echo e($fleet->id); ?>" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.fleet-types.update', $fleet)); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">ویرایش نوع ناوگان</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">کد</label><input class="form-control" name="code" value="<?php echo e($fleet->code); ?>" required></div><div class="col-md-6"><label class="form-label">نام</label><input class="form-control" name="name" value="<?php echo e($fleet->name); ?>" required></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_refrigerated" value="1" <?php echo e($fleet->is_refrigerated ? 'checked' : ''); ?> id="fleet-edit-refrigerated-<?php echo e($fleet->id); ?>"><label class="form-check-label" for="fleet-edit-refrigerated-<?php echo e($fleet->id); ?>">یخچالی</label></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" <?php echo e($fleet->is_active ? 'checked' : ''); ?> id="fleet-edit-active-<?php echo e($fleet->id); ?>"><label class="form-check-label" for="fleet-edit-active-<?php echo e($fleet->id); ?>">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">بستن</button><button class="btn btn-primary">ذخیره</button></div></form></div></div></div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

<div class="modal fade" id="routeTypeCreateModal" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.route-types.store')); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">افزودن نوع مسیر</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">کد</label><input class="form-control" name="code" required></div><div class="col-md-6"><label class="form-label">نام</label><input class="form-control" name="name" required></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_mountainous" value="1" id="route-create-mountain"><label class="form-check-label" for="route-create-mountain">کوهستانی</label></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_hard_path" value="1" id="route-create-hard"><label class="form-check-label" for="route-create-hard">صعب‌العبور</label></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_international" value="1" id="route-create-international"><label class="form-check-label" for="route-create-international">بین‌المللی</label></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" checked id="route-create-active"><label class="form-check-label" for="route-create-active">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">انصراف</button><button class="btn btn-primary">ثبت</button></div></form></div></div></div>
<?php $__currentLoopData = $routeTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $routeType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="modal fade" id="routeTypeEditModal-<?php echo e($routeType->id); ?>" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.route-types.update', $routeType)); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">ویرایش نوع مسیر</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">کد</label><input class="form-control" name="code" value="<?php echo e($routeType->code); ?>" required></div><div class="col-md-6"><label class="form-label">نام</label><input class="form-control" name="name" value="<?php echo e($routeType->name); ?>" required></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_mountainous" value="1" <?php echo e($routeType->is_mountainous ? 'checked' : ''); ?> id="route-edit-mountain-<?php echo e($routeType->id); ?>"><label class="form-check-label" for="route-edit-mountain-<?php echo e($routeType->id); ?>">کوهستانی</label></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_hard_path" value="1" <?php echo e($routeType->is_hard_path ? 'checked' : ''); ?> id="route-edit-hard-<?php echo e($routeType->id); ?>"><label class="form-check-label" for="route-edit-hard-<?php echo e($routeType->id); ?>">صعب‌العبور</label></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_international" value="1" <?php echo e($routeType->is_international ? 'checked' : ''); ?> id="route-edit-international-<?php echo e($routeType->id); ?>"><label class="form-check-label" for="route-edit-international-<?php echo e($routeType->id); ?>">بین‌المللی</label></div><div class="col-md-6 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" <?php echo e($routeType->is_active ? 'checked' : ''); ?> id="route-edit-active-<?php echo e($routeType->id); ?>"><label class="form-check-label" for="route-edit-active-<?php echo e($routeType->id); ?>">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">بستن</button><button class="btn btn-primary">ذخیره</button></div></form></div></div></div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

<div class="modal fade" id="transportRouteCreateModal" tabindex="-1"><div class="modal-dialog modal-lg"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.transport-routes.store')); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">افزودن مسیر حمل</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">مبدا</label><select class="form-select" name="origin_city_id" required><?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($city->id); ?>"><?php echo e($city->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></div><div class="col-md-6"><label class="form-label">مقصد</label><select class="form-select" name="destination_city_id" required><?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($city->id); ?>"><?php echo e($city->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></div><div class="col-md-6"><label class="form-label">نوع مسیر</label><select class="form-select" name="route_type_id"><option value="">بدون نوع</option><?php $__currentLoopData = $routeTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $routeType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($routeType->id); ?>"><?php echo e($routeType->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></div><div class="col-md-6"><label class="form-label">مسافت</label><input type="number" step="0.01" min="0" class="form-control" name="distance_km" required></div><div class="col-12 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" checked id="transport-create-active"><label class="form-check-label" for="transport-create-active">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">انصراف</button><button class="btn btn-primary">ثبت</button></div></form></div></div></div>
<?php $__currentLoopData = $transportRoutes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $route): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="modal fade" id="transportRouteEditModal-<?php echo e($route->id); ?>" tabindex="-1"><div class="modal-dialog modal-lg"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.transport-routes.update', $route)); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">ویرایش مسیر حمل</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">مبدا</label><select class="form-select" name="origin_city_id" required><?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($city->id); ?>" <?php echo e($route->origin_city_id === $city->id ? 'selected' : ''); ?>><?php echo e($city->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></div><div class="col-md-6"><label class="form-label">مقصد</label><select class="form-select" name="destination_city_id" required><?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($city->id); ?>" <?php echo e($route->destination_city_id === $city->id ? 'selected' : ''); ?>><?php echo e($city->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></div><div class="col-md-6"><label class="form-label">نوع مسیر</label><select class="form-select" name="route_type_id"><option value="">بدون نوع</option><?php $__currentLoopData = $routeTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $routeType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($routeType->id); ?>" <?php echo e($route->route_type_id === $routeType->id ? 'selected' : ''); ?>><?php echo e($routeType->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select></div><div class="col-md-6"><label class="form-label">مسافت</label><input type="number" step="0.01" min="0" class="form-control" name="distance_km" value="<?php echo e($route->distance_km); ?>" required></div><div class="col-12 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" <?php echo e($route->is_active ? 'checked' : ''); ?> id="transport-edit-active-<?php echo e($route->id); ?>"><label class="form-check-label" for="transport-edit-active-<?php echo e($route->id); ?>">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">بستن</button><button class="btn btn-primary">ذخیره</button></div></form></div></div></div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

<div class="modal fade" id="financialCoefficientCreateModal" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.financial-coefficients.store')); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">افزودن ضریب مالی</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">گروه</label><input class="form-control" name="coefficient_group" required></div><div class="col-md-6"><label class="form-label">کد</label><input class="form-control" name="code" required></div><div class="col-12"><label class="form-label">عنوان</label><input class="form-control" name="title" required></div><div class="col-md-6"><label class="form-label">مقدار</label><input type="number" step="0.0001" min="0" class="form-control" name="value" value="1" required></div><div class="col-md-6"><label class="form-label">ترتیب</label><input type="number" min="0" class="form-control" name="sort_order" value="0"></div><div class="col-12 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" checked id="coefficient-create-active"><label class="form-check-label" for="coefficient-create-active">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">انصراف</button><button class="btn btn-primary">ثبت</button></div></form></div></div></div>
<?php $__currentLoopData = $financialCoefficients; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $coefficient): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="modal fade" id="financialCoefficientEditModal-<?php echo e($coefficient->id); ?>" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.financial-coefficients.update', $coefficient)); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">ویرایش ضریب مالی</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">گروه</label><input class="form-control" name="coefficient_group" value="<?php echo e($coefficient->coefficient_group); ?>" required></div><div class="col-md-6"><label class="form-label">کد</label><input class="form-control" name="code" value="<?php echo e($coefficient->code); ?>" required></div><div class="col-12"><label class="form-label">عنوان</label><input class="form-control" name="title" value="<?php echo e($coefficient->title); ?>" required></div><div class="col-md-6"><label class="form-label">مقدار</label><input type="number" step="0.0001" min="0" class="form-control" name="value" value="<?php echo e($coefficient->value); ?>" required></div><div class="col-md-6"><label class="form-label">ترتیب</label><input type="number" min="0" class="form-control" name="sort_order" value="<?php echo e($coefficient->sort_order); ?>"></div><div class="col-12 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" <?php echo e($coefficient->is_active ? 'checked' : ''); ?> id="coefficient-edit-active-<?php echo e($coefficient->id); ?>"><label class="form-check-label" for="coefficient-edit-active-<?php echo e($coefficient->id); ?>">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">بستن</button><button class="btn btn-primary">ذخیره</button></div></form></div></div></div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

<div class="modal fade" id="financialItemCreateModal" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.financial-items.store')); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">افزودن قلم مالی</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">کد</label><input class="form-control" name="code" required></div><div class="col-md-6"><label class="form-label">عنوان</label><input class="form-control" name="title" required></div><div class="col-md-6"><label class="form-label">نوع مقدار</label><select class="form-select" name="value_type" required><option value="fixed">fixed</option><option value="percent">percent</option></select></div><div class="col-md-6"><label class="form-label">مقدار</label><input type="number" step="0.0001" min="0" class="form-control" name="value" value="0" required></div><div class="col-12 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" checked id="financial-item-create-active"><label class="form-check-label" for="financial-item-create-active">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">انصراف</button><button class="btn btn-primary">ثبت</button></div></form></div></div></div>
<?php $__currentLoopData = $financialItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="modal fade" id="financialItemEditModal-<?php echo e($item->id); ?>" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><form method="POST" action="<?php echo e(route('admin.master-data.financial-items.update', $item)); ?>"><?php echo csrf_field(); ?><div class="modal-header"><h5 class="modal-title">ویرایش قلم مالی</h5><button type="button" class="btn-close" data-bs-dismiss="modal"></button></div><div class="modal-body row g-3"><div class="col-md-6"><label class="form-label">کد</label><input class="form-control" name="code" value="<?php echo e($item->code); ?>" required></div><div class="col-md-6"><label class="form-label">عنوان</label><input class="form-control" name="title" value="<?php echo e($item->title); ?>" required></div><div class="col-md-6"><label class="form-label">نوع مقدار</label><select class="form-select" name="value_type" required><option value="fixed" <?php echo e($item->value_type === 'fixed' ? 'selected' : ''); ?>>fixed</option><option value="percent" <?php echo e($item->value_type === 'percent' ? 'selected' : ''); ?>>percent</option></select></div><div class="col-md-6"><label class="form-label">مقدار</label><input type="number" step="0.0001" min="0" class="form-control" name="value" value="<?php echo e($item->value); ?>" required></div><div class="col-12 form-check"><input class="form-check-input" type="checkbox" name="is_active" value="1" <?php echo e($item->is_active ? 'checked' : ''); ?> id="financial-item-edit-active-<?php echo e($item->id); ?>"><label class="form-check-label" for="financial-item-edit-active-<?php echo e($item->id); ?>">فعال</label></div></div><div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">بستن</button><button class="btn btn-primary">ذخیره</button></div></form></div></div></div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH S:\wamp\www\sabok\temp-laravel\resources\views/admin/master-data/index.blade.php ENDPATH**/ ?>