<script src="{$path}/SpryAssets/SpryValidationSelect.js" type="text/javascript"></script>
<link href="{$path}/SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" />

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">{$smarty.const.EXPENSES_REVENUE}</a></li>
            <li><a href="#">{$smarty.const.EXPENSES}</a></li>
            <li class="active">{$smarty.const.EXPENSES_TYPE_SHOW}</li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading" style="padding:5px 15px 15px">
                <h3 class="panel-title" style="display: inline-block;">{$smarty.const.EXPENSES_TYPE_SHOW}</h3>
                <a href="{$youtubes[98]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>
                <a href="expensesTypeController.php" class="hidden-print"><input type="button"  id="submit" style="margin-left: 12px" class="btn btn-primary pull-left " value="{$smarty.const.EXPENSES_TYPE_ADD_NEW}"/></a>
            </div>

            <div class="panel-body">

                <!---------- start outputString alert ----------->
                <div id="outputString" class="alert alert-block alert-success fade in" style="display:none">
                    <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">&times;</button>
                    <p id="outputStringValue">{$outputString}</p>
                    <div class="clearfix"></div>
                </div>
                <!---------  end outputString alert ------------>

                <form class="form-inline hidden-print" method="post" action="expensesTypeController.php?do=show">
                    <div class="form-group">
                        <label class="sr-only">{$smarty.const.EXPENSES_TYPE}</label>
                        <select data-placeholder=" {$smarty.const.EXPENSES_TYPE_CHOOSE}"  class="select2 wdt300"   id="parent" name="parent"  onchange="this.form.submit();">
                            <option value="-1">{$smarty.const.CHOOSE}</option>



                            {foreach $allData as $data}



                            <option>{$data->expensestypename}</option>



                            {/foreach}

                        </select>
                    </div>
                    <button type="submit" class="btn btn-primary">{$smarty.const.EXPENSES_SEARCH}</button>
                </form>
                <hr/>
                {literal}
                <form id="form1" name="form1" method="post" action="expensesTypeController.php?do=executeOperation" onsubmit="if (Spry.Widget.Form.validate(this)) {
                            return countChoosenProducts('expensesTypeController');
                        } else {
                            return false;
                        }
                      " enctype="multipart/form-data">
                    {/literal}


                    <div class="panel panel-default panel-m">
                        <!-- Default panel contents -->
                        <div class="panel-heading">{$message}</div>
                        <div class="panel-body">
                            <!-- Table -->
                            <table class="table table-black">
                                <thead>
                                    <tr>
                                        <th class="hidden-print">  <div class="checkbox">
                                    <input type="checkbox" name="checkAll" id="checkAll"/>
                                </div>
                                </th>
                                <th>#</th>
                                <th>{$smarty.const.EXPENSES_TYPE_NAME}</th>
                                <th class="hidden-print" >{$smarty.const.EDIT}</th>
                                <th class="hidden-print" >{$smarty.const.EXPENSES_TYPE_DELETE}</th>
                                </tr>
                                </thead>
                                <tbody>

                                    {foreach $name as $na}
                                    <tr>
                                        <td class="hidden-print"> <div class="checkbox">
                                                <input type="checkbox" name="choosedItem[]" id="checked{$i}" class="choosenItem" value="{$na->expensestypeid}" />
                                            </div></td>
                                        <td>{$na->expensestypeid}</td>
                                        <td>{$na->expensestypename}</td>
                                        <td class="hidden-print"><a href="expensesTypeController.php?do=edit&id={$na->expensestypeid}" type="button" class="btn btn-default btn-lg editicon"></a></td>
                                        <td class="hidden-print"><a href="#" id="delShowBtn" type="button" class="btn btn-default btn-lg deleteicon"></a></td>
                                    </tr>
                                    {/foreach}
                                </tbody>

                            </table>
                            <div class="clearfix"></div>
                            <hr />
                            <div  class="hidden-print">
                                <div class="col-lg-12">
                                    <div class="well well-sm">
                                        <div class="form-group">
                                            <div class="col-lg-4">
                                                <label for="operation"></label>
                                                <span id="spryselect2">
                                                    <select name="operation" id="operation"  data-placeholder="{$smarty.const.EXPENSES_TYPE_CHOOSE_PROCESS}"  class="select2 wdt100">
                                                        <option value="-1"></option>
                                                        <option value="1">{$smarty.const.EXPENSES_TYPE_DELETE}</option>
                                                    </select>
                                                    <span class="selectInvalidMsg">{$smarty.const.EXPENSES_TYPE_CHOOSE_PROCESS}</span></span></div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-lg-4">
                                                <input name=""  class="hidden-print btn btn-primary" type="submit" value="{$smarty.const.EXPENSES_TYPE_EXECUTION}"/>
                                            </div>
                                        </div>

                                        <!-----------  start noElementsError alert ------------->
                                        <div class="clearfix"></div>
                                        <div id="noElementsError" class="alert alert-danger fade in" style="display:none;">
                                            <button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">×</button>
                                            <p>{$smarty.const.EXPENSES_TYPE_SELECTED_FIRST}</p>
                                            <div class="clearfix"></div>
                                        </div>
                                        <!----------  end noElementsError alert -------------->

                                        <div class="clearfix"></div>
                                    </div>
                                </div>

                                <div class="clearfix"></div>
                            </div>
                            </form>



                            <div class="clearfix"></div>
                            <!-- Modal -->
                            <div class="hidden-print">
                                <div class="modal fade " id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content">
                                            <div class="modal-header">
                                                <button type="button" class="close pull-left" data-dismiss="modal" aria-hidden="true">&times;</button>
                                                <h4 class="modal-title">{$smarty.const.EXPENSES_TYPE_CONFIRM_DELETION_RESOURCE}</h4>
                                            </div>
                                            <form id="delform2" action="expensesTypeController.php?do=delete&id={$na->expensestypeid}" method="post" class="form-horizontal">

                                                <div class="modal-body"> {$smarty.const.EXPENSES_TYPE_DELETE_TYPE_BANKER} </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default" data-dismiss="modal">{$smarty.const.EXPENSES_TYPE_NO}</button>
                                                    <button type="submit" id="delconfbtn2" class="btn btn-primary savemodel1">{$smarty.const.EXPENSES_TYPE_YES}</button>
                                                </div>
                                            </form>
                                        </div>
                                        <!-- /.modal-content -->
                                    </div>
                                    <!-- /.modal-dialog -->
                                </div>
                            </div>
                            <!-- /.modal -->
                            <div  class="hidden-print">
                                <div class="col-lg-12">
                                    <div class="form-group">
                                        <div class="col-lg-4">
                                            <button type="button" onclick="print_Custom('mycustomheader');" class="btn btn-success pull-right">{$smarty.const.EXPENSES_TYPE_PRINT}</button>
                                        </div>
                                    </div>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        </div>
                    </div>
            </div>
        </div>
        {literal}
        <script type="text/javascript">
            var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {invalidValue: "-1", isRequired: false});
        </script>
        {/literal}
