(self["webpackChunkLearningchain"] = self["webpackChunkLearningchain"] || []).push([["src_app_pages_newtransaction_newtransaction_module_ts"],{

/***/ 8318:
/*!***********************************************************************!*\
  !*** ./src/app/pages/newtransaction/newtransaction-routing.module.ts ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "NewtransactionPageRoutingModule": () => (/* binding */ NewtransactionPageRoutingModule)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ 1855);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 2741);
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/router */ 9535);
/* harmony import */ var _newtransaction_page__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./newtransaction.page */ 5729);




const routes = [
    {
        path: '',
        component: _newtransaction_page__WEBPACK_IMPORTED_MODULE_0__.NewtransactionPage
    }
];
let NewtransactionPageRoutingModule = class NewtransactionPageRoutingModule {
};
NewtransactionPageRoutingModule = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
    (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule)({
        imports: [_angular_router__WEBPACK_IMPORTED_MODULE_3__.RouterModule.forChild(routes)],
        exports: [_angular_router__WEBPACK_IMPORTED_MODULE_3__.RouterModule],
    })
], NewtransactionPageRoutingModule);



/***/ }),

/***/ 7682:
/*!***************************************************************!*\
  !*** ./src/app/pages/newtransaction/newtransaction.module.ts ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "NewtransactionPageModule": () => (/* binding */ NewtransactionPageModule)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ 1855);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 2741);
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ 6274);
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/forms */ 3324);
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ionic/angular */ 6820);
/* harmony import */ var _newtransaction_routing_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./newtransaction-routing.module */ 8318);
/* harmony import */ var _newtransaction_page__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./newtransaction.page */ 5729);







let NewtransactionPageModule = class NewtransactionPageModule {
};
NewtransactionPageModule = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__decorate)([
    (0,_angular_core__WEBPACK_IMPORTED_MODULE_3__.NgModule)({
        imports: [
            _angular_common__WEBPACK_IMPORTED_MODULE_4__.CommonModule,
            _angular_forms__WEBPACK_IMPORTED_MODULE_5__.FormsModule,
            _ionic_angular__WEBPACK_IMPORTED_MODULE_6__.IonicModule,
            _newtransaction_routing_module__WEBPACK_IMPORTED_MODULE_0__.NewtransactionPageRoutingModule
        ],
        declarations: [_newtransaction_page__WEBPACK_IMPORTED_MODULE_1__.NewtransactionPage]
    })
], NewtransactionPageModule);



/***/ }),

/***/ 5729:
/*!*************************************************************!*\
  !*** ./src/app/pages/newtransaction/newtransaction.page.ts ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "NewtransactionPage": () => (/* binding */ NewtransactionPage)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! tslib */ 1855);
/* harmony import */ var _raw_loader_newtransaction_page_html__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !raw-loader!./newtransaction.page.html */ 8884);
/* harmony import */ var _newtransaction_page_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./newtransaction.page.scss */ 8826);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/core */ 2741);
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ionic/angular */ 6820);
/* harmony import */ var src_app_services_api_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! src/app/services/api.service */ 3734);
/* harmony import */ var src_app_services_common_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/services/common.service */ 6880);
/* harmony import */ var src_app_services_db_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! src/app/services/db.service */ 5185);








let NewtransactionPage = class NewtransactionPage {
    constructor(modalCtrl, commonService, dbService, apiService, navParams) {
        this.modalCtrl = modalCtrl;
        this.commonService = commonService;
        this.dbService = dbService;
        this.apiService = apiService;
        this.navParams = navParams;
        this.link = '';
        this.row_data = [];
    }
    ngOnInit() {
    }
    ionViewDidEnter() {
        this.loginData = JSON.parse(localStorage.getItem("loginData"));
        this.transactionid = this.navParams.get('transactionid');
        this.studentname = this.loginData.FirstName;
    }
    closeModal() {
        return (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__awaiter)(this, void 0, void 0, function* () {
            console.log("called closeModal");
            const onClosedData = "Wrapped Up!";
            this.studentname = '';
            this.certificatename = '';
            this.issuer = '';
            this.issuedate = '';
            this.transactionid = '';
            yield this.modalCtrl.dismiss(onClosedData);
        });
    }
    submit() {
        this.getTransactionsDetails();
    }
    getTransactionsDetails() {
        let data = {
            transactionHash: this.transactionid
        };
        this.commonService.showLoader();
        this.apiService.postData('explorer/getTransactionDetails', data).subscribe((response) => {
            setTimeout(() => {
                this.commonService.dismissLoader();
            }, 1000);
            this.transactionDetails = response;
            this.link = "http://ipfs.learningchain.io/ipfs/" + this.transactionDetails.Decrypted_data;
            this.addcertificate();
        }, err => {
            this.commonService.showToast(err.message);
            setTimeout(() => {
                this.commonService.dismissLoader();
            }, 1000);
        });
    }
    addcertificate() {
        this.dbService.databaseObj.executeSql("INSERT INTO certificationlist(UserId,TransactionHash,StudentName,CertificationName,Issuer,DateofIssue,CertificateLink,WalletId) VALUES ('" + this.loginData.UserName + "','" + this.transactionid + "','" + this.studentname + "','" + this.certificatename + "','" + this.issuer + "','" + this.issuedate + "','" + this.link + "','" + this.loginData.Blockchainaddress + "') ", [])
            .then(() => {
            this.commonService.showToast('Row Inserted! with new walletid');
            this.getRows();
            this.closeModal();
        })
            .catch(e => {
            this.commonService.showErrorShowToast("Something went wrong while inserting data");
        });
    }
    // Retrieve rows from table
    getRows() {
        this.dbService.databaseObj.executeSql('SELECT * FROM certificationlist', [])
            .then((res) => {
            this.row_data = [];
            if (res.rows.length > 0) {
                for (var i = 0; i < res.rows.length; i++) {
                    this.row_data.push(res.rows.item(i));
                }
            }
        })
            .catch(e => {
            this.commonService.showErrorShowToast("Something went wrong with fetching data");
        });
    }
};
NewtransactionPage.ctorParameters = () => [
    { type: _ionic_angular__WEBPACK_IMPORTED_MODULE_6__.ModalController },
    { type: src_app_services_common_service__WEBPACK_IMPORTED_MODULE_3__.CommonService },
    { type: src_app_services_db_service__WEBPACK_IMPORTED_MODULE_4__.DbService },
    { type: src_app_services_api_service__WEBPACK_IMPORTED_MODULE_2__.ApiService },
    { type: _ionic_angular__WEBPACK_IMPORTED_MODULE_6__.NavParams }
];
NewtransactionPage = (0,tslib__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
    (0,_angular_core__WEBPACK_IMPORTED_MODULE_7__.Component)({
        selector: 'app-newtransaction',
        template: _raw_loader_newtransaction_page_html__WEBPACK_IMPORTED_MODULE_0__.default,
        styles: [_newtransaction_page_scss__WEBPACK_IMPORTED_MODULE_1__.default]
    })
], NewtransactionPage);



/***/ }),

/***/ 8826:
/*!***************************************************************!*\
  !*** ./src/app/pages/newtransaction/newtransaction.page.scss ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (".closebtn {\n  padding: 13px;\n  border: #0A0A0A;\n  font-size: 25px;\n  --color: #0A0A0A;\n}\n\n.lbl {\n  width: 100% !important;\n  max-width: 100%;\n  margin-top: 6px;\n  padding-left: 12px;\n  font-size: 16px !important;\n  font-weight: 500;\n  letter-spacing: 0.2px;\n  color: #312d2d !important;\n  text-transform: capitalize;\n}\n\n.imgicon {\n  display: inline-flex;\n}\n\n.dblck {\n  display: inline-flex;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5ld3RyYW5zYWN0aW9uLnBhZ2Uuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNvQixhQUFBO0VBQ0EsZUFBQTtFQUNBLGVBQUE7RUFDQSxnQkFBQTtBQUNwQjs7QUFFQTtFQUNvQixzQkFBQTtFQUNBLGVBQUE7RUFDQSxlQUFBO0VBQ0Esa0JBQUE7RUFDQSwwQkFBQTtFQUNBLGdCQUFBO0VBQ0EscUJBQUE7RUFDQSx5QkFBQTtFQUNBLDBCQUFBO0FBQ3BCOztBQUVBO0VBQ29CLG9CQUFBO0FBQ3BCOztBQUVBO0VBQ29CLG9CQUFBO0FBQ3BCIiwiZmlsZSI6Im5ld3RyYW5zYWN0aW9uLnBhZ2Uuc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5jbG9zZWJ0biB7XG4gICAgICAgICAgICAgICAgICAgIHBhZGRpbmcgIDogMTNweDtcbiAgICAgICAgICAgICAgICAgICAgYm9yZGVyICAgOiAjMEEwQTBBO1xuICAgICAgICAgICAgICAgICAgICBmb250LXNpemUgOiAyNXB4O1xuICAgICAgICAgICAgICAgICAgICAtLWNvbG9yICA6ICMwQTBBMEE7XG59XG5cbi5sYmwge1xuICAgICAgICAgICAgICAgICAgICB3aWR0aCAgICAgICAgIDogMTAwJSAhaW1wb3J0YW50O1xuICAgICAgICAgICAgICAgICAgICBtYXgtd2lkdGggICAgIDogMTAwJTtcbiAgICAgICAgICAgICAgICAgICAgbWFyZ2luLXRvcDo2cHg7XG4gICAgICAgICAgICAgICAgICAgIHBhZGRpbmctbGVmdCAgOiAxMnB4O1xuICAgICAgICAgICAgICAgICAgICBmb250LXNpemUgICAgIDogMTZweCAhaW1wb3J0YW50O1xuICAgICAgICAgICAgICAgICAgICBmb250LXdlaWdodCA6IDUwMDtcbiAgICAgICAgICAgICAgICAgICAgbGV0dGVyLXNwYWNpbmcgOiAwLjJweDtcbiAgICAgICAgICAgICAgICAgICAgY29sb3IgICAgICAgICA6ICMzMTJkMmQgIWltcG9ydGFudDtcbiAgICAgICAgICAgICAgICAgICAgdGV4dC10cmFuc2Zvcm0gOiBjYXBpdGFsaXplO1xufVxuXG4uaW1naWNvbiB7XG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXkgOiBpbmxpbmUtZmxleDtcbn1cblxuLmRibGNrIHtcbiAgICAgICAgICAgICAgICAgICAgZGlzcGxheSA6IGlubGluZS1mbGV4O1xufSJdfQ== */");

/***/ }),

/***/ 8884:
/*!*****************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/newtransaction/newtransaction.page.html ***!
  \*****************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("<ion-header>\n          <ion-toolbar>\n                          <ion-title>New Transaction</ion-title>\n                          <ion-buttons slot=\"end\">\n                                    <ion-button (click)=\"closeModal()\"><ion-icon name=\"close-circle-outline\" class=\"closebtn\"></ion-icon></ion-button>\n                          </ion-buttons> \n          </ion-toolbar>\n</ion-header>\n\n<ion-content>\n                  <div class=\"section3\">   \n\n                              <ion-item lines=\"none\">\n                                    <ion-label position=\"stacked\" class=\"lbl\">Name of Student</ion-label>\n                                    <ion-input type=\"text\" required class=\"inputbox\" name=\"studentname\" [(ngModel)]=\"studentname\" placeholder=\"Enter Student Name\" readonly><img src=\"../assets/images/readingbook.png\" class=\"inptimg1\"/></ion-input>\n                              </ion-item>\n\n                              <ion-item lines=\"none\">\n                                    <ion-label position=\"stacked\" class=\"lbl\">Certificate Name</ion-label>\n                                    <ion-input type=\"text\" required class=\"inputbox\" name=\"certificatename\" [(ngModel)]=\"certificatename\" placeholder=\"Enter Certificate Name\"><img src=\"../assets/images/certificatesmall.png\" class=\"inptimg1\"/></ion-input>\n                              </ion-item>\n\n                              <ion-item lines=\"none\">\n                                    <ion-label position=\"stacked\" class=\"lbl\">Issuer</ion-label>\n                                    <ion-input type=\"text\" required class=\"inputbox\" name=\"issuer\" [(ngModel)]=\"issuer\" placeholder=\"Enter Issuer\"><img src=\"../assets/images/contract.png\" class=\"inptimg1\"/></ion-input>\n                              </ion-item>\n\n                              <ion-item lines=\"none\">\n                                    <ion-label position=\"stacked\" class=\"lbl\">Date of Issue</ion-label>\n                                    <ion-datetime class=\"inputbox dblck\" displayFormat=\"DD-MMM-YYYY\"  name=\"issuedate\" [(ngModel)]=\"issuedate\" placeholder=\"Select Date of Issue\"></ion-datetime>\n                              </ion-item>\n\n                              <ion-item lines=\"none\">\n                                      <ion-label position=\"stacked\" class=\"lbl\">Transaction Id</ion-label>\n                                      <ion-input type=\"text\" readonly class=\"inputbox\" name=\"transactionid\" [(ngModel)]=\"transactionid\" placeholder=\"Enter Transaction Id\"><img src=\"../assets/images/transaction.png\" class=\"inptimg1\"/></ion-input>\n                              </ion-item>\n\n                              <ion-button type=\"submit\" class=\"btn\" (click)=\"submit()\">Submit</ion-button>\n\n                </div>\n</ion-content>\n");

/***/ })

}]);
//# sourceMappingURL=src_app_pages_newtransaction_newtransaction_module_ts.js.map