<?php $__env->startSection('content'); ?>

    <div class="right-side">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <!-- Starting of Dashboard Withdraw Available Fund area -->
                    <div class="section-padding add-product-1">
                        <div class="row">
                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                <div class="add-product-box">
                                    <div class="add-product-header">
                                        <h2>Withdraw Available Fund</h2>
                                        <a href="<?php echo url('admin/campaign/'.$campaign->id); ?>" class="add-back-btn"><i class="fa fa-arrow-left"></i> Back</a>
                                    </div>
                                    <hr/>
                                    <div id="response" class="col-md-12">
                                        <?php if(Session::has('message')): ?>
                                            <div class="alert alert-success alert-dismissable">
                                                <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                                                <?php echo e(Session::get('message')); ?>

                                            </div>
                                        <?php endif; ?>
                                        <?php if(Session::has('error')): ?>
                                            <div class="alert alert-danger alert-dismissable">
                                                <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                                                <?php echo e(Session::get('error')); ?>

                                            </div>
                                        <?php endif; ?>
                                    </div>
                                    <form method="POST" action="<?php echo action('CampaignController@withdraws',['id'=> $campaign->id]); ?>" class="form-horizontal">
                                        <?php echo e(csrf_field()); ?>

                                        <div class="form-group">
                                            <label class="control-label col-sm-3" for="withmethod">Withdraw Method*</label>
                                            <div class="col-sm-8">
                                                <select class="form-control" name="methods" id="withmethod" required>
                                                    <option value="">Select Withdraw Method</option>
                                                    <option value="Paypal">Paypal</option>
                                                    <option value="Skrill">Skrill</option>
                                                    <option value="Payoneer">Payoneer</option>
                                                    <option value="Bank">Bank</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-sm-3" for="withdraw_amount">Withdraw Amount*</label>
                                            <div class="col-sm-8">
                                                <input type="number" name="amount" value="<?php echo e($campaign->available_fund); ?>" id="withdraw_amount" class="form-control btn-default" placeholder="Withdraw Amount" readonly required>
                                            </div>
                                        </div>


                                        <div id="paypal" style="display: none;">
                                            <div class="form-group">
                                                <label class="control-label col-sm-3" for="slug">Account Email<span class="required">*</span>
                                                </label>
                                                <div class="col-sm-8">
                                                    <input name="acc_email" value="<?php echo e(old('acc_email')); ?>" placeholder="Enter Account Email" class="form-control" type="email">
                                                </div>
                                            </div>
                                        </div>

                                        <div id="bank" style="display: none;">
                                            <div class="form-group">
                                                <label class="control-label col-sm-3" for="name">Country<span class="required">*</span>
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="acc_country">
                                                        <option value="">Select Country</option>
                                                        <?php $__currentLoopData = $countries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $country): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <option value="<?php echo e($country->name); ?>"><?php echo e($country->nicename); ?></option>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-sm-3" for="name">IBAN/Account No<span class="required">*</span>
                                                </label>
                                                <div class="col-sm-8">
                                                    <input name="iban" value="<?php echo e(old('iban')); ?>" placeholder="Enter IBAN/Account No" class="form-control" type="text">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-sm-3" for="name">Account Name<span class="required">*</span>
                                                </label>
                                                <div class="col-sm-8">
                                                    <input name="acc_name" value="<?php echo e(old('accname')); ?>" placeholder="Enter Account Name" class="form-control" type="text">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-sm-3" for="name">Address<span class="required">*</span>
                                                </label>
                                                <div class="col-sm-8">
                                                    <input name="address" value="<?php echo e(old('address')); ?>" placeholder="Enter Address" class="form-control" type="text">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="control-label col-sm-3" for="name">Bank Swift Code<span class="required">*</span>
                                                </label>
                                                <div class="col-sm-8">
                                                    <input name="swift" value="<?php echo e(old('swift')); ?>" placeholder="Enter Swift Code" class="form-control" type="text">
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <hr/>
                                        <div class="add-product-footer">
                                            <button name="addProduct_btn" type="submit" class="btn btn-success add-product_btn">Withdraw</button>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- Ending of Dashboard Withdraw Available Fund area -->


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



<?php $__env->stopSection(); ?>

<?php $__env->startSection('footer'); ?>
<script>
    $("#withmethod").change(function(){
        var method = $(this).val();
        if(method == "Bank"){

            $("#bank").show();
            $("#bank").find('input, select').attr('required',true);

            $("#paypal").hide();
            $("#cash").hide();
            $("#paypal").find('input').attr('required',false);
            $("#cash").find('input').attr('required',false);

        }
        if(method !== "Bank" && method !== "Hand Cash"){
            $("#cash").hide();
            $("#bank").hide();
            $("#bank").find('input, select').attr('required',false);
            $("#cash").find('input, select').attr('required',false);

            $("#paypal").show();
            $("#paypal").find('input').attr('required',true);
        }
        if(method == "Hand Cash"){
            $("#paypal").hide();
            $("#bank").hide();
            $("#bank").find('input, select').attr('required',false);
            $("#paypal").find('input, select').attr('required',false);

            $("#cash").show();
            $("#cash").find('input').attr('required',true);
        }
        if(method == ""){
            $("#bank").hide();
            $("#paypal").hide();
            $("#cash").hide();
        }

    })
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.includes.masterpage-admin', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>