<ion-view class="customer" view-title="Customers" hide-nav-bar="true">
    <ion-content scroll="false" id="customer_page">
        <div class="app-main" id="main-content">
            <div compile-html="dataHtml.menuHeader" class="app-header"></div>
            <div class="app-content">
                <div class="app-content-inner content-pd" compile-html="dataHtml.listContent"></div>
            </div>
            <div class="customer-app-create-button app-create-button show" ng-if="hideAddCus">
                <button class="button-add-plus-1 pd0-i w50px h50px" type="button" ng-click="openByGetTemplate('customerPopupAdd')"></button>
            </div>
        </div>
        <div class="app-content-popup-area">
            <form compile-html="dataHtml.customerPopupFilterReport" ng-submit="submitFomFiter()" id="customerPopupFilterReport" class="app-content-popup"></form>
            <div compile-html="dataHtml.customerPopupAdd" id="customerPopupAdd" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerPopupEdit" id="customerPopupEdit" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerPopupDelete" id="customerPopupDelete" class="app-content-popup popup-center"></div>
            <div compile-html="dataHtml.customerPopupPhone" id="customerPopupPhone" class="app-content-popup"></div>
            <form compile-html="dataHtml.customerPopupReview" id="customerPopupReview" class="app-content-popup"></form>
            <div compile-html="dataHtml.customerPopupReviewSearch" class="app-setting customer-review-search"></div>
            <div compile-html="dataHtml.customerPopupReviewFilter" id="customerPopupReviewFilter" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerPopupReviewAdd" id="customerPopupReviewAdd" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerPopupReviewEdit" id="customerPopupReviewEdit" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerPopupReviewDelete" id="customerPopupReviewDelete" class="app-content-popup popup-center"></div>
            <div compile-html="dataHtml.customerPopupJobsite" id="customerPopupJobsite" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerPopupJobsiteAdd" id="customerPopupJobsiteAdd" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerPopupJobsiteEdit" id="customerPopupJobsiteEdit" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerPopupJobsiteDelete" id="customerPopupJobsiteDelete" class="app-content-popup popup-center"></div>
            <div compile-html="dataHtml.customerPopupJobsiteMakePrimary" id="customerPopupJobsiteMakePrimary" class="app-content-popup popup-center"></div>
            <div compile-html="dataHtml.customerPopupDetail" id="customerPopupDetail" class="app-content-popup"> </div>
            <div compile-html="dataHtml.customerConfirmDeleteMailmodal" id="customerConfirmDeleteMailmodal" class="app-content-popup popup-center"></div>
            <div compile-html="dataHtml.customerConfirmDeletePhonemodal" id="customerConfirmDeletePhonemodal" class="app-content-popup popup-center"></div>
            <div compile-html="dataHtml.popupCheckAdditionalPhones" id="popupCheckAdditionalPhones" class="app-content-popup"> </div>
            <div compile-html="dataHtml.addJobsiteModal" id="addJobsiteModal" class="app-content-popup"> </div>
            <div compile-html="dataHtml.jobsiteLogModal" id="jobsiteLogModal" class="app-content-popup"> </div>
            <div class="app-confirm-popup" id="optionCustomerDetail">
                <div class="overlay-area" ng-click="closeTarget('#optionCustomerDetail')"></div>
                <div class="content-area popup-2">
                    <div class="title">
                        <div class="icon">
                            <svg class="h20px" viewBox="0 0 60 60"> <path d="M14,36C8.486,36,4,40.486,4,46s4.486,10,10,10s10-4.486,10-10S19.514,36,14,36z M14,54c-4.411,0-8-3.589-8-8s3.589-8,8-8   s8,3.589,8,8S18.411,54,14,54z" /> <path d="M46,32H14C6.28,32,0,38.28,0,46s6.28,14,14,14h32c7.72,0,14-6.28,14-14S53.72,32,46,32z M46,58H14C7.383,58,2,52.617,2,46   s5.383-12,12-12h32c6.617,0,12,5.383,12,12S52.617,58,46,58z" /> <path d="M14,28h32c7.72,0,14-6.28,14-14S53.72,0,46,0H14C6.28,0,0,6.28,0,14S6.28,28,14,28z M46,4c5.514,0,10,4.486,10,10   s-4.486,10-10,10s-10-4.486-10-10S40.486,4,46,4z" /> </svg>
                        </div>
                        {{setCustomerName(customerDetail.company_name,customerDetail.first_name,customerDetail.last_name)}} option
                    </div>
                    <div class="content row-fixed-15 pdB0-i">
                        <ul class="list-item-03" ng-click="closeTarget('#optionCustomerDetail')">
                            <li ng-click="editCustomers(customerDetail.id)" ng-if="hideEditCustomerDetail">
                                <div class="layout-fixed">
                                    <div class="icon-area">
                                        <svg class="h15px" viewBox="0 0 285 285"> <path d="M216.818,271.424H26.821V81.427h61.713c3.748,0,6.788-3.04,6.788-6.788V13.576h121.496v29.246    c0.3-0.037,0.591-0.115,0.903-0.127c1.753-0.068,5.165,0.019,9.708,1.237c0.909,0.235,1.917,0.572,2.965,0.934V6.788    c0-3.748-3.04-6.788-6.788-6.788H87.894c-1.8,0-3.532,0.714-4.803,1.985l-67.86,67.861c-1.271,1.271-1.985,2.993-1.985,4.793    v203.583c0,3.741,3.04,6.778,6.788,6.778h203.573c3.748,0,6.788-3.037,6.788-6.778V173.01c-3.68,3.612-8.554,5.592-13.576,5.765    L216.818,271.424L216.818,271.424z" fill="#FFF" /> <path d="M267.485,46.164c-4.305-4.305-7.768-4.289-8.139-4.268c-0.52,0.016-1.015,0.235-1.379,0.597l-15.422,15.422    c2.242,1.395,4.704,3.278,7.301,5.875c2.61,2.61,4.49,5.068,5.888,7.308L271.14,55.68c0.377-0.371,0.587-0.857,0.612-1.376    C271.771,53.917,271.783,50.469,267.485,46.164z" fill="#FFF" /> <path d="M254.571,110.462l-7.465,7.465l-4.966-4.96l13.347-13.347c1.15-1.15,1.831-2.703,1.905-4.323    c0.049-1.206,0.111-12.088-13.421-25.621c-13.529-13.539-24.412-13.467-25.621-13.427c-1.63,0.081-3.17,0.761-4.32,1.911    L98.851,173.325c-0.708,0.705-1.252,1.584-1.565,2.549l-16.124,48.372c-0.779,2.338-0.173,4.917,1.581,6.673    c1.735,1.744,4.32,2.345,6.655,1.565l48.384-16.131c0.959-0.321,1.818-0.865,2.533-1.552l97.032-97.035l4.958,4.96l-30.996,30.986    c-2.65,2.66-2.65,6.946,0,9.605c1.33,1.33,3.062,1.985,4.802,1.985c1.732,0,3.473-0.655,4.793-1.985l43.267-43.263    c2.647-2.647,2.647-6.939,0-9.593C261.517,107.809,257.218,107.809,254.571,110.462z" fill="#FFF" /> </svg>
                                    </div>
                                    <div class="name-area text-link-1">
                                        Edit information
                                    </div>
                                </div>
                            </li>
                            <li class="divider"></li>
                            <li ng-click="customerDetail.status=='1' ? confirmDeleteCustomer(customerDetail.id, customerDetail.first_name + ' ' + customerDetail.last_name, customerDetail.status) : confirmDeleteCustomer(customerDetail.id, customerDetail.first_name + ' ' + customerDetail.last_name, customerDetail.status)">
                                <div class="layout-fixed pdL30">
                                    <div class="name-area text-link-1">
                                        Active
                                    </div>
                                    <div class="w60px clear">
                                        <div class="checkedbox-toggle-1 block-i right">
                                            <input class="pointer-none" type="checkbox" name="" ng-checked="customerDetail.status=='1'"><i></i><span></span>
                                        </div>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div compile-html="dataHtml.customerDetailPopupAppointmentHistory" id="customerDetailPopupAppointmentHistory" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerDetailPopupAppointmentHistoryViewLog" id="customerDetailPopupAppointmentHistoryViewLog" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerPopupPhoneAdditionalMore" id="customerPopupPhoneAdditionalMore" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerPopupEmailAdditionalMore" id="customerPopupEmailAdditionalMore" class="app-content-popup"></div>
            <div compile-html="dataHtml.popupCustomerFilterJobsite" id="popupCustomerFilterJobsite" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerPopupCreditCard" id="customerPopupCreditCard" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerDetailAddCreditCard" id="customerDetailAddCreditCard" class="app-content-popup"></div>
            <div compile-html="dataHtml.customerDetailEditCreditCard" id="customerDetailEditCreditCard" class="app-content-popup"></div>
            <div compile-html="dataHtml.popupInstoreCredit" id="popupInstoreCredit" class="app-content-popup"></div>
            <div compile-html="dataHtml.popupAddInstoreCredit" id="popupAddInstoreCredit" class="app-content-popup"></div>
            <div compile-html="dataHtml.popupEditInstoreCredit" id="popupEditInstoreCredit" class="app-content-popup"></div>
            <div compile-html="dataHtml.confirmOverateInstoreCredit" id="confirmOverateInstoreCredit" class="app-content-popup popup-center"></div>
            <div compile-html="dataHtml.confirmDeleteInstoreCredit" id="confirmDeleteInstoreCredit" class="app-content-popup popup-center"></div>
            <div compile-html="dataHtml.customerDetailPopupCreditCardDelete" id="customerDetailPopupCreditCardDelete" class="app-content-popup popup-center"></div>
            <div compile-html="dataHtml.GoogleMap" id="GoogleMap" class="app-content-popup"></div>
            <div compile-html="dataHtml.searchCustomer" class="app-setting customer-search"></div>

            <div ng-controller="scheduleCtrl">
                <div compile-html="dataAppHtml.popupScheduleDetailFileManagement" id="popupScheduleDetailFileManagement" class="app-content-popup"></div>
                <div id="popupScheduleDetailFileManagementName" compile-html="dataAppHtml.popupScheduleDetailFileManagementName" class="app-content-popup"></div>
                <div id="popupAppointmentAddUrl" compile-html="dataAppHtml.popupAppointmentAddUrl" class="app-content-popup"></div>
                <div id="popupScheduleDetailFileManagementDelete" class="app-confirm-popup">
                    <div class="overlay-area" ng-click="closeTarget('#popupScheduleDetailFileManagementDelete')"></div>
                    <div class="content-area popup-2">
                        <div class="title">
                            <div class="icon">
                                <svg class="h20px" viewBox="0 0 59 59"> <path d="M52.5,6H38.456c-0.11-1.25-0.495-3.358-1.813-4.711C35.809,0.434,34.751,0,33.499,0H23.5c-1.252,0-2.31,0.434-3.144,1.289   C19.038,2.642,18.653,4.75,18.543,6H6.5c-0.552,0-1,0.447-1,1s0.448,1,1,1h46c0.552,0,1-0.447,1-1S53.052,6,52.5,6z M20.553,6   c0.112-1.048,0.435-2.496,1.24-3.319C22.24,2.223,22.799,2,23.5,2h9.999c0.701,0,1.26,0.223,1.708,0.681   c0.805,0.823,1.128,2.271,1.24,3.319H20.553z" /> <path d="M10.456,54.021C10.493,55.743,11.565,59,15.364,59h28.272c3.799,0,4.871-3.257,4.907-4.958L50.376,10H8.624L10.456,54.021z    M17.5,42h24c0.552,0,1,0.447,1,1s-0.448,1-1,1h-24c-0.552,0-1-0.447-1-1S16.948,42,17.5,42z M17.5,47h24c0.552,0,1,0.447,1,1   s-0.448,1-1,1h-24c-0.552,0-1-0.447-1-1S16.948,47,17.5,47z M17.5,52h24c0.552,0,1,0.447,1,1s-0.448,1-1,1h-24   c-0.552,0-1-0.447-1-1S16.948,52,17.5,52z" /> </svg>
                            </div>
                            Delete file
                        </div>
                        <div class="content">
                            Are you sure to delete file <b class="clr-white">{{fileDelete.name}}</b> ?
                        </div>
                        <div class="buttons">
                            <div class="layout-fixed h40px pdLR10">
                                <div class="full-h">
                                    <button type="button" class="button-form-field-1 position-left darkgray full" ng-click="closeTarget('#popupScheduleDetailFileManagementDelete')">
                                        Cancel
                                    </button>
                                </div>
                                <div class="full-h" ng-click="deleteFile()">
                                    <button type="button" class="button-form-field-1 position-right full">
                                        OK
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div compile-html="dataAppHtml.popupScheduleDetailFileManagementDetailOfHistory" id="popupScheduleDetailFileManagementDetailOfHistory" class="app-content-popup"></div>
                <div compile-html="dataAppHtml.popupAddScheduleDetailFileManagementDetail" id="popupAddScheduleDetailFileManagementDetail" class="app-content-popup"></div>
                <div compile-html="dataAppHtml.popupFileViewerSchedule" id="popupFileViewerSchedule" class="app-content-popup"></div>
                <div compile-html="dataAppHtml.optionFileDetailSchedule" id="optionFileDetailSchedule" class="app-confirm-popup"></div>
            </div>
        </div>
    </ion-content>
</ion-view>
