<ion-view view-title="إرسال إستفتاء">
    <ion-content class="padding" style="margin-bottom: 20px" >

        <div class="list" >
            <label class="item item-input" style="direction: rtl">
                <input type="text" placeholder="الاسم" ng-model="problem.name">
            </label>
            <label class="item item-input" style="direction: rtl">
                <input type="text" placeholder="الجوال" ng-model="problem.mobile">
            </label>
            <label class="item item-input" style="direction: rtl">
                <input type="text" placeholder="الإيميل" ng-model="problem.email">
            </label>
            <label class="item item-input item-select">
                <div class="input-label">الفقيه  </div>
                <select ng-model="problem.faqih_id" >
                    <option id="{{faqih.faqih_id}}" ng-repeat="faqih in faqih_list" value="{{faqih.faqih_id}}"
                            ng-selected="faqih.faqih_id === '1'">{{faqih.faqih_name}}
                    </option>
                </select>
            </label>
            <label class="item item-input item-select">
                <div class="input-label">الكتاب  </div>
                <select ng-model="problem.book_id" ng-change="getChapters(problem.book_id)" >
                    <option id="{{book.book_id}}" ng-repeat="book in books" value="{{book.book_id}}"
                            ng-selected="book.book_id === '1'">{{book.book_name}}
                    </option>
                </select>
            </label>
            <label class="item item-input item-select">
                <div class="input-label">الباب  </div>
                <select ng-model="problem.chapter_id" >
                    <option id="{{chapter.chapter_id}}" ng-repeat="chapter in chapters" value="{{chapter.chapter_id}}"
                            ng-selected="chapter.chapter_id === '1'">{{chapter.chapter_name}}
                    </option>
                </select>
            </label>

            <label class="item item-input" style="direction: rtl">
                <textarea type="text" placeholder="السؤال (*)" ng-model="problem.problem" style="height: 6em"></textarea>
            </label>

            <ion-scroll direction="x">

            <button class="button button-block button-balanced"
                    ng-click="sendFatwa(problem, 1)">
إرسال
            </button>
                <button ng-if="is_visible"  class="button button-block button-assertive "
                         ng-click="sendFatwa(problem, 0)">
                    حذف
                </button>
            </ion-scroll>
        </div>

    </ion-content>
</ion-view>
