Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/medad.corals.io/storage/framework/views/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/medad.corals.io/storage/framework/views/6c9edc191f6aa8875916e8fe45410b5e2a5f5118.php
<?php echo CoralsForm::openForm($purchaseOrder,['files' => true, 'data-table' => '#PurchaseOrdersDataTable',]); ?>

<div class="row">
    <?php if($actingAs == 'customer'): ?>
        <div class="col-md-4">
            <?php echo CoralsForm::select('customer_company_id','Medad::attributes.branch.customer_company',[$customerBranch->parent_id=>$customerBranch->company->name],  true, $customerBranch->parent_id,[ 'readOnly'=>true]); ?>

            <?php echo CoralsForm::select('customer_branch_id','Medad::attributes.branch.customer_branch', \Medad::getCompanyBranches($customerCompany), true, optional($customerBranch)->id,['data-selected_value'=>optional($customerBranch)->id,
                'class'=>'dependent-select',
                'data'=>  [
                   'dependency-field'=>'project_id',
                   'dependency-ajax-url'=> url('medad/company/projects-list'),
                ]],'select2'); ?>


        </div>
        <div class="col-md-4">
            <?php echo CoralsForm::select('supplier_company_id','Medad::attributes.branch.supplier_company',\Medad::getCompanySuppliers($customerBranch), true, $supplierCompany->id, [
               'id'=>'suppliers',
                'class'=>'dependent-select',
                'data'=>  [
                   'dependency-field'=>'supplier_branch_id',
                   'dependency-ajax-url'=> url('medad/company/branches-list'),
                ]
                ],'select2'); ?>



            <?php echo CoralsForm::select('supplier_branch_id','Medad::attributes.branch.supplier_branch', [], true, optional($supplierBranch)->id, ['data-selected_value'=> optional($supplierBranch)->id],'select2'); ?>


        </div>
        <div class="col-md-4">
            <?php echo CoralsForm::select('project_id','Medad::module.project.title_singular',[], user()->hasRole('medad_project_manager') ? true:false,null,['data-selected_value'=>$purchaseOrder->project_id], 'select2'); ?>


            <?php echo CoralsForm::select('receivers[]','Medad::attributes.receivers',\Medad::getCompanyUsers('medad_company_member', $company),  true, $purchaseOrder->receivers()->pluck('user_id')->toArray(), ['multiple'=>true,'id'=>'receivers',], 'select2'); ?>


        </div>
    <?php else: ?>
        <div class="col-md-4">
            <?php echo CoralsForm::select('customer_company_id','Medad::attributes.branch.customer_company',\Medad::getCompanyCustomers($supplierBranch),  true, $customerCompany->id, [
        'class'=>'dependent-select',
           'data'=>  [
              'dependency-field'=>'customer_branch_id',
              'dependency-ajax-url'=> url('medad/company/branches-list'),
           ]
           ],'select2'); ?>


            <?php echo CoralsForm::select('customer_branch_id','Medad::attributes.branch.customer_branch', [],true, optional($customerBranch)->id, ['data-selected_value'=>optional($customerBranch)->id,
                'class'=>'dependent-select',
                'data'=>  [
                   'dependency-field'=>'project_id',
                   'dependency-ajax-url'=> url('medad/company/projects-list'),
                ]],'select2'); ?>


            
        </div>
        <div class="col-md-4">
            <?php echo CoralsForm::select('supplier_company_id','Medad::attributes.branch.supplier_company', [$supplierBranch->parent_id=>$supplierBranch->company->name],  true, $supplierBranch->parent_id, ['readOnly'=>true,]); ?>


            <?php echo CoralsForm::select('supplier_branch_id','Medad::attributes.branch.supplier_branch',  \Medad::getCompanyBranches($supplierCompany),true, optional($supplierBranch)->id, [],'select2'); ?>

        </div>
    <?php endif; ?>
</div>

<div class="row">
    <div class="col-md-4">
        <?php echo CoralsForm::text('code', 'Medad::attributes.code', false,null,['help_text'=>'Medad::attributes.code_help' ]); ?>


        <?php echo CoralsForm::select('owner_id', 'Medad::attributes.owner',\Medad::getCompanyUsers(),true,\Auth::user()->id, [],'select2'); ?>

        <div class="row">
            <div class="col-md-6">
                <?php echo CoralsForm::number('types_count', 'Medad::attributes.types_count',true,null,['min'=>0]); ?>

            </div>
            <div class="col-md-6">
                <?php echo CoralsForm::number('total_quantity', 'Medad::attributes.total_quantity',true,null,['step'=>0.01,'min'=>0]); ?>

            </div>
        </div>
        <?php echo CoralsForm::number('amount', 'Medad::attributes.amount', true,null,['step'=>0.01,'min'=>0]); ?>



    </div>
    <div class="col-md-4">
        <?php if($purchaseOrder->exists): ?>
            <?php echo CoralsForm::select('quotation_id','Medad::attributes.purchase_order.quotation',[$purchaseOrder->quotation->id=>$purchaseOrder->quotation->code],false,$purchaseOrder->quotation->id , ['readOnly'=>true,]); ?>

        <?php endif; ?>

        <?php echo CoralsForm::text('address','Utility::attributes.location.address', true,null,['id'=>'_autocomplete','placeholder'=>'Utility::attributes.location.address_placeholder']); ?>


        <?php echo CoralsForm::text('lat','Utility::attributes.location.lat',true); ?>


        <?php echo CoralsForm::text('long','Utility::attributes.location.long',true); ?>

    </div>
</div>
<?php echo CoralsForm::textarea('notes','Medad::attributes.notes', false, null,['class'=>'ckeditor-simple']); ?>


<?php echo $__env->make('Media::attachments_section',[
               'hasForm'=> false,
                'object'=>$purchaseOrder,
                 ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<?php echo CoralsForm::customFields($purchaseOrder); ?>


<?php echo CoralsForm::formButtons('',[],['show_cancel'=>false],[[
                            'label'=>trans('Medad::attributes.save_and_open'),
                            'type'=>'submit',
                            'attributes'=>['name'=>'status-with-submit','value'=>'open','class'=>'btn btn-primary mr-3'],
                     ]]); ?>


<?php echo CoralsForm::closeForm($purchaseOrder); ?>


<script>
    $(document).ready(function () {
        $('.dependent-select').trigger('change');
    });

    <?php if($actingAs == 'customer'): ?>
    var selectedReceivers = <?php echo json_encode($purchaseOrder->receivers()->pluck('user_id')->toArray(), 15, 512) ?>;
    var selectedSuppliers =<?php echo json_encode($supplierCompany->id, 15, 512) ?>;

    var companyId = <?php echo json_encode($company->id, 15, 512) ?>;

    $('#project_id').on('change', function () {

        let ele = $(this)
        let project_id = ele.val();

        $.ajax({
            url: '<?php echo e(url($customerBranch->getShowURL().'/get-project-values')); ?>',
            type: 'get',
            data: {'id': project_id, 'company': companyId, 'target': 'both'},
            dataType: 'json',
            success: function (data) {
                let elementData = [];

                elementData.push({'id': '', 'text': ''});

                $.each(data.receivers, function (index, value) {
                    elementData.push({'id': index, 'text': value});
                });

                $('#receivers').select2().empty().select2({
                    data: elementData
                });

                elementData = [];

                elementData.push({'id': '', 'text': ''});

                $.each(data.suppliers, function (index, value) {
                    elementData.push({'id': index, 'text': value});
                });

                $('#suppliers').select2().empty().select2({
                    data: elementData
                });

                if (selectedReceivers) {
                    $('#receivers').val(selectedReceivers).trigger('change');
                    selectedReceivers = null;
                }
                if (selectedSuppliers) {
                    $('#suppliers').val(selectedSuppliers).trigger('change');
                    selectedSuppliers = null;
                }
            },
            error: function () {
            }
        });
    });
    <?php endif; ?>
</script>

<script>
    initAutocomplete()
</script>
<?php /**PATH /home/corals/medad.corals.io/Corals/modules/Medad/resources/views/purchase_orders/create_edit.blade.php ENDPATH**/ ?>

Spamworldpro Mini