Compare commits

..

No commits in common. "2cc34d957b6cb65be3c8bc6c11f0d4e866ebdee4" and "d01df0cc2f1131510de56afa31ee8676b8d62fec" have entirely different histories.

50 changed files with 438 additions and 846 deletions

View File

@ -9904,21 +9904,6 @@
"tslib": "^2.0.0"
}
},
"ngx-mat-select-search": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/ngx-mat-select-search/-/ngx-mat-select-search-3.3.1.tgz",
"integrity": "sha512-U8CnG0ER/Z4WLcvucvzurBHg+WY3Dfr7HCwqSWv3nKG95dXrWCdCG1y34/uCRvv/CPwi7NoS1EoBXA/CNYuCNw==",
"requires": {
"tslib": "^1.9.0"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"ngx-perfect-scrollbar": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/ngx-perfect-scrollbar/-/ngx-perfect-scrollbar-10.1.0.tgz",

View File

@ -56,7 +56,6 @@
"ngx-bootstrap": "^10.2.0",
"ngx-color-picker": "^11.0.0",
"ngx-daterangepicker-material": "^5.0.1",
"ngx-mat-select-search": "^3.3.1",
"ngx-perfect-scrollbar": "10.1.0",
"ngx-scrollbar": "^7.5.6",
"ngx-sortablejs": "^3.1.4",

View File

@ -14,8 +14,8 @@ export class AuthGuard implements CanActivate, CanActivateChild {
if(token != '' && token != undefined && token != null){
return true
}else{
this.router.navigate(['page']);
alert("else");
this.router.navigate(['authentication/login']);
return false;
}

View File

@ -16,8 +16,6 @@ export class AppComponent {
}
ngOnInit() {
console.log(window.location.href)
console.log(window.location.pathname)
console.log(window.location.origin)
}
}

View File

@ -154,8 +154,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = {
provide: HTTP_INTERCEPTORS,
useClass: TokenInterceptor,
multi: true
},
{provide: LocationStrategy, useClass: HashLocationStrategy}
},{provide: LocationStrategy, useClass: HashLocationStrategy}
],
entryComponents: [],
bootstrap: [AppComponent],

View File

@ -63,7 +63,7 @@
</ng-container> -->
<ng-container matColumnDef="paymentStatus">
<th mat-header-cell *matHeaderCellDef class="font-color mat-mob"> Payment Status </th>
<td mat-cell *matCellDef="let row" class="element-spc" [ngClass]="{'positive' :row.paymentStatus == 0,'cancelStatus' : row.paymentStatus == 1}"> <b>{{row.paymentStatus == 0 ? 'Paid' : 'Not Paid'}}</b></td>
<td mat-cell *matCellDef="let row" class="element-spc" [ngClass]="{'positive' :row.paymentStatus == 1,'cancelStatus' : row.paymentStatus == 0}"> <b>{{row.paymentStatus == 1 ? 'Paid' : 'Not Paid'}}</b></td>
</ng-container>
<ng-container matColumnDef="paymentMode">

View File

@ -9,8 +9,7 @@ import { environment } from 'environments/environment';
import Swal from 'sweetalert2';
import { AppointmentsService } from '../appointments-service/appointments.service';
import { DialogBoxComponent } from '../dialog-box/dialog-box.component';
import { ActivatedRoute, Router } from '@angular/router';
import { DashboardService } from 'app/dashboard/dashboard.service';
import { Router } from '@angular/router';
export interface UsersData {
busId: number;
appoinmentTime: string;
@ -60,20 +59,9 @@ export class AppoinmentsListComponent implements OnInit {
consultants: any = [];
selectPractitioner:any = [];
user_role: any=[];
constructor(private router: Router,private notifierService: NotifierService,public dialog: MatDialog, public _app:AppointmentsService,public _dash:DashboardService) {
let go_appointment = localStorage.getItem('go_appointment')
console.log(go_appointment)
if(go_appointment == '0'){
let dataVal = localStorage.getItem('go_appointment_data')
console.log(dataVal)
this.openDialog('Update',JSON.parse(dataVal))
}
}
constructor(private router: Router,private notifierService: NotifierService,public dialog: MatDialog, public _app:AppointmentsService) { }
ngOnInit() {
ngOnInit(): void {
this.recordStatus=false;
this.user_role = localStorage.getItem('user_role');
if(this.user_role != 'FRONTDESK'){
@ -281,8 +269,6 @@ export class AppoinmentsListComponent implements OnInit {
dialogRef.afterClosed().subscribe(result => {
console.log(result)
if(result.data == 0){
localStorage.removeItem('go_appointment_data')
localStorage.setItem('go_appointment','1')
if(this.user_role != 'FRONTDESK'){
let param ={"busId":localStorage.getItem('busId'),"userId":localStorage.getItem('user_id')}
console.log(param)

View File

@ -7,17 +7,20 @@
<mat-form-field appearance="outline" class="card-mat-pane">
<mat-label>Name</mat-label>
<input placeholder="Name" formControlName="name" matInput>
<mat-error *ngIf="myError('name', 'required')">Name is required</mat-error>
<!-- <mat-error *ngIf="myError('cusName', 'required')">Name is required</mat-error>
<mat-error *ngIf="myError('cusName', 'maxlength')">Limit exceed</mat-error> -->
</mat-form-field>
<mat-form-field appearance="outline" class="card-mat-pane">
<mat-label>Email</mat-label>
<input type="email" placeholder="Email" formControlName="email" matInput >
<!-- <mat-error *ngIf="!form.get('email')?.errors?.required && (form.get('email')?.errors?.pattern)">
Please enter a valid email address
</mat-error>
<mat-error *ngIf="myError('email', 'required')">email is required</mat-error>
<mat-error *ngIf="form.get('email')?.invalid && (form.get('email')?.dirty || form.get('email')?.touched) && form.get('email')?.errors?.required">
Email is required
</mat-error> -->
<mat-error *ngIf="myError('email', 'required')">Email is required</mat-error>
<mat-error *ngIf="myError('email', 'email')">Invalid email format</mat-error>
</mat-form-field>
</mat-form-field>
<mat-form-field appearance="outline" class="card-mat-pane">
<mat-label>Phone</mat-label>
<input placeholder="Mobile No" type="text" appMobileNumberPattern maxlength="10" minlength="10" matInput formControlName="phoneNo">
@ -30,7 +33,7 @@
<div class="popup-button">
<!-- <span class="buttons cancel" (click)="close()">Cancel</span> -->
<button type="button"class="buttons cancel" (click)="close()" >Cancel</button>
<button type="submit"class="buttons add" [disabled]="submitDisabled">Save</button>
<button type="submit"class="buttons add">Save</button>
</div>
</form>
</mat-card>

View File

@ -11,19 +11,15 @@ import { CustomersService } from 'app/appoinment/customers/customers-service/cus
export class AppointmentAddcustomerComponent implements OnInit {
form: FormGroup;
@Output() childButtonEvent = new EventEmitter();
submitDisabled: boolean = true;
constructor(public _app:AppointmentsService,public _cus:CustomersService) { }
ngOnInit(): void {
ngOnInit(): void {
this.form = new FormGroup({
name: new FormControl('', [Validators.required]),
email: new FormControl('', [Validators.required, Validators.email]),
phoneNo: new FormControl('', [Validators.required, Validators.minLength(10), Validators.maxLength(10)]),
});
this.form.valueChanges.subscribe(() => {
this.submitDisabled = !this.form.valid;
email: new FormControl('', [Validators.required]),
phoneNo: new FormControl('', [Validators.required,Validators.minLength(10),Validators.maxLength(10)]),
});
}
public myError = (controlName: string, errorName: string) =>{

View File

@ -1,6 +1,6 @@
<!-- <mat-card class="settings-panel" > -->
<h5 mat-dialog-title> <strong>{{action}} Appoinment</strong>
<button mat-icon-button type="button" matTooltip="Close" class="button" matTooltipPosition="above" (click)="closeDialog()"
<button mat-icon-button type="button" matTooltip="Close" class="button" matTooltipPosition="above" (click)="close()"
><mat-icon>close</mat-icon></button></h5>
<form [formGroup]="form" (ngSubmit)="submit()">
<ng-scrollbar class="scrollHV">
@ -147,24 +147,20 @@
</mat-form-field>
<div style="margin-top: 5px;margin-bottom: 15px;">
<div><mat-label>Payment Status</mat-label></div>
<mat-radio-group aria-label="Select an option" formControlName="paymentStatus" required>
<mat-radio-button value="0">Paid</mat-radio-button>
<mat-radio-button value="1" style="margin-left: 10px;">Not Paid</mat-radio-button>
<mat-radio-button value="1">Paid</mat-radio-button>
<mat-radio-button value="0" style="margin-left: 10px;">Not Paid</mat-radio-button>
</mat-radio-group>
<mat-error *ngIf="form.get('paymentStatus').hasError('required')">Payment status is required</mat-error>
<!-- <mat-error *ngIf="paymentStatus.hasError('invalidValue')">Please choose any other</mat-error> -->
</div>
<mat-form-field appearance="outline" class="mat-pane" *ngIf="form.get('paymentStatus').value == 0">
<mat-form-field appearance="outline" class="mat-pane" *ngIf="form.get('paymentStatus').value == 1">
<mat-label>Payment Mode</mat-label>
<mat-select placeholder="Select Payment Mode" formControlName="paymentMode" required>
<mat-option value="Cash">Cash</mat-option>
<mat-option value="UPI">UPI</mat-option>
<mat-option value="Card">Card</mat-option>
</mat-select>
<mat-error *ngIf="form.get('paymentMode').hasError('required')">Payment mode is required</mat-error>
</mat-form-field>
</mat-form-field>
<!-- <div class="notes">
<input type="checkbox" id="scales" name="scales" checked>
<label for="scales">Send notifications for customer</label>

View File

@ -103,7 +103,7 @@ export class DialogBoxComponent implements OnInit {
ServiceId: any;
user_role: string;
consultants: any = [];
Status:any = [{id:1,value:"consultant"},{id:2,value:"Booked"},{id:1,value:"No Show"},{id:1,value:"cancelled"}]
Status:any = [{id:1,value:"Consult"},{id:2,value:"Attend"},{id:1,value:"No Show"},{id:1,value:"Cancel"}]
advanced_slot_days: any=7;
slotIndex: any;
findSlotIndex: any;
@ -117,19 +117,17 @@ export class DialogBoxComponent implements OnInit {
constructor(private notifierService: NotifierService,private router: Router,private formBuilder: FormBuilder, public _cus:CustomersService,
public dialogRef: MatDialogRef<DialogBoxComponent>,public _api:ConsultantService, public _con:ConsultantService,
@Inject(MAT_DIALOG_DATA) public data: UsersData,public _app:AppointmentsService,public end_user:EndUserService) {
// // console.log(data);
console.log(data);
this.local_data = {...data};
this.action = this.local_data.action;
this.frontDeskChoosedPractiID = this.local_data['ServicesMapDetail.userId']
console.log(this.local_data)
console.log(this.frontDeskChoosedPractiID)
}
get f(){
return this.form.controls;
}
closeDialog(){
localStorage.removeItem('go_appointment_data')
localStorage.setItem('go_appointment','1')
this.dialogRef.close({event:'Cancel'});
}
onSelectFile(event) {
@ -141,7 +139,10 @@ export class DialogBoxComponent implements OnInit {
}
}
}
close() {
// console.log(this.form.value);
this.dialogRef.close();
}
// toggle() {
// this.show = !this.show;
@ -156,16 +157,16 @@ export class DialogBoxComponent implements OnInit {
ngOnInit() {
let advanceDays = localStorage.getItem('advanced_slot_days')
// // console.log(this.advanced_slot_days,advanceDays)
console.log(this.advanced_slot_days,advanceDays)
if(advanceDays == 'null' || advanceDays == null){
this.advanced_slot_days = 7
// // console.log(this.advanced_slot_days)
console.log(this.advanced_slot_days)
}else{
this.advanced_slot_days = parseInt(localStorage.getItem('advanced_slot_days'))-1
// // console.log(this.advanced_slot_days)
console.log(this.advanced_slot_days)
}
// this._app.customerlist_observable$.subscribe((res) => {
// // console.log('cus', res);
// console.log('cus', res);
// if(res){
@ -176,17 +177,17 @@ export class DialogBoxComponent implements OnInit {
this.user_role = localStorage.getItem('user_role');
let tmp=[]
// // console.log(this.advanced_slot_days)
console.log(this.advanced_slot_days)
for(let i=0;i<=this.advanced_slot_days;i++){
var someDate = new Date();
someDate.setDate(someDate.getDate() + i); //number of days to add, e.x. 15 days
var dateFormated = someDate.toISOString().substr(0,10);
// // console.log(dateFormated);
console.log(dateFormated);
tmp.push(dateFormated)
}
// // console.log(tmp)
console.log(tmp)
this.days= tmp
// // console.log(this.days)
console.log(this.days)
if(this.user_role != 'FRONTDESK'){
let userId = localStorage.getItem('user_id')
@ -221,7 +222,7 @@ export class DialogBoxComponent implements OnInit {
fees: new FormControl('',null),
appoinmentSlots: new FormControl(''),
});
// // console.log(this.local_data, this.selects)
console.log(this.local_data, this.selects)
// this.findSlotIndex = this.local_data.appoinmentSlots
// this.local_data.forEach(element => {
if(this.local_data.hasOwnProperty('action')){
@ -235,7 +236,7 @@ export class DialogBoxComponent implements OnInit {
this.customerId = this.local_data.customer
this.slotsResult =this.local_data.appoinmentSlots
this.local_data.appoinmentTime = new DatePipe('en-US').transform(this.local_data['appoinmentSlots'][0], 'shortTime')
// // console.log(this.servicesList_array)
console.log(this.servicesList_array)
this.local_data.paymentStatus = ""+this.local_data.paymentStatus+""
}
@ -248,10 +249,10 @@ export class DialogBoxComponent implements OnInit {
this.form.patchValue(this.local_data)
let id = localStorage.getItem('user_id')
// // console.log(id)
console.log(id)
this._con.getUsersListDetails(id).subscribe(res => {
if (res.status == 200) {
// // console.log(res)
console.log(res)
this.userData = res.data[0]
this.form.controls['busname'].setValue( this.userData.BusinessDetails[0].busName
@ -271,10 +272,10 @@ export class DialogBoxComponent implements OnInit {
let findAppointmentDate = this.local_data.appoinmentDate
this.days.forEach(element => {
// // console.log(element)
console.log(element)
if(element == findAppointmentDate){
this.days.indexOf(element)
// // console.log(this.days.indexOf(element))
console.log(this.days.indexOf(element))
this.clicks = this.days.indexOf(element)
}
});
@ -282,7 +283,7 @@ export class DialogBoxComponent implements OnInit {
let options:any = { weekday: 'long'};
var prnDt = new Date(this.days[ this.clicks]).toLocaleTimeString('en-us', options);
var formatDate = prnDt.split(" ")
// // console.log(formatDate)
console.log(formatDate)
this.dayName = formatDate[0]
let userId
@ -290,14 +291,14 @@ export class DialogBoxComponent implements OnInit {
userId = localStorage.getItem('user_id')
}else{
userId = frontDeskPractiUserid
// // console.log(frontDeskPractiUserid)
console.log(frontDeskPractiUserid)
}
// // console.log(userId)
console.log(userId)
let params ={"id":userId ,"day": this.dayName ,"addcount": this.clicks}
this.end_user.getSlots(params).subscribe(res => {
if (res.status == 200) {
// // console.log(res)
console.log(res)
let data = res['data'];
this.slots = data
let len =[]
@ -305,12 +306,12 @@ export class DialogBoxComponent implements OnInit {
len.push( element.length)
})
// // console.log(len)
console.log(len)
// this.slots.forEach(element => {
// // console.log(element)
// console.log(element)
// if(element == this.findSlotIndex[0]){
// this.slots.indexOf(element)
// // console.log(this.slots.indexOf(element))
// console.log(this.slots.indexOf(element))
// this.slotIndex = this.slots.indexOf(element)
// }
@ -322,15 +323,15 @@ export class DialogBoxComponent implements OnInit {
getCosultantList() {
let param ={"busId": localStorage.getItem('busId')}
// // console.log(param)
console.log(param)
this._app.getCosultantListDetails(param).subscribe(res => {
if (res.status == 200) {
// // console.log(res.data)
console.log(res.data)
let consultantsList = res.data;
this.consultants = consultantsList.filter(val => val.role == 'PRACTITIONER')
// // console.log(this.consultants)
console.log(this.consultants)
if(this.user_role == 'FRONTDESK'){
// // console.log(this.local_data['ServicesMapDetail.userId'])
console.log(this.local_data['ServicesMapDetail.userId'])
this.practiId = this.local_data['ServicesMapDetail.userId']
setTimeout(() => {
this.form.controls['practitioner'].setValue(this.practiId);
@ -348,7 +349,7 @@ export class DialogBoxComponent implements OnInit {
}
getConsultServices(selectedPractititoner){
// // console.log(selectedPractititoner)
console.log(selectedPractititoner)
let userId = selectedPractititoner.id
let busId = localStorage.getItem('busId')
this.getServicesList(userId, busId)
@ -359,47 +360,47 @@ export class DialogBoxComponent implements OnInit {
getPractitionerDetails(userId){
// let id = localStorage.getItem('user_id')
// // console.log(userId)
console.log(userId)
this.frontDeskChoosedPractiID = userId
this._app.getPractitionerData(userId).subscribe(res => {
if (res.status == 200) {
// // console.log(res)
console.log(res)
let usersList = res.data[0];
localStorage.setItem('practitioner',JSON.stringify(usersList))
// // console.log(usersList)
console.log(usersList)
let dataDays = usersList['practitionerInfos'][0].days
localStorage.setItem('advanced_slot_days',dataDays)
this.advanced_slot_days = dataDays
// // console.log(this.advanced_slot_days)
console.log(this.advanced_slot_days)
let tmp=[]
// // console.log(this.advanced_slot_days)
console.log(this.advanced_slot_days)
for(let i=0;i<=this.advanced_slot_days;i++){
var someDate = new Date();
someDate.setDate(someDate.getDate() + i); //number of days to add, e.x. 15 days
var dateFormated = someDate.toISOString().substr(0,10);
// // console.log(dateFormated);
console.log(dateFormated);
tmp.push(dateFormated)
}
// // console.log(tmp)
console.log(tmp)
this.days= tmp
}
})
}
checkSlotDur(param:any,i:any,slots){
//// console.log(param,i)
//console.log(param,i)
// this.slot_array =[];
// debugger;
// event.preventDefault();
// this.slotIndex = i
// this.slotTime = param
// // console.log(this.date,param)
// console.log(this.date,param)
let thirtyMinutes = this.duration * 60000; // convert 30 minutes to milliseconds
let date1 = new Date(param);
let date2 = new Date(date1.getTime() + thirtyMinutes);
// // console.log(date1);
// // console.log(date2);
// console.log(date1);
// console.log(date2);
const currentTime = new Date(); // Get the current time
//const filteredTimes = this.slots.filter(time => new Date(time) > date1);
@ -414,7 +415,7 @@ export class DialogBoxComponent implements OnInit {
const lastSlt = new Date( resultArray[0]);
const filteredTimes = slots.filter(time => new Date(time) >= firstSlt && new Date(time) <= lastSlt);
// // console.log(resultArray,filteredTimes);
// console.log(resultArray,filteredTimes);
if(filteredTimes.length>0){
return 1
@ -423,10 +424,10 @@ export class DialogBoxComponent implements OnInit {
return 0
}
// let result = filteredTimes.pop();
// // console.log(result);
// console.log(result);
// this.slots.forEach(element => {
// if(element <date2){
// // console.log(element);
// console.log(element);
// }
// });
@ -434,10 +435,10 @@ export class DialogBoxComponent implements OnInit {
}
submit(){
// console.log(this.form.value,this.slotsResult,this.days[this.clicks]);
console.log(this.form.value,this.slotsResult,this.days[this.clicks]);
// if(this.slotsResult == undefined){
// }
if(this.form.value.paymentStatus == 1){
if(this.form.value.paymentStatus == 0){
console.log('paymentmode')
this.form.controls['paymentMode'].clearValidators();
this.form.controls['paymentMode'].updateValueAndValidity();
@ -449,12 +450,11 @@ export class DialogBoxComponent implements OnInit {
this.form.controls['appoinmentSlots'].updateValueAndValidity();
}else {
if (!this.form.valid) {
this.notifierService.notify('warning', 'Please Fill all the Fields');
return;
return;
}
this.isSubmitting = true;
// console.log(this.form.value,this.slotsResult,this.days[this.clicks]);
console.log(this.form.value,this.slotsResult,this.days[this.clicks]);
let userId
if(this.user_role != 'FRONTDESK'){
userId = localStorage.getItem('user_id')
@ -490,7 +490,7 @@ export class DialogBoxComponent implements OnInit {
paramsData.id =this.local_data.id
paramsData.status =this.form.value.status
}
// console.log(paramsData)
console.log(paramsData)
this._app.addFormDetails(paramsData).subscribe(res => {
if (res.status == 200) {
if(this.local_data.hasOwnProperty('action')){
@ -502,8 +502,6 @@ export class DialogBoxComponent implements OnInit {
}else{
this.notifierService.notify('success', 'Appointment Added Successfully');
}
localStorage.removeItem('go_appointment_data')
localStorage.setItem('go_appointment','1')
let param = {data:0,response:res}
this.dialogRef.close(param);
this.isSubmitting = false;
@ -518,18 +516,18 @@ export class DialogBoxComponent implements OnInit {
goToSlotBooking(i){
// console.log(i)
console.log(i)
// this.days[]
if(this.clicks <this.advanced_slot_days){
this.clicks += 1;
}
// console.log( this.clicks)
// console.log(this.days,this.days[ this.clicks], this.clicks)
console.log( this.clicks)
console.log(this.days,this.days[ this.clicks], this.clicks)
let options:any = { weekday: 'long'};
var prnDt = new Date(this.days[ this.clicks]).toLocaleTimeString('en-us', options);
var formatDate = prnDt.split(" ")
// console.log(formatDate)
console.log(formatDate)
this.dayName = formatDate[0]
let userId
@ -540,17 +538,17 @@ export class DialogBoxComponent implements OnInit {
}
let params ={"id":userId , "day": this.dayName , "addcount": this.clicks}
// console.log(params)
console.log(params)
this.end_user.getSlots(params).subscribe(res => {
if (res.status == 200) {
// console.log(res)
console.log(res)
let data = res['data'];
this.slots = data
// this.slots.forEach(element => {
// // console.log(element)
// console.log(element)
// if(element == this.findSlotIndex[0]){
// this.slots.indexOf(element)
// // console.log(this.slots.indexOf(element))
// console.log(this.slots.indexOf(element))
// this.slotIndex = this.slots.indexOf(element)
// }
@ -565,13 +563,13 @@ export class DialogBoxComponent implements OnInit {
if(this.clicks >0){
this.clicks -= 1;
}
// console.log( this.clicks)
// console.log(this.days,this.days[ this.clicks], this.clicks)
console.log( this.clicks)
console.log(this.days,this.days[ this.clicks], this.clicks)
let options:any = { weekday: 'long'};
var prnDt = new Date(this.days[ this.clicks]).toLocaleTimeString('en-us', options);
var formatDate = prnDt.split(" ")
// console.log(formatDate)
console.log(formatDate)
this.dayName = formatDate[0]
let userId
@ -581,15 +579,15 @@ export class DialogBoxComponent implements OnInit {
userId = this.frontDeskChoosedPractiID
}
let params ={"id":userId , "day": this.dayName , "addcount": this.clicks}
// console.log(params)
console.log(params)
this.end_user.getSlots(params).subscribe(res => {
if (res.status == 200) {
// console.log(res)
console.log(res)
let data = res['data'];
this.slots = data
}
})
// console.log( this.clicks)
console.log( this.clicks)
this.form.controls['appoinmentDate'].setValue(this.days[ this.clicks])
}
check(param){
@ -613,21 +611,21 @@ export class DialogBoxComponent implements OnInit {
let params ={"id": userId,'addcount':0}
this._app.getSlots(params).subscribe((res:any) => {
if (res.status == 200) {
// console.log(res)
console.log(res)
let data = res['data'];
this.slots = data
let len =[];
this.slots.forEach(element => {
len.push( element.length)
})
// console.log(len)
console.log(len)
this.slotslength = len.reduce((a, b) => a + b, 0)
}
})
}
toggleActive(event:any,param:any,i:any,slots,j){
// console.log(event,param,i)
console.log(event,param,i)
this.slot_array =[];
this.slotIndex_group=j
// debugger;
@ -638,12 +636,12 @@ export class DialogBoxComponent implements OnInit {
this.form.controls['appoinmentTime'].setValue(resultDate)
this.date= param
// console.log(this.date,param,this.duration, this.ServiceId)
console.log(this.date,param,this.duration, this.ServiceId)
let thirtyMinutes = this.duration*60000; // convert 30 minutes to milliseconds
let date1 = new Date(param);
let date2 = new Date(date1.getTime() + thirtyMinutes);
// console.log(date1);
// console.log(date2,thirtyMinutes);
console.log(date1);
console.log(date2,thirtyMinutes);
const currentTime = new Date(); // Get the current time
//const filteredTimes = this.slots.filter(time => new Date(time) > date1);
@ -658,17 +656,17 @@ export class DialogBoxComponent implements OnInit {
const lastSlt = new Date( resultArray[0]);
const filteredTimes = slots.filter(time => new Date(time) >= firstSlt && new Date(time) <= lastSlt);
// console.log(resultArray,filteredTimes);
console.log(resultArray,filteredTimes);
// if(filteredTimes.length > 1){
// let result = filteredTimes.pop();
// // console.log(result);
// console.log(result);
// }
this.slotsResult = filteredTimes
// this.show = false;
// this.slots.forEach(element => {
// if(element <date2){
// // console.log(element);
// console.log(element);
// }
// });
@ -676,18 +674,18 @@ export class DialogBoxComponent implements OnInit {
}
getServicesList(id,busId) {
// console.log(id,busId)
console.log(id,busId)
this.servicesList_array = []
let userId = parseInt(id)
//this._pd.getTabStatusPdDetails(this.tabStatus)
this._app.getServicesListDetails(userId,busId).subscribe(res => {
if (res.status == 200) {
this.servicesList_data = res.data;
// console.log(this.servicesList_data)
console.log(this.servicesList_data)
res['data'].forEach(element => {
// tmp.push(element.service)
element.service.forEach(e => {
// console.log(e)
console.log(e)
this.servicesList_array.push(e)
this.assignService.push(e.servicesName)
});
@ -699,10 +697,10 @@ export class DialogBoxComponent implements OnInit {
// duration = this.serviceMapdetails[0].service[0].duration
// fees = this.serviceMapdetails[0].service[0].fees
// }
// console.log(this.servicesList_array,this.form.value)
console.log(this.servicesList_array,this.form.value)
this.servicesList_array.filter(arr=>{return arr.serviceId == this.local_data['ServicesMapDetail.serviceId']})
let serviceDetails = this.servicesList_data.filter(arr=>{return arr.serviceId == this.local_data['ServicesMapDetail.serviceId']})
// console.log(serviceDetails,this.local_data['ServicesMapDetail.serviceId'])
console.log(serviceDetails,this.local_data['ServicesMapDetail.serviceId'])
if(serviceDetails[0].duration.length>0 ){
this.duration = serviceDetails[0].duration[0].durationNew
} else{
@ -716,23 +714,19 @@ export class DialogBoxComponent implements OnInit {
// this.assignService = this.checkedArray
}
serviceData(data){
// console.log(data)
console.log(data)
this.ServiceId = data.serviceId
this.duration = data.duration
this.fees =[];
let serviceDetails = this.servicesList_data.filter(arr=>{return arr.serviceId == data.serviceId})
// console.log(serviceDetails)
console.log(serviceDetails)
if(serviceDetails[0].duration.length>0 ){
this.duration = serviceDetails[0].duration[0].durationNew
this.fees = serviceDetails[0].duration[0].fees
// console.log(this.fees)
} else{
this.duration = serviceDetails[0].service[0].duration
this.fees = serviceDetails[0].service[0].fees
// console.log(this.fees)
this.duration = this.servicesList_array[0].duration
this.fees = this.servicesList_array[0].fees
}
// console.log(this.fees)
// this.form.controls['fees'].setValue([])
this.form.controls['fees'].setValue(this.fees)
this.clicks = 0
this.getSlots()
@ -746,11 +740,11 @@ export class DialogBoxComponent implements OnInit {
if (res.status == 200) {
let appoinmentsList = res.data;
let id = localStorage.getItem('user_id')
// console.log(id)
// console.log(appoinmentsList)
console.log(id)
console.log(appoinmentsList)
let filter = appoinmentsList.filter(arr=>{return arr["ServicesMapDetail.userId"]
== id})
// console.log(filter)
console.log(filter)
filter.forEach(element => {
this.appoinmentsIds.push( element.customer[0].id)
});
@ -763,15 +757,15 @@ export class DialogBoxComponent implements OnInit {
this._cus.getCustomersListDetails(param).subscribe(res => {
if (res.status == 200) {
this.customersList = res.data;
// console.log(this.customersList,this.appoinmentsIds)
console.log(this.customersList,this.appoinmentsIds)
let user_role = localStorage.getItem('user_role');
if(user_role == 'PRACTITIONER'){
const activeIds = this.appoinmentsIds
const serviceList = this.customersList
// console.log(activeIds,serviceList)
console.log(activeIds,serviceList)
const result = serviceList.filter(({id}) => activeIds.includes(id));
// console.log(result)
console.log(result)
this.customersList = result
}
@ -787,7 +781,7 @@ receivedMessageHandler(res){
if(res == 0){
this.customerCard = 0
}else{
// console.log(res)
console.log(res)
this.customersList.push(res.data)
this.customerId = res.data.id
this.form.controls['customer'].setValue( res.data.id);
@ -796,10 +790,10 @@ receivedMessageHandler(res){
}
receiveAutoMsgHandler(p) {
// console.log(p)
console.log(p)
}
customerIdvalue(id){
// console.log(id)
console.log(id)
this.customerId = id
}

View File

@ -21,10 +21,10 @@
<mat-error *ngIf="!form.get('email')?.errors?.required && (form.get('email')?.errors?.pattern)">
Please enter a valid email address
</mat-error>
<mat-error *ngIf="myError('email', 'required')">Email is required</mat-error>
<!-- <mat-error *ngIf="form.get('email')?.invalid && (form.get('email')?.dirty || form.get('email')?.touched) && form.get('email')?.errors?.required">
<mat-error *ngIf="myError('email', 'required')">email is required</mat-error>
<mat-error *ngIf="form.get('email')?.invalid && (form.get('email')?.dirty || form.get('email')?.touched) && form.get('email')?.errors?.required">
Email is required
</mat-error> -->
</mat-error>
<mat-error *ngIf="form.get('email').errors?.usernameTaken && form.get('email').dirty">
Email already exists...
</mat-error>
@ -49,14 +49,12 @@
<mat-select #country
name="country"
id="country"
formControlName="country" noEntriesFoundLabel="'no matching country found'" #singleSelect>
<mat-option>
<ngx-mat-select-search [formControl]="countrySearchCtrl" placeholderLabel="Search Country"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let country of filteredCountries | async" (click)="countryname(country)" [value]="country.name"> {{ country.flag }}&nbsp;&nbsp; {{ country.name }}</mat-option>
formControlName="country">
<mat-option [value]="null">Select Country</mat-option>
<mat-option *ngFor="let country of countries" (click)="countryname(country)" [value]="country.name"> {{ country.flag }}&nbsp;&nbsp; {{ country.name }}</mat-option>
<mat-option value="invalid">Invalid option</mat-option>
</mat-select>
<mat-error *ngIf="form.get('country').hasError('required')">Country is required</mat-error>
<mat-error *ngIf="myError('country', 'required')">Country is required</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" class="mat-pane" *ngIf="action != 'Delete'; else elseTemplate" >
@ -64,29 +62,24 @@
<mat-select #state
name="state"
id="state"
formControlName="state" #singleSelect required>
<mat-option>
<ngx-mat-select-search [formControl]="stateSearchCtrl" placeholderLabel="Search State"></ngx-mat-select-search>
</mat-option>
<!-- <mat-option [value]="null">-- Select Your State --</mat-option> -->
<mat-option *ngFor="let state of filteredStates | async" (click)="statename(state)" [value]="state.name"> {{ state.name }}</mat-option>
formControlName="state">
<mat-option [value]="null">-- Select Your State --</mat-option>
<mat-option *ngFor="let state of states" (click)="statename(state)" [value]="state.name"> {{ state.name }}</mat-option>
<mat-option value="invalid">Invalid option</mat-option>
</mat-select>
<mat-error *ngIf="form.get('state').hasError('required')">Country is required</mat-error>
<mat-error *ngIf="myError('state', 'required')">State is required</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" class="mat-pane" *ngIf="action != 'Delete'; else elseTemplate" >
<mat-label>City</mat-label>
<mat-select #city
name="city"
id="city"
formControlName="city" #singleSelect required>
<mat-option>
<ngx-mat-select-search [formControl]="citySearchCtrl" placeholderLabel="Search City"></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let city of filteredCities | async" (click)="cityname(city)" [value]="city.name"> {{ city.name }}</mat-option>
formControlName="city">
<mat-option [value]="null">-- Select Your City --</mat-option>
<mat-option *ngFor="let city of cities" (click)="cityname(city)" [value]="city.name"> {{ city.name }}</mat-option>
<mat-option value="invalid">Invalid option</mat-option>
</mat-select>
<mat-error *ngIf="form.get('city').hasError('required')">Country is required</mat-error>
<mat-error *ngIf="myError('city', 'required')">City is required</mat-error>
</mat-form-field>
<!-- <mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>State</mat-label>
@ -102,7 +95,7 @@
</mat-form-field> -->
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Type Of Currency</mat-label>
<input placeholder="Type Of Currency" matInput [(ngModel)]="local_data.currency" formControlName="currency" readonly>
<input placeholder="Type Of Currency" matInput [(ngModel)]="local_data.currency" formControlName="currency">
<mat-error *ngIf="myError('currency', 'required')">currency is required</mat-error>
<!-- <mat-error *ngIf="myError('currency', 'maxlength')">Limit exceed</mat-error> -->
</mat-form-field>
@ -117,10 +110,6 @@
<img *ngIf="imageViewStatus == true" class="image mb-2" [src]="url" height="150" width="150"><br/>
<input type='file'accept="image/*" data-max-size="2048" style="width: 50%;" (change)="onSelectFile($event)" formControlName="logo"><br>
<span *ngIf="imageViewStatus != true" class="imgSizeValidation">Upload Below 2MB <br> Supported File (jpg,jpeg and png)</span>
<!-- Add mat-error for logo -->
<mat-error *ngIf="form.get('logo').hasError('required')">Logo is required</mat-error>
<mat-error *ngIf="form.get('logo').hasError('maxSizeExceeded')">File size exceeds 2MB</mat-error>
<!-- Add more error conditions if needed -->
</div>
<div fxFlex.xs="30" fxFlex.sm="30" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" fxLayoutAlign="start end">
<mat-checkbox *ngIf="action != 'Update'" class="example-margin mt-2" formControlName="admin_checked" (change)="showOptions($event)">Add Admin</mat-checkbox>

View File

@ -81,7 +81,7 @@ input[type=file]::file-selector-button {
border: 7px solid #16c1a636;
}
.imgSizeValidation{
color: blue;
color: red;
font-family: Didact Gothic, sans serif;
}
.mat-green:disabled {

View File

@ -9,26 +9,10 @@ import { NotifierService } from 'angular-notifier';
import { environment } from 'environments/environment';
import { map } from 'rxjs/internal/operators/map';
import { Country, State, City } from 'country-state-city';
import { ReplaySubject, Subject } from 'rxjs';
import { MatSelect } from '@angular/material/select';
import { take, takeUntil } from 'rxjs/operators';
export interface UsersData {
name: string;
id: number;
}
export interface countriesName {
name: string;
isoCode: string;
}
export interface statesName {
name: string;
stateCode: string;
}
export interface cityName {
name: string;
cityCode: string;
}
@Component({
selector: 'app-add-business',
@ -59,15 +43,7 @@ export class AddBusinessComponent implements OnInit {
currentFileUpload: any;
countryevent:any=[];
isSubmitting: boolean = false;
private apiUrl = environment.apiEndpoint;
public countrySearchCtrl: FormControl = new FormControl();
public filteredCountries: ReplaySubject<countriesName[]> = new ReplaySubject<countriesName[]>(1);
public stateSearchCtrl: FormControl = new FormControl();
public filteredStates: ReplaySubject<statesName[]> = new ReplaySubject<statesName[]>(1);
public citySearchCtrl: FormControl = new FormControl();
public filteredCities: ReplaySubject<cityName[]> = new ReplaySubject<cityName[]>(1);
protected _onDestroy = new Subject<void>();
@ViewChild('singleSelect') singleSelect: MatSelect;
private apiUrl = environment.apiEndpoint;
constructor(private http: HttpClient,private notifierService: NotifierService,private router: Router,private formBuilder: FormBuilder,
public dialogRef: MatDialogRef<AddBusinessComponent>,
@Optional() @Inject(MAT_DIALOG_DATA) public data: UsersData) {
@ -76,10 +52,6 @@ export class AddBusinessComponent implements OnInit {
console.log(this.local_data)
this.action = this.local_data.action;
this.formData= new FormData();
console.log(this.action)
}
get f(){
return this.form.controls;
@ -170,33 +142,16 @@ export class AddBusinessComponent implements OnInit {
this.dialogRef.close();
}
ngOnInit() {
console.log(this.countries)
// this.filteredCountryList.next(this.countries.slice());
this.filteredCountries.next(this.countries.slice());
// listen for search field value changes
this.countrySearchCtrl.valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(() => {
this.filterCountries();
});
// if(this.countries.length != 0){
// }
// let valData;
// if(this.action == 'Add'){
// valData= [this.validateUsernameAvailability.bind(this)]
// }else{
// valData = null
// }
let valData = [this.validateUsernameAvailability.bind(this)]
let valData;
if(this.action == 'Add'){
valData= [this.validateUsernameAvailability.bind(this)]
}else{
valData = null
}
let userrole = localStorage.getItem('user_role')
this.form = new FormGroup({
admin_checked: new FormControl('',null),
logo: new FormControl('', [Validators.required]),
logo: new FormControl('', null),
busName: new FormControl('', [Validators.required]),
address: new FormControl('', [Validators.required, Validators.maxLength(100)]),
city: new FormControl('', [Validators.required]),
@ -261,7 +216,6 @@ export class AddBusinessComponent implements OnInit {
this.form.patchValue(this.local_data)
// this.filterList()
}
public myError = (controlName: string, errorName: string) =>{
@ -272,24 +226,13 @@ export class AddBusinessComponent implements OnInit {
return this.http.get<any[]>(this.apiUrl + "businessDetailList")
.pipe(
map((response:any) => {
let apiList
if(this.action == 'Add'){
console.log('add')
apiList = response.data
}else{
console.log('edit',this.local_data.busId)
let listData = response.data
const newArray = listData.filter(item => item.busId !== this.local_data.busId);
console.log(newArray)
apiList = newArray
}
// console.log(response)
let response1 = apiList
console.log(response)
let response1 = response.data
let tmp=[];
if(response1 instanceof Array){
apiList.forEach(element => {
response.data.forEach(element => {
tmp.push(element.email)
});
console.log(tmp,`${control.value}`);
@ -306,15 +249,9 @@ export class AddBusinessComponent implements OnInit {
let tmp = this.form.value
tmp.id = this.local_data.id
console.log(tmp,this.form)
if(this.action == 'Update'){
this.form.controls['admin_checked'].clearValidators();
this.form.controls['admin_checked'].updateValueAndValidity();
console.log(this.form.value)
}
if (!this.form.valid) {
console.log("check")
this.notifierService.notify('warning', 'Please fill all the fields');
return;
}
this.isSubmitting = true
@ -352,20 +289,9 @@ export class AddBusinessComponent implements OnInit {
this.countryevent = country
this.states = State.getStatesOfCountry(country.isoCode);
console.log(country)
console.log(this.states)
this.filteredStates.next(this.states.slice());
this.stateSearchCtrl.valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(() => {
this.filterStates();
});
this.form.controls['currency'].setValue(country.currency)
this.selectedCountry = country;
// if(this.action == 'Update'){
this.form.controls['state'].setValue('')
this.form.controls['city'].setValue('')
// }
this.cities = this.selectedState = this.selectedCity = null;
}
@ -373,15 +299,8 @@ export class AddBusinessComponent implements OnInit {
// console.log($event,$event.value)
this.cities = City.getCitiesOfState( this.countryevent.isoCode, state.isoCode)
console.log(this.cities)
this.filteredCities.next(this.cities.slice());
this.citySearchCtrl.valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(() => {
this.filterCity();
});
this.selectedState = state;
this.selectedState = state;
// this.selectedCity = null;
this.form.controls['city'].setValue('')
}
cityname(city){
@ -389,103 +308,4 @@ export class AddBusinessComponent implements OnInit {
this.selectedCity = city
}
// filterList() {
// console.log(this.countries)
// this.countrySearchCtrl.valueChanges.pipe().subscribe(()=>{
// this.applyFilter(this.countrySearchCtrl.value,this.filteredCountryList,this.countries,'name')
// })
// this.stateSearchCtrl.valueChanges.pipe().subscribe(()=>{
// this.applyFilter(this.stateSearchCtrl.value,this.filteredStateList,this.states.name,'name')
// })
// // this.branchFilterCtrl.valueChanges.pipe().subscribe(()=>{
// // this.applyFilter(this.branchFilterCtrl.value,this.filteredBranchList,this.lenderBranchList,'branch_name')
// // })
// }
// applyFilter(filtered_text,filter_list,raw_list,obj_name) {
// if (!raw_list) {
// return;
// }
// // get the search keyword
// let search = filtered_text;
// if (!search) {
// filter_list.next(raw_list.slice());
// return;
// } else {
// search = search.toLowerCase();
// }
// // filter the banks
// filter_list.next(
// raw_list.filter(bank => bank[obj_name].toLowerCase().indexOf(search) > -1)
// );
// }
/**
* Sets the initial value after the filteredCountries are loaded initially
*/
protected setInitialValue() {
this.filteredCountries.pipe(take(1),takeUntil(this._onDestroy)).subscribe(() => {
this.singleSelect.compareWith = (a:countriesName, b: countriesName) => a && b && a.isoCode === b.isoCode;
});
this.filteredStates.pipe(take(1),takeUntil(this._onDestroy)).subscribe(() => {
this.singleSelect.compareWith = (a:statesName, b: statesName) => a && b && a.stateCode === b.stateCode;
});
this.filteredCities.pipe(take(1),takeUntil(this._onDestroy)).subscribe(() => {
this.singleSelect.compareWith = (a:cityName, b: cityName) => a && b && a.cityCode === b.cityCode;
});
}
protected filterCountries() {
if (!this.countries) {
return;
}
// get the search keyword
let search = this.countrySearchCtrl.value;
if (!search) {
this.filteredCountries.next(this.countries.slice());
return;
} else {
search = search.toLowerCase();
}
// filter the banks
this.filteredCountries.next(this.countries.filter(val => val.name.toLowerCase().indexOf(search) > -1)
);
}
protected filterStates(){
if (!this.states) {
return;
}
// get the search keyword
let search = this.stateSearchCtrl.value;
if (!search) {
this.filteredStates.next(this.states.slice());
return;
} else {
search = search.toLowerCase();
}
// filter the banks
this.filteredStates.next(this.states.filter(val => val.name.toLowerCase().indexOf(search) > -1)
);
}
protected filterCity(){
if (!this.cities) {
return;
}
// get the search keyword
let search = this.citySearchCtrl.value;
if (!search) {
this.filteredCities.next(this.cities.slice());
return;
} else {
search = search.toLowerCase();
}
// filter the banks
this.filteredCities.next(this.cities.filter(val => val.name.toLowerCase().indexOf(search) > -1)
);
}
}

View File

@ -101,13 +101,10 @@
</mat-expansion-panel> -->
</mat-accordion>
<!-- Show "No Data Available" or "No matching data found" text -->
<mat-card-content *ngIf="recordStatus && businessListSource.filteredData.length === 0">
<h5 align="center" style="font-weight: bold; color: brown;">No Data Available</h5>
</mat-card-content>
<mat-card-content *ngIf="!recordStatus && businessListSource.filteredData.length === 0">
<h5 align="center" style="font-weight: bold; color: brown;">No matching data found</h5>
</mat-card-content>
<mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold;
color: brown;">No Data Available</h5>
</mat-card-content>
</div>
</div>
</div>

View File

@ -54,11 +54,6 @@ export class BusinessListComponent implements OnInit {
filterValue = filterValue.trim(); // Remove whitespace
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
this.businessListSource.filter = filterValue;
this.checkRecordStatus();
}
checkRecordStatus() {
this.recordStatus = this.businessListSource.filteredData.length === 0;
}
isactive(value: any) {
@ -132,7 +127,6 @@ export class BusinessListComponent implements OnInit {
}
console.log(this.businessListSource)
// this.recordStatus=false;
this.checkRecordStatus();
}
else{
this.isLoading = false
@ -140,7 +134,6 @@ export class BusinessListComponent implements OnInit {
this.businessList=[];
this.businessListLength= null;
this.recordStatus=true;
this.checkRecordStatus();
}
}, error => this.isLoading = false);
}

View File

@ -10,8 +10,6 @@ import { DemoMaterialModule } from 'app/shared/demo.module';
import { NgScrollbarModule } from 'ngx-scrollbar';
import { AddBusinessComponent } from './add-business/add-business.component';
import { NotifierModule, NotifierOptions } from 'angular-notifier';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import { ReactiveFormsModule } from '@angular/forms';
const customNotifierOptions: NotifierOptions = {
@ -62,7 +60,6 @@ const customNotifierOptions: NotifierOptions = {
],
imports: [
ReactiveFormsModule,
DemoMaterialModule,
CommonModule,
BusinessRoutingModule,
@ -71,7 +68,6 @@ const customNotifierOptions: NotifierOptions = {
ScrollingModule,
NgScrollbarModule,
NotifierModule.withConfig(customNotifierOptions),
NgxMatSelectSearchModule
]
})
export class BusinessModule { }

View File

@ -7,14 +7,12 @@
<div mat-dialog-content class="my-table">
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Name</mat-label>
<input placeholder=" Name" matInput formControlName="cusName">
<mat-error *ngIf="myError('cusName', 'required')">Name is required</mat-error>
<mat-error *ngIf="myError('cusName', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Email</mat-label>
<input type="email" placeholder=" Email" matInput [(ngModel)]="local_data.email" formControlName="email">
<mat-error *ngIf="!form.get('email')?.errors?.required && (form.get('email')?.errors?.pattern)">
Please enter a valid email address
@ -25,34 +23,29 @@
</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Mobile No</mat-label>
<input placeholder="Mobile No" type="text" appMobileNumberPattern maxlength="10" minlength="10" matInput [(ngModel)]="local_data.phoneNo" formControlName="phoneNo">
<input placeholder=" Mobile No" type="text" appMobileNumberPattern maxlength="10" minlength="10" matInput [(ngModel)]="local_data.phoneNo" formControlName="phoneNo">
<mat-error *ngIf="myError('phoneNo', 'required')">Contact No is required</mat-error>
<mat-error *ngIf="myError('phoneNo', 'pattern')">Invalid Contact No </mat-error>
<mat-error *ngIf="myError('phoneNo', 'minlength')"> Contact No must be at least 10 characters</mat-error>
<mat-error *ngIf="myError('phoneNo', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Address</mat-label>
<input placeholder="Address" matInput [(ngModel)]="local_data.address_1" formControlName="address_1">
<input placeholder=" Address" matInput [(ngModel)]="local_data.address_1" formControlName="address_1">
<mat-error *ngIf="myError('address_1', 'required')">Address is required</mat-error>
<mat-error *ngIf="myError('address_1', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>State</mat-label>
<input placeholder="State" matInput [(ngModel)]="local_data.state" formControlName="state">
<input placeholder=" State" matInput [(ngModel)]="local_data.state" formControlName="state">
<mat-error *ngIf="myError('state', 'required')">State is required</mat-error>
<mat-error *ngIf="myError('state', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>City</mat-label>
<input placeholder="City" matInput [(ngModel)]="local_data.city" formControlName="city">
<input placeholder=" City" matInput [(ngModel)]="local_data.city" formControlName="city">
<mat-error *ngIf="myError('city', 'required')">City is required</mat-error>
<mat-error *ngIf="myError('city', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Pincode</mat-label>
<input placeholder="Pincode" matInput [(ngModel)]="local_data.pincode" formControlName="pincode">
<input placeholder=" Pincode" matInput [(ngModel)]="local_data.pincode" formControlName="pincode">
<mat-error *ngIf="myError('pincode', 'required')">Pincode is required</mat-error>
<mat-error *ngIf="myError('pincode', 'maxlength')">Limit exceed</mat-error>
</mat-form-field>

View File

@ -21,7 +21,7 @@
</mat-form-field> -->
<mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<mat-label>Duration</mat-label>
<input appMobileNumberPattern placeholder="Duration" matInput formControlName="duration" required>
<input appMobileNumberPattern placeholder="Fees" matInput formControlName="duration" required>
<div matSuffix>
<span><b>Mins</b></span>
</div>

View File

@ -56,10 +56,9 @@
<mat-error *ngIf="!form.get('email')?.errors?.required && (form.get('email')?.errors?.pattern)">
Please enter a valid email address
</mat-error>
<mat-error *ngIf="myError('email', 'required')">Email is required</mat-error>
<!-- <mat-error *ngIf="form.get('email')?.invalid && (form.get('email')?.dirty || form.get('email')?.touched) && form.get('email')?.errors?.required">
<mat-error *ngIf="form.get('email')?.invalid && (form.get('email')?.dirty || form.get('email')?.touched) && form.get('email')?.errors?.required">
Email is required
</mat-error> -->
</mat-error>
<mat-error *ngIf="form.get('email').errors?.usernameTaken && form.get('email').dirty">
Email already exists...
</mat-error>
@ -96,10 +95,6 @@
<img *ngIf="imageViewStatus == true" class="image mb-2" [src]="url" height="150" width="150"><br/>
<input type='file'accept="image/*" data-max-size="2048" style="width: 33%;" (change)="onSelectFile($event)" formControlName="logo"><br>
<span *ngIf="imageViewStatus != true" class="imgSizeValidation">Upload Below 2MB <br> Supported File (jpg,jpeg and png)</span>
<!-- Add mat-error for logo -->
<mat-error *ngIf="form.get('logo').hasError('required')">Logo is required</mat-error>
<mat-error *ngIf="form.get('logo').hasError('maxSizeExceeded')">File size exceeds 2MB</mat-error>
<!-- Add more error conditions if needed -->
<!-- <mat-form-field appearance="outline" *ngIf="action != 'Delete'; else elseTemplate" class="mat-pane">
<input placeholder="ConfirmPassword" matInput formControlName="confirmPassword">
<mat-error *ngIf="myError('confirmPassword', 'required')">confirmPassword is required</mat-error>

View File

@ -57,7 +57,7 @@ input[type=file]::file-selector-button {
border: 7px solid #16c1a636;
}
.imgSizeValidation{
color: blue;
color: red;
font-family: Didact Gothic, sans serif;
}
.user-mate{

View File

@ -58,13 +58,12 @@ export class AddUserComponent implements OnInit {
ngOnInit() {
// let valData;
// if(this.action == 'Add'){
// valData= [this.validateUsernameAvailability.bind(this)]
// }else{
// valData = null
// }
let valData = [this.validateUsernameAvailability.bind(this)]
let valData;
if(this.action == 'Add'){
valData= [this.validateUsernameAvailability.bind(this)]
}else{
valData = null
}
this.hide = true;
this.disableBus = localStorage.getItem('go_admin')
this.userrole = localStorage.getItem('user_role')
@ -82,7 +81,7 @@ export class AddUserComponent implements OnInit {
password: new FormControl('', [Validators.required,Validators.pattern(
'^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*_=+-]).{8,16}$'
)]),
logo: new FormControl('', [Validators.required]),
logo: new FormControl('', null),
// confirmPassword: new FormControl('', [Validators.required, Validators.minLength(6)]),
createdBy:new FormControl(this.userrole,null),
});
@ -124,7 +123,7 @@ export class AddUserComponent implements OnInit {
// console.log(this.action,this.local_data)
// }
validateUsernameAvailability(control: FormControl) {
let userRole = localStorage.getItem('user_role')
@ -137,31 +136,20 @@ export class AddUserComponent implements OnInit {
return this.http.post<any[]>(this.apiUrl + "getusers",param)
.pipe(
map((response:any) => {
console.log(response)
let apiList
if(this.action == 'Add'){
console.log('add')
apiList = response.data
}else{
console.log('edit',this.local_data.id)
let listData = response.data
const newArray = listData.filter(item => item.id !== this.local_data.id);
console.log(newArray)
apiList = newArray
}
console.log(response)
let response1 = apiList
let response1 = response.data
let tmp=[];
if(response1 instanceof Array){
apiList.forEach(element => {
tmp.push(element.email)
});
console.log(tmp,`${control.value}`);
return !tmp.includes(`${control.value}`) ? null : { usernameTaken: true };
}else{
return null
}
if(response1 instanceof Array){
response.data.forEach(element => {
tmp.push(element.email)
});
console.log(tmp,`${control.value}`);
return !tmp.includes(`${control.value}`) ? null : { usernameTaken: true };
}else{
return null
}
})
);
}
@ -231,7 +219,6 @@ export class AddUserComponent implements OnInit {
this.form.controls['password'].updateValueAndValidity();
}
if (!this.form.valid) {
this.notifierService.notify('warning', 'Please fill all the fields');
return;
}
this.isSubmitting = true

View File

@ -149,12 +149,10 @@
</mat-expansion-panel> -->
</mat-accordion>
<mat-card-content *ngIf="recordStatus && usersList.filteredData.length === 0">
<h5 align="center" style="font-weight: bold; color: brown;">No Data Available</h5>
</mat-card-content>
<mat-card-content *ngIf="!recordStatus && usersList.filteredData.length === 0">
<h5 align="center" style="font-weight: bold; color: brown;">No matching data found</h5>
</mat-card-content>
<mat-card-content *ngIf="recordStatus">
<h5 align="center" style="font-weight: bold;
color: brown;">No Data Available</h5>
</mat-card-content>
</div>
</div>
</div>

View File

@ -97,12 +97,7 @@ export class UserListComponent implements OnInit {
this.usersList.filter = filterValue;
console.log(this.usersList)
this.checkRecordStatus();
}
checkRecordStatus() {
this.recordStatus = this.usersList.filteredData.length === 0;
}
}
isactive(value: any) {
console.log(value)

View File

@ -1,41 +1,8 @@
<ng-scrollbar class="scrollHV" *ngIf="user_role != 'PRACTITIONER'">
<ng-scrollbar class="scrollHV">
<div fxLayout="row wrap">
<div fxFlex.gt-sm="33.33%" fxFlex="100" class="m-gap p-gap">
<mat-card class="mat_height" style="background:#3abba3;color: #fff;">
<mat-card-content style="padding: 0;">
<div fxLayout="row wrap" style="padding: 10px;">
<div fxFlex.xs="13" fxFlex.sm="13" fxFlex.md="13" fxFlex.lg="13" fxFlex.xl="13" class="p-gap">
<mat-icon>calendar_today</mat-icon>
</div>
<div fxFlex.xs="87" fxFlex.sm="87" fxFlex.md="87" fxFlex.lg="87" fxFlex.xl="87" class="p-gap">
<h5 style="margin: 0;">Appointment</h5>
</div>
</div>
<hr>
<div fxLayout="row" style="padding: 10px;color: #3abba3;background-color: #fff;">
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" fxLayoutAlign="center center" class="p-gap" style=" border-right: 1px solid rgba(0, 0, 0, 0.12);display: block !important;">
<div class="card-block text-center">
<div class="row">
<div>
<h2>{{count.today_appoinments_count}}</h2>
<p class="text-muted">Today</p>
</div>
</div>
</div>
</div>
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" fxLayoutAlign="center center" class="p-gap">
<div class="card-block text-center">
<div class="row">
<div>
<h2>{{count.monthly_appoinments_count}}</h2>
<p class="text-muted">Monthly</p>
</div>
</div>
</div>
</div>
</div>
</mat-card-content>
<!-- <div fxLayout="row wrap" class="inside_height">
<mat-card class="mat_height">
<div fxLayout="row wrap" class="inside_height">
<div fxFlex.gt-sm="50%" fxLayoutAlign="center center" fxFlex="100" class="m-gap p-gap mb-0 grad-blue icon-tp">
<div class="text-center">
<mat-icon>calendar_today</mat-icon>
@ -59,47 +26,11 @@
</div>
</div>
</div>
</div> -->
</div>
</mat-card>
</div>
<div fxFlex.gt-sm="33.33%" fxFlex="100" class="m-gap p-gap">
<mat-card class="mat_height" style="background: cadetblue;color: #fff;">
<mat-card-content style="padding: 0;">
<div fxLayout="row wrap" class="" style="padding: 10px;">
<div fxFlex.xs="13" fxFlex.sm="13" fxFlex.md="13" fxFlex.lg="13" fxFlex.xl="13" class="p-gap">
<!-- <mat-icon class="mat-icon-size" aria-hidden="true">money</mat-icon> -->
<img src="assets/images/money.png" style="height: 32px !important;max-width: 32px !important;">
</div>
<div fxFlex.xs="87" fxFlex.sm="87" fxFlex.md="87" fxFlex.lg="87" fxFlex.xl="87" class="p-gap">
<h5 style="margin: 0;">Revenue</h5>
</div>
</div>
<hr>
<div fxLayout="row" style="padding: 10px;color: cadetblue;background-color: #fff;">
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" fxLayoutAlign="center center" class="p-gap" style=" border-right: 1px solid rgba(0, 0, 0, 0.12);display: block !important;">
<div class="card-block text-center">
<div class="row">
<div>
<h2>{{count.today_earning_count | currency:currency:true:'2.0'}}</h2>
<p class="text-muted">Today</p>
</div>
</div>
</div>
</div>
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" fxLayoutAlign="center center" class="p-gap">
<div class="card-block text-center">
<div class="row">
<div>
<h2>{{count.monthly_earning_count | currency:currency:true:'2.0'}}</h2>
<p class="text-muted">Monthly</p>
</div>
</div>
</div>
</div>
</div>
</mat-card-content>
</mat-card>
<!-- <mat-card class="mat_height">
<mat-card class="mat_height">
<div fxLayout="row wrap" class="inside_height">
<div fxFlex.gt-sm="50%" fxLayoutAlign="center center" fxFlex="100" class="m-gap p-gap mb-0 grad-green icon-tp">
<div class="text-center">
@ -125,35 +56,10 @@
</div>
</div>
</div>
</mat-card> -->
</mat-card>
</div>
<div fxFlex.gt-sm="33.33%" fxFlex="100" class="m-gap p-gap">
<mat-card class="mat_height" style="background: darksalmon;color: #fff;">
<mat-card-content style="padding: 0;">
<div fxLayout="row wrap" style="padding: 10px;">
<div fxFlex.xs="13" fxFlex.sm="13" fxFlex.md="13" fxFlex.lg="13" fxFlex.xl="13" class="p-gap">
<mat-icon>supervisor_account</mat-icon>
</div>
<div fxFlex.xs="87" fxFlex.sm="87" fxFlex.md="87" fxFlex.lg="87" fxFlex.xl="87" class="p-gap">
<h5 style="margin: 0;">Customer</h5>
</div>
</div>
<hr>
<div fxLayout="row" style="padding: 10px;color: darksalmon;background-color: #fff;">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" fxLayoutAlign="center center" class="p-gap" style="display: block !important;">
<div class="card-block text-center">
<div class="row">
<div>
<h2>{{count.customer_count}}</h2>
<p class="text-muted">Total</p>
</div>
</div>
</div>
</div>
</div>
</mat-card-content>
</mat-card>
<!-- <mat-card class="mat_height">
<mat-card class="mat_height">
<div fxLayout="row wrap" class="inside_height">
<div fxFlex.gt-sm="50%" fxLayoutAlign="center center" fxFlex="100" class="m-gap p-gap mb-0 grad-red icon-tp">
<div class="text-center">
@ -174,7 +80,7 @@
</div>
</div>
</div>
</mat-card> -->
</mat-card>
</div>
</div>
<!-- <div fxLayout="row wrap">
@ -390,74 +296,168 @@
</div>
</div> -->
</ng-scrollbar>
<!-- <ng-scrollbar class="scrollHV" *ngIf="user_role == 'PRACTITIONER'"> -->
<section *ngIf="user_role == 'PRACTITIONER'" >
<!-- <section>
<h3>Appointments</h3>
<div class="services-grid">
<div class="service service2">
<h4>Today</h4>
<ng-scrollbar class="scrollHV service" *ngIf="user_role == 'PRACTITIONER'">
<mat-card *ngFor="let appoinment of appoinmentsListToday; index as i;" (click)="goToBookedAppointment(appoinment)">
<div fxLayout="row wrap" style="padding-top: 8px;padding-bottom: 8px;">
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<div style="text-align: start;margin-left: 10px"><span > {{appoinment.customer[0].cusName}}</span></div>
<div style="text-align: start;margin-left: 10px">{{appoinment.customer[0].phoneNo}}</div>
<i class="ti-light-bulb"></i>
<mat-card>
<div fxLayout="row wrap">
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="p-gap">
<div>Gopi</div>
<div>7896541230</div>
</div>
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<div style="text-align: end;margin-right: 7px">{{appoinment.status}}</div>
<div style="text-align: start;margin-right: 7px"> <span ><b>{{appoinment.appoinmentSlots[0] | date:'dd/MM/yyyy h:mm a'}}</b></span></div>
<!-- <div style="text-align: start;margin-left: 10px"> <span ><b>{{appoinment.appoinmentSlots[0] | date:'h:mm a'}}</b></span></div> -->
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="p-gap">
<div>30/12/2023, 3:00pm</div>
<div>Status</div>
</div>
</div>
</mat-card>
</ng-scrollbar>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
</div>
<div class="service service2">
<h4>Tomorrow</h4>
<ng-scrollbar class="scrollHV service" >
<mat-card *ngFor="let appoinment of appoinmentsListTomorrow; index as i;" (click)="goToBookedAppointment(appoinment)">
<div fxLayout="row wrap" style="padding-top: 8px;padding-bottom: 8px;">
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<div style="text-align: start;margin-left: 10px"><span > {{appoinment.customer[0].cusName}}</span></div>
<div style="text-align: start;margin-left: 10px">{{appoinment.customer[0].phoneNo}}</div>
</div>
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<div style="text-align: end;margin-right: 7px">{{appoinment.status}}</div>
<div style="text-align: start;margin-right: 7px"> <span ><b>{{appoinment.appoinmentSlots[0] | date:'dd/MM/yyyy h:mm a'}}</b></span></div>
<!-- <div style="text-align: start;margin-left: 10px"> <span ><b>{{appoinment.appoinmentSlots[0] | date:'h:mm a'}}</b></span></div> -->
</div>
</div>
<i class="ti-light-bulb"></i>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
</ng-scrollbar>
</div>
<div class="service service2">
<h4>Later</h4>
<ng-scrollbar class="scrollHV service">
<mat-card *ngFor="let appoinment of appoinmentsListLater; index as i;" (click)="goToBookedAppointment(appoinment)">
<div fxLayout="row wrap" style="padding-top: 8px;padding-bottom: 8px;">
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<div style="text-align: start;margin-left: 10px"><span > {{appoinment.customer[0].cusName}}</span></div>
<div style="text-align: start;margin-left: 10px">{{appoinment.customer[0].phoneNo}}</div>
</div>
<div fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<div style="text-align: end;margin-right: 3px">{{appoinment.status}}</div>
<div style="text-align: start;"> <span ><b>{{appoinment.appoinmentSlots[0] | date:'dd/MM/yyyy h:mm a'}}</b></span></div>
<!-- <div style="text-align: start;margin-left: 10px"> <span ><b>{{appoinment.appoinmentSlots[0] | date:'h:mm a'}}</b></span></div> -->
</div>
</div>
<div class="service service3">
<i class="ti-money"></i>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
<mat-card>
<div>
<p>hello</p>
</div>
</mat-card>
</ng-scrollbar>
</div>
</div>
</section>
</section> -->
<!-- </ng-scrollbar> -->
</ng-scrollbar>

View File

@ -544,7 +544,7 @@ mat-icon{
height: unset !important;
// width: 0px !important;
align-self: center !important;
font-size: 2em !important;
font-size: 3em !important;
width: unset !important;
}
@ -669,9 +669,9 @@ h3 {
}
.service {
background: #f1f1f1;
margin: 10px;
// padding: 20px;
background: #fff;
margin: 20px;
padding: 20px;
border-radius: 4px;
text-align: center;
-webkit-box-flex: 1;
@ -765,10 +765,5 @@ h3 {
display: flex;
align-items: center;
}
section mat-card{
background: linear-gradient(58deg, #009688, #673ab7);
color: #fff;
border-radius: 4px 4px;
font-size: 14px;
}

View File

@ -5,8 +5,6 @@ import { MatIconRegistry } from '@angular/material/icon';
import { DomSanitizer } from '@angular/platform-browser';
import * as moment from 'moment';
import { CurrencyPipe, DatePipe } from '@angular/common';
import { AppointmentsService } from 'app/appoinment/appoinments/appointments-service/appointments.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
@ -15,7 +13,7 @@ import { Router } from '@angular/router';
})
export class DashboardComponent {
private currencyPipe1:CurrencyPipe
public single: any[];
public multi: any[];
public showXAxis = true;
@ -326,20 +324,14 @@ messages: Object[] = [{
]
};
selectedDateRange: {startDate: moment.Moment, endDate: moment.Moment};
currentDate: any;
currentDate: Date;
lineChart: any = [];
user_role: any;
currency: any = 'INR';
countAndRevenue: boolean = false;
currencyHtmlCode: any;
startof30days: any;
appoinmentsList:any =[];
appointmentListLength:any =[]
appoinmentsListToday:any=[];
appoinmentsListTomorrow:any =[];
appoinmentsListLater:any =[];
constructor(private router:Router,public _app:AppointmentsService,private currencySymbol: CurrencyPipe,public _dash:DashboardService,private matIconRegistry: MatIconRegistry,private domSanitizer: DomSanitizer) {
constructor(private currencySymbol: CurrencyPipe,public _dash:DashboardService,private matIconRegistry: MatIconRegistry,private domSanitizer: DomSanitizer) {
// this.fetch((data) => { this.rows = data; });
Object.assign(this, {single, multi})
this.matIconRegistry.addSvgIcon(
@ -362,36 +354,16 @@ messages: Object[] = [{
let user_role = localStorage.getItem('user_role')
let param
if(user_role == 'PRACTITIONER'){
this.getAppoinmentsList()
param = {'user_id':localStorage.getItem('user_id'),'busId':localStorage.getItem('busId')}
}else{
param = {'busId':localStorage.getItem('busId')}
}
this.getCount(param)
// Get the current date
this.currentDate = new Date();
// Create an array to store the dates
const dates: Date[] = [];
// Loop through the last 30 days
for (let i = 30; i >= 0; i--) {
const date = new Date();
date.setDate(this.currentDate.getDate() - i);
dates.push(date);
}
// Output the dates
console.log(dates);
//Start Line Chart
// this.currentDate = new Date();
this.startof30days = dates[0]
console.log(this.startof30days,this.currentDate)
let startDate = new DatePipe('en-US').transform(this.startof30days, 'yyyy-MM-dd')
this.currentDate = new Date();
let startDate = new DatePipe('en-US').transform(this.currentDate, 'yyyy-MM-dd')
let EndDate = new DatePipe('en-US').transform(this.currentDate, 'yyyy-MM-dd')
console.log(startDate,EndDate);
let lineParams
@ -419,7 +391,7 @@ messages: Object[] = [{
this.count = res['data']
this.currentDate = new Date();
let startDate = new DatePipe('en-US').transform(this.startof30days, 'yyyy-MM-dd')
let startDate = new DatePipe('en-US').transform(this.currentDate, 'yyyy-MM-dd')
let EndDate = new DatePipe('en-US').transform(this.currentDate, 'yyyy-MM-dd')
console.log(startDate,EndDate);
let user_role = localStorage.getItem('user_role')
@ -649,7 +621,7 @@ messages: Object[] = [{
//Start Line Chart
let lineParams
if(user_role != 'PRACTITIONER'){
if(user_role == 'BIZADMIN'){
lineParams = {'busId':localStorage.getItem('busId'),'fromDate':startDate,'toDate':EndDate}
}
this.getLineChartData(lineParams)
@ -680,71 +652,4 @@ messages: Object[] = [{
return spanElement.innerHTML;
}
getAppoinmentsList() {
this.appoinmentsList=[]
let user_role = localStorage.getItem('user_role');
let param = {"busId": localStorage.getItem('busId'),"userId":localStorage.getItem('user_id')}
console.log(param)
this._app.getAppoinmentsListDetails(param).subscribe(res => {
if (res.status == 200) {
this.appoinmentsList = res.data;
this.appoinmentsList.forEach(element => {
console.log(element)
element.appoinmentSlots = JSON.parse(element.appoinmentSlots)
});
var startDate:any = new Date();
startDate = startDate.toISOString().slice(0, 10);
this.appoinmentsList.forEach(element => {
if(element.appoinmentDate == startDate){
this.appoinmentsListToday.push(element)
}
});
// this.appoinmentsListToday = this.appoinmentsList.filter(val => val.appoinmentDate == startDate )
// this.appoinmentsList = appoinmentsListToday
localStorage.setItem('busId', res.data[0].busId
)
var startDate1:any = new Date();
startDate1.setDate(startDate1.getDate() + 1);
let Tomorrow = startDate1.toISOString().slice(0, 10)
console.log(Tomorrow)
this.appoinmentsList.forEach(element => {
if(element.appoinmentDate == Tomorrow){
this.appoinmentsListTomorrow.push(element)
}
});
this.appoinmentsList.forEach(element => {
if(element.appoinmentDate != Tomorrow && element.appoinmentDate != startDate ){
this.appoinmentsListLater.push(element)
}
});
console.log(this.appoinmentsListLater)
// this.appoinmentsListTomorrow= this.appoinmentsList.filter(val => val.appoinmentDate == Yesterday )
this.appointmentListLength = res.data.length;
console.log(this.appointmentListLength)
}
})
}
goToBookedAppointment(params){
console.log(params)
localStorage.setItem('go_appointment','0');
localStorage.setItem('go_appointment_data',JSON.stringify(params))
// this._dash.passAppointmentDetails.next(params)
this.router.navigate(['/appointments'])
// this.router.navigate(['/appointments', params])
}
}

View File

@ -1,17 +1,13 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from 'environments/environment';
import { BehaviorSubject, Observable } from 'rxjs';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class DashboardService {
private apiUrl = environment.apiEndpoint;
public passAppointmentDetails:BehaviorSubject<any> = new BehaviorSubject<any>([]);
public passAppointmentDetails_observable$ = this.passAppointmentDetails.asObservable();
constructor(private _http: HttpClient) { }
// generateotp(email): Observable<any> {

View File

@ -23,7 +23,7 @@
<div style=" text-align: center;">
<h3 >Your appointment has been successfully Booked.</h3>
<h3 >Your appointment has been successfully Booked On.</h3>
<p style="color:rgb(13, 218, 13)">
Thank You..! Your order status is {{resPayment.response_message}}.
@ -163,6 +163,6 @@
</div>
<footer>
<p>
All Rights Reserved
© 2023 Venba Information Technology Pvt Ltd. All Rights Reserved
</p>
</footer>

View File

@ -57,7 +57,6 @@ mat-toolbar{
}
footer {
text-align: center;
background-color: #d1d1d1;
height:50px;
width: 100%;

View File

@ -4,7 +4,6 @@ import { Router } from '@angular/router';
import * as html2pdf from 'html2pdf.js'
import { environment } from 'environments/environment';
import { format } from 'date-fns';
import { local } from 'd3';
@ -29,26 +28,20 @@ export class BookingSummaryComponent implements OnInit {
constructor(public end_user:EndUserService,private router:Router,) {
this.logo = localStorage.getItem('logo')
this.busName = localStorage.getItem('busName')
let clickSummaryDetails = localStorage.getItem('goToFirstFirst')
if(clickSummaryDetails == '1'){
this.backRedireact()
} else{
localStorage.setItem('goToFirstFirst','1')
}
// this.end_user.bookedDetails_observable$.subscribe((res) => {
// console.log('booked2', res);
// if(res instanceof Array){
this.end_user.bookedDetails_observable$.subscribe((res) => {
console.log('booked2', res);
// if(res.length == 0){
// this.backRedireact()
// }
if(res instanceof Array){
if(res.length == 0){
// this.backRedireact()
}
// }
}
// })
})
this.end_user.summmarylist_observable$.subscribe((res) => {
console.log('booked', res);
if(res.length>0){
@ -108,14 +101,14 @@ export class BookingSummaryComponent implements OnInit {
// console.log(res)
// let serviceMap = res['data'][0].id
// let time = new Date().toLocaleTimeString()
// let param= {
// "busId": serviceDetails.busId,
// "cusId": appointmentId,
// "appoinmentDate": slot_array[0].date,
// "userId": serviceDetails.userId,
// "appoinmentSlots": JSON.stringify(slot_array[0].slots)
// //"servicemap" :this.bookedAppointment_servicemap
// }
// let param= {
// "busId": serviceDetails.busId,
// "cusId": cusID,
// "appoinmentDate": slot_array[0].date,
// "userId": serviceDetails.userId,
// "appoinmentSlots": JSON.stringify(slot_array[0].slots)
// //"servicemap" :this.bookedAppointment_servicemap
// }
let param =paramPay
console.log(param)
@ -234,7 +227,6 @@ export class BookingSummaryComponent implements OnInit {
}
Summaryhide(){
this.summary = true;
localStorage.setItem('goToFirstFirst','1')
}
download(){

View File

@ -101,7 +101,7 @@
</div>
<footer>
<p>
All Rights Reserved
© 2023 Venba Information Technology Pvt Ltd. All Rights Reserved
</p>
</footer>

View File

@ -208,7 +208,6 @@ mat-toolbar{
background-color: #f7f8f5 !important;
}
footer {
text-align: center;
background-color: #d1d1d1;
height:50px;
width: 100%;

View File

@ -286,7 +286,7 @@
</ng-scrollbar>
<footer>
<p>
All Rights Reserved
© 2023 Venba Information Technology Pvt Ltd. All Rights Reserved
</p>
</footer>

View File

@ -154,7 +154,6 @@ mat-toolbar{
}
footer {
text-align: center;
background-color: #d1d1d1;
height:50px;
width: 100%;

View File

@ -68,8 +68,7 @@ export class CustomerInfoComponent implements OnInit {
}
ngOnInit() {
localStorage.setItem('goToFirstFirst','0')
console.log(localStorage.getItem('goToFirstFirst'))
if (performance.navigation.type === 1) {
console.log(0)
// This condition checks if the page is refreshed
@ -476,7 +475,7 @@ this.paymentform = payment;
onclickfun(){
if(this.verifyOTP == 0){
this.getOTP(1)
}
@ -593,7 +592,7 @@ let paramsmap= {
currency: 'INR',
country: 'IND',
udf1: ''+busId+'',
udf2: ''+window.location.origin+'/appointment/#'+URL+'/',
udf2: ''+window.location.origin+'/#'+URL+'/',
udf3: ''+cusID+'',
udf4: ''+appointmentId+'',
udf5: ''
@ -637,9 +636,9 @@ this._cus.paymentRequest(this.form.value ).subscribe(res => {
})
}
// ngOnDestroy(){
// localStorage.clear();
// }
ngOnDestroy(){
localStorage.clear();
}
}

View File

@ -61,7 +61,52 @@
<div class="doctor-profile">
<div fxLayout="row wrap">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" class="m-gap p-gap" >
<div class="doctor_info">
<div class="images">
<img src="{{dp}}" width="100" class="rounded-circle">
</div>
<div class="heading">
<h3>{{bookedAppointment.userName}}</h3>
<a>{{bookedAppointment.practitionerInfos[0].designtion}}</a><br />
<button mat-raised-button (click)="goToSlotBooking()" style="background-color: #e7c953;">Book Appointment</button>
</div>
</div>
<div class="doctor_info">
<h4>PERSONAL INFO</h4>
<ul>
<li>
<span class="pr-1">Phone :</span>
<span> {{bookedAppointment.contactNo}}</span>
</li>
<!-- <li>
<span class="pr-1">Office :</span>
<span> {{bookedAppointment.contactNo}}</span>
</li> -->
<li>
<span class="pr-1">Email:</span>
<span> {{bookedAppointment.email}} </span>
</li>
<li>
<span class="pr-1">Social :</span>
<div class="social-icons">
<a href="#" title="facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a>
<a href="#" title="twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a>
<a href="#" title="google"><i class="fa fa-google" aria-hidden="true"></i></a>
<a href="#" title="youtube"><i class="fa fa-skype" aria-hidden="true"></i></a>
<a href="#" title="linkedin"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
<a href="#" title="printrest"><i class="fa fa-pinterest" aria-hidden="true"></i></a>
</div>
</li>
</ul>
</div>
<!-- <div class="last-of-type ">
<div class="emergency-case ">
<h2>EMERGENCY CASES</h2>
<div>(225) 679-9399</div>
</div>
</div> -->
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="70" fxFlex.lg="70" fxFlex.xl="70" class="m-gap p-gap" >
<div class="padding-lt">
<div class="elementor-container">
@ -103,56 +148,12 @@
</div>
</div>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="30" fxFlex.lg="30" fxFlex.xl="30" class="m-gap p-gap" >
<div class="doctor_info">
<div class="images">
<img src="{{dp}}" width="100" class="rounded-circle">
</div>
<div class="heading">
<h3>{{bookedAppointment.userName}}</h3>
<a>{{bookedAppointment.practitionerInfos[0].designtion}}</a>
<span>{{bookedAppointment.contactNo}}</span><br>
<span>{{bookedAppointment.email}}</span><br />
<button mat-raised-button (click)="goToSlotBooking()" style="background-color: #e7c953;margin-top: 20px;">Book Appointment</button>
</div>
</div>
<!-- <div class="doctor_info">
<h4>PERSONAL INFO</h4>
<ul>
<li>
<span class="pr-1">Phone :</span>
<span> {{bookedAppointment.contactNo}}</span>
</li>
<li>
<span class="pr-1">Email:</span>
<span> {{bookedAppointment.email}} </span>
</li>
<li>
<span class="pr-1">Social :</span>
<div class="social-icons">
<a href="#" title="facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a>
<a href="#" title="twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a>
<a href="#" title="google"><i class="fa fa-google" aria-hidden="true"></i></a>
<a href="#" title="youtube"><i class="fa fa-skype" aria-hidden="true"></i></a>
<a href="#" title="linkedin"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
<a href="#" title="printrest"><i class="fa fa-pinterest" aria-hidden="true"></i></a>
</div>
</li>
</ul>
</div> -->
<!-- <div class="last-of-type ">
<div class="emergency-case ">
<h2>EMERGENCY CASES</h2>
<div>(225) 679-9399</div>
</div>
</div> -->
</div>
</div>
</div>
</ng-scrollbar>
<footer>
<p>
All Rights Reserved
© 2023 Venba Information Technology Pvt Ltd. All Rights Reserved
</p>
</footer>
<!--

View File

@ -306,7 +306,6 @@ mat-toolbar{
color:#fff;
}
footer {
text-align: center;
background-color: #d1d1d1;
height:50px;
width: 100%;

View File

@ -54,7 +54,7 @@
</div>
<footer>
<p>
All Rights Reserved
© 2023 Venba Information Technology Pvt Ltd. All Rights Reserved
</p>
</footer>

View File

@ -50,7 +50,6 @@ mat-toolbar{
display: block !important;
}
footer {
text-align: center;
background-color: #d1d1d1;
height:50px;
width: 100%;

View File

@ -61,7 +61,7 @@
</div>
<footer>
<p>
All Rights Reserved
© 2023 Venba Information Technology Pvt Ltd. All Rights Reserved
</p>
</footer>

View File

@ -139,7 +139,6 @@ mat-toolbar{
margin-right: 5px;
}
footer {
text-align: center;
background-color: #d1d1d1;
height:50px;
width: 100%;

View File

@ -234,7 +234,7 @@
</div>
<footer>
<p>
All Rights Reserved
© 2023 Venba Information Technology Pvt Ltd. All Rights Reserved
</p>
</footer>

View File

@ -270,7 +270,6 @@ p {
}
footer {
text-align: center;
background-color: #d1d1d1;
height:50px;
width: 100%;

View File

@ -28,7 +28,7 @@
</mat-error>
</mat-form-field>
<!-- <button class="mt-2 mb-1" [disabled]="!loginForm.valid" mat-raised-button color="primary" mat-button>Sign In</button> -->
<button class="mt-2 mb-1" mat-raised-button color="primary" [disabled]="!loginForm.valid || isFormEmpty()" mat-button>Sign In</button>
<button class="mt-2 mb-1" mat-raised-button color="primary" mat-button>Sign In</button>
<a class="mat-text-warn mb-0" (click)="openForgot()">Forgot password?</a>
<!-- <p class="mb-0">Don't have an account? <a [routerLink]="['/authentication/register']" class="mat-text-primary">Register Here</a></p> -->
</div>

View File

@ -97,7 +97,7 @@ export class LoginComponent {
this.router.navigate(['/services'])
}
} else{
this.router.navigate(['/services'])
this.router.navigate(['/services'])
}
})
}
@ -122,8 +122,6 @@ export class LoginComponent {
}
this.router.navigate(['/home'])
}
}else{
this.notifierService.notify('warning', res.message);
}
})
}
@ -147,12 +145,6 @@ export class LoginComponent {
this.router.navigate(['authentication/forgot-password'])
// this.router.navigate(['/home'])
}
isFormEmpty(): boolean {
const email = this.loginForm.get('email').value;
const password = this.loginForm.get('password').value;
return !email && !password;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -7,10 +7,10 @@ export const environment = {
apiEndpoint:'https://dev.venbait.in/appointments/api/',
//EndUser URL
endUserUrl: window.location.origin+'/appointment/#/booking/',
mailUrl:window.location.origin+'/appointment',
endUserUrl: window.location.origin+'/#/booking/',
mailUrl:window.location.origin,
payment_api_key :'4cb964d4-9ef4-4a25-8f85-a2a13f43cbba',
payment_mode:'TEST',
payment_mode:'LIVE',
firebase: {
apiKey: "AIzaSyCKbfDJ5Qf0rDP3WKppa94u9xuVaVabaDw",

View File

@ -7,7 +7,7 @@ export const environment = {
production: false,
environmentName: 'Testing Environment',//Localhost Environment.
// apiEndpoint:'http://venbainfotech.com:5000/api/',
// apiEndpoint:'http://192.168.1.29:8080/api/',
// apiEndpoint:'http://192.168.1.32:8080/api/',
apiEndpoint:'https://dev.venbait.in/appointments/api/',
//EndUser URL