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

        <div  class="page-wrapper">
            <!-- ============================================================== -->
            <!-- Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <div class="page-breadcrumb border-bottom">
                <div class="row">
                    <div class="col-lg-3 col-md-4 col-xs-12 align-self-center">
                        <h5 class="font-medium  mb-0">Liste des activités</h5>
                    </div>
                    <div class="col-lg-9 col-md-8 col-xs-12 align-self-center">
                        <!--button class="btn btn-danger text-white float-right ml-3 d-none d-md-block">Buy Ample En cours</button-->
                        <nav aria-label="breadcrumb" class="mt-2 float-md-right float-left">
                            <ol class="breadcrumb mb-0 justify-content-end p-0">
                                <li class="breadcrumb-item"><a href="#"><?php echo e($project->name); ?></a></li>
                                <li class="breadcrumb-item active" aria-current="page">Admin</li>
                            </ol>
                        </nav>
                    </div>
                </div>
            </div>
            <!-- ============================================================== -->
            <!-- End Container fluid  -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- footer -->
            <!-- ============================================================== -->

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

<?php $__env->startSection('content'); ?>
<div class="page-content container-fluid">
        <div class="row">
            <div class="col-lg-12">
                <div class="card bg-white text-black rounded-lg">
                    <div class="card-body">
                        <div class="d-flex no-block align-items-center">
                            <div class="w-100 ml-3 mt-2 mb-0">
                                <div class="d-flex w-100 align-items-center justify-content-between">
                                    <h4 class="font-bold">Nom : <?php echo e($project->name); ?></h4>
                                    <div class="d-flex align-items-center ml-3">
                                        <div class="p-2 p-lg-3 ml-auto">
                                            <div class="p-lg-3 p-2">
                                                <div class="d-flex align-items-center">
                                                    <button class="btn btn-circle btn-cyan text-white btn-lg" href="javascript:void(0)">
                                                        <i class="mdi mdi-calendar-check"></i>
                                                    </button>
                                                    <div class="ml-4">
                                                        <h5 class="font-bold">Date de début</h5>
                                                        <span class="h3 text-primary">
                                                            <?php echo e(date('d/m/Y H:i', strtotime($project->start_date))); ?>

                                                        </span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="p-2 p-lg-3 ml-auto">
                                            <div class="p-lg-3 p-2">
                                                <div class="d-flex align-items-center">
                                                    <button class="btn btn-circle btn-cyan text-white btn-lg" href="javascript:void(0)">
                                                        <i class="mdi mdi-calendar-clock"></i>
                                                    </button>
                                                    <div class="ml-4">
                                                        <h5 class="font-bold">Date limite</h5>
                                                        <span class="h3 text-danger">
                                                            <?php echo e(date('d/m/Y H:i', strtotime($project->end_date))); ?>

                                                        </span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="p-2 p-lg-3 ml-auto">
                                            <div class="p-lg-3 p-2">
                                                <div class="d-flex align-items-center">
                                                    <button class="btn btn-circle btn-cyan text-white btn-lg" href="javascript:void(0)">
                                                        <i class="ti-stats-up"></i>
                                                    </button>
                                                    <div class="ml-4" style="width: 150px;">
                                                        <h4 class="font-light">Evolution</h4>
                                                        <div class="progress">
                                                            <div class="progress-bar bg-cyan" role="progressbar" style="width: <?php echo e($project->percentage); ?>%" aria-valuenow="40" aria-valuemin="0" aria-valuemax="40"></div>
                                                        </div>
                                                    </div>
                                                    <div class="ml-5">
                                                        <h2 class="display-7 mb-0"><?php echo e($project->percentage); ?>%</h2>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <p class="">Description : <?php echo e($project->description); ?></p>
                                <!-- Associer un utilisateur au projet début -->
                                
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
        </div>

        <ul class="nav nav-pills p-3 bg-white mb-1 rounded-pill align-items-center">
            <li class="nav-item"> <a href="javascript:void(0)" class="nav-link rounded-pill note-link d-flex align-items-center active px-2 px-md-3 mr-0 mr-md-2"  id="all-category">
                <i class="icon-layers mr-1"></i><span class="d-none d-md-block">Toutes les activités</span></a>
            </li>
            <li class="nav-item"> <a href="javascript:void(0)" class="nav-link rounded-pill note-link d-flex align-items-center px-2 px-md-3 mr-0 mr-md-2" id="note-business">
                <i class="icon-check mr-1"></i><span class="d-none d-md-block">Terminées</span></a>
            </li>
            <li class="nav-item"> <a href="javascript:void(0)" class="nav-link rounded-pill note-link d-flex align-items-center px-2 px-md-3 mr-0 mr-md-2" id="note-social">
                <i class="icon-refresh mr-1"></i><span class="d-none d-md-block">En cours</span></a>
            </li>
            <li class="nav-item"> <a href="javascript:void(0)" class="nav-link rounded-pill note-link d-flex align-items-center px-2 px-md-3 mr-0 mr-md-2" id="note-important">
                <i class="icon-tag mr-1"></i><span class="d-none d-md-block">Nouveaux</span></a>
            </li>
            <li class="nav-item"> <a href="javascript:void(0)" class="nav-link rounded-pill note-link d-flex align-items-center px-2 px-md-3 mr-0 mr-md-2" id="note-danger">
                <i class="icon-speedometer mr-1"></i><span class="d-none d-md-block">En retard</span></a>
            </li>
            <!-- <li class="nav-item row ml-auto mr-2">
                    <input id="activitySearch" type="text" class="d-none d-lg-block col-lg-5 form-control p-4 shadow-sm border rounded-pill mr-auto" placeholder="Rechercher...">
                    <a href="javascript:void(0)" class="col-lg-6 nav-link btn-info rounded-pill d-flex align-items-center px-3" id="add-notes">
                        <i class="icon-note m-1"></i>
                        <span class="d-none d-md-block font-14">Ajouter une activité </span>
                    </a>
                
            </li> -->
        </ul>
        <div class="d-flex mb-3">
            <div class="d-flex align-items-center mx-1">
                <i class="point fas fa-circle ml-1 font-10 text-primary"></i>
                <span class="ml-1">Nouveau</span>
            </div>
            <div class="d-flex align-items-center mx-1">
                <i class="point fas fa-circle ml-1 font-10 text-info"></i>
                <span class="ml-1">En cours</span>
            </div>
            <div class="d-flex align-items-center mx-1">
                <i class="point fas fa-circle ml-1 font-10 text-danger"></i>
                <span class="ml-1">En retard</span>
            </div>
            <div class="d-flex align-items-center mx-1">
                <i class="point fas fa-circle ml-1 font-10 text-success"></i>
                <span class="ml-1">Terminé</span>
            </div>
        </div>
        <div class="tab-content bg-transparent">
            <div  id="note-full-container" class="row">
                <?php $__currentLoopData = $activities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $activity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="col-12 col-md-6 col-lg-4 single-note-item all-category
                        <?php if($activity->statut == 'new'): ?>
                            note-important
                        <?php elseif($activity->statut == 'ended' || $activity->percentage == 100): ?>
                            note-business
                        <?php elseif($activity->statut == 'progress'): ?>
                            note-social
                        <?php else: ?>
                            note-danger
                        <?php endif; ?>">
                        <div class="card rounded-lg shadow-lg">
                            <div class="card-header rounded badge pt-3
                                <?php if($activity->statut == 'new'): ?>
                                    badge-primary
                                <?php elseif($activity->statut == 'ended' || $activity->percentage == 100): ?>
                                    badge-success
                                <?php elseif($activity->statut == 'progress'): ?>
                                    badge-info
                                <?php else: ?>
                                    badge-danger
                                <?php endif; ?>"
                            >
                                <h4
                                    class="note-title text-truncate font-medium w-100 mb-3 "
                                    data-noteHeading="<?php echo e($activity->name); ?>"
                                >
                                    
                                    <a
                                        title="<?php echo e($activity->name); ?>"
                                        
                                        
                                        
                                        class="text-light"
                                    >
                                        <?php echo e($activity->name); ?>

                                    </a>
                                </h4>
                            </div>
                            
                            <div class="d-flex align-items-center row justify-content-between m-3">
                                <div class="row note-content">
                                    <p class="col-4 note-date font-12 text-danger text-muted">
                                        Commence le
                                        <span class="text-info">
                                            
                                            <?php echo e(date('d/m/Y H:i', strtotime($activity->start_date))); ?>

                                        </span>
                                    </p>
                                    <p class="col-4 note-date font-12 text-danger text-muted">
                                        Finit le
                                        <span class="text-danger">
                                            
                                            <?php echo e(date('d/m/Y H:i', strtotime($activity->end_date))); ?>

                                        </span>
                                    </p>
                                    <h2 class="col-4 note-inner-content text-muted">
                                        <?php echo e($activity->percentage); ?> %
                                    </h2>
                                </div>
                                
                            </div>
                            <div class="d-flex align-items-center row mx-3 mb-4">
                                <a
                                    href="<?php echo e(route('admin-list-task', ['project_id' => $activity->projet_id, 'activity_id' => $activity->id])); ?>"
                                    type="button"
                                    title="Voir les détails de l'activité"
                                    class="btn btn-circle btn-info my-1 mr-1"
                                >
                                    <i class="ti-eye"></i>
                                    
                                </a>
                                    <!-- <?php if($activity->statut != 'ended'): ?>
                                        <form
                                            action="<?php echo e(route('change-status-to-ended', ['activity_id' => $activity->id])); ?>"
                                            method="POST"
                                        >
                                            <?php echo csrf_field(); ?>
                                            <?php echo method_field('PATCH'); ?>
                                            <input type="hidden" name="status-ended" value="ended">
                                            <button
                                                type="submit"
                                                title="Terminer l'activité"
                                                class="btn btn-circle waves-effect waves-light btn-success my-1 mx-1"
                                            >
                                                <i class="ti-check-box"></i>
                                                
                                            </button>
                                        </form>
                                    <?php endif; ?>
                                    <button
                                        title="Modifier l'activité"
                                        type="button"
                                        data-toggle="modal"
                                        data-target="<?php echo e('#modify'. $activity->id); ?>"
                                        class="btn btn-circle waves-effect waves-light btn-warning my-1 mx-1"
                                    >
                                        <i class="ti-pencil-alt"></i>
                                        
                                    </button>
                                    <button
                                        type="button"
                                        title="Supprimer l'activité"
                                        data-toggle="modal"
                                        data-target="#modal_Supprimer<?php echo e($activity->id); ?>"
                                        class="btn btn-circle waves-effect waves-light btn-danger my-1 ml-1"
                                    >
                                        <i class="ti-trash"></i>
                                        
                                    </button> -->
                                <h5 class="note-inner-content text-muted ml-auto">
                                    
                                    <?php echo e($tasks_count[$activity->id]); ?> tache(s)
                                </h5>


                                <div class="modal" id="<?php echo e('modify'. $activity->id); ?>">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <h4 class="modal-title">Modifier</h4>
                                            </div>
                                            <div class="modal-body">
                                                <form method="POST" action="<?php echo e(route('activity_update', ['activity_id' => $activity->id])); ?>" enctype="multipart/form-data" id="<?php echo e('modify_activity_form'. $activity->id); ?>">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('PATCH'); ?>
                                                    <input type="hidden" name="id" class="form-control" id="id" value="<?php echo e($activity->id); ?>">
                                                    <div class="form-group">
                                                        <label for="name" class="control-label">Intitulé de l'activité':</label>
                                                        <input type="text" name="title_modify" value="<?php echo e($activity->name); ?>" class="form-control" id="activity-name">
                                                    </div>
                                                    <div class="form-group">
                                                        <label for="date" class="control-label">Date de début:</label>
                                                        <input type="datetime-local" name="start_date" value="<?php echo e($activity->start_date); ?>" class="form-control" id="<?php echo e('start_date'. $activity->id); ?>"
                                                        min="<?php echo e($project->start_date); ?>"
                                                        max="<?php echo e($project->end_date); ?>">
                                                    </div>
                                                    <div class="form-group">
                                                        <label for="datel" class="control-label">Date limite:</label>
                                                        <input type="datetime-local" name="end_date" value="<?php echo e($activity->end_date); ?>" class="form-control" id="<?php echo e('end_date'. $activity->id); ?>"
                                                        min="<?php echo e($project->start_date); ?>"
                                                        max="<?php echo e($project->end_date); ?>">
                                                    </div>
                                                    <input type="hidden" name="percentage" class="form-control" id="percentage" value="0">
                                                    <input type="hidden" name="activity_id" class="form-control" id="activity_id" value="<?php echo e($activity->id); ?>">
                                                    
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-default waves-effect" data-dismiss="modal">Fermer</button>
                                                        <button type="submit" id="<?php echo e($activity->id); ?>" onClick="modify(this.id)" class="btn btn-success waves-effect waves-light">Sauvegarder</button>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="modal" id="modal_Supprimer<?php echo e($activity->id); ?>" style="color:rgb(32,0,32);">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <!-- Modal Header -->
                                            <div class="modal-header" >
                                                <h2 class="modal-title"> Supprimer l'activité : <?php echo e($activity->name); ?></h2>
                                            </div>
                                            <!-- Modal body -->
                                            <div class="modal-body">
                                                Etes-vous sûr de vouloir supprimer cette activité?
                                                <form class="mt-4" method="post" action="<?php echo e(route('activity_destroy',['activityid' =>$activity->id, 'project_id' => $project->id])); ?>">
                                                    <?php echo e(csrf_field()); ?>

                                                    <?php echo e(method_field('DELETE')); ?>

                                                    <!-- Modal footer -->
                                                    <div class="modal-footer" style="margin-top: 5px; text-align:left;">
                                                        <button type="submit" class="btn btn-danger">Supprimer</button>
                                                        <button type="button" class="btn btn-success" data-dismiss="modal">Annuler</button>
                                                    </div>
                                                </form>
                                            </div>

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

        <!-- Modal Add notes -->
        <div class="modal fade" id="addnotesmodal" tabindex="-1" role="dialog" aria-labelledby="addnotesmodalTitle" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content border-0">
                    <div class="modal-header bg-info text-white">
                        <h5 class="modal-title text-white">Ajouter une activité</h5>
                        <button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <div class="notes-box">
                            <div class="notes-content">
                                <form id="addnotesmodalTitle" method="POST" action="<?php echo e(route('activity_store',['project_id' => $project->id])); ?>">
                                    <?php echo csrf_field(); ?>
                                    <div class="row">
                                        <div class="col-md-12 mb-3">
                                            <div class="note-title">
                                                <label>Titre de l'activité</label>
                                                <input type="text" id="note-has-title" class="form-control" placeholder="Titre" name="titre">
                                            </div>
                                        </div>
                                        <div class="col-md-12 mb-3">
                                            <div class="note-start-date">
                                                <label for="start-date">Date de début</label>
                                                <input
                                                    type="datetime-local"
                                                    id="note-has-start-date"
                                                    class="form-control"
                                                    placeholder="Date de début"
                                                    name="start_date"
                                                    value=""
                                                    min="<?php echo e($project->start_date); ?>"
                                                    max="<?php echo e($project->end_date); ?>"
                                                >
                                                <input type="hidden" id="project_start_date" value="<?php echo e($project->start_date); ?>">
                                            </div>
                                        </div>
                                        <div class="col-md-12 mb-3">
                                            <div class="note-end-date">
                                                <label for="end-date">Date de fin</label>
                                                <input
                                                    type="datetime-local"
                                                    id="note-has-end-date"
                                                    class="form-control"
                                                    placeholder="Date de fin"
                                                    name="end_date"
                                                    value=""
                                                    min="<?php echo e($project->start_date); ?>"
                                                    max="<?php echo e($project->end_date); ?>"
                                                >
                                                <input type="hidden" id="project_end_date" value="<?php echo e($project->end_date); ?>">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="modal-footer">
                                        <button class="btn btn-danger" data-dismiss="modal" type="button"> Annuler</button>
                                        <button type="submit" id="create_activity" class="btn btn-success waves-effect waves-light">Ajouter</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>

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

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

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

    <script src="<?php echo e(asset('dist/js/pages/notes/notes.js')); ?>"></script>

    <!--This page JavaScript -->
	<script src="<?php echo e(asset('assets/libs/quill/dist/quill.min.js')); ?>"></script>
    <!-- Initialize Quill editor -->
    <script src="<?php echo e(asset('dist/js/pages/todo/todo.js')); ?>"></script>

    <!--This page plugins -->
    <script src="<?php echo e(asset('assets/extra-libs/datatables.net/js/jquery.dataTables.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/extra-libs/datatables.net-bs4/js/dataTables.responsive.min.js')); ?>"></script>
    <script src="<?php echo e(asset('dist/js/pages/datatable/datatable-basic.init.js')); ?>"></script>

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

<?php echo $__env->make('layouts.admin-base', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/africawebstudent/public_html/aws/task/resources/views/admin-project.blade.php ENDPATH**/ ?>