<?php /* Smarty version Smarty-3.1.11, created on 2025-12-30 20:00:01
         compiled from "..\views\default\partnerwithdrawalview\add.html" */ ?>
<?php /*%%SmartyHeaderCode:2272269541321e14fd4-13044939%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '861911eba8e6ee6634839d771e63ab6a7d16740b' => 
    array (
      0 => '..\\views\\default\\partnerwithdrawalview\\add.html',
      1 => 1752437506,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2272269541321e14fd4-13044939',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'partnerData' => 0,
    'partner' => 0,
    'saveData' => 0,
    'currency' => 0,
    'userData' => 0,
    'allSave' => 0,
    'data' => 0,
    'bank' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_69541321f3beb5_17559718',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_69541321f3beb5_17559718')) {function content_69541321f3beb5_17559718($_smarty_tpl) {?>

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

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




                    <div class="form-group">
                        <label for="partnerid" class="col-lg-2 control-label">الشريك</label>
                        <div class="col-lg-4">

                            <span id="spryselect1">
                                <select class="select2 wdt100" name="partnerid" id="partnerid">
                                    <option value="-1">اختر شريك</option>

                                    <?php  $_smarty_tpl->tpl_vars['partner'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['partner']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['partnerData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['partner']->key => $_smarty_tpl->tpl_vars['partner']->value){
$_smarty_tpl->tpl_vars['partner']->_loop = true;
?>

                                    <option value="<?php echo $_smarty_tpl->tpl_vars['partner']->value->partnerid;?>
"><?php echo $_smarty_tpl->tpl_vars['partner']->value->partnername;?>
</option>
                                    <?php } ?>

                                </select>
                                <span class="selectInvalidMsg"> *</span></span>

                        </div>
                    </div>

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



                    <!--                    <div class="form-group">
                                            <label for="savecurrentvalue" class="col-lg-2 control-label">قيمة الخزنة الحالية</label>
                                            <div class="col-lg-4">


                                                <div class="input-group">

                                                    <input type="text" name="savecurrentvalue" id="savecurrentvalue" value="<?php echo $_smarty_tpl->tpl_vars['saveData']->value->savecurrentvalue;?>
" readonly="readonly" class="form-control" />

                                                    <span class="input-group-addon"><?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</span>
                                                </div>

                                            </div>
                                        </div>-->

                    <!-- =================================================   -->
                    <div class="form-group">
                        <label for="storereporttype" class="col-lg-2 control-label">نوع العملية</label>
                        <div class=" col-lg-4">
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="partenrwithdrawaltype" id="addvalue" value="0" onclick="showhidediv(this);" checked>
                                    ايداع </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input type="radio" name="partenrwithdrawaltype" id="discountvalue" value="1" onclick="showhidediv(this);">
                                    سحب </label>
                            </div>
                        </div>
                    </div>

                    <!-- =================================================   -->
                    <div class="form-group">

                        <label for="partnerwithdrawalvalue" class="col-lg-2 control-label" id="two"  >قيمة الايداع</label>

                        <label for="partnerwithdrawalvalue" class="col-lg-2 control-label" id="container"  style="display:none">قيمة السحب</label>



                        <div class="col-lg-4">


                            <div class="input-group">
                                <!--onKeyUp="checksaveValue();"-->

                                <span id="sprytextfield2">
                                    <input type="text" name="partnerwithdrawalvalue" id="partnerwithdrawalvalue" value="0"   class="form-control positivefloat" autocomplete="off" placeholder="قيمة السحب"/>
                                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">ادخل القيمة صحيحة</span></span>

                                <span class="input-group-addon"><?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</span>
                            </div>


                        </div>
                    </div>


                    <!-- =================================================   -->
                    <!--    <div class="form-group">
                          <label for="partnerwithdrawalvalue" class="col-lg-2 control-label">قيمة السحب</label>
                         <div class="col-lg-4">


                          <div class="input-group">


                          <span id="sprytextfield1">
                                       <input type="text" name="partnerwithdrawalvalue" id="partnerwithdrawalvalue" value="0" onKeyUp="checksaveValue();"  class="form-control numberinput" placeholder="قيمة السحب"/>
                                             <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">ادخل القيمة صحيحة</span></span>

                   <span class="input-group-addon"><?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</span>
                 </div>


                        </div>
                       </div>-->
                    <!-- =================================================   -->
                    <div class="form-group">
                        <label class="col-lg-2 control-label">طريقة الدفع</label>
                        <div class="col-lg-4">
                            <div class="radio-inline">
                                <label>
                                    <input value="0"  name="paymethod" id="PMSave" class="PMethod" checked="checked"   type="radio" />

                                    خزنة </label>
                            </div>
                            <div class="radio-inline">
                                <label>
                                    <input value="1" name="paymethod" id="PMBank" class="PMethod" type="radio" />
                                    بنك </label>
                            </div>

                        </div>
                    </div>
                    <div id="save-div">
                        <?php if ($_smarty_tpl->tpl_vars['userData']->value->searchinonesave==0){?>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">الخزنة</label>
                            <div class="col-lg-4">
                                <span id="spryselect3">
                                    <select name="saveid"  id="saveid" class="select2">
                                        <option value="-1">اختر الخزنة</option>
                                        <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allSave']->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;
?>
                                        <option value="<?php echo $_smarty_tpl->tpl_vars['data']->value->saveid;?>
" <?php if ($_smarty_tpl->tpl_vars['userData']->value->saveid==$_smarty_tpl->tpl_vars['data']->value->saveid){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['data']->value->savename;?>
</option>
                                        <?php } ?>
                                    </select>
                                    <span class="selectInvalidMsg">اختر الخزنة</span></span>
                            </div>
                        </div>
                        <?php }else{ ?>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">الخزنة</label>
                            <div class="col-lg-4">
                                <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allSave']->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;
?>
                                <?php if ($_smarty_tpl->tpl_vars['userData']->value->saveid==$_smarty_tpl->tpl_vars['data']->value->saveid){?><?php echo $_smarty_tpl->tpl_vars['data']->value->savename;?>
<?php }?>
                                <input type="hidden" name="saveid" id="saveid" value="<?php echo $_smarty_tpl->tpl_vars['userData']->value->saveid;?>
"/>
                                <?php } ?>
                            </div>
                        </div>
                        <?php }?>


                    </div>
                    <div id="bank-div" style="display: none">
                        <div class="form-group">
                            <label class="col-lg-2 control-label">البنك</label>
                            <div class="col-lg-4">
                                <span id="spryselect4">
                                    <select name="bankid"  id="bankid" class="select2">
                                        <option value="-1">اختر البنك</option>
                                        <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['bank']->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;
?>
                                        <option value="<?php echo $_smarty_tpl->tpl_vars['data']->value->bankid;?>
"><?php echo $_smarty_tpl->tpl_vars['data']->value->bankname;?>
</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 id="spryselect5">
                                    <select name="bankaccountid"  id="bankaccountid">
                                        <option></option>
                                    </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 id="sprytextfield3">
                                    <input name="checkNo" id="checkNo" type="text"   class="form-control" />
                                    <span class="textfieldRequiredMsg">*</span></span>
                            </div>
                        </div>
                    </div>

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


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

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

                        </div>
                    </div>

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

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




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




    </div>
</div>





<script type="text/javascript">


    

    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "real");
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {isRequired: false, invalidValue: "-1"});
    var spryselect3 = new Spry.Widget.ValidationSelect("spryselect3", {invalidValue: "-1", isRequired: false});
    var spryselect4 = '';
    var spryselect5 = '';
    var sprytextfield3 = '';
    $(".PMethod").live('change', function () {
        var whatis = $(this).val();
        if (whatis == 0) {
            $('#save-div').show();
            $('#bank-div').hide();
            spryselect3 = new Spry.Widget.ValidationSelect("spryselect3", {invalidValue: "-1", isRequired: false});
            spryselect4.destroy();
            spryselect5.destroy();
            sprytextfield3.destroy();
        } else if (whatis == 1) {
            $('#save-div').hide();
            $('#bank-div').show();
            spryselect3.destroy();
            spryselect4 = new Spry.Widget.ValidationSelect("spryselect4", {invalidValue: "-1", isRequired: false});
            spryselect5 = new Spry.Widget.ValidationSelect("spryselect5");
            sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
        }

    });
    $("#bankid").live('change', function () {
        var id = $(this).val();
        $.post("projectControllerAjax.php?do=getbankaccount", {id: id}, function (data) {
            $("#bankaccountid").html(data);
        });
    });
</script>


<script type="text/javascript">

    function showhidediv(rad) {
        var rads = document.getElementsByName(rad.name);
        document.getElementById('two').style.display = (rads[0].checked) ? 'block' : 'none';
        document.getElementById('container').style.display = (rads[1].checked) ? 'block' : 'none';
        $("#partnerwithdrawalvalue").val(0);
    }
</script>

<?php }} ?>