


<?php $__env->startSection('content'); ?>

<?php if(session('project_update_msg')): ?>
<div class="alert alert-success">
    <?php echo e(session('project_update_msg')); ?>

</div>

<?php endif; ?>

<?php echo Form::model($project, ['method' => 'PATCH', 'route' => ['admin.projects.update', $project->id], 'files' => true]); ?>

<div class="row">
    <div class="col-md-12">
        <div class="card shadow mb-4">
            <div class="card-header py-3">
                <h6 class="m-0 font-weight-bold text-primary"><?php echo e(awtTrans('Update Project')); ?></h6>
            </div>
            <div class="card-body">

                <div class="row">


                    <div class="form-group col-md-6">
                        <?php echo Form::label('title_en', awtTrans('Title English')); ?>

                        <?php echo Form::text('title_en', null, ['class' => $errors->has('title_en') ? 'form-control is-invalid' : 'form-control', 'placeholder'=>'']); ?>

                        <small class="text-danger"><?php echo e($errors->first('title_en')); ?></small>
                    </div>

                    <div class="form-group col-md-6">
                        <?php echo Form::label('title_ar', awtTrans('Title Arabic')); ?>

                        <?php echo Form::text('title_ar', null, ['class' => $errors->has('title_ar') ? 'form-control is-invalid' : 'form-control', 'placeholder'=>'']); ?>

                        <small class="text-danger"><?php echo e($errors->first('title_ar')); ?></small>
                    </div>

                </div>

                <div class="row">

                    <div class="form-group col-lg-6">
                        <?php echo Form::label('customer_id', awtTrans('Customers')); ?>

                        <?php echo Form::select('customer_id', [''=>awtTrans('Choose Customer'),] + $customers, null, ['class' => 'form-control']); ?>

                        <small class="text-danger"><?php echo e($errors->first('customer_id')); ?></small>
                    </div>


                    <div class="form-group col-md-6">
                        <?php echo Form::label('address', awtTrans('Address')); ?>

                        <?php echo Form::text('address', null, ['class' => $errors->has('address') ? 'form-control is-invalid' : 'form-control', 'placeholder'=>'']); ?>

                        <small class="text-danger"><?php echo e($errors->first('address')); ?></small>
                    </div>
                </div>

                <div class="row">


                    <div class="form-group col-lg-6">
                        <?php echo Form::label('desc_en', awtTrans('Description English')); ?>

                        <?php echo Form::textarea('desc_en', null, [ 'class' => 'form-control tinyEditor']); ?>

                        <small class="text-danger"><?php echo e($errors->first('desc_en')); ?></small>
                    </div>


                    <div class="form-group col-lg-6">
                        <?php echo Form::label('desc_ar', awtTrans('Description Arabic')); ?>

                        <?php echo Form::textarea('desc_ar', null, [ 'class' => 'form-control tinyEditor']); ?>

                        <small class="text-danger"><?php echo e($errors->first('desc_ar')); ?></small>
                    </div>

                </div>

                <div class="row">

                    <div class="form-group col-md-6">
                        <?php echo Form::label('completion_date', awtTrans('Complation Date')); ?>

                        <input type="date" name="completion_date" id="completion_date" value="<?php echo e($project->completion_date->format('Y-m-d')); ?>" class="form-control">
                    </div>

                    <div class="form-group col-lg-6">
                        <?php echo Form::label('company_id', awtTrans('Companies')); ?>

                        <?php echo Form::select('company_id', [''=>awtTrans('Choose company'),] + $companies, null, ['class' => 'form-control']); ?>

                        <small class="text-danger"><?php echo e($errors->first('company_id')); ?></small>
                    </div>

                </div>

                <div class="row">

                    <div class="form-group col-lg-12">
                        <?php echo Form::label('photo', awtTrans('الصورة')); ?>

                        <div class="input-group">
                            <span class="input-group-btn">
                                <a data-input="photo" data-preview="photo" class="lfm btn btn-secondary text-white px-4" style="border-top-right-radius: 0;border-bottom-right-radius: 0;border-top-left-radius: 0;border-bottom-left-radius: 0;">
                                    <i class="fa fa-picture-o"></i> <?php echo e(awtTrans('اختر الصورة')); ?>

                                </a>
                            </span>
                            <?php echo Form::text('photo', null, ['class' => $errors->has('photo') ? 'form-control is-invalid photo' : 'form-control photo' , 'readonly' => 'readonly']); ?>

                        </div>
                        <div class="mb-3 mt-3 d-block  photo" id="holder">
                            <img width="100" src="<?php echo e($project->photo); ?>" alt="">
                        </div>
                        <small class="text-danger"><?php echo e($errors->first('photo')); ?></small>
                    </div>
                </div>

                <div class="row">

                    <div class="form-group col-lg-12">
                        <?php echo Form::label('images', awtTrans('Choose Images')); ?>

                        <div class="input-group">
                            <span class="input-group-btn">
                                <a data-input="images" data-preview="images" class="lfm btn btn-secondary text-white px-4" style="border-top-right-radius: 0;border-bottom-right-radius: 0;border-top-left-radius: 0;border-bottom-left-radius: 0;">
                                    <i class="fa fa-picture-o"></i> <?php echo e(awtTrans('اختر الصورة')); ?>

                                </a>
                            </span>
                            <input type="text" name="images" class="<?php echo e($errors->has('images') ? 'form-control is-invalid images' : 'form-control images'); ?>" id="images" value="<?php $__currentLoopData = $project->images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php echo e($image->image); ?>,<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>">
                        </div>
                        <div class="mb-3 mt-3 d-block images" id="holder">
                            <?php $__currentLoopData = $project->images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <img src="<?php echo e($image->image); ?>" width="70px" alt="">
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                        <small class="text-danger"><?php echo e($errors->first('images')); ?></small>
                    </div>
                </div>


                <div class="row">

                    <div class="form-group col-lg-12">
                        <button type="button" class="btn btn-info btn-block" id="add-keyword"><i class="fas fa-plus"></i></button>
                    </div>
                </div>

                <div class="row" id="append-keyword">

                    <?php if($project->keywords->isNotEmpty()): ?>
                    <?php $__currentLoopData = $project->keywords; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $keyword): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if($key == 0): ?>

                    <div class="row col-lg-12">


                        <div class="form-group col-lg-5">
                            <lable for="keyword_ar">الكلمات المفتاحية بالعربي</lable>
                            <input type="text" name="keyword_ar[]" value="<?php echo e($keyword->body_ar); ?>" class="form-control" />
                        </div>

                        <div class="form-group col-lg-5">
                            <lable for="keyword_en">الكلمات المفتاحية بالانجليزي</lable>
                            <input type="text" name="keyword_en[]" value="<?php echo e($keyword->body_en); ?>" class="form-control" />
                        </div>


                    </div>

                    <?php else: ?>

                    <div class="row col-lg-12">


                        <div class="form-group col-lg-5">
                            <lable for="keyword_ar">الكلمات المفتاحية بالعربي</lable>
                            <input type="text" name="keyword_ar[]" value="<?php echo e($keyword->body_ar); ?>" class="form-control" />
                        </div>

                        <div class="form-group col-lg-5">
                            <lable for="keyword_en">الكلمات المفتاحية بالانجليزي</lable>
                            <input type="text" name="keyword_en[]" value="<?php echo e($keyword->body_en); ?>" class="form-control" />
                        </div>

                        <div class="form-group col-lg-2">
                            <lable for="keyword_en">حذف</lable>
                            <button type="button" class="btn btn-danger btn-block" id="delete-keyword"><i class="fas fa-trash"></i></button>
                        </div>

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

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


<?php echo Form::submit(awtTrans('Update Project'), ['class' => 'btn btn-success']); ?>

<a href="<?php echo e(route('admin.projects.index')); ?>" class="btn btn-primary "><i class="fas fa-arrow-left  fa-sm  "></i><?php echo e(awtTrans('Back')); ?></a>

<?php echo Form::close(); ?>


<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\jaadara\Projects from 10-2022\betan-back\resources\views/admin/projects/edit.blade.php ENDPATH**/ ?>