Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
a0c4bebdc4
@ -1216,6 +1216,7 @@ class LeadsController extends BaseController
|
||||
helper('excel_util_helper');
|
||||
$rfq_data = $this->RFQModel->getRFQTableDataWithLeadIDAndType($lead_id, $type);
|
||||
$is_placement = false;
|
||||
$length = 0;
|
||||
|
||||
// dd($rfq_data, $lead_id, $type, $propsal_and_insurer);
|
||||
// print_r($propsal_and_insurer); die;
|
||||
@ -1432,6 +1433,7 @@ class LeadsController extends BaseController
|
||||
$columnLetter = 'A';
|
||||
|
||||
foreach ($headers as $header) {
|
||||
// Kint::dump($header);
|
||||
|
||||
if (in_array($header['parentHeader'], ['Item Key', 'Action'])) {
|
||||
continue;
|
||||
@ -1448,7 +1450,6 @@ class LeadsController extends BaseController
|
||||
|
||||
$startColumn = $columnLetter; // Start of the current header range
|
||||
$subHeaderCount = count($header['subHeaders']); // Number of subheaders for this parent header
|
||||
|
||||
// Set parent header value
|
||||
if ($is_placement == true && !in_array($header['parentHeader'], ['Particulars', 'S.No.'])) {
|
||||
$sheet->setCellValue("{$startColumn}{$rowNumber}", "Terms");
|
||||
@ -1495,8 +1496,11 @@ class LeadsController extends BaseController
|
||||
}
|
||||
|
||||
$columnLetter++; // Move to the next column for subheaders
|
||||
// Kint::dump($subHeader);
|
||||
$length++;
|
||||
}
|
||||
}
|
||||
// die();
|
||||
|
||||
// Apply border to the header range
|
||||
$prevColumn1 = $this->getPreviousColumn($columnLetter);
|
||||
@ -1649,10 +1653,22 @@ class LeadsController extends BaseController
|
||||
$path = ROOTPATH . "public/assets/images/Nhance-Logo-Final.png"; // Use FCPATH for server path
|
||||
$drawing->setPath($path);
|
||||
$drawing->setCoordinates("{$columnLetter_img}1"); // Set position in column B
|
||||
$drawing->setHeight(35); // Adjust image height
|
||||
$drawing->setHeight(35); // Adjust image
|
||||
$columnWidth = $sheet->getColumnDimension("C")->getWidth(); // e.g., 20
|
||||
$cellPixelWidth = $columnWidth * 7; // Approximate conversion (1 unit ≈ 7 pixels)
|
||||
$imagePixelWidth = 250; // Approximate width of your image (in pixels)
|
||||
|
||||
$offsetX = max(0, ($cellPixelWidth - $imagePixelWidth) / 2);
|
||||
$offsetX = $offsetX + 97;
|
||||
// dd($length);
|
||||
if ($length >= 4) {
|
||||
$offsetX = 50;
|
||||
} else if ($length == 3) {
|
||||
$offsetX = 65;
|
||||
}
|
||||
|
||||
// Center align the image in the cell
|
||||
$drawing->setOffsetX(110); // Adjust horizontal offset
|
||||
$drawing->setOffsetX($offsetX); // Adjust horizontal offset
|
||||
$drawing->setOffsetY(10); // Adjust vertical offset
|
||||
$drawing->setWorksheet($sheet);
|
||||
|
||||
@ -3940,7 +3956,7 @@ class LeadsController extends BaseController
|
||||
$offsetX = max(0, ($cellPixelWidth - $imagePixelWidth) / 2);
|
||||
$offsetX = $offsetX + 97;
|
||||
if ($length >= 4) {
|
||||
$offsetX = 50;
|
||||
$offsetX = 50;
|
||||
} else if ($length == 3) {
|
||||
$offsetX = 140;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user