From a9a71139f1ab547d3b40c217791c3714b6242b6f Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 9 Sep 2024 12:06:41 +0530 Subject: [PATCH 1/7] worked on business settings in master -vadivel J --- app/Controllers/Companycontroller.php | 34 +++++++---- app/Models/Companydetails_model.php | 4 +- app/Views/companyview.php | 82 +++++++++++++++++++++------ 3 files changed, 90 insertions(+), 30 deletions(-) diff --git a/app/Controllers/Companycontroller.php b/app/Controllers/Companycontroller.php index 07c835c6..71a4bf93 100644 --- a/app/Controllers/Companycontroller.php +++ b/app/Controllers/Companycontroller.php @@ -132,29 +132,31 @@ class Companycontroller extends BaseController // { + $file=$this->request->getFile('files'); + $PictureName = $this->request->getPost('Image'); $ModifyPictureName = $this->request->getPost('ModifyImage'); $Picture = ""; - $file = $this->request->getFile('ModifyImage'); + $ProfilePicPhoto = $this->request->getFile('photo'); if ($PictureName != '') { - if ($file !== null && $file->isValid() && !$file->hasMoved()) { + if ($ProfilePicPhoto !== null && $ProfilePicPhoto->isValid() && !$ProfilePicPhoto->hasMoved()) { $path = ROOTPATH.'public/uploads/images/'; if(!is_dir($path)) { mkdir($path, 0777, true); } - $Picture = $file->getName(); - $file->move($path,$Picture); + $Picture = $ProfilePicPhoto->getName(); + $ProfilePicPhoto->move($path,$Picture); }else{ $Picture = $PictureName; } } else { - if ($file !== null && $file->isValid() && !$file->hasMoved()) { + if ($ProfilePicPhoto !== null && $ProfilePicPhoto->isValid() && !$ProfilePicPhoto->hasMoved()) { $path = ROOTPATH.'public/uploads/images/'; if(!is_dir($path)) { mkdir($path, 0777, true); } - $Picture = $file->getName(); - $file->move($path,$Picture); + $Picture = $ProfilePicPhoto->getName(); + $ProfilePicPhoto->move($path,$Picture); } } @@ -202,11 +204,21 @@ class Companycontroller extends BaseController $ID = $this->request->getPost('ID'); //$createdDate=$this->request->getPost('createdDate'); - //$Company = array('CompID'=>$CompID,'CompanyName'=>$CompanyName,'Address'=>$Address,'ContactNumber'=>$ContactNumber,'AlternateContactNumber'=>$AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNO'=>$GSTNO,'GSTRange'=>$GSTRange,'UANumber'=>$UANumber,'PaymentTerms'=>$Payment ,'PaymentDays'=>$PaymentDays ,'PayableAT'=>$PayableAT ,'Createdby'=>$createdby,'ProfilePic'=>$Picture,'Exiseregistration'=>$Exiseregistration,'CollectrateAddress'=>$CollectrateAddress,'FiscalYearStartOn'=>$financialstart,'FiscalYearEndsOn'=> $financialend); - $Company = array('CompID' => $CompID, 'CompanyName' => $CompanyName, 'Address' => $Address, 'ContactNumber' => $ContactNumber, 'AlternateContactNumber' => $AlternateContactNumber, 'EmailAddress' => $EmailAddress, 'TIN' => $TIN, 'PAN' => $PAN, 'GSTNO' => $GSTNO, 'GSTRange' => $GSTRange, 'UANumber' => $UANumber, 'MSME' => $MSME , 'Createdby' => $createdby, 'ProfilePic' => $Picture, 'Exiseregistration' => $Exiseregistration, 'CollectrateAddress' => $CollectrateAddress, 'FiscalYearStartOn' => $financialstart, 'FiscalYearEndsOn' => $financialend, 'paymentID' => $PaymentId, 'companyWebsite' => $companywebsite, 'UpdatedBY' => $updatedby, 'Updatedon' => $updateddt); + //$Company = array('CompID'=>$CompID,'CompanyName'=>$CompanyName,'Address'=>$Address,'ContactNumber'=>$ContactNumber, + //'AlternateContactNumber'=>$AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNO'=>$GSTNO, + //'GSTRange'=>$GSTRange,'UANumber'=>$UANumber,'PaymentTerms'=>$Payment ,'PaymentDays'=>$PaymentDays ,'PayableAT'=>$PayableAT , + //'Createdby'=>$createdby,'ProfilePic'=>$Picture,'Exiseregistration'=>$Exiseregistration,'CollectrateAddress'=>$CollectrateAddress, + //'FiscalYearStartOn'=>$financialstart,'FiscalYearEndsOn'=> $financialend); + $Company = array('CompID' => $CompID, 'CompanyName' => $CompanyName, 'Address' => $Address, 'ContactNumber' => $ContactNumber, + 'AlternateContactNumber' => $AlternateContactNumber, 'EmailAddress' => $EmailAddress, 'TIN' => $TIN, 'PAN' => $PAN, + 'GSTNO' => $GSTNO, 'GSTRange' => $GSTRange, 'UANumber' => $UANumber, 'MSME' => $MSME , 'Createdby' => $createdby, + 'ProfilePic' => $Picture, 'Exiseregistration' => $Exiseregistration, 'CollectrateAddress' => $CollectrateAddress, + 'FiscalYearStartOn' => $financialstart, 'FiscalYearEndsOn' => $financialend, 'paymentID' => $PaymentId, + 'companyWebsite' => $companywebsite, 'UpdatedBY' => $updatedby, 'Updatedon' => $updateddt); - if (!empty($file)) { - $myfile = array('CompID' => $CompID, 'filename' => $file, 'ID' => $ID, 'filedescription' => $filedescription1, 'createdDate' => $createddt); + if (!empty($file) && $file->getSize()){ + $fileName = $file->getName(); + $myfile = array('CompID' => $CompID, 'filename' => $fileName, 'uploadedby' => $ID, 'filedescription' => $filedescription1, 'createdDate' => $createddt); $result2 = $this->companydetailsmodel->filedetails($myfile); } diff --git a/app/Models/Companydetails_model.php b/app/Models/Companydetails_model.php index 0158012e..b7ff22cb 100644 --- a/app/Models/Companydetails_model.php +++ b/app/Models/Companydetails_model.php @@ -78,9 +78,9 @@ class Companydetails_model extends Model function companylisting() { $builder = $this->db->table('t_company_details com') - ->select('com.*,emp.firstname,pmt.PaymentTerms') + ->select('com.*,emp.firstname,pmt.PaymentTerms,tbl.userId') ->join('t_paymentterms pmt', 'com.paymentID = pmt.PaymentID', 'left') - ->join('tbl_users as tbl', ' com.createdby = tbl.userid', 'left') + ->join('tbl_users as tbl', ' com.Createdby = tbl.userId', 'left') ->join('t_employee_details as emp', 'emp.empid=tbl.empid', 'left'); $query = $builder->get(); $result = $query->getResult(); diff --git a/app/Views/companyview.php b/app/Views/companyview.php index 1a887da5..9cffe75d 100644 --- a/app/Views/companyview.php +++ b/app/Views/companyview.php @@ -59,6 +59,7 @@ if(!empty($userRecords)) $PaymentTerms = $uf->PaymentTerms ; $PaymentId = $uf->paymentID; $MSME = $uf->MSME; + $userId=$uf->userId; //$PaymentDays = $uf->PaymentDays ; //$PayableAT = $uf->PayableAT ; $Createdby = $uf->Createdby; @@ -172,7 +173,8 @@ function readURL(input,num) { reader.readAsDataURL(input.files[0]); } } - } + +} function isNumberKey(evt){ @@ -501,10 +503,25 @@ function ValidateUA() { Business Information
+ + + + + +
- your image
- - + your image
+
+ +
+ your image
+
+ + + + +
@@ -514,7 +531,7 @@ function ValidateUA() {
- +
@@ -709,17 +726,17 @@ function ValidateUA() { { foreach ($filetype as $rl) { - ?> + ?> -
- - + +
@@ -791,7 +808,14 @@ function ValidateUA() {
- + + + + + + + + + + + + + + + + + + +