From 167fcb49926cc86ac884cf5754e9b4196cd5a7af Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Fri, 28 Jun 2019 17:33:37 +0530 Subject: [PATCH] NORMEL COMMIT --- api/application/composer.json | 2 +- api/application/composer.lock | 91 ++++----- api/application/config/constants.php | 5 +- api/application/config/routes.php | 168 +--------------- api/application/controllers/PD_Controller.php | 181 +++++++++++++++--- .../helpers/authorization_helper.php | 2 +- .../views/report_templates/JSONTOREPORT.php | 8 +- 7 files changed, 213 insertions(+), 244 deletions(-) diff --git a/api/application/composer.json b/api/application/composer.json index 44abf358..b2df246e 100644 --- a/api/application/composer.json +++ b/api/application/composer.json @@ -18,7 +18,7 @@ "ddeboer/tesseract": "^1.1", "aws/aws-sdk-php": "^3.64", "amphp/amp": "^1.2", - "dompdf/dompdf" : "0.8.2", + "dompdf/dompdf" : "0.8.3", "tecnickcom/tcpdf": "^6.2", "phpmailer/phpmailer": "^6.0", "php-curl-class/php-curl-class": "^8.5", diff --git a/api/application/composer.lock b/api/application/composer.lock index 55c782bf..8b6649f6 100644 --- a/api/application/composer.lock +++ b/api/application/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fc220b8435596093210dababb4b092ef", + "content-hash": "60bb51fa13af4981c1289371d8244b89", "packages": [ { "name": "amphp/amp", @@ -65,23 +65,22 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.81.6", + "version": "3.103.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "0e07e92ec7042316ffc79ef290cf7bbb7d7be24b" + "reference": "77ed156cc323efcc7912941440c622d5f12ffbce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/0e07e92ec7042316ffc79ef290cf7bbb7d7be24b", - "reference": "0e07e92ec7042316ffc79ef290cf7bbb7d7be24b", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/77ed156cc323efcc7912941440c622d5f12ffbce", + "reference": "77ed156cc323efcc7912941440c622d5f12ffbce", "shasum": "" }, "require": { "ext-json": "*", "ext-pcre": "*", "ext-simplexml": "*", - "ext-spl": "*", "guzzlehttp/guzzle": "^5.3.3|^6.2.1", "guzzlehttp/promises": "~1.0", "guzzlehttp/psr7": "^1.4.1", @@ -99,7 +98,8 @@ "ext-sockets": "*", "nette/neon": "^2.3", "phpunit/phpunit": "^4.8.35|^5.4.3", - "psr/cache": "^1.0" + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0" }, "suggest": { "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", @@ -144,7 +144,7 @@ "s3", "sdk" ], - "time": "2018-12-14T22:50:05+00:00" + "time": "2019-06-27T18:15:25+00:00" }, { "name": "ddeboer/tesseract", @@ -192,30 +192,34 @@ }, { "name": "dompdf/dompdf", - "version": "v0.8.2", + "version": "v0.8.3", "source": { "type": "git", "url": "https://github.com/dompdf/dompdf.git", - "reference": "5113accd9ae5d466077cce5208dcf3fb871bf8f6" + "reference": "75f13c700009be21a1965dc2c5b68a8708c22ba2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dompdf/dompdf/zipball/5113accd9ae5d466077cce5208dcf3fb871bf8f6", - "reference": "5113accd9ae5d466077cce5208dcf3fb871bf8f6", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/75f13c700009be21a1965dc2c5b68a8708c22ba2", + "reference": "75f13c700009be21a1965dc2c5b68a8708c22ba2", "shasum": "" }, "require": { "ext-dom": "*", - "ext-gd": "*", "ext-mbstring": "*", "phenx/php-font-lib": "0.5.*", "phenx/php-svg-lib": "0.3.*", "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "4.8.*", + "phpunit/phpunit": "^4.8|^5.5|^6.5", "squizlabs/php_codesniffer": "2.*" }, + "suggest": { + "ext-gd": "Needed to process images", + "ext-gmagick": "Improves image processing performance", + "ext-imagick": "Improves image processing performance" + }, "type": "library", "extra": { "branch-alias": { @@ -250,7 +254,7 @@ ], "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", "homepage": "https://github.com/dompdf/dompdf", - "time": "2017-11-26T14:49:08+00:00" + "time": "2018-12-14T02:40:31+00:00" }, { "name": "guzzlehttp/guzzle", @@ -647,16 +651,16 @@ }, { "name": "php-curl-class/php-curl-class", - "version": "8.5.0", + "version": "8.6.0", "source": { "type": "git", "url": "https://github.com/php-curl-class/php-curl-class.git", - "reference": "2b387e3ef1c8a1d6116a1459c0e3e71643f86806" + "reference": "73bf10e2652ad2261cbab7fbf242b76f0e7ee359" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-curl-class/php-curl-class/zipball/2b387e3ef1c8a1d6116a1459c0e3e71643f86806", - "reference": "2b387e3ef1c8a1d6116a1459c0e3e71643f86806", + "url": "https://api.github.com/repos/php-curl-class/php-curl-class/zipball/73bf10e2652ad2261cbab7fbf242b76f0e7ee359", + "reference": "73bf10e2652ad2261cbab7fbf242b76f0e7ee359", "shasum": "" }, "require": { @@ -710,20 +714,20 @@ "web-service", "xml" ], - "time": "2019-01-07T06:43:45+00:00" + "time": "2019-05-12T08:22:01+00:00" }, { "name": "phpmailer/phpmailer", - "version": "v6.0.6", + "version": "v6.0.7", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "8190d73eb5def11a43cfb020b7f36db65330698c" + "reference": "0c41a36d4508d470e376498c1c0c527aa36a2d59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/8190d73eb5def11a43cfb020b7f36db65330698c", - "reference": "8190d73eb5def11a43cfb020b7f36db65330698c", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/0c41a36d4508d470e376498c1c0c527aa36a2d59", + "reference": "0c41a36d4508d470e376498c1c0c527aa36a2d59", "shasum": "" }, "require": { @@ -776,7 +780,7 @@ } ], "description": "PHPMailer is a full-featured email creation and transfer class for PHP", - "time": "2018-11-16T00:41:32+00:00" + "time": "2019-02-01T15:04:28+00:00" }, { "name": "psr/http-message", @@ -961,20 +965,21 @@ }, { "name": "smalot/pdfparser", - "version": "v0.13.2", + "version": "v0.13.3", "source": { "type": "git", "url": "https://github.com/smalot/pdfparser.git", - "reference": "f5e85c023491aecc88e8f6227536d60e1bb4a241" + "reference": "c3a050fb9b47ec3a0ce1b6f1b6f48ec822ba04d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/smalot/pdfparser/zipball/f5e85c023491aecc88e8f6227536d60e1bb4a241", - "reference": "f5e85c023491aecc88e8f6227536d60e1bb4a241", + "url": "https://api.github.com/repos/smalot/pdfparser/zipball/c3a050fb9b47ec3a0ce1b6f1b6f48ec822ba04d6", + "reference": "c3a050fb9b47ec3a0ce1b6f1b6f48ec822ba04d6", "shasum": "" }, "require": { - "ext-iconv": "*", + "ext-mbstring": "*", + "ext-zlib": "*", "php": ">=5.3.0", "tecnickcom/tcpdf": "~6.0" }, @@ -1006,29 +1011,29 @@ "pdf", "text" ], - "time": "2018-06-23T08:43:13+00:00" + "time": "2019-01-11T08:49:57+00:00" }, { "name": "symfony/process", - "version": "v3.3.6", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a" + "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/07432804942b9f6dd7b7377faf9920af5f95d70a", - "reference": "07432804942b9f6dd7b7377faf9920af5f95d70a", + "url": "https://api.github.com/repos/symfony/process/zipball/856d35814cf287480465bb7a6c413bb7f5f5e69c", + "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -1055,7 +1060,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-07-13T13:05:09+00:00" + "time": "2019-05-30T16:10:05+00:00" }, { "name": "tecnickcom/tcpdf", @@ -1121,16 +1126,16 @@ }, { "name": "thiagoalessio/tesseract_ocr", - "version": "2.7.2", + "version": "2.7.3", "source": { "type": "git", "url": "https://github.com/thiagoalessio/tesseract-ocr-for-php.git", - "reference": "3df8862309e049a25828b6db181d18ddddd8cdb0" + "reference": "b369b5496b6e809d012aacf06cbf2db5f6b29f76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thiagoalessio/tesseract-ocr-for-php/zipball/3df8862309e049a25828b6db181d18ddddd8cdb0", - "reference": "3df8862309e049a25828b6db181d18ddddd8cdb0", + "url": "https://api.github.com/repos/thiagoalessio/tesseract-ocr-for-php/zipball/b369b5496b6e809d012aacf06cbf2db5f6b29f76", + "reference": "b369b5496b6e809d012aacf06cbf2db5f6b29f76", "shasum": "" }, "require": { @@ -1162,7 +1167,7 @@ "Tesseract", "text recognition" ], - "time": "2018-12-11T19:38:54+00:00" + "time": "2019-01-30T19:47:33+00:00" } ], "packages-dev": [], diff --git a/api/application/config/constants.php b/api/application/config/constants.php index e5f1307b..0780d4ec 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -86,7 +86,7 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto // define login route name for token verification //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(getPDReportHTML/:any)'); // no errors -defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'getPDOfficerCurrentLocation'); // no errors +defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'login'); // no errors defined('ROUTE_LOGIN_X') OR define('ROUTE_LOGIN_X', '(getPDReportHTML/:any)'); // no errors //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN','getFullPDDetails'); // no errors @@ -561,6 +561,9 @@ defined('PDPURCHASEBILLWISECHILD') OR define('PDPURCHASEBILLWISECHILD','t_pd_pur defined('PDPURCHASEBILLWISECHILDID') OR define('PDPURCHASEBILLWISECHILDID','pbwc_id'); defined('PDMIS') OR define('PDMIS','PD_MIS'); +defined('USERNOTIFICATIONTOKENS') OR define('USERNOTIFICATIONTOKENS','m_user_notification_tokens'); +defined('USERNOTIFICATIONTOKENSID') OR define('USERNOTIFICATIONTOKENSID','notification_token_id'); + diff --git a/api/application/config/routes.php b/api/application/config/routes.php index d0a6d763..000a7eab 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -61,177 +61,11 @@ $route['translate_uri_dashes'] = FALSE; */ /* Routes regards Common Masters CRUD operations*/ -$route['getListOfSubProduct'] = 'Common_Masters_Controller/getListOfSubProduct'; -$route['getListOfBranches'] = 'Common_Masters_Controller/getListOfBranches'; -$route['getListOfCompany'] = 'Common_Masters_Controller/getListOfCompany'; -$route['getListOfState'] = 'Common_Masters_Controller/getListOfState'; -$route['getListOfCity'] = 'Common_Masters_Controller/getListOfCity'; -$route['getPDNotificationsList'] = 'Common_Masters_Controller/getPDNotificationsList'; -$route['getListOfPDTeam'] = 'Common_Masters_Controller/getListOfPDTeam'; -$route['getPdManage'] = 'Common_Masters_Controller/getPdManage'; -$route['savePdTeamManage'] = 'Common_Masters_Controller/savePdTeamManage'; -$route['getListOfPDTeamCityMapping'] = 'Common_Masters_Controller/getListOfPDTeamCityMapping'; -$route['getListOfMaster'] = 'Common_Masters_Controller/getListOfMaster'; -$route['saveMaster'] = 'Common_Masters_Controller/saveMaster'; -$route['saveBranch'] = 'Common_Masters_Controller/saveBranch'; -$route['savePDAllocationType'] = 'Common_Masters_Controller/savePDAllocationType'; -$route['savePDNotification'] = 'Common_Masters_Controller/savePDNotification'; -$route['saveCompany'] = 'Common_Masters_Controller/saveCompany'; -$route['savePDTeam'] = 'Common_Masters_Controller/savePdTeam'; -$route['deletePdTeamMapping'] = 'Common_Masters_Controller/deletePdTeamMapping'; -$route['getLender'] = 'Common_Masters_Controller/getLender'; -$route['getProduct'] = 'Common_Masters_Controller/getProduct'; -$route['getCustomerSegment'] = 'Common_Masters_Controller/getCustomerSegment'; - - - - - - -//USER MANAGEMENT -$route['getListOfUsers'] = 'User_Management_Controller/listAllUsers'; -$route['saveNewUser'] = 'User_Management_Controller/saveNewUser'; -$route['updateExistUser'] = 'User_Management_Controller/updateExistUser'; -$route['getUsersDetails'] = 'User_Management_Controller/getUsersDetails'; -$route['getSingedProfilePicURL'] = 'User_Management_Controller/getSingedProfilePicURL'; -$route['checkpin'] = 'User_Management_Controller/checkpin'; - // TEMPLATE MANAGEMENT $route['(listAllTemplates/:any)'] = 'Template_Management_Controller/listAllTemplates/'; -$route['saveNewTemplateName'] = 'Template_Management_Controller/saveNewTemplateName'; -$route['saveTemplateLenderDetails'] = 'Template_Management_Controller/saveTemplateLenderDetails'; -$route['saveTemplateCategoryDetails'] = 'Template_Management_Controller/saveTemplateCategoryDetails'; -$route['saveTemplateQuestionAnswers'] = 'Template_Management_Controller/saveTemplateQuestionAnswers'; -$route['getTemplateMaster'] = 'Template_Management_Controller/getTemplateMaster'; -$route['getTemplateLenders'] = 'Template_Management_Controller/getTemplateLenders'; -$route['getTemplateCategories'] = 'Template_Management_Controller/getTemplateCategories'; -$route['getTemplateQuestionAnswers'] = 'Template_Management_Controller/getTemplateQuestionAnswers'; -$route['getListOfCategories'] = 'Template_Management_Controller/getListOfCategories'; -$route['getQuestionsForTemplateCreation'] = 'Template_Management_Controller/getQuestionsForTemplateCreation'; -$route['getCategoryGroupCombinations'] = 'Template_Management_Controller/getCategoryGroupCombinations'; -$route['saveScoreCardQuestions'] = 'Template_Management_Controller/saveScoreCardQuestions'; -$route['getFormAndQuestionKeys'] = 'Template_Management_Controller/getFormAndQuestionKeys'; -$route['getScorecardDetails'] = 'Template_Management_Controller/getScorecardDetails'; -$route['savePDReportTemplate'] = 'Template_Management_Controller/savePDReportTemplate'; -$route['getPDReportTemplate'] = 'Template_Management_Controller/getPDReportTemplate'; -$route['getTemplateForms'] = 'Template_Management_Controller/getTemplateForms'; -$route['saveTemplateForms'] = 'Template_Management_Controller/saveTemplateForms'; +$route['login'] = 'Auth/login'; -//QUESTION MANAGEMENT -$route['(listAllQuestions/:any)'] = 'Question_Management_Controller/listAllQuestions/'; -$route['saveNewQuestion'] = 'Question_Management_Controller/saveNewQuestion'; -$route['saveExistQuestion'] = 'Question_Management_Controller/saveExistQuestion'; -$route['updateAnswerStatus'] = 'Question_Management_Controller/updateAnswerStatus'; -//ENTITY MANAGEMENT -$route['(listAllEntites/:any)'] = 'Entity_Management_Controller/listAllEntites/'; -$route['saveNewEntity'] = 'Entity_Management_Controller/saveNewEntity'; -$route['saveExistEntity'] = 'Entity_Management_Controller/saveExistEntity'; -$route['getEntityBillingInfo'] = 'Entity_Management_Controller/getEntityBillingInfo'; -$route['getLocationHierarchy'] = 'Entity_Management_Controller/getLocationHierarchy'; -$route['getEntityMasterInfo'] = 'Entity_Management_Controller/getEntityMasterInfo'; -$route['saveEntityBillingInfo'] = 'Entity_Management_Controller/saveEntityBillingInfo'; -$route['getCityHierarchy'] = 'Entity_Management_Controller/getCityHierarchy'; -$route['saveEntityRegionMapping'] = 'Entity_Management_Controller/saveEntityRegionMapping'; -$route['getEntityRegionCityMap'] = 'Entity_Management_Controller/getEntityRegionCityMap'; -$route['saveVendorCityMapping'] = 'Entity_Management_Controller/saveVendorCityMapping'; -$route['getVendorCityMap'] = 'Entity_Management_Controller/getVendorCityMap'; -$route['saveLenderBranches'] = 'Entity_Management_Controller/saveLenderBranches'; -$route['listLenderBranches'] = 'Entity_Management_Controller/listLenderBranches'; -$route['getFullTATInfo'] = 'Entity_Management_Controller/getFullTATInfo'; -$route['saveTATInfo'] = 'Entity_Management_Controller/saveTATInfo'; -$route['deleteTATCombimaion'] = 'Entity_Management_Controller/deleteTATCombimaion'; -$route['saveEntityPricingInfo'] = 'Entity_Management_Controller/saveEntityPricingInfo'; -$route['listEntityPricingInfo'] = 'Entity_Management_Controller/listEntityPricingInfo'; -//PD RELATED -$route['triggerNewPD'] = 'PD_Controller/triggerNewPD'; -$route['updatePDMaster'] = 'PD_Controller/updatePDMaster'; -$route['(listLessPDDetails/:any)'] = 'PD_Controller/listLessPDDetails/'; -$route['getListOfProducts'] = 'PD_Controller/getListOfProducts'; -$route['getListOfLenders'] = 'PD_Controller/getListOfLenders'; -$route['getListOfCustomerSegments'] = 'PD_Controller/getListOfCustomerSegments'; -$route['getListOfPDAllocationTypes'] = 'PD_Controller/getListOfPDAllocationTypes'; -$route['getListOfStatesAndCities'] = 'PD_Controller/getListOfStatesAndCities'; -$route['getListOfStatesCities'] = 'PD_Controller/getListOfStatesCities'; -$route['getFullPDDetails'] = 'PD_Controller/getFullPDDetails'; -$route['updatePDDocs'] = 'PD_Controller/updatePDDocs'; -$route['updatePDApplicants'] = 'PD_Controller/updatePDApplicants'; -$route['allocatePD'] = 'PD_Controller/allocatePD'; -$route['schdulePD'] = 'PD_Controller/schdulePD'; -$route['getListPDOfficers'] = 'PD_Controller/getListPDOfficers'; -$route['loadFullTemplate'] = 'PD_Controller/loadFullTemplate'; -$route['allbase'] = 'PD_Controller/base'; -$route['savePDQuestions'] = 'PD_Controller/saveActualPDQuestions'; -$route['getAnswersForPD'] = 'PD_Controller/getAnswersForPD'; -$route['checkOTP'] = 'PD_Controller/checkOTP'; -$route['getAssessedIncome'] = 'PD_Controller/getAssessedIncome'; -$route['saveAssessedIncomeSalesDeclaredByCustomer'] = 'PD_Controller/saveAssessedIncomeSalesDeclaredByCustomer'; -$route['saveAssessedIncomeSalesCalculatedByItemwise'] = 'PD_Controller/saveAssessedIncomeSalesCalculatedByItemwise'; -$route['saveAssessedIncomePurchaseDetails'] = 'PD_Controller/saveAssessedIncomePurchaseDetails'; -$route['saveAssessedIncomeBusinessExpenses'] = 'PD_Controller/saveAssessedIncomeBusinessExpenses'; -$route['saveAssessedIncomeHouseholdExpenses'] = 'PD_Controller/saveAssessedIncomeHouseholdExpenses'; -$route['saveAssessedIncomeMonthwiseItems'] = 'PD_Controller/saveAssessedIncomeMonthwiseItems'; -$route['saveAssessedIncomePurchaseBillwise'] = 'PD_Controller/saveAssessedIncomePurchaseBillwise'; -$route['calculateAssessedIncome'] = 'PD_Controller/calculateAssessedIncome'; -$route['saveAssessedIncomeCalculateMode'] = 'PD_Controller/saveAssessedIncomeCalculateMode'; -$route['saveOtherBusinessIncome'] = 'PD_Controller/saveOtherBusinessIncome'; -$route['savePDAdditionalRequiremets'] = 'PD_Controller/savePDAdditionalRequiremets'; -$route['generatePDReport'] = 'PD_Controller/generatePDReport'; -$route['generatePDReportPDF'] = 'PD_Controller/generatePDReportPDF'; -$route['getLatestPDReportBlob'] = 'PD_Controller/getLatestPDReportBlob'; -$route['saveNewVersionOfPDReport'] = 'PD_Controller/saveNewVersionOfPDReport'; -$route['getListOfPDReportVersions'] = 'PD_Controller/getListOfPDReportVersions'; -$route['swapOlderPDReportToLatest'] = 'PD_Controller/swapOlderPDReporttoLatest'; -$route['filterPDList'] = 'PD_Controller/filterPDList'; -$route['getQCLenderRemarks'] = 'PD_Controller/getQCLenderRemarks'; -$route['downloadExcel'] = 'PD_Controller/downloadExcel'; -$route['getEndUseOfLoan'] = 'PD_Controller/getEndUseOfLoan'; -$route['savePDOfficerCurrentLocation'] = 'PD_Controller/savePDOfficerCurrentLocation'; -$route['getPDOfficerCurrentLocation'] = 'PD_Controller/getPDOfficerCurrentLocation'; -$route['getFamilyDetails'] = 'PD_Controller/getFamilyDetailsFromBusinessAndGeneral'; -$route['getProductsFromBusiness'] = 'PD_Controller/getProductsWithTypeofActivityFromBusiness'; -$route['getAllPersonsName'] = 'PD_Controller/getAllPersonsName'; -$route['getAssetsWithLoanFromBusiness'] = 'PD_Controller/getAssetsWithLoanFromBusiness'; -$route['getListOfCities'] = 'PD_Controller/getListOfCities'; -$route['savePDPhotos'] = 'PD_Controller/savePDPhotos'; -$route['updatePDPhoto'] = 'PD_Controller/updateBase64Images'; -$route['getPDAddress'] = 'PD_Controller/getPDAddress'; -$route['updatePDAddress'] = 'PD_Controller/updatePDAddress'; -$route['getPDCompleteDetails'] = 'PD_Controller/getPDCompleteDetails'; -$route['getStateCityNamesAndPincode'] = 'PD_Controller/getStateCityNamesAndPincode'; -$route['saveHTMLReport'] = 'PD_Controller/saveHTMLReport'; -$route['(getPDReportHTML/:any)'] = 'PD_Controller/getPDReportHTML'; -$route['convertBase64'] = 'PD_Controller/convertImgUrlToBase64'; -// $route['savePDFormDetailsJSON'] = 'PD_Controller/savePDFormDetailsJSON'; -// $route['getPDFormDetailsJSON'] = 'PD_Controller/getPDFormDetailsJSON'; - -$route['smartyTestFunction'] = 'PD_Controller/smartyTestFunction'; -$route['codeigniterViewTest'] = 'PD_Controller/codeigniterViewTest'; -$route['archivePDImages'] = 'PD_Controller/archivePDImages'; -$route['pdFormsCompletenessCheck'] = 'PD_Controller/pdFormsCompletenessCheck'; - -//PD Form Related -$route['getPDFormDetails'] = 'PD_Controller/getPDFormDetailsJSON'; -$route['savePDFormDetails'] = 'PD_Controller/savePDFormDetailsJSON'; -$route['getFinalPDReportQuestions'] = 'PD_Controller/getFinalPDReportQuestions'; -$route['getTypeOfActivetyFromBusinessForm'] = 'PD_Controller/getTypeOfActivetyFromBusinessJSON'; -$route['getCompaniesListsForBusiness'] = 'PD_Controller/getCompaniesListsFromGeneralFormRawJSON'; -$route['getPDImages'] = 'PD_Controller/getPDImages'; -//$route['getTypeOfActivetyFromBusinessJSON'] = 'PD_Controller/getTypeOfActivetyFromBusinessJSON'; - -//Dashboard and Reports Related routes -//$route['getDashBoardMaster'] = 'Dash_Board_Controller/getDashBoardDetailsOfPDTypeAndPDStatusWithDayWeekMonth'; -$route['getDashBoardMaster'] = 'Dash_Board_Controller/getDashBoardDetails'; -$route['getDashBoardLenderCity'] = 'Dash_Board_Controller/getDashBoardDetailsOfLenderAndCitywise'; -$route['getDashBoardDetailsOfCity'] = 'Dash_Board_Controller/getDashBoardDetailsOfCitywise'; -$route['getDashBoardAlertDetails'] = 'Dash_Board_Controller/getDashBoardDetailsOfAlert'; -$route['PD_MIS_report'] = 'Dash_Board_Controller/PD_MIS_report'; - -$route['testCognito'] = 'Branch_Controller/testCognito'; -//$route['(getPDReportHTML/:any)'] = 'Welcome/getPDReportHTML'; - -//miscellanous -//$route['showBusinessScorecard'] = 'PD_Controller/'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 3af08f71..46d9a66c 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -5137,8 +5137,8 @@ class PD_Controller extends REST_Controller { $t = substr_replace($t,'',strpos($t,''),(strlen(''))); } - echo $t; - die(); + //echo $t; + //die(); // if (!is_dir(APPPATH.'views/pd_reports/'.$pdid)) { // $dust = mkdir(APPPATH.'views/pd_reports/'.$pdid, 0777, TRUE); @@ -6412,11 +6412,11 @@ class PD_Controller extends REST_Controller { foreach($business_assest_form['business_assets_details'] as $value) { - if($value['business_assets_mode'] == 2) + if(isset($value['business_assets_mode']) && $value['business_assets_mode'] == 2) { $property_count++; } - if($value['business_assets_mode'] == 3) + if(isset($value['business_assets_mode']) && $value['business_assets_mode'] == 3) { $vechile_count++; } @@ -6904,10 +6904,13 @@ class PD_Controller extends REST_Controller { #####Business Form Questions######## $business_form = (json_decode($form_data[13][0]['processed_json'],true)); //print_r($business_form);die(); - //print_r(!isset($business_form['factory_cert']));die(); + //print_r(($business_form['shop_eat_act_cert']));die(); $is_manufacturing_selected = 0; + $selected_type_of_activity = array(); foreach ($business_form['select_business_activity_type'] as $key => $value) { if($value['type_of_activity_id'] == 2){ $is_manufacturing_selected = 1; } + array_push($selected_type_of_activity,$value['type_of_activity_id']); + } // 13 - QNO(2.4) - all business certificate $certificate_count = 0; @@ -6924,27 +6927,80 @@ class PD_Controller extends REST_Controller { if(!$name_board_image_count){ $incomplete_details[] = 'Busienss Section - Business Name Board Image not captured'; } - - (isset($business_form['shop_eat_act_cert']) && strtoupper($business_form['shop_eat_act_cert'])=='YES' && ($business_form['shop_eat_act_cert_pic'] != "")) ? $certificate_count : (strtoupper($business_form['shop_eat_act_cert']) =='NO' || strtoupper($business_form['shop_eat_act_cert']) =='NOT APPLICABLE' ? $certificate_count : $certificate_count++); + if(isset($business_form['shop_eat_act_cert'])) + { + if(strtoupper($business_form['shop_eat_act_cert'])=='YES' && $business_form['shop_eat_act_cert_pic'] == "") + { + $certificate_count++; + } + } else { $certificate_count++; } + if(isset($business_form['gst_Regn_cert'])) + { + if(strtoupper($business_form['gst_Regn_cert'])=='YES' && $business_form['gst_Regn_cert_pic'] == "") + { + $certificate_count++; + } + } else { $certificate_count++; } + + + if(isset($business_form['pf_regn'])) + { + if(strtoupper($business_form['pf_regn'])=='YES' && $business_form['pf_regn_pic'] == "") + { + $certificate_count++; + } + } else { $certificate_count++; } + + if(isset($business_form['esic_regn'])) + { + if(strtoupper($business_form['esic_regn'])=='YES' && $business_form['esic_regn_pic'] == "") + { + $certificate_count++; + } + } else { $certificate_count++; } + + + + //If Business Type of activity is manufacturing or whole sale trading then check these two certifications, + if(in_array('2',$selected_type_of_activity) || in_array('4',$selected_type_of_activity)) + { + if(isset($business_form['factory_cert'])) + { + if(strtoupper($business_form['factory_cert'])=='YES' && $business_form['factory_cert_pic'] == "") + { + $certificate_count++; + } + } //else { $certificate_count++; } + } + //If Business Type of activity is manufacturing then check + if(in_array('2',$selected_type_of_activity)) + { + if(isset($business_form['export_import_cert'])) + { + if(strtoupper($business_form['export_import_cert'])=='YES' && $business_form['export_import_cert_pic'] == "") + { + $certificate_count++; + } + } else { $certificate_count++; } + } - (isset($business_form['gst_Regn_cert']) && strtoupper($business_form['gst_Regn_cert'])=='YES' && ($business_form['gst_Regn_cert_pic'] != "")) ? $certificate_count : (strtoupper($business_form['gst_Regn_cert']) =='NO' || strtoupper($business_form['gst_Regn_cert']) =='NOT APPLICABLE' ? $certificate_count : $certificate_count++); - - (isset($business_form['pf_regn']) && strtoupper($business_form['pf_regn'])=='YES' && ($business_form['pf_regn_pic'] != "")) ? $certificate_count : (strtoupper($business_form['pf_regn']) =='NO' || strtoupper($business_form['pf_regn']) =='NOT APPLICABLE' ? $certificate_count : $certificate_count++); - - (isset($business_form['esic_regn']) && strtoupper($business_form['esic_regn'])=='YES' && ($business_form['esic_regn_pic'] != "")) ? $certificate_count : (strtoupper($business_form['esic_regn']) =='NO' || strtoupper($business_form['esic_regn']) =='NOT APPLICABLE' ? $certificate_count : $certificate_count++); + //If Business Type of activity is service Provider then check practice_cert certification + if(in_array('5',$selected_type_of_activity)) + { + if(isset($business_form['practice_cert'])) + { + if(strtoupper($business_form['practice_cert'])=='YES' && $business_form['practice_cert_pic'] == "") + { + $certificate_count++; + } + } //else { $certificate_count++; } + //echo $certificate_count;die(); + } - (isset($business_form['export_import_cert']) && strtoupper($business_form['export_import_cert'])=='YES' && ($business_form['export_import_cert_pic'] != "")) ? $certificate_count : (strtoupper($business_form['export_import_cert']) =='NO' || strtoupper($business_form['export_import_cert']) =='NOT APPLICABLE' ? $certificate_count : $certificate_count++); - - (isset($business_form['factory_cert'])) ? ((strtoupper($business_form['factory_cert'])=='YES' && ($business_form['factory_cert_pic'] != "") ) ? $certificate_count : (strtoupper($business_form['factory_cert'])=='NO' || strtoupper($business_form['factory_cert'])=='NOT APPLICABLE') ? $certificate_count : $certificate_count++) : $certificate_count;//((($business_form['factory_cert'] != "")) && strtoupper($business_form['factory_cert']) =='NO' || strtoupper($business_form['factory_cert']) =='NOT APPLICABLE' ? $certificate_count : $certificate_count++); - - (isset($business_form['practice_cert'])) ? ((strtoupper($business_form['practice_cert'])=='YES' && ($business_form['practice_cert_pic'] != "") ) ? $certificate_count : (strtoupper($business_form['factory_cert'])=='NO' || strtoupper($business_form['practice_cert'])=='NOT APPLICABLE') ? $certificate_count : $certificate_count++) : $certificate_count; - - //(isset($business_form['practice_cert']) && strtoupper($business_form['practice_cert'])=='YES' && ($business_form['practice_cert_pic'] != "")) ? $certificate_count : ( (isset($business_form['practice_cert'])) && strtoupper($business_form['practice_cert']) =='NO' || strtoupper($business_form['practice_cert']) =='NOT APPLICABLE' ? $certificate_count : $certificate_count++); - if($certificate_count){ $incomplete_details[] = 'Business Section - Images for Document Sighted Not Sufficient'; } @@ -6968,13 +7024,13 @@ class PD_Controller extends REST_Controller { #####Business Assets Form Questions######## $business_assest_form = (json_decode($form_data[22][0]['processed_json'],true)); $businees_assest_images_count = isset($pd_images[22]) ? count($pd_images[22]) : 0; - + //print_r($business_assest_form);die(); if(array_key_exists('business_assets_details',$business_assest_form)) { foreach($business_assest_form['business_assets_details'] as $value) { - if($value['business_assets_mode'] == 4 && !($businees_assest_images_count)) + if(isset($value['business_assets_mode']) && $value['business_assets_mode'] == 4 && !($businees_assest_images_count)) { $incomplete_details[] = 'Business Assets Section - Machinery Image'; } @@ -7011,7 +7067,7 @@ class PD_Controller extends REST_Controller { $cureent_supplier_images_count = 0 ; //Images name check - $supplier_name = $manu_value['manufacturing_supplier_name'].' - Raw Material'.($manu_key+1); + $supplier_name = $manu_value['manufacturing_supplier_name'].' - Raw Material '.($manu_key+1); if(count($supplier_images)) { @@ -7079,7 +7135,7 @@ class PD_Controller extends REST_Controller { } else { - $incomplete_details[] = 'Supplier Section - Supplier (Trading Product'.($key+1).') Details not sufficient'; + $incomplete_details[] = 'Supplier Section - Supplier (Trading Product '.($key+1).') Details not sufficient'; } } @@ -7143,7 +7199,7 @@ class PD_Controller extends REST_Controller { } else { - $incomplete_details[] = 'Client Section - Client (Manufacturing Product'.($key+1).') Details not sufficient'; + $incomplete_details[] = 'Client Section - Client (Manufacturing Product '.($key+1).') Details not sufficient'; } } } @@ -7184,7 +7240,7 @@ class PD_Controller extends REST_Controller { } else { - $incomplete_details[] = 'Client Section - Client (Trading Product'.($key+1).') Details not sufficient'; + $incomplete_details[] = 'Client Section - Client (Trading Product '.($key+1).') Details not sufficient'; } } @@ -7225,7 +7281,7 @@ class PD_Controller extends REST_Controller { } else { - $incomplete_details[] = 'Client Section - Client (Service Provider'.($key+1).') Details not sufficient'; + $incomplete_details[] = 'Client Section - Client (Service Provider '.($key+1).') Details not sufficient'; } } @@ -7398,5 +7454,76 @@ class PD_Controller extends REST_Controller { + } + + + //Get Firebase Notification from fron end and update into userprofile + public function updateNotificationToken_post() + { + $records = $this->post('records'); + $fk_user_id = $records['fk_user_id']; + + $select_data = array('notification_token_id'); + $where_condition_array = array('fk_user_id' =>$fk_user_id ); + $exist_data = $this->PD_Model->selectCustomRecords($select_data,$where_condition_array,USERNOTIFICATIONTOKENS); + + if(!count($exist_data)) + { + $insert_data = array('fk_user_id' => $fk_user_id); + if($records['client'] == 'MOB') + { + $insert_data['mob_token'] = $records['token']; + } + else if($records['client'] == 'WEB') + { + $insert_data['web_token'] = $records['token']; + } + $id = $this->PD_Model->saveRecords($insert_data,USERNOTIFICATIONTOKENS); + if($id) + { + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = $id; + $this->response($data,REST_Controller::HTTP_OK); + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NOT_MODIFIED; + $data['msg'] = 'Something Went Wrong! Try Later'; + $this->response($data,REST_Controller::HTTP_OK); + } + } + else + { + $exist_notification_token_id = $exist_data[0]['notification_token_id']; + $where_condition_array = array('notification_token_id' => $exist_notification_token_id); + $update_data = array('notification_token_id' => $exist_notification_token_id); + if($records['client'] == 'MOB') + { + $update_data['mob_token'] = $records['token']; + } + else if($records['client'] == 'WEB') + { + $update_data['web_token'] = $records['token']; + } + $id = $this->PD_Model->updateRecords($update_data,USERNOTIFICATIONTOKENS,$where_condition_array); + if($id) + { + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = $id; + $this->response($data,REST_Controller::HTTP_OK); + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NOT_MODIFIED; + $data['msg'] = 'Something Went Wrong! Try Later'; + $this->response($data,REST_Controller::HTTP_OK); + } + + } + } } \ No newline at end of file diff --git a/api/application/helpers/authorization_helper.php b/api/application/helpers/authorization_helper.php index 51cf57e8..304014f3 100644 --- a/api/application/helpers/authorization_helper.php +++ b/api/application/helpers/authorization_helper.php @@ -73,7 +73,7 @@ class AUTHORIZATION set_status_header(REST_CONTROLLER::HTTP_UNAUTHORIZED,"Unauthorized"); $response['status']=false; $response['error']="Access denied!"; - log_message('error','Access denied!'); + log_message('error','Access denied!'); echo json_encode($response); exit; } diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index 24861bf9..14ea4efd 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -439,7 +439,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); PD Initiated Date ".$pd_master_details[0]['createdon'].""; echo "PD Visit Date ".$pd_master_details[0]['pd_visit_date'].""; - echo "PD Report Date ".$pd_master_details[0]['pd_report_generated_date'].""; + echo "PD Report Date ".$pd_master_details[0]['pd_report_generated_date'].""; echo "PD Initiated by ".$pd_master_details[0]['branch_name']." Branch"; echo "Loan Application ID ".$pd_master_details[0]['lender_applicant_id'].""; echo "Product ".$pd_master_details[0]['product_name'].""; @@ -787,7 +787,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo ''; - echo ''; + echo ''; echo ''; foreach($pd_score['business'] as $bsk => $business_score) @@ -3450,7 +3450,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?>
Business Related Parameters Impacting Score Response
Business Related Parameters Impacting Score Response
- '.''; } } - echo "
+
Polite
@@ -3694,7 +3694,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo '
'.$question.''.$cerificate['answer'].''.$cerificate['score_band'].''.round($cerificate['attributed_score'],3).'
'.$span.'
'.round($cerificate['max_score'],3).'
'.$max_span.'
"; + echo "
"; } // ########################### End Of Score Card Section ######################################### ?>