Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Apache
: 172.26.7.228 | : 3.145.105.85
Cant Read [ /etc/named.conf ]
5.6.40-24+ubuntu18.04.1+deb.sury.org+1
www-data
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
var /
www /
html /
gcm /
src /
[ HOME SHELL ]
Name
Size
Permission
Action
system
[ DIR ]
drwxr-xr-x
Dispatch_ans_script_setup.php
5.84
KB
-rwxr-xr-x
Dispatch_ans_script_setup_qp.p...
5.18
KB
-rwxr-xr-x
DownloadExamAppFormApplication...
5.12
KB
-rwxr-xr-x
ECHblk.php
11.06
KB
-rwxr-xr-x
FormulaEvaluate.php
14.15
KB
-rwxr-xr-x
MarkEntry-Setup.php
20.57
KB
-rwxr-xr-x
MarkEntry-SetupTEST.php
21.01
KB
-rwxr-xr-x
TAGMAY2013.pdf
331.03
KB
-rwxr-xr-x
TarkaFormatStyles.php
15.37
KB
-rwxr-xr-x
TarkaFormatStyles_old.php
3.71
KB
-rwxr-xr-x
absent_entry_setup.php
8.13
KB
-rwxr-xr-x
absent_entry_setupQp.php
6.91
KB
-rwxr-xr-x
absent_entry_setupQpold.php
7.03
KB
-rwxr-xr-x
ack_exam_app_form.php
12.08
KB
-rwxr-xr-x
ack_rv_rt_application.php
8.04
KB
-rwxr-xr-x
ack_rv_rt_application_before_l...
6.02
KB
-rwxr-xr-x
actClass.php
6.21
KB
-rwxr-xr-x
admission_entry_status.php
2.73
KB
-rwxr-xr-x
admissionapplist.php
9.9
KB
-rwxr-xr-x
approve.php
19.63
KB
-rwxr-xr-x
attendance.php
10.23
KB
-rwxr-xr-x
attendance_31072017.php
6.59
KB
-rwxr-xr-x
attendance_freez.php
8.46
KB
-rwxr-xr-x
attendance_freez03012017.php
8.37
KB
-rwxr-xr-x
attendance_freez_mth.php
8.24
KB
-rwxr-xr-x
attendance_freez_old.php
8.21
KB
-rwxr-xr-x
auto-complete.php
4.89
KB
-rwxr-xr-x
backup.php
2.6
KB
-rwxr-xr-x
backup_restore.php
8.14
KB
-rwxr-xr-x
backupandrestore.php
10.18
KB
-rwxr-xr-x
batch_close.php
4.29
KB
-rwxr-xr-x
bundle_dispatch.php
2.84
KB
-rwxr-xr-x
cManualMailer.php
2.54
KB
-rwxr-xr-x
caccesscontext.php
1.24
KB
-rwxr-xr-x
candidate-entry.php
44.23
KB
-rwxr-xr-x
candidate-entry_without_iapr_i...
34.88
KB
-rwxr-xr-x
candidate-entrybefore yearexam...
34.55
KB
-rwxr-xr-x
candidate-entrykus.php
33.23
KB
-rwxr-xr-x
candidate-entryold.php
34.55
KB
-rwxr-xr-x
cappcontext.php
2.64
KB
-rwxr-xr-x
challan_entries.php
15.31
KB
-rwxr-xr-x
challan_preparation.php
11.58
KB
-rwxr-xr-x
cmailer.php
6.83
KB
-rwxr-xr-x
college.php
4.61
KB
-rwxr-xr-x
college_BEFORE_LOGINPOPUP.php
3.5
KB
-rwxr-xr-x
college_approve.php
5.61
KB
-rwxr-xr-x
college_degree_status.php
5.65
KB
-rwxr-xr-x
connect.php
2.1
KB
-rwxr-xr-x
coutput.php
1.75
KB
-rwxr-xr-x
create_all_grid_files.php
8.57
KB
-rwxr-xr-x
create_all_grid_group_files.ph...
9.94
KB
-rwxr-xr-x
create_all_grid_group_files_ol...
9.61
KB
-rwxr-xr-x
create_all_popup_files.php
5.93
KB
-rwxr-xr-x
create_all_schema_files.php
4.31
KB
-rwxr-xr-x
create_all_views.php
16.52
KB
-rwxr-xr-x
create_html_files.php
52.03
KB
-rwxr-xr-x
create_html_files_without_tab....
44.49
KB
-rwxr-xr-x
create_module_meta_columns.php
5.16
KB
-rwxr-xr-x
crequestbroker.php
2.49
KB
-rwxr-xr-x
csessions.php
514
B
-rwxr-xr-x
cuser.php
3.41
KB
-rwxr-xr-x
custom_mregistry.php
122
B
-rwxr-xr-x
datadictionary.php
3.96
KB
-rwxr-xr-x
daterange.php
4.86
KB
-rwxr-xr-x
degree.php
6.51
KB
-rwxr-xr-x
display_details_in_grid.php
105.15
KB
-rwxr-xr-x
display_details_in_grid0812201...
102.95
KB
-rwxr-xr-x
display_details_in_grid22.php
104.89
KB
-rwxr-xr-x
display_details_in_grid_custom...
2.59
KB
-rwxr-xr-x
display_details_in_grid_studta...
96.56
KB
-rwxr-xr-x
display_details_in_grid_withde...
97.45
KB
-rwxr-xr-x
display_details_in_gridold.php
102.19
KB
-rwxr-xr-x
doc_verify.php
6.99
KB
-rwxr-xr-x
downloadFeeStatement.php
4.71
KB
-rwxr-xr-x
download_misc_files.php
3.65
KB
-rwxr-xr-x
download_photo.php
4.71
KB
-rwxr-xr-x
download_photo01202017.php
3.58
KB
-rwxr-xr-x
download_uploadsikkim.php
3.86
KB
-rwxr-xr-x
dynamicmastersdetails.php
117.45
KB
-rwxr-xr-x
dynamicmastersdetails_one.php
119.36
KB
-rwxr-xr-x
entryexitevents.php
3.09
KB
-rwxr-xr-x
execute_query.php
2.5
KB
-rwxr-xr-x
export_import_setup.php
7.62
KB
-rwxr-xr-x
export_import_utility.php
2.67
KB
-rwxr-xr-x
format.php
7.43
KB
-rwxr-xr-x
freeze_Ad_Cl_Me.php
6.64
KB
-rwxr-xr-x
freeze_module_at_admin_college...
8.22
KB
-rwxr-xr-x
freeze_module_at_admin_college...
6.92
KB
-rwxr-xr-x
freeze_module_at_admin_college...
7.81
KB
-rwxr-xr-x
freeze_module_at_university_co...
7.45
KB
-rwxr-xr-x
general_report_format.php
11
KB
-rwxr-xr-x
getAutoCompleteFromFrameWork.p...
2.97
KB
-rwxr-xr-x
getdata.php
33.4
KB
-rwxr-xr-x
getdata08052017.php
33.04
KB
-rwxr-xr-x
getdata08122016.php
32.65
KB
-rwxr-xr-x
getdata22.php
32.82
KB
-rwxr-xr-x
getdataold.php
28.7
KB
-rwxr-xr-x
getfeeinformation.php
7.12
KB
-rwxr-xr-x
getfeeinformation_24112018.php
6.95
KB
-rwxr-xr-x
getmoduledetails.php
24.56
KB
-rwxr-xr-x
getnumword.php
7.43
KB
-rwxr-xr-x
getreportdetails.php
3.21
KB
-rwxr-xr-x
getreportfilefordisplay.php
1.37
KB
-rwxr-xr-x
getsearchcondition.php
1.3
KB
-rwxr-xr-x
ggridmodel.php
9.27
KB
-rwxr-xr-x
golden_palm_payslip.php
12.48
KB
-rwxr-xr-x
helptext.php
5.38
KB
-rwxr-xr-x
identify_transactions.php
6.4
KB
-rwxr-xr-x
import_marks.php
4.11
KB
-rwxr-xr-x
json.php
33.22
KB
-rwxr-xr-x
login.php
7.67
KB
-rwxr-xr-x
login_BEFORE_LOGINPOPUP.php
3.25
KB
-rwxr-xr-x
login_old.php
3.15
KB
-rwxr-xr-x
mascomb.php
10.02
KB
-rwxr-xr-x
message_board.php
4.67
KB
-rwxr-xr-x
messagetext.php
953
B
-rwxr-xr-x
module_setup.php
2.48
KB
-rwxr-xr-x
mregistry.php
89.5
KB
-rwxr-xr-x
mregistry_beforedownload.php
53.04
KB
-rwxr-xr-x
mrn_approval.php
9
KB
-rwxr-xr-x
printexamform.php
11.54
KB
-rwxr-xr-x
receive_rv_rt_application.php
8.08
KB
-rwxr-xr-x
report_iamarks_pending.php
12.04
KB
-rwxr-xr-x
report_marks_entry_subwise_lis...
11.84
KB
-rwxr-xr-x
report_setup.php
25.12
KB
-rwxr-xr-x
report_tool.php
73.03
KB
-rwxr-xr-x
revaluation.php
16.66
KB
-rwxr-xr-x
revaluation_oldtype.php
8.45
KB
-rwxr-xr-x
revaluation_withdegree.php
16.77
KB
-rwxr-xr-x
room_allotment.php
15.46
KB
-rwxr-xr-x
room_allotment22.php
14.04
KB
-rwxr-xr-x
room_allotment_.php
15.24
KB
-rwxr-xr-x
room_allotment_12092017.php
15.22
KB
-rwxr-xr-x
room_allotment_20112017.php
15.25
KB
-rwxr-xr-x
room_allotment_datewise.php
15.84
KB
-rwxr-xr-x
room_allotment_datewise_150220...
16.87
KB
-rwxr-xr-x
room_allotment_datewise_151129...
18.29
KB
-rwxr-xr-x
room_allotment_datewise_old.ph...
18.29
KB
-rwxr-xr-x
room_allotment_new16012017.php
14.02
KB
-rwxr-xr-x
room_allotment_newformat120920...
15.25
KB
-rwxr-xr-x
room_allotment_oldd.php
9.24
KB
-rwxr-xr-x
room_allotment_qpcodewise.php
9.56
KB
-rwxr-xr-x
roomdeclaration.php
1.81
KB
-rwxr-xr-x
rvdates.php
6.46
KB
-rwxr-xr-x
sendLoginPassword.php
3.09
KB
-rwxr-xr-x
serchbygrid.php
822
B
-rwxr-xr-x
servfeehead.php
3.84
KB
-rwxr-xr-x
services.php
3.47
KB
-rwxr-xr-x
sfeehead.php
5.45
KB
-rwxr-xr-x
stringspliter.php
693
B
-rwxr-xr-x
student_entry.php
32.52
KB
-rwxr-xr-x
student_entry24.php
56.54
KB
-rwxr-xr-x
student_entryold.php
30.33
KB
-rwxr-xr-x
subjectList_display.php
11.01
KB
-rwxr-xr-x
subject_freshExam.php
18.94
KB
-rwxr-xr-x
subjectfreez.php
12.98
KB
-rwxr-xr-x
system_utility.php
1.84
KB
-rwxr-xr-x
systemsetup.php
76.51
KB
-rwxr-xr-x
teachers.php
14.63
KB
-rwxr-xr-x
teachersOLD.php
10.33
KB
-rwxr-xr-x
transaction-series.php
4.86
KB
-rwxr-xr-x
updateSection.php
4.79
KB
-rwxr-xr-x
update_defined_flag.php
3.41
KB
-rwxr-xr-x
upload_studentPhoto.php
10.12
KB
-rwxr-xr-x
upload_studentPhoto_before_dow...
8.02
KB
-rwxr-xr-x
uploadmoduledetails.php
39.65
KB
-rwxr-xr-x
usersetup.php
24.35
KB
-rwxr-xr-x
usersetupold.php
24.36
KB
-rwxr-xr-x
usersubj_identification.php
4.77
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : report_tool.php
<?php /*Author : M.Srikanth Date : 2009-07-30 Project : Reporting tool (Frame Work) Description : This class is for dynamically to create reports */ //Start : 'reporttool' Class $my_aobj_context; class reporttool { public $report_setup; //Start : Constructor function __construct($aobj_context) { session_start(); $this->aobj_context=$aobj_context; $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC); $this->user_id = $_SESSION['user_id']; $this->save_cond_flag = 0 ; $my_aobj_context = $this->aobj_context; $this->setup_name = ''; } //End : Constructor //Start : createReport() /* This function is for to get market modules names*/ function getCompanyDetails() { $select_company_details = "select company_name,city from company_setup"; $lobj_select_company_details = $this->aobj_context->mobj_db->GetRow($select_company_details); return $lobj_select_company_details; } function excelReportPreDefineSetup() { if(trim($this->report_setup['page_orientation']) == 'landscape') $this->worksheet->setLandscape(); else $this->worksheet->setPortrait(); if(!empty($this->report_setup['print_scale'])) $this->worksheet->setPrintScale($this->report_setup['print_scale']); if(!empty($this->report_setup['header_repeat'])) $this->worksheet->repeatRows($this->report_setup['header_repeat']['x'], $this->report_setup['header_repeat']['y']); if($this->report_setup['hide_grid_lines'] == "yes") $this->worksheet->hideScreenGridlines(); if(!empty($this->report_setup['freezePanes'])) $this->worksheet->freezePanes (array($this->report_setup['freezePanes'])); if(!empty($this->report_setup['printRowColHeaders'])) $this->worksheet->printRowColHeaders($this->report_setup['printRowColHeaders ']); if(!empty($this->report_setup['setPaperSize'])) $this->worksheet->setPaper($this->report_setup['setPaperSize']); // DEFULT SETTING if(empty($this->report_setup['page_orientation'])) $this->worksheet->setPortrait(); } function createReport() { ini_set("memory_limit",-1); ini_set('max_execution_time', 1400); $excel_writer=$this->aobj_context->main_src."/Excel_Writer/Writer.php"; $file_path=$this->aobj_context->main_src."/imported_files/{$this->report_name}_report_{$this->report_id}.xls"; $logo_path=$this->aobj_context->main_src."/img/bioplus logo_bit.bmp"; // echo $file_path; // die(); include($excel_writer); $user_id = $_SESSION['user_id']; if($this->save_cond_flag == 1) $workbook = new Spreadsheet_Excel_Writer($file_path); else $workbook = new Spreadsheet_Excel_Writer(); $workbook->setVersion(9); // Use Excel97/2000 Format $tarka_format_file=$this->aobj_context->main_src."/src/TarkaFormatStyles.php"; include_once($tarka_format_file); $objfrmt =& new FormatStyle(); $Data_Center_Bold_NoBorder =& $workbook->addFormat($objfrmt->Data_Center_Bold_NoBorder); $Data_Left_Bold_NoBorder =& $workbook->addFormat($objfrmt->Data_Left_Bold_NoBorder); $Data_Right_Bold_NoBorder =& $workbook->addFormat($objfrmt->Data_Right_Bold_NoBorder); $Data_top_bottm_border =& $workbook->addFormat($objfrmt->Data_top_bottm_border_bold); $Data_border =& $workbook->addFormat($objfrmt->Data_top_bottm_border); $this->worksheet =& $workbook->addWorksheet($Type.' Summary '.$ex_cur_year); // $this->worksheet->setPaper(9); // report setup $Data_border->setTextWrap(); $Data_top_bottm_border->setTextWrap(); $this->worksheet->setMarginTop(0.3); $this->worksheet->setMarginLeft(0.3); $this->worksheet->setMarginRight(0.1); $this->worksheet->setMarginBottom(0.7); $this->worksheet->setPaper(9); //$this->worksheet->setVersion(9); $this->worksheet->setZoom(100); $nextrow = 0; $this->excelReportPreDefineSetup(); $this->getQueries(); $max_col = $this->lobj_get_max_col[maxcol]; $min_col = $this->lobj_get_max_col[mincol]; //$this->worksheet->setColumn(0,$max_col,15); $get_company_header = $this->getCompanyDetails(); $company_name_name = $get_company_header[company_name]; $company_city = $get_company_header[city]; $this->worksheet->insertBitmap(0, 0, $logo_path, 0, 0, 1, 1); $this->worksheet->setColumn(0,0,2); $this->worksheet->write(0,1,$company_name_name,$Data_Center_Bold_NoBorder); $this->worksheet->mergeCells(0,1,0,$max_col); $this->worksheet->write(1,1,$company_city,$Data_Center_Bold_NoBorder); $this->worksheet->mergeCells(1,1,1,$max_col); //$worksheet->setHeader('&C'.$company_name_name."\n".'&C'.$company_city, 0.5); for($tit = 0 ; $tit < count($this->titles) ; $tit++) { $title_name = $this->titles[$tit]['title']; $this->worksheet->write($this->titles[$tit]['row'],$this->titles[$tit]['col'],$title_name,$Data_Center_Bold_NoBorder); $this->worksheet->mergeCells($this->titles[$tit]['row'],$this->titles[$tit]['col'],$this->titles[$tit]['row'],$max_col); if($this->titles[$tit]['row'] > $next_row) $nextrow = $this->titles[$tit]['row']; } $max_nextrow = $this->lobj_get_max_row[nextrow]; $nextrow += 1; $max_st_ctr = 0; for($hed = 0 ; $hed < count($this->lobj_get_report_setup_details); $hed++) { $column_name = $this->lobj_get_report_setup_details[$hed]['query_columns']; $header_row = $nextrow + $this->lobj_get_report_setup_details[$hed]['row']; $header_col = $this->lobj_get_report_setup_details[$hed]['col']; $data_row = $this->lobj_get_report_setup_details[$hed]['row']; $sub_tot_col = $this->lobj_get_report_setup_details[$hed]['sub_total']; $tot = $this->lobj_get_report_setup_details[$hed]['total']; $width = $this->lobj_get_report_setup_details[$hed]['width']; $width = ($width=='0')?19:$width; if($tot > 1) { $check_grand_tot = $tot; } $col_title = $this->lobj_get_report_setup_details[$hed]['title']; if($sub_tot_col > $max_st_ctr) { $max_st_ctr = $sub_tot_col; } $index_col[$column_name] = $header_col; $index_row[$column_name] = $data_row; if($col_title == 1) continue; $this->worksheet->setColumn($header_col,$header_col,$width); $this->worksheet->write($header_row,$header_col,$column_name,$Data_top_bottm_border); } $first = 1; $nextrow = $nextrow+$max_nextrow; for($data = 0 ; $data < count($this->data_set); $data++) { if($first == 1) { $first = 0; for($hed = 0 ; $hed < count($this->lobj_get_report_sub_hed_details); $hed++) { $column_name = $this->lobj_get_report_sub_hed_details[$hed]['query_columns']; $col_title = $this->lobj_get_report_sub_hed_details[$hed]['title']; $value = $this->data_set[$data][$column_name]; $col_ind = $index_col[$column_name]; $title_hed = $column_name.': '.$value; if($col_title == 1) { $this->worksheet->write($nextrow+1,$min_col,$title_hed,$Data_Left_Bold_NoBorder); $nextrow++; } } } for($hed = 0 ; $hed < count($this->lobj_get_report_setup_details); $hed++) { $column_name = $this->lobj_get_report_setup_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_setup_details[$hed]['sub_total']; $total = $this->lobj_get_report_setup_details[$hed]['total']; $data_col_title = $this->lobj_get_report_setup_details[$hed]['title']; $value = $this->data_set[$data][$column_name]; $col_ind = $index_col[$column_name]; $row_ind = $index_row[$column_name]; if($total == 1) { for($cnt = 0; $cnt <= $max_st_ctr ; $cnt++) { $totals[$cnt][$row_ind][$col_ind] += $value; } } if($sub_total > 0) { $totals[$sub_total]['val'] = $value; $totals[$sub_total]['check_val'] = $value; } if($data_col_title == 0) { $value = strtr($value, array( "\r\n" => "\n", "\r" => "\n", )); $this->worksheet->write($nextrow+$row_ind,$col_ind,$value,$Data_border); } } $nextrow = $nextrow+$max_nextrow; $change = false; for($hed = 0 ; $hed < count($this->lobj_get_report_sub_hed_details) ; $hed++) { $column_name = $this->lobj_get_report_sub_hed_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_sub_hed_details[$hed]['sub_total']; if($change) { $totals[$sub_total]['check_val'] = 'changed'; } else { $next_value = $this->data_set[$data+1][$column_name]; if($totals[$sub_total]['check_val'] != $next_value ) { $change = true; } } } for($hed = 0 ; $hed < count($this->lobj_get_report_total_details) ; $hed++) { $column_name = $this->lobj_get_report_total_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_total_details[$hed]['sub_total']; $next_value = $this->data_set[$data+1][$column_name]; $col_ind = $index_col[$column_name]; $row_ind = $index_row[$column_name]; if($totals[$sub_total]['check_val'] != $next_value ) { // $sub_tot_name = 'Total for =>'.$totals[$sub_total]['val']; // $this->worksheet->write($nextrow+$row_ind,$col_ind,$sub_tot_name,$Data_Right_Bold_NoBorder); $print_sub_title = false; for($sub_hed = 0 ; $sub_hed < count($this->lobj_get_report_setup_details); $sub_hed++) { $sub_head_name = $this->lobj_get_report_setup_details[$sub_hed]['query_columns']; $sub_col_ind = $index_col[$sub_head_name]; $sub_row_ind = $index_row[$sub_head_name]; $sub_tot_value = $totals[$sub_total][$sub_row_ind][$sub_col_ind]; if(!empty($sub_tot_value)) { $this->worksheet->write($nextrow+$sub_row_ind,$sub_col_ind,$sub_tot_value,$Data_Right_Bold_NoBorder); $totals[$sub_total][$sub_row_ind][$sub_col_ind] = 0; } } if($print_sub_title == true) { $sub_tot_name = 'Total for =>'.$totals[$sub_total]['val']; $worksheet->write($nextrow+$row_ind,$col_ind,$sub_tot_name,$Data_Right_Bold_NoBorder); } $nextrow = $nextrow+$max_nextrow; } } if($data < count($this->data_set)-1) { for($hed = 0 ; $hed < count($this->lobj_get_report_sub_hed_details) ; $hed++) { $column_name = $this->lobj_get_report_sub_hed_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_sub_hed_details[$hed]['sub_total']; $col_title = $this->lobj_get_report_sub_hed_details[$hed]['title']; $next_value = $this->data_set[$data+1][$column_name]; $title_hed = $column_name.': '.$next_value; $col_ind = $index_col[$column_name]; $row_ind = $index_row[$column_name]; if($totals[$sub_total]['check_val'] != $next_value ) { if($col_title == 1) { $this->worksheet->write($nextrow+1,$min_col,$title_hed,$Data_Left_Bold_NoBorder); $nextrow++; } } } } } if(!empty($check_grand_tot)) { $sub_tot_name = 'Grand Total =>'; $this->worksheet->write($nextrow+$row_ind,$min_col,$sub_tot_name,$Data_Right_Bold_NoBorder); } for($sub_hed = 0 ; $sub_hed < count($this->lobj_get_report_setup_details); $sub_hed++) { $sub_head_name = $this->lobj_get_report_setup_details[$sub_hed]['query_columns']; $sub_col_ind = $index_col[$sub_head_name]; $sub_row_ind = $index_row[$sub_head_name]; $sub_tot_value = $totals[0][$sub_row_ind][$sub_col_ind]; if(!empty($sub_tot_value)) { $this->worksheet->write($nextrow+$sub_row_ind,$sub_col_ind,$sub_tot_value,$Data_Right_Bold_NoBorder); $totals[0][$sub_row_ind][$sub_col_ind] = 0; } } //die(); $this->worksheet->setFooter('&LDate: &D &CPage &P of &N &R'.$this->report_setup['footerLoginName'], "0.3"); $workbook->close(); if($this->save_cond_flag == 0) $workbook->send("{$this->report_name}_report_{$this->report_id}.xls"); } //End : createReport() //STR_PAD_LEFT (integer) //STR_PAD_RIGHT (integer) function createTextReport() { $print_file= "c:\\print_file.txt"; $fh = fopen($print_file,'w') or die("can't open file"); // $title_name = str_pad('-',$this->page_size,"-", STR_PAD_BOTH); // fputs($fh,$title_name."\r\n"); $this->getQueries(); $get_col_width = "select rsd.col,max(rsd.width) as wdt from report_setup_details rsd inner join report_setup_header rsh on rsh.internal_code = rsd.ref_report_setup_header_code where rsh.report_id = '{$this->report_id}' and ifnull(rsh.report_name,'') = '{$this->setup_name}' group by col "; $lobj_get_col_width = $this->aobj_context->mobj_db->GetAll($get_col_width); $max_row = $this->lobj_get_max_row[nextrow]; $get_company_header = $this->getCompanyDetails(); $this->company_name_name = $get_company_header[company_name]; $this->company_city = $get_company_header[city]; //$max_col = $this->lobj_get_max_col[maxcol]; for($ent = 1 ; $ent <= $max_row ; $ent++) { for($dt = 0 ; $dt < count($lobj_get_col_width) ; $dt++) { $blank_print_data[$ent][$lobj_get_col_width[$dt]['col']] = str_pad(" ",$lobj_get_col_width[$dt]['wdt']); } } $max_st_ctr = $this->header($blank_print_data,$max_row,$fh); $title_name = $this->title_name; //start : Printing First subtotal Title $first = 1; for($data = 0 ; $data < count($this->data_set); $data++) { if($first == 1) { $first = 0; $print = 0; $print_data = $blank_print_data; for($hed = 0 ; $hed < count($this->lobj_get_report_sub_hed_details); $hed++) { $column_name = $this->lobj_get_report_sub_hed_details[$hed]['query_columns']; $col_title = $this->lobj_get_report_sub_hed_details[$hed]['title']; $col_width = $this->lobj_get_report_sub_hed_details[$hed]['width']; $sep_txt = $this->lobj_get_report_sub_hed_details[$hed]['sep_text']; $bold = $this->lobj_get_report_sub_hed_details[$hed]['bold']; $get_bold = $this->getBold($bold); $bold_on = $get_bold['on']; $bold_off = $get_bold['off']; $style = $this->lobj_get_report_sub_hed_details[$hed]['style']; $add_style = $this->getStyle($style); $style_on = $add_style['on']; $style_off = $add_style['off']; if(empty($col_width)) $col_width = 20; $col_num = $this->lobj_get_report_sub_hed_details[$hed]['col']; $row_num = $this->lobj_get_report_sub_hed_details[$hed]['row']; $alignment = $this->lobj_get_report_sub_hed_details[$hed]['alignment']; $pad_align = $this->getDataPad($alignment); $alias_name = $this->lobj_get_report_sub_hed_details[$hed]['alias_name']; $nor_alias_name = strtolower($alias_name); $value = $this->data_set[$data][$column_name]; if($nor_alias_name == 'value') $tit_val = $value; else if($nor_alias_name == 'name') $tit_val = $column_name; else $tit_val = $alias_name; $title_hed = $column_name.': '.$tit_val; if($col_title == 1) { $prt_val = substr(str_pad($title_hed,$col_width,' ',$pad_align),0,$col_width) ; $print_data[$row_num][$col_num] = $bold_on.$style_on.$prt_val.$style_off.$bold_off; $print = 1; } } $this->pageBreak($fh,$blank_print_data,$title_name,$max_row); if($print == 1) { for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string .= $print_data[$ent][$dt]; } fwrite($fh,$print_string."\r\n"); $this->page_count++; $st_len = strlen(trim($print_string)); $head_line = str_pad('-',$st_len,"-", STR_PAD_BOTH); fputs($fh,$head_line."\r\n"); $this->page_count++; } } } //End : Printing First subtotal Title //Strat : Printing Normal data $print_data = $blank_print_data; for($hed = 0 ; $hed < count($this->lobj_get_report_setup_details); $hed++) { $column_name = $this->lobj_get_report_setup_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_setup_details[$hed]['sub_total']; $total = $this->lobj_get_report_setup_details[$hed]['total']; if($total > 0) { $text_grand_tot = 1; } $data_col_title = $this->lobj_get_report_setup_details[$hed]['title']; $col_width = $this->lobj_get_report_setup_details[$hed]['width']; if(empty($col_width)) $col_width = 20; $col_num = $this->lobj_get_report_setup_details[$hed]['col']; $row_num = $this->lobj_get_report_setup_details[$hed]['row']; $sep_txt = $this->lobj_get_report_setup_details[$hed]['sep_text']; $style = $this->lobj_get_report_setup_details[$hed]['style']; $add_style = $this->getStyle($style); $style_on = $add_style['on']; $style_off = $add_style['off']; $alignment = $this->lobj_get_report_setup_details[$hed]['alignment']; $pad_align = $this->getDataPad($alignment); $value = $this->data_set[$data][$column_name]; if($total == 1) { for($cnt = 0; $cnt <= $max_st_ctr ; $cnt++) { $totals[$cnt][$row_num][$col_num] += $value; } } if($sub_total > 0) { $totals[$sub_total]['val'] = $value; $totals[$sub_total]['check_val'] = $value; } if($data_col_title == 0) { $prt_val = substr(str_pad($value,$col_width,' ',$pad_align),0,$col_width) ; $print_data[$row_num][$col_num] = $style_on.$prt_val.$style_off; } } $this->pageBreak($fh,$blank_print_data,$title_name,$max_row); for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string .= $print_data[$ent][$dt].$sep_txt; } fwrite($fh,$print_string."\r\n"); $this->page_count++; if($data == count($this->data_set)-1) { for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string .= $print_data[$ent][$dt].$sep_txt; } $st_len = strlen(trim($print_string)); $head_line = str_pad('-',$st_len,"-", STR_PAD_BOTH); fputs($fh,$head_line."\r\n"); $this->page_count++; } } $pgbr = ''; } //End : Printing Normal data $change = false; for($hed = 0 ; $hed < count($this->lobj_get_report_sub_hed_details) ; $hed++) { $column_name = $this->lobj_get_report_sub_hed_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_sub_hed_details[$hed]['sub_total']; if($change) { $totals[$sub_total]['check_val'] = 'changed'; } else { $next_value = $this->data_set[$data+1][$column_name]; if($totals[$sub_total]['check_val'] != $next_value ) { $change = true; } } } //Start : Printing subtotal values //$print_data = $blank_print_data; $print = 0; for($hed = 0 ; $hed < count($this->lobj_get_report_total_details) ; $hed++) { $column_name = $this->lobj_get_report_total_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_total_details[$hed]['sub_total']; $col_width = $this->lobj_get_report_total_details[$hed]['width']; if(empty($col_width)) $col_width = 20; $col_num = $this->lobj_get_report_total_details[$hed]['col']; $row_num = $this->lobj_get_report_total_details[$hed]['row']; $sep_txt = $this->lobj_get_report_total_details[$hed]['sep_text']; $bold = $this->lobj_get_report_total_details[$hed]['bold']; $get_bold = $this->getBold($bold); $bold_on = $get_bold['on']; $bold_off = $get_bold['off']; $style = $this->lobj_get_report_total_details[$hed]['style']; $add_style = $this->getStyle($style); $style_on = $add_style['on']; $style_off = $add_style['off']; $alignment = $this->lobj_get_report_total_details[$hed]['alignment']; $pad_align = $this->getDataPad($alignment); $next_value = $this->data_set[$data+1][$column_name]; if($totals[$sub_total]['check_val'] != $next_value ) { fputs($fh,$title_name."\r\n"); $print_data = $blank_print_data; $sub_tot_name = 'Total for =>'.$totals[$sub_total]['val']; $prt_val = substr(str_pad($sub_tot_name,$col_width,' ',$pad_align),0,$col_width) ; $print_data[$row_num][$col_num] = $bold_on.$style_on.$prt_val.$style_off.$bold_off; for($sub_hed = 0 ; $sub_hed < count($this->lobj_get_report_setup_details); $sub_hed++) { $sub_head_name = $this->lobj_get_report_setup_details[$sub_hed]['query_columns']; $col_width = $this->lobj_get_report_setup_details[$sub_hed]['width']; if(empty($col_width)) $col_width = 20; $sub_col_ind = $this->lobj_get_report_setup_details[$sub_hed]['col']; $sub_row_ind = $this->lobj_get_report_setup_details[$sub_hed]['row']; $sep_txt = $this->lobj_get_report_setup_details[$sub_hed]['sep_text']; $bold = $this->lobj_get_report_setup_details[$sub_hed]['bold']; $get_bold = $this->getBold($bold); $bold_on = $get_bold['on']; $bold_off = $get_bold['off']; $style = $this->lobj_get_report_setup_details[$sub_hed]['style']; $add_style = $this->getStyle($style); $style_on = $add_style['on']; $style_off = $add_style['off']; $alignment = $this->lobj_get_report_setup_details[$sub_hed]['alignment']; $pad_align = $this->getDataPad($alignment); $sub_tot_value = $totals[$sub_total][$sub_row_ind][$sub_col_ind]; if(!empty($sub_tot_value)) { $prt_val = substr(str_pad($sub_tot_value,$col_width,' ',$pad_align),0,$col_width) ; $print_data[$sub_row_ind][$sub_col_ind] = $bold_on.$style_on.$prt_val.$style_off.$bold_off; $totals[$sub_total][$sub_row_ind][$sub_col_ind] = 0; $print = 1; } } $this->pageBreak($fh,$blank_print_data,$title_name,$max_row); if($print == 1) { for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string .= $print_data[$ent][$dt].$sep_txt; } fwrite($fh,$print_string."\r\n"); $this->page_count++; } } fputs($fh,$title_name."\r\n"); $this->page_count++; } } //End : Printing subtotal values //Start : Printing Titels $print_data = $blank_print_data; $print = 0; if($data < count($this->data_set)-1) { for($hed = 0 ; $hed < count($this->lobj_get_report_sub_hed_details) ; $hed++) { $column_name = $this->lobj_get_report_sub_hed_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_sub_hed_details[$hed]['sub_total']; $col_title = $this->lobj_get_report_sub_hed_details[$hed]['title']; $col_width = $this->lobj_get_report_sub_hed_details[$hed]['width']; if(empty($col_width)) $col_width = 20; $col_num = $this->lobj_get_report_sub_hed_details[$hed]['col']; $row_num = $this->lobj_get_report_sub_hed_details[$hed]['row']; $sep_txt = $this->lobj_get_report_sub_hed_details[$hed]['sep_text']; $bold = $this->lobj_get_report_sub_hed_details[$hed]['bold']; $get_bold = $this->getBold($bold); $bold_on = $get_bold['on']; $bold_off = $get_bold['off']; $style = $this->lobj_get_report_sub_hed_details[$hed]['style']; $add_style = $this->getStyle($style); $style_on = $add_style['on']; $style_off = $add_style['off']; $alignment = $this->lobj_get_report_sub_hed_details[$hed]['alignment']; $pad_align = $this->getDataPad($alignment); $alias_name = $this->lobj_get_report_sub_hed_details[$hed]['alias_name']; $nor_alias_name = strtolower($alias_name); $next_value = $this->data_set[$data+1][$column_name]; if($nor_alias_name == 'value') $tit_val = $next_value; else if($nor_alias_name == 'name') $tit_val = $column_name; else $tit_val = $alias_name; $title_hed = $column_name.': '.$tit_val; if($totals[$sub_total]['check_val'] != $next_value ) { if($col_title == 1) { $prt_val = substr(str_pad($title_hed,$col_width,' ',$pad_align),0,$col_width) ; $print_data[$row_num][$col_num] = $bold_on.$style_on.$prt_val.$style_off.$bold_off; $print = 1; } } } $this->pageBreak($fh,$blank_print_data,$title_name,$max_row); if($print == 1) { for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string .= $print_data[$ent][$dt]; } fwrite($fh,$print_string."\r\n"); $this->page_count++; $st_len = strlen(trim($print_string)); $head_line = str_pad('-',$st_len,"-", STR_PAD_BOTH); fputs($fh,$head_line."\r\n"); $this->page_count++; } } } } //End : Printing Titels //Start : Printing Grand Total if($text_grand_tot > 0) { $sub_tot_name = 'Grand Total =>'; $print_data = $blank_print_data; $print_data[1][1] = str_pad($sub_tot_name,$col_width); for($sub_hed = 0 ; $sub_hed < count($this->lobj_get_report_setup_details); $sub_hed++) { $sub_head_name = $this->lobj_get_report_setup_details[$sub_hed]['query_columns']; $col_width = $this->lobj_get_report_setup_details[$sub_hed]['width']; $col_num = $this->lobj_get_report_setup_details[$sub_hed]['col']; $row_num = $this->lobj_get_report_setup_details[$sub_hed]['row']; $sep_txt = $this->lobj_get_report_setup_details[$sub_hed]['sep_text']; $bold = $this->lobj_get_report_setup_details[$sub_hed]['bold']; $get_bold = $this->getBold($bold); $bold_on = $get_bold['on']; $bold_off = $get_bold['off']; $style = $this->lobj_get_report_setup_details[$sub_hed]['style']; $add_style = $this->getStyle($style); $style_on = $add_style['on']; $style_off = $add_style['off']; $alignment = $this->lobj_get_report_setup_details[$sub_hed]['alignment']; $pad_align = $this->getDataPad($alignment); $sub_tot_value = $totals[0][$row_num][$col_num]; if(!empty($sub_tot_value)) { $prt_val = substr(str_pad($sub_tot_value,$col_width,' ',$pad_align),0,$col_width) ; $print_data[$row_num][$col_num] = $bold_on.$style_on.$prt_val.$style_off.$bold_off; $totals[0][$row_num][$col_num] = 0; } } $this->pageBreak($fh,$blank_print_data,$title_name,$max_row); for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string .= $print_data[$ent][$dt].$sep_txt; } fwrite($fh,$print_string."\r\n"); $this->page_count++; $st_len = strlen(trim($print_string)); $head_line = str_pad('-',$st_len,"-", STR_PAD_BOTH); fputs($fh,$head_line."\r\n"); $this->page_count++; } } //End : Printing Grand Total fclose($fh); $header_value='Following Records are not inserted'; header("Content-type:application/txt"); header("Content-Disposition:attachment;filename=print_file.txt"); readfile($print_file); } function createPdfReport() { $pdf_writer=$this->aobj_context->main_src."/tarka_pdf/fpdf.php"; require_once($pdf_writer); $root_rpt_file_download="c:\\Temp\print_pdf.pdf"; $root_rpt_file_dname="print_pdf.pdf"; //unlink($root_rpt_file_download); $PageSetup = ''; if($this->report_setup['page_orientation'] == 'landscape') $PageSetup_orient = 'L'; else $PageSetup = 'P'; if(!empty($this->report_setup['pdfPaperSize'])) $PageSetup_size = $this->report_setup['pdfPaperSize']; //echo $PageSetup; die(); $pdf= new myFPDF($PageSetup_orient, 'mm', $PageSetup_size); //$pdf= new myFPDF($PageSetup); $pdf->lgin_name = $this->report_setup['footerLoginName']; $pdf->logo_path_tool = $this->aobj_context->main_src."/img/bioplus logo.jpg"; $get_company_header = $this->getCompanyDetails(); $company_name_name = $get_company_header[company_name]; $company_city = $get_company_header[city]; $this->getQueries(); $get_col_width = "select rsd.col,max(rsd.width) as wdt from report_setup_details rsd inner join report_setup_header rsh on rsh.internal_code = rsd.ref_report_setup_header_code where rsh.report_id = '{$this->report_id}' and rsh.report_name = '{$this->setup_name}' group by col "; $lobj_get_col_width = $this->aobj_context->mobj_db->GetAll($get_col_width); $max_row = $this->lobj_get_max_row[nextrow]; //$max_col = $this->lobj_get_max_col[maxcol]; for($ent = 1 ; $ent <= $max_row ; $ent++) { for($dt = 0 ; $dt < count($lobj_get_col_width) ; $dt++) { $blank_print_data[$ent][$lobj_get_col_width[$dt]['col']]['data'] = str_pad(" ",$lobj_get_col_width[$dt]['wdt']); $blank_print_data[$ent][$lobj_get_col_width[$dt]['col']]['algn'] = ''; $blank_print_data[$ent][$lobj_get_col_width[$dt]['col']]['width'] = ''; } } $pdf->company_name = $company_name_name; $pdf->company_city = $company_city; $pdf->hd_title = $this->titles; $pdf->hd_maxrow = $max_row; $pdf->hd_pdf_size = $this->pdf_page_size; $pdf->hd_blank_data = $blank_print_data; $pdf->lobj_get_report_setup_details = $this->lobj_get_report_setup_details; $pdf->tarka_constant_pages = 0; $pdf->AliasNbPages(); $pdf->SetMargins(20,14); $max_st_ctr = $pdf->AddPage(); //$pdf->SetFont('Times','B',20); $pdf->SetFont('Times','B',10); //start : Printing First subtotal Title $first = 1; for($data = 0 ; $data < count($this->data_set); $data++) { if($first == 1) { $first = 0; $print = 0; $print_data = $blank_print_data; for($hed = 0 ; $hed < count($this->lobj_get_report_sub_hed_details); $hed++) { $column_name = $this->lobj_get_report_sub_hed_details[$hed]['query_columns']; $col_title = $this->lobj_get_report_sub_hed_details[$hed]['title']; $col_width = $this->lobj_get_report_sub_hed_details[$hed]['width']; $sep_txt = $this->lobj_get_report_sub_hed_details[$hed]['sep_text']; $bold = $this->lobj_get_report_sub_hed_details[$hed]['bold']; $style = $this->lobj_get_report_sub_hed_details[$hed]['style']; if(empty($col_width)) $col_width = 20; $col_num = $this->lobj_get_report_sub_hed_details[$hed]['col']; $row_num = $this->lobj_get_report_sub_hed_details[$hed]['row']; $alignment = $this->lobj_get_report_sub_hed_details[$hed]['alignment']; $pad_align = $this->getPdfDataPad($alignment); $alias_name = $this->lobj_get_report_sub_hed_details[$hed]['alias_name']; $nor_alias_name = strtolower($alias_name); $value = $this->data_set[$data][$column_name]; if($nor_alias_name == 'value') $tit_val = $value; else if($nor_alias_name == 'name') $tit_val = $column_name; else $tit_val = $alias_name; $title_hed = $column_name.': '.$tit_val; if($col_title == 1) { //$prt_val = substr(str_pad($title_hed,$col_width,' ',$pad_align),0,$col_width) ; // $print_data[$row_num][$col_num] = $prt_val; $print_data[$row_num][$col_num]['data'] = $title_hed; $print_data[$row_num][$col_num]['algn'] = $pad_align; $print_data[$row_num][$col_num]['width'] = $col_width; $print = 1; } } if($print == 1) { for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string = $print_data[$ent][$dt]['data']; $print_align = $print_data[$ent][$dt]['algn']; $print_width = $print_data[$ent][$dt]['width']; if(empty($print_width)) $print_width = strlen($print_string); if($ent == $max_row and $dt == count($print_data[$ent])) { $pdf->Cell($print_width*2,5,$print_string,'LR',0,$print_align); } else { if(!empty($print_align)) $pdf->Cell($print_width*2,5,$print_string,'LB',0,$print_align); else $pdf->Cell($print_width*2,5,$print_string,'L',0,$print_align); } } $pdf->Cell(1,5,'',"",1); //$st_len = strlen(trim($print_string)); //$head_line = str_pad('-',$st_len,"-", STR_PAD_BOTH); //$pdf->Cell($st_len,5,$head_line,"",1,"R"); } } } //End : Printing First subtotal Title $pdf->SetFont('Times','',10); //Strat : Printing Normal data $print_data = $blank_print_data; for($hed = 0 ; $hed < count($this->lobj_get_report_setup_details); $hed++) { $column_name = $this->lobj_get_report_setup_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_setup_details[$hed]['sub_total']; $total = $this->lobj_get_report_setup_details[$hed]['total']; if($total > 0) { $pdf_gran_tot = 1; } $data_col_title = $this->lobj_get_report_setup_details[$hed]['title']; $col_width = $this->lobj_get_report_setup_details[$hed]['width']; if(empty($col_width)) $col_width = 20; $col_num = $this->lobj_get_report_setup_details[$hed]['col']; $row_num = $this->lobj_get_report_setup_details[$hed]['row']; $sep_txt = $this->lobj_get_report_setup_details[$hed]['sep_text']; $style = $this->lobj_get_report_setup_details[$hed]['style']; $alignment = $this->lobj_get_report_setup_details[$hed]['alignment']; $pad_align = $this->getPdfDataPad($alignment); $value = $this->data_set[$data][$column_name]; if($total == 1) { for($cnt = 0; $cnt <= $max_st_ctr ; $cnt++) { $totals[$cnt][$row_num][$col_num] += $value; } } if($sub_total > 0) { $totals[$sub_total]['val'] = $value; $totals[$sub_total]['check_val'] = $value; } if($data_col_title == 0) { // $prt_val = substr(str_pad($value,$col_width,' ',$pad_align),0,$col_width) ; //$print_data[$row_num][$col_num] = $prt_val; $print_data[$row_num][$col_num]['data'] = $value; $print_data[$row_num][$col_num]['algn'] = $pad_align; $print_data[$row_num][$col_num]['width'] = $col_width; } } for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string = $print_data[$ent][$dt]['data']; $print_align = $print_data[$ent][$dt]['algn']; $print_width = $print_data[$ent][$dt]['width']; if(empty($print_width)) $print_width = strlen($print_string); if($ent == $max_row and $dt == count($print_data[$ent])) { if($data == count($this->data_set)-1) { $pdf->Cell($print_width*2,5,$print_string,'LRB',0,$print_align); } else { $pdf->Cell($print_width*2,5,$print_string,'LR',0,$print_align); } } else { if($data == count($this->data_set)-1) { $pdf->Cell($print_width*2,5,$print_string,'LB',0,$print_align); } else { $pdf->Cell($print_width*2,5,$print_string,'L',0,$print_align); } } } $pdf->Cell(1,5,'',"",1); } //End : Printing Normal data $change = false; for($hed = 0 ; $hed < count($this->lobj_get_report_sub_hed_details) ; $hed++) { $column_name = $this->lobj_get_report_sub_hed_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_sub_hed_details[$hed]['sub_total']; if($change) { $totals[$sub_total]['check_val'] = 'changed'; } else { $next_value = $this->data_set[$data+1][$column_name]; if($totals[$sub_total]['check_val'] != $next_value ) { $change = true; } } } //Start : Printing subtotal values $pdf->SetFont('Times','B',10); //$print_data = $blank_print_data; $print = 0; for($hed = 0 ; $hed < count($this->lobj_get_report_total_details) ; $hed++) { $column_name = $this->lobj_get_report_total_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_total_details[$hed]['sub_total']; $col_width = $this->lobj_get_report_total_details[$hed]['width']; if(empty($col_width)) $col_width = 20; $col_num = $this->lobj_get_report_total_details[$hed]['col']; $row_num = $this->lobj_get_report_total_details[$hed]['row']; $sep_txt = $this->lobj_get_report_total_details[$hed]['sep_text']; $bold = $this->lobj_get_report_total_details[$hed]['bold']; $style = $this->lobj_get_report_total_details[$hed]['style']; $alignment = $this->lobj_get_report_total_details[$hed]['alignment']; $pad_align = $this->getPdfDataPad($alignment); $next_value = $this->data_set[$data+1][$column_name]; if($totals[$sub_total]['check_val'] != $next_value ) { //fputs($fh,$title_name."\r\n"); // $pdf->Cell(140,5,$title_name,"",1,"R"); $print_data = $blank_print_data; $sub_tot_name = 'Total for =>'.$totals[$sub_total]['val']; //$prt_val = substr(str_pad($sub_tot_name,$col_width,' ',$pad_align),0,$col_width) ; // $print_data[$row_num][$col_num] = $prt_val; $print_data[$row_num][$col_num]['data'] = $sub_tot_name; $print_data[$row_num][$col_num]['algn'] = $pad_align; $print_data[$row_num][$col_num]['width'] = $col_width; for($sub_hed = 0 ; $sub_hed < count($this->lobj_get_report_setup_details); $sub_hed++) { $sub_head_name = $this->lobj_get_report_setup_details[$sub_hed]['query_columns']; $col_width = $this->lobj_get_report_setup_details[$sub_hed]['width']; if(empty($col_width)) $col_width = 20; $sub_col_ind = $this->lobj_get_report_setup_details[$sub_hed]['col']; $sub_row_ind = $this->lobj_get_report_setup_details[$sub_hed]['row']; $sep_txt = $this->lobj_get_report_setup_details[$sub_hed]['sep_text']; $bold = $this->lobj_get_report_setup_details[$sub_hed]['bold']; $style = $this->lobj_get_report_setup_details[$sub_hed]['style']; $alignment = $this->lobj_get_report_setup_details[$sub_hed]['alignment']; $pad_align = $this->getPdfDataPad($alignment); $sub_tot_value = $totals[$sub_total][$sub_row_ind][$sub_col_ind]; if(!empty($sub_tot_value)) { //$prt_val = substr(str_pad($sub_tot_value,$col_width,' ',$pad_align),0,$col_width) ; //$print_data[$sub_row_ind][$sub_col_ind] = $prt_val; $print_data[$sub_row_ind][$sub_col_ind]['data'] = $sub_tot_value; $print_data[$sub_row_ind][$sub_col_ind]['algn'] = $pad_align; $print_data[$sub_row_ind][$sub_col_ind]['width'] = $col_width; $totals[$sub_total][$sub_row_ind][$sub_col_ind] = 0; $print = 1; } } if($print == 1) { for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; $fir = 0; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string = $print_data[$ent][$dt]['data']; $print_align = $print_data[$ent][$dt]['algn']; $print_width = $print_data[$ent][$dt]['width']; if(empty($print_width)) $print_width = strlen($print_string); if($fir == 0) { $grd_width = $print_width; $grd_algn = $print_align; $pdf->Cell($print_width*2,5,$print_string,'LTB',0,$print_align); } else if($dt == count($print_data[$ent])) { $pdf->Cell($print_width*2,5,$print_string,'RTB',0,$print_align); } else { $pdf->Cell($print_width*2,5,$print_string,'TB',0,$print_align); } $fir = 1 ; } //fwrite($fh,$print_string."\r\n"); $pdf->Cell(1,5,'',"",1); } } //fputs($fh,$title_name."\r\n"); //$pdf->Cell(140,5,$title_name,"",1,"R"); } } //End : Printing subtotal values //Start : Printing Titels $print_data = $blank_print_data; $print = 0; if($data < count($this->data_set)-1) { for($hed = 0 ; $hed < count($this->lobj_get_report_sub_hed_details) ; $hed++) { $column_name = $this->lobj_get_report_sub_hed_details[$hed]['query_columns']; $sub_total = $this->lobj_get_report_sub_hed_details[$hed]['sub_total']; $col_title = $this->lobj_get_report_sub_hed_details[$hed]['title']; $col_width = $this->lobj_get_report_sub_hed_details[$hed]['width']; if(empty($col_width)) $col_width = 20; $col_num = $this->lobj_get_report_sub_hed_details[$hed]['col']; $row_num = $this->lobj_get_report_sub_hed_details[$hed]['row']; $sep_txt = $this->lobj_get_report_sub_hed_details[$hed]['sep_text']; $bold = $this->lobj_get_report_sub_hed_details[$hed]['bold']; $style = $this->lobj_get_report_sub_hed_details[$hed]['style']; $alignment = $this->lobj_get_report_sub_hed_details[$hed]['alignment']; $pad_align = $this->getPdfDataPad($alignment); $alias_name = $this->lobj_get_report_sub_hed_details[$hed]['alias_name']; $nor_alias_name = strtolower($alias_name); $next_value = $this->data_set[$data+1][$column_name]; if($nor_alias_name == 'value') $tit_val = $next_value; else if($nor_alias_name == 'name') $tit_val = $column_name; else $tit_val = $alias_name; $title_hed = $column_name.': '.$tit_val; if($totals[$sub_total]['check_val'] != $next_value ) { if($col_title == 1) { // $prt_val = substr(str_pad($title_hed,$col_width,' ',$pad_align),0,$col_width) ; //$print_data[$row_num][$col_num] = $prt_val; $print_data[$row_num][$col_num]['data'] = $title_hed; $print_data[$row_num][$col_num]['algn'] = $pad_align; $print_data[$row_num][$col_num]['width'] = $col_width; $print = 1; } } } if($print == 1) { for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string = $print_data[$ent][$dt]['data']; $print_align = $print_data[$ent][$dt]['algn']; $print_width = $print_data[$ent][$dt]['width']; if(empty($print_width)) $print_width = strlen($print_string); if(!empty($print_align)) $pdf->Cell($print_width*2,5,$print_string,'LB',0,$print_align); else $pdf->Cell($print_width*2,5,$print_string,'L',0,$print_align); } // fwrite($fh,$print_string."\r\n"); $pdf->Cell(1,5,'',"",1); //$st_len = strlen(trim($print_string)); // $head_line = str_pad('-',$st_len,"-", STR_PAD_BOTH); // $pdf->Cell(100,5,$head_line,"",1,"R"); // fputs($fh,$head_line."\r\n"); } } } } //End : Printing Titels //Start : Printing Grand Total if($pdf_gran_tot > 0) { $sub_tot_name = 'Grand Total =>'; $print_data = $blank_print_data; $print_data[1][1]['data'] = $sub_tot_name; $print_data[1][1]['algn'] = $grd_algn; $print_data[1][1]['width'] = $grd_width; for($sub_hed = 0 ; $sub_hed < count($this->lobj_get_report_setup_details); $sub_hed++) { $sub_head_name = $this->lobj_get_report_setup_details[$sub_hed]['query_columns']; $col_width = $this->lobj_get_report_setup_details[$sub_hed]['width']; $col_num = $this->lobj_get_report_setup_details[$sub_hed]['col']; $row_num = $this->lobj_get_report_setup_details[$sub_hed]['row']; $sep_txt = $this->lobj_get_report_setup_details[$sub_hed]['sep_text']; $bold = $this->lobj_get_report_setup_details[$sub_hed]['bold']; $style = $this->lobj_get_report_setup_details[$sub_hed]['style']; $alignment = $this->lobj_get_report_setup_details[$sub_hed]['alignment']; $pad_align = $this->getPdfDataPad($alignment); $sub_tot_value = $totals[0][$row_num][$col_num]; if(!empty($sub_tot_value)) { //$prt_val = substr(str_pad($sub_tot_value,$col_width,' ',$pad_align),0,$col_width) ; // $print_data[$row_num][$col_num] = $prt_val; $print_data[$row_num][$col_num]['data'] = $sub_tot_value; $print_data[$row_num][$col_num]['algn'] = $pad_align; $print_data[$row_num][$col_num]['width'] = $col_width; $totals[0][$row_num][$col_num] = 0; } } for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; $fir = 0; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string = $print_data[$ent][$dt]['data']; $print_align = $print_data[$ent][$dt]['algn']; $print_width = $print_data[$ent][$dt]['width']; if(empty($print_width)) $print_width = strlen($print_string); if($fir == 0) { $pdf->Cell($print_width*2,5,$print_string,'LB',0,$print_align); } else if($dt == count($print_data[$ent])) { $pdf->Cell($print_width*2,5,$print_string,'RB',0,$print_align); } else { $pdf->Cell($print_width*2,5,$print_string,'B',0,$print_align); } $fir = 1; } // fwrite($fh,$print_string."\r\n"); // $pdf->Cell(100,5,$print_string,"",1,"R"); //$st_len = strlen(trim($print_string)); // $head_line = str_pad('-',$st_len,"-", STR_PAD_BOTH); // $pdf->Cell(100,5,$head_line,"",1,"R"); // fputs($fh,$head_line."\r\n"); } } //End : Printing Grand Total $pdf->output($root_rpt_file_download,'D'); } function getQueries() { $get_max_col = "select max(col) as maxcol , min(col) mincol from report_setup_details rsd inner join report_setup_header rsh on rsh.internal_code = rsd.ref_report_setup_header_code where rsh.report_id = '{$this->report_id}' and ifnull(rsh.report_name,'') = '{$this->setup_name}' order by rsd.internal_code"; $this->lobj_get_max_col = $this->aobj_context->mobj_db->GetRow($get_max_col); $get_report_setup_details = "select rsd.* from report_setup_details rsd inner join report_setup_header rsh on rsh.internal_code = rsd.ref_report_setup_header_code where rsh.report_id = '{$this->report_id}' and ifnull(rsh.report_name,'') = '{$this->setup_name}' order by rsd.row,rsd.col"; $this->lobj_get_report_setup_details = $this->aobj_context->mobj_db->GetAll($get_report_setup_details); $get_report_total_details = "select rsd.* from report_setup_details rsd inner join report_setup_header rsh on rsh.internal_code = rsd.ref_report_setup_header_code where rsh.report_id = '{$this->report_id}' and ifnull(rsh.report_name,'') = '{$this->setup_name}' and sub_total > 0 order by sub_total desc"; $this->lobj_get_report_total_details = $this->aobj_context->mobj_db->GetAll($get_report_total_details); $get_report_sub_hed_details = "select rsd.* from report_setup_details rsd inner join report_setup_header rsh on rsh.internal_code = rsd.ref_report_setup_header_code where rsh.report_id = '{$this->report_id}' and ifnull(rsh.report_name,'') = '{$this->setup_name}' and sub_total > 0 order by sub_total"; $this->lobj_get_report_sub_hed_details = $this->aobj_context->mobj_db->GetAll($get_report_sub_hed_details); $get_max_row = "select max(row) as nextrow from report_setup_details rsd inner join report_setup_header rsh on rsh.internal_code = rsd.ref_report_setup_header_code where rsh.report_id = '{$this->report_id}' and ifnull(rsh.report_name,'') = '{$this->setup_name}' order by rsd.internal_code"; $this->lobj_get_max_row = $this->aobj_context->mobj_db->GetRow($get_max_row); } function getDataPad($alignment) { if($alignment == 'Left') $pad_align = STR_PAD_LEFT; else if($alignment == 'Center') $pad_align = STR_PAD_BOTH; else $pad_align = STR_PAD_RIGHT; return $pad_align; } function getPdfDataPad($alignment) { if($alignment == 'Left') $pad_align = "L"; else if($alignment == 'Center') $pad_align = "C"; else $pad_align = "R"; return $pad_align; } function getStyle($style) { $comppress_on = chr(15); $comppress_off = chr(18); $medium_on = ''; $medium_off = ''; $wide_on = chr(27).'W1'; $wide_off = chr(27).'W0'; if($style == 'Compress') { $get_style['on'] = $comppress_on; $get_style['off'] = $comppress_off; } else if($style == 'Medium') { $get_style['on'] = $medium_on; $get_style['off'] = $medium_off; } else if($style == 'Wide') { $get_style['on'] = $wide_on; $get_style['off'] = $wide_off; } else { $get_style['on'] = ''; $get_style['off'] = ''; } return $get_style; } function getBold($bold) { $bold_on = chr(27).'E1'; $bold_off = chr(27).'E0'; if($bold == 1) { $bold_data['on'] = $bold_on; $bold_data['off'] = $bold_off; } else { $bold_data['on'] = ''; $bold_data['off'] = ''; } } function header($blank_print_data,$max_row,$fh) { $this->page_count = 0; $print_data = $blank_print_data; //Getting Printing data and Length also. for($hed = 0 ; $hed < count($this->lobj_get_report_setup_details); $hed++) { $column_name = $this->lobj_get_report_setup_details[$hed]['query_columns']; $header_row = $this->lobj_get_report_setup_details[$hed]['row']; $header_col = $this->lobj_get_report_setup_details[$hed]['col']; $col_width = $this->lobj_get_report_setup_details[$hed]['width']; $sep_txt = $this->lobj_get_report_setup_details[$hed]['sep_text']; $bold = $this->lobj_get_report_setup_details[$hed]['bold']; $get_bold = $this->getBold($bold); $bold_on = $get_bold['on']; $bold_off = $get_bold['off']; $style = $this->lobj_get_report_setup_details[$hed]['style']; $add_style = $this->getStyle($style); $style_on = $add_style['on']; $style_off = $add_style['off']; $alignment = $this->lobj_get_report_setup_details[$hed]['alignment']; $pad_align = $this->getDataPad($alignment); if(empty($col_width)) $col_width = 20; $sub_tot_col = $this->lobj_get_report_setup_details[$hed]['sub_total']; $col_title = $this->lobj_get_report_setup_details[$hed]['title']; if($sub_tot_col > $max_st_ctr) { $max_st_ctr = $sub_tot_col; } if($col_title == 1) continue; $prt_val = substr(str_pad($column_name,$col_width,' ', $pad_align),0,$col_width); $print_data[$header_row][$header_col] = $bold_on.$style_on.$prt_val.$style_off.$bold_off; } // Start: Getting Global Line Length $head_line = ''; for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string .= $print_data[$ent][$dt].$sep_txt; } $st_len = strlen(trim($print_string)); $gb_str_len += $st_len; $this->title_name .= str_pad('-',$st_len,"-", STR_PAD_BOTH); } fputs($fh,$this->title_name."\r\n"); $this->page_count++; // End Getting Global Line Length //Start : Displaying Header $company_name_name = str_pad($this->company_name_name,$gb_str_len," ", STR_PAD_BOTH); fputs($fh,$company_name_name."\r\n"); $this->page_count++; $company_city = str_pad($this->company_city,$gb_str_len," ", STR_PAD_BOTH); fputs($fh,$company_city."\r\n"); $this->page_count++; for($tit = 0 ; $tit < count($this->titles) ; $tit++) { $title_name = $this->titles[$tit]['title']; $title_name = str_pad($title_name,$gb_str_len," ", STR_PAD_BOTH); fputs($fh, $title_name."\r\n"); $this->page_count++; } fputs($fh,$this->title_name."\r\n"); $this->page_count++; // displaying Menue Header for($ent = 1 ; $ent <= $max_row ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string .= $print_data[$ent][$dt].$sep_txt; } fwrite($fh,$print_string."\r\n"); $this->page_count++; $st_len = strlen(trim($print_string)); $head_line = str_pad('-',$st_len,"-", STR_PAD_BOTH); fputs($fh,$head_line."\r\n"); $this->page_count++; } //End : Displaying Header return $max_st_ctr; } function pageBreak($fh,$blank_print_data,$title_name,$max_row) { if ($this->page_count+$max_row >= 65) { $pgbr = chr(12); fputs($fh,$title_name."\r\n".$pgbr); $this->header($blank_print_data,$max_row,$fh); } } } //End : Class file //Start : getModuleNames() /* This function is for to get market module names*/ function getModuleNames($aobj_context) { try { $class_obj=new marketreport($aobj_context); $class_obj->report_id = $aobj_context->mobj_data["report_id"]; $market_modules = $class_obj->getMarketModulesNames(); echo $aobj_context->mobj_output->ToJSONEnvelope($market_modules,0,"Success"); } catch (Exception $aobj_exp) { echo 'Caught exception: ', $aobj_exp->getMessage(), "\n"; } } //End: getModuleNames() //print_r($my_aobj_context); $main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7); $pdf_writer_class =$main_src."/tarka_pdf/fpdf.php"; include_once($pdf_writer_class); class myFPDF extends FPDF { function Header() { $this->SetFont('Times','B',12); $this->Image($this->logo_path_tool, 12, 7, 22, 22, JPG); $company_name = str_pad($this->company_name, 125, " ", STR_PAD_BOTH); $this->Cell(0,5,$company_name,"C",1,0); $company_city = str_pad($this->company_city, 130, " ", STR_PAD_BOTH); $this->Cell(0,4,$company_city,"C",1,0); for($tit = 0 ; $tit < count($this->hd_title) ; $tit++) { $title_name = $this->hd_title[$tit]['title']; $title_name = str_pad($title_name, $this->hd_pdf_size, " ", STR_PAD_BOTH); $this->Cell(0,5,$title_name,"C",1,0); } //$title_name = str_pad('-',$this->hd_pdf_size,"-", STR_PAD_BOTH); $this->Cell(0,5,'',"",1,""); $this->SetFont('Times','B',10); $print_data = $this->hd_blank_data; for($hed = 0 ; $hed < count($this->lobj_get_report_setup_details); $hed++) { $column_name = $this->lobj_get_report_setup_details[$hed]['query_columns']; $header_row = $this->lobj_get_report_setup_details[$hed]['row']; $header_col = $this->lobj_get_report_setup_details[$hed]['col']; $col_width = $this->lobj_get_report_setup_details[$hed]['width']; $sep_txt = $this->lobj_get_report_setup_details[$hed]['sep_text']; $bold = $this->lobj_get_report_setup_details[$hed]['bold']; $style = $this->lobj_get_report_setup_details[$hed]['style']; $alignment = $this->lobj_get_report_setup_details[$hed]['alignment']; if($alignment == 'Left') $pad_align = "L"; else if($alignment == 'Center') $pad_align = "C"; else $pad_align = "R"; if(empty($col_width)) $col_width = 20; $sub_tot_col = $this->lobj_get_report_setup_details[$hed]['sub_total']; $col_title = $this->lobj_get_report_setup_details[$hed]['title']; if($sub_tot_col > $max_st_ctr) { $max_st_ctr = $sub_tot_col; } if($col_title == 1) continue; //$prt_val = substr(str_pad($column_name,$col_width,' ', $pad_align),0,$col_width); $print_data[$header_row][$header_col]['data'] = $column_name; $print_data[$header_row][$header_col]['algn'] = $pad_align; $print_data[$header_row][$header_col]['width'] = $col_width; } for($ent = 1 ; $ent <= $this->hd_maxrow ; $ent++) { $print_string = ''; for($dt = 1 ; $dt <= count($print_data[$ent]) ; $dt++) { $print_string = $print_data[$ent][$dt]['data']; $print_align = $print_data[$ent][$dt]['algn']; $print_width = $print_data[$ent][$dt]['width']; $this->Cell($print_width*2,5,$print_string,1,0,$print_align); } } $this->Cell(1,5,'',"",1); //FPDF::Header(); return $max_st_ctr; } function Footer() { //Go to 1.5 cm from bottom $this->SetY(-12); //Select Arial italic 8 $this->SetFont('Arial','I',8); //Print centered page number $this->Cell(10,10,$this->lgin_name.' '.date("m.d.Y"),0,0,'L'); $this->Cell(0,10,'Page: '.$this->PageNo().'/{nb}',0,0,'R'); } } ?>
Close