HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //proc/self/cwd/pm/plugins/Manufacturing/assets/js/work_orders/view_work_order_js.php
<script>
	$(document).ready(function() {
		setTimeout(function(){
			"use strict";  
			
			
			$('#work_instruction-tab').click();

		}, 400);
	});

	var time_trackings;
	(function($) {
		"use strict";  


		<?php if(isset($time_tracking_details)){ ?>
			var dataObject_pu = <?php echo json_encode($time_tracking_details) ; ?>;
		<?php }else{?>
			var dataObject_pu = [];
		<?php } ?>

		setTimeout(function(){

			var hotElement1 = document.getElementById('time_tracking_hs');

			time_trackings = new Handsontable(hotElement1, {
				licenseKey: 'non-commercial-and-evaluation',

				contextMenu: true,
				manualRowMove: true,
				manualColumnMove: true,
				stretchH: 'all',
				autoWrapRow: true,
				rowHeights: 30,
				defaultRowHeight: 100,
				minRows: 10,
				maxRows: <?php echo html_entity_decode($rows); ?>,
				width: '100%',
				height: '500px',
				

				rowHeaders: true,
				colHeaders: true,
				autoColumnSize: {
					samplingRatio: 23
				},

				filters: true,
				manualRowResize: true,
				manualColumnResize: true,
				allowInsertRow: true,
				allowRemoveRow: true,
				columnHeaderHeight: 40,
			// colWidths:  [20, 20, 20,20],
			rowHeights: 30,
			rowHeaderWidth: [44],
			minSpareRows: 1,
			hiddenColumns: {
				columns: [0],
				indicators: true
			},

			columns: [
			{
				type: 'text',
				data: 'id',
			},
			
			
			{
				data: 'from_date',
				type: 'text',
				
			},
			{
				data: 'to_date',
				type: 'text',
			},
			{
				data: 'duration',
				type: 'numeric',
				numericFormat: {
					pattern: '0,0.00',
				},
			},
			{
				data: 'full_name',
				type: 'text',
			},

			],

			colHeaders: [

			'<?php echo _l('id'); ?>',
			'<?php echo _l('start_date'); ?>',
			'<?php echo _l('end_date'); ?>',
			'<?php echo _l('duration'); ?>',
			'<?php echo _l('staff_name'); ?>',
			],

			data: dataObject_pu,
		});
		},300);

	})(jQuery);



	$('.mark_start_working').on('click', function() {
		"use strict";

		var work_order_id = $("input[name='work_order_id']").val();
		var manufacturing_order = $("input[name='manufacturing_order']").val();

		$.get("<?php echo get_uri("manufacturing/mo_mark_as_start_working/") ?>" + work_order_id+'/'+manufacturing_order, function (response) {
			appAlert.success(response.message);
			

			location.reload();
		}, 'json');

	});

	$('.mark_pause').on('click', function() {
		"use strict";

		var work_order_id = $("input[name='work_order_id']").val();

		$.get("<?php echo get_uri("manufacturing/mo_mark_as_mark_pause/") ?>" + work_order_id, function (response) {
			appAlert.success(response.message);

			location.reload();
		}, 'json');

	});

	$('.mark_done').on('click', function() {
		"use strict";

		var work_order_id = $("input[name='work_order_id']").val();
		var manufacturing_order_id = $("input[name='manufacturing_order']").val();

		$.get("<?php echo get_uri("manufacturing/mo_mark_as_mark_done/") ?>" + work_order_id+'/'+ manufacturing_order_id, function (response) {
			appAlert.success(response.message);


			location.reload();
		}, 'json');

	});
	

</script>