File manager - Edit - /home/wwwroot/camplus.hk/master.camplus.hk/public_html/application/modules/purchase_request/views/budget_item.php
Back
<!-- BEGIN DATATABLE SCRIPTS --> <link href="<?php echo base_url(); ?>assets/custom/datatables/datatables.min.css" rel="stylesheet" > <script src="<?php echo base_url(); ?>assets/custom/datatables/datatables.min.js"></script> <script src="<?php echo base_url(); ?>assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js"></script> <script src="<?php echo base_url(); ?>assets/custom/js/camplus-datatable.js"></script> <link href="<?php echo base_url(); ?>assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet" > <script src="<?php echo base_url(); ?>assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script> <!-- END DATATABLE SCRIPTS --> <link href="<?php echo base_url(); ?>assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.css" rel="stylesheet" > <script src="<?php echo base_url(); ?>assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script> <link href="<?php echo base_url(); ?>assets/global/plugins/bootstrap-editable/bootstrap-editable/css/bootstrap-editable.css" rel="stylesheet"> <script src="<?php echo base_url(); ?>assets/global/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"></script> <?php require_once('progress_bar.php'); ?> <div class="portlet light bordered"> <div class="portlet-title"> <div class="caption" style="display: inline-flex;"> <i class="icon-docs font-dark"></i> <span class="bold"><?php echo(!empty($myBI) && $myBI)?$this->lang->line('my') .' ':''; ?><?php echo $this->lang->line('budget_items'); ?></span> <?php if(!empty($myBI) && $myBI) {?> <form method="post" id="filterForm" style="margin: -5px 0 0 10px;"> <select class="select2" name="financial_year" id="financial_year" onchange="filterByYear()"> <?php foreach ($allFinancialYears as $year) {?> <option value="<?php echo $year['id'];?>" <?php if ($default_financial_year == $year['id']) echo "selected";?> ><?php echo $this->lang->line('in_year') ?> <?php echo $year['financial_year_label'];?></option> <?php }?> </select> </form> <?php }?> </div> <?php if((!empty($budget_groupHead) && $budget_groupHead==TRUE) || $this->acl->hasPermission('APPLY_MY_BI')): ?> <div class="actions"> <?php if($this->acl->hasPermission('APPLY_MY_BI')): ?> <a href="<?php echo base_url(); ?>purchase_request/budget_item/downloadFormat/" class="dt-button btn yellow-casablanca btn-outline" > <i class="fa fa-download"></i> <?php echo $this->lang->line('download_csv_format'); ?> </a> <a href="<?php echo base_url(); ?>purchase_request/budget_item/export/<?php echo $financialYearId?>" class="dt-button btn yellow btn-outline" > <i class="fa fa-sign-in"></i> <?php echo $this->lang->line('export'); ?> </a> <a href="#importModal" class="dt-button btn blue btn-outline" data-toggle="modal" data-action="import" data-action-title="Import"> <i class="fa fa-sign-in"></i> <?php echo $this->lang->line('import'); ?> </a> <?php endif; ?> <?php if($this->acl->hasPermission('APPLY_MY_BI') || (!empty($allBudget_groups) && $allBudget_groups)): ?> <a href="#addModal" class="dt-button btn green-jungle btn-outline" data-toggle="modal"> <i class="fa fa-pencil"></i> <?php echo $this->lang->line('add'); ?> </a> <?php endif; ?> <?php if($this->acl->hasPermission('DELETE_ALL_BI')): ?> <a href="#bulkActionModal" class="dt-button btn red btn-outline bulkAction" data-toggle="modal" data-action="delete" data-action-title="Delete"> <i class="fa fa-trash-o"></i> <?php echo $this->lang->line('delete'); ?> </a> <?php endif; ?> </div> <?php endif; ?> </div> <div class="portlet-body"> <table class="table table-striped table-bordered table-hover table-checkable order-column" id="data_table"> <thead> <tr> <th></th> <?php if(!empty($allBudgetCategory)){?> <th ></th> <?php }?> <th></th> <th></th> <th></th> <th></th> <?php if(unserialize($prSettings['pool_key_enabled']) == 'true') {?> <th></th> <th></th> <?php }?> <th></th> <th data-filter="1"></th> <th data-filter="0"></th> <th data-filter="1"></th> <th data-filter="1"></th> <th></th> </tr> <tr> <th> <label class="mt-checkbox mt-checkbox-single mt-checkbox-outline"> <input type="checkbox" class="group-checkable" data-set="#data_table .checkboxes" /> <span></span> </label> </th> <?php if(!empty($allBudgetCategory)){?> <th><?php echo $this->lang->line('category'); ?></th> <?php }?> <th><?php echo $this->lang->line('title'); ?></th> <th><?php echo $this->lang->line('description'); ?></th> <th><?php echo $this->lang->line('budget_amount'); ?></th> <th><?php echo $this->lang->line('budget_adjustment'); ?></th> <th><?php echo $this->lang->line('quantity'); ?></th> <?php if(unserialize($prSettings['pool_key_enabled']) == 'true') {?> <th><?php echo $this->lang->line('pool_key'); ?></th> <th><?php echo $this->lang->line('total_budget_amount'); ?></th> <?php }?> <th><?php echo $this->lang->line('budget_group_title'); ?></th> <th><?php echo $this->lang->line('applicant'); ?></th> <th><?php echo $this->lang->line('workgroup'); ?></th> <th><?php echo $this->lang->line('status'); ?></th> <th><?php echo $this->lang->line('actions'); ?></th> </tr> </thead> <tbody> </tbody> </table> </div> </div> <?php if($this->acl->hasPermission('APPLY_MY_BI') || (!empty($budget_groupHead) && $budget_groupHead==TRUE)):?> <div id="addModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title"><?php echo $this->lang->line('create_budget_item'); ?> </h4> </div> <div class="modal-body"> <form method="post" action="<?php echo base_url(); ?>purchase_request/budget_item/addBudgetItem"> <div class="scroller" style="height:300px" data-always-visible="1" data-rail-visible="1"> <input type="hidden" name="user_id" value="<?php echo $this->session->userdata['id'];?>"> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('title'); ?><span class="required">*</span></label> <input type="text" name="title" class="title form-control" required> </div> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('description'); ?></label> <textarea name="description" class="form-control"></textarea> </div> <div class="row"> <div class="form-group col-md-4"> <label class="control-label"><?php echo $this->lang->line('budget_amount'); ?><span class="required">*</span></label> <input type="text" name="budget_amount" class="budget_amount form-control" required> </div> <div class="form-group col-md-4"> <label class="control-label"><?php echo $this->lang->line('budget_adjustment'); ?></label> <input type="text" name="budget_allowance" class="budget_allowance form-control"> </div> <div class="form-group col-md-4"> <label class="control-label"><?php echo $this->lang->line('quantity'); ?></label> <input type="text" name="quantity" class="quantity form-control"> </div> </div> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('budget_group'); ?><span class="required">*</span></label> <select name="bg_id" class="select2" required> <option value=""><?php echo $this->lang->line('select_budget_group'); ?></option> <?php foreach($allBudget_groups as $budget_group): ?> <option value="<?php echo $budget_group['id']; ?>"><?php echo $budget_group['title'].' ('.$budget_group['financial_year_label'].')'; ?></option> <?php endforeach; ?> </select> </div> <?php if(unserialize($prSettings['pool_key_enabled']) == 'true'): ?> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('pool_key'); ?></label> <select name="budget_pool_key_id" class="current_budget_pool_key_id col-md-12 form-control"> </select> <div class="input-group"> <span class="input-group-btn"> <button class="btn blue new_budget_pool_key" type="button"><?php echo $this->lang->line('or_add_new'); ?></button> </span> <input type="text" name="budget_pool_key" class="col-md-8 form-control" disabled="disabled" required> </div> </div> <?php endif; ?> </div> <div class="modal-footer"> <button type="button" data-dismiss="modal" class="btn default"><?php echo $this->lang->line('close'); ?></button> <input type="submit" class="btn green" value="<?php echo $this->lang->line('create_budget_item'); ?>"> </div> </form> </div> </div> </div> </div> <?php endif; ?> <?php if($this->acl->hasPermission('EDIT_ALL_BI') || (!empty($budget_groupHead) && $budget_groupHead==TRUE) ): ?> <div id="editModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title"><?php echo $this->lang->line('edit_budget_item'); ?> </h4> </div> <div class="modal-body"> <form method="post" action="<?php echo base_url(); ?>purchase_request/budget_item/editBudgetItem/<?php echo !$myBI?>/<?php echo $financialYearId?>"> <div class="scroller" style="height:300px" data-always-visible="1" data-rail-visible="1"> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('title'); ?><span class="required">*</span></label> <input type="text" name="title" class="title form-control" required> </div> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('description'); ?></label> <textarea name="description" class="description form-control"></textarea> </div> <div class="row"> <div class="form-group col-md-4"> <label class="control-label"><?php echo $this->lang->line('budget_amount'); ?><span class="required">*</span></label> <input type="text" name="budget_amount" class="budget_amount form-control" required> </div> <div class="form-group col-md-4"> <label class="control-label"><?php echo $this->lang->line('budget_adjustment'); ?></label> <input type="text" name="budget_allowance" class="budget_allowance form-control"> </div> <div class="form-group col-md-4"> <label class="control-label"><?php echo $this->lang->line('quantity'); ?></label> <input type="text" name="quantity" class="quantity form-control"> </div> </div> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('budget_group'); ?><span class="required">*</span></label> <select name="bg_id" class="select2" required style="width:100%"> <option value=""><?php echo $this->lang->line('select_budget_group'); ?></option> <?php foreach($allBudget_groups as $budget_group): ?> <option value="<?php echo $budget_group['id']; ?>"><?php echo $budget_group['title'].' ('.$budget_group['financial_year_label'].')'; ?></option> <?php endforeach; ?> <input type="hidden" name="id" class="id" value=""> </select> </div> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('workgroup'); ?><span class="required">*</span></label> <input type="text" name="workgroup" class="workgroup form-control"> </div> <?php if(unserialize($prSettings['pool_key_enabled']) == 'true'): ?> <div class="form-group"> <label class="control-label"><?php echo $this->lang->line('pool_key'); ?></label> <select name="budget_pool_key_id" class="current_budget_pool_key_id form-control"> <option value="0">None</option> <?php foreach($allPoolKeys as $allPoolKey): ?> <option value="<?php echo $allPoolKey['id']; ?>"><?php echo $allPoolKey['pool_key']; ?></option> <?php endforeach; ?> </select> <div class="input-group"> <span class="input-group-btn"> <button class="btn blue new_budget_pool_key" type="button"><?php echo $this->lang->line('or_add_new'); ?></button> </span> <input type="text" name="budget_pool_key" class="col-md-8 form-control" disabled="disabled"> </div> </div> <?php endif; ?> </div> <div class="modal-footer"> <button type="button" data-dismiss="modal" class="btn default"><?php echo $this->lang->line('close'); ?></button> <input type="submit" class="btn green" value="<?php echo $this->lang->line('save_changes'); ?>"> </div> </form> </div> </div> </div> </div> <?php endif; ?> <?php if($this->acl->hasPermission('DELETE_ALL_BI') || $isHead): ?> <div id="actionModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title"><span class="actionEventTitle"></span> <?php echo $this->lang->line('budget_item'); ?></h4> </div> <div class="modal-body"> <h4><?php echo $this->lang->line('are_you_sure'); ?></h4> </div> <div class="modal-footer"> <button type="button" data-dismiss="modal" class="btn default"><?php echo $this->lang->line('close'); ?></button> <a href="" type="button" class="btn default green confirmAction"><?php echo $this->lang->line('yes'); ?>, <span class="actionEvent"></span></a> </div> </div> </div> </div> <?php endif; ?> <?php if($this->acl->hasPermission('APPLY_MY_BI') || !empty($allBudget_groups)): ?> <div id="importModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title"><?php echo $this->lang->line('import'); ?> <?php echo $this->lang->line('budget_items'); ?></h4> </div> <div class="modal-body"> <form method="post" action="<?php echo base_url(); ?>purchase_request/budget_item/import/<?php echo $financialYearId?>" enctype="multipart/form-data"> <div class="fileinput fileinput-new" data-provides="fileinput" style="padding: 10px;"> <div class="input-group input-large"> <div class="form-control uneditable-input input-fixed input-medium" data-trigger="fileinput"> <i class="fa fa-file"></i> <span class="fileinput-filename"></span> </div> <span class="input-group-addon btn default btn-file"> <span class="fileinput-new"><?php echo $this->lang->line('select_file'); ?></span> <span class="fileinput-exists"><?php echo $this->lang->line('change'); ?></span> <input id="file" type="file" name="budget_groups" required> </span> <a href="javascript:;" class="input-group-addon btn red fileinput-exists" data-dismiss="fileinput"><?php echo $this->lang->line('remove'); ?></a> </div> </div> </div> <div class="modal-footer"> <button type="button" data-dismiss="modal" class="btn default"><?php echo $this->lang->line('close'); ?></button> <button type="submit" class="btn default green" data-action=""><?php echo $this->lang->line('import'); ?></button> </div> </form> </div> </div> </div><?php endif; ?> <div id="bulkActionModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title"><span class="actionEventTitle"></span> <?php echo $this->lang->line('budget_items'); ?></h4> </div> <div class="modal-body allGood"> <h4><?php echo $this->lang->line('are_you_sure'); ?></h4> </div> <div class="modal-body noChecks"> <h4><?php echo $this->lang->line('check_atleast_one'); ?></h4> </div> <div class="modal-footer"> <button type="button" data-dismiss="modal" class="btn default"><?php echo $this->lang->line('close'); ?></button> <a href="/#" type="button" class="btn default green confirmBulkAction" data-action=""><?php echo $this->lang->line('yes'); ?></a> </div> </div> </div> </div> <div id="historyModal" class="modal fade" tabindex="-1" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title"><span class="actionEventTitle"></span> <?php echo $this->lang->line('budget_items');?> <?php echo $this->lang->line('history');?></h4> </div> <div class="modal-body"> <table class="table table-bordered"> <thead> <th>Time</th> <th>User</th> <th>Amount</th> <th>Adjustment</th> <th>Status</th> </thead> <tbody id="history_table"> </tbody> </table> </div> <div class="modal-footer"> <button type="button" data-dismiss="modal" class="btn default"><?php echo $this->lang->line('close'); ?></button> </div> </div> </div> </div> <script> function filterByYear() { var year = $('#financial_year').val(); location.href= <?php echo(!empty($myBI) && $myBI)?'BASE_URL + "/purchase_request/budget_item/my_budget_items/"+year':'BASE_URL + "/purchase_request/budget_item/"+year';?> } $(document).ready(function() { var table = $('#data_table').DataTable( { serverSide: true, processing: true, ajax: { url: BASE_URL + 'purchase_request/budget_item/getBudgetItemsJSON/<?php echo $financialYearId?>/<?php echo(!empty($myBI) && $myBI)? '1':''?>', type: 'POST', }, "columns": [ { "data": "" }, <?php if(!empty($allBudgetCategory)){?> { "data": "" }, <?php }?> { "data": "title" }, { "data": "description" }, { "data": "budget_amount" }, { "data": "budget_allowance" }, { "data": "quantity" }, <?php if(unserialize($prSettings['pool_key_enabled']) == 'true') {?> { "data": "pool_key" }, { "data": "total_budget_amount" }, <?php }?> { "data": "budget_group_title" }, { "data": "username" }, { "data": "workgroup" }, { "data": "status" }, { "data": "" }, ], order: [[1, 'desc']], "columnDefs": [ { "targets": -1, render: function ( data, type, row, meta ) { var button=''; var edit ='<a class="btn btn-xs blue editModal" data-toggle="modal" href="#editModal" data-id="'+row['id']+'"><i class="fa fa-edit"></i><?php echo $this->lang->line('edit'); ?></a>'; if(row['status']=="PENDING" || row['status']=="REJECTED" || row['status']=="REVISED") { button = edit } else { } <?php if(empty($myBI) || !$myBI){?> var approve = '<a class="btn btn-xs green actionModal" data-toggle="modal" href="#actionModal" data-action="approve" data-id="'+row['id']+'"><i class="fa fa-edit"></i> <?php echo $this->lang->line('approve'); ?></a>'; var reject = '<a class="btn btn-xs red actionModal" data-toggle="modal" href="#actionModal" data-action="reject" data-id="'+row['id']+'"><i class="fa fa-edit"></i> <?php echo $this->lang->line('reject'); ?></a>'; var revise = '<a class="btn btn-xs yellow actionModal" data-toggle="modal" href="#actionModal" data-action="revise" data-id="'+row['id']+'"><i class="fa fa-edit"></i> <?php echo $this->lang->line('revise'); ?></a>'; var deleted = '<a class="btn btn-xs red actionModal" data-toggle="modal" data-action="delete" data-action-title="<?php echo $this->lang->line('delete'); ?>" href="#actionModal" data-id="'+row['id']+'"><i class="fa fa-trash-o"></i> <?php echo $this->lang->line('delete'); ?></a>'; var history = '<a class="btn btn-xs btn-default historyModal" data-toggle="modal" href="#historyModal" data-id="'+row['id']+'"><i class="fa fa-history"></i> <?php echo $this->lang->line('history'); ?></a>'; var clone = '<a class="btn btn-xs btn-default" href="<?php echo base_url()?>/purchase_request/budget_item/cloneBudgetItem/'+row['id']+'"><i class="fa fa-copy"></i> <?php echo $this->lang->line('clone'); ?></a>'; if(row['status']=="SUBMITTED") { button = approve+reject+revise; } else if (row['status']!="SUBMITTED") { button = edit + deleted; } button = button + history + clone ; <?php }?> <?php //if((!empty($myBI) && $myBI) && count($budget_groupHead)>0){?> var submit ='<a class="btn btn-xs green actionModal" data-toggle="modal" href="#actionModal" data-action="submit" data-id="'+row['id']+'"><i class="fa fa-edit"></i><?php echo $this->lang->line('submit'); ?></a>'; /*if(row['status']=="PENDING" && "<?php echo implode(',',$budget_groupHead);?>".indexOf(row['bg_id'])>-1) { button += submit; }*/ if(row['status']=="PENDING") { button += submit; } <?php //}?> return button; }, // "defaultContent": }, { "targets": -4, 'orderable': true, render: function ( data, type, row, meta ) { var return_str = row.budget_group_title return return_str; }, // "defaultContent": }, { "targets": 0, 'orderable': false, render: function ( data, type, row, meta ) { // console.log(type, data, row); return '<label class="mt-checkbox mt-checkbox-single mt-checkbox-outline"><input type="checkbox" class="checkboxes" data-id="'+row['id']+'" value="1"><span></span></label>'; }, // "defaultContent": }, <?php if(!empty($allBudgetCategory)){?> { "targets": 1, render: function ( data, type, row, meta ) { // console.log(type, data, row); return '<a href="#" class="bc_select" data-type="select" data-pk="'+row['id']+'" data-url="<?php echo base_url(); ?>purchase_request/budget_category/addBudgetItem/" data-title="Select Category">'+row['budget_category']+'</a>'; }, // "defaultContent": } <?php }?> ], "initComplete": function(settings, json) { $("#data_table thead tr:first th").each( function ( i, v ) { if($(v).data('filter') == 1){ var select = $('<input type="text"></input>') .appendTo( $(this).empty() ) .on( 'keyup', function () { table.column( i ) .search($(this).val()) .draw(); } ); } else{ if(i==0) { } } }); <?php if(!empty($allBudgetCategory)){?> <?php echo(!empty($myBI) && $myBI)?'':"init_editable();";?> <?php }?> }, "fnDrawCallback": function (oSettings) { <?php if(!empty($allBudgetCategory)){?> <?php echo(!empty($myBI) && $myBI)?'':"init_editable()";?> <?php }?> } } ); function init_editable(){ $('.bc_select').editable({ value: 2, source: [ <?php foreach ($allBudgetCategory as $bc) { echo "{value: " . addslashes ($bc['id']) . ", text: '" . addslashes($bc['name']) . "'},"; }?> ] }); } $(document).on('click', '.historyModal', function() { $('#history_table').empty(); $.ajax({ type: "GET", url: BASE_URL + "purchase_request/budget_item/getBIHistory/" + $(this).attr('data-id'), dataType: "json", success: function(data) { $.each(data, function(i, v) { var obj = jQuery.parseJSON(v.details); var string = '<tr><td>' + v.time + '</td><td>' + v.uid + '</td><td>' + obj.budget_amount + '</td><td>' + obj.budget_allowance + '</td><td>'+obj.status+'</td></tr>' $('#history_table').append(string); }); } }) }) $(document).on('click', '.editModal', function() { $.ajax({ type: "POST", data: "id=" + $(this).attr('data-id'), url: BASE_URL + "purchase_request/budget_item/getBudgetItem", dataType: "json", success: function(data) { $('#editModal input.title').val(data.budget_item.title); $('#editModal textarea.description').val(data.budget_item.description); $('#editModal input.budget_amount').val(data.budget_item.budget_amount); $('#editModal input.budget_allowance').val(data.budget_item.budget_allowance); $('#editModal input.quantity').val(data.budget_item.quantity); $('#editModal input.workgroup').val(data.budget_item.workgroup); var theseOptions = "<option value=''>None</option>"; $.each(data.pool_keys, function(i, v) { if (v.id == data.budget_item.budget_pool_key_id) var selected = "selected = 'selected'"; else var selected = ""; theseOptions += "<option " + selected + " value='" + v.id + "'>" + v.pool_key + "</option>"; }); $('#editModal input.id').val(data.budget_item.id); $("#editModal").find("select[name='bg_id']>option[value='" + data.budget_item.bg_id + "']").prop('selected', true); $("select[name='bg_id']").select2("destroy").select2(); $('#editModal').find('select.current_budget_pool_key_id').html(theseOptions); } }); }); $(document).on('click', '.confirmBulkAction', function() { var idString = ""; $('.checkboxes:checked').each(function(i, v) { idString += $(v).data('id') + ':'; }); $.ajax({ type: "POST", data: "ids=" + idString.slice(0, -1) + "&action=" + $(this).data('action'), url: BASE_URL + "purchase_request/budget_item/bulkAction", dataType: "json", success: function(data) { location.reload(); } }); }); $(document).on('click', '.bulkAction', function() { if ($('.checkboxes:checked').length == 0) { $('#bulkActionModal .modal-footer').hide(); $('#bulkActionModal .allGood').hide(); $('#bulkActionModal .noChecks').show(); } else { $('#bulkActionModal .modal-footer').show(); $('#bulkActionModal .allGood').show(); $('#bulkActionModal .noChecks').hide(); $('#bulkActionModal span.actionEventTitle').html($(this).attr('data-action-title')); $('#bulkActionModal').find('.confirmBulkAction').attr('data-action', $(this).attr('data-action-title')); } }); $(document).on('click', '.actionModal', function() { $('#actionModal span.actionEventTitle').html($(this).attr('data-action-title')); $('#actionModal span.actionEvent').html($(this).attr('data-action')); $('a.confirmAction').attr('href', BASE_URL + 'purchase_request/budget_item/actionOnBudgetItem/' + $(this).attr('data-id') + '/' + $(this).attr('data-action') + '/<?php echo $financialYearId ?>'); }); $(document).on('click', '.new_budget_pool_key', function() { $(this).removeClass('blue'); $(this).removeClass('new_budget_pool_key'); $(this).addClass('red'); $(this).addClass('use_current_budget_pool_key'); $(this).html('Cancel'); $('.current_budget_pool_key_id').attr('disabled', true); $('input[name="budget_pool_key"]').attr('disabled', false); }); $(document).on('click', '.use_current_budget_pool_key', function() { $(this).removeClass('red'); $(this).removeClass('use_current_budget_pool_key'); $(this).addClass('blue'); $(this).addClass('new_budget_pool_key'); $(this).html('Or add new'); $('.current_budget_pool_key_id').attr('disabled', false); $('input[name="budget_pool_key"]').attr('disabled', true); }); $('select[name="bg_id"]').change(function() { $.ajax({ type: "POST", data: "budget_groupId=" + $(this).val(), url: BASE_URL + "purchase_request/budget_item/getPoolKeysForBudget_group/", dataType: "json", success: function(data) { var newOptions = "<option value=''>None</option>"; $.each(data, function(i, v) { newOptions += "<option value='" + v.id + "'>" + v.pool_key + "</option>"; }); $('#addModal .current_budget_pool_key_id').html(newOptions); } }); }); $('.group-checkable').change(function () { if(this.checked) { console.log('checked') $('.checkboxes').attr("checked",true); } else { $('.checkboxes').attr("checked",false); } }) }); </script>
| ver. 1.4 |
Github
|
.
| PHP 7.2.34 | Generation time: 0.22 |
proxy
|
phpinfo
|
Settings