<input type="hidden" name="package_id" value="<?php echo e(isset($item['id']) ? $item['id'] : ''); ?>">

<?php if(!isset($item) && !$clients->isEmpty()): ?>
    <h3>
        Cautare client
    </h3>
    <div class="form-group">
        <label class="col-sm-2 control-label" for="exist_client">Lista
            clientilor</label>
        <div class="col-sm-10 ">
            <select name="exist_client" id="exist_client"
                    class="select2 form-control exist_client">
                <option value="">Alegeti un client</option>
                <?php foreach($clients as $client): ?>
                    <option value="<?php echo e($client->client_id); ?>"><?php echo e($client->name); ?>

                        / <?php echo e($client->phone); ?><?php echo e(!is_null($client->company) ? ' / ' . $client->company : ''); ?></option>
                <?php endforeach; ?>
            </select>
        </div>
    </div>
<?php endif; ?>
<h3>
    Date despre client
</h3>
<input type="hidden" name="client_id"
       value="<?php echo e(isset($item) && isset($item->client) ? $item->client->client_id : ''); ?>">

<div class="form-group">
    <label class="col-sm-2 control-label" for="fan_courier">Fan courier</label>
    <div class="col-sm-10 report-value">
        <input type="checkbox" name="fan_courier"
               id="fan_courier" <?php echo e(isset($item) && isset($item->client) && $item->client->fan_courier == 1 ? 'checked' : ''); ?>>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label" for="client_name">Nume*</label>
    <div class="col-sm-10 ">
        <input type="text" class="form-control first_name" name="client_name"
               id="client_name"
               value="<?php echo e(isset($item) && isset($item->client) ? $item->client['name'] : ''); ?>">
    </div>
</div>
<div class="form-group">
    <label for="phone" class="col-sm-2 control-label">Telefon*</label>
    <div class="col-sm-10">
        <input type="tel" class="form-control phone" name="phone" id="phone"
               value="<?php echo e(isset($item) && isset($item->client) ? $item->client['phone'] : ''); ?>">
    </div>
</div>
<div class="form-group">
    <label for="address" class="col-sm-2 control-label">Adresa</label>
    <div class="col-sm-10">
        <input type="text" class="form-control address" name="address" id="address"
               value="<?php echo e(isset($item) && isset($item->client) ? $item->client['address'] : ''); ?>">
    </div>
</div>
<div class="form-group">
    <label for="country_id" class="col-sm-2 control-label">Tara</label>
    <div class="col-sm-10">
        <select class=" form-control country_id select2" name="country_id"
                id="country_id">
            <?php if(isset($countryItems) && count($countryItems)): ?>
                <?php foreach($countryItems as $countryItem): ?>
                    <option <?php echo isset($item) && isset($item->client) && $item->client->country_id == $countryItem->country_id  ? 'selected': ($countryItem->country_id == 140 ? 'selected' : ''); ?> value="<?php echo e($countryItem->country_id); ?>"><?php echo e($countryItem->name); ?></option>
                <?php endforeach; ?>
            <?php endif; ?>
        </select>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label" for="is_juridic">Persoana juridica</label>
    <div class="col-sm-10 report-value">
        <input type="checkbox" name="is_juridic"
               id="is_juridic" <?php echo e(isset($item) && isset($item->client) && $item->client->is_juridic == 1 ? 'checked' : ''); ?>>
    </div>
</div>
<div class="form-group">
    <label for="email" class="col-sm-2 control-label">Email client</label>
    <div class="col-sm-10">
        <input type="text" class="form-control email" name="email" id="email"
               value="<?php echo e(isset($item) && isset($item->client) ? $item->client['email'] : ''); ?>">
    </div>
</div>
<div class="form-group send_payment_account">
    <label class="col-sm-2 control-label" for="send_payment_account">Expediaza contul de plata</label>
    <div class="col-sm-10 report-value">
        <input type="checkbox" name="send_payment_account"
               id="send_payment_account">
    </div>
</div>
<div class="form-group">
    <label for="company" class="col-sm-2 control-label">Companie client</label>
    <div class="col-sm-10">
        <input type="text" class="form-control company" name="company" id="company"
               value="<?php echo e(isset($item) && isset($item->client) ? $item->client['company'] : ''); ?>">
    </div>
</div>
<div class="form-group">
    <label for="source_client" class="col-sm-2 control-label">Sursa clientului</label>
    <div class="col-sm-10 ">
        <input type="text" class="form-control source_client" name="source_client"
               id="source_client"
               value="<?php echo e(isset($item) && isset($item->client) ? $item->client['source_client'] : ''); ?>">
    </div>
</div>

<?php /*Fan courier*/ ?>

<div class="fan-courier">
    <input type="hidden" name="fan_agency" value="Bucuresti">
    <input type="hidden" name="fan_locality" value="Bucuresti">
    <h3>
        Fan Courier
    </h3>
    <div class="form-group">
        <label for="contact_person" class="col-sm-2 control-label">Persoana de contact*</label>
        <div class="col-sm-10 ">
            <?php if(!$fanCourierContactPersons->isEmpty()): ?>
                <select name="contact_person" id="contact_person" class="form-control select2">
                    <option value="">Alegeti persoana de contact</option>
                    <?php foreach($fanCourierContactPersons as $person): ?>
                        <option value="<?php echo e($person->id); ?>" <?php echo e(isset($item) && $item->contact_person_id ==  $person->id ? 'selected' : ''); ?>><?php echo e($person->name); ?></option>
                    <?php endforeach; ?>
                </select>
            <?php endif; ?>
        </div>
    </div>
    <div class="form-group">
        <label for="fan_district" class="col-sm-2 control-label">Judet*</label>
        <div class="col-sm-10 ">
            <?php if(!$fanCourierDistricts->isEmpty()): ?>
                <select name="fan_district" id="fan_district" class="form-control select2">
                    <option value="">Alegeti judet</option>
                    <?php foreach($fanCourierDistricts as $district): ?>
                        <option value="<?php echo e($district->district_id); ?>" <?php echo e(isset($item) && isset($item->client) && $item->client->district_id ==  $district->district_id ? 'selected' : ''); ?>><?php echo e($district->name); ?></option>
                    <?php endforeach; ?>
                </select>
            <?php endif; ?>
        </div>
    </div>
    <div class="form-group">
        <label for="fan_village" class="col-sm-2 control-label">Localitate*</label>
        <div class="col-sm-10 ">
            <select name="fan_village" id="fan_village" class="form-control select2">
                <option value="">Alegeti localitate</option>
                <?php if(isset($item) && isset($item->client) && !$item->client->villages->isEmpty()): ?>
                    <?php foreach($item->client->villages as $village): ?>
                        <option value="<?php echo e($village->village_id); ?>" <?php echo e(isset($item) && isset($item->client) && $item->client->village_id ==  $village->village_id ? 'selected' : ''); ?>><?php echo e($village->name); ?></option>
                    <?php endforeach; ?>
                <?php endif; ?>
            </select>
        </div>
    </div>
    <div class="delivery_fan_block-hidden">
        <div class="form-group">
            <label for="fan_street" class="col-sm-2 control-label">Strada (Fan Courier)*</label>
            <div class="col-sm-10 ">
                <select name="fan_street" id="fan_street" class="form-control select2">
                    <option value="">Alegeti strada</option>
                    <?php if(isset($item) && !empty($fanCourierStreets)): ?>
                        <?php foreach($fanCourierStreets as $street): ?>
                            <?php if(!empty($street->type) && !empty($street->street)): ?>
                                <option value="<?php echo e($street->id); ?>"
                                        <?php echo e(isset($item) && $item->fan_street ==  $street->id ? 'selected' : ''); ?> data-postal="<?php echo e($street->postal_code); ?>"><?php echo e($street->street); ?></option>
                            <?php else: ?>
                                <option value="<?php echo e($street->id); ?>"
                                        <?php echo e(isset($item) && $item->fan_street ==  $street->id ? 'selected' : ''); ?> data-postal="<?php echo e($street->postal_code); ?>">
                                    Principala
                                </option>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    <?php endif; ?>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="fan_postal_code_list" class="col-sm-2 control-label">Codul postal*</label>
            <div class="col-sm-10 ">
                <select name="fan_postal_code_list" id="fan_postal_code_list" class="form-control select2">
                    <option value="">Alegeti codul postal</option>
                    <?php if(isset($item) && !empty($fanCourierStreets)): ?>
                        <?php foreach($fanCourierStreets as $street): ?>
                            <?php
                            if ($street->paritate == 0)
                                $paritate = ' | Numere pare';
                            elseif ($street->paritate == 1)
                                $paritate = ' | Numere impare';
                            else
                                $paritate = ' | Numere pare si impare';

                            $interval = $street->from_nr . ($street->to_nr != 'T' && !empty($street->to_nr) ? ' - ' . $street->to_nr : '') . $paritate;
                            ?>
                            <option value="<?php echo e($street->id); ?>"
                                    <?php echo e(isset($item) && $item->fan_postal_code_list ==  $street->id ? 'selected' : ''); ?> data-postal="<?php echo e($street->postal_code); ?>"><?php echo e($street->postal_code); ?>

                                (<?php echo e($interval); ?>)
                            </option>
                        <?php endforeach; ?>
                    <?php endif; ?>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="street_number" class="col-sm-2 control-label">Nr. strazii*</label>
            <div class="col-sm-10 ">
                <input type="text" name="street_number" id="street_number" class="form-control"
                       value="<?php echo e(isset($item) ? $item->street_number : ''); ?>">
            </div>
        </div>
        <div class="form-group">
            <label for="building_number" class="col-sm-2 control-label">Bloc</label>
            <div class="col-sm-10 ">
                <input type="text" name="building_number" id="building_number" class="form-control"
                       value="<?php echo e(isset($item) ? $item->building_number : ''); ?>">
            </div>
        </div>
        <div class="form-group">
            <label for="entrance" class="col-sm-2 control-label">Scara</label>
            <div class="col-sm-10 ">
                <input type="text" name="entrance" id="entrance" class="form-control"
                       value="<?php echo e(isset($item) ? $item->entrance : ''); ?>">
            </div>
        </div>
        <div class="form-group">
            <label for="floor" class="col-sm-2 control-label">Etaj</label>
            <div class="col-sm-10 ">
                <input type="text" name="floor" id="floor" class="form-control"
                       value="<?php echo e(isset($item) ? $item->floor : ''); ?>">
            </div>
        </div>
        <div class="form-group">
            <label for="flat" class="col-sm-2 control-label">Apartament</label>
            <div class="col-sm-10 ">
                <input type="text" name="flat" id="flat" class="form-control"
                       value="<?php echo e(isset($item) ? $item->flat : ''); ?>">
            </div>
        </div>
    </div>
    <div class="form-group extern_km">
        <div class="report-label col-sm-2 control-label">
            <span>Km. exteriori</span>
        </div>
        <div class="col-sm-10 report-value">
            <input type="hidden" name="extern_km" value="<?php echo e(isset($item) ? $item->extern_km : 0); ?>">
            <span><?php echo e(isset($item) ? $item->extern_km : 0); ?></span>
        </div>
    </div>
    <div class="form-group delivery_fan delivery_fan_hidden">
        <label class="col-sm-2 control-label" for="delivery_fan">Livrare sediu FAN</label>
        <div class="col-sm-10 report-value">
            <input type="checkbox" name="delivery_fan"
                   id="delivery_fan" <?php echo e(isset($item) && isset($item->client) && $item->client->delivery_fan == 1 ? 'checked' : ''); ?>>
        </div>
    </div>
    <div class="delivery_fan_block">
        <div class="form-group">
            <label for="delivery_office_fan" class="col-sm-2 control-label">Livrare sediu FAN*</label>
            <div class="col-sm-10 ">
                <select name="delivery_office_fan" id="delivery_office_fan" class="form-control select2">
                    <?php if(isset($item) && !$item->deliveryOffices->isEmpty()): ?>
                        <?php foreach($item->deliveryOffices as $office): ?>
                            <option value="<?php echo e($office->id); ?>" <?php echo e(isset($item) && $item->delivery_office_fan_id == $office->id ? 'selected' : ''); ?>><?php echo e($office->street); ?></option>
                        <?php endforeach; ?>
                    <?php endif; ?>
                </select>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="service_type" class="col-sm-2 control-label">Tip serviciu*</label>
        <div class="col-sm-10 ">
            <?php if(!$fanCourierServicesTypes->isEmpty()): ?>
                <select name="service_type" id="service_type" class="form-control">
                    <?php foreach($fanCourierServicesTypes as $servicesType): ?>
                        <option value="<?php echo e($servicesType->id); ?>" <?php echo e(isset($item) && $item->services_type_id == $servicesType->id ? 'selected' : ''); ?>><?php echo e($servicesType->name); ?></option>
                    <?php endforeach; ?>
                </select>
            <?php endif; ?>
        </div>
    </div>
    <div class="form-group">
        <label for="envelopes" class="col-sm-2 control-label">Nr. plicuri*</label>
        <div class="col-sm-10 ">
            <input type="text" name="envelopes" id="envelopes" class="form-control"
                   value="<?php echo e(isset($item) ? $item->envelopes : 0); ?>">
        </div>
    </div>
    <div class="form-group">
        <label for="parcels" class="col-sm-2 control-label">Nr. colete*</label>
        <div class="col-sm-10 ">
            <input type="text" name="parcels" id="parcels" class="form-control"
                   value="<?php echo e(isset($item) ? $item->parcels : ''); ?>">
        </div>
    </div>
    <div class="form-group">
        <label for="total_weight" class="col-sm-2 control-label">Greutate totala
            (kg)*</label>
        <div class="col-sm-10 ">
            <input type="text" name="total_weight" id="total_weight"
                   class="form-control" value="<?php echo e(isset($item) ? $item->total_weight : ''); ?>">
        </div>
    </div>
    <div class="form-group">
        <label for="payments" class="col-sm-2 control-label">Plata expeditiei
            la*</label>
        <div class="col-sm-10 ">
            <select name="payments" id="payments" class="form-control">
                <option value="altul" <?php echo e(isset($item) && $item->payments == 'altul' ? 'selected' : ''); ?>>Altul</option>
                <option value="expeditor" <?php echo e(isset($item) && $item->payments == 'expeditor' ? 'selected' : ''); ?>>
                    Expeditor
                </option>
                <option value="destinatar" <?php echo e(isset($item) && $item->payments == 'destinatar' ? 'selected' : ''); ?>>
                    Destinatar
                </option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="ramburs" class="col-sm-2 control-label">Ramburs numerar</label>
        <div class="col-sm-10 media-mb-15">
            <input type="text" name="ramburs" id="ramburs" class="form-control"
                   value="<?php echo e(isset($item) ? $item->ramburs : ''); ?>">
        </div>
    </div>
    <div class="form-group">
        <label for="refund" class="col-sm-2 control-label">Restituire</label>
        <div class="col-sm-10 ">
            <input type="text" name="refund" id="refund" class="form-control"
                   value="<?php echo e(isset($item) ? $item->refund : ''); ?>">
        </div>
    </div>
    <div class="form-group">
        <label for="payments_transport" class="col-sm-2 control-label">Plata transport ramburs la*</label>
        <div class="col-sm-10 ">
            <select name="payments_transport" id="payments_transport" class="form-control">
                <option value="---" <?php echo e(isset($item) && $item->payments_transport == '---' ? 'selected' : ''); ?>>
                    ---
                </option>
                <option value="expeditor" <?php echo e(isset($item) && $item->payments_transport == 'expeditor' ? 'selected' : ''); ?>>
                    Expeditor
                </option>
                <option value="destinatar" <?php echo e(isset($item) && $item->payments_transport == 'destinatar' ? 'selected' : ''); ?>>
                    Destinatar
                </option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="observations" class="col-sm-2 control-label">Observatii*</label>
        <div class="col-sm-10 ">
            <?php if(!$fanCourierObservations->isEmpty()): ?>
                <select name="observations[]" id="observations"
                        class="form-control select2-multiple-limited" multiple
                        data-placeholder="Selectati maxim 3 observatii">
                    <?php foreach($fanCourierObservations as $observation): ?>
                        <option value="<?php echo e($observation->id); ?>" <?php echo e(isset($item) && !empty($item->observations) && in_array($observation->id, $item->observations) ? 'selected' : ($observation->id == 4 ? 'selected' : '')); ?>><?php echo e($observation->name); ?></option>
                    <?php endforeach; ?>
                </select>
            <?php endif; ?>
        </div>
    </div>
    <div class="form-group">
        <label for="content" class="col-sm-2 control-label">Continut*</label>
        <div class="col-sm-10 ">
            <input type="text" name="content" id="content" class="form-control"
                   value="<?php echo e(isset($item) ? $item->content : 'Ornamente'); ?>">
        </div>
    </div>
    <div class="form-group total-payment-tva">
        <div class="report-label col-sm-2 control-label">
            <span>Total de plata cash</span>
        </div>
        <div class="col-sm-10 report-value">
            <input type="hidden" name="total_payment_tva"
                   value="<?php echo e(isset($item) && !is_null($item->total_payment_tva) ? $item->total_payment_tva : 0); ?>">
            <span><span class="payment-val"><?php echo e(isset($item) && !is_null($item->total_payment_tva) ? $item->total_payment_tva : 0); ?></span> LEI + TVA</span>
        </div>
    </div>
</div>

<?php /*Fan courier*/ ?>

<div class="hr-line-dashed"></div>
<h3>
    Date despre colet
</h3>
<div class="form-group">
    <label class="col-sm-2 control-label">Nume colet*</label>
    <div class="col-sm-10">
        <input type="text" class="form-control"
               value="<?php echo e(isset($item['name']) ? $item['name'] : ''); ?>"
               name="package_name">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">Valuta coletului*</label>
    <div class="col-sm-10">
        <?php if(!$currency->isEmpty()): ?>
            <select name="currency_id" id="currency_id" class="form-control select2-with-icons">
                <?php foreach($currency as $one_currency): ?>
                    <option value="<?php echo e($one_currency->id); ?>"
                            <?php echo e(isset($item) && $item->currency_id == $one_currency->id ? 'selected' : ''); ?> title="<?php echo e(asset($one_currency->img)); ?>"><?php echo e($one_currency->name); ?></option>
                <?php endforeach; ?>
            </select>
        <?php endif; ?>
    </div>
</div>
<div class="form-group" id="package-price-block">
    <div class="report-label col-sm-2 control-label">
        <span>Pret colet</span>
    </div>
    <div class="col-sm-10 report-value">
        <span>
            <span class="package-price"><?php echo e(isset($item) ? $item->price : 0); ?> </span>
            <span class="currency-price"><?php echo e(isset($item) && !is_null($item->currency) ? $item->currency->name : (!$currency->isEmpty() ? $currency[0]->name : '')); ?></span>
        </span>
    </div>
</div>
<?php if(request()->segment(1) == 'project-registry'): ?>
    <div class="form-group">
        <label class="col-sm-2 control-label" for="is_paid">Coletul e achitat</label>
        <div class="col-sm-10 report-value">
            <input type="checkbox" name="is_paid" id="is_paid" <?php echo e(isset($item) && $item->is_paid == 1 ? 'checked' : ''); ?>>
        </div>
    </div>
<?php endif; ?>
<div class="package-block">
    <?php if(isset($item) && !$item->projects->isEmpty()): ?>
        <?php foreach($item->projects as $project): ?>
            <div class="package-block-items">
                <input type="hidden" name="projects[project_id][]"
                       value="<?php echo e(isset($project->project_id) ? $project->project_id : ''); ?>">
                <div class="form-group">
                    <label class="col-sm-2 control-label">Nume proiect</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control name"
                               name="projects[name][]" value="<?php echo e(isset($project->name) ? $project->name : ''); ?>">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">Prețul proiectului*</label>
                    <div class="col-sm-10 media-mb-15">
                        <input type="text" class="form-control project-price"
                               value="<?php echo e(isset($project->price) ? $project->price : ''); ?>"
                               name="projects[price][]">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        Schita proiectului*
                    </label>
                    <div class="col-sm-10">
                        <div class="file-uploader">
                            <div class="fileinput fileinput-new input-group" data-provides="fileinput">
                                <div class="form-control" data-trigger="fileinput"
                                     onclick="ufChangeFile(this)">
                                    <i class="glyphicon glyphicon-file "></i>
                                    <span class="fileinput-filename"></span>
                                </div>
                                <span class="input-group-addon btn btn-default btn-file fileinput-new">
                                                        <span class=" ">Select file</span>
                                                        <input type="file" name="some_name" value=""
                                                               accept=".jpg, .jpeg, .png"
                                                               onchange="ufUploadFileSingle(this)"/>
                                                </span>
                                <span class="input-group-addon  progress"></span>
                            </div>
                            <div class="file-uploader-garbage">
                                <p><input type="hidden" name="projects[file][]" value="<?php echo e(isset($project->file) ? $project->file : ''); ?>">
                                    <a href="<?php echo e(url('/'.(isset($project) ? $project->file  : ''))); ?>"
                                       data-fancybox="project-schema" data-caption="<?php echo e(isset($project->serial) ? $project->serial : ''); ?>">
                                        <img src="<?php echo e(url('/'.(isset($project) ? $project->file  : ''))); ?>"
                                             alt=""
                                             width="250">
                                    </a>
                                    <?php echo e(basename((isset($project) ? $project->file  : ''))); ?>

                                    <i class="fa fa-remove pull-left red"></i>
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="cancel-project-block">
                    <div class="form-group">
                        <label class="col-sm-2 control-label" for="cancel_project_<?php echo e($project->project_id); ?>">Anulare
                            proiect</label>
                        <div class="col-sm-10">
                            <input type="checkbox" id="cancel_project_<?php echo e($project->project_id); ?>" class="cancel_project"
                                   name="" <?php echo e($project->is_canceled == 1 ? 'checked' : ''); ?>>
                            <input type="hidden" class="cancel_project"
                                   name="projects[cancel_project][]" value="<?php echo e($project->is_canceled); ?>">
                        </div>
                    </div>
                    <div class="form-group <?php echo e($project->is_canceled == 1 ? '' : 'hidden-cancel-reason'); ?>">
                        <label class="col-sm-2 control-label">Motivul anularii</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control cancel-reason" name="projects[cancel_reason][]"
                                   value="<?php echo e(isset($project->cancel_reason) ? $project->cancel_reason : ''); ?>">
                        </div>
                    </div>
                </div>
                <span class="del-item show-del-item"></span>
                <?php if(request()->segment(1) == 'project-registry'): ?>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">Etapa proiect</label>
                        <div class="col-sm-10">
                            <?php if(isset($packageStatusesList) && count($packageStatusesList)): ?>
                                <select name="projects[changed_status][]" class="form-control">
                                    <?php foreach($packageStatusesList as $statusItem): ?>
                                        <option value="<?php echo e(!is_null($statusItem->status) ? $statusItem->status->permaname : ''); ?>" <?php echo e(!is_null($statusItem->status) && !is_null($project->projectStatus) ? ($project->projectStatus->status == $statusItem->status->permaname ? 'selected' : '') : ''); ?>><?php echo e(!is_null($statusItem->status) ? $statusItem->status->getNameAttribute() : ''); ?></option>
                                    <?php endforeach; ?>
                                    <?php if(!is_null($project->projectStatus) && $project->projectStatus->status != 'draft'): ?>
                                        <option value="finished" <?php echo e(!is_null($project->projectStatus) && $project->projectStatus->finishedProject ? 'selected' : ''); ?>>
                                            Proiectul este finisat
                                        </option>
                                    <?php endif; ?>
                                </select>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="comments-block-per-product">
                        <?php echo $__env->make('timeline', [
                        'initComments'=>[
                            'user' => $project->userDraft,
                            'comments' => $project->commentSectionProjectInit,
                            'available_status' => in_array('draft', $packageStatusesPermanames)
                        ],
                        'designComments'=>[
                            'user' => $project->userDesign,
                            'comments' => $project->commentSectionProjectDesign,
                            'available_status' => in_array('design', $packageStatusesPermanames)
                        ],
                        'layoutComments'=>[
                            'user' => $project->userLayout,
                            'comments' => $project->commentSectionProjectLayout,
                            'available_status' => in_array('layout', $packageStatusesPermanames)
                        ],
                        'colorComments'=>[
                            'user' => $project->userColor,
                            'comments' => $project->commentSectionProjectColor,
                            'available_status' => in_array('color', $packageStatusesPermanames)
                        ],
                        'cropComments'=>[
                            'user' => $project->userCrop,
                            'comments' => $project->commentSectionProjectCrop,
                            'available_status' => in_array('crop', $packageStatusesPermanames)
                        ],
                        'assemblyComments'=>[
                            'user' => $project,
                            'comments' => $project->commentSectionProjectAssembly,
                            'available_status' => in_array('assembly', $packageStatusesPermanames)
                        ]
                    ], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                    </div>
                <?php endif; ?>
            </div>
        <?php endforeach; ?>
    <?php else: ?>
        <div class="package-block-items">
            <input type="hidden" name="projects[project_id][]" value="">
            <div class="form-group">
                <label class="col-sm-2 control-label">Nume proiect</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control name"
                           name="projects[name][]" value="">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Prețul proiectului*</label>
                <div class="col-sm-10 media-mb-15">
                    <input type="text" class="form-control project-price"
                           value=""
                           name="projects[price][]">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    Schita proiectului*
                </label>
                <div class="col-sm-10">
                    <div class="file-uploader">
                        <div class="fileinput fileinput-new input-group" data-provides="fileinput">
                            <div class="form-control" data-trigger="fileinput"
                                 onclick="ufChangeFile(this)">
                                <i class="glyphicon glyphicon-file "></i>
                                <span class="fileinput-filename"></span>
                            </div>
                            <span class="input-group-addon btn btn-default btn-file fileinput-new">
                                                        <span class=" ">Select file</span>
                                                        <input type="file" name="some_name" value=""
                                                               accept=".jpg, .jpeg, .png"
                                                               onchange="ufUploadFileSingle(this)"/>
                                                </span>
                            <span class="input-group-addon  progress"></span>
                        </div>
                        <div class="file-uploader-garbage"></div>
                    </div>
                </div>
            </div>
            <div class="cancel-project-block">
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="cancel_project">Anulare proiect</label>
                    <div class="col-sm-10">
                        <input type="checkbox" id="cancel_project" class="cancel_project"
                               name="">
                        <input type="hidden" class="cancel_project"
                               name="projects[cancel_project][]" value="0">
                    </div>
                </div>
                <div class="form-group hidden-cancel-reason">
                    <label class="col-sm-2 control-label">Motivul anularii</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control cancel-reason" name="projects[cancel_reason][]">
                    </div>
                </div>
            </div>
            <span class="del-item"></span>
        </div>
    <?php endif; ?>
    <button type="button" class="col-sm-12 btn btn-info btn-block package-add-item">Adauga un proiect nou</button>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label" for="payment_method_id">Metoda de plata</label>
    <div class="col-sm-10">
        <select class="form-control payment_method_id select2-with-icons" name="payment_method_id"
                id="payment_method_id">
            <?php if(isset($paymentMethodItems) && count($paymentMethodItems)): ?>
                <?php foreach($paymentMethodItems as $paymentMethodItem): ?>
                    <option value="<?php echo e($paymentMethodItem->payment_method_id); ?>"
                            title="<?php echo e(asset($paymentMethodItem->img)); ?>"><?php echo e($paymentMethodItem->name); ?></option>
                <?php endforeach; ?>
            <?php endif; ?>
        </select>
    </div>
</div>
<?php if(auth()->user()->is_admin == 3): ?>
    <?php if(!$teams->isEmpty()): ?>
        <div class="form-group">
            <label for="team_id" class="col-sm-2 control-label">Echipa
                clientului</label>
            <div class="col-sm-10">
                <select class="form-control" name="team_id" id="team_id">
                    <?php foreach($teams as $key => $team): ?>
                        <option value="<?php echo e($team->id); ?>" <?php echo e(!is_null($item) ? ($item->team_id == $team->id ? 'selected' : '') : ''); ?>><?php echo e(isset($team->name) ? $team->name : ''); ?></option>
                    <?php endforeach; ?>
                </select>
            </div>
        </div>
    <?php endif; ?>
<?php endif; ?>
<div class="form-group">
    <label class="col-sm-2 control-label">Serie colet</label>
    <div class="col-sm-10">
        <input type="text" class="form-control" value="<?php echo e(isset($item->serial) ? $item->serial : ''); ?>"
               name="serial"
               readonly>
    </div>
</div>
<div class="form-group all-statuses-block">
    <label class="col-sm-2 control-label">Etapele coletului</label>
    <div class="col-sm-10">
        <?php if(isset($statusItems) && count($statusItems)): ?>
            <div class="select-all-statuses">
                <label for="project_statuses"><input type="checkbox" name="all_project_statuses"
                                                     id="project_statuses" <?php echo e(isset($item) ? (count($packageStatuses) == $statusItems->count() ? 'checked' : '' ) : ($statusItems->count() == count(auth()->user()->userComponentsArr) ? 'checked' : '')); ?>>
                    Selecteaza toate</label>
            </div>
            <?php foreach($statusItems as $key => $statusItem): ?>
                <div class="select-single-statuses">
                    <label for="project_statuses_<?php echo e($key); ?>"><input type="checkbox" name="project_statuses[]"
                                                                  value="<?php echo e($statusItem->status_id); ?>"
                                                                  id="project_statuses_<?php echo e($key); ?>" <?php echo e(isset($item) ? (in_array($statusItem->status_id, $packageStatuses) ? 'checked' : '') : (in_array($statusItem->status_id, auth()->user()->userComponentsArr) ? 'checked' : '')); ?>> <?php echo e($statusItem->getNameAttribute()); ?>

                    </label>
                </div>
            <?php endforeach; ?>
        <?php endif; ?>
    </div>
</div>
