<style>
    table {
        font-family: arial, sans-serif;
        border-collapse: collapse;
        width: 100%;
        table-layout: fixed
    }

    td, th {
        border: 1px solid #000000;
        text-align: center;
        padding: 2px;
    }

    tr:nth-child(even) {
        background-color: #dddddd;
    }
</style>


<div class="page-content-wrapper">
    <div class="page-content">
        <div class="row">
            <div class="col-md-12 clinick invz" >
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption">

                            <i class="fa fa-user"></i>Organization
                        </div>
                        <div class="actions">
                            <a href="{$hosturl}/controllers/{$controllname}.php?ac=organizations"
                               class="btn btn-default btn-sm">
                                Show </a>
                        </div>
                    </div>

                    <div class="portlet-body all">
                        <div class="row">
                            <div class="portlet-body form">
                                <form action="{$hosturl}/controllers/{$controllname}.php?ac=org_add" method="post"
                                      id="org_add_form">
                                    <div class="form-body">
                                        <div class="portlet box grey-cascade">
                                            <div class="portlet-body">
                                                <div class="row">
                                                    <input type="hidden" id="controllName" value="{$controllname}"/>
                                                    <table>
                                                        <tbody>
                                                            <tr>
                                                                <th class="wds20">Id</th>
                                                                <td>
                                                                    <input type="text" class="form-control " id="org_id"   name="org_id"  required />
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>Name</th>
                                                                <td>
                                                                    <input type="text" class="form-control " name="name" id="name" required />
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>Related To.</th>
                                                                <td>
                                                                    <select class="form-control organizations_parents"
                                                                            id="organizations_parents{$data.id}" name="parent_id">
                                                                        <option value="">choose</option>
                                                                        {foreach  $orgParents as $single}
                                                                        <option value="{$single.id}"  >{$single.name}</option>
                                                                        {/foreach}
                                                                        <option value="-1" class="deleteoptincompo">تعديل </option>
                                                                    </select>
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>Type</th>
                                                                <td>
                                                                    <div class="form-group ">
                                                                        <div class="col-md-6">
                                                                            <div class="col-md-3">
                                                                                <div class="md-radio-list">
                                                                                    <div class="md-radio">
                                                                                        <input type="radio" id="org_type0" name="org_type"
                                                                                               class="md-radiobtn org_type" value="0">
                                                                                        <label for="org_type0">
                                                                                            <span></span>
                                                                                            <span class="check"></span>
                                                                                            <span class="box"></span>
                                                                                            Cash </label>
                                                                                    </div>
                                                                                </div>
                                                                            </div>

                                                                            <div class="col-md-3">
                                                                                <div class="md-radio-list">
                                                                                    <div class="md-radio">
                                                                                        <input type="radio" id="org_type1" name="org_type"
                                                                                               class="md-radiobtn org_type" value="1">
                                                                                        <label for="org_type1">
                                                                                            <span></span>
                                                                                            <span class="check"></span>
                                                                                            <span class="box"></span>
                                                                                            Credit  </label>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>Address</th>
                                                                <td>
                                                                    <input type="text" class="form-control " name="location" />
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>Contact  No.</th>
                                                                <td>
                                                                    <input type="text" class="form-control " name="phone" />
                                                                </td>
                                                            </tr>



                                                            <tr>
                                                                <th>Contact Person  </th>
                                                                <td>
                                                                    <input type="text" class="form-control " name="contact_person" />
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>Price List</th>
                                                                <td>
                                                                    <select  class="form-control select2h"  name="price_list">
                                                                        <option value="">choose</option>
                                                                        {foreach  $price_lists as $one}
                                                                        <option value="{$one.id}" >{$one.name}</option>
                                                                        {/foreach}
                                                                    </select>
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>Sales Person</th>
                                                                <td>
                                                                    <select  class="form-control sales_persons"  name="sales_persons"
                                                                             id="sales_persons">
                                                                        <option value="">choose</option>
                                                                        {foreach  $sales_persons as $one}
                                                                        <option value="{$one.id}" >{$one.name}</option>
                                                                        {/foreach}
                                                                        <option value="-1" class="deleteoptincompo">تعديل </option>
                                                                    </select>
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>Contract Start</th>
                                                                <td>
                                                                    <input type="text" class="form-control datepicker " name="contract_start" />
                                                                </td>

                                                            </tr>

                                                            <tr>
                                                                <th>Email</th>
                                                                <td>
                                                                    <input type="text" class="form-control " name="email" />
                                                                </td>

                                                            </tr>

                                                            <tr>
                                                                <th>Vat No.</th>
                                                                <td>
                                                                    <input type="text" class="form-control " name="vat_no" />
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>Credit Limit</th>
                                                                <td>
                                                                    <input type="text" class="form-control " name="credit_limit" />
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>User Name</th>
                                                                <td>
                                                                    <input type="text" class="form-control " name="username"
                                                                           id ="username"  />

                                                                    <div class="alert alert-warning display-hide" id="showerrorusername">
                                                                        <button class="close" data-close="alert"></button>
                                                                        Use another one , this used before with other user.
                                                                    </div>
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>Password</th>
                                                                <td>
                                                                    <input type="password" class="form-control " name="password"
                                                                           id ="password"  />
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <th>Confirm  Password </th>
                                                                <td>
                                                                    <input type="password" class="form-control " 
                                                                           name="confirmpassword"    id ="confirmpassword"  />
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>

                                    </div>


                                    <div class="form-actions">
                                        <div class="row">
                                            <div class="col-md-offset-3 col-md-4 fright">
                                                <button type="submit" class="btn green">Save</button>
                                                <a href="{$hosturl}/controllers/{$controllname}.php?ac=organizations"
                                                   class="btn default">
                                                    Cancel </a>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<div  id="editModalDiv"></div>