

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

        <ol class="breadcrumb">
            <li><a href="#">المطاعم</a></li>
            <li><a href="restaurantprinters.php?do=show">الطابعات</a></li>
            <li class="active">اضافة طابعة</li>
        </ol>


        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">اضافة طابعة</h3>
            </div>
            <div class="panel-body">


                <form id="myform" class="form-horizontal" role="form" action="restaurantprinters.php?do=add" method="post" >

                    <div class="form-group">
                        <label for="printerName" class="col-lg-2 control-label">اسم الطابعة</label>
                        <div class="col-lg-4">
                            <span id="sprytextfield1">
                                <input type="text" name="printerName" id="printerName"   placeholder="اسم الطابعة" class="form-control" />
                                <span class="textfieldRequiredMsg">*</span></span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-lg-2 control-label">تصنيفات المنتجات </label>
                        <div class="col-lg-4">
                            <input type="hidden" name="cats[]" id="cats"/>
                        </div>
                    </div>
                    <!-- =================================================   -->

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="submit" class="btn btn-primary pull-left">حفظ الامر</button>
                        </div>
                    </div>


                </form>
            </div>
        </div>




    </div>
</div>



{literal}
<script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    $(function () {
        $("#cats").select2({
            multiple: true,
            ajax: {
                url: "productControllerAjax.php?do=gellastlevelcats",
                dataType: 'json',
                data: function (term, page) {
                    return {
                        term: term, //search term
                        page_limit: 10 // page size
                    };
                },
                results: function (data) {
                    return {results: data};
                }
            },
            formatResult: function (data) {
                return  data.text;
            },
            initSelection: function (element, callback) {
                var item = element.val().split(':');
                var data = {id: item[0], text: item[1]};
                callback(data);
            }
        });
    });
</script>
{/literal}
