ソースを参照

phone issue fixes, DVR report add new contact fixes, commenting console.logs

Devansh Vakharia 3 日 前
コミット
7b6fad7de4

+ 61 - 59
src/app/contact/contact.component.ts

@@ -57,7 +57,7 @@ selectedCustomerFilter: string = ''; // Holds the name selected in the new filte
   dtOptions = {};
   dtTrigger: Subject<any> = new Subject();
 
-  designations = ["Executive","AM","Manager","Senior Manager","GM","AGM","PMO","DVP","AVP","VP","VP 1","VP 2","SVP","SVP 1","SVP 2","EVP","Head","CTO","CIO","CISO","CFO","President","Director","Managing Director","CEO"];
+  designations = ["Executive","AM","Manager","Senior Manager","GM","AGM","PMO","DVP","AVP","AVP 1", "AVP 2", "VP","VP 1","VP 2","SVP","SVP 1","SVP 2","EVP","Head","CTO","CIO","CISO","CFO","President","Director","Managing Director","CEO", "Left"];
   functions = ["All", "Infra","Cloud","Devops","Digital Transformation","Applications","Testing","Vendor Management","Procurement","Finance","Audit","Business Systems","Quality Assurance", "Buiness Solutions Group"];
   departments = ["IT","Procurement","Finance","Business"];
 
@@ -114,7 +114,7 @@ initComplete: function(settings: any, json: any) {
   // var skipFilterCols = [2, 3, 4, 5];
   const skipFilterCols = ['First Name', 'Last Name', 'Email ID', 'Mobile Number', 'Alternate Mobile Number'];
 
-  console.log(skipFilterCols);
+  // console.log(skipFilterCols);
 
   api.columns().every(function () {
     const column = this;
@@ -256,18 +256,18 @@ $(document).on('click', function () {
   ]
 };
 
-    console.log("in contact");
-    console.log(this.router.url);
+    // console.log("in contact");
+    // console.log(this.router.url);
     var url = this.router.url;
-    console.log("url------->", url);
+    // console.log("url------->", url);
     var myArray = url.split(":");
-    //console.log("myArray", myArray);
+    //// console.log("myArray", myArray);
     this.cont_id = myArray[2];
     var res = myArray[1];
     if (myArray.length > 1) {
       this.disabled_flag = true;
       var myArray1 = res.split("/");
-      //console.log("myArray1",myArray1[0]);
+      //// console.log("myArray1",myArray1[0]);
       let result = decodeURI(myArray1[0])
 
       // let result = myArray1[0].replace("%20", " ");
@@ -277,23 +277,23 @@ $(document).on('click', function () {
         if (response.status == 'tokenfalse') {
           this.router.navigate(['/login'])
         } else {
-          console.log("aaaaaaaaaaa", this.contactList);
+          // console.log("aaaaaaaaaaa", this.contactList);
 
           this.contactList = response.data[0].conrtactData;
-          // console.log("aaaaaaaaaaa", this.contactList);
+          // // console.log("aaaaaaaaaaa", this.contactList);
           this.dtTrigger.next(this.dtOptions)
 
 
           // this.dtTrigger.next(this.dtOptions)
 
           //this.contactList = response.data[0].conrtactData;
-          //console.log("check length",response.data[0]);
+          //// console.log("check length",response.data[0]);
           if (response.data[0].getdvrDataStatus == '1') {
             //data not found
-            console.log("in dataa not found");
+            // console.log("in dataa not found");
 
           } else {
-            console.log("in data");
+            // console.log("in data");
             // $(document).ready(function () {
             //   $("#TABLE_ID").DataTable();
             //   $(".dataTables_empty").empty();
@@ -305,7 +305,7 @@ $(document).on('click', function () {
           // this.dtTrigger.next(this.dtOptions)
         }
       });
-      //console.log("res", this.cont_name);
+      //// console.log("res", this.cont_name);
 
     }
 
@@ -316,7 +316,7 @@ $(document).on('click', function () {
 
   loadData() {
    if (this.cont_name) {
-      console.log("in if")
+      // console.log("in if")
       this.contnav_flag = true;
 
     } else {
@@ -327,7 +327,7 @@ $(document).on('click', function () {
           this.router.navigate(['/login'])
         } else {
           this.contactList = response.data[0].conrtactData;
-          console.log("aaaaaaaaaaa------------>", this.contactList);
+          // console.log("aaaaaaaaaaa------------>", this.contactList);
           // this.dtTrigger.next(this.dtOptions);
           this.rerender();
 
@@ -379,8 +379,8 @@ $(document).on('click', function () {
           ])
         ).values()
       );
-        console.log(this.cust_data);
-        console.log("yyyyyyyyyyyyyy");
+        // console.log(this.cust_data);
+        // console.log("yyyyyyyyyyyyyy");
 
       }
     });
@@ -394,7 +394,7 @@ $(document).on('click', function () {
     
 
     this.loginData.push(JSON.parse(localStorage.getItem("loginData")));
-    console.log("", this.loginData[0]["user_name"]);
+    // console.log("", this.loginData[0]["user_name"]);
     this.login_name = this.loginData[0]["user_name"];
     this.last_login_date = this.loginData[0]["last_loginDate"];
     this.login_id = this.loginData[0]["user_id"];
@@ -417,16 +417,16 @@ $(document).on('click', function () {
 
   contactData(form: FormGroup) {
 
-    console.log(this.isEditMode);
+    // console.log(this.isEditMode);
     if (this.isEditMode) {
-      console.log("EDITING");
+      // console.log("EDITING");
       return;
     }
     this.msg = "";
 
-    console.log("first name", form.value.first_name);
-    console.log("last name", form.value.last_name);
-    console.log("email_Id", form.value.email_Id);
+    // console.log("first name", form.value.first_name);
+    // console.log("last name", form.value.last_name);
+    // console.log("email_Id", form.value.email_Id);
     var email_Id = form.value.email_Id;
 
     // if (form.value.first_name !=null && form.value.email_Id != null) {
@@ -447,12 +447,14 @@ $(document).on('click', function () {
 
     if (this.cont_name) {
 
-      console.log("get from url")
-      console.log(this.cont_id);
+      // console.log("get from url")
+      // console.log(this.cont_id);
       const phoneValue = form.value.mobile_number;
       const formattedPhone = typeof phoneValue === 'object' ? phoneValue.e164Number : phoneValue;
+      // console.log(phoneValue);
       const altPhoneValue = form.value.mob_no;
-      const cleanAltMobile = typeof altPhoneValue === 'object' ? altPhoneValue.e164Number : altPhoneValue;
+      console.log(typeof altPhoneValue);
+      const cleanAltMobile = typeof altPhoneValue === 'object' ? altPhoneValue !== null ? altPhoneValue.e164Number : null : altPhoneValue;
       const contactData = {
         first_name: form.value.first_name,
         last_name: form.value.last_name,
@@ -471,7 +473,7 @@ $(document).on('click', function () {
       if (this.emailID_flag == true) {
         this.commonservice.getData(this.commonservice.projectpath + "/createContactEntry", contactData).subscribe(response => {
 
-          console.log("in create contact response=========>", response);
+          // console.log("in create contact response=========>", response);
 
           if (response.status == 'tokenfalse') {
             this.router.navigate(['/login'])
@@ -484,12 +486,12 @@ $(document).on('click', function () {
 
               if (response.data.length == 0) {
                 //warning 
-                console.log("inside if")
+                // console.log("inside if")
                 this.openPopup();
                 this.status_msg = "Warning";
                 this.error_msg = response.error;
               } else if (response.data.length > 0) {
-                console.log("inside else condition ")
+                // console.log("inside else condition ")
 
 
                 this.openPopup();
@@ -511,21 +513,21 @@ $(document).on('click', function () {
             } else {
               if (response.data.length == 0) {
                 //warning 
-                console.log("inside if")
+                // console.log("inside if")
                 this.openPopup();
                 this.status_msg = "Warning";
                 this.error_msg = response.error;
               }
               else if (response.data.length > 0) {
-                console.log("inside if(response.message== '') 99999999999")
+                // console.log("inside if(response.message== '') 99999999999")
                 if (response.data[0].createStatus == 1 && response.data[0].exception.errorid == 400) {
-                  console.log("duplicate contact");
+                  // console.log("duplicate contact");
                    this.openPopup();
                     this.status_msg = "Warning";
                     this.error_msg = response.data[0].exception.errormessage;
                 }else{
                   this.backtodvr_flag = true;
-                  console.log("response.data[0].lastinsertedData", response.data[0].lastinsertedData);
+                  // console.log("response.data[0].lastinsertedData", response.data[0].lastinsertedData);
                   localStorage.setItem('contactlastinsert', response.data[0].lastinsertedData);
                   this.openPopup();
                   this.status_msg = "Success";
@@ -554,7 +556,7 @@ $(document).on('click', function () {
 
 
     } else {
-      console.log("getting from dropdown");
+      // console.log("getting from dropdown");
       const phoneValue = form.value.mobile_number;
       const formattedPhone = typeof phoneValue === 'object' ? phoneValue.e164Number : phoneValue;
       let cleanAltMobile = null;
@@ -562,8 +564,8 @@ $(document).on('click', function () {
         const altPhoneValue = form.value.mob_no;
         cleanAltMobile = typeof altPhoneValue === 'object' ? altPhoneValue.e164Number : altPhoneValue;
       }      
-      console.log(form.value.mobile_number);
-      console.log(formattedPhone);
+      // console.log(form.value.mobile_number);
+      // console.log(formattedPhone);
       const contactData = {
         first_name: form.value.first_name,
         last_name: form.value.last_name,
@@ -577,7 +579,7 @@ $(document).on('click', function () {
         mob_no: cleanAltMobile
 
       }
-      console.log("contactData", contactData);
+      // console.log("contactData", contactData);
       // console.log("res", this.mySelect);
 
 
@@ -597,12 +599,12 @@ $(document).on('click', function () {
 
               if (response.data.length == 0) {
                 //warning 
-                console.log("inside if")
+                // console.log("inside if")
                 this.openPopup();
                 this.status_msg = "Warning";
                 this.error_msg = response.error;
               } else if (response.data.length > 0) {
-                console.log("inside if(response.message== '')6666666666 ")
+                // console.log("inside if(response.message== '')6666666666 ")
                 this.openPopup();
                 this.sucess_flag = true;
                 this.status_msg = "Success";
@@ -643,15 +645,15 @@ $(document).on('click', function () {
             } else {
               if (response.data.length == 0) {
                 //warning 
-                console.log("inside if")
+                // console.log("inside if")
                 this.openPopup();
                 this.status_msg = "Warning";
                 this.error_msg = response.error || response.data[0].exception.errormessage;
               }
               else if (response.data.length > 0) {
-                console.log("inside if(response.message== '')222222222222 ")
+                // console.log("inside if(response.message== '')222222222222 ")
                 if (response.data[0].createStatus == 1 && response.data[0].exception.errorid == 400) {
-                  console.log("duplicate contact");
+                  // console.log("duplicate contact");
                    this.openPopup();
                     this.status_msg = "Warning";
                     this.error_msg = response.data[0].exception.errormessage || response.error;
@@ -714,8 +716,8 @@ onEditButtonClick() {
 
 updateContact() {
 
-  console.log("Updating");
-  console.log(this.contactForm.value);
+  // console.log("Updating");
+  // console.log(this.contactForm.value);
 
     if (!this.selectedContactId) return;
 
@@ -725,7 +727,7 @@ updateContact() {
     updatedData.updated_by = this.login_id;
     updatedData.mobile_number = updatedData.mobile_number.e164Number;
     updatedData.mob_no = updatedData.mob_no.e164Number;
-    console.log(updatedData);
+    // console.log(updatedData);
 
     this.commonservice.updateContact(this.commonservice.projectpath + "/updateContactDetails", updatedData).subscribe(
       response => {
@@ -733,7 +735,7 @@ updateContact() {
         this.router.navigate(['/login'])
       } 
       else if (response.updateContactStatus == 0) {
-        console.log("Contact Updated");
+        // console.log("Contact Updated");
         alert("Contact updated successfully!");
         this.isEditMode = false;
         this.selectedContactId = null;
@@ -750,8 +752,8 @@ updateContact() {
   editContact(contact: any) {
     this.isEditMode = true;
     this.selectedContactId = contact.contact_id;
-    console.log(this.selectedContactId);
-    console.log(contact);
+    // console.log(this.selectedContactId);
+    // console.log(contact);
 
       // const phoneValue = contact.mobile_number;
       // const altPhoneValue = contact.mob_no;
@@ -771,7 +773,7 @@ updateContact() {
 
     const nameToSelect = contact.customer_name;
     const selected = this.cust_data.find(c => c.customer_name === nameToSelect);
-    console.log(selected);
+    // console.log(selected);
 
     if (selected) {
       this.mySelect = selected;
@@ -782,7 +784,7 @@ updateContact() {
 }
 
 deleteContact(contact_id: any) {
-  console.log(contact_id);
+  // console.log(contact_id);
   // deleteData.updated_by = this.login_id;
   // deleteData.contact_id = this.selectedContactId;
     if (confirm("Are you sure you want to delete this contact?")) {
@@ -792,7 +794,7 @@ deleteContact(contact_id: any) {
         this.router.navigate(['/login'])
       } 
       else if (response.deleteContactStatus == 0) {
-        console.log("Contact Deleted");
+        // console.log("Contact Deleted");
         alert("Contact deleted successfully!");
         this.loadData();
       }
@@ -811,7 +813,7 @@ deleteContact(contact_id: any) {
   onReset() {
   this.contactForm.reset();
   const defaultPhone = this.parsePhoneNumberAuto('');
-  console.log(defaultPhone);
+  // console.log(defaultPhone);
   this.contactForm.patchValue({
     mobile_number: defaultPhone,
     mob_no: defaultPhone
@@ -838,7 +840,7 @@ rerender(): void {
 }
 
   onBack() {
-    console.log("back dvr page");
+    // console.log("back dvr page");
     this.router.navigate(['/dvrentry'])
   }
 
@@ -950,7 +952,7 @@ rerender(): void {
 filterByCustomerName(): void {
     if (this.dtElement && this.dtElement.dtInstance) {
         this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => {
-            console.log(this.role);
+            // console.log(this.role);
             const filterValue = this.selectedCustomerFilter; 
             const customerNameColumnIndex = this.role === 'admin' ? 1 : 0; // Index 1 is 'Customer Name' based on your template
             
@@ -960,7 +962,7 @@ filterByCustomerName(): void {
                 .search(filterValue) 
                 .draw();
                 
-            console.log(`Table filtered by Customer Name: ${filterValue}`);
+            // console.log(`Table filtered by Customer Name: ${filterValue}`);
         });
     }
 }
@@ -971,13 +973,13 @@ modo(value: any) {
     
     // Check if the value is being used for other purposes (like form setup)
     if (value && value.customer_id != undefined) {
-      console.log("Customer selected for form context.");
+      // console.log("Customer selected for form context.");
     } else {
-      console.log("All customers selected for form context.");
+      // console.log("All customers selected for form context.");
     }
 
     this.mySelect = value;
-    console.log(this.mySelect);
+    // console.log(this.mySelect);
     
     // Do NOT call API, destroy table, or call dtTrigger.next() here.
     // The table data is now handled by loadData() once.
@@ -1015,7 +1017,7 @@ modo(value: any) {
 
 
   getContactName(first_name: any, last_name: any) {
-    console.log("in contact details", first_name, last_name);
+    // console.log("in contact details", first_name, last_name);
     localStorage.setItem('contactlastinsert', first_name + ' ' + last_name);
     //this.router.navigate(['/dvrentry']);
   }

+ 7 - 6
src/app/createentry/dvrentry.component.html

@@ -114,8 +114,9 @@
 
                         <select id="Axis" (change)="contactDetails(contactEntryForm)" class="form-control"
                           formControlName='contactName' style="margin-top: 0px;">
-                          <option><a href="" (click)="contactDetails(contactEntryForm)"
-                              style="cursor: pointer;color: #7f7f7f;"> Add New Contact</a></option>
+                          <!-- <option><a href="" (click)="contactDetails(contactEntryForm)"
+                              style="cursor: pointer;color: #7f7f7f;"> Add New Contact</a></option> -->
+                          <option (click)="contactDetails(contactEntryForm)" value="new">Add New Contact</option>
                           <option *ngIf="contact_name" default disabled>{{contact_name}}</option>
                           <option *ngFor="let contact of contact_data" [ngValue]="contact">
                             {{ contact.first_name }} {{ contact.last_name }}
@@ -139,8 +140,9 @@
 
                         <select id="Axis" (change)="contactDetails(contactEntryForm)" class="form-control"
                           formControlName='secondContact' style="margin-top: 0px;">
-                          <option><a href="" (click)="contactDetails(contactEntryForm)"
-                              style="cursor: pointer;color: #7f7f7f;"> Add New Contact</a></option>
+                          <!-- <option><a href="" (click)="contactDetails(contactEntryForm)"
+                              style="cursor: pointer;color: #7f7f7f;"> Add New Contact</a></option> -->
+                          <option (click)="contactDetails(contactEntryForm)" value="new">Add New Contact</option>
                           <option *ngIf="second_contact" default disabled>{{second_contact}}</option>
                           <option *ngFor="let second_contact of contact_data" [ngValue]="second_contact">
                             {{ second_contact.first_name }} {{ second_contact.last_name }}
@@ -153,8 +155,7 @@
 
                         <select id="Axis" (change)="contactDetails(contactEntryForm)" class="form-control"
                           formControlName='secondContact' style="margin-top: 0px;">
-                          <option><a href="" (click)="contactDetails(contactEntryForm)"
-                              style="cursor: pointer;color: #7f7f7f;"> Add New Contact</a></option>
+                          <option (click)="contactDetails(contactEntryForm)" value="new">Add New Contact</option>
                           <option *ngIf="second_contact" default disabled>{{second_contact}}</option>
                           <option *ngFor="let second_contact of secondContact_Details" [ngValue]="second_contact">
                             {{ second_contact.first_name }} {{ second_contact.last_name }}

+ 120 - 114
src/app/createentry/dvrentry.component.ts

@@ -81,33 +81,33 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
 
 
-    console.log("in contact");
-    console.log(this.router.url);
+    // console.log("in contact");
+    // console.log(this.router.url);
     var url = this.router.url;
-    console.log("url------->", url);
+    // console.log("url------->", url);
     var myArray = url.split(":");
-    //console.log("myArray", myArray);
+    //// console.log("myArray", myArray);
     this.cont_id = myArray[2];
     var res = myArray[1];
-    console.log("res========>", res);
+    // console.log("res========>", res);
 
     // getdvrDetailscheck
 
     if (res) {
       this.dvr_id = res;
       this.checkoperationflag = true;
-      console.log("in updation");
+      // console.log("in updation");
 
       $(document).ready(function () {
         $(".textarea").css("height", "207px");
       });
 
       this.commonservice.getAllData(this.commonservice.projectpath + "/getdvrdetails?dvrid=" + res).subscribe(response => {
-        // console.log("getdvrdetails response----------------> ", response.data);
-        // console.log("getdvrdetails response----------------> ", response.data[0].contact_name);
+        // // console.log("getdvrdetails response----------------> ", response.data);
+        // // console.log("getdvrdetails response----------------> ", response.data[0].contact_name);
 
         this.dvrupdate = response.data;
-        console.log("this.dvrupdate", this.dvrupdate);
+        // console.log("this.dvrupdate", this.dvrupdate);
         this.visit_date = response.data[0].visit_date;
         this.customer_name = response.data[0].customer_name;
         this.contact_name = response.data[0].contact_name;
@@ -122,7 +122,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
         this.deal = response.data[0].deal;
         this.postion = response.data[0].func;
         this.person = response.data[0].person;
-        console.log("functinon::::::::::::::::::", this.contact_name)
+        // console.log("functinon::::::::::::::::::", this.contact_name)
 
 
         //this.visit_date = datePipetransform(this.visit_date.now(),'dd/MM/yyyy');
@@ -132,8 +132,8 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
 
         this.visit_date = String(this.visit_date)
-        console.log(" this.visit_date", this.visit_date, this.customer_name, this.contact_name, this.stage_des);
-        console.log("in updatation");
+        // console.log(" this.visit_date", this.visit_date, this.customer_name, this.contact_name, this.stage_des);
+        // console.log("in updatation");
         this.est_Date = String(this.est_Date)
 
 
@@ -157,7 +157,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
 
         });
-        console.log("this.check_date", this.check_date);
+        // console.log("this.check_date", this.check_date);
 
         var date1 = new Date(this.check_date);
         var date2 = new Date();
@@ -168,14 +168,14 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
         // To calculate the no. of days between two dates
         var Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24);
 
-        console.log("Difference_In_Days---->", Math.round(Difference_In_Days));
+        // console.log("Difference_In_Days---->", Math.round(Difference_In_Days));
 
         if (Math.round(Difference_In_Days) <= 1) {
-          console.log("differnt in one days");
+          // console.log("differnt in one days");
           this.checkupdatedelete = true;
 
         } else {
-          console.log("difference is longer");
+          // console.log("difference is longer");
           this.checkupdatedelete = false;
           // this.FormControl['name'].disable();
 
@@ -189,11 +189,11 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
     } else {
       this.checkoperationflag = false;
-      console.log("in insert");
+      // console.log("in insert");
     }
 
     if (this.checkoperationflag == false) {
-      console.log("in insert");
+      // console.log("in insert");
       this.contactEntryForm = new FormGroup({
         date: new FormControl(null, Validators.required),
         message: new FormControl(null, Validators.required),
@@ -236,22 +236,22 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
     this.last_login_date = this.logindata[0]["last_loginDate"];
     this.login_id = this.logindata[0]["user_id"];
     this.role = this.logindata[0]["role"];
-    console.log(" this.logindata=========>", this.login_id, this.role);
+    // console.log(" this.logindata=========>", this.login_id, this.role);
 
 
 
     this.current_date = new Date();
-    // console.log(this.current_date);
-    // console.log(this.current_date - 7);
+    // // console.log(this.current_date);
+    // // console.log(this.current_date - 7);
     var dd = this.current_date.getDate();
-    // console.log(this.current_date.getDate())
-    // console.log(dd);
+    // // console.log(this.current_date.getDate())
+    // // console.log(dd);
     var mm = this.current_date.getMonth() + 1;
-    // console.log(this.current_date.getMonth());
-    // console.log(mm);
+    // // console.log(this.current_date.getMonth());
+    // // console.log(mm);
     var yyyy = this.current_date.getFullYear();
-    // console.log(dd);
-    // console.log(mm);
+    // // console.log(dd);
+    // // console.log(mm);
     if (dd < 10) {
       dd = '0' + dd
     }
@@ -259,24 +259,24 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
       mm = '0' + mm
     }
     this.current_date = yyyy + '-' + mm + '-' + dd;
-    console.log("max date------>", this.current_date);
+    // console.log("max date------>", this.current_date);
 
     document.getElementById("Date").setAttribute("max", this.current_date);
 
     //max date
     var dd1;
-    //console.log("dddddddd------->", this.current_date.getDate() - 7);
+    //// console.log("dddddddd------->", this.current_date.getDate() - 7);
 
     // var date = dd - 7;
     var date = dd;
     this.mincurrent_date = new Date();
     var min_mm = this.mincurrent_date.getMonth();
 
-    // console.log(min_mm);
+    // // console.log(min_mm);
     if (min_mm < 10) {
       min_mm = '0' + min_mm;
     }
-    console.log("date====>", date);
+    // console.log("date====>", date);
 
     // if (date < 10) {
     //   dd1 = '0' + date;
@@ -284,7 +284,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
     //   dd1 = date;
     // }
 
-    console.log(yyyy - 1);
+    // console.log(yyyy - 1);
 
     if (min_mm == "00") {
       min_mm = 11;
@@ -295,14 +295,18 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
     // this.mincurrent_date = yyyy + '-' + min_mm + '-' + dd1;
     this.mincurrent_date = yyyy + '-' + min_mm + '-' + date;
 
-    console.log(this.role);
+    // console.log(this.role);
     if (this.role == 'admin') {
       this.mincurrent_date = '2024-01-01'; // Temporary fix, min date reset
     }
 
-    console.log("min date------>", this.mincurrent_date);
+    // console.log("min date------>", this.mincurrent_date);
     document.getElementById("Date").setAttribute("min", this.mincurrent_date);
 
+    this.contactEntryForm.get('contactName')?.valueChanges.subscribe(() => {
+      this.secondContactDetails(this.contactEntryForm);
+    });
+
     this.commonservice.getAllData(this.commonservice.projectpath + "/getselectionData").subscribe(response => {
       if (response.status == 'tokenfalse') {
         this.router.navigate(['/login'])
@@ -324,9 +328,9 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
           ])
         ).values()
       );
-        console.log(this.cust_data);
-        this.contact_data = response.data[1].contactData;
-        console.log(" this.contact_data ", this.contact_data);
+        // console.log(this.cust_data);
+        // this.contact_data = response.data[1].contactData;
+        // // console.log(" this.contact_data ", this.contact_data);
         this.stage_data = response.data[2].stageData;
         this.personDetails = response.data[3].personData;
         this.funcDetails = response.data[4].funcDetails;
@@ -342,16 +346,16 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
         if (response.data[0].getdvrDataStatus == '1') {
           //data not found
-          console.log("in dataa not found");
+          // console.log("in dataa not found");
           this.checkdataflag = true
         } else {
-          console.log("in data");
+          // console.log("in data");
           //  this.checkdataflag=false;
-          console.log("response.data[0].dvrData;", response.data[0].getdvrDataStatus);
+          // console.log("response.data[0].dvrData;", response.data[0].getdvrDataStatus);
           // if(response.data[0].getdvrDataStatus == '1'){
-          //   console.log("in if condition");
+          //   // console.log("in if condition");
           // }else{
-          //   console.log("in else condition");
+          //   // console.log("in else condition");
           this.currentDateData = response.data[0].dvrData;
 
           // }
@@ -362,7 +366,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
 
       }
-      console.log("response-------->", response);
+      // console.log("response-------->", response);
     });
 
 
@@ -377,7 +381,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
 
     if (localStorage.getItem("contactlastinsert")) {
-      console.log("data is prsent for contact insert");
+      // console.log("data is prsent for contact insert");
       this.contact_name = localStorage.getItem("contactlastinsert");
       this.contactEntryForm = new FormGroup({
         date: new FormControl(this.autofillData["date"], Validators.required),
@@ -398,16 +402,16 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
 
     if (localStorage.getItem("autofilldata")) {
-      console.log("data is autofilldata");
+      // console.log("data is autofilldata");
 
-      console.log("local storage item", localStorage.getItem("autofilldata"));
-      console.log("local storage item---->", localStorage.getItem("contactlastinsert"));
+      // console.log("local storage item", localStorage.getItem("autofilldata"));
+      // console.log("local storage item---->", localStorage.getItem("contactlastinsert"));
 
       this.autofillData.push(JSON.parse(localStorage.getItem("autofilldata")));
-      console.log("this.autofillData", this.autofillData[0]);
+      // console.log("this.autofillData", this.autofillData[0]);
       this.autofillData = this.autofillData[0][0];
 
-      console.log("date", this.autofillData["custName"].customer_name);
+      // console.log("date", this.autofillData["custName"].customer_name);
       this.customer_name = this.autofillData["custName"].customer_name;
 
       if (localStorage.getItem("contactlastinsert")) {
@@ -449,14 +453,14 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
   }
 
   ngOnchanges() {
-    console.log("form.value.message", this.contactEntryForm);
+    // console.log("form.value.message", this.contactEntryForm);
     this.secondContactDetails(this.contactEntryForm)
   }
 
-  ngDoCheck() {
-    console.log("form.value.message", this.contactEntryForm);
-    this.secondContactDetails(this.contactEntryForm)
-  }
+  // ngDoCheck() {
+  //   console.log("form.value.message", this.contactEntryForm);
+  //   this.secondContactDetails(this.contactEntryForm)
+  // }
 
   openPopup() {
     this.displayStyle = "block";
@@ -478,28 +482,28 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
   dvrEntry(form: FormGroup) {
 
 
-    console.log("this.login_id", this.login_id)
+    // console.log("this.login_id", this.login_id)
 
 
     if (this.checkoperationflag == true) {
       //in updation
 
-      console.log("form.value.custName", form.value.custName.length);
+      // console.log("form.value.custName", form.value.custName.length);
       if (form.value.custName.length == undefined) {
-        console.log("change custname");
+        // console.log("change custname");
         this.customer_name = form.value.custName.customer_name;
         //((form.value.custName ? form.value.custName.customer_name : '') ? '' : this.customer_name )
       } if (form.value.contactName.length == undefined) {
-        console.log("change contactname", form.value.contactName);
+        // console.log("change contactname", form.value.contactName);
         this.contact_name = form.value.contactName.first_name + '  ' + form.value.contactName.last_name;
-        console.log("contact name", this.contact_name);
+        // console.log("contact name", this.contact_name);
       } if (form.value.stageName.length == undefined) {
-        console.log("change stage id");
+        // console.log("change stage id");
         this.stage_id = form.value.stageName.stage_id;
       } if (form.value.secondContact.length == undefined) {
-        console.log("change contactname", form.value.secondContact);
+        // console.log("change contactname", form.value.secondContact);
         this.second_contact = form.value.secondContact.first_name + '  ' + form.value.secondContact.last_name;
-        console.log("contact name", this.second_contact);
+        // console.log("contact name", this.second_contact);
       }
 
       const createdvr = {
@@ -521,7 +525,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
       }
 
-      console.log("createdvr111", createdvr);
+      // console.log("createdvr111", createdvr);
 
       this.commonservice.updateData(this.commonservice.projectpath + "/updateDvrEntry", createdvr).subscribe(response => {
         this.status_msg = "";
@@ -529,8 +533,8 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
         if (response.status == 'tokenfalse') {
           this.router.navigate(['/login'])
         } else {
-          console.log("response.error", response.error);
-          console.log("response.data", response.data[0]);
+          // console.log("response.error", response.error);
+          // console.log("response.data", response.data[0]);
 
           if (response.data.length == 0) {
             //warning 
@@ -538,12 +542,12 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
             this.status_msg = "Warning";
             this.error_msg = response.error;
           } else if (response.data.length > 0) {
-            console.log("inside if(response.message== '') ")
+            // console.log("inside if(response.message== '') ")
             this.openPopup();
             localStorage.removeItem("autofilldata")
             this.status_msg = "Success";
             this.error_msg = response.data[0].message;
-            // console.log("response.data.message", response.data[0].exception.errorid);
+            // // console.log("response.data.message", response.data[0].exception.errorid);
             // if (response.data[0].exception.errorid != '') {
             //   this.openPopup();
             //   this.status_msg = "Warning";
@@ -557,14 +561,14 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
         }
 
 
-        console.log("response-------->", response);
+        // console.log("response-------->", response);
       });
 
     } else {
       //in insert
       var createdvr;
-      console.log("this.stage_id", this.stage_id);
-      console.log("this.second_contact", this.second_contact, form.value.secondContact);
+      // console.log("this.stage_id", this.stage_id);
+      // console.log("this.second_contact", this.second_contact, form.value.secondContact);
 
       if (this.stage_id == undefined) {
 
@@ -609,9 +613,9 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
       }
 
 
-      console.log("createdvr in insert", createdvr);
-      console.log("estDate", form.value.estDate);
-      console.log("yyyyyyyy", this.customer_name, form.value.custName, this.stage_id, form.value.stageName, this.username);
+      // console.log("createdvr in insert", createdvr);
+      // console.log("estDate", form.value.estDate);
+      // console.log("yyyyyyyy", this.customer_name, form.value.custName, this.stage_id, form.value.stageName, this.username);
       this.commonservice.getData(this.commonservice.projectpath + "/createDvrEntry", createdvr).subscribe(response => {
         this.status_msg = "";
         this.error_msg = "";
@@ -619,8 +623,8 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
         if (response.status == 'tokenfalse') {
           this.router.navigate(['/login'])
         } else {
-          console.log("response.error", response.error);
-          console.log("response.data", response.data.length);
+          // console.log("response.error", response.error);
+          // console.log("response.data", response.data.length);
 
           if (response.data.length == 0) {
             //warning 
@@ -628,7 +632,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
             this.status_msg = "Warning";
             this.error_msg = response.error;
           } else if (response.data.length > 0) {
-            console.log("inside if(response.message== '') ");
+            // console.log("inside if(response.message== '') ");
             localStorage.removeItem("contactlastinsert")
 
             this.openPopup();
@@ -662,7 +666,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
 
             });
-            // console.log("response.data.message", response.data[0].exception.errorid);
+            // // console.log("response.data.message", response.data[0].exception.errorid);
             if (response.data[0].exception.errorid != '') {
               this.openPopup();
               this.status_msg = "Warning";
@@ -676,7 +680,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
         }
 
 
-        console.log("response-------->", response);
+        // console.log("response-------->", response);
       });
 
     }
@@ -686,14 +690,14 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
 
 
-    console.log(" this.logindata=========>", this.login_id, this.role);
+    // console.log(" this.logindata=========>", this.login_id, this.role);
 
     this.commonservice.getAllData(this.commonservice.projectpath + "/getlastestdvr?role=" + this.role + "&login_id=" + this.login_id).subscribe(response => {
 
       if (response.status == 'tokenfalse') {
         this.router.navigate(['/login'])
       } else {
-        // console.log("response-------->", response);
+        // // console.log("response-------->", response);
 
         this.currentDateData = response.data[0].dvrData;
 
@@ -708,7 +712,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
 
   addUser() {
-    console.log("addUser button click");
+    // console.log("addUser button click");
 
     this.customer_name = "";
     this.contact_name = "";
@@ -741,12 +745,14 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
   contactDetails(form: FormGroup) {
 
 
-    console.log("form value", form.value);
+    // console.log("form value", form.value);
 
-    if (form.value.contactName == "Add New Contact") {
+    // if (form.value.contactName == "Add New Contact") {
+
+    if (form.value.contactName === 'new') {
 
       if (form.value.custName == null) {
-        console.log("value not entered");
+        // console.log("value not entered");
         //user not entered customer details
         this.router.navigate(['/contactDetails'])
         localStorage.removeItem('autofilldata');
@@ -755,24 +761,24 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
         this.router.navigate(["/contactDetails/contact:" + this.customer_name + "/id:" + this.cust_id]);
       }
       else {
-        console.log("value entered");
+        // console.log("value entered");
         this.cust_name = form.value.custName.customer_name;
         this.cust_id = form.value.custName.customer_id
         this.saveautoData.push(form.value);
-        console.log("this.saveautoData", this.saveautoData)
+        // console.log("this.saveautoData", this.saveautoData)
         localStorage.setItem('autofilldata', JSON.stringify(this.saveautoData));
         //user entered customer details
         this.router.navigate(["/contactDetails/contact:" + this.cust_name + "/id:" + this.cust_id]);
       }
     } else {
-      console.log('other options selected');
+      // console.log('other options selected');
 
     }
 
-    if (form.value.secondContact == "Add New Contact") {
+    if (form.value.secondContact == 'new') {
 
       if (form.value.custName == null) {
-        console.log("value not entered");
+        // console.log("value not entered");
         //user not entered customer details
         this.router.navigate(['/contactDetails'])
         localStorage.removeItem('autofilldata');
@@ -781,17 +787,17 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
         this.router.navigate(["/contactDetails/contact:" + this.customer_name + "/id:" + this.cust_id]);
       }
       else {
-        console.log("value entered");
+        // console.log("value entered");
         this.cust_name = form.value.custName.customer_name;
         this.cust_id = form.value.custName.customer_id
         this.saveautoData.push(form.value);
-        console.log("this.saveautoData", this.saveautoData)
+        // console.log("this.saveautoData", this.saveautoData)
         localStorage.setItem('autofilldata', JSON.stringify(this.saveautoData));
         //user entered customer details
         this.router.navigate(["/contactDetails/contact:" + this.cust_name + "/id:" + this.cust_id]);
       }
     } else {
-      console.log('other options selected');
+      // console.log('other options selected');
 
     }
 
@@ -799,21 +805,21 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
   }
 
   customerDetails(form: FormGroup) {
-    console.log("form value", form.value.custName.customer_name);
+    // console.log("form value", form.value.custName.customer_name);
     if (form.value.custName) {
       this.commonservice.getAllData(this.commonservice.projectpath + "/getcustcontactdetails?customer_id=" + form.value.custName.customer_name).subscribe(response => {
         if (response.status == 'tokenfalse') {
           this.router.navigate(['/login'])
         } else {
           this.contact_data = response.data[0].conrtactData;
-          console.log("aaaaaaaaaaa------------>", this.contact_data);
+          // console.log("aaaaaaaaaaa------------>", this.contact_data);
           // this.dtTrigger.next(this.dtOptions)
 
         }
       });
 
     } else {
-      console.log("customer not selected yet");
+      // console.log("customer not selected yet");
     }
 
   }
@@ -823,7 +829,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
   }
 
   isFieldValid(field: string) {
-    // console.log("in field", field)
+    // // console.log("in field", field)
     return !this.contactEntryForm.get(field).valid && this.contactEntryForm.get(field).touched;
   }
   displayFieldCss(field: string) {
@@ -865,7 +871,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
 
   deleteEntry() {
-    console.log("delete entry");
+    // console.log("delete entry");
 
 
     const dvrEntryData = {
@@ -873,30 +879,30 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
       created_by: this.login_id
     }
 
-    console.log("dvrEntryData ", dvrEntryData);
+    // console.log("dvrEntryData ", dvrEntryData);
 
     this.commonservice.getData(this.commonservice.projectpath + "/deletedvrEntry", dvrEntryData).subscribe(response => {
 
-      console.log("response", response);
+      // console.log("response", response);
 
       if (response.status == 'tokenfalse') {
         this.router.navigate(['/login'])
       } else {
-        console.log("response", response);
+        // console.log("response", response);
 
         if (response.data.length < 1) {
           //warning 
-          console.log("in warning")
+          // console.log("in warning")
           this.openPopup();
           this.status_msg = "Warning";
           this.error_msg = response.error;
         } else if (response.data.length > 0) {
-          console.log("inside if(response.message== '') ");
-          console.log("message", response.data[0].message);
+          // console.log("inside if(response.message== '') ");
+          // console.log("message", response.data[0].message);
           this.openPopup();
           this.status_msg = "Success";
           this.error_msg = response.data[0].message;
-          console.log("this.error_msg", this.error_msg);
+          // console.log("this.error_msg", this.error_msg);
           this.entry_successflag = true;
           this.customer_name = "";
           this.contact_name = "";
@@ -926,7 +932,7 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
 
           });
           //this.router.navigate(['/home'])
-          // console.log("response.data.message", response.data[0].exception.errorid);
+          // // console.log("response.data.message", response.data[0].exception.errorid);
 
         }
         else {
@@ -942,11 +948,11 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
   secondContactDetails(form: FormGroup) {
     // console.log("form value", form.value);
     if (form.value.contactName != null) {
-      console.log("first contact is present")
-      console.log("email", form.value.contactName.email_id)
+      // console.log("first contact is present")
+      // console.log("email", form.value.contactName.email_id)
       if (form.value.contactName.email_id != null) {
         this.secondContact_Details = this.contact_data.filter((item: { email_id: any; }) => item.email_id != form.value.contactName.email_id)
-        console.log("contact dataqqqqqqqqqqqqqqqqqqq", this.contact_data)
+        // console.log("contact dataqqqqqqqqqqqqqqqqqqq", this.contact_data)
         this.currentSecondContact = true;
 
       } else {
@@ -954,28 +960,28 @@ export class DvrEntryComponent implements OnInit, OnDestroy {
       }
 
     } else {
-      console.log("first contact is not present")
+      // console.log("first contact is not present")
     }
 
 
   }
 
   funcPersonDetails(form: FormGroup) {
-    console.log("form value", form.value);
+    // console.log("form value", form.value);
     if (form.value.postion != null) {
-      console.log("postion", form.value.postion)
+      // console.log("postion", form.value.postion)
       this.commonservice.getAllData(this.commonservice.projectpath + "/mappingFuncIDToPersonNames?func_id=" + form.value.postion.func_id).subscribe(response => {
         if (response.status == 'tokenfalse') {
           this.router.navigate(['/login'])
         } else {
-          console.log("response:::::::::::::::::::::::::::::::::::::::::::::::::", response.data)
+          // console.log("response:::::::::::::::::::::::::::::::::::::::::::::::::", response.data)
           this.personDetails = response.data;
-          console.log("personDetails------------>", this.personDetails);
+          // console.log("personDetails------------>", this.personDetails);
         }
       });
 
     } else {
-      console.log(" func_id is not present")
+      // console.log(" func_id is not present")
     }
 
 

+ 39 - 39
src/app/customer/customer.component.ts

@@ -237,7 +237,7 @@ $(document).on('click', function () {
 
 
     this.loginData.push(JSON.parse(localStorage.getItem("loginData")));
-    console.log("", this.loginData[0]["user_name"]);
+    // console.log("", this.loginData[0]["user_name"]);
     this.login_name = this.loginData[0]["user_name"];
     this.last_login_date = this.loginData[0]["last_loginDate"];
     this.login_id = this.loginData[0]["user_id"];
@@ -248,9 +248,9 @@ $(document).on('click', function () {
         this.router.navigate(['/login'])
       } else {
         this.cust_data = response.data[0].customerData;
-        // console.log(this.cust_data);
+        // // console.log(this.cust_data);
         this.dtTrigger.next(this.dtOptions);
-        console.log("yyyyyyyyyyyyyy");
+        // console.log("yyyyyyyyyyyyyy");
 
       }
     });
@@ -262,8 +262,8 @@ $(document).on('click', function () {
       }
       else {
 
-        console.log("response of sale person list", response);
-        console.log("response========================>", response.data[0]);
+        // console.log("response of sale person list", response);
+        // console.log("response========================>", response.data[0]);
 
         this.salePersonlist.push(response.data[0].salePerson);
 
@@ -271,8 +271,8 @@ $(document).on('click', function () {
           this.datalist.push(this.salePersonlist[i])
         }
 
-        console.log("salePersonlist---------->", this.salePersonlist)
-        console.log("this.salePersonlist", this.datalist);
+        // console.log("salePersonlist---------->", this.salePersonlist)
+        // console.log("this.salePersonlist", this.datalist);
       }
     });
   }
@@ -288,16 +288,16 @@ $(document).on('click', function () {
       action: 'insert'
     }
 
-    console.log("customerData", customerData);
+    // console.log("customerData", customerData);
 
     this.commonservice.getData(this.commonservice.projectpath + "/createUpdateCustomerentry", customerData).subscribe(response => {
 
-      console.log("response", response);
+      // console.log("response", response);
 
       if (response.status == 'tokenfalse') {
         this.router.navigate(['/login'])
       } else {
-        console.log("response", response);
+        // console.log("response", response);
         // this.msg = response["message"];
         if (response.status == false) {
           //error occured
@@ -327,7 +327,7 @@ $(document).on('click', function () {
 
 
 
-        // console.log("inside if")
+        // // console.log("inside if")
         //     this.openPopup();
         //     this.status_msg = "Warning";
         //     this.error_msg = response.error;
@@ -339,7 +339,7 @@ $(document).on('click', function () {
         //     this.error_msg = response.data[0].message;
         //     this.checkfirstnm_flag = true;
 
-        //     console.log("response.data.message", response.data[0].message);
+        //     // console.log("response.data.message", response.data[0].message);
         //     if (response.data[0].exception.errorid != '') {
         //       this.openPopup();
         //       this.status_msg = "Warning";
@@ -353,13 +353,13 @@ $(document).on('click', function () {
         // } else {
         //   if (response.data.length == 0) {
 
-        //     //console.log("inside if")
+        //     //// console.log("inside if")
         //     this.openPopup();
         //     this.status_msg = "Warning";
         //     this.error_msg = response.error;
         //   }
         //   else if (response.data.length > 0) {
-        //     //console.log("inside if(response.message== '')222222222222 ")
+        //     //// console.log("inside if(response.message== '')222222222222 ")
         //     this.openPopup();
         //     this.status_msg = "Success";
         //     this.error_msg = response.data[0].message;
@@ -394,7 +394,7 @@ $(document).on('click', function () {
 
 
   onBack() {
-    console.log("back dvr page");
+    // console.log("back dvr page");
     this.router.navigate(['/dvrentry'])
   }
 
@@ -402,7 +402,7 @@ $(document).on('click', function () {
     // this.form.reset();
   }
   isFieldValid(field: string) {
-    // console.log("in field", field)
+    // // console.log("in field", field)
     return !this.customerForm.get(field).valid && this.customerForm.get(field).touched;
   }
   displayFieldCss(field: string) {
@@ -421,7 +421,7 @@ $(document).on('click', function () {
 
   onAddButtonClick() {
     if (this.isAddMode) {
-      console.log("Adding");
+      // console.log("Adding");
       this.showAddBox = true;
 
         // this.addCustomerMappingLogic();
@@ -445,15 +445,15 @@ addTask(customerId: string, userId: string) {
     created_by: this.login_id
   };
 
-  console.log('Mapping Payload:', payload);
+  // console.log('Mapping Payload:', payload);
   this.commonservice.getData(this.commonservice.projectpath + "/addCustomerUserMapping", payload).subscribe(response => {
 
-      console.log("response", response);
+      // console.log("response", response);
 
       if (response.status == 'tokenfalse') {
         this.router.navigate(['/login'])
       } else {
-        console.log("response", response);
+        // console.log("response", response);
         // this.msg = response["message"];
         if (response.status == false) {
           //error occured
@@ -481,9 +481,9 @@ addTask(customerId: string, userId: string) {
 }
 
   editCustomerLogic() {
-    console.log("Editing");
-    console.log(this.customerForm.value);
-    console.log(this.old_sales_person_id);
+    // console.log("Editing");
+    // console.log(this.customerForm.value);
+    // console.log(this.old_sales_person_id);
     const customerData = {
       customer_id: this.selectedCustomerId,
       customer_name: this.customerForm.value.customer_name,
@@ -492,15 +492,15 @@ addTask(customerId: string, userId: string) {
       updated_by: this.login_id,
       old_sale_person: this.old_sales_person_id
     }
-    console.log(customerData);
+    // console.log(customerData);
     this.commonservice.updateData(this.commonservice.projectpath + "/updateCustomerDetails", customerData).subscribe(response => {
 
-      console.log("response", response);
+      // console.log("response", response);
 
       if (response.status == 'tokenfalse') {
         this.router.navigate(['/login'])
       } else {
-        console.log("response", response);
+        // console.log("response", response);
         // this.msg = response["message"];
         if (response.status == false) {
           //error occured
@@ -539,10 +539,10 @@ addTask(customerId: string, userId: string) {
   old_sales_person_id: any;
 
   editCustomer(current: any) {
-    console.log(current);
+    // // console.log(current);
     this.isEditMode = true;
     this.selectedCustomerId = current.customer_id;
-    console.log(this.selectedCustomerId);
+    // // console.log(this.selectedCustomerId);
 
     this.customerForm.patchValue({
         customer_id: current.customer_id,
@@ -560,7 +560,7 @@ addTask(customerId: string, userId: string) {
   }
 
   deleteCustomer(i: any) {
-    console.log("Deleting" + i)
+    // // console.log("Deleting" + i)
   }
 
   openPopup() {
@@ -586,17 +586,17 @@ addTask(customerId: string, userId: string) {
 
 
   modo(value: any) {
-    console.log("data---->", value);
-    console.log("customer_id", value.customer_id);
+    // console.log("data---->", value);
+    // console.log("customer_id", value.customer_id);
 
     var id;
     if (value.customer_id != undefined) {
-      console.log("specific customer contact");
+      // console.log("specific customer contact");
       id = parseInt(value.customer_id);
-      console.log("parseInt", typeof (id));
+      // console.log("parseInt", typeof (id));
 
     } else {
-      console.log("in all customer data");
+      // console.log("in all customer data");
       id = value;
     }
 
@@ -609,11 +609,11 @@ addTask(customerId: string, userId: string) {
 
         // this.dtTrigger.next(this.dtOptions)
 
-        //console.log("check length",response.data[0]);
+        //// console.log("check length",response.data[0]);
         if (response.data[0].getdvrDataStatus == '1') {
           //data not found
           this.contactList = [];
-          console.log("in dataa not found");
+          // console.log("in dataa not found");
           $(document).ready(function () {
             $('.odd').show();
 
@@ -621,7 +621,7 @@ addTask(customerId: string, userId: string) {
 
 
         } else {
-          console.log("in data");
+          // console.log("in data");
           this.contactList = response.data[0].conrtactData;
           // document.getElementById("myH1").style.display = "none";
 
@@ -635,14 +635,14 @@ addTask(customerId: string, userId: string) {
         }
 
         // this.dtTrigger.next(this.dtOptions)
-        console.log("aaaaaaaaaaa", this.contactList);
+        // console.log("aaaaaaaaaaa", this.contactList);
       }
     });
   }
 
 
   getContactName(first_name: any, last_name: any) {
-    console.log("in contact details", first_name, last_name);
+    // console.log("in contact details", first_name, last_name);
     localStorage.setItem('contactlastinsert', first_name + ' ' + last_name);
     //this.router.navigate(['/dvrentry']);
   }

+ 105 - 105
src/app/home/home.component.ts

@@ -55,7 +55,7 @@ export class HomeComponent implements OnInit {
 
   constructor(private commonservice: CommonFunctionService, private router: Router) {
 
-    console.log("in home");
+    // console.log("in home");
   }
 
 
@@ -80,7 +80,7 @@ export class HomeComponent implements OnInit {
     // document.getElementById("startDate").setAttribute("max", this.current_date);
     // document.getElementById("endDate").setAttribute("max", this.current_date);
 
-    //console.log("auth =====>",this.auth.isAuthenticated());
+    //// console.log("auth =====>",this.auth.isAuthenticated());
     // if(this.auth.isAuthenticated){
 
     // }
@@ -139,8 +139,8 @@ export class HomeComponent implements OnInit {
       }
       else {
 
-        console.log("response of sale person list", response);
-        console.log("response========================>", response.data[0]);
+        // console.log("response of sale person list", response);
+        // console.log("response========================>", response.data[0]);
 
         this.salePersonlist.push(response.data[0].salePerson);
         // this.datalist.push(this.salePersonlist[0]); 
@@ -148,8 +148,8 @@ export class HomeComponent implements OnInit {
           this.datalist.push(this.salePersonlist[i])
         }
 
-        console.log("salePersonlist---------->", this.salePersonlist)
-        console.log("this.salePersonlist", this.datalist);
+        // console.log("salePersonlist---------->", this.salePersonlist)
+        // console.log("this.salePersonlist", this.datalist);
       }
     });
 
@@ -158,10 +158,10 @@ export class HomeComponent implements OnInit {
     this.last_login_date = this.logindata[0]["last_loginDate"];
     this.user_id = this.logindata[0]["user_id"];
     this.role_check = this.logindata[0]["role"]
-    console.log(" this.logindata", this.logindata);
-    console.log("role_check=====>", this.role_check);
+    // console.log(" this.logindata", this.logindata);
+    // console.log("role_check=====>", this.role_check);
     if (this.role_check == 'admin') {
-      console.log("admin use dashboard")
+      // console.log("admin use dashboard")
       this.check_role = true
     }
 
@@ -187,29 +187,29 @@ export class HomeComponent implements OnInit {
           ])
         ).values()
       );
-        console.log(this.cust_data);
+        // console.log(this.cust_data);
       }
     });
 
     this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?login_id=" + this.user_id).subscribe(response => {
 
 
-      // console.log("status",response.status)
+      // // console.log("status",response.status)
       if (response.status == 'tokenfalse') {
-        console.log("uuuuuuuuuuuuuuuuu")
+        // console.log("uuuuuuuuuuuuuuuuu")
         this.router.navigate(['/login'])
       } else {
-        console.log("uuuuuuuuuuuuu");
-        console.log("respose", response);
-        //   console.log("uuuuuuuuuuu",response.data[0]);
-        console.log("uuuuuuuuuuu", response.data[0].getdvrDataStatus);
+        // console.log("uuuuuuuuuuuuu");
+        // console.log("respose", response);
+        //   // console.log("uuuuuuuuuuu",response.data[0]);
+        // console.log("uuuuuuuuuuu", response.data[0].getdvrDataStatus);
 
         if (response.data[0].getdvrDataStatus == '0') {
 
-          //  console.log("iiiiiiiiiiiiiiiii",response);
+          //  // console.log("iiiiiiiiiiiiiiiii",response);
 
           this.countData = response.data[0]["countdata"];
-          //  console.log("this.countData",this.countData);
+          //  // console.log("this.countData",this.countData);
           this.dvrList = response.data[0]["dvrlist"];
           this.conformlist = this.dvrList;
           this.no_of_visit = this.countData[0].no_of_visit;
@@ -217,7 +217,7 @@ export class HomeComponent implements OnInit {
           this.incom_entry = this.countData[0].no_of_incompleted;
           this.no_contact = this.countData[0].no_of_contact;
 
-          console.log(" this.dvrList", this.dvrList);
+          // console.log(" this.dvrList", this.dvrList);
 
 
         } else {
@@ -279,9 +279,9 @@ export class HomeComponent implements OnInit {
 
     this.dvrList = [];
 
-    console.log("searchfilter", searchfilter);
+    // console.log("searchfilter", searchfilter);
 
-    console.log("dvrlist", this.dvrList);
+    // console.log("dvrlist", this.dvrList);
     this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=" + searchfilter + "&login_id=" + this.user_id).subscribe(response => {
 
       if (response.status == 'tokenfalse') {
@@ -295,14 +295,14 @@ export class HomeComponent implements OnInit {
           // this.countData = response["countdata"];
           // this.dvrList = response["dvrlist"];
 
-          // console.log(" this.dvrList", this.dvrList);
+          // // console.log(" this.dvrList", this.dvrList);
           // this.no_of_visit = this.countData[0].no_of_visit;
           // this.com_entry = this.countData[0].no_of_completed;
           // this.incom_entry = this.countData[0].no_of_incompleted;
           // this.no_contact = this.countData[0].no_of_contact;
 
           this.countData = response.data[0]["countdata"];
-          //  console.log("this.countData",this.countData);
+          //  // console.log("this.countData",this.countData);
           this.dvrList = response.data[0]["dvrlist"];
 
           this.no_of_visit = this.countData[0].no_of_visit;
@@ -332,53 +332,53 @@ export class HomeComponent implements OnInit {
 
   onSearch() {
 
-    console.log("00000000000", this.sale_person);
+    // console.log("00000000000", this.sale_person);
 
     // if(this.customer == undefined){
-    // console.log("first one")
+    // // console.log("first one")
 
     // }else if(this.customer == 'undefined'){
-    //   console.log("second one")
+    //   // console.log("second one")
 
     // }else{
-    //   console.log("third one");
+    //   // console.log("third one");
     // }
 
-    console.log("customer", this.customer);
-    console.log("start date,", this.startDate);
-    console.log("start date,", this.endDate);
+    // console.log("customer", this.customer);
+    // console.log("start date,", this.startDate);
+    // console.log("start date,", this.endDate);
 
-    //  console.log("customer name",this.customer.customer_name);
+    //  // console.log("customer name",this.customer.customer_name);
 
     var searchfilter, result, result1;
 
     this.dvrList = [];
     if (this.startDate != undefined) {
       result = this.startDate.replace("-", "/");
-      console.log("result", result);
+      // console.log("result", result);
       result = result.replace("-", "/");
-      console.log("result1", result);
+      // console.log("result1", result);
     }
     if (this.endDate != undefined) {
       result1 = this.endDate.replace("-", "/");
-      console.log("result--->", result1);
+      // console.log("result--->", result1);
       result1 = result1.replace("-", "/");
-      console.log("result1-->", result1);
+      // console.log("result1-->", result1);
     }
 
-    console.log("endDate date--->", searchfilter);
+    // console.log("endDate date--->", searchfilter);
 
     if (this.endDate == "" && this.startDate != "") {
       //need show pop-up
       //try to enter date
-      console.log('in date filters for 1');
+      // console.log('in date filters for 1');
       this.openPopup();
       this.status_msg = "Warning";
       this.error_msg = "Please enter Dates correctly.";
       this.dvrList = this.conformlist;
     } else if (this.endDate != "" && this.startDate == "") {
       // need to show pop-up
-      console.log('in date filters for 2');
+      // console.log('in date filters for 2');
       this.openPopup();
       this.status_msg = "Warning";
       this.error_msg = "Please enter Dates correctly.";
@@ -390,9 +390,9 @@ export class HomeComponent implements OnInit {
       this.error_msg = "";
       searchfilter = result + "-" + result1;
 
-      console.log("this.sale_person", this.sale_person, "this.customer", this.customer, "searchfilter", searchfilter)
+      // console.log("this.sale_person", this.sale_person, "this.customer", this.customer, "searchfilter", searchfilter)
       if (this.sale_person != undefined && this.customer == undefined && this.startDate == "" && this.endDate == "" && this.sale_person != 'undefined') {
-        console.log("only sales person");
+        // console.log("only sales person");
         this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=undefineddate&login_id=" + this.user_id + "&salePerson=" + this.sale_person).subscribe(response => {
           if (response.status == 'tokenfalse') {
             this.router.navigate(['/login'])
@@ -403,19 +403,19 @@ export class HomeComponent implements OnInit {
               this.countData = response.data[0]["countdata"];
               this.dvrList = response.data[0]["dvrlist"];
               this.rerender();
-              console.log(" this.dvrList", this.dvrList);
+              // console.log(" this.dvrList", this.dvrList);
               this.no_of_visit = this.countData[0].no_of_visit;
               this.com_entry = this.countData[0].no_of_completed;
               this.incom_entry = this.countData[0].no_of_incompleted;
               this.no_contact = this.countData[0].no_of_contact;
 
             } else {
-              console.log("in else part");
+              // console.log("in else part");
 
               this.dvrList = [];
 
               this.rerender();
-              console.log(" this.dvrList", this.dvrList);
+              // console.log(" this.dvrList", this.dvrList);
 
 
               $(document).ready(function () {
@@ -435,19 +435,19 @@ export class HomeComponent implements OnInit {
         });
       }
       else if (this.sale_person == undefined && this.customer != undefined && this.endDate == "" && this.startDate == "" && this.sale_person != 'undefined' && this.customer != 'undefined') {
-        console.log("only customer")
+        // console.log("only customer")
         this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=undefineddate&login_id=" + this.user_id + "&customer=" + this.customer.customer_name + "&customerid=" + this.customer.customer_id).subscribe(response => {
           if (response.status == 'tokenfalse') {
             this.router.navigate(['/login'])
           } else {
             if (response.data[0].getdvrDataStatus == '0') {
-              console.log("response", response);
+              // console.log("response", response);
               //  this.countData = response["countdata"];
               // this.dvrList = response["dvrlist"];
               this.countData = response.data[0]["countdata"];
               this.dvrList = response.data[0]["dvrlist"];
               this.rerender();
-              console.log(" this.dvrList", this.dvrList);
+              // console.log(" this.dvrList", this.dvrList);
               this.no_of_visit = this.countData[0].no_of_visit;
               this.com_entry = this.countData[0].no_of_completed;
               this.incom_entry = this.countData[0].no_of_incompleted;
@@ -458,7 +458,7 @@ export class HomeComponent implements OnInit {
               this.dvrList = [];
 
               this.rerender();
-              console.log(" this.dvrList", this.dvrList);
+              // console.log(" this.dvrList", this.dvrList);
 
 
               $(document).ready(function () {
@@ -477,7 +477,7 @@ export class HomeComponent implements OnInit {
 
         });
       } else if (this.sale_person != undefined && this.customer != undefined && this.endDate == "" && this.startDate == "" && this.sale_person != 'undefined') {
-        console.log("for sales person and customer");
+        // console.log("for sales person and customer");
         this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=undefineddate&login_id=" + this.user_id + "&customer=" + this.customer.customer_name + "&salePerson=" + this.sale_person + "&customerid=" + this.customer.customer_id).subscribe(response => {
           if (response.status == 'tokenfalse') {
             this.router.navigate(['/login'])
@@ -488,7 +488,7 @@ export class HomeComponent implements OnInit {
               this.countData = response.data[0]["countdata"];
               this.dvrList = response.data[0]["dvrlist"];
               this.rerender();
-              console.log(" this.dvrList", this.dvrList);
+              // console.log(" this.dvrList", this.dvrList);
               this.no_of_visit = this.countData[0].no_of_visit;
               this.com_entry = this.countData[0].no_of_completed;
               this.incom_entry = this.countData[0].no_of_incompleted;
@@ -514,19 +514,19 @@ export class HomeComponent implements OnInit {
         this.onClear()
 
       } else if (this.customer == 'undefined' && this.sale_person == undefined) {
-        console.log("in else condition for customer");
+        // console.log("in else condition for customer");
         this.onClear()
 
       } else if (this.sale_person != undefined && this.customer == undefined && this.startDate != "" && this.endDate != "" && this.sale_person != 'undefined') {
-        console.log("for date and sales_person")
+        // console.log("for date and sales_person")
         this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=" + searchfilter + "&login_id=" + this.user_id + "&salePerson=" + this.sale_person).subscribe(response => {
           if (response.status == 'tokenfalse') {
             this.router.navigate(['/login'])
           } else {
 
-            console.log("in searchfilterd");
+            // console.log("in searchfilterd");
             if (response.data[0].getdvrDataStatus == '0') {
-              console.log(" this.dvrList", this.dvrList);
+              // console.log(" this.dvrList", this.dvrList);
 
 
               this.countData = response.data[0]["countdata"];
@@ -544,7 +544,7 @@ export class HomeComponent implements OnInit {
               this.dvrList = [];
 
               this.rerender();
-              console.log(" this.dvrList", this.dvrList);
+              // console.log(" this.dvrList", this.dvrList);
 
 
               $(document).ready(function () {
@@ -563,15 +563,15 @@ export class HomeComponent implements OnInit {
         });
 
       } else if (this.sale_person == undefined && this.customer != undefined && this.endDate != "" && this.startDate != "" && this.sale_person != 'undefined' && this.customer != 'undefined') {
-        console.log("for date and customer");
+        // console.log("for date and customer");
         this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=" + searchfilter + "&login_id=" + this.user_id + "&customer=" + this.customer.customer_name + "&customerid=" + this.customer.customer_id).subscribe(response => {
           if (response.status == 'tokenfalse') {
             this.router.navigate(['/login'])
           } else {
 
-            console.log("in searchfilterd");
+            // console.log("in searchfilterd");
             if (response.data[0].getdvrDataStatus == '0') {
-              console.log(" this.dvrList", this.dvrList);
+              // console.log(" this.dvrList", this.dvrList);
 
 
               this.countData = response.data[0]["countdata"];
@@ -589,7 +589,7 @@ export class HomeComponent implements OnInit {
               this.dvrList = [];
 
               this.rerender();
-              console.log(" this.dvrList", this.dvrList);
+              // console.log(" this.dvrList", this.dvrList);
 
 
               $(document).ready(function () {
@@ -608,14 +608,14 @@ export class HomeComponent implements OnInit {
         });
 
       } else if (this.sale_person != undefined && this.customer != undefined && this.startDate != undefined && this.endDate != undefined) {
-        console.log("all filters date,customer and sales_person");
+        // console.log("all filters date,customer and sales_person");
         this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=" + searchfilter + "&login_id=" + this.user_id + "&salePerson=" + this.sale_person + "&customer=" + this.customer.customer_name + "&customerid=" + this.customer.customer_id).subscribe(response => {
           if (response.status == 'tokenfalse') {
             this.router.navigate(['/login'])
           } else {
-            console.log("in searchfilterd");
+            // console.log("in searchfilterd");
             if (response.data[0].getdvrDataStatus == '0') {
-              console.log(" this.dvrList", this.dvrList);
+              // console.log(" this.dvrList", this.dvrList);
 
               this.countData = response.data[0]["countdata"];
 
@@ -632,7 +632,7 @@ export class HomeComponent implements OnInit {
               this.dvrList = [];
 
               this.rerender();
-              console.log(" this.dvrList", this.dvrList);
+              // console.log(" this.dvrList", this.dvrList);
 
 
               $(document).ready(function () {
@@ -652,7 +652,7 @@ export class HomeComponent implements OnInit {
 
       }
       else {
-        console.log("only date");
+        // console.log("only date");
         if (this.startDate != "" && this.endDate != "") {
           var strtDt = new Date(this.startDate);
           var endDt = new Date(this.endDate);
@@ -665,7 +665,7 @@ export class HomeComponent implements OnInit {
             this.error_msg = "Please enter Dates correctly ,End date need to be bigger then start date.";
             this.dvrList = this.conformlist;
           } else {
-            console.log("valid date");
+            // console.log("valid date");
             this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=" + searchfilter + "&login_id=" + this.user_id).subscribe(response => {
               if (response.status == 'tokenfalse') {
                 this.router.navigate(['/login'])
@@ -674,7 +674,7 @@ export class HomeComponent implements OnInit {
                   this.countData = response.data[0]["countdata"];
                   this.dvrList = response.data[0]["dvrlist"];
                   this.rerender();
-                  console.log(" this.dvrList", this.dvrList);
+                  // console.log(" this.dvrList", this.dvrList);
                   this.no_of_visit = this.countData[0].no_of_visit;
                   this.com_entry = this.countData[0].no_of_completed;
                   this.incom_entry = this.countData[0].no_of_incompleted;
@@ -685,7 +685,7 @@ export class HomeComponent implements OnInit {
                   this.dvrList = [];
 
                   this.rerender();
-                  console.log(" this.dvrList", this.dvrList);
+                  // console.log(" this.dvrList", this.dvrList);
 
 
                   $(document).ready(function () {
@@ -704,7 +704,7 @@ export class HomeComponent implements OnInit {
             });
           }
         } else {
-          console.log("invalid date");
+          // console.log("invalid date");
           this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?login_id=" + this.user_id).subscribe(response => {
             if (response.status == 'tokenfalse') {
               this.router.navigate(['/login'])
@@ -713,7 +713,7 @@ export class HomeComponent implements OnInit {
                 this.countData = response.data[0]["countdata"];
                 this.dvrList = response.data[0]["dvrlist"];
                 this.rerender();
-                console.log(" this.dvrList", this.dvrList);
+                // console.log(" this.dvrList", this.dvrList);
                 this.no_of_visit = this.countData[0].no_of_visit;
                 this.com_entry = this.countData[0].no_of_completed;
                 this.incom_entry = this.countData[0].no_of_incompleted;
@@ -724,7 +724,7 @@ export class HomeComponent implements OnInit {
                 this.dvrList = [];
 
                 this.rerender();
-                console.log(" this.dvrList", this.dvrList);
+                // console.log(" this.dvrList", this.dvrList);
 
 
                 $(document).ready(function () {
@@ -753,18 +753,18 @@ export class HomeComponent implements OnInit {
 
 
       // if (this.sale_person != undefined && searchfilter != undefined && this.startDate != undefined && this.endDate != undefined && this.customer != undefined) {
-      //   console.log("in all filters");
+      //   // console.log("in all filters");
 
-      //   console.log("for sale person and date filters and customer filter");
+      //   // console.log("for sale person and date filters and customer filter");
 
       //   this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=" + searchfilter + "&login_id=" + this.user_id + "&salePerson=" + this.sale_person + "&customer=" + this.customer.customer_name + "&customerid=" + this.customer.customer_id).subscribe(response => {
       //     if (response.status == 'tokenfalse') {
       //       this.router.navigate(['/login'])
       //     } else {
 
-      //       console.log("in searchfilterd");
+      //       // console.log("in searchfilterd");
       //       if (response.data[0].getdvrDataStatus == '0') {
-      //         console.log(" this.dvrList", this.dvrList);
+      //         // console.log(" this.dvrList", this.dvrList);
 
 
       //         this.countData = response.data[0]["countdata"];
@@ -796,7 +796,7 @@ export class HomeComponent implements OnInit {
       //   // for three search filters
       // } else if (this.sale_person != 'undefined' && this.sale_person !=undefined && this.customer != undefined) {
       //   // for customer and sale_person
-      //   console.log("for sale_person and customer");
+      //   // console.log("for sale_person and customer");
       //   this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=undefineddate&login_id=" + this.user_id + "&customer=" + this.customer.customer_name + "&salePerson=" + this.sale_person + "&customerid=" + this.customer.customer_id).subscribe(response => {
       //     if (response.status == 'tokenfalse') {
       //       this.router.navigate(['/login'])
@@ -807,7 +807,7 @@ export class HomeComponent implements OnInit {
       //         this.countData = response.data[0]["countdata"];
       //         this.dvrList = response.data[0]["dvrlist"];
       //         this.rerender();
-      //         console.log(" this.dvrList", this.dvrList);
+      //         // console.log(" this.dvrList", this.dvrList);
       //         this.no_of_visit = this.countData[0].no_of_visit;
       //         this.com_entry = this.countData[0].no_of_completed;
       //         this.incom_entry = this.countData[0].no_of_incompleted;
@@ -831,15 +831,15 @@ export class HomeComponent implements OnInit {
 
       // }else if(this.sale_person != 'undefined' && this.sale_person != undefined && this.startDate != undefined && this.endDate != undefined){
       //  //for sale_person and date
-      //  console.log("for sale_person and date filter");
+      //  // console.log("for sale_person and date filter");
       //  this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=" + searchfilter + "&login_id=" + this.user_id + "&salePerson=" + this.sale_person).subscribe(response => {
       //   if (response.status == 'tokenfalse') {
       //     this.router.navigate(['/login'])
       //   } else {
 
-      //     console.log("in searchfilterd");
+      //     // console.log("in searchfilterd");
       //     if (response.data[0].getdvrDataStatus == '0') {
-      //       console.log(" this.dvrList", this.dvrList);
+      //       // console.log(" this.dvrList", this.dvrList);
 
 
       //       this.countData = response.data[0]["countdata"];
@@ -871,15 +871,15 @@ export class HomeComponent implements OnInit {
       // }
       // else if (this.customer != undefined  && this.sale_person ==undefined && searchfilter != undefined && this.startDate != undefined && this.endDate != undefined) {
       //   //for customer and date filter 
-      //   console.log("for customer and date filter")
+      //   // console.log("for customer and date filter")
       //   this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=" + searchfilter + "&login_id=" + this.user_id + "&customer=" + this.customer.customer_name + "&customerid=" + this.customer.customer_id).subscribe(response => {
       //     if (response.status == 'tokenfalse') {
       //       this.router.navigate(['/login'])
       //     } else {
 
-      //       console.log("in searchfilterd");
+      //       // console.log("in searchfilterd");
       //       if (response.data[0].getdvrDataStatus == '0') {
-      //         console.log(" this.dvrList", this.dvrList);
+      //         // console.log(" this.dvrList", this.dvrList);
 
 
       //         this.countData = response.data[0]["countdata"];
@@ -910,7 +910,7 @@ export class HomeComponent implements OnInit {
       // }
       // else if (this.sale_person != undefined && this.sale_person != 'undefined') {
       //   // only for sale_person
-      //   console.log("only for sale_person")
+      //   // console.log("only for sale_person")
       //   this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=undefineddate&login_id=" + this.user_id + "&salePerson=" + this.sale_person).subscribe(response => {
       //     if (response.status == 'tokenfalse') {
       //       this.router.navigate(['/login'])
@@ -921,7 +921,7 @@ export class HomeComponent implements OnInit {
       //         this.countData = response.data[0]["countdata"];
       //         this.dvrList = response.data[0]["dvrlist"];
       //         this.rerender();
-      //         console.log(" this.dvrList", this.dvrList);
+      //         // console.log(" this.dvrList", this.dvrList);
       //         this.no_of_visit = this.countData[0].no_of_visit;
       //         this.com_entry = this.countData[0].no_of_completed;
       //         this.incom_entry = this.countData[0].no_of_incompleted;
@@ -944,26 +944,26 @@ export class HomeComponent implements OnInit {
       //   });
       // }  else if (this.customer != undefined) {
       //   //for customer filter
-      //   console.log("only for customer filter")
+      //   // console.log("only for customer filter")
       //   this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=undefineddate&login_id=" + this.user_id + "&customer=" + this.customer.customer_name + "&customerid=" + this.customer.customer_id).subscribe(response => {
       //     if (response.status == 'tokenfalse') {
       //       this.router.navigate(['/login'])
       //     } else {
       //       if (response.data[0].getdvrDataStatus == '0') {
-      //         console.log("response",response);
+      //         // console.log("response",response);
       //         //  this.countData = response["countdata"];
       //         // this.dvrList = response["dvrlist"];
       //         this.countData = response.data[0]["countdata"];
       //         this.dvrList = response.data[0]["dvrlist"];
       //         this.rerender();
-      //         console.log(" this.dvrList", this.dvrList);
+      //         // console.log(" this.dvrList", this.dvrList);
       //         this.no_of_visit = this.countData[0].no_of_visit;
       //         this.com_entry = this.countData[0].no_of_completed;
       //         this.incom_entry = this.countData[0].no_of_incompleted;
       //         this.no_contact = this.countData[0].no_of_contact;
 
       //       } else {
-      //         console.log("in else part")
+      //         // console.log("in else part")
       //         $(document).ready(function () {
       //           $('.odd').show();
 
@@ -983,9 +983,9 @@ export class HomeComponent implements OnInit {
       // } 
       // else {
       //   //only for date filters
-      //   console.log("in no filters");
+      //   // console.log("in no filters");
       //   if (result != undefined && result1 != undefined) {
-      //     console.log("valid date")
+      //     // console.log("valid date")
       //     this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?searchfiltertype=" + searchfilter + "&login_id=" + this.user_id).subscribe(response => {
       //       if (response.status == 'tokenfalse') {
       //         this.router.navigate(['/login'])
@@ -994,7 +994,7 @@ export class HomeComponent implements OnInit {
       //           this.countData = response.data[0]["countdata"];
       //           this.dvrList = response.data[0]["dvrlist"];
       //           this.rerender();
-      //           console.log(" this.dvrList", this.dvrList);
+      //           // console.log(" this.dvrList", this.dvrList);
       //           this.no_of_visit = this.countData[0].no_of_visit;
       //           this.com_entry = this.countData[0].no_of_completed;
       //           this.incom_entry = this.countData[0].no_of_incompleted;
@@ -1016,7 +1016,7 @@ export class HomeComponent implements OnInit {
 
       //     });
       //   } else {
-      //     console.log("invalid date");
+      //     // console.log("invalid date");
       //     this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?login_id=" + this.user_id).subscribe(response => {
       //       if (response.status == 'tokenfalse') {
       //         this.router.navigate(['/login'])
@@ -1025,7 +1025,7 @@ export class HomeComponent implements OnInit {
       //           this.countData = response.data[0]["countdata"];
       //           this.dvrList = response.data[0]["dvrlist"];
       //           this.rerender();
-      //           console.log(" this.dvrList", this.dvrList);
+      //           // console.log(" this.dvrList", this.dvrList);
       //           this.no_of_visit = this.countData[0].no_of_visit;
       //           this.com_entry = this.countData[0].no_of_completed;
       //           this.incom_entry = this.countData[0].no_of_incompleted;
@@ -1076,23 +1076,23 @@ export class HomeComponent implements OnInit {
     this.commonservice.getAllData(this.commonservice.projectpath + "/getdashboarddetails?login_id=" + this.user_id).subscribe(response => {
 
 
-      // console.log("status",response.status)
+      // // console.log("status",response.status)
       if (response.status == 'tokenfalse') {
-        console.log("uuuuuuuuuuuuuuuuu")
+        // console.log("uuuuuuuuuuuuuuuuu")
         this.router.navigate(['/login'])
       } else {
-        console.log("uuuuuuuuuuuuu");
-        console.log("respose", response);
-        //   console.log("uuuuuuuuuuu",response.data[0]);
-        console.log("uuuuuuuuuuu", response.data[0].getdvrDataStatus);
+        // console.log("uuuuuuuuuuuuu");
+        // console.log("respose", response);
+        //   // console.log("uuuuuuuuuuu",response.data[0]);
+        // console.log("uuuuuuuuuuu", response.data[0].getdvrDataStatus);
 
         if (response.data[0].getdvrDataStatus == '0') {
 
-          //  console.log("iiiiiiiiiiiiiiiii",response);
+          //  // console.log("iiiiiiiiiiiiiiiii",response);
           this.rerender();
 
           this.countData = response.data[0]["countdata"];
-          //  console.log("this.countData",this.countData);
+          //  // console.log("this.countData",this.countData);
           this.dvrList = response.data[0]["dvrlist"];
           this.conformlist = this.dvrList;
           this.no_of_visit = this.countData[0].no_of_visit;
@@ -1100,7 +1100,7 @@ export class HomeComponent implements OnInit {
           this.incom_entry = this.countData[0].no_of_incompleted;
           this.no_contact = this.countData[0].no_of_contact;
 
-          console.log(" this.dvrList", this.dvrList);
+          // console.log(" this.dvrList", this.dvrList);
 
         } else {
           this.no_of_visit = 0;
@@ -1123,20 +1123,20 @@ export class HomeComponent implements OnInit {
   }
 
   salepersonDetails(sale_person){
-    console.log(sale_person)
+    // console.log(sale_person)
     if (sale_person) {
       this.commonservice.getAllData(this.commonservice.projectpath + "/mappingCustomerDetails?sale_person=" + sale_person).subscribe(response => {
         if (response.status == 'tokenfalse') {
           this.router.navigate(['/login'])
         } else {
-          console.log("sale_person------------>",response);
+          // console.log("sale_person------------>",response);
           this.cust_data = response.data
-          console.log("respocne",response.data)
+          // console.log("respocne",response.data)
         }
       });
 
     } else {
-      console.log("sale person not selected yet");
+      // console.log("sale person not selected yet");
     }
   }
 

+ 10 - 10
src/app/login/login.component.ts

@@ -20,7 +20,7 @@ export class LoginComponent implements OnInit {
   validationmsg: any;
   validationmsg1:any;
   constructor(private router: Router, private http: HttpClient, private commonservice: CommonFunctionService) {
-    console.log("in login");
+    // console.log("in login");
   }
 
   ngOnInit() {
@@ -31,11 +31,11 @@ export class LoginComponent implements OnInit {
   }
 
   ngOnChanges() {
-    console.log("this.loginForm------>", this.loginForm);
+    // console.log("this.loginForm------>", this.loginForm);
   }
 
   loginUser(form: FormGroup) {
-    console.log('Username', form.value.email);
+    // console.log('Username', form.value.email);
     //console.log('password', form.value.password);
 
 
@@ -52,21 +52,21 @@ export class LoginComponent implements OnInit {
     this.loginvalidpassword=false;
     this.commonservice.getData(this.commonservice.projectpath + "/loginuser", logindata).subscribe(response => {
    //   console.log("in response", response);
-      console.log("in response", response.errors);
+      // console.log("in response", response.errors);
       
 
       // console.log("in response---->",response.data[0]["loginStatus"],response.data[0]["jwttoken"]);
 
 
       if (response.errors) {
-        console.log("check condition",response.errors.search("Username"));
+        // console.log("check condition",response.errors.search("Username"));
         if(response.errors.search("Username") > 0){
-          console.log("in if condition");
+          // console.log("in if condition");
           this.loginvalidflag = true;
           this.validationmsg = response.errors;
 
         }else{
-          console.log("in else condition")
+          // console.log("in else condition")
           this.loginvalidpassword=true;
           this.loginvalidflag = false;
           this.validationmsg1 = response.errors;
@@ -79,7 +79,7 @@ export class LoginComponent implements OnInit {
         this.loginvalidpassword=false;
 
         if (this.loginStatus == '0') {
-          console.log("valid user");
+          // console.log("valid user");
           localStorage.setItem('tokenkey', response.data[0]["jwttoken"]);
           var logindata = response.data[0]["logindata"];
 
@@ -96,7 +96,7 @@ export class LoginComponent implements OnInit {
           this.router.navigate(['/home']);
 
         } else {
-          console.log("in invalid user");
+          // console.log("in invalid user");
           this.loginvalidpassword=true;
           this.loginvalidflag = false;
           this.validationmsg1 = "Please enter valid credentials";
@@ -115,7 +115,7 @@ export class LoginComponent implements OnInit {
   }
 
   onCancle() {
-    console.log("in cancel");
+    // console.log("in cancel");
     this.validationmsg = "";
 
 

+ 7 - 7
src/app/password/password.component.ts

@@ -30,7 +30,7 @@ export class PasswordComponent implements OnInit {
 
 
   constructor(private router: Router, private commonservice: CommonFunctionService) {
-    console.log("in password changes");
+    // console.log("in password changes");
   }
 
 
@@ -42,11 +42,11 @@ export class PasswordComponent implements OnInit {
   }
 
   ngOnChanges() {
-    console.log("this.passwordForm------>", this.passwordForm);
+    // console.log("this.passwordForm------>", this.passwordForm);
   }
 
   passwordUser(form: FormGroup) {
-    console.log('Username', form.value.email);
+    // console.log('Username', form.value.email);
     //console.log('password', form.value.password);
 
 
@@ -63,7 +63,7 @@ export class PasswordComponent implements OnInit {
     this.loginvalidpassword = false;
     this.commonservice.getData(this.commonservice.projectpath + "/changepassword", logindata).subscribe(response => {
       //   console.log("in response", response);
-      console.log("in response", response);
+      // console.log("in response", response);
 
 
       if (response.data.length == 0) {
@@ -73,12 +73,12 @@ export class PasswordComponent implements OnInit {
         this.error_msg = response.errors;
         this.entry_successflag=true;
       } else if (response.data.length > 0) {
-        console.log("inside if(response.message== '') ")
+        // console.log("inside if(response.message== '') ")
         this.openPopup();
         this.status_msg = "Success";
         this.error_msg = response.data[0].message;
         this.checkoperationflag=true;
-        console.log("error_msg", this.error_msg);
+        // console.log("error_msg", this.error_msg);
       }
       else {
         this.status_msg = "";
@@ -94,7 +94,7 @@ export class PasswordComponent implements OnInit {
   }
 
   onCancle() {
-    console.log("in cancel");
+    // console.log("in cancel");
     this.validationmsg = "";
 
 

+ 30 - 30
src/app/services/commonfunctions.service.ts

@@ -19,29 +19,29 @@ export class CommonFunctionService {
 
   getAllData(url: string) {
     var headers = new HttpHeaders();
-    console.log("url---->", url);
+    // console.log("url---->", url);
     headers = headers.append("Content-Type", "application/json")
     headers = headers.append("Access-Control-Allow-Origin", '*')
     let text = "Mr. Blue has a blue house";
     // let position = text.search("blue");
     var urlfind = url.includes("loginuser") || url.includes("changepassword");
     if (urlfind) {
-      console.log("login url");
+      // console.log("login url");
       let abc: any;
       abc = this.http.get(url, { headers: headers });
       return abc;
 
     } else {
-      console.log("other url");
+      // console.log("other url");
       var gettoken = localStorage.getItem("tokenkey");
 
-      console.log("url---->", url);
+      // console.log("url---->", url);
       headers = headers.append("token", gettoken);
 
-      console.log(headers.get('token'));
+      // console.log(headers.get('token'));
 
       //headers.append('token', gettoken);
-      console.log("headers", { headers: headers })
+      // console.log("headers", { headers: headers })
       let abc: any;
       abc = this.http.get(url, { headers: headers });
       return abc;
@@ -52,8 +52,8 @@ export class CommonFunctionService {
   }
 
   getData(url: string, json: any) {
-    console.log("params=======>", json);
-    console.log("url---->", url)
+    // console.log("params=======>", json);
+    // console.log("url---->", url)
     var params = json;
     var headers = new HttpHeaders();
     headers = headers.append("Content-Type", "application/json")
@@ -61,33 +61,33 @@ export class CommonFunctionService {
 
     var urlfind = url.includes("loginuser") || url.includes("changepassword");
     if (urlfind) {
-      console.log("login url");
+      // console.log("login url");
       let abc: any; abc = this.http.post(url, params,
         { headers: headers });
       return abc;
 
     } else {
-      console.log("other url");
+      // console.log("other url");
       var gettoken = localStorage.getItem("tokenkey");
 
 
-      console.log("url---->", url);
+      // console.log("url---->", url);
       headers = headers.append("token", gettoken);
-      //console.log(headers.get('token'));
+      //// console.log(headers.get('token'));
       let abc: any; abc = this.http.post(url, params,
         { headers: headers });
       return abc
 
 
     }
-    ////console.log*("params:", JSON.stringify(params));
+    ////// console.log*("params:", JSON.stringify(params));
 
   }
 
 
   updateData(url: string, json: any) {
-    console.log("params=======>", json);
-    console.log("url---->", url)
+    // console.log("params=======>", json);
+    // console.log("url---->", url)
     var params = json;
     var headers = new HttpHeaders();
     headers = headers.append("Content-Type", "application/json")
@@ -95,17 +95,17 @@ export class CommonFunctionService {
 
     var urlfind = url.includes("loginuser") || url.includes("changepassword");
     if (urlfind) {
-      console.log("login url");
+      // console.log("login url");
       let abc: any; abc = this.http.post(url, params,
         { headers: headers });
       return abc;
 
     } else {
-      console.log("other url");
+      // console.log("other url");
       var gettoken = localStorage.getItem("tokenkey");
 
 
-      console.log("url---->", url);
+      // console.log("url---->", url);
       headers = headers.append("token", gettoken);
       //console.log(headers.get('token'));
       let abc: any; abc = this.http.put(url, params,
@@ -120,29 +120,29 @@ export class CommonFunctionService {
 
   updateContact(url: string, json: any) {
         var headers = new HttpHeaders();
-    console.log("url---->", url);
+    // console.log("url---->", url);
     headers = headers.append("Content-Type", "application/json")
     headers = headers.append("Access-Control-Allow-Origin", '*')
 
     var urlfind = url.includes("loginuser") || url.includes("changepassword");
     if (urlfind) {
-      console.log("login url");
+      // console.log("login url");
       let abc: any;
       abc = this.http.put(url, json, { headers: headers });
 
       return abc;
 
     } else {
-      console.log("other url");
+      // console.log("other url");
       var gettoken = localStorage.getItem("tokenkey");
 
-      console.log("url---->", url);
+      // console.log("url---->", url);
       headers = headers.append("token", gettoken);
 
-      console.log(headers.get('token'));
+      // console.log(headers.get('token'));
 
       //headers.append('token', gettoken);
-      console.log("headers", { headers: headers })
+      // console.log("headers", { headers: headers })
       let abc: any;
       abc = this.http.put(url, json, { headers: headers });
 
@@ -153,13 +153,13 @@ export class CommonFunctionService {
 
   deleteContact(url: string, login_id: string, contact_id: any) {
     var headers = new HttpHeaders();
-    console.log("url---->", url);
+    // console.log("url---->", url);
     headers = headers.append("Content-Type", "application/json")
     headers = headers.append("Access-Control-Allow-Origin", '*')
 
     var urlfind = url.includes("loginuser") || url.includes("changepassword");
     if (urlfind) {
-      console.log("login url");
+      // console.log("login url");
       let abc: any;
       abc = this.http.delete(url, { headers: headers, 
         body: { updated_by: login_id, contact_id: contact_id } 
@@ -168,16 +168,16 @@ export class CommonFunctionService {
       return abc;
 
     } else {
-      console.log("other url");
+      // console.log("other url");
       var gettoken = localStorage.getItem("tokenkey");
 
-      console.log("url---->", url);
+      // console.log("url---->", url);
       headers = headers.append("token", gettoken);
 
-      console.log(headers.get('token'));
+      // console.log(headers.get('token'));
 
       //headers.append('token', gettoken);
-      console.log("headers", { headers: headers })
+      // console.log("headers", { headers: headers })
       let abc: any;
       abc = this.http.delete(url, { headers: headers, 
         body: { updated_by: login_id, contact_id: contact_id }