<input id="foodscraftRole" type="hidden" class="form-control" name="foodscraftRole" value="{{ isset($result['foodscraftRole']) ? $result['foodscraftRole'] : $roleType }}" />
<div class="row">
    <div class="col-md-4 col-sm-12 pr-md-1">
        <div class="form-group">
            <label for="companyRole">Designation</label><span class="required-field">*</span>
            <input id="companyRole" type="text" class="form-control" name="companyRole" value="{{ isset($result['companyRole']) ? $result['companyRole'] : '' }}" required <?php echo !isset($result['companyRole']) && empty($result['companyRole']) ? '' : ($type == "edit" ? '' : ($type == "view" ? 'disabled' : '')) ?> />
        </div>
    </div>
    <div class="col-md-4 col-sm-12 px-md-1">
        <div class="form-group">
            <label for="employeeNumber">No. of employees</label><span class="required-field">*</span>
            <input id="employeeNumber" type="text" class="form-control" name="employeeNumber" value="{{ isset($result['employeeNumber']) ? $result['employeeNumber'] : '' }}" required <?php echo !isset($result['employeeNumber']) && empty($result['employeeNumber']) ? '' : ($type == "edit" ? '' : ($type == "view" ? 'disabled' : '')) ?> />
        </div>
    </div>
    <div class="col-md-4 col-sm-12 pl-md-1">
        <div class="form-group">
            <label for="yearExp">Years of experience</label><span class="required-field">*</span>
            <input id="yearExp" type="text" class="form-control" pattern="^[1-9]{1|2}$" data-toggle="tooltip" title="Max 2 Digits Only" name="yearExp" value="{{ isset($result['yearExp']) ? $result['yearExp'] : '' }}" required <?php echo !isset($result['yearExp']) && empty($result['yearExp']) ? '' : ($type == "edit" ? '' : ($type == "view" ? 'disabled' : '')) ?> />
        </div>
    </div>
</div>
<div class="row">
    <div class="col-md-4 col-sm-12 pr-md-1">
        <div class="form-group">
            <label for="companyType">Company type</label><span class="required-field">*</span>
            <select class="form-control" name="companyType" id="companyType" required <?php echo !isset($result['companyType']) && empty($result['companyType']) ? '' : ($type == "edit" ? '' : ($type == "view" ? 'disabled' : '')) ?> >
                <option value="{{ isset($result['companyType']) ? ($type == 'view' ? $result['companyType'] : '') : '' }}">{{ isset($result['companyType']) && !empty($result['companyType']) ? ($type == 'view' ? $result['companyType'] : 'Select type') : 'Select type' }}</option>
                <option value="proprietor">Proprietor</option>
                <option value="partnership">partnership</option>
                <option value="LLP">LLP</option>
                <option value="Pvt">PVT LTD.</option>
            </select>
        </div>
    </div>
    <div class="col-md-4 col-sm-12 px-md-1">
        <div class="form-group">
            <label for="vendorScope">Scope of vendor</label><span class="required-field">*</span>
            <select class="form-control" name="vendorScope" id="vendorScope" required <?php echo !isset($result['vendorScope']) && empty($result['vendorScope']) ? '' : ($type == "edit" ? '' : ($type == "view" ? 'disabled' : '')) ?> >
                <option value="{{ isset($result['vendorScope']) ? ($type == 'view' ? $result['vendorScope'] : '') : '' }}">{{ isset($result['vendorScope']) && !empty($result['vendorScope']) ? ($type == 'view' ? $result['vendorScope'] : 'Select scope') : 'Select scope' }}</option>
                <option value="mainMeal">main meal</option>
                <option value="tuckShop">tuck shop</option>
                <option value="liveMeals">live meals</option>
                <option value="mrp">mrp</option>
                <option value="beverages">beverages</option>
                <option value="healthyMealsSnacks">healthy meals/snacks</option>
                <option value="customizedMeals">customized meals</option>
                <option value="specializedServices">specialized services</option>
                <option value="ODC">ODC</option>
                <option value="CorporateEvents">Corporate events</option>
            </select>
        </div>
    </div>
    <div class="col-md-4 col-sm-12 pl-md-1">
        <div class="form-group">
            <label for="auditRating">Kitchen audit rating</label><span class="required-field">*</span>
            @php
                if(isset($result)){
                    $hasAuditRatingOrNot = isset($result['auditRating']) && !empty($result['auditRating']);
                    $rating = "";
                    switch($result['auditRating']){
                        case "lessFive":
                            $rating = "Less than 5";
                            break;
                        case "fiveToSeven":
                            $rating = "5-7";
                            break;
                        case "sevenToNine":
                            $rating = "7-9";
                            break;
                        case "aboveNine":
                            $rating = "More than 9";
                            break;
                        default:
                            $rating = $result['auditRating'];
                    }
                }
            @endphp
            <select class="form-control" name="auditRating" id="auditRating" required <?php echo !isset($result['auditRating']) && empty($result['auditRating']) ? '' : ($type == "edit" ? '' : ($type == "view" ? 'disabled' : '')) ?> >
                <option value="{{ isset($hasAuditRatingOrNot) && $hasAuditRatingOrNot ? ($type == 'view' ? $result['auditRating'] : '') : '' }}" checked>{{ isset($hasAuditRatingOrNot) && $hasAuditRatingOrNot ? ($type == "view" ? $rating : 'Select rating') : 'Select rating' }}</option>
                <option value="lessFive">Less than 5</option>
                <option value="fiveToSeven">5-7</option>
                <option value="sevenToNine">7-9</option>
                <option value="aboveNine">More than 9</option>
            </select>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-md-3 col-sm-12 pr-md-1">
        <div class="form-group">
            <label for="kitchenArea">Kitchen area</label><span class="required-field">*</span>
            <input id="kitchenArea" type="text" class="form-control" pattern="^[0-9]{1|2|3|4}$" data-toggle="tooltip" title="Digits Only" placeholder="In Sq.ft." name="kitchenArea" value="{{ isset($result['kitchenArea']) ? $result['kitchenArea'] : '' }}" required <?php echo !isset($result['kitchenArea']) && empty($result['kitchenArea']) ? '' : ($type == "edit" ? '' : ($type == "view" ? 'disabled' : '')) ?> />
        </div>
    </div>
    <div class="col-md-3 col-sm-12 px-md-1">
        <div class="form-group">
            <label for="mealCapacity">Meal capacity</label><span class="required-field">*</span>
            <input id="mealCapacity" type="text" class="form-control" pattern="[0-9]+" data-toggle="tooltip" title="Digits Only" placeholder="In numbers per day." name="mealCapacity" value="{{ isset($result['mealCapacity']) ? $result['mealCapacity'] : '' }}" required <?php echo !isset($result['mealCapacity']) && empty($result['mealCapacity']) ? '' : ($type == "edit" ? '' : ($type == "view" ? 'disabled' : '')) ?> />
        </div>
    </div>
    <div class="col-md-3 col-sm-12 px-md-1">
        <div class="form-group">
            <label for="cameraNumber">No. of camera’s</label><span class="required-field">*</span>
            <input id="cameraNumber" type="text" class="form-control" name="cameraNumber" value="{{ isset($result['cameraNumber']) ? $result['cameraNumber'] : '' }}" required <?php echo !isset($result['cameraNumber']) && empty($result['cameraNumber']) ? '' : ($type == "edit" ? '' : ($type == "view" ? 'disabled' : '')) ?> />
        </div>
    </div>
    <div class="col-md-3 col-sm-12 pl-md-1">
        <div class="form-group">
            <label for="cameraMegaPixel">Camera Mega Pixel</label><span class="required-field">*</span>
            <input id="cameraMegaPixel" type="text" class="form-control" name="cameraMegaPixel" value="{{ isset($result['cameraMegaPixel']) ? $result['cameraMegaPixel'] : '' }}" required <?php echo !isset($result['cameraMegaPixel']) && empty($result['cameraMegaPixel']) ? '' : ($type == "edit" ? '' : ($type == "view" ? 'disabled' : '')) ?> />
        </div>
    </div>
</div>
@if(isset($type) && $type == "view" && isset($listMapfirstdata) && isset($listMapseconddata))
    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                <h5 class="text-center d-flex justify-content-center">
                    <span class="border-bottom-span border-bottom">Mapped Client List</span>
                </h5>
                <div class="card-body">
                    <div class="table-responsive px-2" style="overflow-x: scroll; overflow-y: hidden;">
                        <table class="table table-hover">
                            <thead class="text-dark">
                                <tr>
                                    <th class="text-left" scope="col">S.No.</th> 
                                    <th class="text-left" scope="col">Name</th>
                                    <th class="text-left" scope="col">Client Code</th>
                                    <th class="text-left" scope="col">Contact Number</th>
                                    <th class="text-left" scope="col">Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                @forelse($listMapseconddata as $key=>$value)
                                    <tr>
                                        <th class="text-left" scope="row">{{ ++$key }}</th>
                                        <td class="text-left">{{ $value[0]['name'] }}</td>
                                        <td class="text-left">{{ $value[0]['username'] }}</td>
                                        <td class="text-left">{{ $value[0]['contactNumber'] }}</td>
                                        <td class="d-flex">
                                            <div class="peterriver" onclick="viewOrEdit('{{ url('viewOrEditRole') }}', 'view', '{{ $value[0]['clientId'] }}');">View</div> 
                                        </td>
                                    </tr>
                                @empty
                                    <tr>
                                        <td colspan="7" align="center" class="tablemotfounditem">Not Found any</td>
                                    </tr>
                                @endforelse
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                <h5 class="text-center d-flex justify-content-center">
                    <span class="border-bottom-span border-bottom">Mapped Site Marshall List</span>
                </h5>
                <div class="card-body">
                    <div class="table-responsive px-2" style="overflow-x: scroll; overflow-y: hidden;">
                        <table class="table table-hover">
                            <thead class="text-dark">
                                <tr>
                                    <th class="text-left" scope="col">S.No.</th> 
                                    <th class="text-left" scope="col">Name</th>
                                    <th class="text-left" scope="col">Employee ID</th>
                                    <th class="text-left" scope="col">Contact Number</th>
                                    <th class="text-left" scope="col">Designation</th>
                                    <th class="text-left" scope="col">Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                @forelse($listMapfirstdata as $key=>$value)
                                    <tr>
                                        <th class="text-left" scope="row">{{ ++$key }}</th>
                                        <td class="text-left">{{ $value[0]['name'] }}</td>
                                        <td class="text-left">{{ $value[0]['employeeId'] }}</td>
                                        <td class="text-left">{{ $value[0]['contactNumber'] }}</td>
                                        <td class="text-left">{{ $value[0]['designation'] }}</td>
                                        <td class="d-flex">
                                            <div class="peterriver" onclick="viewOrEdit('{{ url('viewOrEditRole') }}', 'view', '{{ $value[0]['marshalId'] }}');">View</div> 
                                        </td>
                                    </tr>
                                @empty
                                    <tr>
                                        <td colspan="7" align="center" class="tablemotfounditem">Not Found any</td>
                                    </tr>
                                @endforelse
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endif