<script>
    $(document).ready(function (){
        $('#branch').select2();
        $('#expense-ledgers').select2();

    });
</script>
<?php echo Form::open(['action'=>'Finance\AccVendorsController@storeNewVendor', 'id'=>'add-company-vendor', 'method'=>'POST']); ?>

<?php if(count(app('CompanyBranches')) > 0): ?>
    <div class="guestDetails_input">
        <div class="guestDetails_inputLabel" >Branch:<span class="error">*</span></div>
        <div class="guestDetails_input">
            <select id="branch" name="branch" style="min-width: 100px">
                
                <?php $__currentLoopData = app('CompanyBranches'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $branch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($branch->id); ?>"><?php echo e($branch->name); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>
    </div>
<?php endif; ?>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        <?php echo Form::label('name', 'Vendor Name'); ?><span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <?php echo Form::text('name', '', ['size'=>'45', 'class'=>'input-text-height']); ?>

    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        <?php echo Form::label('contact-person', 'Contact Person'); ?><span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <?php echo Form::text('contact-person', '', ['size'=>'45', 'class'=>'input-text-height']); ?>

    </div>
</div>
<div class="guestDetails_inputDivider"></div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        <?php echo Form::label('acc-no', 'Account Number'); ?><span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <?php echo Form::text('acc-no', '', ['size'=>'25', 'class'=>'input-text-height']); ?>

    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        <?php echo Form::label('phone', 'Phone Number'); ?><span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <?php echo Form::text('phone', '', ['size'=>'25', 'class'=>'input-text-height']); ?>

    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        <?php echo Form::label('email', 'Email Address'); ?><span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <?php echo Form::text('email-address', '', ['size'=>'25', 'class'=>'input-text-height']); ?>

    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        <?php echo Form::label('kra', 'PIN No.'); ?><span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <?php echo Form::text('kra', '', ['size'=>'25', 'class'=>'input-text-height']); ?>

    </div>
</div>
<div class="guestDetails_inputDivider"></div>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        <?php echo Form::label('ledger', 'Expense/Purchases Account'); ?><span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <select name="ledger-id" id="expense-ledgers" style="width: 700px">
            <optgroup label="Expenditure Ledgers"></optgroup>
            <option value="">--Select Expense Account--</option>
            <?php $__currentLoopData = $expenseMainAccount; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php if($row->ledgerAccounts != null): ?>
                    
                    <?php $__currentLoopData = $row->ledgerAccounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $account): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo $account->id; ?>"><?php echo $account->acc_name; ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <optgroup label="Purchases Ledgers"></optgroup>
            <?php $__currentLoopData = $purchasesMainAccount; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php if($row->ledgerAccounts != null): ?>
                    
                    <?php $__currentLoopData = $row->ledgerAccounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $account): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo $account->id; ?>"><?php echo $account->acc_name; ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
    </div>
</div>
<?php echo Form::close(); ?>


<?php /**PATH /home/zedarroot/public_html/edwulp/resources/views/finance/vendors/add-company-vendor.blade.php ENDPATH**/ ?>