<?php $__env->startSection('small_title'); ?>
Sub Menu
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
                <div class="page-content">
                    <div class="container-fluid">
                        <!-- start عنوان صحفه -->
                        <div class="row">
                            <div class="col-12">
                                <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                                    <div style="margin-right: 50px;display: inline;width: 100px; ">
                                        <label>
                                        <input type="radio" name="menu"  onclick="openNewPage()">
                                         New Page
                                      </label>
                                    </div>

                                    <div style="margin-right: 20px;display: inline; width: 100px ">
                                        <label>


                                        <input type="radio" name="menu"  onclick="openCurrentPage()">
                                       Available Page
                                      </label>

                                    </div>


                                    <div class="page-title-right">
                                        <ol class="breadcrumb m-0">
                                            <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard.index')); ?>"> Dashboard</a></li>
                                            <li class="breadcrumb-item active"> Sub Menu </li>
                                        </ol>
                                    </div>

                                </div>
                            </div>
                            <?php if(Session::has('message')): ?>
<div class="alert alert-info"><?php echo e(Session::get('message')); ?></div>

<?php endif; ?>
                        </div>
                        <!-- end عنوان صحفه -->

                        
<div id="newPage" style="display:none">
    <hr>

    <form method="post" action="<?php echo e(route('submenus.store')); ?>" enctype="multipart/form-data">
		<?php echo csrf_field(); ?>
        <input type="hidden" value="page" name="sub_resource_id">
        <input type="hidden" value="page" name="sub_resource_type">
        <input type="hidden" value="pages.show" name="sub_route_name">
        <input type="hidden" value="<?php echo e($menu); ?>" name="menu_id">
		<div class="col-lg-12">
        <div class="row">


       <div class="col-md-6">
		<h6 class="m-0 font-weight-bold text-primary pull-left" >Name (English) </h6>
		<hr>

		<div class="input-group" style="margin-top: 15px;">
			<input type="text" required  value="<?php echo e(old("sub_menu_name")); ?>" name="sub_menu_name" class="form-control" placeholder="">
			<?php $__errorArgs = ['sub_menu_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
			<span class="alert-danger"><?php echo e($message); ?></span>
			<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
		</div>
       </div>

        <div class="col-md-6">
		<h6 class="m-0 font-weight-bold text-primary pull-left" >Name (Dari) </h6>
		<hr>

		<div class="input-group" style="margin-top: 15px;">
			<input type="text" required  value="<?php echo e(old("da_sub_menu_name")); ?>" name="da_sub_menu_name" class="form-control" placeholder="">
			<?php $__errorArgs = ['da_sub_menu_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
			<span class="alert-danger"><?php echo e($message); ?></span>
			<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
		</div>
       </div>

        <div class="col-md-6">
		<h6 class="m-0 font-weight-bold text-primary pull-left" >Name (Pashto) </h6>
		<hr>
		<div class="input-group" style="margin-top: 15px;">
			<input type="text" required  value="<?php echo e(old("pa_sub_menu_name")); ?>" name="pa_sub_menu_name" class="form-control" placeholder="">
			<?php $__errorArgs = ['pa_sub_menu_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
			<span class="alert-danger"><?php echo e($message); ?></span>
			<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
		</div>
       </div>
			<input type="hidden"   min="1" value="<?php echo e($subMenuOrder); ?>" name="sub_menu_order" class="form-control" placeholder="">
       </div>
       <br>
       <br>
       <br>


                                    <h6 class="m-0 font-weight-bold text-primary pull-left" >Title (English)</h6>
                                <hr>
                                <div class="input-group" style="margin-top: 15px;">
                                    <input type="text" required value="<?php echo e(old('title')); ?>" name="title" class="form-control" placeholder="">
                                    <?php $__errorArgs = ['title'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="alert-danger"><?php echo e($message); ?></span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                                <br>

                           <h6 class="m-0 font-weight-bold text-primary pull-left" >Title (Dari)</h6>
                                <hr>
                                <div class="input-group" style="margin-top: 15px;">
                                    <input type="text" style="direction: rtl"  value="<?php echo e(old('da_title')); ?>" name="da_title" class="form-control" placeholder="">
                                    <?php $__errorArgs = ['da_title'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="alert-danger"><?php echo e($message); ?></span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                                <br>

                                  <h6 class="m-0 font-weight-bold text-primary pull-left" >Title (Pashto)</h6>
                                <hr>
                                <div class="input-group" style="margin-top: 15px;">
                                    <input type="text" style="direction: rtl"  value="<?php echo e(old('pa_title')); ?>" name="pa_title" class="form-control" placeholder="">
                                    <?php $__errorArgs = ['pa_title'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="alert-danger"><?php echo e($message); ?></span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                                <br>



                                <h6 class="m-0 font-weight-bold text-primary pull-left" >Description (English)</h6>
                                <hr>

                                <div class="input-group" style="margin-top: 15px;">
                                    <textarea name="description" id="summary-ckeditor" cols="30" rows="8" class="form-control">
                                          <?php echo old('description'); ?>

                                    </textarea>
                                    <?php $__errorArgs = ['description'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="alert-danger"><?php echo e($message); ?></span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                                <br>

                                  <h6 class="m-0 font-weight-bold text-primary pull-left" >Description (Dari)</h6>
                                <hr>

                                <div class="input-group" style="margin-top: 15px;">
                                    <textarea name="da_description" id="summary-ckeditor_da" cols="30" rows="8" class="form-control">
                                          <?php echo old('da_description'); ?>

                                    </textarea>
                                    <?php $__errorArgs = ['da_description'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="alert-danger"><?php echo e($message); ?></span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                                <br>
                                  <h6 class="m-0 font-weight-bold text-primary pull-left" >Description (Pashto)</h6>
                                <hr>

                                <div class="input-group" style="margin-top: 15px;">
                                    <textarea name="pa_description" id="summary-ckeditor_pa" cols="30" rows="8" class="form-control">
                                          <?php echo old('pa_description'); ?>

                                    </textarea>
                                    <?php $__errorArgs = ['pa_description'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="alert-danger"><?php echo e($message); ?></span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                                <br>

                                <h6 class="m-0 font-weight-bold text-primary pull-left" >Image</h6>
                                <hr>
                                <div class="fileinput fileinput-new"data-provides="fileinput">
                                    <div class="fileinput-new img-thumbnail" style="width: 150px; height: 150px;">
                                        <img src="http://via.placeholder.com/"  alt="...">
                                    </div>
                                    <div class="fileinput-preview fileinput-exists img-thumbnail" style="max-width: 150px; max-height: 150px;"></div>
                                    <div class="mt-2">
                                        <span class="btn btn-outline-secondary btn-file"><span class="fileinput-new">Select Image </span><span class="fileinput-exists">Edit</span><input type="file" name="image"></span>
                                        <a href="#" class="btn btn-outline-secondary fileinput-exists"  data-dismiss="fileinput">Delete</a>
                                    </div>
                                    <?php $__errorArgs = ['image'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class="alert-danger"><?php echo e($message); ?></span>
                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                </div>
                                <br>




	</div>

		<input type="submit" value=" Save" class="btn btn-secondary">


	</form>


  </div>



  

  <div id="currentPage" style="display: none">
    <hr>
    <form method="post" action="<?php echo e(route('submenus.store')); ?>" enctype="multipart/form-data">
		<?php echo csrf_field(); ?>
        <input type="hidden" value="<?php echo e($menu); ?>" name="menu_id">
		<div class="col-lg-12">
        <div class="row">

             <div class="col-md-6">
		<h6 class="m-0 font-weight-bold text-primary pull-left" >Name (English) </h6>
		<hr>

		<div class="input-group" style="margin-top: 15px;">
			<input type="text" required  value="<?php echo e(old("sub_menu_name")); ?>" name="sub_menu_name" class="form-control" placeholder="">
			<?php $__errorArgs = ['sub_menu_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
			<span class="alert-danger"><?php echo e($message); ?></span>
			<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
		</div>
       </div>

        <div class="col-md-6">
		<h6 class="m-0 font-weight-bold text-primary pull-left" >Name (Dari) </h6>
		<hr>

		<div class="input-group" style="margin-top: 15px;">
			<input type="text" required  value="<?php echo e(old("da_sub_menu_name")); ?>" name="da_sub_menu_name" class="form-control" placeholder="">
			<?php $__errorArgs = ['da_sub_menu_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
			<span class="alert-danger"><?php echo e($message); ?></span>
			<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
		</div>
       </div>

        <div class="col-md-6">
		<h6 class="m-0 font-weight-bold text-primary pull-left" >Name (Pashto) </h6>
		<hr>
		<div class="input-group" style="margin-top: 15px;">
			<input type="text" required  value="<?php echo e(old("pa_sub_menu_name")); ?>" name="pa_sub_menu_name" class="form-control" placeholder="">
			<?php $__errorArgs = ['pa_sub_menu_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
			<span class="alert-danger"><?php echo e($message); ?></span>
			<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
		</div>
       </div>
			<input type="hidden"   min="1" value="<?php echo e($subMenuOrder); ?>" name="sub_menu_order" class="form-control" placeholder="">
       </div>


   </div>
       <br>
       <br>

 <div class="row">

       <div class="col-md-6">
		<h6 class="m-0 font-weight-bold text-primary pull-left" >Page </h6>
		<hr>

		<div class="input-group" style="margin-top: 15px;">
             <select name="sub_route_name" class="form-control">
                <option value="">__Select__</option>
                <?php $__currentLoopData = $pages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                 <option <?php if(old('sub_route_name')===$value): ?> <?php echo e("selected"); ?> <?php endif; ?> value="<?php echo e($value); ?>"><?php echo e($key); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
             </select>

			<?php $__errorArgs = ['sub_route_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
			<span class="alert-danger"><?php echo e($message); ?></span>
			<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
		</div>
       </div>
       <div class="col-md-6">

       </div>

	</div>
    <br>
    <br>
    <br>




		<input type="submit" value="Save" class=" btn btn-secondary">


	</form>

  </div>









</div>







</div>
<!-- container-fluid -->
</div>
<!-- End Page-content -->



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




<?php $__env->startSection('script'); ?>
<script>
       CKEDITOR.replace( 'summary-ckeditor');
    CKEDITOR.replace( 'summary-ckeditor_da', {
    contentsLangDirection: 'rtl'
} );

   CKEDITOR.replace( 'summary-ckeditor_pa', {
    contentsLangDirection: 'rtl'
} );
</script>

<script>
  function openCurrentPage(){

       let newPage = document.getElementById("newPage");
       let currentPage = document.getElementById('currentPage');
       let subMenuLabel = document.getElementById("subMenuLabel");
      newPage.style.display = 'none';
      currentPage.style.display = 'block';
      subMenuLabel.style.display = 'none';

    }

  function  openNewPage(){
        let newPage = document.getElementById("newPage");
       let currentPage = document.getElementById('currentPage');
       let subMenuLabel = document.getElementById("subMenuLabel");
      newPage.style.display = 'block';
      currentPage.style.display = 'none';
      subMenuLabel.style.display = 'none';

    }

    function openMenuLabel(){

        let newPage = document.getElementById("newPage");
       let currentPage = document.getElementById('currentPage');
       let subMenuLabel = document.getElementById("subMenuLabel");

      newPage.style.display = 'none';

      currentPage.style.display = 'none';
      subMenuLabel.style.display = 'block';


    }

    </script>

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

<?php echo $__env->make('Admin.master_page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\xampp\htdocs\2025\laravel\MAMI\resources\views/Admin/submenu/create.blade.php ENDPATH**/ ?>