jan4
This commit is contained in:
parent
c87d6d5259
commit
2f0fd08b39
12
.env
12
.env
@ -14,7 +14,7 @@
|
||||
# ENVIRONMENT
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
CI_ENVIRONMENT = production
|
||||
# CI_ENVIRONMENT = production
|
||||
#CI_ENVIRONMENT = development
|
||||
#LOCAL_FOLDER = 'donation'
|
||||
#--------------------------------------------------------------------
|
||||
@ -51,11 +51,11 @@
|
||||
# DATABASE
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
database.default.hostname = venbainfotech.com
|
||||
database.default.database = kasirama_donr
|
||||
database.default.username = kasirama_donr
|
||||
database.default.password = gx2BEG=qc+D0
|
||||
database.default.DBDriver = MySQLi
|
||||
# database.default.hostname = venbainfotech.com
|
||||
# database.default.database = kasirama_donr
|
||||
# database.default.username = kasirama_donr
|
||||
# database.default.password = gx2BEG=qc+D0
|
||||
# database.default.DBDriver = MySQLi
|
||||
|
||||
# database.tests.hostname = localhost
|
||||
# database.tests.database = ci4
|
||||
|
||||
@ -22,6 +22,10 @@ class PhpspreadsheetController extends BaseController
|
||||
|
||||
public function import_donation_data()
|
||||
{
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
|
||||
if($this->request->getmethod() == 'post')
|
||||
@ -104,7 +108,7 @@ public function import_donation_data()
|
||||
|
||||
|
||||
$model = new Donation_data_model();
|
||||
$model->save($fetchData);
|
||||
$model->save($fetchData);
|
||||
|
||||
}
|
||||
|
||||
@ -120,30 +124,42 @@ public function import_donation_data()
|
||||
|
||||
}
|
||||
}
|
||||
echo view('templates/header');
|
||||
echo view('donation_data');
|
||||
echo view('templates/footer');
|
||||
// $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
//return redirect()->to(base_url().'/all_donation_data');
|
||||
return view('donation_data');
|
||||
}
|
||||
|
||||
// if(isset($_FILES['upload_file']['name']) && in_array($_FILES['upload_file']['type'], $file_mimes))
|
||||
|
||||
// public function import_transaction_data()
|
||||
// {
|
||||
// $arr_file = explode('.', $_FILES['upload_file']['name']);
|
||||
// $file_mimes = array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
|
||||
// if(isset($_FILES['transacton_upload']['name']) && in_array($_FILES['transacton_upload']['type'], $file_mimes))
|
||||
// {
|
||||
// $arr_file = explode('.', $_FILES['transacton_upload']['name']);
|
||||
// $extension = end($arr_file);
|
||||
// if('csv' == $extension){
|
||||
// $reader = new \PhpOffice\PhpSpreadsheet\Reader\Csv();
|
||||
// } else {
|
||||
// $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
|
||||
// }
|
||||
// $spreadsheet = $reader->load($_FILES['upload_file']['tmp_name']);
|
||||
// $spreadsheet = $reader->load($_FILES['transacton_upload']['tmp_name']);
|
||||
// $sheetData = $spreadsheet->getActiveSheet()->toArray();
|
||||
// echo "<pre>";
|
||||
// if(!empty($sheetData))
|
||||
// {echo "<pre>";
|
||||
// print_r($sheetData);
|
||||
// }
|
||||
}
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
public function import_transaction_data()
|
||||
{
|
||||
|
||||
if(!session()->has('logged_user'))
|
||||
{
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
if($this->request->getmethod() == 'post')
|
||||
{
|
||||
@ -174,7 +190,7 @@ public function import_transaction_data()
|
||||
$spreadsheet = $render->load($file);
|
||||
$allDataInSheet = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);
|
||||
$arrayCount = count($allDataInSheet);
|
||||
|
||||
print_r($arrayCount);die();
|
||||
$flag = 0;
|
||||
$createArray = array('DATE', 'REF_1', 'REF_2', 'REMARKS' , 'AMOUNT' , 'DONATION_REF');
|
||||
|
||||
@ -221,15 +237,13 @@ public function import_transaction_data()
|
||||
$amount = filter_var(trim($allDataInSheet[$i][$amount]), FILTER_SANITIZE_EMAIL);
|
||||
$donation_ref = filter_var(trim($allDataInSheet[$i][$donation_ref]), FILTER_SANITIZE_STRING);
|
||||
|
||||
$fetchData= array('date' => $date, 'ref_1' => $ref_1, 'ref_2' => $ref_2, 'remarks' => $remarks, 'amount' => $amount, 'donation_ref' => $donation_ref);
|
||||
|
||||
//print_r($fetchData); exit();
|
||||
$model = new Transaction_model();
|
||||
$model->save($fetchData);
|
||||
$fetchData= array('date' => $date, 'ref_1' => $ref_1, 'ref_2' => $ref_2, 'remarks' => $remarks, 'amount' => $amount, 'donation_ref' => $donation_ref);
|
||||
// print_r($fetchData);
|
||||
$model = new Transaction_model();
|
||||
$model->save($fetchData);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
echo '<script>alert("Please import correct file, did not match excel sheet column")</script>';
|
||||
//echo "Please import correct file, did not match excel sheet column";
|
||||
@ -240,19 +254,17 @@ public function import_transaction_data()
|
||||
|
||||
|
||||
}
|
||||
// echo view('templates/header');
|
||||
// echo view('transaction_upload');
|
||||
// echo view('templates/footer');
|
||||
// return redirect()->to(base_url().'/all_transaction');
|
||||
return view('transaction_upload');
|
||||
|
||||
}
|
||||
public function transaction_file()
|
||||
{
|
||||
return $this->response->download('public/assets/download/transaction_upload_file.xlsx', NULL);
|
||||
return $this->response->download('public/assets/download/transaction_data_file.xlsx', NULL);
|
||||
}
|
||||
public function donation_data_file()
|
||||
{
|
||||
return $this->response->download('public/assets/download/donation_data_upload_file.xlsx', NULL);
|
||||
return $this->response->download('public/assets/download/donation_data_file.xlsx', NULL);
|
||||
}
|
||||
|
||||
}
|
||||
@ -178,7 +178,7 @@
|
||||
<input type="file" name="upload_file" value="" style="padding-bottom:20px" >
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<button type="button" class="btn btn-info "style="background-color: green; width: 160px; padding: 0px; line-height: 40px;">submit</button>
|
||||
<button type="submit" class="btn btn-info "style="background-color: green; width: 160px; padding: 0px; line-height: 40px;">submit</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -178,7 +178,7 @@
|
||||
<input type="file" name="transacton_upload" value="" style="padding-bottom:20px" >
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<button type="button" class="btn btn-info "style="background-color: green; width: 160px; padding: 0px; line-height: 40px;">submit</button>
|
||||
<button type="submit" class="btn btn-info "style="background-color: green; width: 160px; padding: 0px; line-height: 40px;">submit</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
BIN
public/assets/download/donation_data_file.xlsx
Normal file
BIN
public/assets/download/donation_data_file.xlsx
Normal file
Binary file not shown.
BIN
public/assets/download/transaction_data_file.xlsx
Normal file
BIN
public/assets/download/transaction_data_file.xlsx
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609737788;_ci_previous_url|s:37:"http://localhost/donation/transaction";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609687940;_ci_previous_url|s:48:"http://localhost/donation/transaction_data_excel";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609686091;_ci_previous_url|s:48:"http://localhost/donation/transaction_data_excel";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609686925;_ci_previous_url|s:48:"http://localhost/donation/transaction_data_excel";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609739191;_ci_previous_url|s:37:"http://localhost/donation/transaction";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609689504;_ci_previous_url|s:37:"http://localhost/donation/transaction";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609741473;_ci_previous_url|s:37:"http://localhost/donation/transaction";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609689540;_ci_previous_url|s:26:"http://localhost/donation/";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609683949;_ci_previous_url|s:42:"http://localhost/donation/transaction_file";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609684809;_ci_previous_url|s:43:"http://localhost/donation/all_donation_data";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609603328;_ci_previous_url|s:26:"http://localhost/donation/";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609739589;_ci_previous_url|s:37:"http://localhost/donation/transaction";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609686583;_ci_previous_url|s:48:"http://localhost/donation/transaction_data_excel";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609739958;_ci_previous_url|s:48:"http://localhost/donation/transaction_data_excel";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609684357;_ci_previous_url|s:39:"http://localhost/donation/donation_data";logged_user|s:1:"3";
|
||||
@ -1 +1 @@
|
||||
__ci_last_regenerate|i:1609602427;_ci_previous_url|s:32:"http://localhost/donation/signup";
|
||||
__ci_last_regenerate|i:1609603328;_ci_previous_url|s:32:"http://localhost/donation/signup";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609738356;_ci_previous_url|s:37:"http://localhost/donation/transaction";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609685637;_ci_previous_url|s:37:"http://localhost/donation/transaction";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609741474;_ci_previous_url|s:32:"http://localhost/donation/signup";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609737333;_ci_previous_url|s:48:"http://localhost/donation/transaction_data_excel";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609687516;_ci_previous_url|s:48:"http://localhost/donation/transaction_data_excel";logged_user|s:1:"3";
|
||||
@ -0,0 +1 @@
|
||||
__ci_last_regenerate|i:1609685235;_ci_previous_url|s:48:"http://localhost/donation/transaction_data_excel";logged_user|s:1:"3";
|
||||
Loading…
Reference in New Issue
Block a user