<div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">نظام المستفيدين</a></li>
            <li><a href="beneficiariesController.php?do=show">عرض المستفيدين</a></li>
            {if $data->del lt 2}
            <li class="active">تعديل </li>
            {else}
            <li class="active">تفاصيل </li>
            {/if}
        </ol>
        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                {if $data->del lt 2}
                <h3 class="panel-title">تعديل </h3>
                {else}
                <h3 class="panel-title">تفاصيل </h3>
                {/if}
            </div>
            <div class="panel-body">


                {literal}
                <form class="form-horizontal" action="beneficiariesController.php" id="charityformajax" method="post"
                    enctype="multipart/form-data" data-dosave="?do=savedata">

                    {/literal}
                    <div class="form-group">
                        <label class="col-lg-2 control-label">المنطقة </label>
                        <div class="col-lg-4">
                            <input id="areaId" type="text" name="area_id" class="getselectjoin areaId"
                                data-placeholder=" المنطقة" data-table="area" data-tableid="areaId" data-join=""
                                data-filter="" data-parent="" data-itr="" data-search="name" />
                            <input type="hidden" name="areaId" class="selectedit" data-tableidname="areaId" data-itr=""
                                data-join="" data-table="area" data-tableid="id" data-search="name"
                                value="{$data->area_id}" />
                        </div>
                        <button type="button" class="btn btn-primary adddatamodal" data-table="area"
                            data-tableid="areaId" data-toggle="modal" data-target="#ModalareaId" data-whatever="@area"
                            data-formt="formarea" data-selectitr="">اضافة منطقة</button>
                        <button type="button" class="btn btn-primary editdatamodal" data-model="#ModalareaId"
                            data-table="area" data-name="areaId" data-tableid="id" data-join="" data-formt="formarea" data-control="beneficiariesController.php"
                            data-selectitr="">تعديل منطقة</button>
                    </div>

                    <div class="form-group">
                        <label class="col-lg-2 control-label">الجمعية </label>
                        <div class="col-lg-4">
                            <select name="charity_id" required="required" data-placeholder="اختر " class="selectnew"
                                data-table="beneficiaries" data-tablecol="charity_id">
                                {foreach $allCharities as $single}
                                <option value="{$single.id}" {if $data->charity_id eq
                                    $single.id}selected{/if}>{$single.charityname}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <hr />

                    <div class="caption">
                        <h4 style="text-decoration: underline; font-weight: bold;">البيانات الشخصية</h4>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الصوره /label>
                        <div class="col-lg-2">
                            {if $data->image !="." && $data->image}
                            <img src="../views/default/images/beneficiaries/{$data->image}"
                                style="width: 140px;height: 100px;border: 3px solid;border-radius: 6px;">
                            {else}
                            <img src="../views/default/assets/img/blank.png"
                                style="width: 140px;height: 100px;border: 3px solid;border-radius: 6px;" alt=""
                                class="card-img">
                            {/if}
                            <input type="hidden" name="oldimage" id="oldimage"
                                value="{$data->image}" />
                            {if $data->del lt 2}
                            <input type="file" name="image" id="image" />
                            {/if}
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="b_name" class="col-lg-2 control-label">اسم المستفيد</label>
                        <div class="col-lg-4">
                            <input required="required" type="text" name="b_name" class="form-control checkcolumn"
                                placeholder="اسم المستفيد" data-table="beneficiaries" data-tablecol="name"
                                data-tableid="" data-parentid="" data-parentcol="" value="{$data->name}" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الشهرة</label>
                        <div class="col-lg-4">
                            <input type="text" name="nickname" class="form-control" placeholder="الشهرة"
                                data-table="beneficiaries" data-tablecol="nickname" data-tableid="" data-parentid=""
                                data-parentcol="" value="{$data->nickname}" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">السن</label>
                        <div class="col-lg-4">
                            <input type="number" name="age" id="age" class="form-control numbers"
                                placeholder="السن" value="{$data->age}" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الرقم القومي</label>
                        <div class="col-lg-4">
                            <input required="required" type="text" name="idnumber" id="idnumber"
                                class="form-control checkcolumn numbers" data-table="beneficiaries"  data-tableid="{$data->id}" data-tablecol="idnumber" placeholder="الرقم القومي"
                                value="{$data->idnumber}" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">رقم تليفون المستفيد </label>
                        <div class="col-lg-4">
                            <input required="required" type="text" name="phone_no" digits="true"
                                class="form-control checkcolumn numbers" placeholder="رقم تليفون المستفيد  "
                                data-table="beneficiaries" data-tablecol="phone_no" data-tableid="{$data->id}" data-parentid=""
                                data-parentcol="" value="{$data->phone_no}" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label"> عنوان المستفيد</label>
                        <div class="col-lg-4">
                            <input required="required" type="text" name="address" class="form-control"
                                placeholder="عنوان المستفيد" value="{$data->address}" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label"> الحالة الاجتماعية</label>
                        <div class="col-lg-4">
                            <select name="marital_status" data-placeholder="اختر " class="selectnew">
                                <option value="1" {if $data->marital_status eq 1}selected{/if}>أعزب/عزباء</option>
                                <option value="2" {if $data->marital_status eq 2}selected{/if}>خاطب/مخطوبة</option>
                                <option value="3" {if $data->marital_status eq 3}selected{/if}>متزوج/ة</option>
                                <option value="4" {if $data->marital_status eq 4}selected{/if}>أرمل/ة</option>
                            </select>
                        </div>
                    </div>

                    <div class="caption">
                        <h4 style="text-decoration: underline; font-weight: bold;">بيانات جهة العمل</h4>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">العمل </label>
                        <div class="col-lg-4">
                            <input type="text" name="work" value="{$data->work}" class="form-control"
                                placeholder="العمل" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label"> محل العمل </label>
                        <div class="col-lg-4">
                            <input type="text" name="workplace" value="{$data->workplace}" class="form-control"
                                placeholder=" محل العمل " />
                        </div>
                    </div>
                    <hr />

                    <div class="caption">
                        <h4 style="text-decoration: underline; font-weight: bold;">بيانات صحية</h4>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label"> الأمراض المزمنة </label>
                        <div class="col-lg-4">
                            <input id="diseaseId" type="text" multiple="" name="diseas"
                                class="getselectmultiple diseaseId" data-placeholder=" الأمراض المزمنة "
                                data-table="disease" data-tableid="id" data-join="" data-filter="" data-parent=""
                                data-itr="" data-search="name" />
                            <input type="hidden" name="diseaseId" class="selecteditMulti" data-tableidname="diseaseId"
                                data-itr="" data-join="" data-table="disease" data-tableid="id" data-search="name"
                                value="{$data->diseas}" />
                        </div>

                        <button type="button" class="btn btn-primary adddatamodal" data-table="disease"
                            data-tableid="diseaseId" data-toggle="modal" data-target="#ModaldiseaseId"
                            data-whatever="@disease" data-formt="formdisease" data-selectitr="">اضافة مرض</button>
                        <button type="button" class="btn btn-primary editdataMulti" data-model="#ModalEditDiseas"
                            data-table="disease" data-name="diseaseId" data-tableid="id">تعديل مرض</button>
                    </div>
                    <hr />

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">وصف الحالة</label>
                        <div class="col-lg-4">
                            <textarea class="form-control" name="status_description" rows="5"
                                placeholder="وصف الحالة">{$data->status_description}</textarea>
                        </div>
                    </div>
                    <hr />

                    <div class="caption">
                        <h4 style="text-decoration: underline; font-weight: bold;">تكوين الأسرة</h4>
                    </div>

                    <button type="button" name="addNewFamily" id="addNewFamily" data-container="family"
                        class="btn btn-primary pull-left ft-nor addappend">إضافة
                        جديد</button>
                    <div class="table-responsive">
                        <table class="table billtable table-bordered  table-black">
                            <thead>
                                <tr>
                                    <th>م</th>
                                    <th>الاسم</th>
                                    <th>القرابة</th>
                                    <th>السن</th>
                                    <th>الرقم القومي</th>
                                    <th>الحالة الاجتماعية</th>
                                    <th>المهنة</th>
                                    <th>الدخل</th>
                                    <th>الحالة الصحية</th>
                                    <th>الحالة التعليمية</th>
                                    <th>حذف</th>
                                </tr>
                            </thead>
                            <input type="hidden" name="familyItr" id="familyItr" value="{count($allFamily)}" />
                            <tbody id="familyTbl">
                                {assign var="i" value="1"}
                                {foreach $allFamily as $family}
                                <tr>
                                    <input type="hidden" name="family_id{$i}" value="{$family.id}" />
                                    <td>{$i}</td>
                                    <td>
                                        <input type="text" name="name{$i}" class="form-control" placeholder="الاسم"
                                            value="{$family.name}" />
                                    </td>
                                    <td>
                                        <input type="text" name="relation{$i}" class="form-control"
                                            placeholder="القرابة" value="{$family.relation}" />
                                    </td>
                                    <td>
                                        <input type="text" name="age{$i}" class="form-control" placeholder="السن"
                                            value="{$family.age}" />
                                    </td>
                                    <td>
                                        <input type="text" name="id_number{$i}" class="form-control"
                                            placeholder="الرقم القومي" value="{$family.id_number}" />
                                    </td>
                                    <td>
                                        <!-- <input type="text" name="status{$i}" class="form-control"
                                            placeholder="الحالة الاجتماعية" value="{$family.status}" /> -->
                                        <select name="status{$i}" data-placeholder="اختر " class="selectnew">
                                            <option value="1" {if $family.status eq 1}selected{/if}>أعزب/عزباء
                                            </option>
                                            <option value="2" {if $family.status eq 2}selected{/if}>خاطب/مخطوبة
                                            </option>
                                            <option value="3" {if $family.status eq 3}selected{/if}>متزوج/ة
                                            </option>
                                            <option value="4" {if $family.status eq 4}selected{/if}>أرمل/ة
                                            </option>
                                        </select>
                                    </td>
                                    <td>
                                        <input type="text" name="job{$i}" class="form-control" placeholder="المهنة"
                                            value="{$family.job}" />
                                    </td>
                                    <td>
                                        <input type="text" name="salary{$i}" class="form-control" placeholder="الدخل"
                                            value="{$family.salary}" />
                                    </td>
                                    <td>
                                        <input type="text" name="health_status{$i}" class="form-control"
                                            placeholder="الحالة الصحية" value="{$family.health_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="education_status{$i}" class="form-control"
                                            placeholder="الحالة التعليمية" value="{$family.education_status}" />
                                    </td>
                                    <td>
                                        <button type="button" data-itr="{$i}" data-container="family"
                                            class="btn btn-danger ft-nor delRow">حذف</button>
                                    </td>
                                </tr>
                                {assign var="i" value=$i+1}
                                {/foreach}
                            </tbody>
                        </table>
                    </div>
                    <hr />
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الحالة الاجتماعية للأسرة</label>
                        <div class="col-lg-4">
                            <textarea class="form-control" name="social_status" rows="5"
                                placeholder="الحالة الاجتماعية للأسرة">{$data->social_status}</textarea>
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الحالة الصحية للأسرة</label>
                        <div class="col-lg-4">
                            <textarea class="form-control" name="health_status" rows="5"
                                placeholder="الحالة الصحية للأسرة">{$data->health_status}</textarea>
                        </div>
                    </div>

                    <div class="caption">
                        <h4 style="text-decoration: underline; font-weight: bold;">الحالة الاقتصادية للأسرة</h4>
                    </div>

                    <button type="button" name="addNewEco" id="addNewEco" data-container="eco"
                        class="btn btn-primary pull-left ft-nor addappend">إضافة
                        جديد</button>
                    <div class="table-responsive">
                        <table class="table billtable table-bordered  table-black">
                            <thead>
                                <tr>
                                    <th>م</th>
                                    <th>أوجه الدخل</th>
                                    <th>أوجه الإنفاق</th>
                                    <th>حذف</th>
                                </tr>
                            </thead>
                            <input type="hidden" name="ecoItr" id="ecoItr" value="{count($allEco)}" />
                            <tbody id="ecoTbl">
                                {assign var="j" value="1"}
                                {foreach $allEco as $eco}
                                <tr>
                                    <input type="hidden" name="eco_id{$j}" value="{$eco.id}" />
                                    <td>{$j}</td>
                                    <td>
                                        <input type="text" name="income{$j}" class="form-control"
                                            placeholder="أوجه الدخل" value="{$eco.income}" />
                                    </td>
                                    <td>
                                        <input type="text" name="paying{$j}" class="form-control"
                                            placeholder="أوجه الإنفاق" value="{$eco.paying}" />
                                    </td>
                                    <td>
                                        <button type="button" data-itr="{$j}" data-container="eco"
                                            class="btn btn-danger ft-nor delRow">حذف</button>
                                    </td>
                                </tr>
                                {assign var="j" value=$j+1}
                                {/foreach}
                            </tbody>
                        </table>
                    </div>
                    <hr />

                    <div class="caption">
                        <h4 style="text-decoration: underline; font-weight: bold;">وصف السكن</h4>
                    </div>
                    <h4 style="text-decoration: underline; font-weight: bold;">1) البنية التحتية</h4>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">عدد الأدوار </label>
                        <div class="col-lg-4">
                            <input type="text" name="floors_no" class="form-control numbers" placeholder="عدد الأدوار"
                                value="{$data->floors_no}" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">عدد الغرف </label>
                        <div class="col-lg-4">
                            <input type="text" name="rooms_no" class="form-control numbers" placeholder="عدد الغرف"
                                value="{$data->rooms_no}" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الإيجار </label>
                        <div class="col-lg-4">
                            <input type="text" name="rent" class="form-control numbers" placeholder="الإيجار"
                                value="{$data->rent}" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الحمام </label>
                        <div class="col-lg-4">
                            <input type="radio" name="bathroom" value="1" {if $data->bathroom eq 1}checked{/if}>خاص
                            <input type="radio" name="bathroom" value="2" {if $data->bathroom eq 2}checked{/if}>مشترك
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الأرضيات </label>
                        <div class="col-lg-4">
                            <input type="text" name="flooring" class="form-control" placeholder="الأرضيات"
                                value="{$data->flooring}" />
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">أسقف </label>
                        <div class="col-lg-4">
                            <input type="text" name="ceiling" class="form-control" placeholder="أسقف"
                                value="{$data->ceiling}" />
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">حوائط </label>
                        <div class="col-lg-4">
                            <input type="text" name="walls" class="form-control" placeholder="حوائط"
                                value="{$data->walls}" />
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الإضاءة </label>
                        <div class="col-lg-4">
                            <input type="text" name="lighting" class="form-control" placeholder="الإضاءة"
                                value="{$data->lighting}" />
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">وصف الصالة </label>
                        <div class="col-lg-4">
                            <input type="text" name="hall" class="form-control" placeholder="وصف الصالة"
                                value="{$data->hall}" />
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">وصف غرفة النوم </label>
                        <div class="col-lg-4">
                            <input type="text" name="bedroom" class="form-control" placeholder="وصف غرفة النوم"
                                value="{$data->bedroom}" />
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">وصف الحمام </label>
                        <div class="col-lg-4">
                            <input type="text" name="bathroom_desc" class="form-control" placeholder="وصف الحمام"
                                value="{$data->bathroom_desc}" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">وصف المطبخ </label>
                        <div class="col-lg-4">
                            <input type="text" name="kitchen" class="form-control" placeholder="وصف المطبخ"
                                value="{$data->kitchen}" />
                        </div>
                    </div>

                    <h4 style="text-decoration: underline; font-weight: bold;">2) الأثاث والأجهزة</h4>
                    <div class="table-responsive">
                        <table class="table billtable table-bordered  table-black">
                            <thead>
                                <tr>
                                    <th>الاسم</th>
                                    <th>هل يوجد</th>
                                    <th>عدد</th>
                                    <th>الحالة</th>
                                    <th>ملاحظات</th>
                                </tr>
                                <tr>
                                    <th colspan="5">الأجهزة</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>بوتوجاز</td>
                                    <td>
                                        <input type="radio" name="cooker" value="1" {if $data->cooker eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="cooker" value="2" {if $data->cooker eq
                                        2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="cooker_no" class="form-control numbers" placeholder=""
                                            value="{$data->cooker_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="cooker_status" class="form-control" placeholder=""
                                            value="{$data->cooker_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="cooker_notes" class="form-control" placeholder=""
                                            value="{$data->cooker_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>غسالة</td>
                                    <td>
                                        <input type="radio" name="washer" value="1" {if $data->washer eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="washer" value="2" {if $data->washer eq
                                        2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="washer_no" class="form-control numbers" placeholder=""
                                            value="{$data->washer_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="washer_status" class="form-control" placeholder=""
                                            value="{$data->washer_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="washer_notes" class="form-control" placeholder=""
                                            value="{$data->washer_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>ثلاجة</td>
                                    <td>
                                        <input type="radio" name="fridge" value="1" {if $data->fridge eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="fridge" value="2" {if $data->fridge eq
                                        2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="fridge_no" class="form-control numbers" placeholder=""
                                            value="{$data->fridge_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="fridge_status" class="form-control" placeholder=""
                                            value="{$data->fridge_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="fridge_notes" class="form-control" placeholder=""
                                            value="{$data->fridge_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>مروحة</td>
                                    <td>
                                        <input type="radio" name="fan" value="1" {if $data->fan eq 1}checked{/if}>نعم
                                        <input type="radio" name="fan" value="2" {if $data->fan eq 2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="fan_no" class="form-control numbers" placeholder=""
                                            value="{$data->fan_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="fan_status" class="form-control" placeholder=""
                                            value="{$data->fan_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="fan_notes" class="form-control" placeholder=""
                                            value="{$data->fan_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>تليفون</td>
                                    <td>
                                        <input type="radio" name="phone" value="1" {if $data->phone eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="phone" value="2" {if $data->phone eq 2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="phone_nu" class="form-control numbers" placeholder=""
                                            value="{$data->phone_nu}" />
                                    </td>
                                    <td>
                                        <input type="text" name="phone_status" class="form-control" placeholder=""
                                            value="{$data->phone_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="phone_notes" class="form-control" placeholder=""
                                            value="{$data->phone_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>كاسيت</td>
                                    <td>
                                        <input type="radio" name="casset" value="1" {if $data->casset eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="casset" value="2" {if $data->casset eq
                                        2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="casset_no" class="form-control numbers" placeholder=""
                                            value="{$data->casset_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="casset_status" class="form-control" placeholder=""
                                            value="{$data->casset_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="casset_notes" class="form-control" placeholder=""
                                            value="{$data->casset_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>خلاط</td>
                                    <td>
                                        <input type="radio" name="blender" value="1" {if $data->blender eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="blender" value="2" {if $data->blender eq
                                        2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="blender_no" class="form-control numbers" placeholder=""
                                            value="{$data->blender_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="blender_status" class="form-control" placeholder=""
                                            value="{$data->blender_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="blender_notes" class="form-control" placeholder=""
                                            value="{$data->blender_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>تلفزيون</td>
                                    <td>
                                        <input type="radio" name="tv" value="1" {if $data->tv eq 1}checked{/if}>نعم
                                        <input type="radio" name="tv" value="2" {if $data->tv eq 2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="tv_no" class="form-control numbers" placeholder=""
                                            value="{$data->tv_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="tv_status" class="form-control" placeholder=""
                                            value="{$data->tv_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="tv_notes" class="form-control" placeholder=""
                                            value="{$data->tv_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>أخرى</td>
                                    <td>
                                        <input type="text" name="machine_name" class="form-control" placeholder=""
                                            value="{$data->machine_name}" />
                                    </td>
                                    <td>
                                        <input type="text" name="machine_no" class="form-control" placeholder=""
                                            value="{$data->machine_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="machine_status" class="form-control" placeholder=""
                                            value="{$data->machine_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="machine_notes" class="form-control" placeholder=""
                                            value="{$data->machine_notes}" />
                                    </td>
                                </tr>
                            </tbody>
                            <thead>
                                <tr>
                                    <th colspan="5">الأثاث</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>سرير</td>
                                    <td>
                                        <input type="radio" name="bed" value="1" {if $data->bed eq 1}checked{/if}>نعم
                                        <input type="radio" name="bed" value="2" {if $data->bed eq 2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="bed_no" class="form-control numbers" placeholder=""
                                            value="{$data->bed_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="bed_status" class="form-control" placeholder=""
                                            value="{$data->bed_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="bed_notes" class="form-control" placeholder=""
                                            value="{$data->bed_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>دولاب</td>
                                    <td>
                                        <input type="radio" name="wardrobe" value="1" {if $data->wardrobe eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="wardrobe" value="2" {if $data->wardrobe eq
                                        2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="wardrobe_no" class="form-control numbers"
                                            placeholder="" value="{$data->wardrobe_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="wardrobe_status" class="form-control" placeholder=""
                                            value="{$data->wardrobe_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="wardrobe_notes" class="form-control" placeholder=""
                                            value="{$data->wardrobe_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>كنب</td>
                                    <td>
                                        <input type="radio" name="couch" value="1" {if $data->couch eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="couch" value="2" {if $data->couch eq 2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="couch_no" class="form-control numbers" placeholder=""
                                            value="{$data->couch_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="couch_status" class="form-control" placeholder=""
                                            value="{$data->couch_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="couch_notes" class="form-control" placeholder=""
                                            value="{$data->couch_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>صالون</td>
                                    <td>
                                        <input type="radio" name="salon" value="1" {if $data->salon eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="salon" value="2" {if $data->salon eq 2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="salon_no" class="form-control numbers" placeholder=""
                                            value="{$data->salon_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="salon_status" class="form-control" placeholder=""
                                            value="{$data->salon_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="salon_notes" class="form-control" placeholder=""
                                            value="{$data->salon_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>كرسي</td>
                                    <td>
                                        <input type="radio" name="chair" value="1" {if $data->chair eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="chair" value="2" {if $data->chair eq 2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="chair_no" class="form-control numbers" placeholder=""
                                            value="{$data->chair_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="chair_status" class="form-control" placeholder=""
                                            value="{$data->chair_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="chair_notes" class="form-control" placeholder=""
                                            value="{$data->chair_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>مكتبة</td>
                                    <td>
                                        <input type="radio" name="library" value="1" {if $data->library eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="library" value="2" {if $data->library eq
                                        2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="library_no" class="form-control numbers" placeholder=""
                                            value="{$data->library_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="library_status" class="form-control" placeholder=""
                                            value="{$data->library_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="library_notes" class="form-control" placeholder=""
                                            value="{$data->library_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>سجاد</td>
                                    <td>
                                        <input type="radio" name="carpet" value="1" {if $data->carpet eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="carpet" value="2" {if $data->carpet eq
                                        2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="carpet_no" class="form-control numbers" placeholder=""
                                            value="{$data->carpet_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="carpet_status" class="form-control" placeholder=""
                                            value="{$data->carpet_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="carpet_notes" class="form-control" placeholder=""
                                            value="{$data->carpet_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>حصير</td>
                                    <td>
                                        <input type="radio" name="mat" value="1" {if $data->mat eq 1}checked{/if}>نعم
                                        <input type="radio" name="mat" value="2" {if $data->mat eq 2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="mat_no" class="form-control numbers" placeholder=""
                                            value="{$data->mat_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="mat_status" class="form-control" placeholder=""
                                            value="{$data->mat_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="mat_notes" class="form-control" placeholder=""
                                            value="{$data->mat_notes}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>بطاطين</td>
                                    <td>
                                        <input type="radio" name="blanket" value="1" {if $data->blanket eq
                                        1}checked{/if}>نعم
                                        <input type="radio" name="blanket" value="2" {if $data->blanket eq
                                        2}checked{/if}>لا
                                    </td>
                                    <td>
                                        <input type="text" name="blanket_no" class="form-control numbers" placeholder=""
                                            value="{$data->blanket_no}" />
                                    </td>
                                    <td>
                                        <input type="text" name="blanket_status" class="form-control" placeholder=""
                                            value="{$data->blanket_status}" />
                                    </td>
                                    <td>
                                        <input type="text" name="blanket_notes" class="form-control" placeholder=""
                                            value="{$data->blanket_notes}" />
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                    <div class="caption">
                        <h4 style="text-decoration: underline; font-weight: bold;">الاحتياجات</h4>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">وفقاً للطلب المقدم من الحالة</label>
                        <div class="col-lg-6">
                            <textarea class="form-control" name="beneficiaries_needs" rows="5"
                                placeholder="وفقاً للطلب المقدم من الحالة">{$data->beneficiaries_needs}</textarea>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">وفقاً لوجهة نظر المستكشف</label>
                        <div class="col-lg-6">
                            <textarea class="form-control" name="observer_needs" rows="5"
                                placeholder="وفقاً لوجهة نظر المستكشف">{$data->observer_needs}</textarea>
                        </div>
                    </div>

                    <div class="caption">
                        <h4 style="text-decoration: underline; font-weight: bold;">آراء داعمة للاستكشاف</h4>
                    </div>
                    <h4 style="text-decoration: underline; font-weight: bold;">رأي الجيران</h4>
                    <div class="table-responsive">
                        <table class="table billtable table-bordered  table-black">
                            <thead>
                                <tr>
                                    <th>أقرب محل</th>
                                    <td>
                                        <input type="text" name="nearest_shop" class="form-control" placeholder=""
                                            value="{$data->nearest_shop}" />
                                    </td>
                                </tr>
                                <tr>
                                    <th>أقرب جار</th>
                                    <td>
                                        <input type="text" name="nearest_neighbour" class="form-control" placeholder=""
                                            value="{$data->nearest_neighbour}" />
                                    </td>
                                </tr>
                                <tr>
                                    <th>أخرى</th>
                                    <td>
                                        <input type="text" name="other_opinion" class="form-control" placeholder=""
                                            value="{$data->other_opinion}" />
                                    </td>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">رأي المستكشف</label>
                        <div class="col-lg-6">
                            <textarea class="form-control" name="observer_opinion" rows="5"
                                placeholder="رأي المستكشف">{$data->observer_opinion}</textarea>
                        </div>
                    </div>
                    <hr />
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الرأي النهائي لللجنة</label>

                        <div class="col-lg-4">
                            <input type="radio" name="final_opinion" value="1" {if $data->final_opinion eq
                            1}checked{/if}>تستحق
                            <input type="radio" name="final_opinion" value="2" {if $data->final_opinion eq
                            2}checked{/if}>لا تستحق
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الأسباب</label>
                        <div class="col-lg-6">
                            <textarea class="form-control" name="reasons" rows="5"
                                placeholder="الأسباب">{$data->reasons}</textarea>
                        </div>
                    </div>


                    <input type="hidden" name="beneficiariesid" id="beneficiariesid" value="{$data->id}" />
                    <input type="hidden" class="deldata" value="{$data->del}" />



                    {if $data->del lt 2}
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="button" class="btn btn-primary pull-left charityformajax">تعديل
                            </button>
                        </div>
                    </div>
                    {/if}
                </form>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="ModalareaId" tabindex="-1" role="dialog" aria-labelledby="ModalareaIdLabel"
    aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title" id="ModalareaIdLabel"> اضافة </h3>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" action="beneficiariesController.php" id="formarea" method="post"
                    enctype="multipart/form-data" data-dosave="?do=savearea" data-direction="">
                    <div class="form-group">
                        <label for="name" class="col-form-label"> اسم المنطقة </label>
                        <input required="required" type="text" name="name" class="form-control checkcolumn"
                            placeholder=" اسم المنطقة " data-table="area" data-tablecol="name" data-filter=" name = ? "
                            data-tableid="" data-parentid="" data-parentcol="" />
                    </div>

                    <input id="poparea" type="hidden" name="areaId" value="" />
                    <input id="itrarea" type="hidden" name="selectitr" value="" />

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">الغاء</button>
                <button type="button" class="btn btn-primary saveformajax" data-action="0" data-form="formarea">
                    حفظ</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="ModaldiseaseId" tabindex="-1" role="dialog" aria-labelledby="ModaldiseaseIdLabel"
    aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title" id="ModaldiseaseIdLabel"> اضافة </h3>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" action="beneficiariesController.php" id="formdisease" method="post"
                    enctype="multipart/form-data" data-dosave="?do=savedisease" data-direction="">
                    <div class="form-group">
                        <label for="name" class="col-form-label"> اسم المرض </label>
                        <input required="required" type="text" name="name" class="form-control checkcolumn"
                            placeholder=" اسم المرض " data-table="disease" data-tablecol="name" data-filter=" name = ? "
                            data-tableid="" data-parentid="" data-parentcol="" />
                    </div>

                    <input id="popdisease" type="hidden" name="diseaseId" value="" />
                    <input id="itrdisease" type="hidden" name="selectitr" value="" />

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">الغاء</button>
                <button type="button" class="btn btn-primary saveformajax" data-action="0" data-form="formdisease">
                    حفظ</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="ModalEditDiseas" tabindex="-1" role="dialog" aria-labelledby="ModaldiseaseIdLabel"
    aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title" id="ModaldiseaseIdLabel"> تعديل </h3>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body" id="editDis">
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function () {
        selecteditMulti();
        deldata();
    });
</script>