<?php $__env->startSection('css_page_level'); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-content'); ?>
            <!-- CONTENT -->
            <div class="wrap-fluid" id="paper-bg">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="box">
                            <div class="box-header">
                                <!-- tools box -->
                                <div class="pull-right box-tools">
                                </div>
                                <h3 class="box-title"><i class="fontello-doc"></i>
                                    <span>大樓規章</span>
                                    <span><?php echo e($title); ?></span>
                                </h3>
                            </div>
                            <!-- /.box-header -->
                            <div class="box-body">
                                <div class="box-body table-responsive no-padding">
                                   <form method="GET" action="">
                                    <?php echo csrf_field(); ?>

                                    <?php /*文件資料夾選項  */ ?>
                                    <select  class="form-control" name="about_name" id="about_name">
                                        <option value="">請選擇</option>
                                        <?php foreach($aboutus_columns as $one): ?>
                                        <option value=<?php echo e($one->id); ?>><?php echo e($one->name); ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                   </form>
                                </div>
                                <!-- /.box-body -->
                            </div>
                            <div class="box-body table-responsive">
                                <table class="table table-hover">
                                    <tbody>
                                        <tr>
                                            <th>文件名稱</th>
                                            <th>發布單位</th>
                                            <th>時間</th>
                                        </tr>
                                        <?php foreach($aboutus_files as $file): ?>
                                        <tr>
                                            <td>
                                                <a href="<?php echo e(call_user_func($update_url, $file->file)); ?>"><?php echo e($file->title); ?></a>
                                            </td>                                         
                                            <td><?php echo e($file->author); ?></td>
                                            <td><?php echo e($file->created_at); ?></td>
                                        </tr>
                                        <?php endforeach; ?>
                                    </tbody>
                                </table>
                             
                            </div>
                            <!-- 显示分页链接 -->
                            <?php echo $aboutus_files->render(); ?>


                            <!-- /.box-body -->
                        </div>
                        <!-- /.box -->
                    </div>
                </div>


            </div>
            <!-- #/paper bg -->
            <?php $__env->stopSection(); ?>
<!-- Include jQuery from a CDN -->
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script>
    $(document).ready(function () {
        // When the about_name dropdown changes
        $('#about_name').on('change', function () {
            // Get the selected folder_id
            var folderId = $(this).val();
            var title = $(this).find('option:selected').text();
            
            // Construct the new URL with the selected folder_id
            var newUrl = '<?php echo e(route('website::building_regulations')); ?>'+'?about_name=' + folderId+'&title='+title;            
            // alert(newUrl);
            // Redirect the browser to the new URL
            window.location.href = newUrl;
        });
    });
</script>
<?php echo $__env->make('layout.front', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>