Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme

This commit is contained in:
vadivel J 2024-11-14 17:59:13 +05:30
commit e6b98cb133
5 changed files with 88 additions and 77 deletions

View File

@ -3,6 +3,7 @@
namespace App\Controllers;
use App\Controllers\BaseController;
use App\Models\Supplier_model;
use App\Models\PowerConsumptionDetails;
use App\Models\CoatingMachineDetailsModel;
use App\Models\DrierMachineDetailsModel;
@ -24,6 +25,7 @@ use DateInterval;
class StockController extends BaseController
{
protected $supplier_model;
protected $powerConsumptionDetails_model;
protected $coatingMachineDetails_model;
protected $drierMachineDetails_model;
@ -47,7 +49,9 @@ class StockController extends BaseController
{
$this->db = \Config\Database::connect();
parent::__construct();
$this->supplier_model = new Supplier_model();
$this->powerConsumptionDetails_model = new PowerConsumptionDetails();
$this->coatingMachineDetails_model = new CoatingMachineDetailsModel();
@ -941,45 +945,7 @@ class StockController extends BaseController
return $dates;
}
function fillMissingDates($monthData, $drierDetails) {
$filledDetails = [];
$drierDetailsByDate = [];
foreach ($drierDetails as $detail) {
$drierDetailsByDate[$detail['date']] = $detail;
}
foreach ($monthData as $day) {
$date = $day['database'];
if (isset($drierDetailsByDate[$date])) {
$filledDetails[] = $drierDetailsByDate[$date];
} else {
$filledDetails[] = [
'id' => null,
'date' => $date,
'drier_on_time' => null,
'drier_off_time' => null,
'drier_running_hours' => '0.00',
'supplier_name' => null,
'input_sand_moisture' => '0.00',
'total_gas_consumption' => '0.00',
'gas_per_ton' => '0.00',
'input_sand_qty' => '0.00',
'moisture_loss_qty' => '0.00',
'sand_dried_qty' => '0.00',
'qty_per_hours' => '0.00',
'dust_qty' => '0.00',
'customer_name' => null,
'created_at' => null,
'updated_at' => null
];
}
}
return $filledDetails;
}
function generateTimeOptions() {
$times = [];
$start = strtotime('00:00'); // Start at midnight (12:00 AM)
@ -1006,14 +972,24 @@ class StockController extends BaseController
$data['startDate'] = $monthData[0]['database'];
$data['endDate'] = $monthData[count($monthData)-1]['database'];
$data['timeDropdown'] = $this->generateTimeOptions();
$data['supplierData'] = $this->supplier_model->supplierlisting();
$data['drierDetails'] = $this->drierMachineDetails_model->where('date >=', $data['startDate'])->where('date <=', $data['endDate'])->findAll();
if(!count($data['drierDetails']))
{
//insert empty data
$tempInsert = [];
foreach ($monthData as $key => $value) {
array_push($tempInsert,[ 'date'=>$value['database'] ]);
}
$this->drierMachineDetails_model->insertBatch($tempInsert);
$data['drierDetails'] = $this->drierMachineDetails_model->where('date >=', $data['startDate'])->where('date <=', $data['endDate'])->findAll();
}
$data['drierDetails'] = $this->drierMachineDetails_model
->where('date >=', $data['startDate'])
->where('date <=', $data['endDate'])
->findAll();
$data['datefordropdown'] = $currentMonth;
$data['data'] = $this->fillMissingDates($monthData, $data['drierDetails']);
$this->global['pageTitle'] = 'Drier Details';

View File

@ -1,8 +1,4 @@
<!-- <script src="<?php echo base_url() ?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
<script src="<?php echo base_url() ?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script> -->
<!-- <script src="<?php echo base_url() ?>public/assets/js/jquery.CongelarFilaColumna.js"></script> -->
<
@ -178,12 +174,9 @@ $currentday = date('d');
padding-right: 30% ! important;
}
/* .fht-table th:nth-child(1),
.fht-table td:nth-child(1),
.fht-table th:nth-child(1),
.fht-table th:nth-child(2),
.fht-table td:nth-child(2),
.fht-table th:nth-child(3),
.fht-table td:nth-child(3)
.fht-table th:nth-child(3)
{
position: sticky;
left: 0;
@ -191,7 +184,20 @@ $currentday = date('d');
z-index: 2;
border-right: 2px solid #ddd;
color: #ffffff;
} */
}
.fht-table td:nth-child(1),
.fht-table td:nth-child(2),
.fht-table td:nth-child(3)
{
position: sticky;
left: 0;
background-color: #ffffff;
z-index: 2;
border-right: 2px solid #ddd;
color: #0e0b0b;
}
</style>
<div class="content-page">
<div class="content">
@ -649,13 +655,9 @@ $currentday = date('d');
<script>
function myFunction(p, i, v) {
//alert(p+"-"+i+"-"+v);
//alert(v);
// alert(k.keyCode);
var v = v;
var i = i;
var id = i.substr(-1);
//alert(id);
var len = i.length;
var nxtid = 0;
var nxtvalue = 0;
@ -674,16 +676,13 @@ $currentday = date('d');
var j = '#' + i;
var nextid = $(j).closest('td').next('td');
//alert(nextid);
nxtid = nextid[0].attributes[2].value;
//alert(nxtid);
//console.log(nextid[0].attributes[2].value);
//console.log(nextid);
nxtvalue = v - 8;
curvalue = 8;

View File

@ -35,7 +35,6 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
width: auto;
border-collapse: collapse;
border-spacing: 0;
/*table-layout: fixed; Algoritmo de distribucion fijo */
white-space:nowrap;
}
@ -161,13 +160,26 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
height: 20px;
}
.modal {
padding-right: 30% ! important;
}
#drierTable th:nth-child(1) {
position: sticky;
left: 0;
background-color: #00a65a;
z-index: 2;
border-right: 2px solid #ddd;
color: #ffffff;
}
#drierTable td:nth-child(1) {
position: sticky;
left: 0;
background-color: #ffffff;
z-index: 2;
border-right: 2px solid #ddd;
color: #0e0b0b;
}
@ -241,7 +253,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<thead>
<tr>
<th class="celda_encabezado_general" style="padding: 10px;">S.NO</th>
<th class="celda_encabezado_general" style="padding: 10px;">Date</th>
<th class="celda_encabezado_general" style="padding: 10px;">Drier On Time</th>
<th class="celda_encabezado_general" style="padding: 10px;">Drier Off Time</th>
@ -264,12 +276,19 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<?php $index = 0;
$row = 0;
foreach ($data as $a) {
foreach ($drierDetails as $a) {
$row++;
$index++; ?>
<tr id="<?php echo $row; ?>">
<td width="45" height="45" class="celda_normal"><?php echo $index; ?></td>
<tr id="<?php echo $row; ?>"
<?php
$date = DateTime::createFromFormat('Y-m-d', $a['date'])->format('Y-m-d');
$currentDate = date('Y-m-d');
if ($date === $currentDate) { echo 'style="background: #cef0ad;"'; }
?>
>
<td width="79" height="45" class="celda_normal"><?php echo DateTime::createFromFormat('Y-m-d', $a['date'])->format('d-m-Y'); ?></td>
<td class="celda_normal" >
<select class="timeDropdown drier_on_time" style="width: 100px;" ">
@ -291,7 +310,12 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<?php echo $a['drier_running_hours']; ?>
</td>
<td class="celda_normal" contenteditable="true">
<?php echo $a['supplier_name']; ?>
<select class="timeDropdown supplier_name" style="width: 300px;">
<option value="">Select</option>
<?php foreach ($supplierData as $key => $value) { ?>
<option value="<?= $value->SupplierID; ?>" <?php if($a['supplier_name'] == $value->SupplierID){ echo 'selected'; } ?> ><?= $value->SupplierName; ?></option>
<?php } ?>
</select>
</td>
<td class="celda_normal" contenteditable="true" >
<?php echo $a['input_sand_moisture']; ?>
@ -362,8 +386,10 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
{
$('.timeDropdown').select2({
placeholder: "Select a time",
placeholder: "Select",
});
$('#save').click(function() {
@ -376,6 +402,8 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
// Get the selected values from dropdowns
row['Drier On Time'] = $(this).find('.drier_on_time').val();
row['Drier Off Time'] = $(this).find('.drier_off_time').val();
row['Supplier Name'] = $(this).find('.supplier_name').val();
});

View File

@ -339,7 +339,15 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<tbody >
<?php foreach ($dieselConsumptionDetails as $key => $row): ?>
<tr id="<?php echo $key + 1; ?>">
<tr id="<?php echo $key + 1; ?>"
<?php
$date = DateTime::createFromFormat('Y-m-d', $row['date'])->format('Y-m-d');
$currentDate = date('Y-m-d');
if ($date === $currentDate) { echo 'style="background: #cef0ad;"'; }
?>
>
<?php foreach ($columns as $index => $column): ?>
<?php if($index == 0) : ?>

View File

@ -93,7 +93,7 @@
<th>PAN</th>
<th>GST Number</th>
<th>Payment Terms</th>
<th></th>
<th>Action</th>
</tr>
</thead>
<tbody>
@ -107,7 +107,7 @@
} else {
$cdate = date('d-m-Y', strtotime($record->CreatedOn));
} ?>
<td style="width:75px" align="right"><?php echo $cdate; ?></td>
<td style="width:75px" align="left"><?php echo $cdate; ?></td>
<td>