

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

<div class="container mt-5">
<div class="card shadow p-4">

<h3 class="mb-4 text-center text-primary">Edit Journalist Application</h3>

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

<form method="POST"
      action="<?php echo e(route('application.update', $application->id)); ?>"
      enctype="multipart/form-data">

<?php echo csrf_field(); ?>


<div class="row">



<div class="col-md-6 mb-3">
<label class="form-label">Full Name</label>
<input type="text" name="full_name"
value="<?php echo e($application->full_name); ?>"
class="form-control" required>
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Father Name</label>
<input type="text" name="father_name"
value="<?php echo e($application->father_name); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Mother Name</label>
<input type="text" name="mother_name"
value="<?php echo e($application->mother_name); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Date of Birth</label>
<input type="date" name="dob"
value="<?php echo e($application->dob); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Gender</label>
<select name="gender" class="form-select">
<option value="">Select</option>
<option value="Male" <?php echo e($application->gender=='Male'?'selected':''); ?>>Male</option>
<option value="Female" <?php echo e($application->gender=='Female'?'selected':''); ?>>Female</option>
<option value="Other" <?php echo e($application->gender=='Other'?'selected':''); ?>>Other</option>
</select>
</div>

<div class="col-md-6 mb-3">
<label class="form-label">NID</label>
<input type="text" name="nid"
value="<?php echo e($application->nid); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Mobile</label>
<input type="text" name="mobile"
value="<?php echo e($application->mobile); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Email</label>
<input type="email" name="email"
value="<?php echo e($application->email); ?>"
class="form-control">
</div>



<div class="col-md-6 mb-3">
<label class="form-label">Present Address</label>
<textarea name="present_address"
class="form-control"><?php echo e($application->present_address); ?></textarea>
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Permanent Address</label>
<textarea name="permanent_address"
class="form-control"><?php echo e($application->permanent_address); ?></textarea>
</div>

<div class="col-md-6 mb-3">
<label class="form-label">District</label>
<input type="text" name="district"
value="<?php echo e($application->district); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Division</label>
<input type="text" name="division"
value="<?php echo e($application->division); ?>"
class="form-control">
</div>



<div class="col-md-6 mb-3">
<label class="form-label">Education</label>
<input type="text" name="education"
value="<?php echo e($application->education); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">University</label>
<input type="text" name="university"
value="<?php echo e($application->university); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Graduation Year</label>
<input type="text" name="graduation_year"
value="<?php echo e($application->graduation_year); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Experience</label>
<textarea name="experience"
class="form-control"><?php echo e($application->experience); ?></textarea>
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Current Profession</label>
<input type="text" name="current_profession"
value="<?php echo e($application->current_profession); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Previous Media</label>
<input type="text" name="previous_media"
value="<?php echo e($application->previous_media); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Reporting Category</label>
<input type="text" name="reporting_category"
value="<?php echo e($application->reporting_category); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Working Area</label>
<input type="text" name="working_area"
value="<?php echo e($application->working_area); ?>"
class="form-control">
</div>



<div class="col-md-6 mb-3">
<label class="form-label">Portfolio Link</label>
<input type="url" name="portfolio_link"
value="<?php echo e($application->portfolio_link); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Facebook Link</label>
<input type="url" name="facebook_link"
value="<?php echo e($application->facebook_link); ?>"
class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">YouTube Link</label>
<input type="url" name="youtube_link"
value="<?php echo e($application->youtube_link); ?>"
class="form-control">
</div>
</div>



<!-- =======================================  -->




<div class="row mt-3">


<div class="col-md-4 mb-3">
    <label class="form-label">CV (PDF)</label>

    <?php if(!empty($application->cv_file)): ?>
    <?php
      $cvUrl = 'https://bdcrimewatch.com/storage/app/public/' . ltrim($application->cv_file, '/');
      ?>
        <div class="mb-2">
            <a href="<?php echo e($cvUrl); ?>"
               target="_blank"
               class="btn btn-sm btn-info">
               View Current
            </a>
        </div>
    <?php endif; ?>

    <input type="file" name="cv_file" class="form-control">
</div>



<div class="col-md-4 mb-3">
    <label class="form-label">Photo</label>

    <?php if(!empty($application->photo)): ?>
        <?php
        $extension = strtolower(pathinfo($application->photo, PATHINFO_EXTENSION));
        $imageExtensions = ['jpg','jpeg','png','webp'];
        $photoUrl = 'https://bdcrimewatch.com/storage/app/public/' . ltrim($application->photo, '/');
    ?>

        <div class="mb-2">
            <?php if(in_array($extension, $imageExtensions)): ?>
                <img src="<?php echo e($photoUrl); ?>"
                     width="100"
                     class="img-thumbnail">
            <?php else: ?>
                <a href="<?php echo e($photoUrl); ?>"
                   target="_blank"
                   class="btn btn-primary btn-sm">
                   Open File
                </a>
            <?php endif; ?>
        </div>
    <?php endif; ?>

    <input type="file" name="photo" class="form-control">
</div>



<div class="col-md-4 mb-3">
    <label class="form-label">NID Copy</label>

    <?php if(!empty($application->nid_copy)): ?>
          <?php
        $nidUrl = 'https://bdcrimewatch.com/storage/app/public/' . ltrim($application->nid_copy, '/');
    ?>
       

        <div class="mb-2">
            <?php if(str_contains($application->nid_copy, '.pdf')): ?>
                <a href="<?php echo e($nidUrl); ?>"
                   target="_blank"
                   class="btn btn-danger btn-sm">
                   📄 View PDF
                </a>
            <?php else: ?>
                <img src="<?php echo e($nidUrl); ?>"
                     width="100"
                     class="img-thumbnail">
            <?php endif; ?>
        </div>
    <?php endif; ?>

    <input type="file" name="nid_copy" class="form-control">
</div>

</div>

<!-- ==============================================  -->





<div class="col-12 mt-3">
<button type="submit" class="btn btn-dark px-4">
Update Application
</button>
</div>

</div>

</form>

</div>
</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.front', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/dhakasupplier/bdcrimewatch.com/resources/views/application/edit.blade.php ENDPATH**/ ?>