<?php /* Smarty version Smarty-3.1.11, created on 2024-07-15 17:38:46
         compiled from "..\views\default\clientview\add.html" */ ?>
<?php /*%%SmartyHeaderCode:1466766954286e9cb92-39378144%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'ff6e1b417d661a00649590d6dc8b58fa6fa9251d' => 
    array (
      0 => '..\\views\\default\\clientview\\add.html',
      1 => 1701074585,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1466766954286e9cb92-39378144',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'msg' => 0,
    'clientnegative' => 0,
    'checkNo' => 0,
    'Programsettingdata' => 0,
    'allDelegate' => 0,
    'delegate' => 0,
    'nextId' => 0,
    'allGovernment' => 0,
    'government' => 0,
    'stores' => 0,
    'data' => 0,
    'typeClient' => 0,
    'today_date' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_669542870fbd55_80307112',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_669542870fbd55_80307112')) {function content_669542870fbd55_80307112($_smarty_tpl) {?><div class="row">
    <div class="container">

        <ol class="breadcrumb">
            <li><a href="#">خصائص عامة</a></li>
            <li><a href="clientController.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 class="form-horizontal nameToBeChecked" role="form" action="clientController.php?do=add"
                    method="post" id="spform" enctype="multipart/form-data">

                    

                    <div class="form-group">
                        <span style="   font-size: 17px; color: red;text-align: center;margin-right: 211px;"> <?php if (!empty($_smarty_tpl->tpl_vars['msg']->value)){?><?php echo $_smarty_tpl->tpl_vars['msg']->value;?>
<?php }?></span>
                    </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="txtName" id="txtName" class="form-control"
                                placeholder="اسم العميل" />
                            <div id="nameError" class="alert alert-block alert-danger fade in" style="display:none">
                                <button type="button" class="close pull-left" data-dismiss="alert"
                                    aria-hidden="true">&times;</button>
                                <h4>رسالة خطا</h4>
                                <p>هذا الاسم مستخدم من قبل</p>

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

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label"> اسم العميل E</label>
                        <div class="col-lg-4">
                            <input type="text" name="txtNameE" id="txtNameE" class="form-control"
                                placeholder=" اسم العميل   E" />
                            <div id="nameError" class="alert alert-block alert-danger fade in" style="display:none">
                                <button type="button" class="close pull-left" data-dismiss="alert"
                                    aria-hidden="true">&times;</button>
                                <h4>رسالة خطا</h4>
                                <p>هذا الاسم مستخدم من قبل</p>

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


                    <div class="form-group">
                        <label for="txtDebt" class="col-lg-2 control-label">أصل المديونية</label>
                        <div class="col-lg-4">

                            <input type="text" name="txtDebt" id="txtDebt"
                                class="form-control <?php if ($_smarty_tpl->tpl_vars['clientnegative']->value==1){?>numberinput<?php }else{ ?>positivefloat<?php }?>"
                                placeholder="0" />

                        </div>
                        <!--span style="   font-size: 17px; color: red;text-align: center;">  <?php if (!empty($_smarty_tpl->tpl_vars['checkNo']->value)){?><?php echo $_smarty_tpl->tpl_vars['checkNo']->value;?>
<?php }?></span-->
                    </div>

                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">رقم التليفون</label>
                        <div class="col-lg-4">
                            <span id="phoneError"><!-- textfieldRequiredState -->
                                <input type="text" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientfieldrequired==1){?>
                                required="required" <?php }?> name="txtPhone" id="txtPhone" class="form-control positiveNo"
                                placeholder="رقم التليفون"/>
                                <span id="phoneErrorTxt" class="textfieldRequiredMsg"></span></span>
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="txtMobile" class="col-lg-2 control-label">رقم الموبايل</label>
                        <div class="col-lg-4">
                            <span id="mobileError"><!-- textfieldRequiredState -->
                                <input type="text" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientfieldrequired==1){?>
                                required="required" <?php }?> name="txtMobile" id="txtMobile" class="form-control
                                positiveNo" placeholder="رقم الموبايل"/>
                                <span id="mobileErrorTxt" class="textfieldRequiredMsg"></span></span>
                        </div>
                    </div>

                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="txtAddress" class="col-lg-2 control-label">العنوان</label>
                        <div class="col-lg-4">
                            <input type="text" name="txtAddress" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientfieldrequired==1){?>
                            required="required" <?php }?> id="txtAddress" class="form-control" placeholder="العنوان"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtAddress" class="col-lg-2 control-label">العنوان2</label>
                        <div class="col-lg-4">
                            <input type="text" name="txtAddress2" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientfieldrequired==1){?>
                            required="required" <?php }?> id="txtAddress2" class="form-control" placeholder="العنوان2"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="txtAddress" class="col-lg-2 control-label">الدولة</label>
                        <div class="col-lg-4">
                            <input type="text" name="country" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientfieldrequired==1){?>
                            required="required" <?php }?> id="country" 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="facility" id="facility" class="form-control"
                                placeholder=" اسم   الكامل  للمنشأه " />
                            <div id="nameError" class="alert alert-block alert-danger fade in" style="display:none">
                                <button type="button" class="close pull-left" data-dismiss="alert"
                                    aria-hidden="true">&times;</button>
                                <h4>رسالة خطا</h4>
                                <p>هذا الاسم مستخدم من قبل</p>

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

                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label"> البريد الالكترونى</label>
                        <div class="col-lg-4">
                            <input type="email" name="txtemail" id="txtemail" class="form-control"
                                placeholder="البريد الالكترونى" />
                            <div id="nameError" class="alert alert-block alert-danger fade in" style="display:none">
                                <button type="button" class="close pull-left" data-dismiss="alert"
                                    aria-hidden="true">&times;</button>
                                <h4>رسالة خطا</h4>
                                <p>هذا الاسم مستخدم من قبل</p>

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


                        </div>
                    </div>

                    <div class="form-group <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->tamweenBakery==1){?> hidden <?php }?>">
                        <label for="debtLimit" class="col-lg-2 control-label"> حد الدين</label>
                        <div class="col-lg-4">
                            <input type="text" name="debtLimit" class="form-control positivefloat" id="debtLimit"
                                placeholder="" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->clientDefaultDebtLimit;?>
" />
                        </div>
                    </div>

                    <div class="form-group <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->tamweenBakery==1){?> hidden <?php }?>">
                        <label class="col-lg-2 control-label">نوع السعر </label>
                        <div class="col-lg-4">
                            <span>
                                <select name="priceTypeId" id="priceTypeId" data-placeholder="اختر "
                                    class="select2 wdt100">
                                    <option value="-1">اختر نوع السعر </option>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceall==1){?>
                                    <option value="0">جملة</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceunit==1){?>
                                    <option value="1">تجزئة</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpricehalf==1){?>
                                    <option value="2">نصف جملة</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice4==1){?>
                                    <option value="4">سعر4</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice5==1){?>
                                    <option value="5">سعر5</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice6==1){?>
                                    <option value="6">سعر6</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice7==1){?>
                                    <option value="7">سعر7</option>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice8==1){?>
                                    <option value="8">سعر8</option>
                                    <?php }?>
                                </select>
                                <!--<span class="selectInvalidMsg">اختر المحافظة</span>-->
                            </span>

                        </div>
                    </div>


                    <div class="form-group ">
                        <label class="col-lg-2 control-label">المندوب </label>
                        <div class="col-lg-4">
                            <span>
                                <select name="delegateid" id="delegateid" data-placeholder="اختر "
                                    class="select2 wdt100">


                                    <option value="-1">اختر </option>
                                    <?php  $_smarty_tpl->tpl_vars['delegate'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['delegate']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allDelegate']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['delegate']->key => $_smarty_tpl->tpl_vars['delegate']->value){
$_smarty_tpl->tpl_vars['delegate']->_loop = true;
?>
                                    <option value="<?php echo $_smarty_tpl->tpl_vars['delegate']->value['userid'];?>
"><?php echo $_smarty_tpl->tpl_vars['delegate']->value['employeename'];?>
</option>
                                    <?php } ?>
                                </select>
                                <!--<span class="selectInvalidMsg">اختر المحافظة</span>-->
                            </span>

                        </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="delegate" id="delegate" class="form-control"
                                placeholder="المندوب" />
                            <div id="nameError" class="alert alert-block alert-danger fade in" style="display:none">
                                <button type="button" class="close pull-left" data-dismiss="alert"
                                    aria-hidden="true">&times;</button>
                                <h4>رسالة خطا</h4>
                                <p>هذا الاسم مستخدم من قبل</p>

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





                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientcode==1){?>

                    <div class="form-group">

                        <label for="txtName" class="col-lg-2 control-label"><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->clientcodname;?>
</label>
                        <div class="col-lg-4">
                            <input <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientfieldrequired==1){?> required="required" <?php }?>
                            type="text" name="clientcode" id="clientcode" class="form-control"
                            placeholder="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->clientcodname;?>
" value="<?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->tamweenBakery==1){?><?php echo $_smarty_tpl->tpl_vars['nextId']->value;?>
<?php }?>"/>
                            <div id="clientcodeError" class="alert alert-block alert-danger fade in"
                                style="display:none">
                                <button type="button" class="close pull-left" data-dismiss="alert"
                                    aria-hidden="true">&times;</button>
                                <h4>رسالة خطا</h4>
                                <p>هذا الكود مستخدم من قبل</p>

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

                    <?php }?>


                    <!-- =================================================   -->
                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientserial==1){?>
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">الرقم التسلسلي</label>
                        <div class="col-lg-4">

                            <input type="text" name="clientid" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientfieldrequired==1){?>
                            required="required" <?php }?> disabled id="clientid" class="form-control" value="<?php echo $_smarty_tpl->tpl_vars['nextId']->value;?>
"/>

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

                    </div>
                    <?php }?>
                    <div class="form-group">
                        <label for="taxnumber" class="col-lg-2 control-label">الرقم الضريبى</label>
                        <div class="col-lg-4">
                            <input type="text" name="taxnumber" class="form-control" <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->ebill==1){?> required <?php }?>/>
                            <div class="clearfix"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="taxnumber" class="col-lg-2 control-label">الرقم السجل التجارى </label>
                        <div class="col-lg-4">
                            <input type="text" name="commercial" class="form-control" />
                            <div class="clearfix"></div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="taxnumber" class="col-lg-2 control-label">الرقم ضريبة القيمة المضافه </label>
                        <div class="col-lg-4">
                            <input type="text" name="valtaxnumber" class="form-control" />
                            <div class="clearfix"></div>
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="txtName" class="col-lg-2 control-label">RFID العميل</label>
                        <div class="col-lg-4">
                            <input type="text" name="clientRFID" id="clientRFID" class="form-control" value="" />
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->tamweenBakery==1){?>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">افراد التموين</label>
                        <div class="col-lg-4">
                            <input type="text" name="noOfPersonsTamween" id="noOfPersonsTamween"
                                class="form-control positiveNo" required="required" />
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label class="col-lg-2 control-label">افراد العيش</label>
                        <div class="col-lg-4">
                            <input type="text" name="noOfPersonsDa3m" id="noOfPersonsDa3m"
                                class="form-control positiveNo" required="required" />
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label class="col-lg-2 control-label">رقم البطاقة</label>
                        <div class="col-lg-4">
                            <span id="cardNumError"><!-- textfieldRequiredState -->
                                <input type="text" name="cardNum" id="cardNum" class="form-control positiveNo" />
                                <span id="cardNumErrorTxt" 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="text" name="cardPassword" id="cardPassword" class="form-control positiveNo"
                                required="required" />
                        </div>
                    </div>
                    <?php }?>

                    <!-- =================================================   -->
                    <!--                    <div class="form-group">
                                            <label for="txtAddress" class="col-lg-2 control-label">المحافظة </label>
                                            <div class="col-lg-4">
                                                <span id="spryselect1">
                                                    <select name="clientgovernmentid" id="clientgovernmentid"  data-placeholder="اختر " class="select2 wdt100">


                                                        <option value="0">اختر المحافظة </option>
                                                        <?php  $_smarty_tpl->tpl_vars['government'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['government']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allGovernment']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['government']->key => $_smarty_tpl->tpl_vars['government']->value){
$_smarty_tpl->tpl_vars['government']->_loop = true;
?>
                                                        <option value="<?php echo $_smarty_tpl->tpl_vars['government']->value->governmentid;?>
"><?php echo $_smarty_tpl->tpl_vars['government']->value->governmentname;?>
 </option>
                                                        <?php } ?>
                                                    </select>
                                                    <span class="selectInvalidMsg">اختر المحافظة</span></span>

                                            </div>
                                        </div>-->
                    <!-- =================================================   -->


                    <!-- =================================================   -->
                    <div class="form-group <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->tamweenBakery==1){?> hidden <?php }?>">
                        <label for="txtAddress" class="col-lg-2 control-label">الشركة - المنطقة</label>
                        <div class="col-lg-4">
                            <span id="spryselect1">
                                <input <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientfieldrequired==1){?> required="required" <?php }?>
                                type="hidden" name="clientareaid" value="0" id="clientareaid"/>
                                <span class="selectInvalidMsg">اختر الشركة - المنطقة</span></span>

                        </div>
                    </div>

                    <!-- =================================================   -->


                    <!-- =================================================   -->

                    <div class="form-group">
                        <label class="col-lg-2 control-label"> عدد الايام الاجلة</label>
                        <div class="col-lg-4">
                            <input type="text" name="postponeDays" class="form-control positiveNo" id="postponeDays"
                                value="" />
                        </div>
                    </div>
                    <!-- =================================================   -->

                    <div class="form-group <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->tamweenBakery==1){?> hidden <?php }?>">
                        <label class="col-lg-2 control-label"> خصم خاص</label>
                        <div class="col-lg-1">
                            <input type="checkbox" name="specialDiscount" id="specialDiscount" value="1" />
                        </div>
                        <div style="display: none" id="specialDiscountVal_div">
                            <label class="col-lg-1 control-label">النسبة </label>
                            <div class="col-lg-2">
                                <input type="text" name="specialDiscountVal" id="specialDiscountVal"
                                    class="form-control positivefloat" placeholder="" value="" />
                            </div>
                        </div>
                    </div>
                    <!-- =================================================   -->

                    <div class="form-group">
                        <label class="col-lg-2 control-label">صورة البطاقة</label>
                        <div class="col-lg-4">
                            <input type="file" name="file" id="file" />
                        </div>
                    </div>


                    <!-- =================================================   -->

                    <div class="form-group">
                        <label for="textDetails" class="col-lg-2 control-label">التعليق</label>
                        <div class="col-lg-4">

                            <textarea class="form-control" rows="3" name="textDetails" id="textDetails"></textarea>

                        </div>
                    </div>

                    <!-- =================================================   -->

                    <div class="form-group">
                        <label for="debtLimit" class="col-lg-2 control-label">الباسورد</label>
                        <div class="col-lg-4">
                            <input type="text" name="password" class="form-control" placeholder="" value="" />
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->mandobCollectionRatio!=1){?> hidden <?php }?>">
                        <label class="col-lg-2 control-label">نسبة المندوب </label>
                        <div class="col-lg-4">
                            <input type="text" name="mandobCollectRatio" id="mandobCollectRatio"
                                class="form-control positivefloat" placeholder="" value="" />
                        </div>
                    </div>

                    <!-- =================================================   -->
                    <div class="form-group <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->tamweenBakery==1){?> hidden <?php }?>">
                        <label for="textDetails" class="col-lg-2 control-label">المخزن</label>
                        <div class="col-lg-9">
                            <div class="col-lg-3">
                                <label>
                                    <input type="checkbox" class="ckstore" name="store_all" id="store_all"
                                        checked="checked" value="1" />
                                    كل المخازن
                                </label>
                            </div>
                            <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['stores']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
?>
                            <div class="col-lg-3">
                                <label>
                                    <input type="checkbox" class="clientStore ckstore" name="store<?php echo $_smarty_tpl->tpl_vars['data']->value->storeId;?>
"
                                        id="store<?php echo $_smarty_tpl->tpl_vars['data']->value->storeId;?>
" checked="checked" value="1" />
                                    <?php echo $_smarty_tpl->tpl_vars['data']->value->storeName;?>

                                </label>
                            </div>
                            <?php } ?>
                        </div>
                    </div>
                    <!-- =================================================   -->
                    <div class="form-group <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->tamweenBakery==1){?> hidden <?php }?>">
                        <label for="textDetails" class="col-lg-2 control-label">نوع العميل</label>
                        <div class="col-lg-9">
                            <div class="col-lg-3">
                                <label>
                                    <input type="checkbox" class="cktype" name="typeClient_all" id="typeClient_all"
                                        checked="checked" value="1" />
                                    كل انوع العملاء
                                </label>
                            </div>
                            <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['typeClient']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
?>
                            <div class="col-lg-3">
                                <label>
                                    <input type="checkbox" class="typeClient cktype" name="type<?php echo $_smarty_tpl->tpl_vars['data']->value->typeId;?>
"
                                        id="type<?php echo $_smarty_tpl->tpl_vars['data']->value->typeId;?>
" checked="checked" value="1" />
                                    <?php echo $_smarty_tpl->tpl_vars['data']->value->typeName;?>

                                </label>
                            </div>
                            <?php } ?>
                        </div>
                    </div>

                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->ebillclient==1){?>
                    <div class="tab-pane" id="EBill"><!-- start the 3rd tab -->
                        <div class="form-group">
                            <label class="col-lg-2 control-label"> المحافظة</label>
                            <div class="col-lg-4">
                                <input type="text" required name="egovernorate" id="egovernorate" class="form-control"
                                    value="" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label"> المركز (المدينة)</label>
                            <div class="col-lg-4">
                                <input type="text" required name="ecity" id="ecity" class="form-control" value="" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label"> الشارع</label>
                            <div class="col-lg-4">
                                <input type="text" required name="estreet" id="estreet" class="form-control" value="" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label"> رقم المبنى</label>
                            <div class="col-lg-4">
                                <input type="text" required name="ebuildingNum" id="ebuildingNum" class="form-control"
                                    value="" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">النوع فى الضرائب</label>
                            <div class="col-lg-4">
                                <select class="select2" required name="etaxType" id="etaxType">
                                    <option></option>
                                    <option value="P">فردى (P)</option>
                                    <option value="B">أعمال (B)</option>
                                    <option value="F">أجنبى (F)</option>
                                </select>
                            </div>
                        </div>
                        <!--   <div class="form-group">
                             <label class="col-lg-2 control-label">الرقم الضريبى</label>
                             <div class="col-lg-4">
                                 <input type="text" required name="eTaxNum" id="eTaxNum" class="form-control" value=""/>
                             </div>
                         </div> -->
                        <input type="hidden" name="ebill" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->ebill;?>
" />


                    </div>
                    <?php }?>

                    <!-- =================================================   -->
                    <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->clientdetail==0){?>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> تاريخ الحجز </label>
                        <div class="col-lg-4">
                            <input type="text" name="booking_date" class="form-control awdatepicker" autocomplete="off"
                                data-date-format="yyyy-mm-dd" value="<?php echo $_smarty_tpl->tpl_vars['today_date']->value;?>
" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> تاريخ البروفه </label>
                        <div class="col-lg-4">
                            <input type="text" name="rehearsal_date" class="form-control awdatepicker"
                                autocomplete="off" data-date-format="yyyy-mm-dd" value="<?php echo $_smarty_tpl->tpl_vars['today_date']->value;?>
" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-lg-2 control-label">
                            <h3>مقاس الجاكيت </h3>
                        </label>
                        <div class="col-lg-4">
                            <input type="text" name="size_jackt" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> كتف </label>
                        <div class="col-lg-4">
                            <input type="text" name="shoulder" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> كم </label>
                        <div class="col-lg-4">
                            <input type="text" name="how_much" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> طول </label>
                        <div class="col-lg-4">
                            <input type="text" name="jacket_length" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> وسع </label>
                        <div class="col-lg-4">
                            <input type="text" name="jacket_expand" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> رأس الكم </label>
                        <div class="col-lg-4">
                            <input type="text" name="sleeve_head" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-9 offset-lg-3 control-label">
                            <h3>مقاس البنطلون </h3>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> الكمر </label>
                        <div class="col-lg-4">
                            <input type="text" name="pants_beam" class="form-control " value="" />
                        </div>
                        <label class="col-lg-2 control-label"> الحجر </label>
                        <div class="col-lg-4">
                            <input type="text" name="pants_stone" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> الهانش </label>
                        <div class="col-lg-4">
                            <input type="text" name="pants_hash" class="form-control " value="" />
                        </div>
                        <label class="col-lg-2 control-label"> الركبة </label>
                        <div class="col-lg-4">
                            <input type="text" name="pants_knee" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> الفخذ </label>
                        <div class="col-lg-4">
                            <input type="text" name="pants_thigh" class="form-control " value="" />
                        </div>
                        <label class="col-lg-2 control-label"> الرجل </label>
                        <div class="col-lg-4">
                            <input type="text" name="pants_man" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> السماناه </label>
                        <div class="col-lg-4">
                            <input type="text" name="samanah" class="form-control " value="" />
                        </div>
                        <label class="col-lg-2 control-label"> الطول </label>
                        <div class="col-lg-4">
                            <input type="text" name="pants_length" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-9 offset-lg-3 control-label">
                            <h3>مقاس السديري </h3>
                        </label>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> بطن </label>
                        <div class="col-lg-4">
                            <input type="text" name="sudairi_belly" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> صدر </label>
                        <div class="col-lg-4">
                            <input type="text" name="sudairi_chest" class="form-control " value="" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label"> طول </label>
                        <div class="col-lg-4">
                            <input type="text" name="sudairi_length" class="form-control " value="" />
                        </div>
                    </div>
                    <input type="hidden" name="clientdetail" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->clientdetail;?>
" />
                    <?php }?>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">نوع العميل فى شجرة الحسابات</label>
                        <div class="col-lg-9">
                            <div class="radio-inline">
                                <label>
                                    <input value="0" class="noradioR" name="clientTypeForTree" type="radio"
                                        checked="checked">
                                    عميل محلى </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="1" class="radioR" name="clientTypeForTree" type="radio">
                                    عميل خارجى </label>
                            </div>

                        </div>
                    </div>

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




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




    </div>
</div>





<script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "real");
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", { invalidValue: "0", isRequired: false });
</script>


<script type="text/javascript">
    $('#store_all').live('click', function () {
        if ($(this).attr('checked') == 'checked') {
            $('.clientStore').attr('checked', 'checked');
            $('.clientStore').attr('disabled', 'disabled');
        } else {
            $('.clientStore').removeAttr('checked');
            $('.clientStore').removeAttr('disabled');
        }
    });

    $('#typeClient_all').live('click', function () {
        if ($(this).attr('checked') == 'checked') {
            $('.typeClient').attr('checked', 'checked');
            $('.typeClient').attr('disabled', 'disabled');
        } else {
            $('.typeClient').removeAttr('checked');
            $('.typeClient').removeAttr('disabled');
        }
    });

    $('#spbutton').live('click', function (e) {


        if ($('#spform').validate().form()) {
            //ckeck name
            var tableName = 'client';
            var inputName = 'txtName';
            var name = $("#" + inputName).val();
            $.ajax({
                url: 'checkRedundantNames.php?name=' + name + '&tablename=' + tableName,
                success: function (data) {
                    //alert(data);
                    if (data == '0') {
                        $("#nameError").css("display", "none");
                        //return true;
                        //check code
                        /*----------------------------------------------------*/
                        var tableName = 'clientcode';
                        var inputName = 'clientcode';
                        var name = $("#" + inputName).val();
                        $.ajax({
                            url: 'checkRedundantNames.php?name=' + name + '&tablename=' + tableName,
                            success: function (data) {
                                //alert(data);
                                if (data == '0') {
                                    $("#clientcodeError").css("display", "none");
                                    //return true;
                                    var phone = $('#txtPhone').val();
                                    var mobile = $('#txtMobile').val();
                                    var cardNum = $('#cardNum').val();
                                    var uFlag = checkOtherUniquesIfExist(0, phone, mobile, cardNum);
                                    if (uFlag == 1) {
                                        var myForm = document.getElementById("spform");
                                        var SS = Spry.Widget.Form.validate(myForm);
                                        if (SS == true) {
                                            var aStoreIsSelected = 0;
                                            $('.ckstore').each(function () {
                                                if ($(this).attr('checked') == 'checked') {
                                                    aStoreIsSelected = 1;
                                                    return;
                                                }
                                            });
                                            if (aStoreIsSelected == 1) {
                                                if (!$('#spbutton').hasClass("processing")) {
                                                    $('#spbutton').addClass("processing");
                                                    myForm.submit();
                                                    //$('#spbutton').unbind('click');
                                                }
                                            } else {
                                                alert('عفوا لابد من اختيار مخزن على الاقل');
                                                e.preventDefault();
                                            }
                                        }
                                    } else {
                                        e.preventDefault();
                                        return false;
                                    }

                                } else if (data == '1') {
                                    $("#" + inputName).val("");
                                    $("#" + inputName).focus();
                                    e.preventDefault();
                                    $("#clientcodeError").css("display", "block");
                                    return false;
                                }
                            }
                        });

                        /*----------------------------------------------------*/

                    } else if (data == '1') {
                        $("#" + inputName).val("");
                        $("#" + inputName).focus();
                        $("#nameError").css("display", "block");
                        return false;
                    }
                }
            });

        } else {
            // alert('xx');

            e.preventDefault();

        }




    });




</script>
<?php }} ?>