latest updates @APR 20, 2022

This commit is contained in:
pritesh 2022-04-20 11:15:19 +05:30 committed by Pranav
parent 90b15f5e00
commit a0bdbc7c55
1657 changed files with 301942 additions and 0 deletions

45
src/README.md Normal file
View file

@ -0,0 +1,45 @@
# fSelect
A jQuery select box replacement library ([live demo](https://facetwp.com/wp-content/plugins/facetwp/assets/vendor/fSelect/test.html))
<img src="http://i.imgur.com/yXOv8DG.png" width="208" height="223" />
### Usage
```javascript
$('.your-select').fSelect();
```
### Available options
```js
$('.your-select').fSelect({
placeholder: 'Select some options',
numDisplayed: 3,
overflowText: '{n} selected',
noResultsText: 'No results found',
searchText: 'Search',
showSearch: true
});
```
* **placeholder** (str) - the default placeholder text
* **numDisplayed** (int) - the number of values to show before switching to the `overflowText`
* **overflowText** (str) - the text to show after exceeding the `numDisplayed` limit
* **noResultsText** (str) - the text to show if no choices exist (or an empty string)
* **searchText** (str) - the search box placeholder text
* **showSearch** (bool) - show the search box?
### Methods
```js
$('.your-select').fSelect('reload');
$('.your-select').fSelect('destroy');
```
### Single vs. multi-select
Add the `multiple` attribute to your `<select>` to enable multi-select:
```html
<select class="your-select-box" multiple="multiple">
```

View file

@ -0,0 +1,151 @@
<!DOCTYPE html>
<html lang="en">
<!--
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>GPS AUTO TRACK | About Us</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/animate.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/responsive.css" rel="stylesheet">
</head> -->
<body>
<carousel>
<slide>
<img src="../../assets/image/aboutus-1.jpg"style="display: block; width: 100%" >
<div class="carousel-caption">
</div>
</slide>
<slide>
<img src="../../assets/image/about_us_2.jpg" style="display: block; width: 100%" >
</slide>
<slide>
<img src="../../assets/image/track_slide_3.jpg"style="display: block; width: 100%" >
<div class="carousel-caption">
</div>
</slide>
</carousel>
<section id="about-us">
<div class="container">
<div id="about-slider">
<div id="carousel-slider" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators visible-xs">
<li data-target="#carousel-slider" data-slide-to="0" class="active"></li>
<li data-target="#carousel-slider" data-slide-to="1"></li>
<li data-target="#carousel-slider" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="images/slider_one.jpg" class="img-responsive" alt="">
</div>
<div class="item">
<img src="images/slider_one.jpg" class="img-responsive" alt="">
</div>
<div class="item">
<img src="images/slider_one.jpg" class="img-responsive" alt="">
</div>
</div>
<a class="left carousel-control hidden-xs" href="#carousel-slider" data-slide="prev">
<i class="fa fa-angle-left"></i>
</a>
<a class=" right carousel-control hidden-xs"href="#carousel-slider" data-slide="next">
<i class="fa fa-angle-right"></i>
</a>
</div>
</div>
<div class="center wow fadeInDown" style="padding:30px;">
<h2 style="text-align:center">ABOUT US</h2>
</div>
<div class="aboutuscontent">
<p>We are the fastest growing and popular GPS Tracking service offering company. Our service is lead by the team of energetic and
experienced young technical professionals. We are providing the best and quality service for our customers, there are lots of customers get full satisfaction
and happiness for getting our service. Our main objective is to satisfy the needs and expectations of the customers. Our GPS tracking software is very simple
to handle where we will see the different parameters like speed, location, idling and stoppage of vehicle, device alerts, cover of total distance and other
type of data parameters. The software is present in the user friendly form. We will get the alerts and reports your Smartphone. We are providing the cost
effective GPS tracking software with guaranteed. We provide the services for 24*7.
<br />We are deliver the hassle free and premium quality service for our customer. Our services are provided in the fully guaranteed form. Our GPS tracking
software having the best quality control to ensure you can get accurate and the perfect real time information of your automobile or vehicle. Our GPS tracking
software are integrated among the cloud related technology so the user will track their automobile from any type of place with the great uptime. We are offering
the services for the vehicle tracking system, personal tracking system and fleet tracking system. Our GPS tracking software service specialty is to offer the
affordable price robust solution, and offering end to end solution to the fleet owners. We customize our services and platform based on our customer's requirements.
You can contact our service through SMS, phone and direct meet. Our quality of the service is the main reason for our company growth. We handle our customers in
the friendly and respected form. You can contact our service at any time in day; we are waiting to offer the best service to our customer.</p>
<p>&nbsp;</p>
<p><span style="font-weight:bold; font-size:15px; color:#9bbb59;">Radical :</span> We endeavor to achieve customer satisfaction as our essential business requirement</p>
<p><span style="font-weight:bold; font-size:15px; color:#9bbb59;">Excellence :</span> We constantly strive to achieve the highest possible standards in our day-to-day work and in the quality of the goods and services we provide</p>
<p><span style="font-weight:bold; font-size:15px; color:#9bbb59;">Dedication :</span> We commit that all our products and services we provide are reliable</p>
<p><span style="font-weight:bold; font-size:15px; color:#9bbb59;">Energetic : </span>Active character by involvement and action.</p>
</div>
</div>
</section>
<section id="whymi">
<div class="container" >
<div class="row">
<div class="col-md-6">
<img src="../../assets/image/gps-map.jpg" style="width:100%;"/>
</div>
<div class="col-md-6">
<h1 style="color:#0029b0; text-align:center;">Why <span style="color:#ff6a00;">{{org_name}}</span></h1>
<p>&#10004; &nbsp;Branded and Robust Tracker </p>
<p>&#10004; &nbsp;Dedicated 6 servers with an uptime record of 99.94%.</p>
<p>&#10004; &nbsp;Customer centric approch: We belive in delivering more than that we promise &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; rather than making false commitments the time of the scale.</p>
<p>&#10004; &nbsp;Rich experties in field of tracking.</p>
<p>&#10004; &nbsp;Maximum no. of alerts and reports.</p>
<p>&#10004; &nbsp;The option of rebranding available.</p>
<p>&#10004; &nbsp;Services call attended within 48 hours.</p>
</div>
</div>
</div>
</section>
<footer id="footer" class="midnight-blue" style="text-align:center;background:#6b6666;">
<div class="container">
<div class="row">
<div class="col-sm-4" style="color:white;padding-top: 20px;">
&copy; 2017 {{org_name}}. All Rights Reserved
</div>
<div class="col-sm-4">
<ul >
<li style="color:white"><a href="/home" style="color:white">Home</a></li>
<li style="color:white"><a href="/about-us" style="color:white">About Us</a></li>
<li style="color:white"><a href="/contact-us" style="color:white">Contact Us</a></li>
</ul>
</div>
<div class="col-sm-4" style="margin-top:20px;">
<a href="/home" style="color:white;padding-top: 20px;">Designed by {{org_name}}</a>
</div>
</div>
</div>
</footer>
<script src="js/jquery.js"></script>
<script type="text/javascript">
$('.carousel').carousel()
</script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.prettyPhoto.html"></script>
<script src="js/jquery.isotope.min.js"></script>
<script src="js/style.js"></script>
<script src="js/wow.min.js"></script>
</body>
</html>

View file

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AboutUsComponent } from './about-us.component';
describe('AboutUsComponent', () => {
let component: AboutUsComponent;
let fixture: ComponentFixture<AboutUsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AboutUsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AboutUsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,21 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-about-us',
templateUrl: './about-us.component.html',
styleUrls: ['./about-us.component.scss']
})
export class AboutUsComponent implements OnInit {
org_name = '';
constructor() {
this.org_name = window.localStorage['organisationName']
}
ngOnInit() {
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AccountDetailComponent } from './account-detail.component';
describe('AccountDetailComponent', () => {
let component: AccountDetailComponent;
let fixture: ComponentFixture<AccountDetailComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AccountDetailComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AccountDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,51 @@
<!-- <div class="modal"> -->
<!-- <div class="modal-header"> -->
<h4 md-dialog-title>{{title}}</h4>
<!-- </div> -->
<div md-dialog-content>
<form [formGroup]="planForm">
<div class="form-group row">
<label for="Name" class="col-sm-2 col-form-label">Name</label>
<div class="col-sm-10">
<input formControlName="Name" type="text" class="form-control" id="Name" placeholder="Enter Plan Name">
</div>
</div>
<div class="form-group row">
<label for="Amount" class="col-sm-2 col-form-label">Amount</label>
<div class="col-sm-10">
<input formControlName="Amount" type="number" class="form-control" id="Amount" placeholder="Enter Amount">
</div>
</div>
<div class="form-group row">
<label for="status" class="col-sm-2 col-form-label">Status</label>
<div class="col-sm-10">
<select class="form-control" formControlName="Status">
<option>Active</option>
<option>InActive</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="type" class="col-sm-2 col-form-label">Type</label>
<div class="col-sm-10">
<select class="form-control" formControlName="Duration_days">
<option value=30>Monthly</option>
<option Value=90> Quaterly</option>
<option value=180>Half Yearly</option>
<option value=365>Yearly</option>
<option value=1095>3 Years</option>
</select>
</div>
</div>
</form>
</div>
<md-dialog-actions align="end">
<button md-button md-dialog-close>Cancel</button>
<button *ngIf="data==null" md-button (click)="submit()"> Save</button>
<button *ngIf="data!=null" md-button (click)="editPlan()"> Update</button>
</md-dialog-actions>
<!-- </div> -->

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddPlanComponent } from './add-plan.component';
describe('AddPlanComponent', () => {
let component: AddPlanComponent;
let fixture: ComponentFixture<AddPlanComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddPlanComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddPlanComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,72 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
import { ContactService } from '../../contact.service';
@Component({
selector: 'app-add-plan',
templateUrl: './add-plan.component.html',
styleUrls: ['./add-plan.component.scss']
})
export class AddPlanComponent implements OnInit {
planForm:FormGroup;
title="Add New Plan"
useridd;
or
constructor(public dialogRef: MdDialogRef<AddPlanComponent>,
@Inject(MD_DIALOG_DATA) public data: any,private fb:FormBuilder,private contactService:ContactService) { }
ngOnInit() {
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName;
this.planForm=this.fb.group({
Name:[''],
Status:[''],
Amount:[''],
Duration_days:[''],
SupAdmin:[this.useridd],
Org:[this.or]
})
if(this.data!=null){
this.title="Edit Plan Details";
this.patchPlanForm()
}
}
patchPlanForm(){
this.planForm.patchValue({
Name:this.data.Name,
Status:this.data.Status,
Amount:this.data.Amount,
Duration_days:this.data.Duration_days,
SupAdmin:[this.useridd],
Org:[this.or]
})
}
submit(){
console.log(this.planForm.value);
this.contactService.post('/RechargePlan/add',this.planForm.value).subscribe(res=>{
console.log(res);
this.dialogRef.close("succ")
})
}
editPlan(){
var data={
_id:this.data._id,
Name:this.planForm.value.Name,
Status:this.planForm.value.Status,
Amount:this.planForm.value.Amount,
Duration_days:this.planForm.value.Duration_days,
SupAdmin:this.planForm.value.SupAdmin,
Org:this.planForm.value.Org
}
this.contactService.post('/RechargePlan/edit',data).subscribe(res=>{
console.log(res);
this.dialogRef.close("succ")
})
}
}

View file

@ -0,0 +1,486 @@
ul, li {
list-style: none;
float: left;
line-height: 15vh;
}
.upper{
margin-top: -70px;
width: 100%;
height: 17%;
/* margin-left: -2px;*/
position: fixed;
background-color: white;
top: 0;
z-index: 1
}
.up{
color: gray;
/* Add a font */
/* Set the font-size to 25 pixels */
font-size: 25px;
}
.middle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
margin-left: -220px;
margin-top: -20px;
}
.dropdown:hover .dropdown-content {
display: block;
}
.desc {
padding: 15px;
text-align: center;
}
#insert{
margin-left:8px;
margin-top:-15px;
text-shadow: 20px;
}
#insert2{
margin-left:8px;
margin-top:-15px;
text-shadow: 20px;
}
.example-container {
width: 500px;
height: 300px;
border: 1px solid rgba(0, 0, 0, 0.5);
}
.example-sidenav-content {
display: flex;
height: 100%;
align-items: center;
justify-content: center;
}
.example-sidenav {
padding: 20px;
}
.vertical-menu {
width: 250px;
padding-left: 10px;
}
.vertical-menu a {
background-color: #eee;
color: black;
display: block;
padding: 12px;
text-decoration: none;
}
.vertical-menu a:hover {
background-color: #ccc;
}
.vertical-menu a.active {
background: rgba(0, 0, 0, 0.8);
color: white;
}
#c2 {
}
#c1 {
float:left;
}
body {margin:0}
.icon-bar {
width: 17%;
/* background-color: #555; */
background-color: #18262F;
margin-top: -9px;
height:100%;
position: fixed;
display: inline-block;
margin-left: -16px;
}
@media screen and (max-width: 1000px){
.off{
display: none;
}
}
.icon-bar2 {
width: 299px;
background-color: white;
margin-top: -7px;
height:86vh;
position: fixed;
}
.icon-bar a {
display: block;
text-align: center;
padding: 16px;
transition: all 0.3s ease;
color: white;
font-size: 14px;
text-align: left;
}
.icon-bar a:hover {
background-color: #000;
}
.active {
background-color: #4CAF50 !important;
}
.iphone {
width: 201px;
height: 378px;
background: #f9f7f9;
border: 5px solid #c1bfc1;
border-radius: 45px;
opacity: 0.8;
}
.highlight {
width: 185px;
height: 366px;
border: 3px solid #fff;
border-radius: 45px;
position: relative;
z-index: 10;
top: -748px;
left: 10px;
}
.circle {
width: 7px;
height: 7px;
background: #333;
border-radius: 50%;
position: relative;
top: -370px;
left: 92px;
}
.camera {
width: 10px;
height: 10px;
background: #333;
border-radius: 50%;
position: relative;
top: -376px;
left: 66px;
}
.speaker {
width: 59px;
height: 3px;
background: #333;
border-radius: 5px;
position: relative;
top: -372px;
left: 73px;
}
.screen {
width: 166px;
height: 255px;
border: 3px solid #333;
border-radius: 5px;
position: relative;
left: 18px;
top: -365px;
background: #7f8282;
background: -webkit-linear-gradient(#e2e3e4, #7f8282);
background: -o-linear-gradient(#e2e3e4, #7f8282);
background: -moz-linear-gradient(#e2e3e4, #7f8282);
background: linear-gradient(#e2e3e4, #7f8282);
}
.home1 {
width: 47px;
height: 47px;
background: #fff;
border-radius: 50%;
position: relative;
top: -353px;
left: 79px;
z-index: 2;
}
.home2 {
width: 52px;
height: 52px;
border-radius: 50%;
position: relative;
top: -403px;
left: 77px;
background: #7f8282;
background: -webkit-linear-gradient(#e2e3e4, #7f8282);
background: -o-linear-gradient(#e2e3e4, #7f8282);
background: -moz-linear-gradient(#e2e3e4, #7f8282);
background: linear-gradient(#e2e3e4, #7f8282);
}
#c2{
background:green;
float:right;
}
#c1, #c2 {
width: 33%;
background: rebeccapurple
}
#c3 {
width: auto;
width:34%;
background: red
}
.off{
margin: auto;
width: 60%;
top:70%;
padding: 10px;
margin-right:30%
}
.newspaper {
-webkit-column-count: 2; /* Chrome, Safari, Opera */
-moz-column-count: 2; /* Firefox */
column-count: 2;
-webkit-column-gap: 40px; /* Chrome, Safari, Opera */
-moz-column-gap: 40px; /* Firefox */
column-gap: 40px;
align-content:left;
text-align: left;
}
#demo {
margin: 30px 0 50px 0;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
}
#demo .wrapper {
display: inline-block;
width: 180px;
margin: 0 10px 0 0;
height: 20px;
position: relative;
}
#demo .parent {
height: 100%;
width: 100%;
display: block;
cursor: pointer;
line-height: 30px;
height: 30px;
border-radius: 5px;
background: #F9F9F9;
border: 1px solid #AAA;
border-bottom: 1px solid #777;
color: #282D31;
font-weight: bold;
z-index: 2;
position: relative;
-webkit-transition: border-radius .1s linear, background .1s linear, z-index 0s linear;
-webkit-transition-delay: .8s;
text-align: center;
}
#demo .parent:hover,
#demo .content:hover ~ .parent {
background: #fff;
-webkit-transition-delay: 0s, 0s, 0s;
}
#demo .content:hover ~ .parent {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
z-index: 0;
}
#demo .content {
position: absolute;
top: 0;
display: block;
z-index: 1;
height: 0;
width: 180px;
padding-top: 30px;
-webkit-transition: height .5s ease;
-webkit-transition-delay: .4s;
border: 1px solid #777;
border-radius: 5px;
box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
#demo .wrapper:active .content {
height: 123px;
z-index: 3;
-webkit-transition-delay: 0s;
}
#demo .content:hover {
height: 123px;
z-index: 3;
-webkit-transition-delay: 0s;
}
#demo .content ul {
background: #fff;
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
#demo .content ul a {
text-decoration: none;
}
#demo .content li:hover {
background: #eee;
color: #333;
}
#demo .content li {
list-style: none;
text-align: left;
color: #888;
font-size: 14px;
line-height: 30px;
height: 30px;
padding-left: 10px;
border-top: 1px solid #ccc;
}
#demo .content li:last-of-type {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
.customClass {
background-color: #dd3;
border-radius: 5px;
margin:5px;
width: 500px;
}
.customClass .img-ul-upload {
background-color: #000 !important;
}
.customClass .img-ul-clear {
background-color: #B819BB !important;
}
.customClass .img-ul-drag-box-msg {
color: purple !important;
}
.customClass .img-ul-container {
background-color: #FF6CAD !important;
}
.img-ul-file-upload[_ngcontent-c6] {
padding: 16px;
height: 201px !important;
}
.weekDays-selector input {
display: none!important;
}
.weekDays-selector input[type=checkbox] + label {
display: inline-block;
border-radius: 6px;
background: #dddddd;
height: 40px;
width: 34.2px;
margin-right: 3px;
line-height: 40px;
text-align: center;
cursor: pointer;
}
.weekDays-selector input[type=checkbox]:checked + label {
background: #2AD705;
color: #ffffff;
}
@media screen and (max-width: 900px) {
.icon-bar{
display: none;
}
.sch{
display: none;
}
.first{
width:1%!important;
}
.second{
margin-left: 8px!important;
}
.small{
display: block!important;
}
.image{
display: none;
}
.schlar{
display: block!important;
}
}
@media screen and (min-width: 900px) {
.schlar{
display: none;
}
}
.small{
display: none;
}
.first{
float:left;
width: 16%;
height:86vh;
overflow-y: hidden;
overflow-x: hidden;
margin-right: 5px
}
.second{
width: 88%;
height:86vh;
margin-left:171px;
}
.mat-dialog-container {
max-width: none !important;
}
.sch{
}
.schlar{
}
.pointer{
cursor:pointer !important;
}
.expansion-panel__content{
margin-left: 0% !important;
}

View file

@ -0,0 +1,652 @@
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
</head>
<body>
<div class="upper">
<md-toolbar>My App</md-toolbar>
<md-toolbar flex style="background-color:white;width: 100%;" >
<img src="../../assets/image/a.jpg"
style=
"width:12%;padding-top: 8px;">
<ul fxHide.sm="true" fxHide.xs="true" style="width:50%;padding:30px 10% 0 0;" fxLayout="row" >
</ul>
<ul fxShow fxHide.xs="false" fxHide.lg="true" fxHide.gt-sm="true" style="width:100%;padding-top: 15px;"> <!--for small screen -->
<!-- <li style="float:right;" >
<div class="dropdown">
<img src="../../assets/image/us.jpg" height=30px>
<div class="dropdown-content">
<b> <h4> &nbsp;<p id="insert3"></p></h4></b>
<h6><p id="insert4"></p></h6>
&nbsp; <button type="reset" class="btn btn-default" >My Account</button>
&nbsp;&nbsp; <input type="submit" class="btn btn btn-success" style="float: left;" value="Log Out" (click)="openPop()"/>
</div>
</div>
</li> -->
<md-menu #appMenu="mdMenu" [overlapTrigger]="false">
<h5>&nbsp;&nbsp;{{fs}} {{ls}}</h5>
<h5>&nbsp;&nbsp;{{or}}</h5><br>
<!-- <b> <h4><p id="insert"></p></h4></b>
<h6><p id="insert2"></p></h6> -->
&nbsp; <button type="reset" class="btn btn-default" >My Account</button>
<button class="btn btn btn-success"(click)="logout()" >&nbsp;&nbsp;&nbsp;Log Out&nbsp;&nbsp;&nbsp;</button> &nbsp;
</md-menu>
<button md-icon-button [mdMenuTriggerFor]="appMenu" style="float:right;outline:none">
<!-- <md-icon>more_vert</md-icon> -->
<img src="../../assets/image/us.jpg" height=30px>
</button>
</ul>
<ul fxShow fxHide.xs="true" fxHide.lt-md="true" fxHide.gt-sm="false" style="float:right;width:30%; margin-top: 3%;">
<!-- <li style="width:27%;float:right">
<div class="dropdown">
<img src="../../assets/image/us.jpg" height=30px>
<div class="dropdown-content">
<b> <h4> &nbsp;<p id="insert"></p></h4></b>
<h6><p id="insert2"></p></h6>
&nbsp; <button type="reset" class="btn btn-default" >My Account</button>
<button class="btn btn btn-success"(click)="openPop()" >&nbsp;&nbsp;&nbsp;Log Out&nbsp;&nbsp;&nbsp;</button> &nbsp;
</div>
</div>
</li>
-->
<md-menu #appMenu="mdMenu" [overlapTrigger]="false">
<h5>&nbsp;&nbsp;{{fs}} {{ls}}</h5>
<h5>&nbsp;&nbsp;{{or}}</h5><br>
<!-- <b> <h4><p id="insert"></p></h4></b>
<h6><p id="insert2"></p></h6> -->
&nbsp; <button type="reset" class="btn btn-default" >My Account</button>
<button class="btn btn btn-success"(click)="logout()" >&nbsp;&nbsp;&nbsp;Log Out&nbsp;&nbsp;&nbsp;</button> &nbsp;
</md-menu>
<button md-icon-button [mdMenuTriggerFor]="appMenu" style="float:right;outline:none">
<!-- <md-icon>more_vert</md-icon> -->
<img src="../../assets/image/us.jpg" height=30px>
</button>
</ul>
</md-toolbar>
</div>
<!-- <div class="icon-bar"> ***-->
<!-- <a class="active" href="#"><i class="fa fa-home"></i></a> -->
<!--**** <a href="#">PRODUCT LAUNCHER</a>
<a href="#">RULES</a>
</div>
<div class="icon-bar2" style="right:0;">
<div class="iphone"></div>
<div class="circle"></div>
<div class="camera"></div>
<div class="speaker"></div>
<div class="screen"></div>
<div class="home1"></div>
<div class="home2"></div>
<div class="highlight"></div>
<div class="line"></div>
</div> -->
<!-- <div class="w3-sidebar w3-light-grey w3-bar-block" style="width:25%">
<h3 class="w3-bar-item">Menu</h3>
<a href="#" class="w3-bar-item w3-button">Link 1</a>
<a href="#" class="w3-bar-item w3-button">Link 2</a>
<a href="#" class="w3-bar-item w3-button">Link 3</a>
</div>
<div class="w3-sidebar w3-light-grey w3-bar-block" style="width:25%;right:0;">
<h3 class="w3-bar-item">Menu</h3>
<a href="#" class="w3-bar-item w3-button">Link 1</a>
<a href="#" class="w3-bar-item w3-button">Link 2</a>
<a href="#" class="w3-bar-item w3-button">Link 3</a>
</div> -->
<!--
<div class="iphone"></div>
<div class="circle"></div>
<div class="camera"></div>
<div class="speaker"></div>
<div class="screen"></div>
<div class="home1"></div>
<div class="home2"></div>
<div class="highlight"></div>
<div class="line"></div> -->
<!-- <div class="cen">
<section>
<h1>WWF</h1>
<p>The World Wide Fund for Nature (WWF) is an international organization working on issues regarding the conservation, research and restoration of the environment, formerly named the World Wildlife Fund. WWF was founded in 1961.</p>
</section>
</div> -->
<!-- <div class ="small" >
</div> -->
<div class="small">
<button md-button [mdMenuTriggerFor]="menu" style="padding:0%;"><i class="material-icons">list</i></button>
<md-menu #menu="mdMenu">
<a class="pointer" (click)="soon()">
<h6>DASHBOARD
<md-icon style="float:right">dashboard</md-icon>
</h6>
</a>
<!-- <a href="http://localhost:4200/account">
<h6>PRODUCT LAUNCHER</h6></a> -->
<!-- <a class="pointer" (click)="soon()"><h6>RULES<md-icon style="float:right">dock</md-icon></h6></a>
-->
<a (click)="devi()" class="pointer"><h6>DEVICES <md-icon style="float:right">devices</md-icon></h6></a>
</md-menu>
</div>
<!-- <ul fxShow fxHide.xs="false" fxHide.lg="true" fxHide.gt-sm="true" style="width:100%;padding-top: 18px;">
<li style="width:25%;">
</li>
<li style="float:left;width:22%;padding-left:1.7em;">
</li>
<li style="float:right;width:40%;">
<button md-button [mdMenuTriggerFor]="menu" style="padding:0%;"><i class="material-icons">list</i></button>
<md-menu #menu="mdMenu">
<button md-menu-item routerLink="home" >Home</button>
<button md-menu-item routerLink="community" >Community</button>
<button md-menu-item routerLink="support">Support</button>
</md-menu></li>
</ul> -->
<div style="position:relative">
<div class = "first">
<div class="icon-bar">
<!-- <a class="active" href="#"><i class="fa fa-home"></i></a> -->
<a class="pointer" (click)="soon()">DASHBOARD <md-icon style="float:right">dashboard</md-icon></a>
<!-- <a href="http://localhost:4200/account" style="cursor:pointer;">PRODUCT LAUNCHER</a> -->
<a class="pointer" (click)="soon()">RULES<md-icon style="float:right">dock</md-icon></a>
<a (click)="devi()" class="pointer">DEVICES <md-icon style="float:right">devices</md-icon></a>
<a class="pointer" (click)="openNav()" >GPS TRACKER<md-icon style="float:right">my_location</md-icon></a>
<a class="pointer" (click)="a()" >DEVICE REPORT<md-icon style="float:right">keyboard_arrow_down</md-icon></a>
<a class="pointer" *ngIf="cond" (click)="report()" >Distance<md-icon style="float:right">trending_flat</md-icon></a>
<a class="pointer" *ngIf="cond" (click)="report_speed()" >Speed<md-icon style="float:right">trending_up</md-icon></a> </div>
</div>
<div class="second">
<h3 style=" padding-left: 5%;padding-top:2%">{{userId}} <!-- <md-select name="typdev" [(ngModel)]="new">
<md-option *ngFor="let device of devices" [value]="device.viewValue" >
{{ device.viewValue }}
</md-option>
</md-select> -->
<!--
<div class="dropdown">
<span> <md-icon>arrow_drop_down</md-icon></span>
<div class="dropdown-content">
<p>Hello World!</p>
</div>
</div> -->
<md-menu #deviceMenu="mdMenu" [overlapTrigger]="false">
</md-menu>
<!-- <button md-icon-button [mdMenuTriggerFor]="deviceMenu" style="outline:none">
<md-icon>arrow_drop_down</md-icon>
</button> -->
</h3>
<div class="image" style=" float: right;
width: 34%;
margin-top: -2%;
margin-right: 10%;">
<image-upload
[url]="'my-url.com'"
[headers]="{Authorization: 'MyToken'}"
buttonCaption="SELECT DEVICE IMAGE"
dropBoxMessage="DROP YOUR DEVICE IMAGE"
>
<!-- (removed)="onRemoved($event)" -->
</image-upload></div>
<h6 style=" padding-left: 7%;font-size:13px;"><b>Device ID:</b></h6>
<h6 style=" padding-left: 7%;font-size:10px;">{{deviceid}}</h6>
<h6 style=" padding-left: 7%;font-size:13px;"><b>Created by:</b></h6>
<h6 style=" padding-left: 7%;font-size:10px;">{{emailid}}</h6><br>
<!-- <md-icon style=" padding-left: 24px">add</md-icon> <p style="font-size:13px;padding-left: 4%;margin-top:-26px;margin-left:27px;"><md-icon style=" padding-right: 2%;">add</md-icon<b>Created by:</b></p>
<p style=" padding-left: 7%;font-size:10px;margin-top: -2%">{{emailid}}</p> --><br>
<!-- <md-icon style=" padding-left: 24px">create</md-icon> --><!-- <p style="font-size:13px;padding-left: 5%;margin-top:-27px;margin-left:27px;">Last Edited:</p>
<p style=" padding-left: 8%;font-size:10px;margin-top:-12 px">6 hours ago</p> -->
<!-- <md-icon style=" padding-left: 24px">computer</md-icon> --><!-- <p style="font-size:13px;padding-left: 65px;margin-top:-27px;margin-left:27px;">Devices:</p>
<p style=" padding-left: 59px;font-size:10px;margin-top:-12 px">1</p> -->
<hr>
<md-tab-group style="overflow: hidden;">
<md-tab label="Datamatrix">
<br> <p><button data-tooltip="Add Device" style="border:1px solid transparent; background-color: transparent;float:left;" (click)="openDialog()"> <md-icon style="float:left;width:30px;height:30px;">add</md-icon></button></p>
<table class="table table-striped table-hover ">
<thead>
<tr>
<th>Matrix Name</th>
<th>API</th>
</tr>
</thead>
<tbody>
<!--
<tr *ngFor="let device of mat ">
<td width="50" >{{device.Matrix_Name}}</td>
<td width="60" style="cursor:pointer" (click)="matrixred(device.API)">{{device.API}}</td>
<td width="10"> <p><button data-tooltip="Remove Device" style="border:1px solid transparent; background-color: transparent;"(click)="delete(device.Device_ID)">
<md-icon>delete</md-icon></button></p>
</td>
</tr> -->
</tbody>
</table>
<!-- <div class="newspaper">
<h6 *ngFor="let ls of l" >
<h5><b> &#10140; </b>{{ ls}} </h5>
</h6>
</div> -->
</md-tab>
<md-tab label="Rule" style="overflow: hidden;">
<table class="table table-striped table-hover ">
<thead>
<tr>
<th align="left">Action</th>
<th align="left">User Info</th>
<th align="left">Condition</th>
<th align="left">value</th>
</tr>
</thead>
<tbody>
<!-- <tr *ngFor="let device of devices" (click)="vewdev(device.Device_Name)">
<td>{{device.Device_ID }}</td>
<td>{{ device.Device_Name }}</td>
<td>{{device.type_of_device }}</td>
<td> {{device.Device_Des}}</td>
</tr> -->
<!-- <tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<th align="left"> <p><button data-tooltip="Add Device" style="border:1px solid transparent; background-color: transparent;"(click)="delete()"> <md-icon>delete</md-icon></button></p>
</th>
</tr> -->
</tbody>
</table>
<br> <p><button data-tooltip="Add Device" style="border:1px solid transparent; background-color: transparent; position: fixed;bottom: 0;right: 0;" (click)="openDialog2()"> <md-icon style="float:left;width:30px;height:30px;">add</md-icon></button></p>
</md-tab>
<md-tab label="Scheduler">
<expansion-panels-container >
<expansion-panel #panel style="margin-left:2px;" >
<expansion-panel-title>
<md-icon style="float:left;width:26px;">add</md-icon> <b> Add Scheduler</b>
</expansion-panel-title>
<expansion-panel-description-hidden>
</expansion-panel-description-hidden>
<expansion-panel-description-toggled>
.....
</expansion-panel-description-toggled>
<expansion-panel-content style="height:30px">
<div class ="sch"> <div style="
outline: none;
width: 45%;
cursor: pointer;float:left;">
<p>ON Time:</p>
<timepicker [(ngModel)]="onn_time"></timepicker></div>
<!-- <input type="time" name="onn_time" [(ngModel)]="onn_time"style="width:191px;margin-left:-121px;outline: none;cursor:pointer;" required> -->
<div style="
outline: none;
cursor: pointer;
">
<p>OFF Time:</p><timepicker [(ngModel)]="offf_time"></timepicker></div>
<form class="form-group" name="myForm" #lgForm="ngForm">
<!-- <label style=" float: left;
margin-left: -33%;
margin-top: 5%;">ON Time : </label> -->
<!-- <input type="time" name="offf_time" [(ngModel)]="offf_time"style="width:191px;outline: none;cursor:pointer;" required> -->
<!-- <md-select name="action" placeholder="Action"
style="margin-top:-18px;width:45%;float:left;margin-left:-31%;padding-right:18px" [(ngModel)]="action">
<md-option *ngFor="let food of foods" [value]="food.viewValue" >
{{ food.viewValue }}
</md-option>
</md-select>
<material-datepicker [(date)]="date" style="margin-left:100px;outline: none;cursor:pointerp;border: 0px none;"
></material-datepicker> --><br><br>
<md-select name="rep" placeholder="Repitation" style="width:45%;float:left;padding-right:109px; padding-top: 2px;" [(ngModel)]="rep" (change)="onChange(rep)" required>
<md-option *ngFor="let food of foodss" [value]="food.viewValue" >
{{ food.viewValue }}
</md-option>
</md-select>
<div style=" padding-top: 2px;" *ngIf="daydes" >
<div class="weekDays-selector" >
<input name="dayselM" type="checkbox" id="weekday-mon" class="weekday" [(ngModel)]="dayselM" />
<label for="weekday-mon">M</label>
<input name="dayselT" type="checkbox" id="weekday-tue" class="weekday" [(ngModel)]="dayselT"/>
<label for="weekday-tue">T</label>
<input name="dayselW" type="checkbox" id="weekday-wed" class="weekday" [(ngModel)]="dayselW"/>
<label for="weekday-wed">W</label>
<input name="dayselTH" type="checkbox" id="weekday-thu" class="weekday" [(ngModel)]="dayselTH" />
<label for="weekday-thu">Th</label>
<input name="dayselF" name="daysel" type="checkbox" id="weekday-fri" class="weekday" [(ngModel)]="dayselF" />
<label for="weekday-fri">F</label>
<input name="dayselSa" type="checkbox" id="weekday-sat" class="weekday" [(ngModel)]="dayselSa"/>
<label for="weekday-sat">Sa</label>
<input name="dayselSu" type="checkbox" id="weekday-sun" class="weekday" [(ngModel)]="dayselSu"/>
<label for="weekday-sun">S</label>
</div>
</div>
<div *ngIf="rep == 'Monthly'">
<label style="float:left;">From Date : </label>
<material-datepicker [(date)]="date1" style="width:191px;outline: none;cursor:pointer;" required
></material-datepicker><br>
<br><label style="float:left; margin-top: 3%">To Date : </label> <material-datepicker [(date)]="date2" style="width:191px;outline: none;cursor:pointer;"required
></material-datepicker>
<md-form-field class="example-full-width width" style="
width: 45%;
">
<input mdInput type="text" [(ngModel)]="Expiry" name="Expiry" placeholder="Expiry (In Months)" required >
<md-error class="required">Enter Expiry Period</md-error>
</md-form-field>
</div>
<div *ngIf="rep == 'Daily'">
<md-form-field class="example-full-width width" style="float:left;width:32%">
<input mdInput type="text" [(ngModel)]="Expiry" name="Expiry" placeholder="Expiry (In Days)" >
<!-- <md-error class="required">Enter Expiry Period</md-error>-->
</md-form-field>
</div>
<div *ngIf="rep == 'Weekly'">
<md-form-field class="example-full-width width" style="float:left;width:42%">
<input mdInput type="text" [(ngModel)]="Expiry" name="Expiry" placeholder="Expiry (In Weeks)" >
</md-form-field>
</div><br>
<!-- <time-duration-picker [inputDisabled]=false returnedValueUnit="hour" (onChange)="onNumberChanged($event)" class="row">
<time-duration-picker-unit class="col-md-2" [name]="'second'" [label]="'Seconds'" [min]="0" [max]="59" [step]="1"></time-duration-picker-unit>
<time-duration-picker-unit class="col-md-2" [name]="'minute'" [label]="'Minutes'" [min]="0" [max]="59" [step]="1"></time-duration-picker-unit>
<time-duration-picker-unit class="col-md-2" [name]="'hour'" [label]="'Hours'" [min]="0" [max]="23" [step]="1"></time-duration-picker-unit>
</time-duration-picker> -->
<br>
<input type="reset" class="btn btn-primary" style="margin-top: 18px;cursor:pointer" value="Clear"/>
<input type="submit" class="btn btn btn-success" style="margin-top: 18px;cursor:pointer
" value="Generate Sheduler" (click)="addshe(onn_time,offf_time)" />
</form>
</div>
<div class="schlar"> <!-- small screen -->
<form class="form-group" #lgForm="ngForm">
<label style="float:left;margin-left:-31%;">ON Time : </label><input type="time" name="onn_time" [(ngModel)]="onn_time"style="width:134px;margin-left:7px;outline: none;cursor:pointer;" required><br>
<br><label style="float:left;margin-left:-31%;">OFF Time : </label><input type="time" name="offf_time" [(ngModel)]="offf_time"style="width:130px;margin-left:7px;outline: none;cursor:pointer;" required>
<br>
<br>
<md-select name="rep" placeholder="Repitation" style="margin-top:-18px;width:117%;float:left;margin-left:-31%;padding-right:18px"
(change)="onChange(rep)"
[(ngModel)]="rep" required>
<md-option *ngFor="let food of foodss" [value]="food.viewValue" >
{{ food.viewValue }}
</md-option>
</md-select><br>
<div *ngIf="daydes" >
<br><div style="float:left;margin-left: -38%;" class="weekDays-selector" >
<input name="dayselM" type="checkbox" id="weekday-mon" class="weekday" [(ngModel)]="dayselM" />
<label for="weekday-mon">M</label>
<input name="dayselT" type="checkbox" id="weekday-tue" class="weekday" [(ngModel)]="dayselT"/>
<label for="weekday-tue">T</label>
<input name="dayselW" type="checkbox" id="weekday-wed" class="weekday" [(ngModel)]="dayselW"/>
<label for="weekday-wed">W</label>
<input name="dayselTH" type="checkbox" id="weekday-thu" class="weekday" [(ngModel)]="dayselTH" />
<label for="weekday-thu">Th</label>
<input name="dayselF" name="daysel" type="checkbox" id="weekday-fri" class="weekday" [(ngModel)]="dayselF" />
<label for="weekday-fri">F</label>
<input name="dayselSa" type="checkbox" id="weekday-sat" class="weekday" [(ngModel)]="dayselSa"/>
<label for="weekday-sat">Sa</label>
<input name="dayselSu" type="checkbox" id="weekday-sun" class="weekday" [(ngModel)]="dayselSu"/>
<label for="weekday-sun">S</label>
</div><br></div>
<div *ngIf="rep == 'Monthly'">
<br> <label style="margin-left:-39%;">From Date : </label>
<material-datepicker [(date)]="date" style="width:134px;margin-left:7px;outline: none;cursor:pointer;"
></material-datepicker><br>
<label style="float:left;margin-left:-31%;">To Date : </label> <material-datepicker [(date)]="date" style="width:130px;margin-left:7px;outline: none;cursor:pointer;"
></material-datepicker><br></div>
<div *ngIf="rep == 'Daily'">
<md-form-field class="example-full-width width" style="float:left;margin-left:-31%;width:117%">
<input mdInput type="text" [(ngModel)]="Expiry" name="Expiry" placeholder="Expiry (In Days)" ><br>
</md-form-field>
</div>
<div *ngIf="rep == 'Weekly'">
<md-form-field class="example-full-width width" style="float:left;margin-left:-31%;width:117%">
<input mdInput type="text" [(ngModel)]="Expiry" name="Expiry" placeholder="Expiry (In Weeks)" ><br>
</md-form-field>
</div><br>
<input type="submit" class="btn btn-primary" style="margin-left:-22px;margin-top: 18px;cursor:pointer; margin-left: 5%;" value="Clear"(click)='null_fun()'/>
<input type="submit" class="btn btn btn-success" style="margin-left:2px;margin-top: 18px;cursor:pointer
" value="Generate Sheduler" (click)="addshe(onn_time,offf_time) "/>
</form>
</div>
<flash-messages style="float: left; width: 547px;
margin-left: -15%;"></flash-messages>
<br>
</expansion-panel-content>
<expansion-panel-buttons>
<!--
<button md-button (click)="panel.cancel()">
Cancel
</button> -->
<!-- <button (click)='pancel.submit()'>Submit</button>
-->
</expansion-panel-buttons>
</expansion-panel>
</expansion-panels-container>
<!-- <h6 *ngFor="let ls of l" >
<h5><b></b>{{ ls}} </h5>
</h6> -->
<!-- <form class="form-group" #lgForm="ngForm" style="float:left">
<md-select name="typdev" placeholder="Select Action" [(ngModel)]="new">
<md-option *ngFor="let food of foods" [value]="food.viewValue" >
{{ food.viewValue }}
</md-option>
</md-select>
<material-datepicker [(date)]="yourModelDate"></material-datepicker>
</form> -->
<flash-messages style="width: 547px;
"></flash-messages>
<table class="table table-striped table-hover ">
<thead align="center">
<tr>
<th> Device Name</th>
<th>ON Time</th>
<th>OFF Time</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let device of on_table ">
<td>{{f_did}}</td>
<td>{{device.f_o_t}} </td>
<td>{{device.f_f_t}} </td>
<!-- <td>{{f_did}}</td>
<td>{{f_on}}</td>
<td>{{f_off}}</td> -->
<td width="2%"> <p><button *ngIf="del" data-tooltip="Add Device" style="border:1px solid transparent; background-color: transparent;cursor:pointer"(click)="edit_schedule(f_did,device.f_o_t,device.f_f_t,device.f_o_id)"> <md-icon>mode_edit
</md-icon></button></p>
</td>
<td> <p><button *ngIf="del" data-tooltip="Add Device" style="border:1px solid transparent; background-color: transparent;cursor:pointer"(click)="delete_schedule(device.f_o_id)"> <md-icon>delete</md-icon></button></p>
</td>
</tr>
</tbody>
</table>
<!-- <br><table class="w3-table w3-striped">
<tr>
<th>Action</th>
<th>Selected Date</th>
<th>Selected Time</th>
<th>Repetation</th>
</tr>
<tr>
<td>SMS</td>
<td>06/10/2017</td>
<td>10:20 Am</td>
<td>Daily</td>
<td> <p><button data-tooltip="Add Device" style="border:1px solid transparent; background-color: transparent;"(click)="delete()"> <md-icon>delete</md-icon></button></p>
</td>
</tr>
</table> -->
</md-tab>
<!-- <md-tab label="Intigrate">Intigrate</md-tab> -->
</md-tab-group>
<br><br><br>
</div>
<!-- <div style="float:left; width: 25%; height:86vh;overflow-y: hidden;
overflow-x: hidden; ">
<div class="off">
<div class="iphone"></div>
<div class="circle"></div>
<div class="camera"></div>
<div class="speaker"></div>
<div class="screen">
<b> <h3 style=" padding-left: 10px;font-size:20px;text-align:center">{{userId}} </h3>
</b></div>
<div class="home1"></div>
<div class="home2"></div>
<div class="highlight"></div>
<div class="line"></div>
</div></div> -->
</div>
</body>

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AccountComponent } from './account.component';
describe('AccountComponent', () => {
let component: AccountComponent;
let fixture: ComponentFixture<AccountComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AccountComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AccountComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,584 @@
import { Component, OnInit,Output,EventEmitter } from '@angular/core';
import {MdDialog, MdDialogRef, MD_DIALOG_DATA} from '@angular/material';
import {GmapComponent} from '../gmap/gmap.component';
import { EditScheComponent } from '../edit-sche/edit-sche.component';
import {RuleComponent} from '../rule/rule.component';
import { ExpansionPanelsModule } from 'ng2-expansion-panels';
import {ContactService} from '../contact.service';
import { TimeDurationPickerModule } from 'angular2-time-duration-picker';
import {Schedule} from '../shedule';
import {Scheduleb} from '../scheduleb';
import {Schedulec} from '../schedulec';
import { DatePipe } from '@angular/common';
import {Device} from '../device';
import * as moment from 'moment-timezone';
import * as io from 'socket.io-client';
import { FlashMessagesService } from 'angular2-flash-messages';
import {Router, ActivatedRoute, Params} from '@angular/router';
import { DatepickerModule as YourAlias } from 'angular2-material-datepicker'
@Component({
selector: 'app-details',
templateUrl: './account.component.html',
styleUrls: ['./account.component.css'],
providers: [ContactService,DatePipe]
})
export class AccountComponent implements OnInit {
@Output() private onClose: EventEmitter<AccountComponent> = new EventEmitter();
@Output() private onCancel: EventEmitter<any> = new EventEmitter();
public cancel(): void {
this.unselect();
this.onCancel.emit();
}
private unselect(): void {
//this.container.selectedPanel = undefined;
this.onClose.emit(this);
}
animal: string;
name: string;
/* foods = [
{value: 'SMS', viewValue: 'SMS'},
{value: 'Email', viewValue: 'Email'},
{value: 'Push', viewValue: 'Push Notification'},
]; */
foodss = [
{value: 'Daily', viewValue: 'Daily'},
/* {value: 'Weekly', viewValue: 'Weekly'},
{value: 'Monthly', viewValue: 'Monthly'}, */
];
devices = [
{value: 'steak-0', viewValue: 'Steak'},
{value: 'pizza-1', viewValue: 'Pizza'},
{value: 'tacos-2', viewValue: 'Tacos'}
];
device: Device;
Device_ID: string;
schedules: Schedule[];
schedule: Schedule;
schedulesb: Scheduleb[];
scheduleb: Scheduleb;
schedulesc: Schedulec[];
schedulec: Schedulec;
action:any;
rep:any;
month : boolean =false;
daydes : boolean =true;
myForm:any;
date:any;
dayselM:any ;
dayselT:any;
dayselW:any;
dayselTH:any;
dayselF:any;
dayselSa:any ;
dayselSu:any ;
Expiry:any;
date1:any;
date2:any;
df:any
sheds:any;
on_uid:any;
off_uid:any;
on_time_h:any;
on_time_m:any;
timedecoff_h:any;
timedecoff_m:any;
on_time:any;
off_time:any;
on_time_h_e:any;
on_time_m_e:any;
str:any;
sub_minutes:any;
hours_conv:any;
hour_on:any;
minute_on:any;
off_time_h_e:any;
off_time_h:any;
off_time_m_e:any;
off_time_m:any;
sub_minute:any;
hours_con:any;
hour_off:any;
minute_off:any
mess:any;
mess2:any;
ontime:any
offtime:any;
dev:any;
did:any;
dexp:any;
onn_time: Date ;
offf_time: Date;
panel:any;
private socket;
matrixred(link){
window.open(link);
}
saveForm(){
}
edit_schedule(a,b,c,d): void {
let dialogRef = this.dialog.open(EditScheComponent, {
width: '548px',
data: { did: this.deviceid, Device_name: a,on_time: b,off_time:c,on_id:d}
});
dialogRef.afterClosed().subscribe(result => {
this.on_table=[];
this.tabledata();
});
}
delete_schedule(did){
this.contactService.delshu(did)
.subscribe(
dev => {
this.dev = dev
//this._flashMessagesService.show('Deleted Sucessfully !!', { timeout: 1000});
this.on_table=[];
this.tabledata();
}
);
//this.on_table=[];
// this.tabledata();
}
logout(){
this.router.navigateByUrl("login");
}
soon(){
this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
openNav() {
this.router.navigateByUrl("location?_dname="+ this.userId +"_id="+this.deviceid);
}
addshe(onn_time,offf_time)
{
this.ontime = this.onn_time
this.offtime = this.offf_time
function randomString(length, chars) {
var mask = '';
if (chars.indexOf('a') > -1) mask += 'abcdefghijklmnopqrstuvwxyz';
if (chars.indexOf('A') > -1) mask += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
if (chars.indexOf('#') > -1) mask += '0123456789';
if (chars.indexOf('!') > -1) mask += '~`!@#$%^&*+-:";\'<>?,./|\\';
var result = '';
for (var i = length; i > 0; --i) result += mask[Math.floor(Math.random() * mask.length)];
return result;
}
this.on_uid=randomString(5, 'a#A');
this.off_uid=randomString(6, 'a#A');
this.did =this.userId;
this.dexp=this.Expiry
if(this.rep === "Daily" ){
if(this.ontime === undefined){
this._flashMessagesService.show('Error: Enter ON Time !!', { timeout: 2000});
}
else if(this.offtime === undefined){
this._flashMessagesService.show('Error: Enter OFF Time !!', { timeout: 2000});
}
else if(this.ontime == this.offtime){
this._flashMessagesService.show('Error: Same ON Time and OFF Time !!', { timeout: 2000});
}
else{
const newshe ={
did : this.did,
ontime: this.ontime,
on_uid:this.on_uid,
offtime: this.offtime,
off_uid:this.off_uid ,
wday: [this.dayselM,this.dayselT,this.dayselW,this.dayselTH,this.dayselF,this.dayselSa,this.dayselSu],
dexp : this.dexp
}
this.contactService.addshe(newshe)
.subscribe(schedule => {
this._flashMessagesService.show('Congratulation you have sucessfully created the scheduler !!!', { timeout: 1000});
this.tabledata();
this.panel.cancel()
this.schedules.push(schedule);
this.null_fun();
} , (err: any) => {
if(err.status == 500)
{
this.mess = err._body.split(":")[1] ;
this.mess2 = this.mess.split("}")[0];
this._flashMessagesService.show("Error: "+this.mess2, { timeout: 2000 });
}
}
);
}}
else if(this.rep === "Weekly")
{
const newshe ={
// repitation: this.rep,
did : this.userId,
on_time:this.on_time,
on_uid:this.on_uid,
off_time:this.off_time,
off_uid:this.off_uid,
w_day: [this.dayselM,this.dayselT,this.dayselW,this.dayselTH,this.dayselF,this.dayselSa,this.dayselSu],
wexp : this.Expiry
}
this.contactService.addshe(newshe)
.subscribe(scheduleb => {
this._flashMessagesService.show('Congratulation you have sucessfully created the scheduler !!!', { timeout: 3000});
this.null_fun();
this.contactService.getShe(this.devicename).subscribe(
data => {
this.sheds = data
this.final = this.sheds.daily_sched
});
this.schedulesb.push(scheduleb);
}, (err: any) => {
if(err.status == 500)
{
this.mess = err._body.split(":")[1] ;
this.mess2 = this.mess.split("}")[0];
this._flashMessagesService.show("Error: Scheduling For this Device Already Exict Please Remove Earlier one !!", { timeout: 7000 });
}
}
);
}
else if(this.rep === "Monthly")
{
let fromdate =this.datepipe.transform(this.date1, 'yyyy-MM-dd');
let todate =this.datepipe.transform(this.date2, 'yyyy-MM-dd');
const newshe ={
did : this.deviceid,
fdate: fromdate,
tdate: todate,
ftime:this.on_time,
on_uid:this.on_uid,
ttime:this.off_time,
off_uid:this.off_uid,
mexp : this.Expiry
}
var subbed = new Date(this.date1 - 3*60*60*1000);
/* this.on_time = null; */
/*
this.contactService.addshe(newshe)
.subscribe(schedulec => {
this._flashMessagesService.show('Congratulation you have sucessfully created the scheduler !!!', { timeout: 3000});
this.null_fun();
this.schedulesc.push(schedulec);
console.log(schedulec.message);
}, (err: any) => { console.log(err.status);
console.log(err);
if(err.status == 500)
{
this.mess = err._body.split(":")[1] ;
this.mess2 = this.mess.split("}")[0];
console.log(this.mess);
this._flashMessagesService.show("Error: Scheduling For this Device Already Exict Please Remove Earlier one !!", { timeout: 7000 });
console.log("Error");
}
}
); */
}
}
onChange(value){
if(value === "Daily"){
this.daydes = true;
this.dayselM = true ;
this.dayselT = true ;
this.dayselW = true ;
this.dayselTH = true ;
this.dayselF = true ;
this.dayselSa = true ;
this.dayselSu = true ;
}
else if(value === "Monthly")
{
this.daydes = false;
this.dayselM = false ;
this.dayselT = false ;
this.dayselW = false ;
this.dayselTH = false ;
this.dayselF = false ;
this.dayselSa = false ;
this.dayselSu = false ;
}
else{
this.daydes = true;
this.dayselM = false ;
this.dayselT = false ;
this.dayselW = false ;
this.dayselTH = false ;
this.dayselF = false ;
this.dayselSa = false ;
this.dayselSu = false ;
}
}
devi(){
this.router.navigateByUrl("dashboard");
}
cond:Boolean = false;
point : any = 0;
a(){
if(this.point == 0){
this.cond = true;
this.point ++;
}
else if(this.point % 2 == 0){
this.cond = true;
this.point ++;
}
else{
this.cond = false
this.point ++;
}
}
report(){
this.cond = false
this.router.navigateByUrl("device-report");
}
report_speed(){
// console.log("report speed call")
this.cond = false
this.router.navigateByUrl("device-report/device-speed-report");
}
delete(){
// console.log("DELETE RUNNING");
}
jun = moment();
constructor(private _flashMessagesService: FlashMessagesService,private router: Router,public datepipe: DatePipe,public dialog: MdDialog, private contactService: ContactService, private activatedRoute: ActivatedRoute) {
}
openDialog(): void {
let dialogRef = this.dialog.open(GmapComponent, {
width: '480px',
data: { did: this.deviceid, animal: this.animal }
});
dialogRef.afterClosed().subscribe(result => {
// console.log('The dialog was closed');
this.contactService.getmatrix( this.deviceid).subscribe(
mat_data => {
this.mat = mat_data
/* this.final = this.sheds[length].daily_sched.ontime;
*/
// console.log(this.mat);
// console.log( mat_data);
});
this.animal = result;
// console.log(this.animal);
/* this.l.push(this.animal) */
});
}
openDialog2(): void {
let dialogRef = this.dialog.open(RuleComponent, {
width: '700px',
//data: { name: "1234567890", animal: this.animal }
});
dialogRef.afterClosed().subscribe(result => {
// console.log('The dialog was closed');
// this.animal = result;
// console.log(this.animal);
// this.l.push(this.animal)
});
}
private l = [];
userId:any;
divinfo(){
}
fs :any;
ls :any;
or :any;
userID :any;
emailid :any;
devicess:any;
fm:any;
deviceid:any;
devicedata:any;
devicename:any;
final:any;
final2:any;
onGmt:any;
offGmt:any;
mat:any;
on:any;
off:any;
f_on:any;
f_off:any;
d:any;
f_did:any;
f_onn:any;
f_offf:any;
f_didd:any;
list:any;
del:boolean=true;
on_table = [];
data:any;
null_fun(){
// console.log("NULL CALLED");
this.ontime = undefined;
this.offtime = undefined;
this.rep = undefined;
this.on_time=null;
this.on_uid=null;
this.off_time=null;
this.off_uid=null;
this.dayselM=null;
this.dayselT=null;
this.dayselW=null;
this.dayselTH=null;
this.dayselF=null;
this.dayselSa=null;
this.dayselSu=null;
this.Expiry=null;
}
tabledata(){
this.contactService.getShe(this.devicename).subscribe(
data => {
this.sheds = data
this.on_table = []
this.on = this.sheds.split('|')[0];
this.f_onn = this.on.split('-'[0]);
this.f_on = this.f_onn[1]
let final_ON = this.f_on.split(',')
this.off = this.sheds.split('|')[1];
this.f_offf = this.off.split('-'[0]);
this.f_off = this.f_offf[1];
let final_OFF = this.f_off.split(',')
this.d = this.sheds.split('|')[2];
this.f_didd = this.d.split('-')[1];
this.f_did = this.f_didd
let on_id = this.sheds.split('|')[3];
let i_onid = on_id.split('-')[1];
let f_onid = i_onid.split('/')[0]
for(let i=0;i<final_ON.length;i++)
{
let f_o_t = this.f_on.split(',')[i];
let f_f_t = this.f_off.split(',')[i];
let f_o_id = f_onid.split(',')[i];
data={f_o_t,f_f_t,f_o_id}
this.on_table.push(data);
}
// console.log(this.on_table);
}, (err: any) => { console.log(err.status);
// console.log(err);
if(err.status == 500)
{
// console.log("No Schedule")
// this.on_table = null;
//this.del = false;
this.on_table = []
}
})
}
ngOnInit() {
this.fs = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).fn;
this.ls = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).ln;
this.emailid = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email;
this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName;
this.activatedRoute.queryParams.subscribe((params: Params) => {
let userId = params['_did'];
var devicedata = userId.split('.');
this.deviceid = devicedata[0];
this.devicename = devicedata[1];
this.userId = this.devicename;
});
/* this.contactService.getmatrix( this.deviceid).subscribe(
mat_data => {
this.mat = mat_data
console.log(this.mat);
console.log( mat_data);
}); */
this.tabledata();
}
}

View file

@ -0,0 +1,466 @@
<div class="container-fluid" style="background: #f9f9f9;padding:0px;height:80vh;padding: 18px;">
<div style="text-align: center; font-size: 22px; font-weight: 500; background: #426E86; padding-top: 5px; color: white; padding-bottom: 5px;">
<p style="margin-bottom: 0px;">{{title | translate}}</p>
</div>
<div class="row" style="margin:0px">
<div class="col-12">
<flash-messages style="float: center;margin:0px 1px;height:-6px;"></flash-messages>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="userID" placeholder="Enter User ID" name="userId" required>
<!-- <md-error class="pattern">{{'Please Enter User ID' | translate}}</md-error> -->
</md-form-field>
</div>
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="first_name" placeholder="{{'Enter First Name' | translate}}" name="first_name" required>
<md-error class="pattern">{{'Please Enter First Name' | translate}}</md-error>
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="last_name" placeholder="{{'Enter Last Name' | translate}}" name="last_name" required>
<md-error class="pattern">{{'Please Enter Last Name' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-6">
<md-form-field class="example-full-width width" (click)="stren();">
<input (keypress)="click2($event)" pattern="[^@^ ]+@[^@^ ]+\.[a-zA-Z]{2,}" mdInput type="text" [(ngModel)]="emaill" name="emaill" placeholder="{{'Enter Email ID ' | translate}}">
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width" (click)="stre();">
<i class="fas fa-eye" style="float:right;margin-bottom:12px;height:5px;cursor:pointer" (click)="showpassword('p1')" mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol"></i>
<!-- <md-icon style="float:right;margin-bottom:12px;height:5px;cursor:pointer" (click)="showpassword('p1')" mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol">{{passwordIcon}}</md-icon> -->
<input (keypress)="click2($event)" pattern="(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$"
mdInput type="{{passwordtype}}" [(ngModel)]="passwordd" name="passwordd" placeholder="{{'Enter Password' | translate}}" minlength="6"
maxlength="12" required>
<md-error class="required">{{'Invalid Password' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-6">
<md-form-field class="example-full-width width" (click)="stre();">
<i class="fas fa-eye" style="float:right;margin-bottom:12px;height:5px;cursor:pointer" (click)="showpassword('p2')" mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol"></i>
<!-- <md-icon style="float:right;margin-bottom:12px;height:5px;cursor:pointer" (click)="showpassword('p2')" mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol">{{passwordIcon_1}}</md-icon> -->
<input mdInput type="{{passwordtype_1}}" [(ngModel)]="password2" name="password2" placeholder="{{'Confirm Password' | translate}}" minlength="6" maxlength="12"
required>
<md-error class="required">{{'Please Enter Confirm Password' | translate}}</md-error>
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6">
<!-- <md-form-field class="example-full-width width" (click)="stren();">
<input (keypress)="click1($event)" onkeydown="call(event)" mdInput type="text" minlength="10" maxlength="10" [(ngModel)]="phone"
name="phone" placeholder="{{'Enter Mobile Number' | translate}}">
</md-form-field> -->
<md-form-field class="example-full-width width" (click)="stren();">
<input type="tel" id="demo" (keypress)="click1($event)" onkeydown="call(event)" mdInput id="telephone" [(ngModel)]="phone" >
</md-form-field>
</div>
<div class="col-6">
<md-input-container class="example-full-width width">
<input [disabled]="!superAdmin" mdInput placeholder="{{'Search Dealer' | translate}}" [mdAutocomplete]="tdAuto2" name="state" #state="ngModel" [(ngModel)]="dealerName"
(ngModelChange)="filterDealerStates(dealerName)">
<md-autocomplete #tdAuto2="mdAutocomplete">
<md-option *ngFor="let dealer of dealerSelect" [value]="dealer.dealer_firstname" (click)="dealerFinalVal(dealer)">
<span>{{ dealer.dealer_firstname?dealer.dealer_firstname:"" }} {{dealer.dealer_lastname?dealer.dealer_lastname:""}}</span>
</md-option>
</md-autocomplete>
</md-input-container>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="address" placeholder="{{'Enter address' | translate}}" name="address" >
<md-error class="pattern">{{'Please Enter address' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-6">
<lable>Timezone</lable>
<select id="dbselect" >
<option *ngFor="let zone of timezoneArray" [value]="zone.value" [selected] = "zone.value === timezone">{{ zone.viewValue }}</option>
</select>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-12"> <span>{{'Upload Documents' | translate}} :</span>
<button mdTooltip="upload Documents" style="border:1px solid transparent; background-color: transparent;cursor:pointer;float:right" (click)="AddDocumentsField('addedrow')">
<!-- <md-icon style="float: right;width:30px;height:30px;cursor:pointer">add</md-icon> -->
<i class="fas fa-plus" style="float: right;width:30px;height:30px;cursor:pointer"></i>
</button>
</div>
</div>
<div class="row" style="margin:0px" *ngFor="let data of imageuploadObject; let i =index" [ngClass]="{'rowHeight':docRow}">
<div class="col-3" style="padding-right: 0px">
<md-select class="example-full-width width" (ngModelChange)="documentType($event)" [(ngModel)] = "data.doctype" placeholder="{{'Doc Type' | translate}}">
<md-option *ngFor="let doc of documentList" [value]="doc.docId">{{doc.docName}}</md-option>
</md-select>
</div>
<div class="col-3" style="margin-top: 4px;padding-right: 0px">
<md-form-field class="example-full-width width">
<input type="text" [(ngModel)]="data.phone" mdInput placeholder="{{'Doc Number' | translate}}">
</md-form-field>
</div>
<div class="col-4" style="margin-top: 7px;padding-right: 0px">
<!-- <input type="file" class="btn btn btn-success" style="background: #f1f1f1;border: none;color: black;width:190px;" (change)="onFileChanged($event)"> -->
<input type="file" class="form-control" placeholder='{{"Choose a file..." | translate}}' (change)="onFileChanged($event)" />
</div>
<div class="col-2" style="padding-right: 0px">
<i class="fas fa-cloud-upload-alt" style="float: right;width:50px;height:50px;color:green; cursor:pointer;padding-top:15px;" (click)="onUpload(i)"></i>
<i class="fas fa-trash-alt" style="float: right;width:50px;height:50px;color:red; cursor:pointer;padding-top:15px;" (click)="DeleteDocumentsField(i)"></i>
<!-- <md-icon style="float: right;width:50px;height:50px;color:green; cursor:pointer;padding-top:15px;" (click)="onUpload(i)">cloud_upload</md-icon>
<md-icon style="float: right;width:50px;height:50px;color:red; cursor:pointer;padding-top:15px;" (click)="DeleteDocumentsField(i)">delete</md-icon> -->
</div>
</div>
<!-- <md-expansion-panel style="background: #fcfbfb;box-shadow: none"> -->
<!-- <md-expansion-panel-header>
<md-panel-title style="font-size: 15px;font-weight: 500;color: #615c5c;text-align: left; ">{{'ADDITIONAL SETTING' | translate}}
</md-panel-title>
</md-expansion-panel-header> -->
<span data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample"
style="font-size: 15px;font-weight: 500;color: #615c5c;text-align: left; ">{{'EMERGENCY CONTACT' | translate}}</span>
<div class="collapse" id="collapseExample">
<form [formGroup]="emergencyForm">
<div class="row" style="margin:0px">
<div class="col-6" style="border: solid 1px black;
margin-top: 8px;">
<h6 style="text-align: center;margin-top: 10px;">Contact Details 1</h6>
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_name1" placeholder="{{'Enter name' | translate}}" name="name">
<!-- <md-error class="pattern">{{'Please Enter address' | translate}}</md-error> -->
</md-form-field>
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_cell1" placeholder="{{'Enter Mobile Number 1' | translate}}"
name="emg_cell1">
<!-- <md-error class="pattern">{{'Please Enter address' | translate}}</md-error> -->
</md-form-field>
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_cell2" placeholder="{{'Enter Mobile Number 2' | translate}}"
name="emg_cell2">
<!-- <md-error class="pattern">{{'Please Enter address' | translate}}</md-error> -->
</md-form-field>
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_phone1" placeholder="{{'Enter phone Number 1' | translate}}"
name="emg_phone1">
<!-- <md-error class="pattern">{{'Please Enter address' | translate}}</md-error> -->
</md-form-field>
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_phone2" placeholder="{{'Enter phone Number 2' | translate}}"
name="emg_phone2">
<!-- <md-error class="pattern">{{'Please Enter address' | translate}}</md-error> -->
</md-form-field>
</div>
<div class="col-6" style="border: solid 1px black;
margin-top: 8px;">
<h6 style="text-align: center;margin-top: 10px;" >Contact Details 2</h6>
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_name2" placeholder="{{'Enter name' | translate}}" name="name">
<!-- <md-error class="pattern">{{'Please Enter address' | translate}}</md-error> -->
</md-form-field>
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_cell3" placeholder="{{'Enter Mobile Number 1' | translate}}"
name="emg_cell1">
<!-- <md-error class="pattern">{{'Please Enter address' | translate}}</md-error> -->
</md-form-field>
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_cell4" placeholder="{{'Enter Mobile Number 2' | translate}}"
name="emg_cell2">
<!-- <md-error class="pattern">{{'Please Enter address' | translate}}</md-error> -->
</md-form-field>
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_phone3" placeholder="{{'Enter phone Number 1' | translate}}"
name="emg_phone1">
<!-- <md-error class="pattern">{{'Please Enter address' | translate}}</md-error> -->
</md-form-field>
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_phone4" placeholder="{{'Enter phone Number 2' | translate}}"
name="emg_phone2">
<!-- <md-error class="pattern">{{'Please Enter address' | translate}}</md-error> -->
</md-form-field>
</div>
</div>
</form>
</div>
<!-- <md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_name1" placeholder="{{'Enter name' | translate}}" name="name">
</md-form-field>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_cell1" placeholder="{{'Enter Mobile Number' | translate}}"
name="emg_cell1">
</md-form-field>
</div>
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_cell2" placeholder="{{'Enter Mobile Number' | translate}}"
name="emg_cell2">
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_phone1" placeholder="{{'Enter Mobile Number' | translate}}"
name="emg_phone1">
</md-form-field>
</div>
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_phone2" placeholder="{{'Enter Mobile Number' | translate}}"
name="emg_phone2">
</md-form-field>
</div>
</div>
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_name2" placeholder="{{'Enter name' | translate}}" name="name">
</md-form-field>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_cell3" placeholder="{{'Enter Mobile Number' | translate}}"
name="emg_cell3">
</md-form-field>
</div>
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_cell4" placeholder="{{'Enter Mobile Number' | translate}}"
name="emg_cell4">
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_phone3" placeholder="{{'Enter Mobile Number' | translate}}"
name="emg_phone3">
</md-form-field>
</div>
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" formControlName="emg_phone4" placeholder="{{'Enter Mobile Number' | translate}}"
name="emg_phone4">
!-- <md-error class="pattern">{{'Please Enter address' | translate}}</md-error> --
</md-form-field>
</div>
</div> -->
<!-- </md-expansion-panel> -->
<div class="row" style="text-align: center;padding-top: 20px;margin:0px">
<div class="col-12">
<button *ngIf="!isTechnician" style="background-color:rgb(48, 100, 197);color:#fdfdfd;width: 135px;" md-raised-button (click)="addContact2()">{{'SUBMIT' | translate}}</button>
<button *ngIf="isTechnician" style="background-color:rgb(48, 100, 197);color:#fdfdfd;width: 135px;" md-raised-button
(click)="addContact3()">{{'SUBMIT' | translate}}</button>
<button style="background-color: #d81111;color:#fdfdfd;width: 135px;" md-raised-button (click)="closebox()">{{'CANCEL' | translate}}</button>
</div>
</div>
<!-- <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#demo">Simple collapsible</button>
<div id="demo" class="collapse">
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div> -->
</div>
<!-- ===============================backup================================================= -->
<!-- <div style="height:90vh;">
<h4 style="text-align:center;">Add Custumer</h4>
<div class="row">
<div class="col-sm-4" style="padding-top: 15px;">
<span >User ID:</span>
</div>
<div class="col-sm-8">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="userID" placeholder="Enter User ID" name="userId" required>
<md-error class="pattern">Please Enter User ID</md-error>
</md-form-field>
</div>
</div>
<div class="row">
<div class="col-sm-4" style="padding-top: 15px;">
<span >First Name:</span>
</div>
<div class="col-sm-8">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="first_name" placeholder="Enter First Name" name="first_name" required>
<md-error class="pattern">Please Enter First Name</md-error>
</md-form-field>
</div>
</div>
<div class="row">
<div class="col-sm-4" style="padding-top: 15px;">
<span >Last Name:</span>
</div>
<div class="col-sm-8">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="last_name" placeholder="Enter Last Name" name="last_name" required>
<md-error class="pattern">Please Enter Last Name</md-error>
</md-form-field>
</div>
</div>
<div class="row">
<div class="col-sm-4" style="padding-top: 15px;">
<span >Email ID:</span>
</div>
<div class="col-sm-8">
<md-form-field class="example-full-width width" (click)="stren();">
<input (keypress)="click2($event)" pattern="[^@^ ]+@[^@^ ]+\.[a-zA-Z]{2,}" mdInput type="text" [(ngModel)]="emaill" name="emaill"
placeholder="Enter Email ID">
</md-form-field>
</div>
</div>
<div class="row">
<div class="col-sm-4" style="padding-top: 15px;">
<span >Password:</span>
</div>
<div class="col-sm-8">
<md-form-field class="example-full-width width" (click)="stre();">
<md-icon style="float:right;margin-bottom:12px;height:5px;cursor:pointer" mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol">info_outline</md-icon>
<input (keypress)="click2($event)" pattern="(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$" (keypress)="click2($event2)"
mdInput type="password" [(ngModel)]="passwordd" name="passwordd" placeholder="Enter Password" minlength="6"
maxlength="12" required>
<md-error class="required">Invalid Password</md-error>
</md-form-field>
</div>
</div>
<div class="row">
<div class="col-sm-4" style="padding-top: 15px;">
<span >Confirm Password:</span>
</div>
<div class="col-sm-8">
<md-form-field class="example-full-width width" (click)="stre();">
<input mdInput type="password" [(ngModel)]="password2" name="password2" placeholder="Confirm Password" minlength="6" maxlength="12"
required>
<md-error class="required">Please Enter Confirm Password</md-error>
</md-form-field>
</div>
</div>
<div class="row">
<div class="col-sm-4" style="padding-top: 15px;">
<span >Mobile Number:</span>
</div>
<div class="col-sm-8">
<md-form-field class="example-full-width width" (click)="stren();">
<input (keypress)="click1($event)" onkeydown="call(event)" mdInput type="text" minlength="10" maxlength="10" [(ngModel)]="phone"
name="phone" placeholder="Enter Mobile Number">
</md-form-field>
</div>
</div>
<p>upload document</p>
<div class="row">
<div class = "col-sm-6">
<span>Upload Documents * :</span>
</div>
<div class = "col-sm-6">
<button mdTooltip="upload Documents" style="border:1px solid transparent; background-color: transparent;cursor:pointer;float:right" (click)="AddDocumentsField('addedrow')"><md-icon style="float: right;width:30px;height:30px;cursor:pointer">add</md-icon></button>
</div>
</div>
<div style="overflow: scroll" [ngClass]="{'rowHeight':docRow}">
<div class= "row" style="margin-bottom: 2%;" *ngFor="let data of imageuploadObject; let i =index">
<div class="col-sm-2" >
<md-select (ngModelChange)="documentType($event)" [(ngModel)] = "data.doctype" placeholder = "Doc Type">
<md-option *ngFor="let doc of documentList" [value]="doc.docId">{{doc.docName}}</md-option>
</md-select>
</div>
<div class="col-sm-10" style="margin-top: 2%;">
<input type="text" style ="margin-right: 2%;margin-left: 7px;" [(ngModel)]="data.phone" placeholder="Doc number">
<span><input type="file" class="btn btn btn-success" style ="background: #f1f1f1;border: none;color: black;margin-right: 2%;width:36%;" (change)="onFileChanged($event)" ></span>
<span><button class="btn btn btn-success" (click)="onUpload(i)">Upload!</button></span>
<span><button mdTooltip="Delete field" style="padding:0px;border:1px solid transparent; background-color: transparent;cursor:pointer;float:right" (click)="DeleteDocumentsField(i)"><md-icon style="float: right;width:50px;height:50px;color:red; cursor:pointer">delete</md-icon></button></span>
</div>
</div>
</div>
<p>upload document</p>
<div class="row">
<div class="col-sm-4" style="padding-top: 15px;">
<span >Dealer:</span>
</div>
<div class="col-sm-8">
<md-input-container>
<input [disabled]="!superAdmin" mdInput placeholder="Search Dealer" [mdAutocomplete]="tdAuto2" name="state" #state="ngModel" [(ngModel)]="dealerName"
(ngModelChange)="filterDealerStates(dealerName)">
<md-autocomplete #tdAuto2="mdAutocomplete">
<md-option *ngFor="let dealer of dealerSelect" [value]="dealer.dealer_firstname" (click)="dealerFinalVal(dealer)">
<span>{{ dealer.dealer_firstname?dealer.dealer_firstname:"" }} {{dealer.dealer_lastname?dealer.dealer_lastname:""}}</span>
</md-option>
</md-autocomplete>
</md-input-container>
</div>
</div>
<div class="row">
<div class="col-sm-4" style="padding-top: 15px;">
<span >Address :</span>
</div>
<div class="col-sm-8">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="address" placeholder="Enter address" name="address" required>
<md-error class="pattern">Please Enter address</md-error>
</md-form-field>
</div>
</div>
<div class="row">
<div class="col-sm-12" style="padding-left:35%">
<input type="submit" class="btn btn btn-success" style="cursor:pointer;width: 177px;" value="Submit" (click)="addContact2()"/>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<flash-messages style="float: center;margin:0px 1px;height:-6px;"></flash-messages>
</div>
</div>
</div>
-->

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddCustComponent } from './add-cust.component';
describe('AddCustComponent', () => {
let component: AddCustComponent;
let fixture: ComponentFixture<AddCustComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddCustComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddCustComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,128 @@
<div class="container-fluid" style="background: #f9f9f9;padding:0px">
<div style="text-align: center; font-size: 22px; font-weight: 500; background: #426E86; padding-top: 5px; color: white; padding-bottom: 5px;">
<p>{{'ADD DEALER' | translate}}</p>
</div>
<div class="row" style="margin:0px">
<div class="col-12">
<flash-messages style="float: center;margin:0px 1px;height:-6px;"></flash-messages>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="userID" placeholder="{{'Enter User ID' | translate}}" name="userId" required>
<md-error class="pattern">{{'Please Enter User ID' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="first_name" placeholder="{{'Enter First Name' | translate}}" name="first_name" required>
<md-error class="pattern">{{'Please Enter First Name' | translate}}</md-error>
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="last_name" placeholder="{{'Enter Last Name' | translate}}" name="last_name" required>
<md-error class="pattern">{{'Please Enter Last Name' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-6">
<md-form-field class="example-full-width width" (click)="stren();">
<input (keypress)="click2($event)" pattern="[^@^ ]+@[^@^ ]+\.[a-zA-Z]{2,}" mdInput type="text" [(ngModel)]="emaill" name="emaill" placeholder="{{'Enter Email ID ' | translate}}">
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width" (click)="stre();">
<i class="fas fa-eye" style="float:right;margin-bottom:12px;height:5px;cursor:pointer" mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol" (click)="showpassword('p1')"></i>
<!-- <md-icon style="float:right;margin-bottom:12px;height:5px;cursor:pointer" mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol" (click)="showpassword('p1')">{{passwordIcon}}</md-icon> -->
<input (keypress)="click2($event)" pattern="(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$" (keypress)="click2($event2)" mdInput type="{{passwordtype}}" [(ngModel)]="passwordd" name="passwordd" placeholder="{{'Enter Password' | translate}}" minlength="6" maxlength="12" required>
<md-error class="required">{{'Invalid Password' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-6">
<md-form-field class="example-full-width width" (click)="stre();">
<i class="fas fa-eye" style="float:right;margin-bottom:12px;height:5px;cursor:pointer" mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol" (click)="showpassword('p2')"></i>
<!-- <md-icon style="float:right;margin-bottom:12px;height:5px;cursor:pointer" mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol" (click)="showpassword('p2')">{{passwordIcon_1}}</md-icon> -->
<input mdInput type="{{passwordtype_1}}" [(ngModel)]="password2" name="password2" placeholder="{{'Confirm Password' | translate}}" minlength="6" maxlength="12" required>
<md-error class="required">{{'Please Enter Confirm Password' | translate}}</md-error>
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6">
<md-form-field class="example-full-width width" (click)="stren();">
<input type="tel" (keypress)="click1($event)" onkeydown="call(event)" mdInput id="telephone" [(ngModel)]="phone" minlength="10" maxlength="10">
</md-form-field>
</div>
<div class="col-6">
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="address" placeholder="{{'Enter address' | translate}}" name="address" required>
<md-error class="pattern">{{'Please Enter address' | translate}}</md-error>
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-6" style="margin-bottom: 20px;">
<lable>Timezone</lable>
<select id="dbselect" >
<option *ngFor="let zone of timezoneArray" [value]="zone.value" [selected] = "zone.value === timezone">{{ zone.viewValue }}</option>
</select>
</div>
<div class="col-6" style="margin-bottom: 20px;">
<lable>Inventory</lable>
<md-slide-toggle style="margin-top: 5px;" [(ngModel)]="inventoryManagement" ngDefaultControl>
</md-slide-toggle>
<span style="margin-right: 10px;">Bussiness Type :</span>
<md-slide-toggle style="margin-top: 5px;" [(ngModel)]="bussinessType" ngDefaultControl>
</md-slide-toggle>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-12"> <span>{{'Upload Documents' | translate}} :</span>
<button mdTooltip="upload Documents" style="border:1px solid transparent; background-color: transparent;cursor:pointer;float:right" (click)="AddDocumentsField('addedrow')">
<!-- <md-icon style="float: right;width:30px;height:30px;cursor:pointer">add</md-icon> -->
<i class="fas fa-plus" style="float: right;width:30px;height:30px;cursor:pointer"></i>
</button>
</div>
</div>
<div class="row" style="margin:0px" *ngFor="let data of imageuploadObject; let i =index" [ngClass]="{'rowHeight':docRow}">
<div class="col-3" style="padding-right: 0px">
<md-select class="example-full-width width" (ngModelChange)="documentType($event)" [(ngModel)]="data.doctype" placeholder="{{'Doc Type' | translate}}">
<md-option *ngFor="let doc of documentList" [value]="doc.docId">{{doc.docName}}</md-option>
</md-select>
</div>
<div class="col-3" style="margin-top: 4px;padding-right: 0px">
<md-form-field class="example-full-width width">
<input type="text" [(ngModel)]="data.phone" mdInput placeholder="{{'Doc Number' | translate}}">
</md-form-field>
</div>
<div class="col-4" style="margin-top: 7px;padding-right: 0px">
<!-- <input type="file" class="btn btn btn-success" style="background: #f1f1f1;border: none;color: black;width:190px;" (change)="onFileChanged($event)"> -->
<input type="file" class="form-control" placeholder='{{"Choose a file..." | translate}}' (change)="onFileChanged($event)" />
</div>
<div class="col-2" style="padding-right: 0px">
<i class="fas fa-cloud-upload-alt" style="float: right;width:50px;height:50px;color:green; cursor:pointer;padding-top:15px;" (click)="onUpload(i)"></i>
<i class="fas fa-trash-alt"
style="float: right;width:50px;height:50px;color:#d81111;; cursor:pointer;padding-top:15px;" (click)="DeleteDocumentsField(i)"></i>
<!-- <md-icon style="float: right;width:50px;height:50px;color:green; cursor:pointer;padding-top:15px;" (click)="onUpload(i)">cloud_upload</md-icon> -->
<!-- <md-icon style="float: right;width:50px;height:50px;color:#d81111;; cursor:pointer;padding-top:15px;" (click)="DeleteDocumentsField(i)">delete</md-icon> -->
</div>
</div>
<div class="row" style="margin:0px" style="text-align: center;padding-top: 20px;">
<div class="col-12">
<button style="background-color: #484848;color:#fdfdfd;width: 135px;" md-raised-button (click)="addContact2()">{{'SUBMIT' | translate}}</button>
<button style="background-color: red;color:#fdfdfd;width: 135px;" md-raised-button (click)="closebox()">{{'CANCEL' | translate}}</button>
</div>
</div>
</div>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddDealerComponent } from './add-dealer.component';
describe('AddDealerComponent', () => {
let component: AddDealerComponent;
let fixture: ComponentFixture<AddDealerComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddDealerComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddDealerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,801 @@
import { FormGroup, FormControl, Validators} from '@angular/forms';
import {ResponseOptions, Response} from '@angular/http';
import {Contact} from '../contact';
import {ContactService} from '../contact.service';
import {Otp} from '../otp';
// import {Md5} from 'ts-md5/dist/md5';
import * as moment from 'moment-timezone';
declare var google :any;
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { FlashMessagesService } from 'angular2-flash-messages';
import { AbstractControl, NG_VALIDATORS, Validator, ValidatorFn } from '@angular/forms';
const EMAIL_REGEX =/^[a-zA-Z0-9.!#$%&*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
import { Component, OnInit,Inject } from '@angular/core';
import {MdDialog, MdDialogRef, MD_DIALOG_DATA} from '@angular/material';
declare var swal: any;
declare var ol : any;
declare var $:any;
@Component({
selector: 'app-add-dealer',
templateUrl: './add-dealer.component.html',
styleUrls: ['./add-dealer.component.scss'],
providers:[ContactService]
})
export class AddDealerComponent implements OnInit {
superAdmin: any;
inventoryManagement
show1:boolean = false;
show2:boolean = true;
passwordtype : any = 'password';
passwordtype_1 :any = 'password';
show3:boolean = false;
first_name:any=null;
imageuploadObject = [];
timezone:any = 'Asia/Kolkata';
last_name:any=null;
passwordd:any=null;
org_name:any=null;
emaill:any=null;
phone:any=null;
executed:any;
$event2:any;
dealer:any;
contacts: Contact[]=[];
contact: Contact;
login1:any;
mess2:any;
mess:any;
otp:any;
str:boolean = false;
password2:any=null;
before:any;
emmnerr:any;
Load:any
$event:any;
fs:any;
ls:any;
emailid:any;
or:any;
useridd:any;
custtype:any;
cust:boolean=false;
mb:any;
logo:any;
text:any;
userID:any;
address:any;
sup_admin: any;
documentDetail:any;
imageURL:any;
documentList = [
{
"docId": "Adhar",
"docName": "Adhar Card"
},
{
"docId": "voterCard",
"docName": "Voter Id"
},
{
"docId": "PAN",
"docName": "Pan Card"
},
{
"docId": "DL",
"docName": "Driving License"
},
{
"docId": "Nepali Citizenship",
"docName": "Nepali Citizenship"
}
];
countrySelected: { countryCode: any; dialcode: any; };
timezoneArray: any[];
telCountryCode: any;
constructor(private contactService: ContactService,private router: Router,private _flashMessagesService: FlashMessagesService,public dialogRef: MdDialogRef<AddDealerComponent>,
@Inject(MD_DIALOG_DATA) public data: any) {
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.0/js/intlTelInput-jquery.min.js");
document.getElementsByTagName("head")[0].appendChild(script);
var initialObj = {
doctype:'',
image:'',
phone:''
}
this.imageuploadObject.push(initialObj);
}
bussinessType:boolean=false;
ngOnInit() {
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
this.fs = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).fn;
this.ls = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).ln;
this.emailid = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email;
this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName;
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.mb = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).phn;
// this.bussinessType=this.data.userInfo.bussinessType?this.data.userInfo.bussinessType=="1"?true:false:false
this.sup_admin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).supAdmin;
var that = this;
setTimeout(() => {
that.telCountryCode = $("#telephone").intlTelInput({
allowDropdown:true,
autoPlaceholder:"Enter Mobile Number",
initialCountry:"in",
preferredCountries: ["in","us" ],
separateDialCode:true,
});
}, 300);
var Phoneinput = document.getElementById('telephone');
var that = this;
Phoneinput.addEventListener("countrychange",function(p) {
console.log("Inside Function");
var countryData = $('#telephone').intlTelInput("getSelectedCountryData");
console.log(countryData);
that.countrySelected = {
countryCode : countryData.iso2,
dialcode: countryData.dialCode
}
});
if(this.superAdmin){
this.sup_admin = this.useridd;
}
this.custtype = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer;
// this.getdev();
if(this.mb.charAt(0)=="n"){
this.mb = ' '
}
if(this.custtype == true){
this.cust = true;
}
this.logo=window.localStorage['logo'];
this.text=window.localStorage['text'];
var timeZn = moment.tz.guess();
if(timeZn != 'Asia/Calcutta'){
this.timezone = timeZn;
}
console.log(this.timezone);
var timeZones = moment.tz.names();
console.log(timeZones);
this.timezoneArray=[];
for (var i in timeZones) {
this.timezoneArray.push({ viewValue: "(GMT" + moment.tz(timeZones[i]).format('Z') + ")" + timeZones[i], value: timeZones[i] });
}
setTimeout(() => {
$('#dbselect').multipleSelect({
width: 300,
placeholder: 'Select Timezone',
filter: true,
single: true,
selectAll: false
})
}, 100);
this.latLongDetail()
}
stre(){
this.str =true;
}
stren(){
this.str =false;
}
addcus(){
this.router.navigateByUrl("add");
}
clear(){
this.first_name=' '
this.last_name=' '
this.emaill = null
this.phone = null
}
addContact2(){
var tzone = $('#dbselect').multipleSelect('getSelects','value');
console.log(tzone);
var expDate = new Date()
expDate.setFullYear(expDate.getFullYear()+1);
var countryData = $('#telephone').intlTelInput("getSelectedCountryData");
console.log(countryData);
this.countrySelected = {
countryCode : countryData.iso2,
dialcode: countryData.dialCode
}
console.log('expDate=>',expDate);
if(this.first_name==null || this.last_name==null || this.passwordd==null)
{
return this._flashMessagesService.show('Please fill all Requied fields', { cssClass: 'alert-danger', timeout: 3000 });
}
else if((this.userID == undefined)||(this.userID.trim() == '')){
return this._flashMessagesService.show('User ID is mandatory', { cssClass: 'alert-danger', timeout: 3000 });
}
// else if((this.emaill == undefined)||(this.emaill.trim() == '')){
// return this._flashMessagesService.show('Email is mandatory', { cssClass: 'alert-danger', timeout: 3000 });
// }
else if(this.password2 != this.passwordd){
// this._flashMessagesService.show('Password and Confirm Password do not match', { cssClass: 'alert-danger', timeout: 3000 });
this.tost1("psdnmtch")
}
else if (this.emaill && this.phone){
this.Load=true
// if (!this.executed) {
// this.executed = true;
const newContact2 ={
first_name: this.first_name,
last_name: this.last_name,
email: this.emaill,
password: this.passwordd,
phone: this.phone,
isDealer: true,
custumer:false,
sysadmin:this.superAdmin,
expdate : new Date(expDate),
supAdmin:this.sup_admin,
user_id:this.userID,
address:this.address
}
if(this.inventoryManagement!=undefined){
newContact2['inventoryManagement']=this.inventoryManagement;
}
if(this.bussinessType!=undefined){
newContact2['bussinessType']=this.bussinessType?"1":"0";
}
if(this.countrySelected != undefined){
newContact2['std_code']=this.countrySelected;
}
if (tzone != undefined) {
newContact2['timezone'] = tzone[0];
}
if(this.imageuploadObject.length > 0){
for(var d = 0 ;d <this.imageuploadObject.length;d++){
if((this.imageuploadObject[d].doctype == "")&&(this.imageuploadObject[d].image == "")&&(this.imageuploadObject[d].phone == "")){
this.imageuploadObject.splice(d,1);
}
}
}
console.log("Final DOC ARRAY",this.imageuploadObject);
newContact2['imageDoc'] = this.imageuploadObject;
console.log(newContact2);
this.contactService.addContact(newContact2)
.subscribe(contact => {
console.log(contact);
// USER_ID already exists
if(contact.message == "USER_ID already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}if(contact.message == "USER_ID already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else if(contact.message == "User Duplicate"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else if(contact.message == "Email ID already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else if(contact.message == "Mobile Number already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else{
this.clear();
this.Load=false
this.onNoClick("succ");
this.contacts.push(contact);
}
}, (err: any) => {
// console.log(err.status);
// console.log(err);
if(err.status == 500)
{
// console.log(err._body);
this.Load=false
this.emmnerr=JSON.parse(err._body);
this.data_descip = this.emmnerr.split(':')[1];
console.log(this.data_descip);
swal(
'Error',
this.data_descip,
'error'
)
this.tost1("EmM")
}
else{
this.Load=false
swal(
'Error',
'Internal Server error , Please try after sometime !!!',
'error'
)
}
});
/* this._flashMessagesService.show('OTP Sent Sucessfully', { cssClass: 'alert-success', timeout: 3000 }); */
}
else if((this.phone)||(this.userID)){
this.Load=true
// if (!this.executed) {
// this.executed = true;
const newContact2 ={
first_name: this.first_name,
last_name: this.last_name,
password: this.passwordd,
// phone: this.phone,
isDealer: true,
custumer:false,
sysadmin:this.superAdmin,
expdate : new Date(expDate).toISOString(),
supAdmin:this.sup_admin,
// user_id:this.userID,
address:this.address
}
if(this.phone){
newContact2['phone'] = this.phone ;
}
if(this.countrySelected != undefined){
newContact2['std_code']=this.countrySelected;
}
if(tzone != undefined){
newContact2['timezone'] = tzone[0];
}
if(this.inventoryManagement!=undefined){
newContact2['inventoryManagement']=this.inventoryManagement;
}
if(this.bussinessType!=undefined){
newContact2['bussinessType']=this.bussinessType?"1":"0";
}
if(this.userID){
newContact2['user_id'] = this.userID ;
}
if(this.imageuploadObject.length > 0){
for(var d = 0 ;d <this.imageuploadObject.length;d++){
if((this.imageuploadObject[d].doctype == "")&&(this.imageuploadObject[d].image == "")&&(this.imageuploadObject[d].phone == "")){
this.imageuploadObject.splice(d,1);
}
}
}
newContact2['imageDoc'] = this.imageuploadObject;
this.contactService.addContact(newContact2)
.subscribe(contact => {
if(contact.message == "USER_ID already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}if(contact.message == "USER_ID already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else if(contact.message == "User Duplicate"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else if(contact.message == "Email ID already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else if(contact.message == "Mobile Number already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else{
this.clear();
this.Load=false;
this.onNoClick("succ");
this.contacts.push(contact);
}
}, (err: any) => {
if(err.status == 500)
{
// console.log(err._body);
this.Load=false
this.emmnerr=JSON.parse(err._body);
this.data_descip = this.emmnerr.split(':')[1];
console.log(this.data_descip);
swal(
'Error',
this.data_descip,
'error'
)
this.tost1("EmM")
}
else{
this.Load=false
// console.log("dadsa");
swal(
'Error',
'Internal Server error , Please try after sometime !!!',
'error'
)
}})}
else if(this.emaill){
// if (!this.executed) {
// this.executed = true;
const newContact2 ={
first_name: this.first_name,
last_name: this.last_name,
password: this.passwordd,
org_name: this.org_name,
email: this.emaill,
isDealer: true,
custumer:false,
sysadmin:this.superAdmin,
expdate : new Date(expDate).toISOString(),
supAdmin:this.sup_admin,
user_id:this.userID,
address:this.address
}
if(this.countrySelected != undefined){
newContact2['std_code']=this.countrySelected;
}
if(tzone != undefined){
newContact2['timezone'] = tzone[0];
}
if(this.inventoryManagement!=undefined){
newContact2['inventoryManagement']=this.inventoryManagement;
}
if(this.bussinessType!=undefined){
newContact2['bussinessType']=this.bussinessType?"1":"0";
}
if(this.imageuploadObject.length > 0){
for(var d = 0 ;d <this.imageuploadObject.length;d++){
if((this.imageuploadObject[d].doctype == "")&&(this.imageuploadObject[d].image == "")&&(this.imageuploadObject[d].phone == "")){
this.imageuploadObject.splice(d,1);
}
}
}
newContact2['imageDoc'] = this.imageuploadObject;
this.contactService.addContact(newContact2)
.subscribe(contact => {
console.log(contact);
// USER_ID already exists
//this.tost1("succ")
if(contact.message == "USER_ID already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}if(contact.message == "USER_ID already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else if(contact.message == "User Duplicate"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else if(contact.message == "Email ID already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else if(contact.message == "Mobile Number already exists"){
return this._flashMessagesService.show(contact.message, { cssClass: 'alert-danger', timeout: 3000 });
}else{
this.clear();
this.Load=false
this.onNoClick("succ");
this.contacts.push(contact);
}
}, (err: any) => {
if(err.status == 500)
{
// console.log(err._body);
this.Load=false
this.emmnerr=JSON.parse(err._body);
this.data_descip = this.emmnerr.split(':')[1];
console.log(this.data_descip);
swal(
'Error',
this.data_descip,
'error'
)
// console.log(this.emmnerr)
this.tost1("EmM")
}
else{
this.Load=false
swal(
'Error',
'Internal Server error , Please try after sometime !!!',
'error'
)
}});
}
}
data_descip:any;
onNoClick(a): void {
this.dialogRef.close(a);
}
tost1(divid){
if(divid == "EmM"){
this.data_descip = this.emmnerr.split(":")[1]
this._flashMessagesService.show(this.data_descip, { cssClass: 'alert-danger', timeout: 3000 });
}
else if(divid == "succ"){
this.data_descip = "Dealer Successfully Added"
this._flashMessagesService.show(this.data_descip, { cssClass: 'alert-success', timeout: 3000 });
}
else if(divid == "psdnmtch"){
this.data_descip = "Error: Password and confirm password do not match"
this._flashMessagesService.show(this.data_descip, { cssClass: 'alert-danger', timeout: 3000 });
}
// function launch_toast() {
// // console.log(divid);
// var x = document.getElementById("toast")
// //console.log(x);
// x.className = "show";
// setTimeout(function(){ x.className = x.className.replace("show", ""); }, 4500);
// }
}
valclear(){
this._flashMessagesService.show("Cleared", { cssClass: 'alert-warning', timeout: 2000 });
}
devicess:any;
final:any;
click1(event){
this.show2=false;
this.show3=true;
if((event.keyCode >= 48 && event.keyCode <= 57) || event.keyCode == 9 || event.keyCode == 8 || event.keyCode == 46 || event.keyCode == 37 || event.keyCode == 39){
}
/* if(event.keyCode===13){
this.otp_window();
} */
else
event.preventDefault();
}
click2(event2){
this.show2=true;
this.show3=false;
}
call(e) {
{
if (e.keyCode == 32) {
e.preventDefault();
}
}
}
getdev(){
let foods = []
this.contactService.getDevice(this.emailid,this.useridd).subscribe(
data => {
this.devicess = data
let swap;
for(let g = 0;g<this.devicess.devices.length-1;g++ ){
for(let c = 0;c<this.devicess.devices.length-g-1;c++ ){
if(this.devicess.devices[c].Device_Name>this.devicess.devices[c+1].Device_Name){
swap = this.devicess.devices[c];
this.devicess.devices[c] = this.devicess.devices[c+1];
this.devicess.devices[c+1] = swap;
}
}
}
this.final = this.devicess.devices
for(let i=0;i<this.devicess.devices.length;i++){
// if(this.devicess.devices[i].type_of_device =="Tracker"){
let a ={
value : this.devicess.devices[i].Device_Name,
viewValue:this.devicess.devices[i].Device_Name
}
foods.push(a);
// }
}
});
}
cond:Boolean = false;
point : any = 0;
aa(){
console.log(this.point);
if(this.point == 0){
this.cond = true;
this.point ++;
}
else if(this.point % 2 == 0){
this.cond = true;
this.point ++;
}
else{
this.cond = false
this.point ++;
}
}
documentType(docType){
console.log("doctypeObject=>",docType);
}
docRow:boolean=false;
AddDocumentsField(addedRow){
if(addedRow){
this.docRow = true;
}
var obj={doctype:'',image:''};
this.imageuploadObject.push(obj);
console.log(this.imageuploadObject);
// console.log("ImageuploadObject=>",this.imageuploadObject);
}
DeleteDocumentsField(index){
console.log(this.imageuploadObject.length);
if(this.imageuploadObject.length == 1){
this.docRow = false;
}
this.imageuploadObject.splice(index, 1);
}
selectedFile: File;
onFileChanged(event) {
this.selectedFile = <File>event.target.files[0];
console.log(this.selectedFile);
}
closebox(){
this.dialogRef.close(null);
}
onUpload(imgIndex) {
console.log(imgIndex);
console.log(this.imageuploadObject);
const fd = new FormData();
fd.append('photo',this.selectedFile,this.selectedFile.name)
console.log("imgURL=>",fd) ;
this.contactService.imageupload(fd)
.subscribe(res=>{
var resImage ='';
resImage = res['_body'];
console.log(res['_body']);
this.imageuploadObject[imgIndex].image = resImage;
console.log(this.imageuploadObject);
// console.log(res);
},err=>{
console.log(err);
})
}
passwordIcon:any='visibility_off';
passwordIcon_1:any='visibility_off';
showpassword(p:any){
if((p == 'p1')&&(this.passwordtype == "password")){
this.passwordtype = 'text';
this.passwordIcon = 'visibility';
return;
}
if((p == 'p1')&&(this.passwordtype == "text")){
this.passwordtype = 'password'
this.passwordIcon = 'visibility_off';
return;
}
if((p == 'p2')&&(this.passwordtype_1 == "password")){
this.passwordtype_1 = 'text';
this.passwordIcon_1 = 'visibility';
return;
}
if((p == 'p2')&&(this.passwordtype_1 == "text")){
this.passwordtype_1 = 'password';
this.passwordIcon_1 = 'visibility_off';
return;
}
}
latLongDetail(){
var that =this;
console.log("Inside Latlong Function");
if (navigator.geolocation) {
if(location.protocol != 'https:'){
this.contactService.getlatLong().subscribe(res=>{
console.log(res);
let t_latlng = new google.maps.LatLng(res.lat, res.lon);
let request = {
latLng: t_latlng
};
this.getAddress(request);
})
}else{
navigator.geolocation.getCurrentPosition(function(position) {
var d_lat= position.coords.latitude;
var d_lng=position.coords.longitude;
let t_latlng = new google.maps.LatLng(d_lat, d_lng);
let request = {
latLng: t_latlng
};
that.getAddress(request);
})
}}
}
getAddress(request){
let geocoder = new google.maps.Geocoder();
geocoder.geocode(request, function (data, status) {
console.log("Inside geocoder function");
var userCountry;
if (status == google.maps.GeocoderStatus.OK) {
if (data[0] != null) {
var address_show = data[0];
console.log('var=>' ,address_show);
for (var ac = 0; ac < data[0].address_components.length; ac++) {
var component = data[0].address_components[ac];
switch(component.types[0]) {
case 'country':
userCountry = component.short_name;
console.log(userCountry);
break;
}
};
var aaa = $('#telephone').intlTelInput("setCountry",userCountry);
} else {
userCountry = 'in';
}
}
else {
console.log("Inside Error function");
userCountry = 'in';
}
})
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,363 @@
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
</head>
<body>
<app-all-menus></app-all-menus>
<div class="small">
<button md-button [mdMenuTriggerFor]="menu" style="padding:0%;"><i class="material-icons">list</i></button>
<md-menu #menu="mdMenu">
<a href="#">
<h6>DASHBOARD
<md-icon style="float:right">dashboard</md-icon>
</h6>
</a>
<a href="#"><h6>RULES<md-icon style="float:right">dock</md-icon></h6></a>
</md-menu>
</div>
<div style="float:left; width: 100%;padding-top: 6%;">
<div class="loading" *ngIf="Load">Loading&#8230;</div>
<md-card style="opacity: .9;margin-top: 15px;background: #fcfbfb;">
<h4 style="float:left;color:#855353">{{'Add Device Model' | translate}}</h4> <br><hr>
<!-- ----------------------- Body of Driver Form----------------------------------------------------- -->
<form #signupForm="ngForm">
<div class ="form-group">
<!-- Device Model Name -->
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput class="no-spin" [(ngModel)]="device_type" name="device_type"placeholder="{{'Device Model Name' | translate}}" required/>
<md-error class="required">{{'Enter Device Model' | translate}}</md-error>
</md-form-field>
<!-- Device Model Configuration Command -->
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="config_cmd" name="config_cmd"placeholder="{{'Configuration Command' | translate}}" required/>
<md-error class="required">{{'Enter Configuration Command' | translate}}</md-error>
</md-form-field>
</div>
<!-- <div class ="form-group">
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput class="no-spin" [(ngModel)]="sos_number" name="device_type"placeholder="{{'Device SOS Number' | translate}}" />
</md-form-field>
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="chk_status" name="config_cmd"placeholder="{{'Check Status Command' | translate}}" />
</md-form-field>
</div> -->
<!-- <div class ="form-group">
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput class="no-spin" [(ngModel)]="stop_engine" name="stop_engine" placeholder="{{'Stop Engine Command' | translate}}" />
</md-form-field>
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="restore_engine" name="restore_engine" placeholder="{{'Restore Engine Command' | translate}}" />
</md-form-field>
</div> -->
<div class ="form-group">
<!--Location command -->
<md-form-field class="example-full-width width " style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="loc_cmd" name="loc_cmd"placeholder="{{'Location Command'| translate}}" />
</md-form-field>
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="imob_cmd" name="imob_cmd"placeholder="{{'Immoblizer Command' | translate}}" required>
<md-error class="required">{{'Enter Immoblizer command' | translate}}</md-error>
</md-form-field>
</div>
<div class ="form-group">
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="reset_cmd" name="reset_cmd" placeholder="{{'Reset Command' | translate}}" required>
<md-error class="required">{{'Enter Reset command' | translate}}</md-error>
</md-form-field>
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="resume_cmd" name="resume_cmd" placeholder="{{'Resume Command' | translate}}" required>
<md-error class="required">{{'Enter Resume command' | translate}}</md-error>
</md-form-field>
</div>
<div class ="form-group">
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput class="no-spin" [(ngModel)]="timeZone" name="timezone" placeholder="{{'Timezone' | translate}}" />
</md-form-field>
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="apn" name="apn" placeholder="{{'APN' | translate}}" />
</md-form-field>
</div>
<div class ="form-group">
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="number" [(ngModel)]="deviceport" name="port" placeholder="{{'Port' | translate}}" >
</md-form-field>
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="sms_ip" name="port" placeholder="{{'SMS IP' | translate}}">
</md-form-field>
</div>
<div class="form-group">
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="sms_apn" name="port" placeholder="{{'SMS APN' | translate}}">
</md-form-field>
</div>
<div class="form-group">
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="sms_timezone" name="port" placeholder="{{'SMS Timezone' | translate}}">
</md-form-field>
</div>
<div >
<md-form-field class="example-full-width width" style="float:left;width: 50%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="Manufacturer" name="manufacturer" placeholder="{{'Manufacturer' | translate}}" >
</md-form-field>
<md-select (ngModelChange)="immobilizerType($event)" style="width: 46%;padding-top: 12px;"[(ngModel)]="immValue" name="immType" placeholder="{{'Immoblizer Type' | translate}}">
<md-option value="serverCmd">Server Command</md-option>
<md-option value="mobileCmd">Mobile Command</md-option>
</md-select>
</div>
<!-- sms_ip;
sms_apn;
sms_timezone; -->
</form>
<!-- formgroup ends here -->
<br><br>
<div >
<!-- <button class="btn btn-primary btn-block/"(click)="addDevice()" style="cursor:pointer;width: 159px;height: 44px;">Add Device</button> -->
</div><br>
<flash-messages style="float: center;"></flash-messages>
<!-- form button and flash msgs end here -->
<div style="padding-top:3%;">
<input type="submit" [disabled]="!signupForm.form.valid" (click) ="addDeviceModel(signupForm.form)" class="btn btn-primary btn-block/" value="ADD DEVICE MODEL" style="cursor:pointer;width: 159px;height: 44px;" fxFlexAlign="center">&nbsp;&nbsp;
<input type="submit" (click) ="NewVehicleType()" class="btn btn-primary btn-block/" value="Cancel" style="cursor:pointer;width: 159px;height: 44px;" >
<br>
<flash-messages style="float: center;"></flash-messages>
</div>
</md-card>
</div>
<!-- </div> -->
</body>
</html>
<!-- <html>
<head>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
</head>
<body>
<div class="upper">
<md-toolbar>My App</md-toolbar>
<md-toolbar flex style="background-color:white;width: 100%;" >
<img src="../../assets/image/f_logo.jpg"
style=
"width:12%;padding-top: 8px;">
<ul fxHide.sm="true" fxHide.xs="true" style="width:50%;padding:30px 10% 0 0;" fxLayout="row" >
</ul>
<ul fxShow fxHide.xs="false" fxHide.lg="true" fxHide.gt-sm="true" style="width:100%;padding-top: 15px;">
<md-menu #appMenu="mdMenu" [overlapTrigger]="false">
<h5>&nbsp;&nbsp;{{fs}} {{ls}}</h5>
<h5>&nbsp;&nbsp;{{or}}</h5><br>
&nbsp; <button type="reset" class="btn btn-default" >My Account</button>
<button class="btn btn btn-success"(click)="logout()" >&nbsp;&nbsp;&nbsp;Log Out&nbsp;&nbsp;&nbsp;</button> &nbsp;
</md-menu>
<button md-icon-button [mdMenuTriggerFor]="appMenu" style="float:right;outline:none">
<img src="../../assets/image/us.jpg" height=30px>
</button>
</ul>
<ul fxShow fxHide.xs="true" fxHide.lt-md="true" fxHide.gt-sm="false" style="float:right;width:30%; margin-top: 3%;">
<md-menu #appMenu="mdMenu" [overlapTrigger]="false">
<h5>&nbsp;&nbsp;{{fs}} {{ls}}</h5>
<h5>&nbsp;&nbsp;{{or}}</h5><br>
&nbsp; <button type="reset" class="btn btn-default" >My Account</button>
<button class="btn btn btn-success"(click)="logout()" >&nbsp;&nbsp;&nbsp;Log Out&nbsp;&nbsp;&nbsp;</button> &nbsp;
</md-menu>
<button md-icon-button [mdMenuTriggerFor]="appMenu" style="float:right;outline:none">
<img src="../../assets/image/us.jpg" height=30px>
</button>
</ul>
</md-toolbar>
</div>
<div class="for" >
<md-card>
<form action="" role="form">
<input id='step2' type='checkbox'>
<input id='step3' type='checkbox'>
<div id="part1" class="form-group">
<div class="panel panel-primary">
<b><h3 style="text-align:left;">Device Details</h3></b>
<form #lgForm="ngForm" (ngSubmit)="addDevice()">
<progress-bar [value]="50" [max]="100" title="Device Details"></progress-bar> <br>
<div class ="form-group">
<md-form-field class="example-full-width width">
<input mdInput class="no-spin" [(ngModel)]=" deviceid" name=" deviceid"placeholder="Device ID" required/>
<md-error class="required">Enter Device ID</md-error>
</md-form-field>&nbsp;&nbsp;&nbsp;
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="devicename" name="devicename"placeholder="Device Name" required/>
<md-error class="required">Enter Device Name</md-error>
</md-form-field>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<md-form-field class="example-full-width width ">
<input mdInput type="text" [(ngModel)]="des" name="des"placeholder="Description" />
</md-form-field>&nbsp;&nbsp;&nbsp;&nbsp;
<md-select name="typdev" placeholder="Device Type" style="margin-top: -4px;
width: 40%;
/* float: right; */
margin-right: 2%;" [(ngModel)]="new" (ngModelChange)="cultivoChange(new)">
<md-option *ngFor="let food of foods" [value]="food" >
{{ food.viewValue }}
</md-option>
</md-select>
<div *ngIf="show">
<md-form-field class="example-full-width width" style="float:left;margin-left:8%;">
<input mdInput type="text" [(ngModel)]="hrdwr" name="hrdwr"placeholder="SIM Number" required/>
<md-error class="required">Enter SIM Number</md-error>
</md-form-field>
<md-select name="neww" placeholder="Vechiles Type" style="margin-top: -4px;
width: 40%;
/* float: right; */
margin-right: 8%;" [(ngModel)]="neww">
<md-option *ngFor="let foodd of foodds" [value]="foodd" >
{{ foodd.viewValue }}
</md-option>
</md-select>
</div>
</div>
<br> <br> <br>
<div class="btn-group btn-group-lg" role="group" aria-label="...">
<label class="back">
<div class="btn btn-default btn-primary btn-lg" role="button" (click)="back2home();">Back</div>
</label>&nbsp;&nbsp;
<label for='step2' id="continue-step2" class="continue">
<div class="btn btn-default btn-success btn-lg" >Next</div>
</label>
</div>
</form>
</div>
</div>
<div id="part2" class="form-group">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 style="text-align:left;">Security</h3>
</div>
<progress-bar [value]="100" [max]="100" title="Security" color="red"></progress-bar>
<b><h5 align="justify"><font size="+1">Auto-generated authentication token</font></h5></b>
<p align="justify">
You have registered your device credentials, to get connected you need to generate the token key. Once you have generated the token, you will able to read and write the devices. Token will be sent to your registered e-mail id. Authentication tokens are non-recoverable. If you missplace this token, you will need to re-register the device to generate the new authentication token.
</p>
<md-card style="margin-top:-2px;height:104px">
<div style="margin-top:-35px;">
<div class ="form-group">
<br>
<label style="float:left;font-size:16px;"><b>Device ID : &nbsp;</b></label>
<label style="float:left;font-size:12px; margin-top: 3px;">{{this.deviceid}}</label><br>
</div>
<div class ="form-group">
<label style="float:left;font-size:16px;"><b>Device Name : &nbsp;</b></label>
<label style="float:left;font-size:12px; margin-top: 3px;">{{this.devicename}}</label><br>
<br>
<br> </div>
</div>
</md-card>
<div class="btn-group btn-group-lg btn-group-justified" role="group" aria-label="...">
<label for='step2' id="back-step2" class="back">
<div class="btn btn-default btn-primary btn-lg" role="button">Back</div>
</label>&nbsp;&nbsp;
&nbsp;&nbsp; <label for='step3' id="continue-step3" class="continue">
<button type="submit" class="btn btn-default btn-success btn-lg" (click)="addDevice()"[disabled]="!lgForm.form.valid">Submit</button>
</label>
</div>
<flash-messages style="float: center;"></flash-messages>
<button (click)="test()" style="float:left;font-size:11px;background-color: Transparent; background-repeat:no-repeat;border: none;cursor:pointer; overflow: hidden;outline:none;margin-top:10pxpx">* token pricing</button>
</div>
</div>
</form>
</md-card>
</div>
</body>
</html> -->

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddDeviceModelComponent } from './add-device-model.component';
describe('AddDeviceModelComponent', () => {
let component: AddDeviceModelComponent;
let fixture: ComponentFixture<AddDeviceModelComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddDeviceModelComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddDeviceModelComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,494 @@
import { Component, OnInit } from '@angular/core';
import {JSONEditor} from 'jsoneditor';
import {Device} from '../device';
import {Driver} from '../driver';
import {Token} from '../token';
import{Contact} from '../contact';
import {MdSnackBar} from '@angular/material';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import { SidebarComponent } from '../sidebar/sidebar.component';
import {ContactService} from '../contact.service';
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot,ActivatedRoute,Params } from '@angular/router';
import { FlashMessagesService } from 'angular2-flash-messages';
import {Observable} from 'rxjs/Rx';
import { MyaccountComponent } from '../myaccount/myaccount.component';
import {MdDialog, MdDialogRef, MD_DIALOG_DATA} from '@angular/material';
import { toString } from '@ng-bootstrap/ng-bootstrap/util/util';
@Component({
selector: 'app-add-device-model',
templateUrl: './add-device-model.component.html',
styleUrls: ['./add-device-model.component.css'],
providers: [ContactService,SidebarComponent]
})
export class AddDeviceModelComponent implements OnInit {
sos_number:any;
chk_status:any;
stop_engine:any;
restore_engine:any;
device_Id: string;
dev: any;
deviceId: any;
group_info: any;
executed2:any;
groupInfo:any;
devices: Device[] = []
device: Device
fuel_tank_capicity:any;
voltage_tank_empty:any;
tankfull_capicity:any;
tokens: Token[] = []
token: Token
useridd: any;
routeData : any=[];
data:any;
mb: any;
logoutbut: boolean;
dealer: boolean;
custtype: boolean;
cust: boolean;
fs: any;
ls: any;
or: any;
logo: any;
superAdmin: any;
timeZone:any;
apn:any;
sms_ip;
sms_apn;
sms_timezone;
text: any;
Manufacturer: any;
immValue: any;
immobilizerCmd: any;
deviceport : any;
myaccount(){
this.cond = false
this.router.navigateByUrl("accountSettings");
// let dialogRef = this.dialog.open(MyaccountComponent, {
// width: '903px',
// data: {}
// });
// dialogRef.afterClosed().subscribe(result => {
// if(result == "succ"){
// console.log("Updated")
// }
// });
}
openNav() {
/* document.getElementById("myNav").style.width = "100%";
*/
this.router.navigateByUrl("location");
} logout(){
window.localStorage.clear();
this.router.navigateByUrl("login");
}
devi(){
this.router.navigateByUrl("dashboard");
}
soon(){
this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
vehicleRoute(){
this.cond = false
this.router.navigateByUrl("vehicleRoute");
}
dealerInfo(){
this.cond = false
this.router.navigateByUrl("dealerInfo");
}
NewVehicleType(){
this.router.navigateByUrl("deviceModel");
// this.devices=[];
// ngForm.reset();
}
// new_1(){
// this.router.navigateByUrl("new");
// }
notification(){
this.cond = false
this.router.navigateByUrl("notifications");
}
cond:Boolean = false;
point : any = 0;
aa(){
// console.log(this.point);
if(this.point == 0){
this.cond = true;
this.point ++;
}
else if(this.point % 2 == 0){
this.cond = true;
this.point ++;
}
else{
this.cond = false
this.point ++;
}
}
Ddetail(){
this.router.navigateByUrl("driverdetail");
}
DModel(){
this.router.navigateByUrl("deviceModel");
}
VType(){
this.router.navigateByUrl("VehicleType");
}
routeViolation(){
this.cond = false
this.router.navigateByUrl("device-report/routeViolation");
}
alert_report(){
this.cond = false
this.router.navigateByUrl("device-report/alert-report");
}
summaryReport(){
this.cond = false
this.router.navigateByUrl("device-report/summary-report");
}
overspeed(){
this.cond = false
this.router.navigateByUrl("device-report/overspeed");
}
stoppage_report(){
this.cond = false
this.router.navigateByUrl("device-report/stoppage_report");
}
ignition_report(){
this.cond = false
this.router.navigateByUrl("device-report/ignition_report");
}
geofancingReport(){
this.cond = false
this.router.navigateByUrl("device-report/geofancing");
}
route_map(){
this.router.navigateByUrl("routeMapping");
}
distance_report(){
this.cond = false
this.router.navigateByUrl("device-report/distance_report");
}
trip_report(){
this.cond = false
this.router.navigateByUrl("device-report/trip_report");
}
addgeo(){
this.router.navigateByUrl("geofence-add");
}
geo(){
this.router.navigateByUrl("geofencing");
}
a(){
// console.log(this.point);
if(this.point == 0){
this.cond = true;
this.point ++;
}
else if(this.point % 2 == 0){
this.cond = true;
this.point ++;
}
else{
this.cond = false
this.point ++;
}
}
addcus(){
this.router.navigateByUrl("add");
} report(){
this.cond = false
this.router.navigateByUrl("device-report");
}
report_speed(){
// console.log("report speed call")
this.cond = false
this.router.navigateByUrl("device-report/device-speed-report");
}
device_type: any;
config_cmd: any;
loc_cmd: any;
imob_cmd: any;
reset_cmd: any;
resume_cmd: any;
Manf: string;
Model: string;
tkstatus:any;
value:any;
Lo:string;
Hardware_Ver: string;
Loca: string;
temp:any
food:any
new:any;
email:any;
message:string;
selectedValue:any;
show:boolean =false;
/* ../../assets/image/bgtry2.jpg */
foodds = [
{value: 'true', viewValue: 'True'},
{value: 'false', viewValue: 'False'},
];
cultivoChange(val){
if(val.value == "Tracker"){
this.show=true
}
else{
this.show=false
}
}
back2home(){
// console.log("Runnig Back")
this.router.navigateByUrl("dashboard");
}
constructor(private _formBuilder: FormBuilder,private router: Router, public snackBar: MdSnackBar,private contactService: ContactService,private _flashMessagesService: FlashMessagesService,private sidebar:SidebarComponent,public dialog: MdDialog,private act:ActivatedRoute) { }
test(){
// console.log("Runnig Test")
// console.log(this.new.value);
}
mydealer(){
window.localStorage['token'] = window.localStorage['Dealer_token'];
localStorage.removeItem('devices');
window.localStorage['DataUpdate'] = 'True';
if(window.localStorage['DataLoaded'] = 'True'){
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
// this.router.navigateByUrl("const?_status="+"OK");
}
}
/* TOKEN GENERATION */
/* ADD DEVICE */
mess:any;
mess2:any;
mess3:any;
neww:any;
driver:any;
before:any;
dcontact:any;
timer:any;
subscription:any;
Load:boolean=false
ign(){
this.router.navigateByUrl("device-report/ign-report");
}
addDeviceModel(signupForm){
// alert(this.useridd);
if(this.device_type == null||this.config_cmd == null||this.loc_cmd == null||this.imob_cmd == null||this.reset_cmd == null||this.resume_cmd == null)
{
this._flashMessagesService.show('Error :Please Insert details of Device type', { cssClass: 'alert-danger', timeout: 2000 });
this.Load = false;
return;
}
const newDeviceModel ={
device_type: this.device_type,
config_cmd: this.config_cmd,
loc_cmd: this.loc_cmd,
imob_cmd: this.imob_cmd,
reset_cmd: this.reset_cmd,
resume_cmd:this.resume_cmd,
// sms_ip:this.sms_ip,
// sms_apn:this.sms_apn,
// sms_timezone:this.sms_timezone
}
if(this.sms_ip){
newDeviceModel['sms_ip'] = this.sms_ip;
}
if(this.sms_apn){
newDeviceModel['sms_apn'] = this.sms_apn;
}
if(this.sms_timezone){
newDeviceModel['sms_timezone'] = this.sms_timezone;
}
//webservice to add new driver
if(this.timeZone){
newDeviceModel['device_timezone'] = this.timeZone;
}
if(this.apn){
newDeviceModel['device_apn'] = this.apn;
}
if(this.Manufacturer){
newDeviceModel['Manufacturer'] = this.Manufacturer;
}
if(this.deviceport){
newDeviceModel['deviceport'] = this.deviceport;
}
if(this.immobilizerCmd){
newDeviceModel['imobliser_type'] = this.immobilizerCmd;
}
console.log(newDeviceModel);
this.contactService.addDeviceModel(newDeviceModel)
.subscribe((dataret => {
this.data = dataret;
// this._flashMessagesService.show('Device Model Added', { cssClass: 'alert-success', timeout: 2000 });
// this.NewVehicleType(signupForm);
this.router.navigateByUrl('deviceModel');
}), (err: any) => {
this._flashMessagesService.show('Internal Server Error', { cssClass: 'alert-denger', timeout: 2000 });
}
);
}
imageFile:any;
Filename:any;
private fileCounter = 0;
onRemoved(file) {
// console.log(file);
}
group(){
this.cond = false
this.router.navigateByUrl("group_view");
}
report_map(){
this.router.navigateByUrl("routeMapping");
}
immobilizere=[
{
value : 'serverCmmand',
Viewvalue : 'Server command'
},
{
value : 'mobCmd',
Viewvalue : 'Mobile command'
}
]
ngOnInit() {
this.immobilizere;
this.logo=window.localStorage['logo'];
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
this.fs = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).fn;
this.ls = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).ln;
this.email = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email;
this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName;
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.mb = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).phn;
this.act.queryParams.subscribe((params:Params) =>{
// console.log(params['useridd']);
this.routeData=params.user_id;
// let id= params['user_id'];
// this.groupId = id;
// console.log(this.groupId);
})
this.custtype = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer;
if(this.custtype == true){
this.cust = true;
}
if(this.mb.charAt(0)=="n"){
this.mb = ' '
}
if(this.mb.charAt(0)=="n"){
this.mb = ' '
}
if( window.localStorage['Custumer'] == 'ON'){
this.logoutbut = false
this.dealer = true
}
else{
this.logoutbut = true
}
this.logo=window.localStorage['logo'];
this.text=window.localStorage['text'];
}
immobilizerType(ev:any){
if(ev == "serverCmd") this.immobilizerCmd = '1.0';
if(ev == "mobileCmd") this.immobilizerCmd = '0.0';
console.log(this.immobilizerCmd);
}
}

View file

@ -0,0 +1,755 @@
<!-- <div style="max-height: 736px;overflow: auto;overflow-x: hidden;">
<div class="row" style="margin:0px">
<div class="col-sm-8 col-md-8" style="text-align: right; font-size: 22px; font-weight: 500;padding-right: 60px;background: #426E86;color: white;">
<label>{{heading}}</label>
</div>
<div class="col-sm-4 col-md-4" style="text-align: right; padding-top: 10px;background: #426E86;color: white;">
<md-slide-toggle *ngIf = "!editVal" [(ngModel)]="distStaus" ngDefaultControl ></md-slide-toggle>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-12">
<flash-messages style="float: center;margin:0px 1px;height:-6px;"></flash-messages>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="userID" placeholder="{{'Enter User ID' | translate}}" name="userId" required>
<md-error class="pattern">{{'Please Enter User ID' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="first_name" placeholder="{{'Enter First Name' | translate}}" name="first_name" required>
<md-error class="pattern">{{'Please Enter First Name' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="last_name" placeholder="{{'Enter Last Name' | translate}}" name="last_name" required>
<md-error class="pattern">{{'Please Enter Last Name' | translate}}</md-error>
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial" (click)="stren();">
<input (keypress)="click2($event)" pattern="[^@^ ]+@[^@^ ]+\.[a-zA-Z]{2,}" mdInput type="text" [(ngModel)]="emaill" name="emaill"
placeholder="{{'Enter Email ID *' | translate }}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="width: 100%;" (click)="stren();">
<input type="tel" id="demo" (keypress)="click1($event)" onkeydown="call(event)" mdInput id="telephone" [(ngModel)]="phone" minlength="10" maxlength="10">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="organisation_name" placeholder="{{'Enter Organisation Name' | translate}}" name="organisation_name" >
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="address" placeholder="{{'Enter address' | translate}}"
name="address">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" >
<md-form-field class="example-full-width width" style="display: initial" (click)="stre();">
<md-icon style="float:right;margin-bottom:12px;height:5px;cursor:pointer" (click)="showpassword('p1')" mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol">{{passwordIcon}}</md-icon>
<input (keypress)="click2($event)" pattern="(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$"
mdInput type="{{passwordtype}}" [(ngModel)]="passwordd" name="passwordd" placeholder="{{'Enter Password' | translate}}" minlength="6"
maxlength="12" required>
<md-error class="required">{{'Invalid Password' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" *ngIf = "editVal">
<md-form-field class="example-full-width width" style="display: initial" (click)="stre();">
<md-icon style="float:right;margin-bottom:12px;height:5px;cursor:pointer" (click)="showpassword('p2')" mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol">{{passwordIcon_1}}</md-icon>
<input mdInput type="{{passwordtype_1}}" [(ngModel)]="password2" name="password2" placeholder="{{'Confirm Password' | translate}}" minlength="6" maxlength="12"
required>
<md-error class="required">{{'Please Enter Confirm Password' | translate}}</md-error>
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 30px;">
<div >
<span style="margin-right: 10px;">Welcome Message :</span>
<md-slide-toggle style="float: right;margin-top: 5px;" [(ngModel)]="welcome_messages_status" ngDefaultControl ></md-slide-toggle>
</div>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" *ngIf = "editVal">
<label>Timezone</label>
<div style="display:flex">
<select id="dbselect" >
<option *ngFor="let zone of timezoneArray" [value]="zone.value" [selected] = "zone.value === timezone">{{ zone.viewValue }}</option>
</select>
</div>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" >
<md-select style="width: 99%;padding-top: 20px;" [(ngModel)]="selectedlanguage" placeholder="--{{'Language' | translate}}--" ngDefaultControl (change)="changelanguage()">
<md-option *ngFor="let language of available_languages" [value]="language.id">
{{language.view}}
</md-option>
</md-select>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="speedLimit" placeholder="{{'Enter Speed Limit (KM/Hr)' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="outOfReach" placeholder="{{'Out Of Reach (Hours)' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 30px;">
<div>
<span style="margin-right: 10px;">KYC Verification Mail :</span>
<md-slide-toggle style="float: right;margin-top: 5px;" [(ngModel)]="kyc_verification_mail" ngDefaultControl>
</md-slide-toggle>
</div>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-12" style="padding-top: 20px;font-weight: 600;"> <span>{{'Upload Documents' | translate }}:</span>
<button mdTooltip="{{'upload Documents' | translate}}" style="border:1px solid transparent; background-color: transparent;cursor:pointer;float:right" (click)="AddDocumentsField('addedrow')">
<md-icon style="float: right;width:30px;height:30px;cursor:pointer">add</md-icon>
</button>
</div>
</div>
<div style="margin:0px" class="row" *ngFor="let data of imageuploadObject; let i =index" [ngClass]="{'rowHeight':docRow}">
<div class="col-3" style="padding-right: 0px;padding-top: 16px;">
<md-select class="example-full-width width" style="display: initial" (ngModelChange)="documentType($event)" [(ngModel)] = "data.doctype" placeholder="{{'Doc Type' | translate}}">
<md-option *ngFor="let doc of documentList" [value]="doc.docId">{{doc.docName}}</md-option>
</md-select>
</div>
<div class="col-3" style="margin-top: 4px;padding-right: 0px">
<md-form-field class="example-full-width width" style="display: initial">
<input type="text" [(ngModel)]="data.phone" mdInput placeholder="{{'Doc Number' | translate}}">
</md-form-field>
</div>
<div class="col-4" style="margin-top: 7px;padding-right: 0px">
<input type="file" class="form-control" placeholder='Choose a file...' (change)="onFileChanged($event)" />
</div>
<div class="col-2" style="padding-right: 0px">
<md-icon style="float: right;width:50px;height:50px;color:green; cursor:pointer;padding-top:15px;" (click)="onUpload(i)">cloud_upload</md-icon>
<md-icon style="float: right;width:50px;height:50px;color:red; cursor:pointer;padding-top:15px;" (click)="DeleteDocumentsField(i)">delete</md-icon>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-12">
<p style="font-size: 20px;font-weight: 600;color: #5c5c5c;margin-top: 1rem;">Billing Information</p>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 16px;">
<md-select class="example-full-width width" style="display: initial" [(ngModel)] = "billingType" placeholder="{{'Billing Type' | translate}}">
<md-option *ngFor="let bill of billingTypeArr" [value]="bill">{{bill}}</md-option>
</md-select>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="display: inherit;">
<md-select name="currency" [(ngModel)]="currencyType" style="padding-top: 17px;">
<md-option value="USD" selected="selected">United States Dollars</md-option>
<md-option value="EUR">Euro</md-option>
<md-option value="GBP">United Kingdom Pounds</md-option>
<md-option value="DZD">Algeria Dinars</md-option>
<md-option value="ARP">Argentina Pesos</md-option>
<md-option value="AUD">Australia Dollars</md-option>
<md-option value="ATS">Austria Schillings</md-option>
<md-option value="BSD">Bahamas Dollars</md-option>
<md-option value="BBD">Barbados Dollars</md-option>
<md-option value="BEF">Belgium Francs</md-option>
<md-option value="BMD">Bermuda Dollars</md-option>
<md-option value="BRR">Brazil Real</md-option>
<md-option value="BGL">Bulgaria Lev</md-option>
<md-option value="CAD">Canada Dollars</md-option>
<md-option value="CLP">Chile Pesos</md-option>
<md-option value="CNY">China Yuan Renmimbi</md-option>
<md-option value="CYP">Cyprus Pounds</md-option>
<md-option value="CSK">Czech Republic Koruna</md-option>
<md-option value="DKK">Denmark Kroner</md-option>
<md-option value="NLG">Dutch Guilders</md-option>
<md-option value="XCD">Eastern Caribbean Dollars</md-option>
<md-option value="EGP">Egypt Pounds</md-option>
<md-option value="FJD">Fiji Dollars</md-option>
<md-option value="FIM">Finland Markka</md-option>
<md-option value="FRF">France Francs</md-option>
<md-option value="DEM">Germany Deutsche Marks</md-option>
<md-option value="XAU">Gold Ounces</md-option>
<md-option value="GRD">Greece Drachmas</md-option>
<md-option value="HKD">Hong Kong Dollars</md-option>
<md-option value="HUF">Hungary Forint</md-option>
<md-option value="ISK">Iceland Krona</md-option>
<md-option value="INR">India Rupees</md-option>
<md-option value="IDR">Indonesia Rupiah</md-option>
<md-option value="IEP">Ireland Punt</md-option>
<md-option value="ILS">Israel New Shekels</md-option>
<md-option value="ITL">Italy Lira</md-option>
<md-option value="JMD">Jamaica Dollars</md-option>
<md-option value="JPY">Japan Yen</md-option>
<md-option value="JOD">Jordan Dinar</md-option>
<md-option value="KRW">Korea (South) Won</md-option>
<md-option value="LBP">Lebanon Pounds</md-option>
<md-option value="LUF">Luxembourg Francs</md-option>
<md-option value="MYR">Malaysia Ringgit</md-option>
<md-option value="MXP">Mexico Pesos</md-option>
<md-option value="NLG">Netherlands Guilders</md-option>
<md-option value="NZD">New Zealand Dollars</md-option>
<md-option value="NOK">Norway Kroner</md-option>
<md-option value="PKR">Pakistan Rupees</md-option>
<md-option value="XPD">Palladium Ounces</md-option>
<md-option value="PHP">Philippines Pesos</md-option>
<md-option value="XPT">Platinum Ounces</md-option>
<md-option value="PLZ">Poland Zloty</md-option>
<md-option value="PTE">Portugal Escudo</md-option>
<md-option value="ROL">Romania Leu</md-option>
<md-option value="RUR">Russia Rubles</md-option>
<md-option value="SAR">Saudi Arabia Riyal</md-option>
<md-option value="XAG">Silver Ounces</md-option>
<md-option value="SGD">Singapore Dollars</md-option>
<md-option value="SKK">Slovakia Koruna</md-option>
<md-option value="ZAR">South Africa Rand</md-option>
<md-option value="KRW">South Korea Won</md-option>
<md-option value="ESP">Spain Pesetas</md-option>
<md-option value="XDR">Special Drawing Right (IMF)</md-option>
<md-option value="SDD">Sudan Dinar</md-option>
<md-option value="SEK">Sweden Krona</md-option>
<md-option value="CHF">Switzerland Francs</md-option>
<md-option value="TWD">Taiwan Dollars</md-option>
<md-option value="THB">Thailand Baht</md-option>
<md-option value="TTD">Trinidad and Tobago Dollars</md-option>
<md-option value="TRL">Turkey Lira</md-option>
<md-option value="VEB">Venezuela Bolivar</md-option>
<md-option value="ZMK">Zambia Kwacha</md-option>
<md-option value="EUR">Euro</md-option>
<md-option value="XCD">Eastern Caribbean Dollars</md-option>
<md-option value="XDR">Special Drawing Right (IMF)</md-option>
<md-option value="XAG">Silver Ounces</md-option>
<md-option value="XAU">Gold Ounces</md-option>
<md-option value="XPD">Palladium Ounces</md-option>
<md-option value="XPT">Platinum Ounces</md-option>
</md-select>
<md-form-field class="example-full-width width" style="display: initial;padding-top: 5px;">
<input mdInput type="number" [(ngModel)]="billingRate" placeholder="{{'Enter Billing Rate' | translate}}"
name="billrate">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="display: initial;padding-top: 7px;">
<md-form-field class="example-full-width width" style="width: 100%;" (click)="stren();">
<input type="tel" (keypress)="click1($event)" onkeydown="call(event)" mdInput id="telephoneBill" [(ngModel)]="billingContactDetail" minlength="10" maxlength="10">
</md-form-field>
<small id="emailHelp" class="form-text text-muted" style="margin-top: 0;">Enter Billing Contact Detail</small>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="billingMail" placeholder="{{'Enter Billing Email' | translate}}"
name="billrate">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 16px;">
<md-select [(ngModel)]="plan" class="example-full-width width" style="display: initial" placeholder="Please select Plan">
<md-option value="basic">Basic</md-option>
<md-option value="advanced">Advanced</md-option>
<md-option value="premium">Premium</md-option>
</md-select>
</div>
</div>
<!-- ------------------------- SUpports And Service-------- --
<div class="row" style="margin:0px">
<div class="col-12">
<p style="font-size: 20px;font-weight: 600;color: #5c5c5c;margin-top: 1rem;">Supports And Services</p>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="support1" placeholder="{{'support1' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="support2" placeholder="{{'support2' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="support3" placeholder="{{'support3' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="service1" placeholder="{{'service1' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="service2" placeholder="{{'service2' | translate}}">
</md-form-field>
</div>
</div>
<div class="row" style="text-align: center;padding-top: 20px;margin:0px">
<div class="col-12">
<button style="background-color: #484848;color:#fdfdfd;width: 135px;" md-raised-button (click)="checkkeyandupdate()">{{'SUBMIT' | translate}}</button>
<button style="background-color: #d81111;color:#fdfdfd;width: 135px;" md-raised-button (click)="closebox()">{{'CANCEL' | translate}}</button>
</div>
</div>
</div> -->
<div style="height: 90vh;">
<div class="row" style="margin:0px">
<div class="col-sm-8 col-md-8"
style="text-align: right; font-size: 22px; font-weight: 500;padding-right: 60px;background: #426E86;color: white;">
<label>{{heading}}</label>
</div>
<div class="col-sm-4 col-md-4" style="text-align: right; padding-top: 10px;background: #426E86;color: white;">
<md-slide-toggle *ngIf="!editVal" [(ngModel)]="distStaus" ngDefaultControl></md-slide-toggle>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-12">
<flash-messages style="float: center;margin:0px 1px;height:-6px;"></flash-messages>
</div>
</div>
<ul class="nav nav-tabs" style="margin-top: 17px;" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#tabs-1" role="tab">General Information</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#tabs-2" role="tab">Upload Documents</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#tabs-3" role="tab">Billing Information</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#tabs-4" role="tab">Support And Service</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#tabs-5" role="tab">Permissions</a>
</li>
</ul><!-- Tab panes -->
<div class="tab-content" style="margin-top: 13px;margin: 20px;">
<div class="tab-pane active" id="tabs-1" role="tabpanel">
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="userID" placeholder="{{'Enter User ID' | translate}}" name="userId"
required>
<md-error class="pattern">{{'Please Enter User ID' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="first_name" placeholder="{{'Enter First Name' | translate}}"
name="first_name" required>
<md-error class="pattern">{{'Please Enter First Name' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="last_name" placeholder="{{'Enter Last Name' | translate}}"
name="last_name" required>
<md-error class="pattern">{{'Please Enter Last Name' | translate}}</md-error>
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial" (click)="stren();">
<input (keypress)="click2($event)" pattern="[^@^ ]+@[^@^ ]+\.[a-zA-Z]{2,}" mdInput type="text"
[(ngModel)]="emaill" name="emaill" placeholder="{{'Enter Email ID *' | translate }}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="width: 100%;" (click)="stren();">
<input type="tel" id="demo" (keypress)="click1($event)" onkeydown="call(event)" mdInput id="telephone"
[(ngModel)]="phone" minlength="10" maxlength="10">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="organisation_name"
placeholder="{{'Enter Organisation Name' | translate}}" name="organisation_name">
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="address" placeholder="{{'Enter address' | translate}}"
name="address">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial" (click)="stre();">
<i class="fas fa-eye" style="float:right;margin-bottom:12px;height:5px;cursor:pointer" (click)="showpassword('p1')"
mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol"></i>
<!-- <md-icon style="float:right;margin-bottom:12px;height:5px;cursor:pointer" (click)="showpassword('p1')"
mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol">
{{passwordIcon}}</md-icon> -->
<input (keypress)="click2($event)"
pattern="(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$" mdInput
type="{{passwordtype}}" [(ngModel)]="passwordd" name="passwordd"
placeholder="{{'Enter Password' | translate}}" minlength="6" maxlength="12" required>
<md-error class="required">{{'Invalid Password' | translate}}</md-error>
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" *ngIf="editVal">
<md-form-field class="example-full-width width" style="display: initial" (click)="stre();">
<i class="fas fa-eye" style="float:right;margin-bottom:12px;height:5px;cursor:pointer" (click)="showpassword('p2')"
mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol"></i>
<!-- <md-icon style="float:right;margin-bottom:12px;height:5px;cursor:pointer" (click)="showpassword('p2')"
mdTooltip="Password Tips : &#013;Min 6 character & Max 12 character. Password must contain at least one small & one capital alphabet , one numeric digit and one special symbol">
{{passwordIcon_1}}</md-icon> -->
<input mdInput type="{{passwordtype_1}}" [(ngModel)]="password2" name="password2"
placeholder="{{'Confirm Password' | translate}}" minlength="6" maxlength="12" required>
<md-error class="required">{{'Please Enter Confirm Password' | translate}}</md-error>
</md-form-field>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 30px;">
<div>
<span style="margin-right: 10px;">Welcome Message :</span>
<md-slide-toggle style="float: right;margin-top: 5px;" [(ngModel)]="welcome_messages_status"
ngDefaultControl></md-slide-toggle>
</div>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" *ngIf="editVal">
<label>Timezone</label>
<div style="display:flex">
<select id="dbselect">
<option *ngFor="let zone of timezoneArray" [value]="zone.value" [selected]="zone.value === timezone">{{
zone.viewValue }}</option>
</select>
</div>
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<md-select style="width: 99%;padding-top: 20px;" [(ngModel)]="selectedlanguage"
placeholder="--{{'Language' | translate}}--" ngDefaultControl (change)="changelanguage()">
<md-option *ngFor="let language of available_languages" [value]="language.id">
{{language.view}}
</md-option>
</md-select>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="speedLimit"
placeholder="{{'Enter Speed Limit (KM/Hr)' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="outOfReach" placeholder="{{'Out Of Reach (Hours)' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 30px;">
<div>
<span style="margin-right: 10px;">KYC Verification Mail :</span>
<md-slide-toggle style="float: right;margin-top: 5px;" [(ngModel)]="kyc_verification_mail" ngDefaultControl>
</md-slide-toggle>
</div>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 30px;">
<div>
<span style="margin-right: 10px;">Inventory :</span>
<md-slide-toggle style="float: right;margin-top: 5px;" [(ngModel)]="inventoryManagement" ngDefaultControl>
</md-slide-toggle>
</div>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 30px;">
<div>
<span style="margin-right: 10px;">Bussiness Type :</span>
<md-slide-toggle style="float: right;margin-top: 5px;" [(ngModel)]="bussinessType" ngDefaultControl>
</md-slide-toggle>
</div>
</div>
</div>
</div>
<!-- --------------------------------Document Upload -->
<!-- <div class="tab-content" style="margin-top: 13px;margin: 20px;"> -->
<div class="tab-pane" id="tabs-2" role="tabpanel">
<div class="row" style="margin:0px">
<div class="col-12" style="padding-top: 20px;font-weight: 600;"> <span>{{'Upload Documents' | translate }}:</span>
<button mdTooltip="{{'upload Documents' | translate}}"
style="border:1px solid transparent; background-color: transparent;cursor:pointer;float:right"
(click)="AddDocumentsField('addedrow')">
<i class="fas fa-plus" style="float: right;width:30px;height:30px;cursor:pointer"></i>
<!-- <md-icon style="float: right;width:30px;height:30px;cursor:pointer">add</md-icon> -->
</button>
</div>
</div>
<div style="margin:0px" class="row" *ngFor="let data of imageuploadObject; let i =index"
[ngClass]="{'rowHeight':docRow}">
<div class="col-3" style="padding-right: 0px;padding-top: 16px;">
<md-select class="example-full-width width" style="display: initial" (ngModelChange)="documentType($event)"
[(ngModel)]="data.doctype" placeholder="{{'Doc Type' | translate}}">
<md-option *ngFor="let doc of documentList" [value]="doc.docId">{{doc.docName}}</md-option>
</md-select>
</div>
<div class="col-3" style="margin-top: 4px;padding-right: 0px">
<md-form-field class="example-full-width width" style="display: initial">
<input type="text" [(ngModel)]="data.phone" mdInput placeholder="{{'Doc Number' | translate}}">
</md-form-field>
</div>
<div class="col-4" style="margin-top: 7px;padding-right: 0px">
<input type="file" class="form-control" placeholder='Choose a file...' (change)="onFileChanged($event)" />
</div>
<div class="col-2" style="padding-right: 0px">
<i class="fas fa-cloud-upload-alt" style="float: right;width:50px;height:50px;color:green; cursor:pointer;padding-top:15px;"
(click)="onUpload(i)"></i>
<i class="fas fa-trash-alt"
style="float: right;width:50px;height:50px;color:red; cursor:pointer;padding-top:15px;"
(click)="DeleteDocumentsField(i)"></i>
<!-- <md-icon style="float: right;width:50px;height:50px;color:green; cursor:pointer;padding-top:15px;"
(click)="onUpload(i)">cloud_upload</md-icon> -->
<!-- <md-icon style="float: right;width:50px;height:50px;color:red; cursor:pointer;padding-top:15px;"
(click)="DeleteDocumentsField(i)">delete</md-icon> -->
</div>
</div>
</div>
<!-- </div> -->
<!-- --------------------------------Billing Information -->
<!-- <div class="tab-content" style="margin-top: 13px;margin: 20px;"> -->
<div class="tab-pane" id="tabs-3" role="tabpanel">
<div class="row" style="margin:0px">
<div class="col-12">
<p style="font-size: 20px;font-weight: 600;color: #5c5c5c;margin-top: 1rem;">Billing Information</p>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 16px;">
<md-select class="example-full-width width" style="display: initial" [(ngModel)]="billingType"
placeholder="{{'Billing Type' | translate}}">
<md-option *ngFor="let bill of billingTypeArr" [value]="bill">{{bill}}</md-option>
</md-select>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="display: inherit;">
<md-select name="currency" [(ngModel)]="currencyType" style="padding-top: 17px;">
<md-option value="USD" selected="selected">United States Dollars</md-option>
<md-option value="EUR">Euro</md-option>
<md-option value="GBP">United Kingdom Pounds</md-option>
<md-option value="DZD">Algeria Dinars</md-option>
<md-option value="ARP">Argentina Pesos</md-option>
<md-option value="AUD">Australia Dollars</md-option>
<md-option value="ATS">Austria Schillings</md-option>
<md-option value="BSD">Bahamas Dollars</md-option>
<md-option value="BBD">Barbados Dollars</md-option>
<md-option value="BEF">Belgium Francs</md-option>
<md-option value="BMD">Bermuda Dollars</md-option>
<md-option value="BRR">Brazil Real</md-option>
<md-option value="BGL">Bulgaria Lev</md-option>
<md-option value="CAD">Canada Dollars</md-option>
<md-option value="CLP">Chile Pesos</md-option>
<md-option value="CNY">China Yuan Renmimbi</md-option>
<md-option value="CYP">Cyprus Pounds</md-option>
<md-option value="CSK">Czech Republic Koruna</md-option>
<md-option value="DKK">Denmark Kroner</md-option>
<md-option value="NLG">Dutch Guilders</md-option>
<md-option value="XCD">Eastern Caribbean Dollars</md-option>
<md-option value="EGP">Egypt Pounds</md-option>
<md-option value="FJD">Fiji Dollars</md-option>
<md-option value="FIM">Finland Markka</md-option>
<md-option value="FRF">France Francs</md-option>
<md-option value="DEM">Germany Deutsche Marks</md-option>
<md-option value="XAU">Gold Ounces</md-option>
<md-option value="GRD">Greece Drachmas</md-option>
<md-option value="HKD">Hong Kong Dollars</md-option>
<md-option value="HUF">Hungary Forint</md-option>
<md-option value="ISK">Iceland Krona</md-option>
<md-option value="INR">India Rupees</md-option>
<md-option value="IDR">Indonesia Rupiah</md-option>
<md-option value="IEP">Ireland Punt</md-option>
<md-option value="ILS">Israel New Shekels</md-option>
<md-option value="ITL">Italy Lira</md-option>
<md-option value="JMD">Jamaica Dollars</md-option>
<md-option value="JPY">Japan Yen</md-option>
<md-option value="JOD">Jordan Dinar</md-option>
<md-option value="KRW">Korea (South) Won</md-option>
<md-option value="LBP">Lebanon Pounds</md-option>
<md-option value="LUF">Luxembourg Francs</md-option>
<md-option value="MYR">Malaysia Ringgit</md-option>
<md-option value="MXP">Mexico Pesos</md-option>
<md-option value="NLG">Netherlands Guilders</md-option>
<md-option value="NZD">New Zealand Dollars</md-option>
<md-option value="NOK">Norway Kroner</md-option>
<md-option value="PKR">Pakistan Rupees</md-option>
<md-option value="XPD">Palladium Ounces</md-option>
<md-option value="PHP">Philippines Pesos</md-option>
<md-option value="XPT">Platinum Ounces</md-option>
<md-option value="PLZ">Poland Zloty</md-option>
<md-option value="PTE">Portugal Escudo</md-option>
<md-option value="ROL">Romania Leu</md-option>
<md-option value="RUR">Russia Rubles</md-option>
<md-option value="SAR">Saudi Arabia Riyal</md-option>
<md-option value="XAG">Silver Ounces</md-option>
<md-option value="SGD">Singapore Dollars</md-option>
<md-option value="SKK">Slovakia Koruna</md-option>
<md-option value="ZAR">South Africa Rand</md-option>
<md-option value="KRW">South Korea Won</md-option>
<md-option value="ESP">Spain Pesetas</md-option>
<md-option value="XDR">Special Drawing Right (IMF)</md-option>
<md-option value="SDD">Sudan Dinar</md-option>
<md-option value="SEK">Sweden Krona</md-option>
<md-option value="CHF">Switzerland Francs</md-option>
<md-option value="TWD">Taiwan Dollars</md-option>
<md-option value="THB">Thailand Baht</md-option>
<md-option value="TTD">Trinidad and Tobago Dollars</md-option>
<md-option value="TRL">Turkey Lira</md-option>
<md-option value="VEB">Venezuela Bolivar</md-option>
<md-option value="ZMK">Zambia Kwacha</md-option>
<md-option value="EUR">Euro</md-option>
<md-option value="XCD">Eastern Caribbean Dollars</md-option>
<md-option value="XDR">Special Drawing Right (IMF)</md-option>
<md-option value="XAG">Silver Ounces</md-option>
<md-option value="XAU">Gold Ounces</md-option>
<md-option value="XPD">Palladium Ounces</md-option>
<md-option value="XPT">Platinum Ounces</md-option>
</md-select>
<md-form-field class="example-full-width width" style="display: initial;padding-top: 5px;">
<input mdInput type="number" [(ngModel)]="billingRate" placeholder="{{'Enter Billing Rate' | translate}}"
name="billrate">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="display: initial;padding-top: 7px;">
<md-form-field class="example-full-width width" style="width: 100%;" (click)="stren();">
<input type="tel" (keypress)="click1($event)" onkeydown="call(event)" mdInput id="telephoneBill"
[(ngModel)]="billingContactDetail" minlength="10" maxlength="10">
</md-form-field>
<small id="emailHelp" class="form-text text-muted" style="margin-top: 0;">Enter Billing Contact Detail</small>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="billingMail" placeholder="{{'Enter Billing Email' | translate}}"
name="billrate">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 16px;">
<md-select [(ngModel)]="plan" class="example-full-width width" style="display: initial"
placeholder="Please select Plan">
<md-option value="basic">Basic</md-option>
<md-option value="advanced">Advanced</md-option>
<md-option value="premium">Premium</md-option>
</md-select>
</div>
</div>
</div>
<!-- </div> -->
<!-- --------------------------------Supports And Services -->
<!-- <div class="tab-content" style="margin-top: 13px;margin: 20px;"> -->
<div class="tab-pane" id="tabs-4" role="tabpanel">
<div class="row" style="margin:0px">
<div class="col-12">
<p style="font-size: 20px;font-weight: 600;color: #5c5c5c;margin-top: 1rem;">Supports And Services</p>
</div>
</div>
<div class="row" style="margin:0px">
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="support1" placeholder="{{'support1' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="support2" placeholder="{{'support2' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="support3" placeholder="{{'support3' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="service1" placeholder="{{'service1' | translate}}">
</md-form-field>
</div>
<div class="col-sm-12 col-md-4 col-lg-4" style="padding-top: 17px;">
<md-form-field class="example-full-width width" style="display: initial">
<input mdInput type="text" [(ngModel)]="service2" placeholder="{{'service2' | translate}}">
</md-form-field>
</div>
</div>
</div>
<!-- </div> -->
<!-- --------------------------------Device And User Settings-->
<!-- <div class="tab-content" style="margin-top: 13px;margin: 20px;"> -->
<div class="tab-pane" id="tabs-5" role="tabpanel">
<div class="form-group row m-2">
<label for="options" class="ml-3 mr-4">User Setting :</label>
<div class="mr-3" *ngFor="let option of UserOptions">
<label>
<input type="checkbox" name="options" value="{{option.value}}" [checked]="option.value"
(change)="updateCheckedOptions(option.name, !option.value,'user')" />
{{option.name}}
</label>
</div>
</div>
<div class="form-group row m-2">
<label for="options" class="ml-3 mr-4">Device Setting :</label>
<div class="mr-3" *ngFor="let option of DeviceOptions">
<label>
<input type="checkbox" name="options" value="{{option.value}}" [checked]="option.value"
(change)="updateCheckedOptions(option.name, !option.value,'device')" />
{{option.name}}
</label>
</div>
</div>
</div>
</div>
<div class="row" style="text-align: center;padding-top: 20px;margin:0px">
<div class="col-12">
<button style="background-color: #484848;color:#fdfdfd;width: 135px;" md-raised-button
(click)="checkkeyandupdate()">{{'SUBMIT' | translate}}</button>
<button style="background-color: #d81111;color:#fdfdfd;width: 135px;" md-raised-button
(click)="closebox()">{{'CANCEL' | translate}}</button>
</div>
</div>
</div>

View file

@ -0,0 +1,20 @@
// ::-webkit-scrollbar {
// width: 10px;
// height: 10px;
// }
// /* Track */
// ::-webkit-scrollbar-track {
// background: rgb(153, 153, 153);
// }
// /* Handle */
// ::-webkit-scrollbar-thumb {
// // background: rgb(74, 118, 184);
// background: #868e96;
// }
// /* Handle on hover */
// ::-webkit-scrollbar-thumb:hover {
// background: #555;
// }

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddDistributersComponent } from './add-distributers.component';
describe('AddDistributersComponent', () => {
let component: AddDistributersComponent;
let fixture: ComponentFixture<AddDistributersComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddDistributersComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddDistributersComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,377 @@
<!-- <html>
<head>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
</head>
<body> -->
<div *ngIf="!update">
<app-all-menus></app-all-menus>
</div>
<div class="small">
<button md-button [mdMenuTriggerFor]="menu" style="padding:0%;"><i class="material-icons">list</i></button>
<md-menu #menu="mdMenu">
<a href="#">
<h6>DASHBOARD
<md-icon style="float:right">dashboard</md-icon>
</h6>
</a>
<a href="#"><h6>RULES<md-icon style="float:right">dock</md-icon></h6></a>
</md-menu>
</div>
<div style="float:left; width: 100%;padding-top: 6%;">
<div class="loading" *ngIf="Load">Loading&#8230;</div>
<md-card style="opacity: .9;margin-top: 15px;background: #fcfbfb;">
<h4 style="float:left;color:#855353">{{title| translate}}</h4> <br><hr>
<!-- ----------------------- Body of Driver Form----------------------------------------------------- -->
<form #signupForm="ngForm">
<div class ="form-group">
<!-- Driver Name -->
<md-form-field class="example-full-width width" style="float:left;width: 30%;">
<input mdInput class="no-spin" [(ngModel)]="name" name=" driverName" placeholder="{{'Driver Name' | translate}}" required/>
<md-error class="required">{{'Enter Driver Name' | translate}}</md-error>
</md-form-field>
<!-- Driver Address -->
<md-form-field class="example-full-width width" style="float:left;width: 30%;padding-left:2%">
<input mdInput type="text" [(ngModel)]="address" name="driverAddress" placeholder="{{'Driver Address' | translate}}" required/>
<md-error class="required">{{'Enter Driver Address' | translate}}</md-error>
</md-form-field>
<!-- Driver Status -->
<md-form-field class="example-full-width width " style="float:left;width: 30%;padding-left:2%">
<input mdInput type="text" required [(ngModel)]="status" name="status" placeholder="{{'Status' | translate}}" />
</md-form-field>
</div>
<div class ="form-group">
<md-form-field class="example-full-width width" style="float:left;width: 30%;">
<input mdInput type="text" [(ngModel)]="license_number" name="licenseNumber" placeholder="{{'License Number' | translate}}" required>
<md-error class="required">{{'Enter License Number' | translate}}</md-error>
</md-form-field>
<md-form-field class="example-full-width width " style="float:left;width: 30%;padding-left:2%">
<input mdInput type="text" required [(ngModel)]="contactNumber" name="contactNumber" placeholder="{{'Contact Number' | translate}}" />
</md-form-field>
<md-form-field class="example-full-width width" style="float:left;width: 30%;padding-left:2%">
<input mdInput type="text" (keypress)="click1($event)" [(ngModel)]="salary" name="salary" placeholder="{{'Salary' | translate}}" required>
<md-error class="required">{{'Enter Salary' | translate}}</md-error>
</md-form-field>
<!-- -----date of joining--------- -->
<div style="float:left;width: 30%;padding-left:1%; padding-top: 1%;">
<div style="float:left;width: 20%;padding-top: 2.5%;">{{'DOJ' | translate}}:</div>
<div id="c11" style="float:left;width: 80%;">
<owl-date-time ngDefaultControl name="doj" [(ngModel)]="doj" [hourFormat]="'12'" [type]="'calendar'" [dateFormat]="'DD/MM/YYYY'" placeholder="{{'Date Of Joining' | translate}}" [autoClose]="true" required></owl-date-time> </div>
</div>
</div>
</form>
<!--image upload and License upload -->
<!-- <div class ="form-group">
<md-form-field class="example-full-width width" style="float:left;width: 50%">
<input mdInput type="text" [(ngModel)]="imagePath" name="imagePath1" placeholder="Image Path" required readonly>
{{Filename}}
</md-form-field>
</div> <br>
<div class="form-group">
<md-form-field class="example-full-width width" style="float:left;width: 50%">
<input mdInput type="text" [(ngModel)]="license_upload" name="image" placeholder="Image Path" required readonly>
{{Filename}}
</md-form-field>
</div> -->
<!-- </form> -->
<!-- formgroup ends here -->
<br><br>
<div style="padding-top:15%;">
<!-- <button class="btn btn-primary btn-block/"(click)="addDevice()" style="cursor:pointer;width: 159px;height: 44px;">Add Device</button> -->
</div><br>
<flash-messages style="float: center;"></flash-messages>
<!-- form button and flash msgs end here -->
<div >
<!-- <div style="padding-top:10%;">
<button class="btn btn-primary btn-block/"(click)="addDriver()" style="cursor:pointer;width: 159px;height: 44px;">ADD DRIVER</button>
</div><br> -->
<input type="submit" [disabled]="!signupForm.form.valid" (click) ="addDriver(signupForm.form)" class="btn btn-primary btn-block/" [value]="buttonText" style="cursor:pointer;width: 159px;height: 44px;" fxFlexAlign="center">
<input type="submit" (click) ="NewVehicleType(signupForm.form)" class="btn btn-primary btn-block/" value="Cancel" style="cursor:pointer;width: 159px;height: 44px;" >
<flash-messages style="float: center;"></flash-messages>
</div>
</md-card>
</div>
<!-- </div> -->
<!-- <div class="image" style=" float: right;
margin-top: -2%;
margin-right: 10%;">
<image-upload
[url]="'http://13.126.36.205:3000/vehicleType/profileUpload'"
[buttonCaption]="'Upload'"
(removed)="onRemoved($event)"
(uploadFinished)="onUploadFinished($event)"
>
</image-upload></div> -->
<!--(uploadStateChanged)="onUploadStateChanged($event)"-->
<!-- <div class="image" style=" float: right;
margin-top: -2%;
margin-right: 10%;">
<image-upload
url="http://13.126.36.205:3000/vehicleType/licenseUpload"
[beforeUpload]="onBeforeUpload1"
[buttonCaption]="'Upload1'"
(removed)="onRemoved1($event)"
(uploadFinished)="onUploadFinished1($event)"
(uploadStateChanged)="onUploadStateChanged1($event)">
</image-upload></div> -->
<!-- </body>
</html> -->
<!-- <html>
<head>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
</head>
<body>
<div class="upper">
<md-toolbar>My App</md-toolbar>
<md-toolbar flex style="background-color:white;width: 100%;" >
<img src="../../assets/image/f_logo.jpg"
style=
"width:12%;padding-top: 8px;">
<ul fxHide.sm="true" fxHide.xs="true" style="width:50%;padding:30px 10% 0 0;" fxLayout="row" >
</ul>
<ul fxShow fxHide.xs="false" fxHide.lg="true" fxHide.gt-sm="true" style="width:100%;padding-top: 15px;">
<md-menu #appMenu="mdMenu" [overlapTrigger]="false">
<h5>&nbsp;&nbsp;{{fs}} {{ls}}</h5>
<h5>&nbsp;&nbsp;{{or}}</h5><br>
&nbsp; <button type="reset" class="btn btn-default" >My Account</button>
<button class="btn btn btn-success"(click)="logout()" >&nbsp;&nbsp;&nbsp;Log Out&nbsp;&nbsp;&nbsp;</button> &nbsp;
</md-menu>
<button md-icon-button [mdMenuTriggerFor]="appMenu" style="float:right;outline:none">
<img src="../../assets/image/us.jpg" height=30px>
</button>
</ul>
<ul fxShow fxHide.xs="true" fxHide.lt-md="true" fxHide.gt-sm="false" style="float:right;width:30%; margin-top: 3%;">
<md-menu #appMenu="mdMenu" [overlapTrigger]="false">
<h5>&nbsp;&nbsp;{{fs}} {{ls}}</h5>
<h5>&nbsp;&nbsp;{{or}}</h5><br>
&nbsp; <button type="reset" class="btn btn-default" >My Account</button>
<button class="btn btn btn-success"(click)="logout()" >&nbsp;&nbsp;&nbsp;Log Out&nbsp;&nbsp;&nbsp;</button> &nbsp;
</md-menu>
<button md-icon-button [mdMenuTriggerFor]="appMenu" style="float:right;outline:none">
<img src="../../assets/image/us.jpg" height=30px>
</button>
</ul>
</md-toolbar>
</div>
<div class="for" >
<md-card>
<form action="" role="form">
<input id='step2' type='checkbox'>
<input id='step3' type='checkbox'>
<div id="part1" class="form-group">
<div class="panel panel-primary">
<b><h3 style="text-align:left;">Device Details</h3></b>
<form #lgForm="ngForm" (ngSubmit)="addDevice()">
<progress-bar [value]="50" [max]="100" title="Device Details"></progress-bar> <br>
<div class ="form-group">
<md-form-field class="example-full-width width">
<input mdInput class="no-spin" [(ngModel)]=" deviceid" name=" deviceid"placeholder="Device ID" required/>
<md-error class="required">Enter Device ID</md-error>
</md-form-field>&nbsp;&nbsp;&nbsp;
<md-form-field class="example-full-width width">
<input mdInput type="text" [(ngModel)]="devicename" name="devicename"placeholder="Device Name" required/>
<md-error class="required">Enter Device Name</md-error>
</md-form-field>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<md-form-field class="example-full-width width ">
<input mdInput type="text" [(ngModel)]="des" name="des"placeholder="Description" />
</md-form-field>&nbsp;&nbsp;&nbsp;&nbsp;
<md-select name="typdev" placeholder="Device Type" style="margin-top: -4px;
width: 40%;
/* float: right; */
margin-right: 2%;" [(ngModel)]="new" (ngModelChange)="cultivoChange(new)">
<md-option *ngFor="let food of foods" [value]="food" >
{{ food.viewValue }}
</md-option>
</md-select>
<div *ngIf="show">
<md-form-field class="example-full-width width" style="float:left;margin-left:8%;">
<input mdInput type="text" [(ngModel)]="hrdwr" name="hrdwr"placeholder="SIM Number" required/>
<md-error class="required">Enter SIM Number</md-error>
</md-form-field>
<md-select name="neww" placeholder="Vechiles Type" style="margin-top: -4px;
width: 40%;
/* float: right; */
margin-right: 8%;" [(ngModel)]="neww">
<md-option *ngFor="let foodd of foodds" [value]="foodd" >
{{ foodd.viewValue }}
</md-option>
</md-select>
</div>
</div>
<br> <br> <br>
<div class="btn-group btn-group-lg" role="group" aria-label="...">
<label class="back">
<div class="btn btn-default btn-primary btn-lg" role="button" (click)="back2home();">Back</div>
</label>&nbsp;&nbsp;
<label for='step2' id="continue-step2" class="continue">
<div class="btn btn-default btn-success btn-lg" >Next</div>
</label>
</div>
</form>
</div>
</div>
<div id="part2" class="form-group">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 style="text-align:left;">Security</h3>
</div>
<progress-bar [value]="100" [max]="100" title="Security" color="red"></progress-bar>
<b><h5 align="justify"><font size="+1">Auto-generated authentication token</font></h5></b>
<p align="justify">
You have registered your device credentials, to get connected you need to generate the token key. Once you have generated the token, you will able to read and write the devices. Token will be sent to your registered e-mail id. Authentication tokens are non-recoverable. If you missplace this token, you will need to re-register the device to generate the new authentication token.
</p>
<md-card style="margin-top:-2px;height:104px">
<div style="margin-top:-35px;">
<div class ="form-group">
<br>
<label style="float:left;font-size:16px;"><b>Device ID : &nbsp;</b></label>
<label style="float:left;font-size:12px; margin-top: 3px;">{{this.deviceid}}</label><br>
</div>
<div class ="form-group">
<label style="float:left;font-size:16px;"><b>Device Name : &nbsp;</b></label>
<label style="float:left;font-size:12px; margin-top: 3px;">{{this.devicename}}</label><br>
<br>
<br> </div>
</div>
</md-card>
<div class="btn-group btn-group-lg btn-group-justified" role="group" aria-label="...">
<label for='step2' id="back-step2" class="back">
<div class="btn btn-default btn-primary btn-lg" role="button">Back</div>
</label>&nbsp;&nbsp;
&nbsp;&nbsp; <label for='step3' id="continue-step3" class="continue">
<button type="submit" class="btn btn-default btn-success btn-lg" (click)="addDevice()"[disabled]="!lgForm.form.valid">Submit</button>
</label>
</div>
<flash-messages style="float: center;"></flash-messages>
<button (click)="test()" style="float:left;font-size:11px;background-color: Transparent; background-repeat:no-repeat;border: none;cursor:pointer; overflow: hidden;outline:none;margin-top:10pxpx">* token pricing</button>
</div>
</div>
</form>
</md-card>
</div>
</body>
</html> -->

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddDriverComponent } from './add-driver.component';
describe('AddDriverComponent', () => {
let component: AddDriverComponent;
let fixture: ComponentFixture<AddDriverComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddDriverComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddDriverComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,738 @@
import { Component, Inject, OnInit} from '@angular/core';
import {JSONEditor} from 'jsoneditor';
import {Device} from '../device';
import {Driver} from '../driver';
import {Token} from '../token';
import{Contact} from '../contact';
import {MdSnackBar} from '@angular/material';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import { SidebarComponent } from '../sidebar/sidebar.component';
import {ContactService} from '../contact.service';
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot,ActivatedRoute,Params } from '@angular/router';
import { FlashMessagesService } from 'angular2-flash-messages';
import {Observable} from 'rxjs/Rx';
import { MyaccountComponent } from '../myaccount/myaccount.component';
import {MdDialog, MdDialogRef, MD_DIALOG_DATA} from '@angular/material';
import { toString } from '@ng-bootstrap/ng-bootstrap/util/util';
@Component({
selector: 'app-add-driver',
templateUrl: './add-driver.component.html',
styleUrls: ['./add-driver.component.css'],
providers: [ContactService,SidebarComponent]
})
export class AddDriverComponent implements OnInit {
text: any;
timezoneArray(arg0: any): any {
throw new Error("Method not implemented.");
}
contactNumber
//File uploader above
device_Id: string;
dev: any;
deviceId: any;
group_info: any;
executed2:any;
groupInfo:any;
devices: Device[] = []
device: Device
fuel_tank_capicity:any;
voltage_tank_empty:any;
tankfull_capicity:any;
tokens: Token[] = []
token: Token
useridd: any;
routeData : any=[];
data:any;
fs: any;
ls: any;
or: any;
mb: any;
custtype: any;
cust: boolean;
logoutbut: boolean;
dealer: boolean;
logo: any;
superAdmin: any;
myaccount(){
this.cond = false
this.router.navigateByUrl("accountSettings");
// let dialogRef = this.dialog.open(MyaccountComponent, {
// width: '903px',
// data: {}
// });
// dialogRef.afterClosed().subscribe(result => {
// if(result == "succ"){
// console.log("Updated")
// }
// });
}
group(){
this.cond = false
this.router.navigateByUrl("group_view");
}
openNav() {
/* document.getElementById("myNav").style.width = "100%";
*/
this.router.navigateByUrl("location");
} logout(){
window.localStorage.clear();
this.router.navigateByUrl("login");
}
devi(){
this.router.navigateByUrl("dashboard");
}
soon(){
this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
vehicleRoute(){
this.cond = false
this.router.navigateByUrl("vehicleRoute");
}
dealerInfo(){
this.cond = false
this.router.navigateByUrl("dealerInfo");
}
// new_1(){
// this.router.navigateByUrl("new");
// }
cond:Boolean = false;
point : any = 0;
aa(){
// console.log(this.point);
if(this.point == 0){
this.cond = true;
this.point ++;
}
else if(this.point % 2 == 0){
this.cond = true;
this.point ++;
}
else{
this.cond = false
this.point ++;
}
}
Ddetail(){
this.router.navigateByUrl("driverdetail");
}
DModel(){
this.router.navigateByUrl("deviceModel");
}
VType(){
this.router.navigateByUrl("VehicleType");
}
routeViolation(){
this.cond = false
this.router.navigateByUrl("device-report/routeViolation");
}
alert_report(){
this.cond = false
this.router.navigateByUrl("device-report/alert-report");
}
summaryReport(){
this.cond = false
this.router.navigateByUrl("device-report/summary-report");
}
overspeed(){
this.cond = false
this.router.navigateByUrl("device-report/overspeed");
}
stoppage_report(){
this.cond = false
this.router.navigateByUrl("device-report/stoppage_report");
}
ignition_report(){
this.cond = false
this.router.navigateByUrl("device-report/ignition_report");
}
geofancingReport(){
this.cond = false
this.router.navigateByUrl("device-report/geofancing");
}
route_map(){
this.router.navigateByUrl("routeMapping");
}
distance_report(){
this.cond = false
this.router.navigateByUrl("device-report/distance_report");
}
trip_report(){
this.cond = false
this.router.navigateByUrl("device-report/trip_report");
}
addgeo(){
this.router.navigateByUrl("geofence-add");
}
geo(){
this.router.navigateByUrl("geofencing");
}
a(){
// console.log(this.point);
if(this.point == 0){
this.cond = true;
this.point ++;
}
else if(this.point % 2 == 0){
this.cond = true;
this.point ++;
}
else{
this.cond = false
this.point ++;
}
}
addcus(){
this.router.navigateByUrl("add");
} report(){
this.cond = false
this.router.navigateByUrl("device-report");
}
report_speed(){
// console.log("report speed call")
this.cond = false
this.router.navigateByUrl("device-report/device-speed-report");
}
name: any;
address: any;
status: any;
license_number: any;
license_upload: any;
overall_rating: any;
salary:any;
doj: string;
Manf: string;
Model: string;
tkstatus:any;
value:any;
Lo:string;
Hardware_Ver: string;
Loca: string;
temp:any
food:any
new:any;
email:any;
message:string;
selectedValue:any;
show:boolean =false;
remove
devicename: any;
deviceid: any;
des: any;
model: any;
Des: any;
hrdwr: any;
typdev:any;
Device_ID: string;
/* ../../assets/image/bgtry2.jpg */
foodds = [
{value: 'true', viewValue: 'True'},
{value: 'false', viewValue: 'False'},
];
cultivoChange(val){
if(val.value == "Tracker"){
this.show=true
}
else{
this.show=false
}
}
back2home(){
// console.log("Runnig Back")
this.router.navigateByUrl("dashboard");
}
title="Add Driver";
buttonText="Add";
update:boolean=false
constructor(public dialogRef: MdDialogRef<AddDriverComponent>,@Inject(MD_DIALOG_DATA) public data1: any ,private _formBuilder: FormBuilder,private router: Router, public snackBar: MdSnackBar,private contactService: ContactService,private _flashMessagesService: FlashMessagesService,private sidebar:SidebarComponent,public dialog: MdDialog,private act:ActivatedRoute) {
console.log(data1);
if(Object.keys(data1).length != 0){
this.update=true
this.title="Edit Driver";
this.buttonText="Update"
this.name=data1.name;
this.salary=data1.salary;
this.doj=data1.date_of_joining;
this.address=data1.address;
this.status=data1.status;
this.license_number=data1.license_number
this.contactNumber=data1.contactNumber
}else{
this.update=false
this.title="Add Driver";
this.buttonText="Add"
}
}
test(){
// console.log("Runnig Test")
// console.log(this.new.value);
}
mydealer(){
window.localStorage['token'] = window.localStorage['Dealer_token'];
localStorage.removeItem('devices');
window.localStorage['DataUpdate'] = 'True';
if(window.localStorage['DataLoaded'] = 'True'){
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
// this.router.navigateByUrl("const?_status="+"OK");
}
}
/* TOKEN GENERATION */
tokenn(){
if(this.name == null)
{
this._flashMessagesService.show('Error : Insert the Complete Details', { cssClass: 'alert-danger', timeout: 1000 });
this.tkstatus=0;
}
else{
// console.log("GENERATING TOKEN")
/* const newToken ={
deviceid: this.deviceid,
eid: "test@test.com",
}
this.contactService.addToken(newToken)
.subscribe(token => {
this.tokens.push(token);
});
this.tkstatus=1; */
}
}
/* ADD DEVICE */
mess:any;
mess2:any;
mess3:any;
neww:any;
driver:any;
before:any;
dcontact:any;
timer:any;
subscription:any;
Load:boolean=false
ign(){
this.router.navigateByUrl("device-report/ign-report");
}
addDriver(ngForm){
// alert(this.useridd);
if(this.name == null||this.address == null||this.status == null||this.license_number == null||this.salary == null||this.doj == null)
{
this._flashMessagesService.show('Error : Please insert details of Driver', { cssClass: 'alert-danger', timeout: 2000 });
this.Load = false
}
// else if(this.address == null)
// {
// this._flashMessagesService.show('Error : Insert the Address ', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// else if(this.status == null)
// {
// this._flashMessagesService.show('Error : Insert the Status', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// second row
// else if(this.license_number == null)
// {
// this._flashMessagesService.show('Error : Insert license number', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// else if(this.license_upload == null)
// {
// this._flashMessagesService.show('Error : Insert license upload', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// else if(this.overall_rating == null)
// {
// this._flashMessagesService.show('Error : Insert overall rating', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// third row
// else if(this.salary == null)
// {
// this._flashMessagesService.show('Error : Insert salary', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// else if(this.doj == null)
// {
// this._flashMessagesService.show('Error : Insert date of joining', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// else if(this.imagePath == null)
// {
// this._flashMessagesService.show('Error : Insert image path', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
else{
this._flashMessagesService.show('Driver Added', { cssClass: 'alert-danger', timeout: 1000 });
}
//this._flashMessagesService.show('Congratulation Device Added as '+this.deviceid, { cssClass: 'alert-success', timeout: 2000 });
//object should form as per the request;
if(this.update){
this.updateDriver()
}else{
const newDriver ={
name: this.name,
address: this.address,
status: this.status,
license_number: this.license_number,
overall_rating:this.overall_rating,
salary:this.salary,
doj:this.doj,
userid :this.routeData,
contactNumber:this.contactNumber,
}
//webservice to add new driver
this.contactService.addDriver(newDriver)
.subscribe((dataret => {
this.data = dataret
this.NewVehicleType(ngForm);
if(this.data.status == 200){
//this.driver.push(newDriver);
this._flashMessagesService.show("New Driver Added!", { cssClass: 'alert-danger', timeout: 2000 });
}
}), (err: any) => {
// console.log(err.status);
// console.log(err);
if(err.status == 500)
{
this.mess = err._body.split(":")[5] ;
this.mess2 = this.mess.split("_")[0];
this.mess3 = this.mess.split("_")[1];
// this._flashMessagesService.show(this.mess2 + this.mess3+" Duplicate Entry", { cssClass: 'alert-danger', timeout: 3000 });
this.Load = false
// console.log("Error");
}
else{
this._flashMessagesService.show("Error !!", { cssClass: 'alert-danger', timeout: 2000 });
this.Load = false
}
}
);
}
}
updateDriver(){
var data={
_id:this.data1._id,
name: this.name,
address: this.address,
status: this.status,
license_number: this.license_number,
overall_rating:this.overall_rating,
salary:this.salary,
doj:this.doj,
contactNumber:this.contactNumber,
userid :this.data1.user_id._id
}
this.contactService.post('/driver/updateDriverDetails',data).subscribe(res=>{
// this.dialogRef.close();
})
}
// imageFile:any;
// Filename:any;
// Lfilename:any;
private fileCounter = 0;
// -------------------profile upload----------------------------------
// onBeforeUpload = (metadata) => {
// if (this.fileCounter % 2 === 0) {
// metadata.abort = true;
// } else {
// // mutate the file or replace it entirely - metadata.file
// metadata.url = 'http://13.126.36.205:3000/vehicleType/profileUpload'
// }
// this.fileCounter++;
// return metadata;
// };
// onUploadFinished(file) {
// debugger;
// console.log(file);
// this.imageFile=file;
// console.log(this.imageFile.file.name);
// this.Filename=this.imageFile.file.name
// }
// onRemoved(file) {
// console.log(file);
// }
// onUploadStateChanged(state: boolean) {
// console.log(state);
// }
// //---------------license upload------------------
// onBeforeUpload1 = (metadata) => {
// if (this.fileCounter % 2 === 0) {
// metadata.abort = true;
// } else {
// // mutate the file or replace it entirely - metadata.file
// metadata.url = 'http://13.126.36.205:3000/vehicleType/licenseUpload'
// }
// this.fileCounter++;
// return metadata;
// };
// onUploadFinished1(file) {
// debugger;
// console.log(file);
// this.imageFile=file;
// console.log(this.imageFile.file.name);
// this.Lfilename=this.imageFile.file.name
// }
// onRemoved1(file) {
// console.log(file);
// }
// onUploadStateChanged1(state: boolean) {
// console.log(state);
// }
report_map(){
this.router.navigateByUrl("routeMapping");
}
NewVehicleType(ngForm){
//this.router.navigateByUrl("addEditVehicleType");
this.driver=[];
ngForm.reset();
}
click1(event){
if((event.keyCode >= 48 && event.keyCode <= 57) || event.keyCode == 9 || event.keyCode == 8 || event.keyCode == 46 || event.keyCode == 37 || event.keyCode == 39){
}
else
event.preventDefault();
}
ngOnInit() {
// console.log(moment("2014-06-01T12:00:00Z").tz('America/Los_Angeles').format('ha z'));
this.logo=window.localStorage['logo'];
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
this.fs = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).fn;
this.ls = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).ln;
this.email = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email;
this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName;
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.mb = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).phn;
this.custtype = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer;
if(this.custtype == true){
this.cust = true;
}
if(this.mb.charAt(0)=="n"){
this.mb = ' '
}
if(this.mb.charAt(0)=="n"){
this.mb = ' '
}
if( window.localStorage['Custumer'] == 'ON'){
this.logoutbut = false
this.dealer = true
}
else{
this.logoutbut = true
}
this.logo=window.localStorage['logo'];
this.text=window.localStorage['text'];
this.act.queryParams.subscribe((params:Params) =>{
// console.log(params['useridd']);
this.routeData=params.user_id;
// let id= params['user_id'];
// this.groupId = id;
// console.log(this.groupId);
})
}
}
// call(e) {
// {
// if (e.keyCode == 32) {
// e.preventDefault();
// }
// }
// }
// click1(event){
// if((event.keyCode >= 48 && event.keyCode <= 57) || event.keyCode == 9 || event.keyCode == 8 || event.keyCode == 46 || event.keyCode == 37 || event.keyCode == 39){
// }
// /* if(event.keyCode===13){
// this.otp_window();
// } */
// else
// event.preventDefault();
// }
// fs:any;
// ls:any;
// or:any;
// userid:any;
// emailid :any;
// useridd:any;
// custtype:any;
// cust:boolean=true;
// isLinear = false;
// firstFormGroup: FormGroup;
// secondFormGroup: FormGroup;
// phoneno: any;
// logo:any;
// text:any;
// ideal(){
// this.router.navigateByUrl("device-report/ideal-report");
// }
// mb:any
// logoutbut:boolean;
// dealer:boolean;
// groups=[];
// group(){
// this.cond = false
// this.router.navigateByUrl("group_view");
// }
// fuel_calibration(){
// console.log("Inside fuel Callibration !!!");
// if(this.fuel_tank_capicity == null)
// {
// this._flashMessagesService.show('Error : Empty entry', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// else if(this.voltage_tank_empty == null)
// {
// this._flashMessagesService.show('Error : Empty entry', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// else if(this.tankfull_capicity == null)
// {
// this._flashMessagesService.show('Error : Empty entry', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// const fuelCapicity ={
// fuelCapicity: this.fuel_tank_capicity,
// voltageTankempity: this.voltage_tank_empty,
// tankfullcapicity: this.tankfull_capicity,
// }
// console.log(fuelCapicity);
// }
//}

View file

@ -0,0 +1,20 @@
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
/* Track */
::-webkit-scrollbar-track {
background: rgb(143, 215, 255);;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #dadada;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}

View file

@ -0,0 +1,167 @@
<app-all-menus></app-all-menus>
<div class="container" style="width: 90%;max-width: 100%;">
<div class="row" style="padding-top: 6%;height:98vh;padding-left: 0;padding-right: 0;">
<div class="col-12" style="background: whitesmoke;padding: 0;height: 90vh;">
<div class="row" style="width:100%;text-align: center;align-items: center;background: #426E86; padding-top: 10px; margin: 0; color: white;">
<div class="col-12">
<flash-messages style="float: center;position: absolute;"></flash-messages>
<p>{{'ADD VEHICLE TYPE'| translate}}</p>
</div>
</div>
<form #signupForm="ngForm">
<div class="row" style="margin: 0px;margin-top: 20px;">
<div class="col-sm-12 col-md-6 col-lg-6">
<div class="row">
<div class="col-sm-12 col-md-6 col-lg-6">
<div class="form-group">
<label for="exampleInputEmail1">{{'Brand' | translate}}</label>
<input type="email" class="form-control" id="exampleInputEmail1" name="brand" [(ngModel)]="brand" aria-describedby="emailHelp" placeholder="{{'Enter Brand Name' | translate}}">
<!-- <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small> -->
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-6" >
<div class="form-group">
<label for="exampleInputEmail1">{{'Description' | translate}}</label>
<input type="email" class="form-control" id="exampleInputEmail1" name="description" style="width: 95%;" aria-describedby="emailHelp" [(ngModel)]="description" placeholder="{{'Pealse Enter Description' | translate}}">
<!-- <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small> -->
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-md-6 col-lg-6">
<div class="form-group">
<label for="exampleInputEmail1">{{"Model" | translate}}</label>
<input type="email" name="model" class="form-control" id="exampleInputEmail1" [(ngModel)]="model" aria-describedby="emailHelp" placeholder="{{'Enter Model' | translate}}">
<!-- <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small> -->
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-6">
<div class="form-group">
<!-- <label for="exampleInputEmail1">Icon type</label> -->
<label for="exampleInputEmail1">{{'Mileage' | translate}}</label>
<input type="number" name="mileage" class="form-control" id="exampleInputEmail1" [(ngModel)]="mileage" style="width: 95%;" aria-describedby="emailHelp" placeholder="{{'Enter Mileage' | translate}}">
</div>
</div>
</div>
<div style="text-align: center;">
<label style="font-weight: 700; color: red;">{{'Fuel Calibration' | translate}}</label>
<md-icon style="cursor: pointer;float: right;padding-left: 5px;font-weight: 600;color:grey" (click)="addRow(0,0)">add</md-icon>
</div>
<div class="form-group" style="width:100%;height: 225px; max-height: 225px;overflow: auto;overflow-x: hidden;">
<div class="row" *ngFor="let data of voltage_calibration; let i =index">
<div class="col-sm-12 col-md-6 col-lg-6">
<input type="number" class="form-control" id="exampleInputEmail1" [(ngModel)]="data.voltage" (keypress)="click1($event)"
name="data.voltage{{i}}" aria-describedby="emailHelp" placeholder="Enter in volts">
<small id="emailHelp" class="form-text text-muted">{{"VOLTAGE VALUE" | translate}}</small>
</div>
<div class="col-sm-12 col-md-6 col-lg-6">
<div>
<input type="number" class="form-control" id="exampleInputEmail1" [(ngModel)]="data.fuel" (keypress)="click1($event)"
name="data.fuel{{i}}" style="width: 90%;" aria-describedby="emailHelp" placeholder="{{'Enter fuel in liters' | translate}">
<small id="emailHelp" class="form-text text-muted">{{'FUEL VALUE' | translate}}</small>
</div>
<i class="fas fa-trash" (click)="deleteRow(i)" style="cursor: pointer;color: red;position: absolute;right: 18px; bottom: 30px;"></i>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-6">
<div class="row">
<div class="col-sm-12 col-md-6 col-lg-6">
<div class="form-group">
<label for="exampleInputEmail1">{{'Tank Size' | translate}}</label>
<input type="number" class="form-control" name="tank_size" [(ngModel)]="tank_size" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="{{'Tank Size' | translate}}">
<!-- <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small> -->
</div>
</div>
<div class="col-sm-12 col-md-6 col-lg-6" >
<div class="form-group">
<md-select style="width: 94%;padding-top: 12%;" name="neww"
placeholder="{{'Select icon type' | translate}}" [(ngModel)]="iconObj">
<md-option *ngFor="let icon of IconType" [value]="icon">{{icon.viewValue}}</md-option>
</md-select>
<!-- <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small> -->
</div>
</div>
</div>
<div class="row" style="height: 75px;">
<div class="col-12">
</div>
</div>
<div style="text-align: center;">
<label style="font-weight: 700; color: red;">{{'Temperature Calibration' | translate}}</label>
<md-icon style="cursor: pointer;float: right;padding-left: 5px;font-weight: 600;color:grey" (click)="addTempRow(0,0)">add</md-icon>
</div>
<div class="form-group" style="width:100%;height: 225px; max-height: 225px;overflow: auto;overflow-x: hidden;">
<div class="row" *ngFor="let data1 of temprature_calibration; let i =index">
<div class="col-sm-12 col-md-6 col-lg-6">
<input type="number" class="form-control" id="exampleInputEmail1" [(ngModel)]="data1.voltage" (keypress)="click1($event)"
name="data1.voltage{{i}}" aria-describedby="emailHelp" placeholder="{{'Enter in volts' | translate}}">
<small id="emailHelp" class="form-text text-muted">{{'VOLTAGE VALUE' | translate}}</small>
</div>
<div class="col-sm-12 col-md-6 col-lg-6">
<div>
<input type="number" class="form-control" id="exampleInputEmail1" [(ngModel)]="data1.temp" (keypress)="click1($event)"
name="data1.temp{{i}}" style="width: 90%;" aria-describedby="emailHelp" placeholder="Enter tempreture in celsius">
<small id="emailHelp" class="form-text text-muted">{{'TEMPERATURE VALUE' | translate}}</small>
</div>
<i class="fas fa-trash" (click)="deltempRow(i)" style="cursor: pointer;color: red;position: absolute;right: 18px; bottom: 30px;"></i>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="margin: 0px;margin-top: 20px;">
<div class="col-sm-12 col-md-6 col-lg-6">
</div>
<div class="col-sm-12 col-md-6 col-lg-6">
<!-- <label>{{'Fuel Calibrator' | translate}}</label> -->
<!-- <md-icon style="cursor: pointer;float: right;padding-left: 5px;font-weight: 600;color:grey" (click)="addRow(0,0)">add</md-icon> -->
<!-- <div class="form-group" style="width:100%;height: 225px; max-height: 225px;overflow: auto;overflow-x: hidden;"> -->
<!-- <div class="row">
<div class="col-sm-12 col-md-10 col-lg-10">
<p style="color: #555454;font-weight: 400;"><label>{{'Volatage Calibrator' | translate}}</label></p>
</div>
<div class="col-sm-12 col-md-2 col-lg-2">
<md-icon style="cursor: pointer;" (click)="addRow(0,0)">add</md-icon>
</div>
</div> -->
<!-- <div class="row" *ngFor="let data of voltage_calibration; let i =index">
<div class="col-sm-12 col-md-6 col-lg-6">
<input type="number" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter in volts">
<small id="emailHelp" class="form-text text-muted">VOLTAGE VALUE</small>
</div>
<div class="col-sm-12 col-md-6 col-lg-6">
<div>
<input type="number" class="form-control" id="exampleInputEmail1" style="width: 90%;" aria-describedby="emailHelp" placeholder="Enter fuel in liters">
<small id="emailHelp" class="form-text text-muted">FUEL VALUE</small>
</div>
<i class="fas fa-trash" (click)="deleteRow(i)" style="cursor: pointer;color: red;position: absolute;right: 18px; bottom: 30px;"></i>
</div>
</div> -->
<!-- </div> -->
</div>
</div>
<div class="row" style="margin: 0px;">
<div class="col-12" style="text-align: center;">
<input type="submit" [disabled]="!signupForm.form.valid" (click)="addVehicleType(signupForm.form)"
class="btn btn-primary btn-block/" value="Add Vehicle Type" style="cursor:pointer;width: 159px;height: 44px;" fxFlexAlign="center">&nbsp;&nbsp;
<input type="submit" (click)="NewVehicleType(signupForm.form)" class="btn btn-primary btn-block/" value="Cancel" style="cursor:pointer;width: 159px;height: 44px;background-color: red;">
</div>
</div>
</form>
</div>
</div>
</div>

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddEditVehicleTypeComponent } from './add-edit-vehicle-type.component';
describe('AddEditVehicleTypeComponent', () => {
let component: AddEditVehicleTypeComponent;
let fixture: ComponentFixture<AddEditVehicleTypeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddEditVehicleTypeComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddEditVehicleTypeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,562 @@
import { Component, OnInit } from '@angular/core';
import {JSONEditor} from 'jsoneditor';
import {Device} from '../device';
import {Driver} from '../driver';
import {Token} from '../token';
import {Vehicle} from '../vehicle';
import{Contact} from '../contact';
import {MdSnackBar} from '@angular/material';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import { SidebarComponent } from '../sidebar/sidebar.component';
import {ContactService} from '../contact.service';
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot,ActivatedRoute,Params } from '@angular/router';
import { FlashMessagesService } from 'angular2-flash-messages';
import {Observable} from 'rxjs/Rx';
import { MyaccountComponent } from '../myaccount/myaccount.component';
import {MdDialog, MdDialogRef, MD_DIALOG_DATA} from '@angular/material';
import { toString } from '@ng-bootstrap/ng-bootstrap/util/util';
@Component({
selector: 'app-add-edit-vehicle-type',
templateUrl: './add-edit-vehicle-type.component.html',
styleUrls: ['./add-edit-vehicle-type.component.css'],
providers: [ContactService,SidebarComponent]
})
export class AddEditVehicleTypeComponent implements OnInit {
[x: string]: any;
device_Id: string;
dev: any;
deviceId: any;
group_info: any;
executed2:any;
groupInfo:any;
devices: Device[] = [];
device: Device;
vehicle_types:Vehicle[]=[];
vehicle_type:Vehicle;
IconType = [
{ value: 'car', viewValue: 'Car' },
{ value: 'bike', viewValue: 'Bike' },
{ value: 'bus', viewValue: 'Bus' },
{ value: 'pickup', viewValue: 'Pickup' },
{ value: 'tractor', viewValue: 'Tractor' },
{ value: 'truck', viewValue: 'Truck' },
{ value: 'truck', viewValue: 'Heavy Truck' },
{ value: 'tanker', viewValue: 'Tanker' },
{ value: 'jcb', viewValue: 'JCB' },
{ value: 'roadroller', viewValue: 'Roadroller' },
{ value : 'user' ,viewValue : 'User'},
{ value : 'ambulance' ,viewValue : 'Ambulance'},
// { value : 'tempo' ,viewValue : 'Tempo'}
];
// { value : 'user' ,viewValue : 'User'}
// Bike Bus Car Heavy truck Pickup Tanker Tractor Truck JCB Roadroller
iconObj:any;
fuel_tank_capicity:any;
voltage_tank_empty:any;
tankfull_capicity:any;
tokens: Token[] = []
token: Token
useridd: any;
routeData : any=[];
data:any;
custtype: any;
cust: boolean;
mb: any;
dealer: boolean;
logoutbut: boolean;
fs: any;
ls: any;
or: any;
logo: any;
superAdmin: any;
click1(event){
if((event.keyCode >= 48 && event.keyCode <= 57) || event.keyCode == 9 || event.keyCode == 8 || event.keyCode == 46 || event.keyCode == 37 || event.keyCode == 39){
}
else
event.preventDefault();
}
myaccount(){
this.cond = false
this.router.navigateByUrl("accountSettings");
// let dialogRef = this.dialog.open(MyaccountComponent, {
// width: '903px',
// data: {}
// });
// dialogRef.afterClosed().subscribe(result => {
// if(result == "succ"){
// console.log("Updated")
// }
// });
}
openNav() {
/* document.getElementById("myNav").style.width = "100%";
*/
this.router.navigateByUrl("location");
} logout(){
window.localStorage.clear();
this.router.navigateByUrl("login");
}
devi(){
this.router.navigateByUrl("dashboard");
}
soon(){
this.router.navigateByUrl("const?_i="+window.localStorage.token);
}
vehicleRoute(){
this.cond = false
this.router.navigateByUrl("vehicleRoute");
}
dealerInfo(){
this.cond = false
this.router.navigateByUrl("dealerInfo");
}
// new_1(){
// this.router.navigateByUrl("new");
// }
cond:Boolean = false;
point : any = 0;
aa(){
// console.log(this.point);
if(this.point == 0){
this.cond = true;
this.point ++;
}
else if(this.point % 2 == 0){
this.cond = true;
this.point ++;
}
else{
this.cond = false
this.point ++;
}
}
// Ddetail(){
// this.router.navigateByUrl("driverdetail");
// }
// DModel(){
// this.router.navigateByUrl("deviceModel");
// }
// VType(){
// this.router.navigateByUrl("VehicleType");
// }
// routeViolation(){
// this.cond = false
// this.router.navigateByUrl("device-report/routeViolation");
// }
// alert_report(){
// this.cond = false
// this.router.navigateByUrl("device-report/alert-report");
// }
// summaryReport(){
// this.cond = false
// this.router.navigateByUrl("device-report/summary-report");
// }
// overspeed(){
// this.cond = false
// this.router.navigateByUrl("device-report/overspeed");
// }
// stoppage_report(){
// this.cond = false
// this.router.navigateByUrl("device-report/stoppage_report");
// }
// ignition_report(){
// this.cond = false
// this.router.navigateByUrl("device-report/ignition_report");
// }
// geofancingReport(){
// this.cond = false
// this.router.navigateByUrl("device-report/geofancing");
// }
// route_map(){
// this.router.navigateByUrl("routeMapping");
// }
// distance_report(){
// this.cond = false
// this.router.navigateByUrl("device-report/distance_report");
// }
// trip_report(){
// this.cond = false
// this.router.navigateByUrl("device-report/trip_report");
// }
// addgeo(){
// this.router.navigateByUrl("geofence-add");
// }
// geo(){
// this.router.navigateByUrl("geofencing");
// }
a(){
// console.log(this.point);
if(this.point == 0){
this.cond = true;
this.point ++;
}
else if(this.point % 2 == 0){
this.cond = true;
this.point ++;
}
else{
this.cond = false
this.point ++;
}
}
// addcus(){
// this.router.navigateByUrl("add");
// } report(){
// this.cond = false
// this.router.navigateByUrl("device-report");
// }
// report_speed(){
// // console.log("report speed call")
// this.cond = false
// this.router.navigateByUrl("device-report/device-speed-report");
// }
brand: any;
description: any;
model: any;
// voltage_calibration=[{voltage:[],fuel:[]}];
voltage_calibration=[];
temprature_calibration=[];
volts;
ltrs:any=[];
tank_size: number;
mileage: number;
Manf: string;
Model: string;
tkstatus:any;
value:any;
Lo:string;
Hardware_Ver: string;
Loca: string;
temp:any
food:any
new:any;
email:any;
message:string;
selectedValue:any;
show:boolean =false;
/* ../../assets/image/bgtry2.jpg */
foodds = [
{value: 'true', viewValue: 'True'},
{value: 'false', viewValue: 'False'},
];
cultivoChange(val){
if(val.value == "Tracker"){
this.show=true
}
else{
this.show=false
}
}
back2home(){
// console.log("Runnig Back")
this.router.navigateByUrl("dashboard");
}
constructor(private _formBuilder: FormBuilder,private router: Router, public snackBar: MdSnackBar,private contactService: ContactService,private _flashMessagesService: FlashMessagesService,private sidebar:SidebarComponent,public dialog: MdDialog,private act:ActivatedRoute) { }
test(){
// console.log("Runnig Test")
// console.log(this.new.value);
}
mydealer(){
window.localStorage['token'] = window.localStorage['Dealer_token'];
localStorage.removeItem('devices');
window.localStorage['DataUpdate'] = 'True';
if(window.localStorage['DataLoaded'] = 'True'){
window.localStorage['Custumer'] = 'OFF'
this.router.navigateByUrl("add")
// this.router.navigateByUrl("const?_status="+"OK");
}
}
/* TOKEN GENERATION */
/* ADD DEVICE */
mess:any;
mess2:any;
mess3:any;
neww:any;
driver:any;
before:any;
dcontact:any;
timer:any;
subscription:any;
Load:boolean=false
// ign(){
// this.router.navigateByUrl("device-report/ign-report");
// }
addVehicleType(signupForm){
// console.log("vehicle ICon",this.iconObj);
if(this.brand == null ||this.description == null|| this.model == null ||this.voltage_calibration == null||this.tank_size == null||this.mileage == null)
{
this._flashMessagesService.show('Error :Please Insert Details', { cssClass: 'alert-danger', timeout: 5000 });
// this.Load = false
//this.router.navigateByUrl("addEditVehicleType");
return;
}
// else if(this.description == null)
// {
// this._flashMessagesService.show('Error : Please Insert Description ', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// else if(this.model == null)
// {
// this._flashMessagesService.show('Error : Please Insert Model', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// second row
// else if(this.voltage_calibration == null)
// {
// this._flashMessagesService.show('Error : Please insert Voltage', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// else if(this.tank_size == null)
// {
// this._flashMessagesService.show('Error : Please Insert Tank Size', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
// else if(this.mileage == null)
// {
// this._flashMessagesService.show('Error : Please Insert Mileage', { cssClass: 'alert-danger', timeout: 2000 });
// this.Load = false
// }
else{
const newVehicleModel ={
brand: this.brand,
description: this.description,
model: this.model,
voltage_calibration: this.voltage_calibration,
temp_calibration: this.temprature_calibration,
tank_size: this.tank_size,
mileage: this.mileage,
iconType:this.iconObj.value,
user:this.useridd
}
console.log('newVehicleModel',newVehicleModel);
//webservice to add new driver
// console.log('finalPayload',newVehicleModel)
this.contactService.addVehicleType(newVehicleModel)
.subscribe((dataret => {
// this.data = dataret
// this.NewVehicleType(signupForm);
// this._flashMessagesService.show('Vehicle Type Added', { cssClass: 'alert-success', timeout: 2000 });
this.router.navigateByUrl("VehicleType");
// this.router.navigateByUrl("VehicleType");
}), (err: any) => {
if(err.status == 500)
{
this.mess = err._body.split(":")[5] ;
this.mess2 = this.mess.split("_")[0];
this.mess3 = this.mess.split("_")[1];
this.Load = false
}
else{
this._flashMessagesService.show("Error !!", { cssClass: 'alert-danger', timeout: 2000 });
this.Load = false
}
}
);
}
//this._flashMessagesService.show('Congratulation Device Added as '+this.deviceid, { cssClass: 'alert-success', timeout: 2000 });
//object should form as per the request
}
NewVehicleType(ngForm){
//this.router.navigateByUrl("addEditVehicleType");
this.router.navigateByUrl("VehicleType");
// this.vehicle_types=[];
// ngForm.reset();
}
imageFile:any;
Filename:any;
private fileCounter = 0;
group(){
this.cond = false
this.router.navigateByUrl("group_view");
}
onRemoved(file) {
// console.log(file);
}
report_map(){
this.router.navigateByUrl("routeMapping");
}
// loadRow(){
// this.voltage_calibration.push({voltage:0,fuel:0});
// }
addRow(voltage,fuel){
var obj={};
//let contact = this.voltage_calibration({voltage:0,fuel:0});
obj={voltage:voltage,fuel:fuel};
this.voltage_calibration.push(JSON.parse(JSON.stringify(obj)));
obj={};
}
addTempRow(voltage,temp){
var obj={};
//let contact = this.voltage_calibration({voltage:0,fuel:0});
obj={voltage:voltage,temp:temp};
this.temprature_calibration.push(JSON.parse(JSON.stringify(obj)));
obj={};
}
deltempRow(index){
this.temprature_calibration.splice(index, 1);
}
deleteRow(index){
this.voltage_calibration.splice(index, 1);
}
ngOnInit() {
this.logo=window.localStorage['logo'];
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
this.fs = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).fn;
this.ls = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).ln;
this.email = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email;
this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName;
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.mb = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).phn;
this.custtype = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer;
if(this.custtype == true){
this.cust = true;
}
if(this.mb.charAt(0)=="n"){
this.mb = ' '
}
if(this.mb.charAt(0)=="n"){
this.mb = ' '
}
if( window.localStorage['Custumer'] == 'ON'){
this.logoutbut = false
this.dealer = true
}
else{
this.logoutbut = true
}
this.logo=window.localStorage['logo'];
this.text=window.localStorage['text'];
this.act.queryParams.subscribe((params:Params) =>{
// console.log(params['useridd']);
this.routeData=params.user_id;
// let id= params['user_id'];
// this.groupId = id;
// console.log(this.groupId);
this.addRow(0,0);
this.addTempRow(0,0);
})
}
}

View file

@ -0,0 +1,69 @@
<app-all-menus></app-all-menus>
<div class="topDiv">
<!-- <div id="toast">
<div id="desc">{{data_descip}}</div>
</div> -->
<div class="row"
style="text-align: center; background: #426E86; padding-top: 10px; padding-bottom: 10px; color: white;box-shadow:3px 1px 5px 0px rgb(178, 176, 174)">
<div class="col-sm-12 col-md-12 col-lg-12">
<h4>{{'Add Fuel Price' | translate}}
<button class="btn btn-primary btn-sm" style="float: right;margin-right: 11px;" [routerLink]="['/FuelPrice']"><i
class="fas fa-arrow-left"></i> Back</button>
<button class="btn btn-primary btn-sm" *ngIf="useridd=='59cbbdbe508f164aa2fef3d8'" style="float: right;margin-right: 11px;" data-toggle="collapse" href="#multiCollapseExample1" role="button" aria-expanded="false"
aria-controls="multiCollapseExample1"><i class="fas fa-upload"></i> Upload Excel</button>
</h4>
</div>
</div>
<div class="collapse multi-collapse" id="multiCollapseExample1">
<div class="card card-body">
<div class="row" style="margin-top: 10px;margin-bottom: 10px;">
<div class="col-sm-12" style="text-align: left;font-size: initial;">
<div class="col-sm-offset-2 col-sm-10" style="text-align: center;">
<label style="background: MD_DIALOG_DATA;box-shadow: 2px 2px #a0a3a5;" class="file-upload btn btn-primary">Browse
for Excel file ... <input type="file" id="excelFile" multiple size="50" />
</label>
<button type="button" style="margin-top: 0px; margin-left: 15px;; width: 90px; box-shadow: 2px 2px #b1adad"
class="btn btn-primary" data-toggle="collapse" data-target="#collapseZero" aria-expanded="true"
aria-controls="collapseZero" (click)="uploadExcel()">Upload</button>
</div>
</div>
</div>
</div>
</div>
<div class="table-responsive" style="overflow: scroll;height: 90vh;">
<table class="table table-striped">
<thead>
<tr>
<th>State</th>
<th>Date</th>
<th>Petrol Price</th>
<th>Diesel Price</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of stateArray; let i=index;">
<td>{{item.state}}</td>
<td><input id="to_date" bsDatepicker class="form-control form-control-sm" style="height: 25px;" [bsConfig]="bsConfig"
[(ngModel)]="date" type="text"></td>
<td><input [(ngModel)]="item.petrol" (ngModelChange)="petrolChange($event,i)"></td>
<td><input [(ngModel)]="item.diesel" (ngModelChange)="dieselChange($event,i)"></td>
</tr>
</tbody>
</table>
<div class="text-center mb-3 mt-3">
<button class="btn btn-primary" (click)="submit()">Sumbit</button>
</div>
</div>
</div>

View file

@ -0,0 +1,46 @@
// #body{
// overflow-x: hidden;
// overflow-y: hidden;
// }
#myInput {
border-radius: 15px;
/* border: 2px solid #18262F; */
padding: 7px;
width: 116px;
height: 17px;
font-size: 9px;
outline: none;
float: right;
margin-top: 2%;
}
.headStyle {
text-align: center;
font-size: 22px;
font-weight: 500;
color: #6b6a6a;
padding-top: 7px;
margin: 0px;
}
.sidebar {
height: 84vh;
width: 24%;
text-align: left;
background: white;
box-shadow: 3px 1px 5px 0px #b2b0ae;
position: fixed;
padding: 10px;
}
.main {
box-shadow: 3px 1px 5px 0px #b2b0ae;
padding: 10px;
background: white;
// margin-left: 5px;
}
.topDiv {
padding-top: 59px;
background: whitesmoke;
height: 100vh;
}

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddFuelPriceComponent } from './add-fuel-price.component';
describe('AddFuelPriceComponent', () => {
let component: AddFuelPriceComponent;
let fixture: ComponentFixture<AddFuelPriceComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddFuelPriceComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddFuelPriceComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,155 @@
import { Component, OnInit } from '@angular/core';
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
import { BsDatepickerConfig } from 'ngx-bootstrap';
import { ContactService } from '../contact.service';
declare var XLSX:any;
@Component({
selector: 'app-add-fuel-price',
templateUrl: './add-fuel-price.component.html',
styleUrls: ['./add-fuel-price.component.scss']
})
export class AddFuelPriceComponent implements OnInit {
petrolPrice
dieselPrice
faileduploadDevices;
stateArray
Indianstate = [
{state:"Andhra Pradesh",petrol:"",diesel:'',date:''},
{state:"Arunachal Pradesh",petrol:"",diesel:'',date:''},
{state:"Assam",petrol:"",diesel:'',date:''},
{state:"Bihar",petrol:"",diesel:'',date:''},
{state:"Chhattisgarh",petrol:"",diesel:'',date:''},
{state:"Goa",petrol:"",diesel:'',date:''},
{state:"Gujarat",petrol:"",diesel:'',date:''},
{state:"Haryana",petrol:"",diesel:'',date:''},
{state:"Himachal Pradesh",petrol:"",diesel:'',date:''},
{state:"Jammu and Kashmir",petrol:"",diesel:'',date:''},
{state:"Jharkhand",petrol:"",diesel:'',date:''},
{state:"Karnataka",petrol:"",diesel:'',date:''},
{state:"Kerala",petrol:"",diesel:'',date:''},
{state:"Madhya Pradesh",petrol:"",diesel:'',date:''},
{state:"Maharashtra",petrol:"",diesel:'',date:''},
{state:"Manipur",petrol:"",diesel:'',date:''},
{state:"Meghalaya",petrol:"",diesel:'',date:''},
{state:"Mizoram",petrol:"",diesel:'',date:''},
{state:"Nagaland",petrol:"",diesel:'',date:''},
{state:"Odisha",petrol:"",diesel:'',date:''},
{state:"Punjab",petrol:"",diesel:'',date:''},
{state:"Rajasthan",petrol:"",diesel:'',date:''},
{state:"Sikkim",petrol:"",diesel:'',date:''},
{state:"Tamil Nadu",petrol:"",diesel:'',date:''},
{state:"Telangana",petrol:"",diesel:'',date:''},
{state:"Tripura",petrol:"",diesel:'',date:''},
{state:"Uttarakhand",petrol:"",diesel:'',date:''},
{state:"Uttar Pradesh",petrol:"",diesel:'',date:''},
{state:"West Bengal",petrol:"",diesel:'',date:''},
{state:"Andaman and Nicobar Islands",petrol:"",diesel:'',date:''},
{state:"Chandigarh",petrol:"",diesel:'',date:''},
{state:"Dadra and Nagar Haveli",petrol:"",diesel:'',date:''},
{state:"Daman and Diu",petrol:"",diesel:'',date:''},
{state:"Lakshadweep",petrol:"",diesel:'',date:''},
{state:"Delhi",petrol:"",diesel:'',date:''},
{state:"Puducherry",petrol:"",diesel:'',date:''},
]
bsConfig: Partial<BsDatepickerConfig>;
date=new Date();
uploadJSON;
showErrorupload_1
failedFiles;
useridd
constructor( private contactService:ContactService) { }
ngOnInit() {
this.stateArray=this.Indianstate
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.bsConfig = Object.assign({ dateInputFormat: 'DD-MM-YYYY' }, { containerClass: 'theme-dark-blue' });
let that = this;
$("#excelFile").change(function(e){
let _e:any = e;
that.failedFiles=[]
console.log("Inside function");
var reader = new FileReader();
console.log(reader);
reader.onload = function(e) {
let _E:any = e;
var data = _E.target.result;
let workbook = XLSX.read(data, {type: 'binary' });
let first_sheet_name = workbook.SheetNames[0];
let worksheet = workbook.Sheets[first_sheet_name];
let d:any = XLSX.utils.sheet_to_json(worksheet,{raw:true});
that.uploadJSON=d.map(function(d){
if((isFinite(Number(d.lat)) && Math.abs(Number(d.lat)) <= 90)&&(isFinite(d.long) && Math.abs(d.long) <= 180)){
console.log(d.lat);
return d;
}else{
if(!(that.failedFiles.includes(d))){
console.log(d);
d.diesel=d.diesel.substring(0, (d.diesel.length - 4));
d.petrol=d.petrol.substring(0, (d.petrol.length - 4))
that.failedFiles.push(d)
}
}
});
console.log("file=>",that.uploadJSON);
that.stateArray=that.failedFiles
console.log("Failed",that.stateArray);
that.faileduploadDevices=that.uploadJSON;
that.showErrorupload_1=true
};
reader.readAsBinaryString(_e.target.files[0]);
});
}
petrolChange(ev,i){
// console.log(ev,i);
}
dieselChange(ev,i){
// console.log(ev,i);
}
submit(){
console.log(this.stateArray);
for(var i=0;i<this.stateArray.length;i++){
this.stateArray[i].date=this.date.toISOString().substr(0, 10)
}
var request={
data:this.stateArray,
date:this.date
}
console.log(request);
this.contactService.post('/googleAddress/addFuelPrice',request).subscribe((res:any)=>{
console.log(res);
this.stateArray=this.Indianstate
})
}
uploadExcel(){
for(var i=0;i<this.stateArray.length;i++){
this.stateArray[i].date=this.date.toISOString().substr(0, 10)
}
var request={
data:this.stateArray,
date:this.date
}
console.log(request);
this.contactService.post('/googleAddress/addFuelPrice',request).subscribe((res:any)=>{
console.log(res);
this.stateArray=this.Indianstate
})
}
}

View file

@ -0,0 +1,71 @@
<!-- <div class="grpStyle">
<md-toolbar style="background: white;padding-left: 143px;background: white;
color: #676464;
font-weight: 500;">{{'Add Group' | translate}}</md-toolbar>
<div>
<input id="myInput" type="text" class="form-control" [(ngModel)]="name" placeholder="{{'Type group name' | translate}}" />
</div>
<div>
<md-select placeholder="--{{'Status' | translate}}--" [(ngModel)]="option" class="form-control">
<md-option *ngFor="let foodd of foodds" [value]="foodd">{{foodd}}</md-option>
</md-select>
</div>
</div>
<div>
</div>
<div style="margin: 10px;">
<md-dialog-actions>
<div class="row" style="margin-left:-4px;">
<button md-icon-button (click)="car_status()">
<img class="png-icon" src="../assets/image/car_1.png" style="width: 50px;height: 40px;border: 1px solid #863619;border-radius: 5px;">
</button>
<button md-icon-button (click)="bike_status()" style="margin-left: 13px">
<img class="png-icon" src="../assets/image/bike_1.png" style="width: 50px;height: 40px;border: 1px solid #863619;border-radius: 5px;">
</button>
<button md-icon-button (click)="truck_status()" style="margin-left: 13px">
<img class="png-icon" src="../assets/image/truck_1.png" style="width: 50px;height: 40px;border: 1px solid #863619;border-radius: 5px;">
</button>
</div>
</md-dialog-actions>
</div>
<div>
<md-dialog-actions>
<button md-raised-button (click)="onCloseConfirm(name,option)">{{'CONFIRM' | translate}}</button>&nbsp;
<button md-raised-button (click)="onCloseCancel()">{{'CANCEL' | translate}}</button>
</md-dialog-actions>
</div>
<p ng-if="showError" style="text-align:center">{{errortext}}</p> -->
<div class="card">
<div class="card-header">
<h4>Add Group</h4>
</div>
<div class="card-body">
<div class="row p-2">
<input id="myInput" type="text" class="form-control" [(ngModel)]="name"
placeholder="{{'Type group name' | translate}}" />
</div>
<div class="row p-2">
<md-select placeholder="--{{'Status' | translate}}--" [(ngModel)]="option" class="form-control">
<md-option *ngFor="let foodd of foodds" [value]="foodd">{{foodd}}</md-option>
</md-select>
</div>
<p ng-if="showError" style="text-align:center">{{errortext}}</p>
</div>
<div class="card-footer text-center">
<!-- <md-dialog-actions> -->
<button md-raised-button (click)="onCloseConfirm(name,option)">{{'CONFIRM' | translate}}</button>&nbsp;
<button md-raised-button (click)="onCloseCancel()">{{'CANCEL' | translate}}</button>
<!-- </md-dialog-actions> -->
</div>
</div>

View file

@ -0,0 +1,19 @@
.grpStyle{
input{
height: 40px;
border-radius: 7px;
padding-left: 6px;
width: 200px;
}
md-select{
width: 161px;
padding-left: 30px;
}
}
.iconStyle{
text-align: center;
padding: 17px 2px 17px 2px;
}

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddGroupComponent } from './add-group.component';
describe('AddGroupComponent', () => {
let component: AddGroupComponent;
let fixture: ComponentFixture<AddGroupComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddGroupComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddGroupComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,104 @@
import { MdDialog } from '@angular/material';
import { Component, OnInit } from '@angular/core';
import {MdDialogRef} from '@angular/material';
import {ContactService} from '../contact.service';
@Component({
selector: 'app-add-group',
templateUrl: './add-group.component.html',
styleUrls: ['./add-group.component.scss']
})
export class AddGroupComponent implements OnInit {
be: any;
errortext: any;
name:any;
status:any;
useridd:any;
icon="car"
foodds = [
'Active',"InActive"
];
option:any;
constructor(public thisDialogRef: MdDialogRef<AddGroupComponent>,private contactService:ContactService) { }
ngOnInit(){
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
}
showError=false;
group_payload:any;
car_icon:any;
bike_icon:any;
truck_icon:any;
car_status(){
this.icon="car"
}
truck_status(){
this.icon="truck"
}
bike_status(){
this.icon="bike"
}
onCloseConfirm(name,option){
// console.log("done")
let a = name;
if(option!=undefined){
this.be =option;
}else{
this.be=option;
}
if((a==undefined)&&(this.be==undefined)){
this.showError=true;
this.errortext="Please provide details ";
}
if(a==undefined){
this.showError=true;
this.errortext="Please type group name";
}else if(this.be==undefined){
this.showError=true;
this.errortext="Please select status";
}else{
// console.log("now call post service here and on success response close the dialog box")
this.group_payload ={
"uid" :this.useridd,
"name" : a,
"status" : this.be,
"logopath" : this.icon
}
this.contactService.addGroup(this.group_payload).subscribe(
res => {
if(res){
// console.log(res);
// console.log("Group added successfully");
this.thisDialogRef.close("success");
}
// console.log(res);
},
err=> {
console.log("Check your Internet Connection");
});
}
}
onCloseCancel(){
// console.log("cancel button clicked");
this.thisDialogRef.close('Cancel');
}
}

View file

@ -0,0 +1,746 @@
<!-- <app-all-menus></app-all-menus>
<div class="small">
<button md-button [mdMenuTriggerFor]="menu" style="padding:0%;"><i class="material-icons">list</i></button>
<md-menu #menu="mdMenu">
<a href="#">
<h6>DASHBOARD
<md-icon style="float:right">dashboard</md-icon>
</h6>
</a>
<a href="#">
<h6>RULES<md-icon style="float:right">dock</md-icon>
</h6>
</a>
</md-menu>
</div>
<div style="float:left; width: 100%;padding-top: 6%;">
<p class="headStyle">{{'Customers' | translate}}</p>
<p *ngIf="errorMsg" style="text-align: center">{{serviceResponse}}</p>
<div class="loading" *ngIf="Load">Loading&#8230;</div>
<div id="toast">
<div id="desc">{{data_descip}}</div>
</div>
<div class="row">
<div class="col-sm-4">
<button *ngIf="(dealer_Permission === true) || (superAdmin === true) || adbtn" mdTooltip="{{'Add customer' | translate}}" style="border:1px solid transparent; background-color: transparent;margin-top:8px;cursor:pointer" (click)="openDialog()">
<md-icon style="float: right;width:30px;height:30px;cursor:pointer">add</md-icon>
</button>
<a *ngIf="showNav" href="https://youtu.be/dg1zd2geHXA" style="cursor: pointer;color:black" title="Video tutorial"
target="_blank">
<md-icon class="material-icons" style="font-size: 30px"> theaters </md-icon>
</a>
</div>
<div class="col-sm-8" style="padding-left: 41%;padding-top: 1%;">
<input style="border-radius: 6px;
border: 1px solid #c7c7c7;
border-bottom: 0px;
padding: 12px;
width: 175px;
/* margin-right: 22%; */
height: 7px;
background-color: red;
font-size: 12px;
float: left;
margin-top: 0;
background: #fffcfc;" type="search" class="form-control" id="myInput" name="myInput" [(ngModel)]="myInput"
placeholder="{{'Customer Search' | translate}}" (ngModelChange)="searchFilter($event)" />
<button [disabled]="lastcall" (click)="pre()" style="margin-left: 10px;">
< {{'Previous' | translate}} </button> <button [disabled]="firstcall" (click)="next()"> {{'Next' | translate}} >
</button>
</div>
</div>
<div class="scrollbar" style="overflow:overlay;">
<table id="myTable" class="table table-striped" style="overflow-y: hidden;
overflow-x: hidden;font-size:12px">
<thead style="background-color:#A2C523;color: white;">
<tr>
<th>{{'User ID' | translate}}</th>
<th>{{'Name' | translate}}</th>
<th>{{'Dealer' | translate}}</th>
<th>{{'Email ID' | translate}}</th>
<th>{{'Phone Number' | translate}}</th>
<th>{{'Password' | translate}}</th>
<th>{{'Total Vehicle' | translate}}</th>
<th>{{'Deleted Vehicle' | translate}}</th>
<th>{{'Created On' | translate}}</th>
<th>{{'Expire On' | translate}}</th>
<th>{{'Token' | translate}}</th>
<th>{{'Last activity' | translate}}</th>
<th>{{'Last login' | translate}}</th>
<th>{{'Login type' | translate}}</th>
<th>{{'Documents' | translate}}</th>
<th>{{'Edit' | translate}}</th>
<th *ngIf="((custtype == true)||(superAdmin == true))">{{'Report Setting' | translate}}</th>
<th *ngIf="((custtype == true)||(superAdmin == true))">{{'Dashboard Column' | translate}}</th>
<th>{{'Delete' | translate}}</th>
<th>{{'Customer Status' | translate}}</th>
<th>{{'Customer Info' | translate}}</th>
<th>{{'Reset Password' | translate}}</th>
<th>{{'Add Point' | translate}}</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let cust_array of custumer">
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.user_id?cust_array.user_id:'NA'}}
</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.first_name}} {{cust_array.last_name}}
</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.DealerDetails[0].first_name}}
{{cust_array.DealerDetails[0].last_name}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.email}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.phone}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.pass?cust_array.pass:'NA'}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.total_vehicle}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.delDevices}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.created_on |date:'dd/MM/yyyy'}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">{{cust_array.expire_date|date:'dd/MM/yyyy'}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">
{{cust_array.notificationTokenCount ?cust_array.notificationTokenCount :0}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">
{{cust_array.last_activity_on|date:'dd/MM/yyyy, h:mm:ss a'}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">
{{cust_array.last_login|date:'dd/MM/yyyy, h:mm:ss a'}}</td>
<td style="cursor:pointer" (click)="vewdev(cust_array._id)">
{{cust_array.login_type?cust_array.login_type:"NA"}}</td>
<td>
<p><button md-tooltip="View/Download"
style="border:1px solid transparent; background-color: transparent;float:right"
(click)="viewDocuments(cust_array)">
<md-icon>library_books</md-icon>
</button></p>
</td>
<td>
<p><button md-tooltip="Edit" style="border:1px solid transparent; background-color: transparent;float:right"
(click)="edit_costumerDetail(cust_array)">
<md-icon>edit</md-icon>
</button></p>
</td>
<td *ngIf="((custtype == true)||(superAdmin == true))">
<p><button md-tooltip="Report Setting"
style="border:1px solid transparent; background-color: transparent;float:right"
(click)="reportSetting(cust_array)">
<md-icon>calendar_today</md-icon>
</button></p>
</td>
<td *ngIf="((custtype == true)||(superAdmin == true))">
<img src="assets/image/customised_table.png" alt="Customise Table Content" height="25" width="25" style="cursor: pointer;" title="Customise Table Content" (click)="custom_table(cust_array)">
</td>
<td>
<p><button md-tooltip="Delete"
style="border:1px solid transparent; background-color: transparent;float:right"
(click)="delete_costumerDetail(cust_array)">
<md-icon>delete</md-icon>
</button></p>
</td>
<td style="padding-top:20px">
<md-slide-toggle [(ngModel)]="cust_array.status" ngDefaultControl (change)="onChange(cust_array,$event)">
</md-slide-toggle>
</td>
<td style="padding-top:18px">
<i class="fas fa-sign-in-alt" style="cursor: pointer;font-size: 22px;" title="Send Login Credentials" (click)="shareUserCredential(cust_array)"></i>
</td>
<td style="padding-top:18px">
<img src="assets/image/reset_password.png" alt="reset_password" height="25" width="25" style="cursor: pointer;" title="Reset password" (click)="resetPassword(cust_array)">
</td>
<td>
<i id="pointShare" style="cursor:pointer;font-size: 20px;margin-top: 12px;" class="fas fa-coins" (click)="addPoints(cust_array)"></i>
</td>
</tr>
</tbody>
</table>
</div>
</div> -->
<div class="limiter">
<app-all-menus></app-all-menus>
<div id="toast">
<div id="desc">{{ data_descip }}</div>
</div>
<!-- <div class="loading" *ngIf="Load">Loading&#8230;</div> -->
<div class="container-table100">
<div class="wrap-table100">
<div class="row">
<div
class="col-6"
style="
width: 100%;
text-align: center;
align-items: center;
background: #426e86;
padding-top: 10px;
padding-bottom: 10px;
color: white;
box-shadow: 3px 1px 5px 0px rgb(178, 176, 174);
"
>
<i
class="fas fa-plus-circle"
*ngIf="dealer_Permission === true || superAdmin === true || adbtn"
(click)="openDialog()"
mdTooltip="{{ 'Add customer' | translate }}"
style="
box-shadow: 3px 1px 5px 0px #b2b0ae;
cursor: pointer;
float: left;
font-size: 24px;
border-radius: 50px;
margin-left: 20px;
"
></i>
<i style="cursor: pointer;float: left;font-size: 24px;margin-left: 16px;touch-action: none;user-select: none;" class="fas fa-file-excel" (click)="downloadExcel()"></i>
<h4 style="display: inline-block; float: right">
{{ "Customers" | translate }}
</h4>
</div>
<div
class="col-6"
style="
width: 100%;
text-align: center;
align-items: center;
background: #426e86;
padding-top: 10px;
padding-bottom: 10px;
color: white;
box-shadow: 3px 1px 5px 0px rgb(178, 176, 174);
"
>
<button
class="btn btn-default"
[disabled]="firstcall"
(click)="next()"
style="margin-right: 10px"
>
{{ "Next" | translate }} >>
</button>
<button
class="btn btn-default"
[disabled]="lastcall"
(click)="pre()"
style="border-right-color: #2d4262"
>
<< {{ "Previous" | translate }}
</button>
<!-- <button class="btn btn-default" (click)="getAllCustomers()" style="border-right-color: #2d4262">
<< {{ "All" | translate }} </button> -->
<input
type="search"
style="
width: 225px;
float: right;
border-radius: 0px;
line-height: 1.9;
background: #efecec;
box-shadow: 3px 2px 5px 0px rgb(178, 176, 174);
"
class="form-control"
id="myInput"
name="myInput"
type="text"
[(ngModel)]="myInput"
(ngModelChange)="searchFilter($event)"
placeholder="{{ 'Customer Search' | translate }}"
/>
<md-slide-toggle
*ngIf="superAdmin === true"
style="float: right; padding: 8px 35.1px"
md-tooltip="Include Dealer's Customers"
[(ngModel)]="allUser"
(change)="allUserFunction($event)"
></md-slide-toggle>
</div>
</div>
<flash-messages class='fmsg'></flash-messages>
<!-- <div style="width:100%;text-align: center;align-items: center;background: #426E86; padding-top: 10px; padding-bottom: 10px; color: white;box-shadow:3px 1px 5px 0px rgb(178, 176, 174)">
<h4 style="display: inline-block;">{{'Customers' | translate}}</h4>
<button class="btn btn-default" [disabled]="firstcall" (click)="next()" style="margin-right: 10px;">Next >></button>
<button class="btn btn-default" [disabled]="lastcall" (click)="pre()" style="border-right-color: #2d4262;"><< Previous</button>
<input type="search" style="width: 225px;float: right;border-radius: 0px;line-height: 1.9;background: #efecec;box-shadow: 3px 2px 5px 0px rgb(178, 176, 174);" class="form-control" id="myInput" name="myInput" type="text" [(ngModel)]="myInput" (ngModelChange)="searchFilter($event)" placeholder="{{'Customer Search' | translate}}" />
</div> -->
<!-- <p style="width:100%;text-align: center;align-items: center;background: #426E86; padding-top: 10px; padding-bottom: 10px; color: white;box-shadow:3px 1px 5px 0px rgb(178, 176, 174)">Dealers</p> -->
<div class="table100 ver1">
<div class="table100-firstcol">
<table id='customerTable'>
<thead>
<tr class="row100 head">
<th
class="cell100 column1"
style="font-weight: 600; background: #add8e6"
>
{{ "NAME" | translate }}
</th>
</tr>
</thead>
<tbody>
<tr class="row100 body" *ngFor="let cust_array of custumer">
<td class="cell100 column1" (click)="viewCustomerDetails(cust_array)">
{{ cust_array.first_name ? cust_array.first_name : "" }}
{{ cust_array.last_name ? cust_array.last_name : "" }}
</td>
</tr>
</tbody>
</table>
</div>
<div class="wrap-table100-nextcols js-pscroll" style="height: 660px">
<div class="table100-nextcols">
<table>
<thead>
<tr class="row100 head">
<th
class="cell100 column2"
style="font-weight: 600; background: #add8e6"
>
{{ "USER ID" | translate }}
</th>
<th
class="cell100 column3"
style="font-weight: 600; background: #add8e6"
>
{{ "DEALER" | translate }}
</th>
<th
class="cell100 column4"
style="font-weight: 600; background: #add8e6"
>
{{ "EMAIL ID" | translate }}
</th>
<th
class="cell100 column5"
style="font-weight: 600; background: #add8e6"
>
{{ "PHONE" | translate }}
</th>
<th
class="cell100 column6"
style="font-weight: 600; background: #add8e6"
>
{{ "PASSWORD" | translate }}
</th>
<!-- <th
class="cell100 column7"
style="font-weight: 600; background: #add8e6"
>
{{ "TOTAL VEHICLES" | translate }}
</th>
<th
class="cell100 column8"
style="font-weight: 600; background: #add8e6"
>
{{ "DELETED VEHICLES" | translate }}
</th>
<th
class="cell100 column9"
style="font-weight: 600; background: #add8e6"
>
{{ "CREATED ON" | translate }}
</th>
<th
class="cell100 column10"
style="font-weight: 600; background: #add8e6"
>
{{ "EXPIRES ON" | translate }}
</th>
<th
class="cell100 column11"
style="font-weight: 600; background: #add8e6"
>
{{ "TOKEN" | translate }}
</th>
<th
class="cell100 column12"
style="font-weight: 600; background: #add8e6"
>
{{ "LAST ACTIVITY" | translate }}
</th>
<th
class="cell100 column13"
style="font-weight: 600; background: #add8e6"
>
{{ "LAST LOGIN" | translate }}
</th>
<th
class="cell100 column14"
style="font-weight: 600; background: #add8e6"
>
{{ "LOGIN TYPE" | translate }}
</th>
<th
class="cell100 column12"
style="font-weight: 600; background: #add8e6"
>
{{ "ALLOCATED POINTS" | translate }}
</th>
<th class="cell100 column15" style="
text-align: center;
font-weight: 600;
background: #add8e6;
">
{{ "KYC Status" | translate }}
</th>
<th
class="cell100 column15"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "DOCUMENTS" | translate }}
</th> -->
<th
class="cell100 column16"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "EDIT" | translate }}
</th>
<!-- <th
class="cell100 column17"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
*ngIf="custtype == true || superAdmin == true"
>
{{ "USER SETTINGS" | translate }}
</th>
<th
class="cell100 column18"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
*ngIf="custtype == true || superAdmin == true"
>
{{ "DASHBOARD COLUMNS" | translate }}
</th> -->
<th
class="cell100 column19"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "DELETE" | translate }}
</th>
<!-- <th
class="cell100 column20"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "CUSTOMER STATUS" | translate }}
</th>
<th
class="cell100 column21"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "CUSTOMER INFO" | translate }}
</th>
<th
class="cell100 column22"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "RESTET PASSWORD" | translate }}
</th>
<th
class="cell100 column23"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "SUSPEND ACCOUNT" | translate }}
</th>
<th
class="cell100 column23"
style="
text-align: center;
font-weight: 600;
background: #add8e6;
"
>
{{ "ADMIN ALERT" | translate }}
</th>
<th *ngIf="custtype" class="cell100 column23" style="
text-align: center;
font-weight: 600;
background: #add8e6;
">
{{ "DEALER ALERT" | translate }}
</th>
<th class="cell100 column23" style="
text-align: center;
font-weight: 600;
background: #add8e6;
">
{{ "Pull Data" | translate }}
</th> -->
</tr>
</thead>
<tbody>
<tr class="row100 body" *ngFor="let cust_array of custumer">
<td
class="cell100 column2"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.user_id ? cust_array.user_id : "NA" }}
</td>
<td
class="cell100 column3"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{
cust_array.DealerDetails.length != 0
? cust_array.DealerDetails[0].first_name
: ""
}}
{{
cust_array.DealerDetails != 0
? cust_array.DealerDetails[0].last_name
: ""
}}
</td>
<td
class="cell100 column4"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.email }}
</td>
<td
class="cell100 column5"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ custPhone(cust_array) }}
</td>
<td
class="cell100 column6"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.pass ? cust_array.pass : "NA" }}
</td>
<!-- <td
class="cell100 column7"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.total_vehicle }}
</td>
<td
class="cell100 column8"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.delDevices }}
</td>
<td
class="cell100 column9"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.created_on | date: "dd/MM/yyyy" }}
</td>
<td
class="cell100 column10"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.expire_date | date: "dd/MM/yyyy" }}
</td>
<td
class="cell100 column11"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{
cust_array.notificationTokenCount
? cust_array.notificationTokenCount
: 0
}}
</td>
<td
class="cell100 column12"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{
cust_array.last_activity_on
| date: "dd/MM/yyyy, h:mm:ss a"
}}
</td>
<td
class="cell100 column13"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.last_login | date: "dd/MM/yyyy, h:mm:ss a" }}
</td>
<td
class="cell100 column14"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{ cust_array.login_type ? cust_array.login_type : "NA" }}
</td>
<td
class="cell100 colu mn14"
style="cursor: pointer"
(click)="vewdev(cust_array._id)"
>
{{
cust_array.point_Allocated
? cust_array.point_Allocated
: 0
}}
</td>
<td class="cell100 column15" style="cursor: pointer; text-align: center">
<button class="btn btn-warning btn-sm" style="border-radius: 40px; font-size: x-small; background-color: orange;"
*ngIf="cust_array.kycStatus==undefined">Pending</button>
<button class="btn btn-warning btn-sm" style="border-radius: 40px; font-size: x-small; background-color: orange;" *ngIf="cust_array.kycStatus=='Pending'">{{cust_array.kycStatus}}</button>
<button class="btn btn-success btn-sm" style="border-radius: 40px; font-size: x-small; background-color: green;" *ngIf="cust_array.kycStatus=='Approved'">{{cust_array.kycStatus}}</button>
<button class="btn btn-danger btn-sm" style="border-radius: 40px; font-size: x-small; background-color: red;" *ngIf="cust_array.kycStatus=='Reject'">{{cust_array.kycStatus}}</button>
</td>
<td
class="cell100 column15"
style="cursor: pointer; text-align: center"
>
<i
class="far fa-folder-open"
md-tooltip="View/Download"
style="cursor: pointer"
(click)="viewDocuments(cust_array)"
></i>
</td> -->
<td class="cell100 column16" style="text-align: center">
<i
class="far fa-edit"
md-tooltip="Edit"
style="cursor: pointer; color: #08de85"
(click)="edit_costumerDetail(cust_array)"
></i>
</td>
<!-- <td
class="cell100 column17"
*ngIf="custtype == true || superAdmin == true"
style="text-align: center"
>
<i
class="fas fa-sort-alpha-down"
md-tooltip="User Setting"
style="cursor: pointer"
(click)="reportSetting(cust_array)"
></i>
</td>
<td
class="cell100 column18"
*ngIf="custtype == true || superAdmin == true"
style="text-align: center"
>
<i
class="fas fa-columns"
md-tooltip="Customise Table Content"
style="cursor: pointer"
(click)="custom_table(cust_array)"
></i>
</td> -->
<td class="cell100 column19" style="text-align: center">
<i
class="fas fa-trash-alt"
md-tooltip="Delete"
style="cursor: pointer; color: #ff0707"
(click)="delete_costumerDetail(cust_array)"
></i>
</td>
<!-- <td class="cell100 column20" style="text-align: center">
<md-slide-toggle
[(ngModel)]="cust_array.status"
style="height: 0px !important"
ngDefaultControl
ngDefaultControl
(change)="onChange(cust_array, $event)"
></md-slide-toggle>
</td>
<td class="cell100 column21" style="text-align: center">
<i
class="fas fa-sign-in-alt"
title="Send Login Credentials"
(click)="shareUserCredential(cust_array)"
></i>
</td>
<td class="cell100 column22" style="text-align: center">
<i
class="fas fa-unlock-alt"
title="Reset Password"
(click)="resetPassword(cust_array)"
></i>
</td>
<td class="cell100 column20" style="text-align: center">
<md-slide-toggle
[(ngModel)]="cust_array.accountSuspended"
style="height: 0px !important"
ngDefaultControl
(change)="accountStatusOnChange(cust_array, $event)"
></md-slide-toggle>
</td>
<td class="column20" style="text-align: center">
<md-slide-toggle
[(ngModel)]="cust_array.adminAlert"
style="height: 0px !important"
ngDefaultControl
(change)="alertStatus($event, cust_array)"
></md-slide-toggle>
</td>
<td *ngIf="custtype" class="column20" style="text-align: center">
<md-slide-toggle [(ngModel)]="cust_array.dealerAlert" style="height: 0px !important" ngDefaultControl
(change)="dealerAlert($event, cust_array)"></md-slide-toggle>
</td>
<td class="column20" style="text-align: center">
<md-slide-toggle [checked]="cust_array.pullData?cust_array.pullData:false" style="height: 0px !important" ngDefaultControl
(change)="generatePullData($event, cust_array)"></md-slide-toggle>
</td> -->
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddComponent } from './add.component';
describe('AddComponent', () => {
let component: AddComponent;
let fixture: ComponentFixture<AddComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

1153
src/app/add/add.component.ts Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,35 @@
<div class="container">
<div class="row" >
<div class="col-12">
<p style="text-align: center; font-size: 20px; background: #4859a5; color: white; margin-bottom: 0; padding-top: 10px; padding-bottom: 10px;">Dashboard Columns</p>
</div>
</div>
<div class="row" style="height: fit-content;margin: 0px; text-align: center; border: 1px solid #31428c4f; padding-top: 10px; box-shadow: 6px 5px 8px #4859a557;">
<div class="col-12" style="margin : 0%; padding: 0%">
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; text-align: left; padding-left: 70px;">
<p>{{'COLUMN NAME' | translate}}</p>
</div>
<div class="col-6" style="font-size: 14px; font-weight: 500;">
<p>{{'COLUMN VISIBILITY' | translate}}</p>
</div>
</div>
<div class="row" *ngFor = "let d_column of dashboard_column; let i = index">
<div class="col-6" style="text-align: left; padding-left: 70px;font-weight: 500; color: #616161;">
<p >{{d_column.name}}</p>
</div>
<div class="col-6" >
<md-checkbox type="checkbox" [checked]="d_column.dash_column" (change)="selectedStatus(i,$event)"></md-checkbox>
</div>
</div>
<div clas="row" style="margin-top: 30px;margin-bottom: 30px;text-align: center;">
<div class="col-12">
<button md-raised-button style="background: #31428c; color: white;" (click)="savereportPref()">{{'Save' | translate}}</button>
<button md-raised-button style="background: #1d8216; color: white;" (click)="cancel()">{{'Cancel' | translate}}</button>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,3 @@
.container{
padding: 0px;
}

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DashboardContentComponent } from './dashboard-content.component';
describe('DashboardContentComponent', () => {
let component: DashboardContentComponent;
let fixture: ComponentFixture<DashboardContentComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DashboardContentComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DashboardContentComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,104 @@
import { Component, OnInit, Inject } from '@angular/core';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
import { ReportSettingComponent } from '../report-setting/report-setting.component';
import { ContactService } from '../../contact.service';
@Component({
selector: 'app-dashboard-content',
templateUrl: './dashboard-content.component.html',
styleUrls: ['./dashboard-content.component.scss']
})
export class DashboardContentComponent implements OnInit {
userIdd: any;
dashboard_column = [
{name:"GPS",dash_column:true,value:"gps_column"},
{name:"AC",dash_column:true,value:"ac_column"},
{name:"POWER",dash_column:true,value:"power_column"},
{name :"GSM",dash_column:true,value:"gsm_column"},
{name :"IGNITION",dash_column:true,value:"ignition_column"},
{name:"External Volatage",dash_column:true,value:"ext_volt"},
{name:"Door",dash_column:false,value:"door_column"},
{name :"Temperature",dash_column:false,value:"temp_column"},
{name :"Charging status",dash_column:false,value:"charging_column"},
];
constructor(public dialogRef: MdDialogRef<ReportSettingComponent>,
@Inject(MD_DIALOG_DATA) public data: any,private contactService: ContactService,) {
console.log(data);
console.log('data._id',data);
this.userIdd = data._id;
this.getCostumerDetail()
}
ngOnInit() {
}
savereportPref(){
// var dashboard_content_payload =[]
var tempsemp = {};
// dashboard_content_payload = JSON.parse(JSON.stringify(this.dashboard_column));
var tt =[];
for(var index in this.dashboard_column){
var k = this.dashboard_column[index].value;
let pl = { };
tempsemp[k] = this.dashboard_column[index].dash_column;
delete tempsemp[k].name;
delete tempsemp[k].value;
}
console.log(tempsemp);
var payload = {
dashboard_column : tempsemp,
user : this.userIdd
}
// console.log(payload);
this.contactService.setDashboardContent(payload).subscribe(res=>{
this.dialogRef.close('updated');
},err=>{
console.log(err);
})
}
cancel(){
this.dialogRef.close('close');
}
selectedStatus(ind,ev,flag){
this.dashboard_column[ind].dash_column = ev.checked;
}
getCostumerDetail(){
let that = this;
this.contactService.getcustToken(this.userIdd).subscribe(res=>{
var d_column = res.cust.dashboard_column;
for(let dt in d_column){
let arr = that.dashboard_column.filter(function(d){
return d.value == dt;
})
// arr[0].dash_column = d_column[dt].dash_column;
// this.dashboard_column[dt].dash_column = d_column[dt] ;
arr[0].dash_column = d_column[dt] ;
console.log('d_column[dt]',d_column[dt])
// arr[0].Astatus = tempReport[dt].Astatus;
}
console.log('this.dashboard_column=>',this.dashboard_column);
})
}
}

View file

@ -0,0 +1,20 @@
<button style="float: right;border-radius: 32px;" class='btn btn-danger' (click)="dialogRef.close()"> <i class="fas fa-times-circle"></i></button>
<div id="toast">
<div id="desc">{{ data_descip }}</div>
</div>
<div class="col-sm-12 mt-5 bgWhite">
<div class="title">
Verify OTP
</div>
<div class="mt-5">
<input class="form-control" [(ngModel)]="otp" type="number">
</div>
<div *ngIf="show" class="alert alert-warning" role="alert">
{{ data_descip }}
</div>
<hr class="mt-4">
<button class='btn btn-primary btn-block mt-4 mb-4 customBtn' (click)="verify()">Verify</button>
</div>

View file

@ -0,0 +1,36 @@
.title {
font-weight: 600;
margin-top: 20px;
font-size: 24px;
}
.customBtn {
border-radius: 0px;
padding: 10px;
}
// form input {
// display: inline-block;
// width: 50px;
// height: 50px;
// text-align: center;
// }
#toast {
visibility: hidden;
max-width: 250px;
height: 50px;
/*margin-left: -125px;*/
margin: auto;
background-color: #333;
color: #fff;
text-align: center;
border-radius: 2px;
position: fixed;
z-index: 1;
left: 60%;
right: 0;
bottom: 80%;
font-size: 13px;
white-space: nowrap;
}

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { OtpScreenComponent } from './otp-screen.component';
describe('OtpScreenComponent', () => {
let component: OtpScreenComponent;
let fixture: ComponentFixture<OtpScreenComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OtpScreenComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(OtpScreenComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,50 @@
import { Component, Inject, OnInit } from '@angular/core';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
import { ContactService } from '../../contact.service';
@Component({
selector: 'app-otp-screen',
templateUrl: './otp-screen.component.html',
styleUrls: ['./otp-screen.component.scss']
})
export class OtpScreenComponent implements OnInit {
otp
constructor(public dialogRef: MdDialogRef<OtpScreenComponent>,private contactService:ContactService,
@Inject(MD_DIALOG_DATA) public data: any) {
console.log(data);
}
ngOnInit() {
}
data_descip;
show:boolean=false;
verify(){
console.log(this.otp);
this.contactService.post('/users/verifyOtp',{user:this.data._id,otp:this.otp}).subscribe((res:any)=>{
this.data_descip = res.message;
launch_toast()
this.dialogRef.close({value:'done'});
},err=>{
console.log(err);
var message=JSON.parse(err._body);
console.log(message);
this.data_descip = "You entered wrong OTP"
this.show=true;
var that=this;
// this.data_descip = res.message;
launch_toast()
setTimeout(function () {that.show=false }, 4500);
})
function launch_toast() {
// console.log(divid);
var x = document.getElementById("toast")
//console.log(x);
x.className = "show";
setTimeout(function () { x.className = x.className.replace("show", ""); }, 4500);
}
}
}

View file

@ -0,0 +1,283 @@
<!-- <div class="container"> -->
<!-- <div class="row">
<div class="col-12">
<p
style="text-align: center; font-size: 20px; background: #4859a5; color: white; margin-bottom: 0; padding-top: 10px; padding-bottom: 10px;">
User Setting</p>
</div>
</div> -->
<md-dialog-content class="mat-typography">
<md-tab-group class="selected-tab-{{tabGroup.selectedIndex}}" #tabGroup>
<md-tab>
<template md-tab-label>REPORT PREFERENCE</template>
<div class="row mt-4" style="margin-top: 19px;">
<!-- <div class="row"
style="height: fit-content;margin: 0px; text-align: center; border: 1px solid #31428c4f; padding-top: 10px; box-shadow: 6px 5px 8px #4859a557;"> -->
<div class="col-12" style="margin : 0%; padding: 0%">
<div class="row">
<div class="col-6"
style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'REPORTS' | translate}}</p>
</div>
<div class="col-3" style="font-size: 14px; font-weight: 500; color: #7b7b7b;">
<p>{{'REPORTS VISIBILITY' | translate}}</p>
</div>
<div class="col-3" style="font-size: 14px; font-weight: 500; color: #7b7b7b;">
<p>{{'ADDRESS VISIBILITY' | translate}}</p>
</div>
</div>
<div class="row" *ngFor="let devStatus of reportArray; let i = index">
<div class="col-6" style="text-align: left; padding-left: 70px;font-weight: 500;">
<p>{{devStatus.name}}</p>
</div>
<div class="col-3">
<md-checkbox type="checkbox" [checked]="devStatus.Rstatus" (change)="selectedStatus(i,$event,'rVisibility')">
</md-checkbox>
</div>
<div class="col-3">
<md-checkbox type="checkbox" [checked]="devStatus.Astatus" (change)="selectedStatus(i,$event,'aVisibility')">
</md-checkbox>
</div>
</div>
</div>
</div>
<!-- </div> -->
</md-tab>
<md-tab>
<template md-tab-label>USER SETTINGS</template>
<!-- <div class="row mt-4" style="margin-top: 19px;"> -->
<form [formGroup]="userSettingForm" class="form mt-4">
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'AC' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="ac"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Door' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="door"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Immoblizer' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="immoblizer"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Share' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="share"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Tow' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="tow"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Parking' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="parking"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Fuel' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="fuel"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Temprature' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="temp"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Satelite' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="satelite"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Zoom Level' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<!-- <md-checkbox formControlName="zoomLevel"></md-checkbox> -->
<input type="number" formControlName="zoomLevel">
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Relay Timer' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="relay_timer"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Error Code' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="errorCode"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Error Message' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<md-checkbox formControlName="errorMessage"></md-checkbox>
</div>
</div>
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'Satelite Value' | translate}}</p>
</div>
<div class="col-md-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left;">
<input type="number" formControlName="sateliteValue">
<!-- <md-checkbox formControlName="errorMessage"></md-checkbox> -->
</div>
</div>
<!-- <md-dialog-actions align="end">
<button md-button md-dialog-close>Cancel</button>
<button md-button cdkFocusInitial (click)="saveSettings()">Save</button>
</md-dialog-actions> -->
</form>
<!-- </div> -->
</md-tab>
<md-tab>
<template md-tab-label>Dashboard Column</template>
<div class="container">
<div class="row"
style="height: fit-content;margin: 0px; text-align: center; padding-top: 10px;">
<div class="col-12" style="margin : 0%; padding: 0%">
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; text-align: left; padding-left: 70px;">
<p>{{'COLUMN NAME' | translate}}</p>
</div>
<div class="col-6" style="font-size: 14px; font-weight: 500;">
<p>{{'COLUMN VISIBILITY' | translate}}</p>
</div>
</div>
<div class="row" *ngFor="let d_column of dashboard_column; let i = index">
<div class="col-6" style="text-align: left; padding-left: 70px;font-weight: 500; color: #616161;">
<p>{{d_column.name}}</p>
</div>
<div class="col-6">
<md-checkbox type="checkbox" [checked]="d_column.dash_column" (change)="selectedStatus1(i,$event)">
</md-checkbox>
</div>
</div>
</div>
</div>
</div>
</md-tab>
</md-tab-group>
</md-dialog-content>
<md-dialog-actions align="end">
<button md-button cdkFocusInitial style="background: #31428c; color: white;" (click)="saveSettings(tabGroup.selectedIndex)">{{'Save' |
translate}}</button>
<button style="background: #1d8216; color: white;" md-button md-dialog-close (click)="cancel()">{{'Cancel' |
translate}}</button>
</md-dialog-actions>
<!-- <div class="container" style="height: 500px">
<div class="row" >
<div class="col-12">
<p style="text-align: center; font-size: 20px; background: #4859a5; color: white; margin-bottom: 0; padding-top: 10px; padding-bottom: 10px;">REPORT PREFERENCE</p>
</div>
</div> -->
<!-- <div class="row" style="height: fit-content;margin: 0px; text-align: center; border: 1px solid #31428c4f; padding-top: 10px; box-shadow: 6px 5px 8px #4859a557;">
<div class="col-12" style="margin : 0%; padding: 0%">
<div class="row">
<div class="col-6" style="font-size: 14px; font-weight: 500; color: #7b7b7b;text-align: left; padding-left: 70px;">
<p>{{'REPORTS' | translate}}</p>
</div>
<div class="col-3" style="font-size: 14px; font-weight: 500; color: #7b7b7b;">
<p>{{'REPORTS VISIBILITY' | translate}}</p>
</div>
<div class="col-3" style="font-size: 14px; font-weight: 500; color: #7b7b7b;">
<p>{{'ADDRESS VISIBILITY' | translate}}</p>
</div>
</div>
<div class="row" *ngFor = "let devStatus of reportArray; let i = index">
<div class="col-6" style="text-align: left; padding-left: 70px;font-weight: 500;">
<p >{{devStatus.name}}</p>
</div>
<div class="col-3">
<md-checkbox type="checkbox" [checked]="devStatus.Rstatus" (change)="selectedStatus(i,$event,'rVisibility')"></md-checkbox>
</div>
<div class="col-3">
<md-checkbox type="checkbox" [checked]="devStatus.Astatus" (change)="selectedStatus(i,$event,'aVisibility')"></md-checkbox>
</div>
</div>
<div clas="row" style="margin-top: 30px;margin-bottom: 30px;text-align: center;">
<div class="col-12">
<button md-raised-button style="background: #31428c; color: white;" (click)="savereportPref()">{{'Save' | translate}}</button>
<button md-raised-button style="background: #1d8216; color: white;" (click)="cancel()">{{'Cancel' | translate}}</button>
</div>
</div>
</div>
</div> -->
<!-- </div> -->
<!-- <div class="row" style="padding-bottom: 10px;">
<div class="col-12">
<p style="text-align: center; font-size: 20px;color: #827f7f;">Please select reports which you want to hide from customer portal</p>
</div>
</div> -->
<!-- <div class="col-12">
<span *ngFor = "let devStatus of reportArray; let i = index" [ngClass]="{ 'selected' :(devStatus.status == 'true'), 'deselected' : !devStatus.status}" (click)="selectedStatus(i)" style="margin-right: 10px;margin-bottom: 10px;font-size: 14px;cursor: pointer;" class="badge badge-pill badge-primary">{{devStatus.name}}</span>
</div> -->

View file

@ -0,0 +1,68 @@
.selected {
background-color: #5d5f62;
border-radius: 40px;
}
.deselected {
background: #db2f2f;
border-radius: 40px;
}
.form-control {
margin-bottom: 8px;
}
.selected-tab-0 md-ink-bar {
background-color: red;
}
.selected-tab-1 md-ink-bar {
background-color: #426e86;
}
.selected-tab-2 md-ink-bar {
background-color: green;
}
.mat-tab-body-content {
overflow: hidden !important;
}
.mat-tab-body.mat-tab-body-active {
overflow-y: hidden !important;
}
.project-tab {
// padding: 10%;
height: 500px;
// margin-top: -8%;
}
.project-tab #tabs {
background: #007b5e;
color: #eee;
}
.project-tab #tabs h6.section-title {
color: #eee;
}
.project-tab #tabs .nav-tabs .nav-item.show .nav-link,
.nav-tabs .nav-link.active {
color: #0062cc;
background-color: transparent;
border-color: transparent transparent #f3f3f3;
border-bottom: 3px solid !important;
font-size: 16px;
font-weight: bold;
}
.project-tab .nav-link {
border: 1px solid transparent;
border-top-left-radius: 0.25rem;
border-top-right-radius: 0.25rem;
color: #0062cc;
font-size: 16px;
font-weight: 600;
}
.project-tab .nav-link:hover {
border: none;
}
.project-tab thead {
background: #f3f3f3;
color: #333;
}
.project-tab a {
text-decoration: none;
color: #333;
font-weight: 600;
}

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ReportSettingComponent } from './report-setting.component';
describe('ReportSettingComponent', () => {
let component: ReportSettingComponent;
let fixture: ComponentFixture<ReportSettingComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ReportSettingComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ReportSettingComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,244 @@
import { Component, OnInit, Inject } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
import { ContactService } from '../../contact.service';
@Component({
selector: 'app-report-setting',
templateUrl: './report-setting.component.html',
styleUrls: ['./report-setting.component.scss']
})
export class ReportSettingComponent implements OnInit {
reportCheck :any;
addressCheck :any;
userSettingForm:FormGroup;
selectedTab=1;
dashboard_column = [
{name:"GPS",dash_column:true,value:"gps_column"},
{name:"AC",dash_column:true,value:"ac_column"},
{name:"POWER",dash_column:true,value:"power_column"},
{name :"GSM",dash_column:true,value:"gsm_column"},
{name :"IGNITION",dash_column:true,value:"ignition_column"},
{name:"External Volatage",dash_column:true,value:"ext_volt"},
{name:"Door",dash_column:false,value:"door_column"},
{name :"Temperature",dash_column:false,value:"temp_column"},
{name :"Charging status",dash_column:false,value:"charging_column"},
];
reportArray = [
{name:"Daily Report",Rstatus:true,Astatus:false,value:"daily_report"},
{name:"Daywise Report",Rstatus:true,Astatus:false,value:"daywise_report"},
{name:"Speed Variation",Rstatus:true,Astatus:false,value:"speed_variation"},
{name :"Fuel Report",Rstatus : true,Astatus:false,value:"fuel_report"},
{name :"Idle Report",Rstatus : true,Astatus:false,value:"idle_report"},
{name:"Fuel Consumption Report",Rstatus:true,Astatus:false,value:"fuel_consumption_report"},
{name:"Trip Report",Rstatus:true,Astatus:false,value:"trip_report"},
{name : "Travel Path Report",Rstatus : true,Astatus:false,value:"travel_path_report"},
{name : "Summary Report",Rstatus : true,Astatus:false,value:"summary_report"},
{name : "Geofence Report",Rstatus : true,Astatus:false,value:"geofence_report"},
{name : "Overspeed Report",Rstatus : true,Astatus:false,value:"overspeed_report"},
{name : "Route Violation Report",Rstatus : true,Astatus:false,value:"route_violation_report"},
{name : "Stoppage Report",Rstatus : true,Astatus:true,value:"stoppage_report"},
{name : "Ignition Report",Rstatus : true,Astatus:true,value:"ignition_report"},
{name : "Distance Report",Rstatus : true,Astatus:false,value:"distance_report"},
{name : "POI Report",Rstatus : true,Astatus:false,value:"poi_report"},
{name : "SOS Report",Rstatus : true,Astatus:false,value:"sos_report"},
{name : "AC Report",Rstatus : true,Astatus:false,value:"ac_report"},
{name : "Driver Performance Report",Rstatus : true,Astatus:false,value:"driver_performance_report"},
{name : "User Trip Report",Rstatus : true,Astatus:true,value:"user_trip_report"},
{name : "Alert Report",Rstatus : true,Astatus:false,value:"alert_report"},
{name : "Loading Unloading Trip",Rstatus : true,Astatus:false,value:"loading_unloading_trip"},
{name : "Working Hours Reports",Rstatus : true,Astatus:false,value:"working_hours_report"},
{name : "Maintenance Reports",Rstatus : true,Astatus:false,value:"maintanance_report"},
{name:"Daily Logs",Rstatus:true,Astatus:false,value:"daily_logs"},
{name : "Notification Center",Rstatus : true,Astatus:false,value:"notification_master"},
];
userIdd: any;
Address_Status_name: any = [];
constructor(public dialogRef: MdDialogRef<ReportSettingComponent>,private fb:FormBuilder,
@Inject(MD_DIALOG_DATA) public data: any,private contactService: ContactService,) {
console.log(data);
console.log('data._id',data);
this.userIdd = data._id;
}
// ac,door,immoblizer,share,tow,parking
ngOnInit() {
this.userSettingForm=this.fb.group({
ac:[],
door:[],
immoblizer:[],
share:[],
tow:[],
parking:[],
fuel:[],
temp:[],
satelite:[],
zoomLevel:[""],
relay_timer:[],
errorCode:[],
errorMessage:[],
sateliteValue:['']
})
this.getCostumerDetail();
// this.getUserSettings()
}
savereportPref(){
var report_preference_payload = [];
console.log(this.reportArray);
report_preference_payload = JSON.parse(JSON.stringify(this.reportArray));
var tempsemp ={};
console.log(report_preference_payload);
for(var index in report_preference_payload){
var k = report_preference_payload[index].value;
if(report_preference_payload[index].Rstatus == false){
if(report_preference_payload[index].value!="trip_report" && report_preference_payload[index].value!="ignition_report" && report_preference_payload[index].value!="stoppage_report"){
report_preference_payload[index].Astatus = false;
}
}
tempsemp[k] = report_preference_payload[index];
delete tempsemp[k].name;
delete tempsemp[k].value;
}
console.log(tempsemp);
var reportPref ={
reportsArr : tempsemp,
id :this.userIdd
}
this.contactService.setReportPrefrence(reportPref).subscribe(res=>{
console.log(res);
this.dialogRef.close('updated');
},err=>{
console.log("error",err);
})
}
cancel(){
this.dialogRef.close('close');
}
Status_name = [];
selectedStatus(ind,ev,flag){
if(flag == 'rVisibility'){
this.reportArray[ind].Rstatus = ev.checked;
}
if(flag == 'aVisibility'){
this.reportArray[ind].Astatus = ev.checked;
}
console.log('this.reportArray',this.reportArray);
}
getCostumerDetail(){
let that = this;
this.contactService.getcustToken(this.userIdd).subscribe(res=>{
console.log("resresresresresresresresres",res);
var tempReport = res.cust.report_preference;
if(res.cust.user_settings){
this.userSettingForm.patchValue(res.cust.user_settings);
}
for(let dt in tempReport){
let arr = that.reportArray.filter(function(d){
return d.value == dt;
})
if(dt=="trip_report" || dt=="ignition_report" || dt=="stoppage_report"){
arr[0].Astatus = true;
arr[0].Rstatus = tempReport[dt].Rstatus;
}else{
arr[0].Astatus = tempReport[dt].Astatus;
arr[0].Rstatus = tempReport[dt].Rstatus;
}
}
var d_column = res.cust.dashboard_column;
for(let dt in d_column){
let arr1 = that.dashboard_column.filter(function(d){
return d.value == dt;
})
// arr[0].dash_column = d_column[dt].dash_column;
// this.dashboard_column[dt].dash_column = d_column[dt] ;
arr1[0].dash_column = d_column[dt] ;
console.log('d_column[dt]',d_column[dt])
// arr[0].Astatus = tempReport[dt].Astatus;
}
console.log("that.reportArray=>",that.reportArray);
})
}
saveSettings(value){
console.log(value);
if(value==0){
this.savereportPref()
}else if(value==1){
var reportPref={
userSetting : this.userSettingForm.value,
id :this.userIdd
}
this.contactService.setReportPrefrence(reportPref).subscribe(res=>{
console.log(res);
this.dialogRef.close('updated');
},err=>{
console.log("error",err);
})
}else{
this.savereportPref1()
}
}
savereportPref1(){
// var dashboard_content_payload =[]
var tempsemp = {};
// dashboard_content_payload = JSON.parse(JSON.stringify(this.dashboard_column));
var tt =[];
for(var index in this.dashboard_column){
var k = this.dashboard_column[index].value;
let pl = { };
tempsemp[k] = this.dashboard_column[index].dash_column;
delete tempsemp[k].name;
delete tempsemp[k].value;
}
console.log(tempsemp);
var payload = {
dashboard_column : tempsemp,
user : this.userIdd
}
// console.log(payload);
this.contactService.setDashboardContent(payload).subscribe(res=>{
this.dialogRef.close('updated');
},err=>{
console.log(err);
})
}
selectedStatus1(ind,ev,flag){
this.dashboard_column[ind].dash_column = ev.checked;
}
}

View file

@ -0,0 +1,28 @@
<div class="main">
<div class="row">
<div class="col-12">
<div style="display: flex;">
<input style="margin-bottom: 15px;" class="form-control" name="halt" type="{{iType}}" [(ngModel)]="pass" placeholder="Type reset password" />
<i *ngIf="showBtn" style="cursor: pointer; margin-bottom: 15px; font-size: 20px; padding-top: 8px; padding-left: 10px;" title="Show Password" class="fas fa-eye-slash" (click)="show_hide_pass(0)"></i>
<i *ngIf="!showBtn" style="cursor: pointer; margin-bottom: 15px; font-size: 20px; padding-top: 8px; padding-left: 10px;" title="Show Password" class="fas fa-eye" (click)="show_hide_pass(1)"></i>
</div>
<div style="display: flex;">
<input style="margin-bottom: 15px;" class="form-control" name="halt" type="{{iType_1}}" [(ngModel)]="cnfrmpass" placeholder="Confirm password" />
<i *ngIf="showBtn_1" style="cursor: pointer; margin-bottom: 15px; font-size: 20px; padding-top: 8px; padding-left: 10px;" title="Show Password" class="fas fa-eye-slash" (click)="show_hide_pass(2)"></i>
<i *ngIf="!showBtn_1" style="cursor: pointer; margin-bottom: 15px; font-size: 20px; padding-top: 8px; padding-left: 10px;" title="Show Password" class="fas fa-eye" (click)="show_hide_pass(3)"></i>
</div>
</div>
</div>
<div class="row" style="text-align: center;">
<div class="col-12">
<button style="background-color:rgb(48, 100, 197);color:#fdfdfd;width: 135px;" md-raised-button (click)="reset()">{{'RESET' | translate}}</button>
<button style="background-color: #d81111;color:#fdfdfd;width: 135px;" md-raised-button (click)="closebox()">{{'CANCEL' | translate}}</button>
</div>
</div>
<div class="row" style="text-align: center; margin-top: 10px; color: red;">
<div class="col-12">
<p *ngIf= "error" style="margin-bottom: 0;">{{errorMsg}}</p>
</div>
</div>
</div>

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ResetPasswordComponent } from './reset-password.component';
describe('ResetPasswordComponent', () => {
let component: ResetPasswordComponent;
let fixture: ComponentFixture<ResetPasswordComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ResetPasswordComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ResetPasswordComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,77 @@
import { Component, OnInit, Inject } from '@angular/core';
import { MdDialog, MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
import { ContactService } from '../../contact.service';
@Component({
selector: 'app-reset-password',
templateUrl: './reset-password.component.html',
styleUrls: ['./reset-password.component.scss']
})
export class ResetPasswordComponent implements OnInit {
pass:any;
cnfrmpass:any;
iType:any = "password";
iType_1:any="password";
errorMsg:string;
showError: boolean = false;
constructor(private contactService: ContactService,public dialog: MdDialog,public dialogRef: MdDialogRef<ResetPasswordComponent>, @Inject(MD_DIALOG_DATA) public data: any) {
console.log(data);
}
ngOnInit() {
}
error :boolean = false;
reset(){
var that = this;
let userid = this.data._id ;
console.log("reset passowrd");
if(this.pass != this.cnfrmpass){
this.error = true ;
that.errorMsg = "Password do not matched";
let showError = setTimeout(function(){ that.error = false; clearTimeout(showError); },3000)
}else{
let payLoad={
id : userid,
pass : this.pass
};
this.contactService.resetPass(payLoad).subscribe(res=>{
console.log(res);
this.dialogRef.close('succ');
},error=>{
console.log(error);
})
}
}
closebox(){
console.log("close the box");
this.dialogRef.close('close');
}
showBtn : boolean = true;
showBtn_1 : boolean = true;
show_hide_pass(id){
debugger;
console.log(id);
if(id == 0){
this.iType = 'text';
this.showBtn = !this.showBtn;
}
if(id == 1){
this.iType = 'password';
this.showBtn = !this.showBtn;
}
if(id == 2){
this.iType_1 = 'text';
this.showBtn_1 = !this.showBtn_1;
}
if(id == 3){
this.iType_1 = 'password';
this.showBtn_1 = !this.showBtn_1;
}
}
}

View file

@ -0,0 +1,17 @@
<!-- <p>
{{url}}
</p> -->
<div class="card">
<div class="card-header">
<h4>Pull Data Api</h4>
<button type="button" class="btn-close close pull-right" aria-label="Close" (click)="close()">
<span aria-hidden="true" class="visually-hidden">&times;</span>
</button>
</div>
<div class="card-body">
<textarea style="margin-top: 0px;margin-bottom: 0px;height: 292px;width: -webkit-fill-available;" [value]="url">
</textarea>
</div>
</div>

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ShowPullDataLinkComponent } from './show-pull-data-link.component';
describe('ShowPullDataLinkComponent', () => {
let component: ShowPullDataLinkComponent;
let fixture: ComponentFixture<ShowPullDataLinkComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ShowPullDataLinkComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ShowPullDataLinkComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,25 @@
import { Component, Inject, OnInit } from '@angular/core';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
@Component({
selector: 'app-show-pull-data-link',
templateUrl: './show-pull-data-link.component.html',
styleUrls: ['./show-pull-data-link.component.scss']
})
export class ShowPullDataLinkComponent implements OnInit {
url
constructor(public dialogRef: MdDialogRef<ShowPullDataLinkComponent>,
@Inject(MD_DIALOG_DATA) public data: any) {
console.log(data);
var token=data.split('.');
this.url="https://13.126.36.205/pullData/pullDataForUser1?token="+token[1]
}
ngOnInit() {
}
close(){
this.dialogRef.close()
}
}

View file

@ -0,0 +1,454 @@
<!-- <div class="container mt-5"> -->
<!-- <div class="row"> -->
<!-- <div class="col-md-10 ml-auto col-xl-10 mr-auto">
<p class="category">Tabs with Background on Card</p> -->
<!-- Customer Details,Device Details,Setting,Document,Activites -->
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs nav-tabs-neutral justify-content-center" role="tablist"
data-background-color="orange">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#CustomerDetails" role="tab">Customer Details</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#DeviceDetails" role="tab">Device Details</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#Settings" role="tab">Settings</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#Documents" role="tab">Documents</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#Activites" role="tab">Activites</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#Actions" role="tab">Actions</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#Transaction" role="tab">Payments</a>
</li>
</ul>
</div>
<div class="card-body">
<div class="tab-content">
<div class="tab-pane active" id="CustomerDetails" role="tabpanel">
<div class="row mt-3">
<div class="col-md-6">
<b>Name:</b> <span> {{data?data.first_name?data.first_name:'':''}} {{data?data.last_name?data.last_name:'':''}}</span>
</div>
<div class="col-md-6">
<b>User ID:</b><span> {{data?data.user_id?data.user_id:'':''}}</span>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<b>Email:</b> <span> {{data?data.email?data.email:'':''}}</span>
</div>
<div class="col-md-6">
<b>Phone:</b> <span> {{data?data.phone?data.phone:'':''}}</span>
<i *ngIf="data?data.phone_verfi==false?true:false:false" class="fas fa-exclamation-circle"></i>
<i *ngIf="data?data.phone_verfi==true?true:false:false" class="fas fa-check-circle"></i>
<!-- <img *ngIf="data?data.phone_verfi==true?true:false:false" src="../../../assets/image/accept.png" width='20px'> -->
<button *ngIf="data?data.phone_verfi==false?true:false:false" type="button" style="float: right;font-size: small; border-radius: 20px;"
class="btn btn-outline-primary btn-sm" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">Verify</button>
<div class="collapse" id="collapseExample">
<div class="card card-body">
<div class="col-sm-12">
<div class="title mb-1">
Verify OTP
</div>
<div>
<input class="form-control" [(ngModel)]="otp" type="number">
</div>
<div *ngIf="show" class="alert alert-warning" role="alert">
{{ data_descip }}
</div>
<hr class="mt-4">
<button class='btn btn-primary btn-block mt-4 mb-4 customBtn' (click)="verify1()">Verify</button>
</div>
</div>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<b>Password:</b> <span> {{data?data.pass?data.pass:'':''}}</span>
</div>
<div class="col-md-6">
<b>Created On:</b><span> {{data?data.created_on?data.created_on:'':''}}</span>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<b>Expiry date:</b> <span> {{data?data.expire_date?data.expire_date:'':''}}</span>
</div>
<div class="col-md-6">
<b>Point Allocated:</b> <span> {{data?data.point_Allocated?data.point_Allocated:0:0}}</span>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<b>Dealer:</b> <span> {{data?data.DealerDetails[0].first_name?data.DealerDetails[0].first_name:'':''}} {{data?data.DealerDetails[0].last_name?data.DealerDetails[0].last_name:'':''}}</span>
</div>
</div>
</div>
<div class="tab-pane" id="DeviceDetails" role="tabpanel">
<div class="row mt-3">
<div class="col-md-6">
<b>Total Vehicles:</b> <span> {{data?data.total_vehicle?data.total_vehicle:0:0}}</span>
</div>
<div class="col-md-6">
<b>Deleted Vehicles:</b> <span> {{data?data.delDevices?data.delDevices:0:0}}</span>
</div>
</div>
</div>
<div class="tab-pane" id="Settings" role="tabpanel">
<app-report-setting></app-report-setting>
</div>
<div class="tab-pane" id="Documents" role="tabpanel">
<flash-messages></flash-messages>
<div [hidden]="doclist">
<table id="test" class="table table-striped table-hover"
style="overflow-y: hidden;overflow-x: hidden;font-size:12px">
<thead>
<tr>
<th>Document Name</th>
<th>Document number</th>
<th>Image</th>
<th>Status</th>
<th>Action</th>
</thead>
<tbody>
<tr *ngFor="let doc of testDocuments; let i = index">
<td style="cursor:pointer">{{doc.doctype}}</td>
<td style="cursor:pointer">{{doc.phone}}</td>
<td>
<h4 *ngIf="doc.ext=='pdf'">
<a href={{doc.image}} target="_blank"><i class="fa fa-file-pdf"></i></a>
</h4>
<span *ngIf="doc.ext!='pdf'">
<img style="width: 100px;" [src]="'https://www.oneqlik.in'+doc.image" >
<!-- (click)="openModal(template,doc)"> -->
</span>
</td>
<td>
<button class="btn btn-warning btn-sm" style="border-radius: 40px; font-size: x-small; background-color: orange;"
*ngIf="data.kycStatus==undefined">Pending</button>
<button class="btn btn-warning btn-sm" style="border-radius: 40px; font-size: x-small; background-color: orange;"
*ngIf="data.kycStatus=='Pending'">{{data.kycStatus}}</button>
<button class="btn btn-success btn-sm" style="border-radius: 40px; font-size: x-small; background-color: green;"
*ngIf="data.kycStatus=='Approved'">{{data.kycStatus}}</button>
<button class="btn btn-danger btn-sm" style="border-radius: 40px; font-size: x-small; background-color: red;"
*ngIf="data.kycStatus=='Reject'">{{data.kycStatus}}</button>
</td>
<td style="cursor:pointer">
<button class="btn btn-primary btn-block/"> <i class="fas fa-download" (click)="downloadDoc(doc)"></i></button>
<button class="btn btn-danger btn-block/"><i class="fas fa-trash" (click)="SaveDocuments('deldoc',i)"></i></button>
<!-- <button class="btn btn-primary btn-block/" (click)="downloadDoc(doc)"
style="background: green;cursor: pointer;float: right;border:none;">Download</button> -->
<!-- <button class="btn btn-primary btn-block/" [disabled]="disableDelete" (click)="SaveDocuments('deldoc',i)"
style="background: #f90808;cursor: pointer;float: right;border-color: transparent;margin-right: 16px;border:none;">Delete</button> -->
</td>
</tr>
</tbody>
</table>
<div class="row text-center mt-2" style="justify-content: center;">
<!-- <button class="btn btn-primary m-1" (click)="Adddocuments('')">Add <i class="fa fa-plus-circle"></i></button> -->
<button class="btn btn-success m-1" [disabled]="data.kycStatus=='Approved'"
(click)="changeKYC('Approved')">Approve <i class="fa fa-check-circle"></i></button>
<button class="btn btn-danger m-1" [disabled]="data.kycStatus=='Approved'"
(click)="changeKYC('Reject')">Reject <i class="fa fa-times-circle"></i></button>
</div>
</div>
<!-- <div [hidden]="!doclist">
<button class="btn btn-primary btn-block/" (click)="Adddocuments('')"
style="background: green;cursor: pointer;float: right;border: none;width: 125px;margin-right: 43%;">Add</button>
</div> -->
<div>
<div class="row">
<div class="col-sm-6">
<p>Upload Documents * </p>
</div>
<div class="col-sm-6">
<button mdTooltip="upload Documents"
style="border:1px solid transparent; background-color: transparent;cursor:pointer;float:right"
(click)="AddDocumentsField('addedrow')">
<md-icon style="float: right;width:30px;height:30px;cursor:pointer">add</md-icon>
</button>
</div>
</div>
<div style="overflow: scroll;overflow-x: hidden;" [ngClass]="{'rowHeight':docRow}">
<div class="row" style="margin-bottom: 2%;" *ngFor="let data of imageuploadObject; let i = index">
<div class="col-sm-2">
<md-select (ngModelChange)="documentType($event)" [(ngModel)]="data.doctype" placeholder="Doc Type">
<md-option *ngFor="let doc of documentList" [value]="doc.docId">{{doc.docName}}</md-option>
</md-select>
</div>
<div class="col-sm-10" style="margin-top: 2%;">
<input type="text" style="margin-right: 2%;margin-left: 7px;" [(ngModel)]="data.phone"
placeholder="Doc number">
<span><input type="file" class="btn btn btn-success"
style="background: #f1f1f1;border: none;color: black;margin-right: 2%;width:36%;"
(change)="onFileChanged($event)"></span>
<span><button class="btn btn btn-success" (click)="onUpload(i)">{{uploadStatus}}</button></span>
<span><button mdTooltip="Delete field"
style="padding:0px;border:1px solid transparent; background-color: transparent;cursor:pointer;float:right"
(click)="DeleteDocumentsField(i)">
<md-icon style="float: right;width:50px;height:50px;color:red; cursor:pointer">delete</md-icon>
</button></span>
</div>
</div>
<button [disabled]="!ifuploadArr" class="btn btn-primary btn-block/" (click)="SaveDocuments(null,0)"
style="cursor: pointer;float: right;border: none;width: 125px;margin-right: 43%;margin-bottom: 10px;">Save</button>
</div>
</div>
</div>
<div class="tab-pane" id="Activites" role="tabpanel">
<div class="row mt-3">
<div class="col-md-6">
<b>Last Activity:</b> <span> {{data?data.last_activity_on?data.last_activity_on:0:0}}</span>
</div>
<div class="col-md-6">
<b>Last Login:</b> <span> {{data?data.last_login?data.last_login:0:0}}</span>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<b>Login Type:</b> <span> {{data?data.login_type?data.login_type:0:0}}</span>
</div>
<div class="col-md-6">
<b>Number of Mobile Login:</b> <span> {{data?data.notificationTokenCount? data.notificationTokenCount: 0:0}}</span>
</div>
</div>
</div>
<div class="tab-pane" id="Actions" role="tabpanel">
<div class="row mt-3">
<div class="col-md-6">
<b>Customer Status:</b> <md-slide-toggle [(ngModel)]="data.status" style="height: 0px !important" ngDefaultControl ngDefaultControl
(change)="onChange(data, $event)"></md-slide-toggle>
</div>
<div class="col-md-6">
<b>Suspend Account:</b> <md-slide-toggle [(ngModel)]="data.accountSuspended" style="height: 0px !important" ngDefaultControl
(change)="accountStatusOnChange(data, $event)"></md-slide-toggle>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<b>Admin Alert:</b>
<md-slide-toggle [(ngModel)]="data.adminAlert" style="height: 0px !important" ngDefaultControl
(change)="alertStatus($event, data)"></md-slide-toggle>
</div>
<div class="col-md-6">
<b>Pull Data:</b>
<md-slide-toggle [checked]="data.pullData?data.pullData:false" style="height: 0px !important" ngDefaultControl
(change)="generatePullData($event, data)"></md-slide-toggle>
</div>
</div>
<div class="row mt-3">
<div class="col-md-6">
<b>Share Customer Info:</b>
<i class="fas fa-sign-in-alt" title="Send Login Credentials" (click)="shareUserCredential()"></i>
</div>
<div class="col-md-6">
<b>Reset Password:</b>
<i class="fas fa-unlock-alt" title="Reset Password" (click)="resetPassword()"></i>
</div>
</div>
<div class="row mt-3">
<div *ngIf="custtype" class="col-md-6">
<b>Dealer Alert:</b>
<md-slide-toggle [(ngModel)]="data.dealerAlert" style="height: 0px !important" ngDefaultControl
(change)="dealerAlert($event, data)"></md-slide-toggle>
</div>
</div>
</div>
<div class="tab-pane" id="Transaction" role="tabpanel">
<button *ngIf="!add" class="btn btn-outline-primary" style="border-radius: 20px;margin-left: 6px;float: right;font-size: small;margin-bottom: 13px;" type="button" data-toggle="collapse"
data-target="#collapseOne" aria-expanded="true"aria-controls="collapseOne" (click)="add=!add">back</button>
<button *ngIf="add" class="btn btn-outline-primary" style="border-radius: 20px;float: right;font-size: small;margin-bottom: 13px;" type="button" data-toggle="collapse"
data-target="#collapseTwo" aria-expanded="true"aria-controls="collapseTwo" (click)="addButton()">Add Transaction <i class="fas fa-plus"></i></button>
<div class="accordion" id="table">
<div class="card">
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#table">
<div class="card-body">
<table class="table table-striped">
<thead>
<tr>
<!-- <th scope="col">Customer _ID</th> -->
<th scope="col">Amount</th>
<th scope="col">Payment Mode</th>
<th scope="col">Transaction ID</th>
<th scope="col">Remarks</th>
<th scope="col">Items</th>
<th scope="col">Payment Date</th>
<th scope="col">Status</th>
<th scope="col">Edit</th>
<th scope="col">Delete</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of payementsArray">
<!-- <td>{{item.Customer_ID}}</td> -->
<td>{{item.Amount}}</td>
<td>{{item.PaymentMode}}</td>
<td>{{item.TransactionID}}</td>
<td>{{item.Remarks}}</td>
<td>{{item.Items}}</td>
<td>
<span *ngIf="item.date">{{item.date | date:'medium'}}</span>
<span *ngIf="!item.date">N/A</span>
</td>
<td>{{item.Status}}</td>
<td><i class="fas fa-pencil-alt" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="true"aria-controls="collapseTwo" (click)="editPayment(item)"></i></td>
<td><i class="fas fa-trash" (click)="deletePayment(item)"></i></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="card">
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#table">
<div class="card-body" style="height: 45vh;">
<form [formGroup]="transactionForm" class="form">
<div class="row" style="margin-bottom: 12px;">
<div class="col">
<input type="text" class="form-control" formControlName="Amount" placeholder="Enter Amount">
</div>
<div class="col">
<input type="text" class="form-control" formControlName="TransactionID" placeholder="Enter Transaction Id">
</div>
</div>
<div class="row" style="margin-bottom: 12px;">
<div class="col">
<select id="dbselect" style="width:336px;margin-left: -14px;" multiple="multiple">
<option *ngFor="let option_1 of options" [value]="option_1.selectedValue">{{ option_1.value }}</option>
</select>
</div>
<div class="col">
<input type="text" class="form-control" formControlName="Remarks" placeholder="Enter Remark">
</div>
</div>
<div class="row" style="margin-bottom: 12px;">
<div class="col">
<select formControlName="Items" id="inputState" class="form-control">
<option value="" disabled selected>Select Items</option>
<option *ngFor="let item of items" [value]="item">{{item}}</option>
</select>
</div>
<div class="col">
<select formControlName="PaymentMode" id="inputState" class="form-control">
<option value="" disabled selected>Select Payment Mode</option>
<option *ngFor="let item of PaymentMode" [value]="item">{{item}}</option>
</select>
</div>
</div>
<div class="row">
<div class="col">
<select formControlName="Status" id="inputState" class="form-control">
<option value="" disabled selected>Select Status</option>
<option value="Pending">Pending</option>
<option value="Paid">Paid</option>
</select>
</div>
<div class="col">
<input id="from_date" bsDatepicker class="form-control form-control-sm" style="height: 25px;" [bsConfig]="bsConfig"
formControlName="date" type="text">
</div>
</div>
<div class="card-footer mt-4 text-center">
<button class="btn btn-primary" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true"aria-controls="collapseOne" (click)="addPayment()">{{buttonText}}</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card-footer text-center" >
<button class='btn btn-danger' (click)="dialogRef.close()"> Close <i
class="fas fa-times-circle"></i></button>
</div>
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->
<!-- </div> -->

View file

@ -0,0 +1,307 @@
button,
input {
font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}
a {
color: #f96332;
}
a:hover,
a:focus {
color: #f96332;
}
p {
line-height: 1.61em;
font-weight: 300;
font-size: 1.2em;
}
.category {
text-transform: capitalize;
font-weight: 700;
color: #9a9a9a;
}
body {
color: #2c2c2c;
font-size: 14px;
font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
overflow-x: hidden;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
.nav-item .nav-link,
.nav-tabs .nav-link {
-webkit-transition: all 300ms ease 0s;
-moz-transition: all 300ms ease 0s;
-o-transition: all 300ms ease 0s;
-ms-transition: all 300ms ease 0s;
transition: all 300ms ease 0s;
}
.card a {
-webkit-transition: all 150ms ease 0s;
-moz-transition: all 150ms ease 0s;
-o-transition: all 150ms ease 0s;
-ms-transition: all 150ms ease 0s;
transition: all 150ms ease 0s;
}
[data-toggle="collapse"][data-parent="#accordion"] i {
-webkit-transition: transform 150ms ease 0s;
-moz-transition: transform 150ms ease 0s;
-o-transition: transform 150ms ease 0s;
-ms-transition: all 150ms ease 0s;
transition: transform 150ms ease 0s;
}
[data-toggle="collapse"][data-parent="#accordion"][aria-expanded="true"] i {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
}
.now-ui-icons {
display: inline-block;
font: normal normal normal 14px/1 "Nucleo Outline";
font-size: inherit;
// speak: none;
text-transform: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@-webkit-keyframes nc-icon-spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes nc-icon-spin {
0% {
-moz-transform: rotate(0deg);
}
100% {
-moz-transform: rotate(360deg);
}
}
@keyframes nc-icon-spin {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.now-ui-icons.objects_umbrella-13:before {
content: "\ea5f";
}
.now-ui-icons.shopping_cart-simple:before {
content: "\ea1d";
}
.now-ui-icons.shopping_shop:before {
content: "\ea50";
}
.now-ui-icons.ui-2_settings-90:before {
content: "\ea4b";
}
.nav-tabs {
border: 0;
padding: 15px 0.7rem;
}
.nav-tabs:not(.nav-tabs-neutral) > .nav-item > .nav-link.active {
box-shadow: 0px 5px 35px 0px rgba(0, 0, 0, 0.3);
}
.card .nav-tabs {
border-top-right-radius: 0.1875rem;
border-top-left-radius: 0.1875rem;
}
.nav-tabs > .nav-item > .nav-link {
color: #888888;
margin: 0;
margin-right: 5px;
background-color: transparent;
border: 1px solid transparent;
border-radius: 30px;
font-size: 14px;
padding: 11px 23px;
line-height: 1.5;
}
.nav-tabs > .nav-item > .nav-link:hover {
background-color: transparent;
}
.nav-tabs > .nav-item > .nav-link.active {
background-color: #444;
border-radius: 30px;
color: #ffffff;
}
.nav-tabs > .nav-item > .nav-link i.now-ui-icons {
font-size: 14px;
position: relative;
top: 1px;
margin-right: 3px;
}
.nav-tabs.nav-tabs-neutral > .nav-item > .nav-link {
color: #ffffff;
}
.nav-tabs.nav-tabs-neutral > .nav-item > .nav-link.active {
background-color: rgba(255, 255, 255, 0.2);
color: #ffffff;
}
.card {
border: 0;
border-radius: 0.1875rem;
display: inline-block;
position: relative;
width: 100%;
// margin-bottom: 30px;
// box-shadow: 0px 5px 25px 0px rgba(0, 0, 0, 0.2);
}
.card .card-header {
background-color: transparent;
border-bottom: 0;
background-color: transparent;
border-radius: 0;
padding: 0;
}
.card[data-background-color="orange"] {
background-color: #2d4262;
}
.card[data-background-color="red"] {
background-color: #ff3636;
}
.card[data-background-color="yellow"] {
background-color: #ffb236;
}
.card[data-background-color="blue"] {
background-color: #2ca8ff;
}
.card[data-background-color="green"] {
background-color: #15b60d;
}
[data-background-color="orange"] {
background-color: #2d4262;
}
[data-background-color="black"] {
background-color: #2c2c2c;
}
[data-background-color]:not([data-background-color="gray"]) {
color: #ffffff;
}
[data-background-color]:not([data-background-color="gray"]) p {
color: #ffffff;
}
[data-background-color]:not([data-background-color="gray"])
a:not(.btn):not(.dropdown-item) {
color: #ffffff;
}
[data-background-color]:not([data-background-color="gray"])
.nav-tabs
> .nav-item
> .nav-link
i.now-ui-icons {
color: #ffffff;
}
@font-face {
font-family: "Nucleo Outline";
src: url("https://github.com/creativetimofficial/now-ui-kit/blob/master/assets/fonts/nucleo-outline.eot");
src: url("https://github.com/creativetimofficial/now-ui-kit/blob/master/assets/fonts/nucleo-outline.eot")
format("embedded-opentype");
src: url("https://raw.githack.com/creativetimofficial/now-ui-kit/master/assets/fonts/nucleo-outline.woff2");
font-weight: normal;
font-style: normal;
}
.now-ui-icons {
display: inline-block;
font: normal normal normal 14px/1 "Nucleo Outline";
font-size: inherit;
// speak: none;
text-transform: none;
/* Better Font Rendering */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
footer {
margin-top: 50px;
color: #555;
background: #fff;
padding: 25px;
font-weight: 300;
background: #f7f7f7;
}
.footer p {
margin-bottom: 0;
}
footer p a {
color: #555;
font-weight: 400;
}
footer p a:hover {
color: #e86c42;
}
@media screen and (max-width: 768px) {
.nav-tabs {
display: inline-block;
width: 100%;
padding-left: 100px;
padding-right: 100px;
text-align: center;
}
.nav-tabs .nav-item > .nav-link {
margin-bottom: 5px;
}
}
.mat-dialog-container {
padding: 0px !important;
}

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ViewCustomerDetailsComponent } from './view-customer-details.component';
describe('ViewCustomerDetailsComponent', () => {
let component: ViewCustomerDetailsComponent;
let fixture: ComponentFixture<ViewCustomerDetailsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViewCustomerDetailsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ViewCustomerDetailsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,640 @@
import { Component, Inject, OnInit, TemplateRef } from '@angular/core';
import { MdDialog, MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
import { BsDatepickerConfig, BsModalRef, BsModalService } from 'ngx-bootstrap';
import { ContactService } from '../../contact.service';
import { OtpScreenComponent } from '../otp-screen/otp-screen.component';
import { saveAs } from 'file-saver';
import { ShowPullDataLinkComponent } from '../show-pull-data-link/show-pull-data-link.component';
import { FormBuilder, FormGroup } from '@angular/forms';
import { ResetPasswordComponent } from '../reset-password/reset-password.component';
declare var swal: any;
declare var $:any;
@Component({
selector: 'app-view-customer-details',
templateUrl: './view-customer-details.component.html',
styleUrls: ['./view-customer-details.component.scss']
})
export class ViewCustomerDetailsComponent implements OnInit {
testDocuments;
documentList = [
{
"docId": "Adhar card",
"docName": "Adhar Card"
},
{
"docId": "voter Id",
"docName": "Voter Id"
},
{
"docId": "PAN card",
"docName": "Pan Card"
},
{
"docId": "Driving License",
"docName": "Driving License"
},
{
"docId": "RC Book",
"docName": "RC Book"
},
{
"docId": "Device Image",
"docName": "Device Image"
},
{
"docId": "Other",
"docName": "Other"
}
];
otp
data_descip
doclist:boolean=true;
showUpload: boolean=false;
Load: boolean;
uploadStatus: any = 'Upload';
ifuploadArr: boolean ;
useridForDocUpload: any;
disableDelete: boolean;
errorMsg: string;
showError: boolean = false;
dealerStatus: any;
superAdmin: any;
superadminAccess: any;
imageuploadObject = [];
label: any;
modalRef: BsModalRef;
header: any;
useridd;
options: any=[{selectedValue : '',value:''}];
transactionForm:FormGroup;
items=['New GPS','GPS Renewal','Service','SIM + Software','Software','SIM']
PaymentMode =['Cash','Cheque','Net Banking','UPI','Wallet','Others']
custtype: any;
bsConfig: Partial<BsDatepickerConfig>;
constructor(public dialogRef: MdDialogRef<ViewCustomerDetailsComponent>,private fb:FormBuilder,public dialog: MdDialog,private contactService: ContactService,private modalService: BsModalService,
@Inject(MD_DIALOG_DATA) public data: any) {
this.testDocuments = this.data.imageDoc;
console.log(data,this.testDocuments);
this.custtype = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer;
if(this.testDocuments){
console.log("INDJj");
if(this.testDocuments.length != 0){
for(var i=0;i<this.testDocuments.length;i++){
if(this.testDocuments[i].image){
var ext=this.testDocuments[i].image.split('.').pop();
this.testDocuments[i].ext=ext
this.testDocuments[i].image=(this.testDocuments[i].image).substring(6);
}
}
this.doclist = false;
}
}else{
this.doclist = true;
}
this.useridForDocUpload = this.data.dealer_id?this.data.dealer_id:this.data._id
this.getVehicles(this.data)
}
ngOnInit() {
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.transactionForm=this.fb.group({
Amount:[''],
Customer_ID:this.data._id,
Status:[''],
TransactionID:[''],
Remarks:[''],
VehicleNo:[''],
Items :[''],
PaymentMode:[''],
supAdmin: this.useridd,
date:new Date()
})
this.getPayments()
}
getVehicles(data:any){
this.contactService.get('/devices/getDeviceByUser?email='+data.email+'&id='+data._id).subscribe((resp:any) => {
console.log('device api respoonse=>',resp);
for(let i=0;i<resp.devices.length;i++){
// if(resp.devices[i].type_of_device =="Tracker"){
let a ={
value : resp.devices[i].Device_Name,
viewValue:resp.devices[i].Device_Name,
did:resp.devices[i].Device_ID,
id:resp.devices[i]._id,
user:resp.devices[i].user,
}
a['selectedValue'] = resp.devices[i]._id ;
this.options.push(a);
// }
}
this.loadropdown()
})
}
loadropdown() {
let that = this;
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", "https://unpkg.com/multiple-select@1.3.1/dist/multiple-select.min.js");
document.getElementsByTagName("head")[0].appendChild(script);
// ||(this.componentIdentifier === 'notification_master')
setTimeout(() => {
$('#dbselect').multipleSelect({
width: 384,
placeholder: 'Select Vehicles',
filter: true,
// single: false,
// selectAll: false
})
// that.showLoader = false;
}, 100);
}
verify(){
let dialogRef = this.dialog.open(OtpScreenComponent,{
// width: '800px',
// // height: '600px',
disableClose: true,
data:this.data
});
dialogRef.afterClosed().subscribe(result => {
console.log(result);
if (result.value == "done") {
this.data.phone_verfi=true;
}
});
}
downloadDoc(doc:any){
console.log(doc.image);
var imageLink = doc.image;
var filetext = imageLink.split('.');
console.log(filetext[1]);
this.contactService.DownloadDocument(doc.image).subscribe(res=>{
console.log(res);
this.saveToFileSystem(res,doc,filetext[1]);
},err=>{
console.log(err);
})
}
private saveToFileSystem(response,doc,fileex) {
console.log(response._body);
if(fileex == 'pdf'){
console.log("Inside pdf");
var blob = new Blob([response._body], { type: "application/pdf" });
}else{
var blob = new Blob([response._body], { type: "image/png" });
}
var filename = doc.doctype+'_'+doc.phone;
// console.log(filename);
saveAs(blob,filename);
}
deleteDoc(doc,index){
console.log(index);
console.log(doc);
}
Adddocuments(doc){
console.log(doc);
this.disableDelete = true;
this.showUpload = true;
if(this.imageuploadObject.length == 0){
this.ifuploadArr = false;
}
}
docRow:boolean=false;
AddDocumentsField(addedRow:any){
console.log("Inside function !!!");
if(addedRow){
this.docRow = true;
}
var obj={doctype:'',image:'',phone:''};
this.imageuploadObject.push(obj);
console.log(this.imageuploadObject);
}
DeleteDocumentsField(index){
console.log(this.imageuploadObject.length);
if(this.imageuploadObject.length == 1){
this.docRow = false;
this.showUpload = false;
}
this.imageuploadObject.splice(index, 1);
}
documentType(docType){
console.log("doctypeObject=>",docType);
}
selectedFile: File;
onFileChanged(event) {
console.log(event.target.files[0]);
this.selectedFile = <File>event.target.files[0];
console.log(this.selectedFile);
}
onUpload(imgIndex) {
console.log(imgIndex);
console.log(this.imageuploadObject);
const fd = new FormData();
console.log("selected file name =>",this.selectedFile.name);
if(this.selectedFile.name == " "){
swal(
'Upload Error',
'Please select document type before upload !!!',
'error'
)
}else{
fd.append('photo',this.selectedFile,this.selectedFile.name)
console.log("imgURL=>",fd) ;
this.Load = true;
this.contactService.imageupload(fd)
.subscribe(res=>{
this.Load = false;
this.ifuploadArr = true;
console.log(res);
var resImage ='';
resImage = res['_body'];
console.log(res['_body']);
this.imageuploadObject[imgIndex].image = resImage;
console.log(this.imageuploadObject);
},err=>{
this.Load= false;
// this._flashMessagesService.show('Internal server error , try again', { cssClass: 'alert-success', timeout: 2000 });
})
}
}
SaveDocuments(actionString,objIndex){
console.log(this.imageuploadObject);
console.log("Save");
var imageuploadArr = {
_id : this.useridForDocUpload
}
if(actionString == 'deldoc'){
this.testDocuments.splice(objIndex,1);
console.log("testArray after deleting doc =>",this.testDocuments);
}
for(var d = 0 ;d <this.imageuploadObject.length;d++){
if((this.imageuploadObject[d].doctype == "")&&(this.imageuploadObject[d].image == "")&&(this.imageuploadObject[d].phone == "")){
this.imageuploadObject.splice(d,1);
}
}
console.log(this.imageuploadObject);
for(var j = 0;j< this.testDocuments.length;j++){
console.log(this.testDocuments[j]);
this.imageuploadObject.push(this.testDocuments[j]);
}
imageuploadArr['imageDoc'] = this.imageuploadObject;
console.log(this.imageuploadObject.length);
this.contactService.updateImage(imageuploadArr).subscribe(res=>{
console.log(res);
if(actionString != 'deldoc'){
// this.thisDialogRef.close("imageupdated");
}
if(actionString == 'deldoc'){
this.imageuploadObject = [];
}
},err=>{
// this._flashMessagesService.show('Internal server error , try again', { cssClass: 'alert-success', timeout: 2000 });
})
}
expand(value){
console.log(value);
if(value){
document.getElementById('container').style.width='80vh'
}else{
}
}
changeKYC(event){
console.log(event);
var req={
user:this.data.dealer_payload._id,
status:event
}
this.contactService.changeKycStatus(req).subscribe(res=>{
console.log(res);
// this.tost1('kyc');
this.dialogRef.close('yes')
})
}
openModal(template: TemplateRef<any>,data) {
this.modalRef = this.modalService.show(template,{'backdrop':'static',class:'modal-lg modal-dialog-centered'});
this.header=data.doctype
// this.image='https://www.oneqlik.in/'+data.image
}
onChange(cust, ev) {
let status = ev;
// console.log(status.checked);
let cust_status = cust;
let cust_id = cust._id;
let cust_activity = cust.status
// console.log(cust_activity);
var cust_load = {
"uId": cust_id,
"loggedIn_id": this.useridd,
"status": status.checked
}
// console.log(cust_id);
console.log(cust_load);
this.contactService.custStatus(cust_load)
.subscribe(res => {
let a = res;
// console.log(a);
// console.log("Status changed");
})
}
accountStatus:boolean = true;
accountStatusOnChange(custObj, event){
console.log(custObj,event.checked);
var payload = {
accountSuspended : event.checked,
acoountId : custObj._id ,
suspendedBy : 'distributer'
}
var that = this;
swal("Are you sure ?", "Do you want to change account status ?").then((ans)=>{
console.log(ans);
that.contactService.accountSuspend(payload).subscribe(res=>{
console.log(res);
// that.getCustomer();
that.data_descip = "Account Status Changed";
launch_toast();
function launch_toast() {
// console.log(divid);
var x = document.getElementById("toast")
//console.log(x);
x.className = "show";
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 4500);
}
})
},err=>{
// that.getCustomer();
console.log(err);
});
}
adm_alert:boolean=false;
alertStatus(ev,cobj){
var aAlert= ev.checked;
var pld= {
uid : cobj._id,
adminAlert : aAlert
}
console.log(pld);
this.contactService.setlanguage(pld).subscribe(res=>{
console.log(res);
// this.tost1('alertset');
})
}
dealerAlert(ev,cobj){
var aAlert= ev.checked;
var pld= {
uid : cobj._id,
dealerAlert : aAlert
}
console.log(pld);
this.contactService.setlanguage(pld).subscribe(res=>{
console.log(res);
// this.tost1('alertset');
})
}
generatePullData(ev,data){
// if(ev.checked){
console.log(ev,data);
var request={
pullData:ev.checked,
pass:data.pass
}
if(data.user_id){
request['user_id']=data.user_id
}
if(data.phone){
request['phone']=data.phone
}
console.log(request);
this.contactService.post('/users/getToken',request).subscribe((res:any)=>{
console.log(res);
if(ev.checked){
let dialogRef = this.dialog.open(ShowPullDataLinkComponent, {
width: '800px',
// height: '600px',
data:res.token
});
}
})
}
show:boolean=false;
verify1(){
console.log(this.otp);
this.contactService.post('/users/verifyOtp',{user:this.data._id,otp:this.otp}).subscribe((res:any)=>{
this.data_descip = res.message;
launch_toast()
this.dialogRef.close({value:'done'});
},err=>{
console.log(err);
var message=JSON.parse(err._body);
console.log(message);
this.data_descip = "You entered wrong OTP"
this.show=true;
var that=this;
// this.data_descip = res.message;
launch_toast()
setTimeout(function () {that.show=false }, 4500);
})
function launch_toast() {
// console.log(divid);
var x = document.getElementById("toast")
//console.log(x);
x.className = "show";
setTimeout(function () { x.className = x.className.replace("show", ""); }, 4500);
}
}
add:boolean=true;
addPayment(){
if(this.buttonText=="Update"){
this.updatePayment()
}else{
this.transactionForm.patchValue({
VehicleNo:$('#dbselect').multipleSelect('getSelects','value')
})
this.contactService.post('/CustomerPayment/add',this.transactionForm.value).subscribe(res=>{
// console.log(res);
this.getPayments()
})
}
}
payementsArray
getPayments(){
this.payementsArray=[]
this.contactService.get('/CustomerPayment/get?Customer_ID='+this.data._id).subscribe(res=>{
// console.log(res);
this.payementsArray=res
})
}
paymentId
buttonText="Save"
editPayment(data){
this.paymentId=data._id
this.transactionForm.patchValue({
Customer_ID:data.Customer_ID,
Amount:data.Amount,
Items:data.Items,
PaymentMode:data.PaymentMode,
Remarks:data.Remarks,
Status:data.Status,
TransactionID:data.TransactionID,
VehicleNo:data.VehicleNo,
supAdmin:data.supAdmin,
})
this.buttonText="Update";
this.add=!this.add;
}
updatePayment(){
this.contactService.post('/CustomerPayment/update',{id:this.paymentId,data:this.transactionForm.value}).subscribe(res=>{
this.getPayments()
})
}
deletePayment(data){
this.contactService.post('/CustomerPayment/delete',{_id:data._id}).subscribe(res=>{
this.getPayments()
})
}
addButton(){
this.add=!this.add;
this.buttonText="Save";
// this.transactionForm.reset()
}
shareUserCredential(){
console.log('this.data',this.data);
var cost_id = this.data._id;
this.contactService.shareCostumerInfo(cost_id).subscribe(res=>{
console.log(res);
let message =res.message;
let action
// this.snackBar.open(message, action, {
// duration: 4000,
// });
},err=>{
console.log(err);
})
}
resetPassword(){
// console.log("Inside reset",cust_array);
let dialogRef = this.dialog.open(ResetPasswordComponent, {
width: '400px',
data : this.data
// height: '600px',
});
dialogRef.afterClosed().subscribe(result => {
// console.log(result);
if (result == "succ") {
// this.tost1("password_changed");
this.ngOnInit();
}
if (result == "close") {
// this.tost1("succ");
// this.ngOnInit();
}
});
}
}

View file

@ -0,0 +1,28 @@
<p style="text-align: center;font-size: 25px;">{{'Add POI' | translate}}</p>
<div class="row" style="padding-bottom: 15px;">
<div class="col-md-4 col-lg-4 col-sm-4" style="padding-top: 15px;">
<md-form-field>
<input mdInput type="text" style="width: inherit;border-radius: 10px;" [(ngModel)]="poiName" name="poiName" placeholder="{{'Enter POI name' | translate}}">
</md-form-field>
</div>
<div class="col-md-4 col-lg-4 col-sm-4" style="padding-top: 15px;">
<!-- <input mdInput type="text" style="width: inherit;border-radius: 10px;" [(ngModel)]="address" name="Address" placeholder="Enter Address"> -->
<md-form-field>
<input disabled="true" type="text" mdInput name="text" style="width: inherit;border-radius: 10px;" id="txtSource" [(ngModel)]="address_show" placeholder="{{'Enter Address' | translate}}">
</md-form-field>
</div>
<div class="col-md-4 col-lg-4 col-sm-4">
<span>POI Type</span>
<select [(ngModel)]="poitype" class="form-control" name="poitype" >
<option *ngFor="let type of poiType; let i = index;" [value]="type.value" >{{type.view}}</option>
</select>
</div>
</div>
<div class="row">
<div class="col-sm-6" style="padding-left: 25%;">
<button (click)="saveDetails()" style="background-color: green" class="btn btn-primary btn-block">{{'Save' | translate}}</button>
</div>
<div class="col-sm-6" style="padding-right: 25%;">
<button class="btn btn-primary btn-block" (click)="close()" style="background-color: #ff0f0f">{{'Cancel' | translate}}</button>
</div>
</div>

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddpoiBylocationComponent } from './addpoi-bylocation.component';
describe('AddpoiBylocationComponent', () => {
let component: AddpoiBylocationComponent;
let fixture: ComponentFixture<AddpoiBylocationComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddpoiBylocationComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddpoiBylocationComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,188 @@
import { Component, OnInit,Inject } from '@angular/core';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
import { ContactService } from '../contact.service';
declare var google: any;
@Component({
selector: 'app-addpoi-bylocation',
templateUrl: './addpoi-bylocation.component.html',
styleUrls: ['./addpoi-bylocation.component.scss']
})
export class AddpoiBylocationComponent implements OnInit {
poiName:any;
address:any;
useridd: any;
Saddress: any;
lattitude:any;
longitude:any;
poitype:any;
poiType=[
{view : "Provider",value:""},
{view : "Customer",value:"customer"},
{view : "Garage",value:"garage"},
{view : "Emergency",value:"emergency"},
{view : "Others",value:"others"},
{view : "Gas Station",value:"gas_station"},
{view :"Residence",value : "residence"},
{view : "City",value:"city"},
{view : "Work",value:"work"},
{view : "Resturant",value:"resturant"},
{view : "Shopping",value:"shopping"},
{view : "Bank",value:"bank"},
{view : "School",value:"school"},
{view :"Super Market",value : "supermarket"},
{view :"Gym",value : "gym"},
{view : "Home", value : "home"},
{view :"Grocery Store",value : "grocery_store"}
];
constructor(public dialogRef: MdDialogRef<AddpoiBylocationComponent>,@Inject(MD_DIALOG_DATA) public data: any,public contactService: ContactService) {
// console.log("deviceInfo=>",data);
this.lattitude = data.deviceData.lat;
this.longitude = data.deviceData.long;
console.log('this.lattitude',this.lattitude);
console.log('this.longitude',this.longitude);
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
}
ngOnInit() {
// this.Saddress = new google.maps.places.Autocomplete(document.getElementById('txtSource'));
this.getAddress();
}
saveDetails(){
// console.log(this.address_show);
var locationObj = {
'type' : 'Point',
"coordinates": [this.longitude,this.lattitude]
}
// this.Saddress = document.getElementById('txtSource');
// this.address =this.Saddress.value;
var poiObj = {
poi: [
{
"location": locationObj,
"poiname" : this.poiName,
"status": "Active",
"address" : this.address_show,
"user" : this.useridd,
"radius" : 30
}
]
}
if(this.poitype != undefined){
poiObj.poi[0]['poi_type'] = this.poitype ;
}
this.contactService.addOnePoi(poiObj)
.subscribe(res=>{
// console.log(res);
},err=>{
// console.log(err);
})
// console.log(poiObj);
this.dialogRef.close("success");
}
close(){
this.dialogRef.close();
}
address_show:any;
getAddress() {
var outerThis = this;
let d_lat = (this.lattitude != undefined)?this.lattitude : null;
let d_lng = (this.longitude != undefined)?this.longitude : null;
var latlng_1 =
{
"lat": d_lat,
"long": d_lng
}
this.contactService.getAddressByApi(latlng_1).subscribe(res=>{
if(res.message == "Address not found in databse"){
let geocoder = new google.maps.Geocoder();
let t_latlng = new google.maps.LatLng(d_lat, d_lng);
let request = {
latLng: t_latlng
};
geocoder.geocode(request, function (data, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (data[0] != null) {
outerThis.address_show = data[0].formatted_address;
// console.log(outerThis.address_show);
} else {
// console.log("No address available")
outerThis.address_show = "No address available";
}
}
else {
outerThis.address_show = 'NA';
}
})
}else{
outerThis.address_show = res.address;
}
})
// if (this.lattitude== undefined) {
// this.lattitude = null;
// this.longitude = null;
// }
// var geocoder = new google.maps.Geocoder();
// var latlng = new google.maps.LatLng(this.lattitude, this.longitude);
// var request = {
// latLng: latlng
// };
// geocoder.geocode(request, function (data, status) {
// if (status == google.maps.GeocoderStatus.OK) {
// if (data[0] != null) {
// outerThis.address_show = data[0].formatted_address;
// } else {
// outerThis.address_show = "No address available";
// }
// }
// else {
// outerThis.address_show = outerThis.lattitude + ", " + outerThis.longitude;
// }
// })
}
}

View file

@ -0,0 +1,43 @@
<app-all-menus></app-all-menus>
<div class="topDiv">
<div class="row" style="text-align: center; background: #426E86; padding-top: 10px; padding-bottom: 10px; color: white;box-shadow:3px 1px 5px 0px rgb(178, 176, 174)">
<div class="col-sm-12 col-md-12 col-lg-12">
<h4>{{'Address' | translate}}</h4>
</div>
</div>
<div class="row rowStyle">
<!-- <div class="col-sm-3 col-md-3 col-lg-3" style="padding-left: 20px; padding-right: 5px; padding-top: 5px; padding-bottom: 5px;">
<div class="row" style="margin:0px;height: 84vh;background: white;box-shadow: 3px 1px 5px 0px #b2b0ae;">
<div class="col-sm-12 col-md-12 col-lg-12" style="padding:0px">
</div>
</div>
</div> -->
<div class="col-sm-12 col-md-12 col-lg-12" style="padding-left: 5px; padding-right: 20px; padding-top: 5px;">
<div class="row" style="margin:0px;height: 84vh;padding-top:10px;padding-bottom:5px;background: white;box-shadow: 3px 1px 5px 0px #b2b0ae;">
<div class="col-sm-12 col-md-12 col-lg-12">
<!-- <div *ngIf="Load" class="loading">Loading&#8230;</div> -->
<div style="width: 100%;height:84vh;">
<table id="deviceTable" cellspacing="0" style="width: 100%;font-size: 14px;">
<thead style="background-color:#e0e0e0;color: #444444;">
<tr>
<th style="text-align:left;"></th>
<th style="text-align:left;">{{'Current address' | translate}} </th>
<th style="text-align:left;">{{'Suggested address' | translate}} </th>
<th style="text-align:left;">{{'Added On' | translate}}</th>
<th style="text-align:left;">{{'Status' |translate}}</th>
<th style="text-align:left;">{{'Added By' | translate}}</th>
<th style="text-align:left;">{{'Location Point' | translate}}</th>
<th style="text-align:left;">{{'Update Address' | translate}}</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,38 @@
.topDiv{
padding-top: 59px;
background: whitesmoke;
height: 100vh;
}
.rowStyle{
// margin: 5px;
// background: white;
height: 84vh;
// box-shadow: 3px 1px 5px 0px #b2b0ae;
}
#deviceTable input {
border-radius: 5px;
}
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
background: rgb(153, 153, 153);
}
/* Handle */
::-webkit-scrollbar-thumb {
// background: rgb(74, 118, 184);
background: #868e96;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddressUpdateComponent } from './address-update.component';
describe('AddressUpdateComponent', () => {
let component: AddressUpdateComponent;
let fixture: ComponentFixture<AddressUpdateComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddressUpdateComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddressUpdateComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,258 @@
import { Component, OnInit } from '@angular/core';
import { MdDialog } from '@angular/material';
import { Router } from '@angular/router';
import { ContactService } from '../contact.service';
declare var moment,$:any;
declare var swal:any;
@Component({
selector: 'app-address-update',
templateUrl: './address-update.component.html',
styleUrls: ['./address-update.component.scss']
})
export class AddressUpdateComponent implements OnInit {
addressArr:any=[];
tabelObj: any;
useridd: any;
identifier:any='addressComponent'
constructor(public dialog: MdDialog, private router: Router, private contactService: ContactService) { }
ngOnInit() {
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
var td= this.todate.setHours(0,0,0,0);
this.todate = new Date(td);
this.testTable();
}
testTable() {
const that = this;
console.log("inside function");
$(document).ready(function() {
that.tabelObj = $('#deviceTable').DataTable({
'serverSide': true,
"processing": true,
"searching": false,
pagingType: 'full_numbers',
pageLength: 25,
"scrollY":'65vh',
// "ordering": true,
order: [[0, 'desc']],
"scrollCollapse": true,
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
ajax: (dataTablesParameters,callback) => {
// dataTablesParameters.op = {};
// dataTablesParameters.select = [];
// dataTablesParameters.find = {};
// dataTablesParameters.columns = [
// { data: "_id","orderable": "true" },
// { data: "address" },
// { data: "current_address" },
// { data: "createdBy.first_name" },
// { data: "createdBy.last_name" },
// { data: "createdOn" },
// { data: "status" },
// { data: "location.coordinates" },
// { data: null, defaultContent: '' }
// ]
// if (that.Fromdate) {
// var fdate = new Date(that.Fromdate).toISOString()
// dataTablesParameters.find['createdOn'] = dataTablesParameters.find['createdOn'] ? dataTablesParameters.find['createdOn'] : {};
// dataTablesParameters.find['createdOn']['$gte'] = fdate
// };
// if (that.todate) {
// var tdate = new Date(that.todate).toISOString()
// dataTablesParameters.find['createdOn'] = dataTablesParameters.find['createdOn'] ? dataTablesParameters.find['createdOn'] : {};
// dataTablesParameters.find['createdOn']['$lte'] = tdate;
// }
// dataTablesParameters.find['user'] = that.useridd;
var suburl = "";
suburl += "/googleAddress/test1";
that.contactService.getApprovalAddressList(that.useridd).subscribe(resp => {
console.log("Response from datatable=>", resp);
callback(resp);
}, err => {
});
},
"rowCallback": function(row: Node, data: any | Object, index: number){
$('#updateAddress',row).bind('click',()=>{
// var warningMsg = "Are you sure that you want to permanently delete the selected device ?" ;
swal({
// title: 'Are you sure?',
text: "Do you want to approve this address ?",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, approve'
}).then((result: { value: boolean; }) =>{
if(result){
var payLoad={
lat : data.location.coordinates[1],
long: data.location.coordinates[0],
address : data.address,
mid: data._id
}
that.contactService.changeAddress(payLoad).subscribe(res=>{
swal(
'Updated',
'Address Updated',
'success'
)
that.tabelObj.ajax.reload();
})
}
});
})
},
"columns": [
{
"data": "_id",
"visible":false,
"defaultContent": "",
"render": function(data, type, row) {
return data?data : '';
}
},
{
"data": "current_address",
"defaultContent": "",
"render": function(data, type, row) {
return data?data : '';
}
},
{
"data": "address",
"defaultContent": "",
"render": function(data, type, row) {
return data?data : '';
}
},
{
"data": "createdOn",
"defaultContent": "",
render: function(data, type, row) {
var expDate = new Date(data);
return data ? (moment(expDate).format('llll')) : "";
}
},
{
"data": "status",
"defaultContent": "",
render: function(data, type, row) {
return data?data:'';
}
},
{
"data": "createdBy",
"defaultContent": "",
render: function(data, type, row) {
console.log(row);
var firstName=data.first_name?data.first_name:'';
var lastName=data.last_name?data.last_name:''
// var isUserename = row.user;
// if(isUserename != undefined){
// name = data.first_name?data.first_name:''
// :''+ ' '+ data.last_name?data.last_name:'';
// }
return firstName+' '+lastName;
}
},
{
"data": "location",
"defaultContent": "",
render: function(data, type, row) {
return data?(data.coordinates[1] + ',' + data.coordinates[0]):'';
}
} ,
{
"data":null,
"render":function(data,type,row){
if(row.status == 'Pending'){
return '<i id="updateAddress" style="cursor:pointer;color:red" class="fas fa-exclamation-triangle" title="Approve address"></i>'
}else{
return '<i class="far fa-check-circle" style="cursor:pointer;color:green" title="Approved"></i>'
}
}
}
],
});
});
}
Fromdate= new Date();
todate = new Date();
getReport(event){
console.log("inside function");
if(event == 'getExcel'){
this.exportExcel();
}else{
var deviceId: any;
var tpdata = event ;
var that = this;
var fd = new Date(tpdata.fromDate);
var td = new Date(tpdata.toDate);
this.Fromdate = fd;
this.todate = td;
this.tabelObj.ajax.reload();
}
}
tab:any;
exportExcel()
{
var tab_text="<table border='2px'><tr bgcolor='#87AFC6'>";
var textRange; var j=0;
var table = $('#deviceTable').clone();
table[0].querySelector("thead").remove();
table[0].prepend($(".dataTable thead").clone()[0]);
this.tab = table[0];//document.getElementById('deviceTable'); // id of table
for(j = 0 ; j < this.tab.rows.length ; j++)
{
tab_text=tab_text+this.tab.rows[j].innerHTML+"</tr>";
}
tab_text=tab_text+"</table>";
tab_text= tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); // reomves input params
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
var sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));
return (sa);
}
}

View file

@ -0,0 +1,51 @@
import { Component, OnInit } from '@angular/core';
import { Alert, AlertType } from './alert';
import { AlertService } from './alert.service';
@Component({
moduleId: module.id,
selector: 'alert',
templateUrl: './community/community.component.html'
})
export class AlertComponent {
alerts: Alert[] = [];
constructor(private alertService: AlertService) { }
ngOnInit() {
this.alertService.getAlert().subscribe((alert: Alert) => {
if (!alert) {
// clear alerts when an empty alert is received
this.alerts = [];
return;
}
// add alert to array
this.alerts.push(alert);
});
}
removeAlert(alert: Alert) {
this.alerts = this.alerts.filter(x => x !== alert);
}
cssClass(alert: Alert) {
if (!alert) {
return;
}
// return css class based on alert type
switch (alert.type) {
case AlertType.Success:
return 'alert alert-success';
case AlertType.Error:
return 'alert alert-danger';
case AlertType.Info:
return 'alert alert-info';
case AlertType.Warning:
return 'alert alert-warning';
}
}
}

57
src/app/alert.service.ts Normal file
View file

@ -0,0 +1,57 @@
import { Injectable } from '@angular/core';
import { Router, NavigationStart } from '@angular/router';
import { Observable } from 'rxjs';
import { Subject } from 'rxjs/Subject';
import { Alert, AlertType } from './alert';
@Injectable()
export class AlertService {
private subject = new Subject<Alert>();
private keepAfterRouteChange = false;
constructor(private router: Router) {
// clear alert messages on route change unless 'keepAfterRouteChange' flag is true
router.events.subscribe(event => {
if (event instanceof NavigationStart) {
if (this.keepAfterRouteChange) {
// only keep for a single route change
this.keepAfterRouteChange = false;
} else {
// clear alert messages
this.clear();
}
}
});
}
getAlert(): Observable<any> {
return this.subject.asObservable();
}
success(message: string, keepAfterRouteChange = false) {
this.alert(AlertType.Success, message, keepAfterRouteChange);
}
error(message: string, keepAfterRouteChange = false) {
this.alert(AlertType.Error, message, keepAfterRouteChange);
}
info(message: string, keepAfterRouteChange = false) {
this.alert(AlertType.Info, message, keepAfterRouteChange);
}
warn(message: string, keepAfterRouteChange = false) {
this.alert(AlertType.Warning, message, keepAfterRouteChange);
}
alert(type: AlertType, message: string, keepAfterRouteChange = false) {
this.keepAfterRouteChange = keepAfterRouteChange;
this.subject.next(<Alert>{ type: type, message: message });
}
clear() {
// clear alerts
this.subject.next();
}
}

11
src/app/alert.ts Normal file
View file

@ -0,0 +1,11 @@
export class Alert {
type: AlertType;
message: string;
}
export enum AlertType {
Success,
Error,
Info,
Warning
}

View file

@ -0,0 +1,440 @@
<nav class="navbar navbar-expand-lg navbar-light custom_style" style="z-index: 20;">
<!-- <a class="navbar-brand" href="#">Navbar</a> -->
<!-- <img src={{this.logo}} > -->
<img src={{this.logo}} style="width:140px;padding-left: 10px;height: 50px;">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- <div [ngStyle]="{'background-color': style1 ? 'red' : (style2 ? 'blue' : null) }"> style="flex: 1;text-align: center;padding-left: 70px;"paddingLeft-->
<div class="collapse navbar-collapse list_style" id="navbarSupportedContent">
<div [ngClass]="paddingLeft?'changePadding1':'changePadding'">
<div>
<ul class="navbar-nav mr-auto">
<li class="nav-item dropdown hoverStyle" style="text-align: center;padding-top: 5px;cursor: pointer;">
<!-- <i class="fas fa-user-shield" style="font-size: 20px;"></i> -->
<div data-toggle="dropdown">
<i class="fas fa-user-shield" style="color:white"></i>
<a class="nav-link dropdown-toggle" style="padding-top: 0px !important;
padding-bottom: 10px !important;cursor: pointer;" id="navbarDropdown" role="button" aria-haspopup="true" aria-expanded="false">
{{'Admin' | translate}}
</a>
</div>
<div class="dropdown-menu dropdown_style" aria-labelledby="navbarDropdown">
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin" (click)="addressList('admin')">{{'Address approval' | translate}}</a>
<!-- *ngIf="(useridd == '59cbbdbe508f164aa2fef3d8')" -->
<li class="dropdown-submenu dropdown_style" *ngIf="(useridd == '59cbbdbe508f164aa2fef3d8')">
<a class="nav-link dropdown-toggle"
style="width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;"
data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> <span style="margin-left: 13px;">Billing</span></a>
<ul class="dropdown-menu dropdown_style">
<li *ngIf="this.reportArray[3].Rstatus == true" class="dropdown_style" (click)="billing('report')"
style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;">
<a>{{'Billing Details' | translate}}</a></li>
<li *ngIf="this.reportArray[5].Rstatus == true" class="dropdown_style" (click)="deviceList()"
style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;">
<a>{{'Device List' | translate}}</a></li>
<li *ngIf="this.reportArray[5].Rstatus == true" class="dropdown_style" (click)="inActiveAdmins()"
style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;">
<a>{{'Inactive Admins' | translate}}</a>
</li>
</ul>
</li>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" (click)="Ddetail('admin')">{{'Driver Master' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin" (click)="DModel('admin')">{{'Device Model' | translate}}</a>
<a *ngIf="superAdmin || custtype" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" (click)="deviceMaster('admin')">{{'Device Master' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="showIMEI" (click)="imeiFind('admin')">{{'IMEI Finder' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin || isOperator" (click)="deviceInventoryList('admin')">{{'Inventory List' | translate}}</a>
<li class="dropdown-submenu dropdown_style">
<a class="nav-link dropdown-toggle"
style="width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;"
data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> <span
style="margin-left: 13px;">Installation</span></a>
<ul class="dropdown-menu dropdown_style">
<li *ngIf="this.reportArray[3].Rstatus == true" class="dropdown_style" (click)="technician('admin')"
style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;">
<a>{{'Technicians' | translate}}</a>
</li>
<li *ngIf="this.reportArray[5].Rstatus == true" class="dropdown_style" (click)="jobCard('admin')"
style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;">
<a>{{'Job Card' | translate}}</a>
</li>
</ul>
</li>
<a class="dropdown-item" *ngIf="superAdmin"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
(click)="issueList('admin')">{{'Issue List' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin || custtype" (click)="messageUtility('admin')">{{'Message Utility' | translate}}</a>
<li class="dropdown-submenu dropdown_style">
<a class="nav-link dropdown-toggle"
style="width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;"
data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> <span
style="margin-left: 13px;">Master</span></a>
<ul class="dropdown-menu dropdown_style">
<li *ngIf="this.reportArray[3].Rstatus == true" class="dropdown_style" (click)="modelMaster('admin')"
style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;">
<a>{{'Model Master' | translate}}</a>
</li>
<li *ngIf="this.reportArray[5].Rstatus == true" class="dropdown_style" (click)="RTOMaster('admin')"
style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;">
<a>{{'RTO Master' | translate}}</a>
</li>
</ul>
</li>
<!-- <a *ngIf="superAdmin" class="dropdown-item"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
(click)="modelMaster('admin')">{{'Model Master' | translate}}</a> -->
<a *ngIf="superAdmin" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" (click)="subAdmin('admin')">{{'Subadmin' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin" (click)="gpsMaster('admin')">{{'System Logs' | translate}}</a>
<!-- <a class="dropdown-item"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
*ngIf="superAdmin" (click)="RTOMaster('admin')">{{'RTO Master' | translate}}</a> -->
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin" (click)="tutorialVideos('admin')">{{'Tutorial Videos' | translate}}</a>
<a class="dropdown-item"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
*ngIf="showIMEI" (click)="userFinder('admin')">{{'User Finder' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin" (click)="userMaster('admin')">{{'User Master' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin || custtype" (click)="VType('admin')">{{'Vehicle Type' | translate}}</a>
<!-- <a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin" (click)="censorDetail('admin')">{{'Sensor Details' | translate}}</a> -->
<!-- <a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" *ngIf="superAdmin || isOperator" (click)="commandQueue('admin')">{{'Comman Queue' | translate}}</a> -->
<!-- commanQueue -->
</div>
</li>
<li class="nav-item active hoverStyle" (click)="soon('soon')" style="cursor: pointer;padding-top: 5px;">
<i class="fas fa-home" style="color:white"></i>
<a class="nav-link" style="padding-top: 0px !important;padding-bottom: 10px !important;">{{'Dashboard' | translate}} <span
class="sr-only">(current)</span></a>
</li>
<li class="nav-item hoverStyle" style="cursor: pointer;padding-top: 5px;" (click)="group('group')">
<i class="fab fa-audible" style="color:white"></i>
<a class="nav-link" style="padding-top: 0px !important;padding-bottom: 10px !important;"> {{'Groups' | translate}}</a>
</li>
<li class="nav-item dropdown hoverStyle" style="cursor: pointer;padding-top: 5px;">
<!-- <i class="fas fa-home" ></i> -->
<div data-toggle="dropdown">
<i class="fas fa-car" style="color:white"></i>
<a class="nav-link dropdown-toggle" style="padding-top: 0px !important;padding-bottom: 10px !important;cursor: pointer;" id="navbarDropdown" role="button"
aria-haspopup="true" aria-expanded="false"> {{'Vehicles' | translate}}</a>
</div>
<div class="dropdown-menu dropdown_style" aria-labelledby="navbarDropdown">
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;;" (click)="devi('devi')">{{'Vehicle List' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;" (click)="reminder_list('devi')">{{'Maintenance Reminder' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;" (click)="vehicleExpense('routes')">{{'Vehicle Expense' | translate}}</a>
<a *ngIf="superAdmin || custtype" class="dropdown-item"style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"(click)="deviceRenew('admin')">{{'Vehicle Renewal Report' | translate}}</a>
<a *ngIf="superAdmin || custtype" class="dropdown-item"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;"
(click)="deviceInventory()">{{'Device Inventory' | translate}}</a>
</div>
</li>
<li class="nav-item dropdown hoverStyle" style="text-align: center;padding-top: 5px;cursor: pointer;">
<!-- <i class="fas fa-home" style="color:white"></i> -->
<div data-toggle="dropdown">
<i class="fas fa-road" style="color:white"></i>
<a class="nav-link dropdown-toggle" style="padding-top: 0px !important;padding-bottom: 10px !important;cursor: pointer;"
id="navbarDropdown" role="button" aria-haspopup="true" aria-expanded="false">
{{'Tracking' | translate}}
</a>
</div>
<div class="dropdown-menu dropdown_style" aria-labelledby="navbarDropdown">
<a id="d" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;" class="dropdown-item" (click)="openNav('openNav')">{{'Live Tracking' | translate}}</a>
<a id="d" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;" class="dropdown-item" (click)="TrackingHistory('devi')">{{'History Tracking' | translate}}</a>
<!-- <a id="d" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;" class="dropdown-item" (click)="livetrack('devi')">{{'OpenMAp' | translate}}</a> -->
</div>
</li>
<li class="nav-item hoverStyle" style="cursor: pointer;padding-top: 5px;" (click)="geo('geo')">
<i class="fas fa-bullseye" style="color:white"></i>
<a class="nav-link" style="padding-top: 0px !important;padding-bottom: 10px !important"> {{'Geofencing' | translate}}</a>
</li>
<!-- <li class="nav-item dropdown hoverStyle" (click)="reports()" style="text-align: center;padding-top: 5px;cursor: pointer;">
<i class="fas fa-file" style="color:white"></i>
<a class="nav-link" style="padding-top: 0px !important;padding-bottom: 10px !important"> {{'Reports' |
translate}}</a>
</li> -->
<li class="nav-item dropdown hoverStyle" style="text-align: center;padding-top: 5px;cursor: pointer;">
<!-- <i class="fas fa-home" style="color:white"></i> -->
<div data-toggle="dropdown">
<i class="fas fa-file" style="color:white"></i>
<a class="nav-link dropdown-toggle"
style="padding-top: 0px !important;padding-bottom: 10px !important;cursor: pointer;" id="navbarDropdown"
role="button" aria-haspopup="true" aria-expanded="false">
{{'Reports' | translate}}
</a>
</div>
<div class="dropdown-menu dropdown_style" aria-labelledby="navbarDropdown">
<a id="d" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;"
class="dropdown-item" (click)="reports()">{{'Reports' | translate}}</a>
<a id="d" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;"
class="dropdown-item" (click)="reportScedule()">{{'Schedule Report ' | translate}}</a>
<!-- <a id="d" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;" class="dropdown-item" (click)="livetrack('devi')">{{'OpenMAp' | translate}}</a> -->
</div>
</li>
<!-- <div data-toggle="dropdown">
<i class="fas fa-file" style="color:white"></i>
<a class="nav-link dropdown-toggle" style="padding-top: 0px !important;padding-bottom: 10px !important;cursor: pointer;" id="navbarDropdown" role="button" aria-haspopup="true" aria-expanded="false"> {{'Reports' |translate}} </a>
</div>
<div class="dropdown-menu dropdown_style" style="height: auto; overflow-y: auto;max-height: 600px;"
aria-labelledby="navbarDropdown">
<a *ngIf="this.reportArray[17].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="acReport('report')">{{'AC Reports' | translate}}</a>
<a *ngIf="this.reportArray[0].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="report('report')">{{'Daily Reports' | translate}}</a>
<a *ngIf="this.reportArray[0].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="daily_logs('report')">{{'Daily Logs' | translate}}</a>
<a *ngIf="this.reportArray[1].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="daywisereport()">{{'Daywise Reports' | translate}}</a>
<a *ngIf="this.reportArray[14].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="distance_report('report')">{{'Distance Reports' | translate}}</a>
<a *ngIf="this.reportArray[18].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="driverPerformance('report')">{{'Driver Performance Reports' | translate}}</a>
<a *ngIf="this.reportArray[9].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="geofancingReport('report')">{{'Geofencing Reports' | translate}}</a>
<a *ngIf="this.reportArray[4].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="idleReport('routes')">{{'IDLE Reports' | translate}}</a>
<a *ngIf="this.reportArray[13].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="ignition_report('report')">{{'Ignition Reports' | translate}}</a>
<a *ngIf="this.reportArray[21].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="loadUnload('report')">{{'Loading Unloading Trip' | translate}}</a>
<a *ngIf="this.reportArray[13].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;font-size: 14px;" (click)="notification('notification')">{{'Notification Center' | translate}}</a>
<a *ngIf="this.reportArray[10].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="overspeed('report')">{{'Overspeeding Reports' | translate}}</a>
<a *ngIf="this.reportArray[15].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="POI_report('report')">{{'POI Reports' | translate}}</a>
<a *ngIf="this.reportArray[11].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="routeViolation('report')">{{'Route variations Reports' | translate}}</a>
<a *ngIf="this.reportArray[2].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="report_speed('report')">{{'Speed Variation' | translate}}</a>
<a *ngIf="this.reportArray[8].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="summaryReport('report')">{{'Summary Reports' | translate}}</a>
<a *ngIf="this.reportArray[12].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="stoppage_report('report')">{{'Stoppage Reports' | translate}}</a>
<a *ngIf="this.reportArray[16].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="SOS_report('report')">{{'SOS Reports' | translate}}</a>
<a *ngIf="this.reportArray[6].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="trip_report('report')">{{'Trip Reports' | translate}}</a>
<a *ngIf="this.reportArray[7].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="travelPath('report')">{{'Travel Path Reports' | translate}}</a>
<a *ngIf="this.reportArray[18].Rstatus == true" class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;
padding-bottom: 7px;
font-size: 14px;" (click)="workingHour('report')">{{'Working Hours Reports' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;" (click)="mainReport()">{{'Maintenance Reports' | translate}}</a>
</div> -->
<!-- </li> -->
<li class="nav-item dropdown hoverStyle" style="text-align: center" style="cursor: pointer;padding-top: 5px;">
<!-- <i class="fas fa-home" style="color:white"></i> -->
<div data-toggle="dropdown">
<i class="fas fa-map-marker-alt" style="color:white"></i>
<a class="nav-link dropdown-toggle" style="padding-top: 0px !important;padding-bottom: 10px !important" id="navbarDropdown"
role="button" aria-haspopup="true" aria-expanded="false">
{{'POI List' | translate}}
</a>
</div>
<div class="dropdown-menu dropdown_style" aria-labelledby="navbarDropdown" style="cursor: pointer;"
(click)="POIlist('routes')">
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px;padding-bottom: 7px;font-size: 14px;">{{'POI List' | translate}}</a>
</div>
</li>
<li class="nav-item dropdown hoverStyle" style="text-align: center;padding-top: 5px;cursor: pointer;">
<div data-toggle="dropdown">
<i class="fab fa-bandcamp" style="color:white"></i>
<a class="nav-link dropdown-toggle" style="padding-top: 0px !important;padding-bottom: 10px !important"
id="navbarDropdown" role="button" aria-haspopup="true" aria-expanded="false">
{{'Routes' | translate}} </a>
</div>
<div class="dropdown-menu dropdown_style" aria-labelledby="navbarDropdown">
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;" (click)="vehicleRoute('routes')">{{'Route list' | translate}}</a>
<a class="dropdown-item" style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;" (click)="route_map('routes')">{{'Manage Trips' | translate}}</a>
<a class="dropdown-item"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;"
(click)="route_plan('route_plan')">{{'Route Plan' | translate}}</a>
<a class="dropdown-item"
style="cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; font-size: 14px;"
(click)="route_planReport('route_plan')">{{'Route Plan Report' | translate}}</a>
</div>
</li>
<li class="nav-item dropdown hoverStyle" style="text-align: center;padding-top: 5px;cursor: pointer;">
<div data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">
<!-- <i class="fab fa-bandcamp" style="color:white"></i> -->
<!-- <i class="fa fa-border-all" ></i> -->
<i class="fab fa-accusoft" style="color:white"></i>
<a class="nav-link dropdown-toggle" style="padding-top: 0px !important;padding-bottom: 10px !important" id="navbarDropdown" role="button" aria-haspopup="true" aria-expanded="false"> {{'Sensor' | translate}} </a>
</div>
<!-- <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> <span class="nav-label">Services</span> <span class="caret"></span></a> -->
<ul class="dropdown-menu" style="padding: 0;">
<li class="dropdown-submenu dropdown_style">
<a class="nav-link dropdown-toggle" style="width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> Fuel</a>
<ul class="dropdown-menu dropdown_style" >
<li *ngIf="this.reportArray[3].Rstatus == true" class="dropdown_style" (click)="fuel_report('routes')" style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;"><a >{{'Fuel Chart' | translate}}</a></li>
<li *ngIf="this.reportArray[5].Rstatus == true" class="dropdown_style" (click)="dev_fuel_report()" style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;"><a >{{'Consumption Reports' | translate}}</a></li>
<li *ngIf="this.reportArray[5].Rstatus == true" class="dropdown_style" (click)="fuel_report1()"
style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;">
<a>{{'Fuel Reports' | translate}}</a></li>
<li class="dropdown_style" style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;" *ngIf="superAdmin || custtype" (click)="VType('admin')"><a >Fuel Calibration</a></li>
<li class="dropdown_style" (click)="fuelPrice('admin')" style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;" ><a >Fuel Price</a></li>
</ul>
</li>
<li class="dropdown-submenu dropdown_style">
<a class="nav-link dropdown-toggle" style="width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> Temperature</a>
<ul class="dropdown-menu dropdown_style" >
<li class="dropdown_style" style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;" (click)="censorDetail('admin')"><a>Temperature Chart</a></li>
<li class="dropdown_style" style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;" (click)="tempDetal('admin')"><a>Temperature Report</a></li>
<li class="dropdown_style" style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;" *ngIf="superAdmin || custtype" (click)="VType('admin')"><a>Calibration</a></li>
</ul>
</li>
<li class="dropdown-submenu dropdown_style">
<a class="nav-link dropdown-toggle" style="width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> RFID</a>
<ul class="dropdown-menu dropdown_style" >
<li class="dropdown_style" style="padding-left: 5px;width: 100% !important;cursor: pointer;border-bottom: 1px solid;padding-top: 7px; padding-bottom: 7px; padding-right: 20px;font-size: 14px;"><a>Rfid Report</a></li>
</ul>
</li>
</ul>
</li>
<li *ngIf="(useridd == '59cbbdbe508f164aa2fef3d8')" class="nav-item hoverStyle" (click)="toll()"
style="cursor: pointer;padding-top: 5px;">
<!-- <i class="fas fa-home" style="color:white"></i> -->
<i class="fa fa-building" style="color:white"></i>
<a class="nav-link" style="padding-top: 0px !important;padding-bottom: 10px !important;"> {{'Toll' |
translate}}</a>
</li>
<li *ngIf="isOrganisation" class="nav-item hoverStyle" (click)="adddistributers()" style="cursor: pointer;padding-top: 5px;">
<!-- <i class="fas fa-home" style="color:white"></i> -->
<i class="fas fa-user-lock" style="color:white"></i>
<a class="nav-link" style="padding-top: 0px !important;padding-bottom: 10px !important;"> {{'Distributors' | translate}}</a>
</li>
<li *ngIf="superAdmin" class="nav-item hoverStyle" (click)="dealerInfo('dealerInfo')" style="cursor: pointer;padding-top: 5px;">
<!-- <i class="fas fa-home" style="color:white"></i> -->
<!-- <i class="fas fa-users" style="color:white"></i> -->
<i class="fas fa-user" style="color:white"></i>
<a class="nav-link" style="padding-top: 0px !important;padding-bottom: 10px !important;"> {{'Dealers' | translate}}</a>
</li>
<li class="nav-item hoverStyle" *ngIf="cust || superAdmin" (click)="addcus('addcus')" style="cursor: pointer;padding-top: 5px;">
<i class="fas fa-users" style="color:white"></i>
<a class="nav-link" style="padding-top: 0px !important;padding-bottom: 10px !important;"> {{'Customers' | translate}}</a>
</li>
<!-- <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true"> <span class="nav-label">Services</span> <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Service A</a></li>
<li><a href="#">Service B</a></li>
<li class="dropdown-submenu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <span class="nav-label">Service C</span><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Service C1</a></li>
<li><a href="#">Service C2</a></li>
<li><a href="#">Service C3</a></li>
<li><a href="#">Service C4</a></li>
<li><a href="#">Service C5</a></li>
</ul>
</li>
</ul>
</li> -->
</ul>
</div>
</div>
<div style=" float: left; padding-top: 10px; ">
<p style="margin-top: 0px;margin-bottom:0 ;color: white;margin-left: 20px;border-radius: 20px;background: #fff;color: #212529; font-size: 14px;padding: 0px 5px;font-weight: 600;">{{fs}}</p>
</div>
<div style="width: 80px; float: right;">
<md-menu #appMenu="mdMenu" [overlapTrigger]="false">
<div class="row" style="margin: 0; margin-bottom: 10px;">
<div class="col-3" style="padding: 0;">
<div style="text-align: center;">
<img *ngIf="!ppSHOW" src="../../assets/userAccount.png" alt="UserImage" height="60" style="width: 100%;">
<img *ngIf="ppSHOW" style="border-radius: 50%;" src="{{profilePic}}" alt="UserImage" height="60" width="60" crossorigin="anonymous">
</div>
</div>
<div class="col-9" style="padding-left: 10px !important;font-size: 18px;font-weight: 400;">
<div><span>{{fs}}</span><span style="padding-left: 5px;">{{ls}}</span></div>
<p style="margin-bottom: 0;">{{mb}}</p>
<div *ngIf = "availaPointsFlag === true" title="Available Points" style="font-size: 15px;">
<span > <i class="fas fa-coins" style="color: #cf6b05;font-size: 18px;"></i></span>
<span style="margin-left: 15px;font-weight: 600;color: #656565;">{{pointCount}}</span>
</div>
<p >{{or}}</p>
</div>
</div>
<div class="row" style="margin: 0;">
<div class="col-6" >
<button type="reset" md-raised-button class="btn btn-default" style="background: #e2e2e2;" (click)="myaccount('myaccount')">{{'My Account' | translate}}</button>
</div>
<div class="col-6" >
<button *ngIf="dealer" md-raised-button class="w3-button w3-red" (click)="mydealer('mydealer')">{{'Dealer Account' | translate}}</button>
<button *ngIf="sup_admin" md-raised-button class="w3-button w3-red" (click)="super_Admin('mydealer')">{{'Admin Account' | translate}}</button>
<button *ngIf="logoutbut" md-raised-button class="btn btn btn-success" style="color:white" (click)="logout()">{{'Log Out' | translate}}</button>
</div>
</div>
</md-menu>
<button md-icon-button [mdMenuTriggerFor]="appMenu" style="float:right;outline:none;padding-top: 6px;">
<i class="fas fa-user" style=" color: white; font-size: 20px;"></i>
</button>
<app-notification></app-notification>
</div>
<!-- <ul fxShow fxHide.xs="true" fxHide.lt-md="true" fxHide.gt-sm="false" style="float:right;width:11%; margin-top: 3%;padding-left:0%">
<md-menu #appMenu="mdMenu" [overlapTrigger]="false">
<h5>&nbsp;&nbsp;{{fs}} {{ls}}&nbsp;&nbsp;</h5>
<h5>&nbsp;&nbsp;{{mb}}</h5>
<h5>&nbsp;&nbsp;{{or}}</h5>
<br> &nbsp;
<button type="reset" class="btn btn-default" (click)="myaccount('myaccount')">My Account</button>
&nbsp;
<button *ngIf="dealer" class="w3-button w3-red" (click)="mydealer('mydealer')">Dealer Account</button> &nbsp;
<button *ngIf="sup_admin" class="w3-button w3-red" (click)="super_Admin('mydealer')">Admin Account</button> &nbsp;
<button *ngIf="logoutbut" class="btn btn btn-success" (click)="logout()">&nbsp;&nbsp;&nbsp;Log
Out&nbsp;&nbsp;&nbsp;</button> &nbsp;
</md-menu>
<button md-icon-button [mdMenuTriggerFor]="appMenu" style="float:right;outline:none">
<img src="../../assets/image/us.jpg" height=24px>
</button>
<app-notification></app-notification>
</ul> -->
</div>
</nav>

View file

@ -0,0 +1,234 @@
.custom_style {
// position: fixed;
// top:0 ;
// left:0;
// right :0;
// background: #2D4262;
// padding-top: 0%;
// padding-bottom: 0%;
// line-height: 2.8;
// box-shadow: -1px 7px 7px -5px rgb(48, 68, 99);
// ================changed style==================
position: fixed;
background: #2d4262;
padding-top: 1%;
padding: 0;
width: 100%;
box-shadow: -1px 7px 7px -5px #304463;
}
.changePadding {
flex: 1;
text-align: center;
padding-left: 90px;
}
.changePadding1 {
flex: 1;
text-align: center;
padding-left: 15px;
}
.list_style {
margin-left: 100px;
ul {
li {
a {
color: white;
}
}
}
}
.dropdown_style {
// background: #b9b7b7 ;
// background: linear-gradient(to bottom, #2c3e50,#bdc3c7);
// background: #D42021;
background: #2d4262;
padding-top: 0;
padding-bottom: 0;
cursor: pointer;
a {
color: white;
}
}
.dropdown-menu > a:hover {
background-color: #2a3132;
background-image: none;
}
.hoverStyle:hover {
background-color: #2a3132;
background-image: none;
}
.nav-item > a:hover {
background-color: #2a3132;
}
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
background: rgb(153, 153, 153);
}
/* Handle */
::-webkit-scrollbar-thumb {
background: rgb(74, 118, 184);
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}
@media (max-width: 1540px) {
#navbarSupportedContent {
margin-left: 50px;
}
}
@media (min-width: 1366px) {
#navbarSupportedContent {
margin-left: 50px;
}
}
@media (max-width: 1366px) {
.list_style {
font-size: 13px;
}
}
@media (max-width: 1366px) {
.changePadding {
padding-left: 0px;
}
.changePadding1 {
padding-left: 0px;
}
}
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
/* Track */
::-webkit-scrollbar-track {
background: rgb(143, 215, 255);
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #dadada;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}
#navbarSupportedContent {
margin-left: 100px;
}
@media (max-width: 1537px) {
#navbarSupportedContent {
margin-left: 0px;
}
}
@media (max-width: 1537px) {
.list_style {
font-size: 13px;
}
}
// @media (min-width:1366px){
// .list_style{
// font-size: 14px;
// }
// }
// @media (max-width:1476px){
// .list_style{
// font-size: 14px;
// }
// }
// 1366,1440
// .bg-light{
// background: #737373;
// }
// .bg-light :hover{
// background: #dbd4d4;
// }
// .navbar-nav > li > .dropdown-menu { background-color: #FF0000; }
// .dropdown-menu > .active > a,.dropdown-menu > .active > a:hover.dropdown-menu > .active > a:focus {color: #555555!important; background-color: #e7e7e7!important;}
li a.nav-link {
width: max-content !important;
// padding: 20px 5px !important;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu > .dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px;
-moz-border-radius: 0 6px 6px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover > .dropdown-menu {
display: block;
}
.dropdown-submenu > a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #ccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover > a:after {
border-left-color: #fff;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left > .dropdown-menu {
left: -100%;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-moz-border-radius: 6px 0 6px 6px;
border-radius: 6px 0 6px 6px;
}

View file

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AllMenusComponent } from './all-menus.component';
describe('AllMenusComponent', () => {
let component: AllMenusComponent;
let fixture: ComponentFixture<AllMenusComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AllMenusComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AllMenusComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,917 @@
// import { Component, OnInit } from '@angular/core';
// @Component({
// selector: 'app-all-menus',
// templateUrl: './all-menus.component.html',
// styleUrls: ['./all-menus.component.scss']
// })
// export class AllMenusComponent implements OnInit {
// constructor() { }
// ngOnInit() {
// }
// }
// import { Component, OnInit } from '@angular/core';
// @Component({
// selector: 'app-poi-menu',
// templateUrl: './poi-menu.component.html',
// styleUrls: ['./poi-menu.component.scss']
// })
// export class PoiMenuComponent implements OnInit {
// constructor() { }
// ngOnInit() {
// }
// }
////////////////////////////
import { Component, OnInit, Input } from '@angular/core';
import { Params, Router, ActivatedRoute } from '@angular/router'
import { ContactService } from '../contact.service';
import { TranslateService } from 'ng2-translate';
import { MdDialog } from '@angular/material';
import { DemoVideosComponent } from '../const/demo-videos/demo-videos.component';
// import { PoiListComponent } from '../poi-list/poi-list.component';
// import { PoiDtlDelComponent } from "../poi-dtl-del/poi-dtl-del.component";
// import { MdDialog } from '@angular/material';
// import { Data } from '../data';
declare var google: any,$:any;
@Component({
selector: 'app-all-menus',
templateUrl: './all-menus.component.html',
styleUrls: ['./all-menus.component.scss']
})
export class AllMenusComponent implements OnInit {
//
marker1: any;
mapData: any[];
routePath: any;
before: any;
logoutbut: boolean;
cust: boolean = false;
logo: any;
text: any;
fs: any; ls: any; emailid: any; or: any; useridd: any; mb: any; custtype: any; dealer: any;
showImage: any;
groups = [];
group_info: any;
deviceId: any;
device_update: any;
markerpoi: any;
superAdmin: any = false;
waypoints_path:any;
routeData:any;
cnt:any =0;
showIMEI=false
dbMap:any;
dbMapInit:any = false;
menuFlag:any ='';
isOperator: boolean = false;
isOrganisation: boolean = false;
reportPrefrecne: any;
paddingLeft:boolean=false
reportArray = [
{name:"Daily Report",Rstatus:true,Astatus:false,value:"daily_report"},
{name:"Daywise Report",Rstatus:true,Astatus:false,value:"daywise_report"},
{name:"Speed Variation",Rstatus:true,Astatus:false,value:"speed_variation"},
{name :"Fuel Report",Rstatus : true,Astatus:false,value:"fuel_report"},
{name :"Idle Report",Rstatus : true,Astatus:false,value:"idle_report"},
{name:"Fuel Consumption Report",Rstatus:true,Astatus:false,value:"fuel_consumption_report"},
{name:"Trip Report",Rstatus:true,Astatus:false,value:"trip_report"},
{name : "Travel Path Report",Rstatus : true,Astatus:false,value:"travel_path_report"},
{name : "Summary Report",Rstatus : true,Astatus:false,value:"summary_report"},
{name : "Geofence Report",Rstatus : true,Astatus:false,value:"geofence_report"},
{name : "Overspeed Report",Rstatus : true,Astatus:false,value:"overspeed_report"},
{name : "Route Violation Report",Rstatus : true,Astatus:false,value:"route_violation_report"},
{name : "Stoppage Report",Rstatus : true,Astatus:false,value:"stoppage_report"},
{name : "Ignition Report",Rstatus : true,Astatus:false,value:"ignition_report"},
{name : "Distance Report",Rstatus : true,Astatus:false,value:"distance_report"},
{name : "POI Report",Rstatus : true,Astatus:false,value:"poi_report"},
{name : "SOS Report",Rstatus : true,Astatus:false,value:"sos_report"},
{name : "AC Report",Rstatus : true,Astatus:false,value:"ac_report"},
{name : "Driver Performance Report",Rstatus : true,Astatus:false,value:"driver_performance_report"},
{name : "User Trip Report",Rstatus : true,Astatus:false,value:"user_trip_report"},
{name : "Alert Report",Rstatus : true,Astatus:false,value:"alert_report"} ,
{name : "Loading Unloading Trip",Rstatus : true,Astatus:false,value:"loading_unloading_trip"} ,
{name : "Working Hours Reports",Rstatus : true,Astatus:false,value:"working_hours_report"},
{name : "Maintenance Reports",Rstatus : true,Astatus:false,value:"maintanance_report"},
{name:"Daily Logs",Rstatus:true,Astatus:false,value:"daily_logs"},
{name : "Notification Center",Rstatus : true,Astatus:false,value:"notification_master"},
];
availaPointsFlag: boolean = false;
pointCount: number = 0;
adressTab: boolean=false;
phone: any;
// ,public dialog: MdDialog
constructor(public dialog: MdDialog,private router: Router, private route: ActivatedRoute, private contactService: ContactService,public translate: TranslateService) {
this.contactService.totalTicketCount.subscribe(totalTicketCount => {
// this.ticketCount = totalTicketCount
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
this.fs = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).fn;
this.phone=JSON.parse(window.atob(window.localStorage.token.split(".")[1])).phn;
this.ls = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).ln;
this.isOrganisation = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isOrganisation;
// console.log("jwtvalue",JSON.parse(window.atob(window.localStorage.token.split(".")[1])));
this.ngOnInit()
});
this.useridd = JSON.parse(window.atob(window.localStorage.token.split('.')[1]))._id;
if(this.useridd=="59cbbdbe508f164aa2fef3d8"){
this.showIMEI=true;
}
console.log("USEERRRR",this.useridd,'59cbbdbe508f164aa2fef3d8', this.showIMEI);
this.fs = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).fn;
this.ls = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).ln;
this.isOrganisation = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isOrganisation;
// console.log("jwtvalue",JSON.parse(window.atob(window.localStorage.token.split(".")[1])));
var routeID = localStorage.getItem('routeId')
// this.route.params.subscribe((params:Params)=>{
// let id= params['routePath._id'];
// this.getRouteData(routeID);
// });
}
link
menuWidth:any;
sup_admin:boolean;
isOrgnaisation:boolean=false;
ngOnInit() {
// console.log("Inside all app menu component---------------------------------------------");
// this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
if(localStorage.getItem('superadmin')=="ON"){
this.sup_admin = true;
this.logoutbut = false;
this.dealer = false;
}
this.logo = window.localStorage['logo'];
// this.text = window.localStorage['text'];
// window.localStorage['DataUpdate'] = 'Tthis.rue'
this.fs = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).fn;
this.ls = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).ln;
// this.emailid = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).email;
this.or = JSON.parse(window.atob(window.localStorage.token.split(".")[1]))._orgName;
this.superAdmin = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isSuperAdmin;
this.isOrganisation = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).isOrganisation;
this.mb = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).phn;
// // this.routePath = JSON.parse(localStorage.getItem('routeData'));
this.custtype = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isDealer;
this.isOperator = JSON.parse(window.atob(window.localStorage.token.split('.')[1])).isOperator;
this.reportPrefrecne = JSON.parse(window.atob(window.localStorage.token.split(".")[1])).report_preference;
let that = this;
if(this.reportPrefrecne !=undefined){
var tempReport = this.reportPrefrecne;
console.log(this.reportPrefrecne);
for(let dt in tempReport){
let arr = that.reportArray.filter(function(d){
return d.value == dt;
})
arr[0].Astatus = tempReport[dt]?tempReport[dt].Astatus:false;
arr[0].Rstatus = tempReport[dt]?tempReport[dt].Rstatus:false;
}
}
// console.log("this.reportPrefrecne=>",this.reportPrefrecne);
if (this.custtype == true) {
this.cust = true;
}
// let foods = [];
// if (this.mb.charAt(0) == "n") {
// this.mb = ' '
// }
if (window.localStorage['Custumer'] == 'ON') {
// this.logoutbut = true;
this.sup_admin =false;
this.dealer = true;
}else if(window.localStorage['superadmin']=='ON'){
this.logoutbut = false;
}
else {
this.logoutbut = true;
}
this.getLanguage()
this.menuFlag = this.contactService.menuReturnGet();
var chkProfilePic = localStorage.getItem('profilePic');
// console.log('chkProfilePic',chkProfilePic);
if(chkProfilePic == null){
this.getProfileImagePath();
}else{
this.ppSHOW = true;
this.profilePic = chkProfilePic ;
}
this.availaPointsFlag = false ;
if((this.custtype === true)||((this.superAdmin === true)&&(this.isOrganisation === false))){
// console.log("Inside FunctionCheckpoint");
this.availaPointsFlag = true ;
this.getPointAvailable(this.useridd);
}
this. checkPassword();
// if(this.useridd === '59cbbdbe508f164aa2fef3d8'){
// this.adressTab = true;
// }
$(document).on('click', '.dropdown-menu', function (e) {
e.stopPropagation();
});
// this.getLink()
}
getLink(){
// 9481773053'
console.log("PHONE_________-------",this.phone);
this.contactService.get('/pullData/getSetuLink?mobileNumber='+this.phone).subscribe((res:any)=>{
console.log(res);
if(res.link){
this.link=res.link
}
})
}
//2 menu dashboard
soon(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("const?_i=" + window.localStorage.token);
}
// 3 menu
group(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("group_view");
}
// 4 menu
devi(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("dashboard");
}
productSummary(id){
this.router.navigateByUrl("product-summary");
}
orderSummary(id){
this.router.navigateByUrl("orderSummary");
}
tempDetal(id){
this.router.navigateByUrl("device-report/temp_report");
}
//5 menu
openNav(id) {
this.contactService.menuReturnSet(id);
this.router.navigate(['/location'],{queryParams : {pageid : 'locationComponent'}});
}
//6 menu
geo(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("geofencing");
}
// 7 menu
report(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report");
}
daywisereport(){
this.router.navigateByUrl("device-report/daywise-report");
}
subAdmin(){
this.router.navigateByUrl("suAdmin");
}
modelMaster(){
this.router.navigateByUrl("ModelMaster");
}
vehicleExpense(id){
this.router.navigateByUrl("vehicleExpense");
}
temp_report(id){
this.router.navigateByUrl("device-report/tempGraph");
}
commandQueue(id){
this.router.navigateByUrl("commanQueue");
}
addressList(id){
this.router.navigateByUrl("addreessUpdate");
}
censorDetail(id){
this.router.navigateByUrl("censor");
}
fuelPrice(id){
console.log(id);
this.router.navigate(["/FuelPrice"]);
}
daily_logs(){
this.router.navigateByUrl("device-report/dailyLogs");
}
workingHour(id){
this.router.navigateByUrl("workhourReport");
}
reminder_list(id)
{
this.router.navigateByUrl("vehicle/reminder_service");
}
TrackingHistory(id){
// this.menuFlag = this.contactService.menuReturnSet(id);
// this.router.navigateByUrl("location/live-history");
this.contactService.menuReturnSet(id);
this.router.navigate(['/location'],{queryParams : {pageid : 'locationHistory'}});
}
dev_fuel_report(){
this.router.navigateByUrl("device-report/dev-fuel-report");
}
fuel_report1(){
this.router.navigateByUrl("device-report/fuel_report");
}
POI_report(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/POI_report");
}
SOS_report(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/devicesosReport");
}
//8
report_speed(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/device-speed-report");
}
//9
trip_report(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/trip_report");
//10
}
acReport(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/ac_report");
}
summaryReport(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/summary-report");
}
//11
geofancingReport(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/geofancing");
}
//12
travelPath(id){
// TravelPathReportComponent
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/travel_path");
}
messageUtility(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("messageUtility");
}
Rechange(id){
this.menuFlag = this.contactService.menuReturnSet(id);
// this.router.navigateByUrl("recharge");
}
billing(id){
this.router.navigateByUrl("billingDashboard");
}
overspeed(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/overspeed");
}
//13
routeViolation(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/routeViolation");
}
mainReport(){
this.router.navigateByUrl("maintananceReport");
}
idleReport(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/idle-report");
}
//14
stoppage_report(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/stoppage_report");
}
//15
ignition_report(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/ignition_report");
}
//16
distance_report(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/distance_report");
}
//17
alert_report(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/alert-report");
}
POIlist(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("POI_list");
}
userTrip(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/deviceTrip");
}
driverPerformance(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/Driver-performance");
}
//18
vehicleRoute(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("vehicleRoute");
}
//19
route_map(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("routeMapping");
}
route_plan(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("routePlan");
}
route_planReport(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("routePlanReportNew");
}
//20
addcus(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
localStorage.removeItem('mapLoad_ID')
this.router.navigateByUrl("add");
}
//21
Ddetail(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("driverdetail");
}
userMaster(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("userLogs");
}
cssupport(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("cus_support");
}
adddistributers(){
this.router.navigateByUrl("distributersList");
}
deviceMaster(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("deviceMaster");
}
deviceRenew(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("RenewReport");
}
deviceInventory(){
this.router.navigateByUrl("deviceInventory");
}
gpsMaster(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("gpsMaster");
}
technician(id){
this.router.navigateByUrl("technician");
}
jobCard(id)
{
this.router.navigateByUrl("JobCard");
}
cmdMaster(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("cmdMaster");
}
deviceEntry(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("deviceEntry");
}
deviceInventoryList(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("Inventorylist");
}
//22
poiMenu(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("poimenu");
}
//23
myaccount(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("accountSettings");
}
loadUnload(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("device-report/tripLoadUnload");
}
load_management(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("loadManagement");
}
// LR_Number(id){
// this.menuFlag = this.contactService.menuReturnSet(id);
// this.router.navigateByUrl("lrinput");
// }
fuel_report(id){
console.log(id);
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("fuel_Report");
}
//24
mydealer(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
localStorage.removeItem("in1");
window.localStorage['token'] = window.localStorage['Dealer_token'];
localStorage.removeItem('supAdminAcessToCust');
localStorage.removeItem('devices');
localStorage.removeItem('custId')
window.localStorage['DataUpdate'] = 'True';
if (window.localStorage['DataLoaded'] = 'True') {
window.localStorage['Custumer'] = 'OFF';
localStorage.setItem('Dealer',"ON");
// this.dealer = false;
this.sup_admin =false;
this.logoutbut= true;
var chkPP = localStorage.getItem('profilePic');
if(chkPP != null){
localStorage.removeItem('profilePic');
}
this.router.navigateByUrl("add");
// this.router.navigateByUrl("const?_status="+"OK");
}
}
super_Admin(id){
this.menuFlag = this.contactService.menuReturnSet(id);
// localStorage.setItem('token',localStorage.getItem('superAdminToken'));
var tempsup = localStorage.getItem('superAdminToken');
localStorage.removeItem('supAdminAcessToCust');
localStorage.removeItem("in1");
if(tempsup == null){
// console.log("Inside if block");
this.sup_admin = false;
this.logoutbut= true;
}else{
window.localStorage['token'] = window.localStorage['superAdminToken'];
localStorage.removeItem('devices');
window.localStorage['DataUpdate'] = 'True';
if(window.localStorage['DataLoaded'] = 'True'){
// let dlrStatus = "true";
localStorage.setItem('superadmin',"OFF");
this.sup_admin =false;
this.logoutbut=true;
// localStorage.setItem("dlrchk",dlrStatus)
var chkPP = localStorage.getItem('profilePic');
if(chkPP != null){
localStorage.removeItem('profilePic');
}
this.router.navigateByUrl("dealerInfo");
// this.router.navigateByUrl("const?_status="+"OK");
}
}
}
//25
notification(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("notifications");
}
DModel(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("deviceModel");
}
VType(id) {
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("VehicleType");
}
dealerInfo(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigateByUrl("dealerInfo");
}
logout() {
window.localStorage.clear();
this.router.navigateByUrl("login");
}
goback() {
this.router.navigateByUrl("vehicleRoute");
}
new() {
this.router.navigateByUrl("new");
}
checkPassword(){
this.contactService.getImagePath(this.useridd).subscribe((res:any)=>{
if(localStorage.getItem('currentpwd') && localStorage.getItem('currentuser')){
if(res._id==localStorage.getItem('currentuser')){
if(localStorage.getItem('currentpwd')!=res.pass){
if(localStorage.getItem('currentpwd')!='XIt8UXhmjW'){
this.logout()
}
}
}
// pass
}else{
this.logout()
}
})
}
ppSHOW:boolean = false;
profilePic = '';
getProfileImagePath(){
// console.log('check profile pic function');
this.contactService.getImagePath(this.useridd).subscribe((res:any)=>{
// console.log(res);
if(res.imageDoc.length != 0){
var str = res.imageDoc[0]
var splitStr = str.split('/');
// console.log(splitStr);
var concatStr ='';
for(var i=1 ; i< splitStr.length ; i++){
if(i > 0){
var tt = splitStr[i];
concatStr += '/'+tt ;
}
}
// console.log(concatStr);
this.ppSHOW = true;
this.profilePic = 'https://www.oneqlik.in' + concatStr;
localStorage.setItem('profilePic',this.profilePic)
localStorage.setItem('org',JSON.stringify(res.organisation))
}else{
this.ppSHOW = false ;
}
})
}
cond: Boolean = false;
point: any = 0;
aa() {
if (this.point == 0) {
this.cond = true;
this.point++;
}
else if (this.point % 2 == 0) {
this.cond = true;
this.point++;
}
else {
this.cond = false
this.point++;
}
}
selectedlanguage:any;
classVar:any = 'defaultClass';
classVarDashboard:any = 'styleDefaultDashboard';
getLanguage(){
// var Var = { uid: this.useridd };
// this.contactService.getLanguages(Var).subscribe(res=>{
this.selectedlanguage = localStorage.getItem('appLang');
if(this.selectedlanguage != undefined){
if(this.selectedlanguage=='newLan2'){
this.paddingLeft=true
}else{
this.paddingLeft=false
}
this.translate.setDefaultLang(this.selectedlanguage);
this.translate.use(this.selectedlanguage);
// localStorage.setItem('appLang',this.selectedlanguage);
if(this.selectedlanguage != 'en'){
this.classVar = 'changedclass';
this.classVarDashboard = 'stylechangedDashboard';
}
if(this.selectedlanguage == 'en'){
this.classVar = 'defaultClass';
this.classVarDashboard = 'styleDefaultDashboard';
}
}else{
this.translate.setDefaultLang('en');
localStorage.setItem('appLang','en');
this.translate.use('en');
this.classVar = 'defaultClass';
this.classVarDashboard = 'styleDefaultDashboard';
}
// },err=>{
// console.log(err);
// })
}
dataArrayCoords: any;
currentLatitude: any;
currentLongitude: any;
marker: any;
livetrack(id){
this.router.navigateByUrl("live");
}
getPointAvailable(distId){
var distPoint = '0';
this.contactService.getAvialblePoints(distId,distPoint).subscribe(res=>{
// console.log(res.available_points);
this.pointCount =res.available_points?res.available_points: 0 ;
})
}
tutorialVideos(){
let dialogRef = this.dialog.open(DemoVideosComponent, {
// width: '903px',
// data: { Type: type, dataset: datasets }
panelClass: 'custom-dialog-container'
});
dialogRef.afterClosed().subscribe(result => {
if (result == "OKK") {
}
else if (result == "No_Dev") {
}
});
}
reports(){
this.router.navigate(['/reports/start'])
}
reportScedule(){
this.router.navigate(['/report-schedule'])
}
imeiFind(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigate(["/IEMI_Finder"]);
}
userFinder(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigate(["/USER_Finder"]);
}
issueList(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigate(["/issueList"]);
}
RTOMaster(id){
this.menuFlag = this.contactService.menuReturnSet(id);
this.router.navigate(["/RTO_Master"]);
}
deviceList(){
this.router.navigate(['/deviceList'])
}
inActiveAdmins(){
this.router.navigate(['/inactiveAdmins'])
}
toll(){
this.router.navigate(['/toll'])
}
}

124
src/app/app.component.css Normal file
View file

@ -0,0 +1,124 @@
::-webkit-scrollbar {
display: none;
}
body::-webkit-scrollbar {
display: none;
}
menu */
.navigation {
width: 300px;
}
/* reset our lists to remove bullet points and padding */
.mainmenu, .submenu {
list-style: none;
padding: 0;
margin: 0;
}
/* make ALL links (main and submenu) have padding and background color */
.mainmenu a {
display: block;
background-color: #CCC;
text-decoration: none;
padding: 10px;
color: #000;
}
/* add hover behaviour */
.mainmenu a:hover {
background-color: #C5C5C5;
}
/* when hovering over a .mainmenu item,
display the submenu inside it.
we're changing the submenu's max-height from 0 to 200px;
*/
.mainmenu li:hover .submenu {
display: block;
max-height: 200px;
}
/*
we now overwrite the background-color for .submenu links only.
CSS reads down the page, so code at the bottom will overwrite the code at the top.
*/
.submenu a {
background-color: #999;
}
/* hover behaviour for links inside .submenu */
.submenu a:hover {
background-color: #666;
}
/* this is the initial state of all submenus.
we set it to max-height: 0, and hide the overflowed content.
*/
.submenu {
overflow: hidden;
max-height: 0;
-webkit-transition: all 0.5s ease-out;
}
body{
height:100%; width:100%;
}
::-webkit-scrollbar {
display: none;
}
ul, li {
list-style: none;
float: left;
line-height: 15vh;
}
footer {
background:#FAFAFA;
bottom: 0;
width: 100%;
/* height: 50px;
padding: 20px; */
position: fixed;
opacity: 1.0;
filter: alpha(opacity=50);
text-align: center;
border-top:1px solid #ddd;
}
footer:hover{
opacity: 1.0;
filter: alpha(opacity=100);
}
.active-link{
border-bottom: 1px solid #1ba0c0;
font-weight: bold;
}
a:hover{
text-decoration: none;
color: #1ba0c0!important;
}
.main{
/* padding: 16px;
padding-right: 0%;
margin-top: 48px;
height: 89vh; */
}
header{
overflow: hidden;
background-color: #333;
position: fixed;
top: 0;
width: 100%;
}
.tableHeader{
background-color: #A2C523;
color : white;
}

129
src/app/app.component.html Normal file
View file

@ -0,0 +1,129 @@
<html>
<head>
</head>
<body>
<md-toolbar flex *ngIf="showNav" style="background-color:white;width: 100%;overflow: hidden;position: fixed; top: 0;z-index: 9;border-bottom:1px solid #ddd">
<img src={{this.logo}} routerLink="home" style="padding-top: 8px;cursor:pointer;border:none">
<ul fxHide.sm="true" fxHide.xs="true" style="width:33%;padding:30px 10% 0 0;float:right" fxLayout="row">
<p style="padding-top: 2%;
padding-left: 0%;">{{text}}</p>
</ul>
<ul fxShow fxHide.xs="false" fxHide.lg="true" fxHide.gt-sm="true" style="width:100%;padding-top: 18px;">
<!-- <li style="width:25%;">
<a style="font-size: 2.5vw; color: black;
padding: 4em 6em;" routerLink="signup">SignUp</a>
</li> -->
<li style="float:left;width:22%;padding-left:1.7em;">
<a color="blue" routerLink="login" style="font-size: 2.5vw;color: black;padding-left:2.3em">{{'Login' | translate}}</a>
</li>
<li style="float:right;width:40%;">
<button md-button [mdMenuTriggerFor]="menu" style="padding:0%;"><i class="material-icons">list</i></button>
<md-menu #menu="mdMenu">
<button md-menu-item routerLink="home">Home</button>
<button md-menu-item routerLink="support">Contact us</button>
<button md-menu-item routerLink="about-us">About us</button>
<button md-menu-item routerLink="services">Services</button>
</md-menu>
</li>
</ul>
<ul fxShow fxHide.xs="true" fxHide.lt-md="true" fxHide.gt-sm="false" style="float:right;width:50%; margin-top: 3%;">
<!-- <li style="width:12%;float:right">
<a style="font-size: 15px;color: black;padding: 10%;" routerLink="signup"
routerLinkActive="active-link">SignUp</a>
</li> -->
<li style="width:10%;float:right">
<a style="font-size: 15px;color: black;padding: 10%;" routerLink="login" routerLinkActive="active-link">Login</a>
</li>
<li style="width:12%;float:right;margin-right:34px">
<a style="font-size: 15px;color: black;padding: 10 19%;" routerLink="support"
routerLinkActive="active-link">Contact us</a>
</li>
<li style="float:right;width:15%">
<a color="blue" routerLink="about-us" style="font-size: 15px ;padding: 10 3%;color: black;"
routerLinkActive="active-link">About Us</a>
</li>
<li style="float:right;width:15%">
<a color="blue" routerLink="services" style="font-size: 15px;padding: 10 3%;color: black;"
routerLinkActive="active-link">Services</a>
</li>
<li style="float:right;width:10%">
<a color="blue" routerLink="home" style="font-size: 15px;padding: 10 3%;color: black;"
routerLinkActive="active-link">Home</a>
</li>
</ul>
</md-toolbar>
<!-- <div>
<md-toolbar flex style="background-color:white;width: 100%;position:fixed;z-index:10;" >
<img src="../../assets/image/a.jpg" routerLink="home"
style=
" /* padding-top: 8px; */width:20%;outline:none;">
<ul fxShow fxHide.gt-xs="false" style="padding: 10px 0px 0px 0px;margin:0px;" fxLayout="row" >
<li fxHide.xs="true" fxHide.gt-xs="false"style="line-height: unset;" >
<a routerLink="home" style="font-size: 1.5vw;color: black;padding: 0 10px;">Home</a>
</li>
<li fxHide.xs="true" fxHide.gt-xs="false" style="line-height: unset;" >
<a routerLink="community" style="font-size: 1.5vw;color: black;padding: 0 10px;
">Pricing</a>
</li>
<li fxHide.xs="true" fxHide.gt-xs="false"style="line-height: unset;" >
<a routerLink="support" style="font-size: 1.5vw; color: black;padding: 0 10px;
">Contact Us</a>
</li>
<li fxHide.xs="true" fxHide.gt-xs="false" style="line-height: unset;">
<a routerLink="login" style="font-size: 1.5vw; color: black;padding: 0 10px; ">Login</a>
</li>
<li fxHide.xs="true" fxHide.gt-xs="false" style="line-height: unset;">
<a routerLink="signup" style="font-size: 1.5vw; color: black; padding: 0 10px;
">SignUp</a>
</li>
</ul> -->
<!--
<ul fxShow fxHide.xs="false" fxHide.lg="true" fxHide.gt-sm="true" fxHide.gt-xs="true" style="
width: 50%;
display: block;
padding: 0px;
margin: 0px;"> -->
<!--for small screen -->
<!-- <li style="width: 22%;padding-left:0.7em;">
<a routerLink="signup" style="font-size: 2.5vw; color: black;" >SignUp</a>
</li>
<li style="
width: 15%;padding-left:1.5em;">
<a color="blue" routerLink="login" style="font-size: 2.5vw;color: black;padding-left: 2.3em;">Login</a>
</li>
<li style=" width: 15%;float:right;">
<button md-button md-icon-button [mdMenuTriggerFor]="appMenu"><i class="material-icons" style="padding:0%;">list</i></button>
<md-menu #appMenu="mdMenu" [overlapTrigger]="false" >
<button md-menu-item routerLink="home" >Home</button>
<button md-menu-item routerLink="community" >Contact Us</button>
<button md-menu-item routerLink="support">Pricing</button>
</md-menu></li>
</ul> -->
<!-- <ul fxShow fxHide.xs="true" fxHide.lt-md="true" fxHide.gt-sm="false" style="float:right;width:30%; margin-top: 3%;">
<li style="width:27%;float:right">
<a style="font-size: 1.5vw; color: black;padding: 10%;" routerLink="signup">SignUp</a>
</li>
<li style="float:right;width:25%">
<a color="blue" routerLink="login" style="font-size: 1.5vw;color: black;">Login</a>
</li>
</ul>
-->
<!-- <div class="main"> -->
<ng4-loading-spinner></ng4-loading-spinner>
<router-outlet></router-outlet>
<!-- </div> -->
</body>
</html>

View file

@ -0,0 +1,32 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
}));
});

163
src/app/app.component.ts Normal file
View file

@ -0,0 +1,163 @@
import { environment } from './../environments/environment';
import { Component, Inject } from '@angular/core';
import { RouterLinkActive } from '@angular/router';
import { Title } from '@angular/platform-browser';
import {ContactService} from './contact.service';
import{Http, Headers} from '@angular/http';
import 'rxjs/add/operator/map';
import { Observable } from 'rxjs/Observable';
import { Injectable } from '@angular/core';
import { TranslateService } from 'ng2-translate';
import { LoginComponent } from './login/login.component';
import { DOCUMENT } from '@angular/common';
@Injectable()
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
providers: [LoginComponent],
})
export class AppComponent {
userData:any;
url:any;
logo:any;
text:any;
address:any;
mobile:any;
dev_url = environment.hostUrl;
showMenu = environment.showLandingpageMenu;
headerfooterPadding:any;
margintop:any;
showNav: boolean;
constructor(private titleService: Title,private contactService: ContactService,private http: Http,public translate: TranslateService,public loginComp : LoginComponent){
console.log("showMenu=>",this.showMenu);
let split1 = document.URL.split('//')[1];
let split2 = split1.split('/')[0];
let splitForStyle = split1.split('/')[1];
this.url = split2;
// let split3 = document.URL.split('referrer_token')[1] || localStorage.getItem('referrer_token');
var decode_token = function(token){
var decodeToken = function(token){
return token ? (window.atob(token)):token;
}
var parseToken = function(token){
if(token && typeof(token)=='string'){
try {
return JSON.parse(token)
} catch (e) {
return "";
}
}
else
return "";
}
var getData = function(token){
return token ? {
"referer": decodeToken(token._referrer),
"username": decodeToken(token._u),
"pass": decodeToken(token._p)
} : null;
}
return getData(parseToken(decodeToken(token)));
}
let token = document.URL.split('referrer_token=')[1] || localStorage.getItem('referrer_token=');
console.log(token);
var split3 = decode_token(token) ;
console.log(split3);
if(split3 && split3.referer){
// var referrer_token = split3.substring(1);
// var referer_data = window.atob(referrer_token).split(",");
// var referer = referer_data[0].split("=")[1];
// var username = referer_data[1].split("=")[1];
// var password = referer_data[2].split("=")[1];
// console.log(referer);
// console.log(username);
// console.log(password);
// var r1 = referer.split('"')[0];
// var u1 = username.split('"')[0];
// var p1 = password.split('"')[0];
// console.log(r1);
// var reffere_obj = {
// user : username,
// pass : password
// }
localStorage.setItem('referer_obj',JSON.stringify(split3));
localStorage.setItem('referrer_token=',token);
var referer = split3['referer'];
this.contactService.getReferenceId(referer).subscribe(res=>{
// localStorage.setItem('referrer_token',split3);
this.loginComp.loginemail() ;
},err=>{
console.log(err);
})
}else{
for(var i = 0; i <this.showMenu.length;i++){
if (this.url == this.showMenu[i]) {
this.showNav = true;
return;
} else {
this.showNav = false;
}
}
this.contactService.dealerInfo(this.url).subscribe(
data => {
this.userData = data
this.logo = this.dev_url+this.userData.logo;
this.titleService.setTitle(this.userData.organisationName);
this.text=this.userData.text;
this.address = this.userData.address;
console.log("this.userData.email",this.userData.email);
// this.dealerId =
console.log("this.userData",this.userData);
window.localStorage['dealerName']= this.userData.dealerName;
window.localStorage['DealerID'] = this.userData.email;
window.localStorage['DealerPhone'] =this.userData.contactNumber;
window.localStorage['logo'] =this.logo;
window.localStorage['address'] =this.userData.address;
window.localStorage['text'] = this.text;
window.localStorage['mobile'] = this.userData.contactNumber;
window.localStorage['facebook'] = this.userData.facebook;
window.localStorage['android'] = this.userData.androidApp;
window.localStorage['iphone'] = this.userData.appleApp;
window.localStorage['organisationName'] = this.userData.organisationName;
if(window.localStorage[this.userData.dealerName]){
console.log("Dealer Name =>", this.userData.dealerName);
}
})
// translate.setDefaultLang('en');
// translate.use('en');
}
};
color:any;
fun1(value){
if(value=="signup"){
this.color='red';
// console.log(this.color);
}
}
ngOnDestroy() {
window.localStorage.clear();
}
}

635
src/app/app.module.ts Normal file
View file

@ -0,0 +1,635 @@
import { Ng2OrderModule } from 'ng2-order-pipe';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule , NO_ERRORS_SCHEMA } from '@angular/core';
import { AppComponent } from './app.component';
import { ModalModule, TimepickerModule } from 'ngx-bootstrap';
import {FlexLayoutModule} from "@angular/flex-layout";
import {NgxPaginationModule} from 'ngx-pagination';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {TranslateModule, TranslateStaticLoader, TranslateLoader} from 'ng2-translate/ng2-translate';
import { routes2 } from './dash/dash.router';
import { routes } from './app.router';
import {SoonComponent} from './soon/soon.component';
import { CommunityComponent } from './community/community.component';
import { LoginComponent } from './login/login.component';
import { SignupComponent } from './signup/signup.component';
import { SupportComponent } from './support/support.component';
import { HomeComponent } from './home/home.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
/* import { AuthService, AppGlobals } from 'angular2-google-login';
*/import { ReCaptchaModule } from 'angular2-recaptcha';
import {ResponseOptions, Response, Http} from '@angular/http';
import { HttpModule } from '@angular/http';
import { StormpathModule } from 'angular-stormpath';
import { AlertComponent } from './alert.component';
import { AlertService } from './alert.service';
import { NguiPopupModule } from '@ngui/popup';
import {GmapComponent} from './gmap/gmap.component';
import {LoginsucComponent} from './login_sucess/loginsuc.component';
/* import { AgmCoreModule } from 'angular2-google-maps/core'; */
import { Ng2DropdownModule } from 'ng2-material-dropdown';
import { DashComponent } from './dash/dash.component';
import { Data } from "./data";
import { Ng2CarouselamosModule } from 'ng2-carouselamos';
import { CarouselModule } from 'ngx-bootstrap';
import { ChartsModule } from 'ng2-charts';
import {CountDown} from "ng2-date-countdown";
import { SimpleTimer } from 'ng2-simple-timer';
import { MomentModule } from 'angular2-moment';
// import { AgmCoreModule } from '@agm/core';
/* import {GaugesModule} from 'ng-canvas-gauges/lib'; */
import { GaugeModule } from 'angular-gauge';
import { FlashMessagesModule } from 'angular2-flash-messages';
import { FormWizardModule } from 'angular2-wizard';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import { AccountComponent } from './account/account.component';
import {ProgressBarModule} from "ng2-progress-bar";
import { DashboardComponent } from './dashboard/dashboard.component';
import { DialogContentExampleDialogComponent } from './dialog-content-example-dialog/dialog-content-example-dialog.component';
import { GatewayComponent } from './gateway/gateway.component';
import { DragulaModule } from 'ng2-dragula';
// import { DatepickerModule } from 'angular2-material-datepicker'
import { ExpansionPanelsModule } from 'ng2-expansion-panels';
import {ResizableModule} from 'angular2-resizable';
import { DetailsComponent } from './details/details.component';
import { RuleComponent } from './rule/rule.component';
// import { ImageUploadModule } from "angular2-image-upload";
import { PasswordStrengthBarModule } from 'ng2-password-strength-bar';
import { ConstComponent } from './const/const.component';
import { MDBBootstrapModule } from 'angular-bootstrap-md';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
import { LocationComponent } from './location/location.component';
import { EditScheComponent } from './edit-sche/edit-sche.component';
import { DatepickerModule, BsDatepickerModule } from 'ngx-bootstrap/datepicker';
import { AngularDateTimePickerModule } from 'angular2-datetimepicker';
import {IfScrollbarsModule} from 'ng2-if-scrollbars';
// import { IonicApp, IonicModule } from 'ionic-angular';
import { LoaderServiceComponent } from './loader-service/loader-service.component';
import { GeofencingComponent } from './geofencing/geofencing.component';
import { GeofenceAddComponent } from './geofence-add/geofence-add.component';
import { GeofencingViewComponent } from './geofencing-view/geofencing-view.component';
import { GeofencingView2Component } from './geofencing-view2/geofencing-view2.component';
import { DeviceReportComponent } from './device-report/device-report.component';
import { DeviceEditComponent } from './dashboard/device-edit/device-edit.component';
import { DeviceSpeedReportComponent } from './device-report/device-speed-report/device-speed-report.component';
import { DeviceShareComponent } from './dashboard/device-share/device-share.component';
import { ShareUserComponent } from './dashboard/share-user/share-user.component';
import { DateTimePickerModule } from 'ng-pick-datetime';
import { SpeednotifyComponent } from './dashboard/speednotify/speednotify.component';
import { ShareLocComponent } from './location/share-loc/share-loc.component';
import { AddComponent } from './add/add.component';
import { ResetpwdComponent } from './resetpwd/resetpwd.component';
import { GetdevdetailComponent } from './const/getdevdetail/getdevdetail.component';
import { IdealReportComponent } from './device-report/ideal-report/ideal-report.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import {DatainjectionService} from './datainjection.service';
import {ContactService} from './contact.service';
import { NotificationComponent } from './notification/notification.component';
import { MyaccountComponent } from './myaccount/myaccount.component';
import { AddCustComponent } from './add-cust/add-cust.component';
import { IgnReportComponent } from './device-report/ign-report/ign-report.component';
import { SpecDevComponent } from './spec-dev/spec-dev.component';
//import {NgxPaginationModule} from 'ngx-pagination';
import {Ng2PaginationModule} from 'ng2-pagination';
import { AboutUsComponent } from './about-us/about-us.component';
import { ServicesComponent } from './services/services.component';
import { TripDetailsComponent } from './device-report/trip-details/trip-details.component';
import { SummaryReportComponent } from './device-report/summary-report/summary-report.component';
import {GeofancingReportComponent} from './device-report/geofancing-report/geofancing-report.component';
import { OverSpeedComponent } from './device-report/over-speed/over-speed.component';
import { RouteViolationComponent } from './device-report/route-violation/route-violation.component';
import { StoppageReportComponent } from './device-report/stoppage-report/stoppage-report.component';
import { IgnitionReportComponent } from './device-report/ignition-report/ignition-report.component';
import { DistanceReportComponent } from './device-report/distance-report/distance-report.component';
import { AlertReportComponent } from './device-report/alert-report/alert-report.component';
import { TripReportComponent } from './device-report/trip-report/trip-report.component';
import { GroupComponent } from './group/group.component';
import { AddGroupComponent } from './add-group/add-group.component';
import { DialogDemoComponent } from './dialog-demo/dialog-demo.component';
import { EditGroupComponent } from './edit-group/edit-group.component';
import { DeleteGroupComponent } from './delete-group/delete-group.component';
import { SidemenuFuelComponent } from './sidemenu-fuel/sidemenu-fuel.component';
import { VehicleRouteComponent } from './vehicle-route/vehicle-route.component';
import { RouteSetComponent } from './route-set/route-set.component';
import { ShowRouteComponent } from './show-route/show-route.component';
import { DealersInfoComponent } from './dealers-info/dealers-info.component';
import { RouteMappingComponent } from './route-mapping/route-mapping.component';
import { RouteMapAddComponent } from './route-map-add/route-map-add.component';
import { PointOfIntrestComponent } from './point-of-intrest/point-of-intrest.component';
import { RouteDeleteComponent } from './route-delete/route-delete.component';
import { AddDealerComponent } from './add-dealer/add-dealer.component';
import { NotificationMasterComponent } from './notification-master/notification-master.component';
import { EditCostumerComponent } from './edit-costumer/edit-costumer.component';
import { EditDealerComponent } from './edit-dealer/edit-dealer.component';
import { DriversPerformanceReportComponent } from './device-report/drivers-performance-report/drivers-performance-report.component';
import { TripHistoryComponent } from './trip-history/trip-history.component';
import { PoiListComponent } from './poi-list/poi-list.component';
import { ShowCaliberationComponent} from './show-caliberation/show-caliberation.component';
import {VehicleTypeComponent} from './vehicle-type/vehicle-type.component';
import { DriverDetailComponent } from './driver-detail/driver-detail.component';
import { DeviceModelComponent } from './device-model/device-model.component';
import { AddEditVehicleTypeComponent } from './add-edit-vehicle-type/add-edit-vehicle-type.component';
import { AddDriverComponent } from './add-driver/add-driver.component';
import { AddDeviceModelComponent } from './add-device-model/add-device-model.component';
import { MdButtonModule, MdCheckboxModule, MaterialModule,MdAutocompleteModule, MdDialogRef, MD_DIALOG_DATA } from '@angular/material';
import { EditRouteMapComponent } from './edit-route-map/edit-route-map.component';
import { POIdetailsComponent } from './poidetails/poidetails.component';
import { PoiDtlDelComponent } from './poi-dtl-del/poi-dtl-del.component';
import { AcReportComponent } from './device-report/ac-report/ac-report.component';
import { FuelReportComponent } from './device-report/fuel-report/fuel-report.component';
import { PoiMenuComponent } from './poi-menu/poi-menu.component';
import { AllMenusComponent } from './all-menus/all-menus.component';
import { LoadManagementComponent } from './load-management/load-management.component';
import { FuelReportGraphComponent } from './fuel-report-graph/fuel-report-graph.component';
import { EditVehicleTypeComponent } from './edit-vehicle-type/edit-vehicle-type.component';
import { Ng2SearchPipeModule } from 'ng2-search-filter';
import { UserMasterComponent } from './user-master/user-master.component';
import { DeviceComponent } from './device/device.component';
import { GpsMasterComponent } from './gps-master/gps-master.component';
import { CmdPacketMasterComponent } from './cmd-packet-master/cmd-packet-master.component';
import { EditDeviceMasterComponent } from './device/edit-device-master/edit-device-master.component';
import { GpsEditMasterComponent } from './gps-master/gps-edit-master/gps-edit-master.component';
import { POIReportComponent } from './device-report/poi-report/poi-report.component';
import { AddpoiBylocationComponent } from './addpoi-bylocation/addpoi-bylocation.component';
import { POIreportComponent } from './poireport/poireport.component';
import { LRNumberComponent } from './lr-number/lr-number.component';
import { DayWiseReportComponent } from './device-report/day-wise-report/day-wise-report.component';
import { DeviceFuelReportComponent } from './device-report/device-fuel-report/device-fuel-report.component';
import { SOSAlertComponent } from './sosalert/sosalert.component';
import { EditDeviceModelComponent } from './edit-device-model/edit-device-model.component';
import { PoiMasterEditComponent } from './poi-master-edit/poi-master-edit.component';
import { NotificationSettingComponent } from './notification-setting/notification-setting.component';
import { DeviceSOSreportComponent } from './device-report/device-sosreport/device-sosreport.component';
import { SearchFilterPipe } from './search-filter.pipe';
import { LiveHistoryComponent } from './location/live-history/live-history.component';
import { DeviceEntryComponent } from './device-entry/device-entry.component';
import { InventoryListComponent } from './inventory-list/inventory-list.component';
import { AcreportInfoComponent } from './device-report/ac-report/acreport-info/acreport-info.component';
import { GeneralSettingsComponent } from './dashboard/general-settings/general-settings.component';
import { DistributersListComponent } from './distributers-list/distributers-list.component';
import { AddDistributersComponent } from './add-distributers/add-distributers.component';
import { CostumerSupportComponent } from './costumer-support/costumer-support.component';
import { CreateTripComponent } from './location/create-trip/create-trip.component';
import { TripByDeviceComponent } from './device-report/trip-by-device/trip-by-device.component';
import { FuelObjectcomponentComponent } from './fuel-objectcomponent/fuel-objectcomponent.component';
import { TravelPathReportComponent } from './device-report/travel-path-report/travel-path-report.component';
import { ExpenseComponentComponent } from './device-report/trip-by-device/expense-component/expense-component.component';
import { ExpenselistComponent } from './device-report/trip-by-device/expenselist/expenselist.component';
import { ReportSettingComponent } from './add/report-setting/report-setting.component';
import { NormalCertComponent } from './device/normal-cert/normal-cert.component';
import { CertOptionComponent } from './device/cert-option/cert-option.component';
import { IdleReportComponent } from './device-report/idle-report/idle-report.component';
import { VehicleReminderComponent } from './vehicle-reminder/vehicle-reminder.component';
import { AddReminderComponent } from './vehicle-reminder/add-reminder/add-reminder.component';
import { ImmobilizeComponent } from './location/immobilize/immobilize.component';
import { ReportFilterComponent } from './device-report/report-filter/report-filter.component';
import { ResetPasswordComponent } from './add/reset-password/reset-password.component';
import { DealerPermissionComponent } from './dealers-info/dealer-permission/dealer-permission.component';
import { DashboardContentComponent } from './add/dashboard-content/dashboard-content.component';
import { SharedDevicesComponent } from './const/shared-devices/shared-devices.component';
import { DailyLogsComponent } from './device-report/daily-logs/daily-logs.component';
import { VehicleExpensesComponent } from './vehicle-expenses/vehicle-expenses.component';
import { AddVehicleExpensesComponent } from './vehicle-expenses/add-vehicle-expenses/add-vehicle-expenses.component';
import { VehicleExpenseDetailComponent } from './vehicle-expenses/vehicle-expense-detail/vehicle-expense-detail.component';
import { ProductSummaryComponent } from './product-summary/product-summary.component';
import { AddProductComponent } from './product-summary/add-product/add-product.component';
import { ProductShopComponent } from './product-shop/product-shop.component';
import { ProductOverviewComponent } from './product-shop/product-overview/product-overview.component';
import { PointShareComponent } from './point-share/point-share.component';
import { MessageUtilityComponent } from './message-utility/message-utility.component';
import { TripLoadUnloadComponent } from './device-report/trip-load-unload/trip-load-unload.component';
import { BuyNowComponent } from './product-shop/buy-now/buy-now.component';
import { BillingInfoComponent } from './product-shop/billing-info/billing-info.component';
import { OrderSummaryComponent } from './product-shop/order-summary/order-summary.component';
import { OrderDetailsComponent } from './product-shop/order-details/order-details.component';
import { DemoVideosComponent } from './const/demo-videos/demo-videos.component';
import { SafePipe } from './const/safe.pipe';
import { BillingDashboardComponent } from './billing-dashboard/billing-dashboard.component';
import { WorkingHourDetailComponent } from './device-report/working-hour-detail/working-hour-detail.component';
import { WorkingHourReportComponent } from './device-report/working-hour-report/working-hour-report.component';
import { AccountDetailComponent } from './account-detail/account-detail.component';
import { TempretureGraphComponent } from './device-report/tempreture-graph/tempreture-graph.component';
import { CensorDisplayComponent } from './censor-display/censor-display.component';
import { ManualAddressComponent } from './const/manual-address/manual-address.component';
import { AddressUpdateComponent } from './address-update/address-update.component';
import { CmdUIComponent } from './location/cmd-ui/cmd-ui.component';
import { CommanQueueComponent } from './comman-queue/comman-queue.component';
import { CommandWindowComponent } from './location/command-window/command-window.component';
import { AddDeviceComponent } from './location/add-device/add-device.component';
import { MaintananceComponent } from './device-report/maintanance/maintanance.component';
import { SubAminComponent } from './sub-amin/sub-amin.component';
import { AddsubadminComponent } from './sub-amin/addsubadmin/addsubadmin.component';
import { PlayTripComponent } from './play-trip/play-trip.component';
import { TempretureReportComponent } from './device-report/tempreture-report/tempreture-report.component';
import { CommentWindowComponent } from './comment-window/comment-window.component';
import { DetailComponent } from './device-report/distance-report/details/details.component';
import { DailyDetailsComponent } from './device-report/daily-details/daily-details.component';
import { AnnouncementComponent } from './const/announcement/announcement.component';
import { ReportModule } from './report/report.module';
import { ReportService } from './report/report.service';
import { DeviceRenewComponent } from './device-renew/device-renew.component';
import { ReportScheduleComponent } from './report-schedule/report-schedule.component';
import { DeviceListComponent } from './device-list/device-list.component';
import { TollComponent } from './toll/toll.component';
import { RenewalHistoryComponent } from './dashboard/renewal-history/renewal-history.component';
import { DeviceInventoryComponent } from './device-inventory/device-inventory.component';
import { SelectUntrackVehiclesComponent } from './geofencing/select-untrack-vehicles/select-untrack-vehicles.component';
import { IssueListComponent } from './issue-list/issue-list.component';
import { TechnicianComponent } from './technician/technician.component';
import { JobCardComponent } from './job-card/job-card.component';
import { AddJobCardComponent } from './job-card/add-job-card/add-job-card.component';
import { RechargeComponent } from './recharge/recharge.component';
import { AddPlanComponent } from './account-detail/add-plan/add-plan.component';
import { RenewVehicleComponent } from './dashboard/renew-vehicle/renew-vehicle.component';
import { RoutePlanComponent } from './route-plan/route-plan.component';
import { RoutPlanReportComponent } from './rout-plan-report/rout-plan-report.component';
import { ShowPullDataLinkComponent } from './add/show-pull-data-link/show-pull-data-link.component';
import { NewTempReportComponent } from './device-report/tempreture-report/new-temp-report/new-temp-report.component';
import { RouteListComponent } from './route-plan/route-list/route-list.component';
import { HualtListComponent } from './route-plan/hualt-list/hualt-list.component';
import { InactiveAdminComponent } from './inactive-admin/inactive-admin.component';
import { UserFinderComponent } from './user-finder/user-finder.component';
import { ShowVehiclesComponent } from './show-vehicles/show-vehicles.component';
import { ViewCustomerDetailsComponent } from './add/view-customer-details/view-customer-details.component';
import { OtpScreenComponent } from './add/otp-screen/otp-screen.component';
import { KycApprovalComponent } from './kyc-approval/kyc-approval.component';
import { FuelPriceComponent } from './fuel-price/fuel-price.component';
import { AddFuelPriceComponent } from './add-fuel-price/add-fuel-price.component';
import { ShoRoutePlanComponent } from './location/sho-route-plan/sho-route-plan.component';
import { EChalanComponent } from './dashboard/e-chalan/e-chalan.component';
import { TrackedVehiclesComponent } from './vehicle-route/tracked-vehicles/tracked-vehicles.component';
import { RtoMasterComponent } from './rto-master/rto-master.component';
import { DeviceKYCComponent } from './kyc-approval/device-kyc/device-kyc.component';
import { DeviceDocComponent } from './kyc-approval/device-doc/device-doc.component';
import { NewRoutePlanReportComponent } from './rout-plan-report/new-route-plan-report/new-route-plan-report.component';
import { ModelMasterComponent } from './model-master/model-master.component';
import { TrackedUntrackedVehiclesComponent } from './poireport/tracked-untracked-vehicles/tracked-untracked-vehicles.component';
import { NotificationForCCComponent } from './notification-for-cc/notification-for-cc.component';
import { AddNewDeviceComponent } from './dashboard/add-new-device/add-new-device.component';
import { ViewCertificateComponent } from './dashboard/view-certificate/view-certificate.component';
import { NewEditDeviceComponent } from './dashboard/new-edit-device/new-edit-device.component';
import { DownloadCertificateComponent } from './dashboard/download-certificate/download-certificate.component';
// import { DisatanceReportComponent } from './report/disatance-report/disatance-report.component';
// import { MainComponent } from './report/main/main.component';
// import { AcReportsComponent } from './report/ac-report/ac-report.component';
// import { LiveTrackingComponent } from './live-tracking/live-tracking.component';
// import { NgSelectModule } from '@ng-select/ng-select';
// import { EditDeviceMasterComponent } from './device/src/app/device/edit-device-master/edit-device-master.component';
// import { NgCircleProgressModule } from 'ng-circle-progress';
// import { NgCircleProgressModule } from 'ng-circle-progress';
/* const googleMapsCore = AgmCoreModule.forRoot({
apiKey : 'AIzaSyDZKxpYMfGSyStS3fLuVqHuM6ZEJWtF1-k',
}); */
/* const googleMapsCore = AgmCoreModule.forRoot({
apiKey : 'AIzaSyDZKxpYMfGSyStS3fLuVqHuM6ZEJWtF1-k',
}); */
export function createTranslateLoader(http: Http) {
return new TranslateStaticLoader(http, './assets/i18n', '.json');
}
@NgModule({
declarations: [
AppComponent,
CommunityComponent,
LoginComponent,
SignupComponent,
CountDown,
SupportComponent,
HomeComponent,
AlertComponent,
LoginsucComponent,
GmapComponent,
DashComponent,
SoonComponent,
AccountComponent,
DashboardComponent,
DialogContentExampleDialogComponent,
GatewayComponent,
DetailComponent,
RuleComponent,
ConstComponent,
LocationComponent,
EditScheComponent,
LoaderServiceComponent,
GeofencingComponent,
GeofenceAddComponent,
GeofancingReportComponent,
GeofencingViewComponent,
GeofencingView2Component,
DeviceReportComponent,
DeviceEditComponent,
DeviceSpeedReportComponent,
DeviceShareComponent,
ShareUserComponent,
SpeednotifyComponent,
ShareLocComponent,
AddComponent,
ResetpwdComponent,
GetdevdetailComponent,
IdealReportComponent,
SidebarComponent,
NotificationComponent,
MyaccountComponent,
AddCustComponent,
IgnReportComponent,
SpecDevComponent,
AboutUsComponent,
ServicesComponent,
TripDetailsComponent,
SummaryReportComponent,
GeofancingReportComponent,
OverSpeedComponent,
RouteViolationComponent,
StoppageReportComponent,
IgnitionReportComponent,
DistanceReportComponent,
AlertReportComponent,
TripReportComponent,
GroupComponent,
AddGroupComponent,
DialogDemoComponent,
EditGroupComponent,
DeleteGroupComponent,
AccountDetailComponent,
SidemenuFuelComponent,
VehicleRouteComponent,
RouteSetComponent,
ShowRouteComponent,
DealersInfoComponent,
RouteMappingComponent,
RouteMapAddComponent,
PointOfIntrestComponent,
RouteDeleteComponent,
AddDealerComponent,
NotificationMasterComponent,
EditCostumerComponent,
EditDealerComponent,
DriversPerformanceReportComponent,
TripHistoryComponent,
PoiListComponent,
ShowCaliberationComponent,
VehicleTypeComponent,
DriverDetailComponent,
DeviceModelComponent,
AddEditVehicleTypeComponent,
AddDriverComponent,
AddDeviceModelComponent,
EditRouteMapComponent,
POIdetailsComponent,
PoiDtlDelComponent,
AcReportComponent,
FuelReportComponent,
PoiMenuComponent,
AllMenusComponent,
LoadManagementComponent,
FuelReportGraphComponent,
EditVehicleTypeComponent,
UserMasterComponent,
DeviceComponent,
GpsMasterComponent,
CmdPacketMasterComponent,
EditDeviceMasterComponent,
GpsEditMasterComponent,
POIReportComponent,
AddpoiBylocationComponent,
POIreportComponent,
LRNumberComponent,
DayWiseReportComponent,
DeviceFuelReportComponent,
SOSAlertComponent,
EditDeviceModelComponent,
PoiMasterEditComponent,
NotificationSettingComponent,
DeviceSOSreportComponent,
SearchFilterPipe,
LiveHistoryComponent,
DeviceEntryComponent,
InventoryListComponent,
AcreportInfoComponent,
GeneralSettingsComponent,
DistributersListComponent,
AddDistributersComponent,
CostumerSupportComponent,
CreateTripComponent,
TripByDeviceComponent,
FuelObjectcomponentComponent,
TravelPathReportComponent,
ExpenseComponentComponent,
ExpenselistComponent,
ReportSettingComponent,
NormalCertComponent,
CertOptionComponent,
IdleReportComponent,
VehicleReminderComponent,
AddReminderComponent,
ImmobilizeComponent,
ReportFilterComponent,
ResetPasswordComponent,
DealerPermissionComponent,
DashboardContentComponent,
SharedDevicesComponent,
DailyLogsComponent,
VehicleExpensesComponent,
AddVehicleExpensesComponent,
VehicleExpenseDetailComponent,
ProductSummaryComponent,
AddProductComponent,
ProductShopComponent,
ProductOverviewComponent,
PointShareComponent,
MessageUtilityComponent,
TripLoadUnloadComponent,
BuyNowComponent,
BillingInfoComponent,
OrderSummaryComponent,
OrderDetailsComponent,
DemoVideosComponent,
SafePipe,
BillingDashboardComponent,
WorkingHourReportComponent,
WorkingHourDetailComponent,
TempretureGraphComponent,
CensorDisplayComponent,
ManualAddressComponent,
AddressUpdateComponent,
CmdUIComponent,
CommanQueueComponent,
CommandWindowComponent,
AddDeviceComponent,
MaintananceComponent,
SubAminComponent,
AddsubadminComponent,
PlayTripComponent,
TempretureReportComponent,
CommentWindowComponent,
DailyDetailsComponent,
DetailsComponent,
AnnouncementComponent,
DeviceRenewComponent,
ReportScheduleComponent,
DeviceListComponent,
TollComponent,
RenewalHistoryComponent,
DeviceInventoryComponent,
SelectUntrackVehiclesComponent,
IssueListComponent,
TechnicianComponent,
JobCardComponent,
AddJobCardComponent,
RechargeComponent,
AddPlanComponent,
RenewVehicleComponent,
RoutePlanComponent,
RoutPlanReportComponent,
ShowPullDataLinkComponent,
NewTempReportComponent,
RouteListComponent,
HualtListComponent,
InactiveAdminComponent,
UserFinderComponent,
ShowVehiclesComponent,
ViewCustomerDetailsComponent,
OtpScreenComponent,
KycApprovalComponent,
FuelPriceComponent,
AddFuelPriceComponent,
ShoRoutePlanComponent,
EChalanComponent,
TrackedVehiclesComponent,
RtoMasterComponent,
DeviceKYCComponent,
DeviceDocComponent,
NewRoutePlanReportComponent,
ModelMasterComponent,
TrackedUntrackedVehiclesComponent,
NotificationForCCComponent,
AddNewDeviceComponent,
ViewCertificateComponent,
NewEditDeviceComponent,
DownloadCertificateComponent,
// LiveTrackingComponent,
// MainComponent,
// DisatanceReportComponent,
// AcReportsComponent
],
imports: [
/*
AgmCoreModule.forRoot({
apiKey: 'AIzaSyDZKxpYMfGSyStS3fLuVqHuM6ZEJWtF1-k'
}), */
// NgCircleProgressModule.forRoot({
// // set defaults here
// radius: 100,
// outerStrokeWidth: 16,
// innerStrokeWidth: 8,
// outerStrokeColor: "#78C000",
// innerStrokeColor: "#C7E596",
// animationDuration: 300,
// }),
IfScrollbarsModule,
GaugeModule.forRoot(),
/* GaugesModule, */
DateTimePickerModule ,
AngularDateTimePickerModule,
BrowserModule,
NgbModule.forRoot(),
NgxPaginationModule,
MDBBootstrapModule.forRoot(),
BsDatepickerModule.forRoot(),
ExpansionPanelsModule,
routes2,
Ng2SearchPipeModule,
Ng2OrderModule,
MomentModule,
PasswordStrengthBarModule,
DatepickerModule,
DragulaModule,
routes,
ResizableModule,
ProgressBarModule,
FlashMessagesModule,
// NgSelectModule,
FormsModule,
ReactiveFormsModule,
ReCaptchaModule,
HttpModule,
StormpathModule,
NguiPopupModule,
/* googleMapsCore, */
Ng2DropdownModule,
BrowserAnimationsModule,
NoopAnimationsModule,
MdButtonModule,
MdCheckboxModule,
MdAutocompleteModule,
ChartsModule,
FlexLayoutModule,
MaterialModule,
TranslateModule.forRoot({
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [Http]
}),
FormWizardModule,BrowserModule, ChartsModule,
Ng2CarouselamosModule,
// GaugeModule.forRoot(),
CarouselModule.forRoot(),
TimepickerModule.forRoot(),
BsDatepickerModule.forRoot(),
ReportModule,
ModalModule.forRoot()
],
schemas: [ NO_ERRORS_SCHEMA ],
entryComponents:[PoiDtlDelComponent,EditDeviceMasterComponent,AcreportInfoComponent,GpsEditMasterComponent,RenewalHistoryComponent,PoiMenuComponent,ExpenseComponentComponent,
AddpoiBylocationComponent,CreateTripComponent,CommentWindowComponent,DetailComponent,DailyDetailsComponent,RenewVehicleComponent,ViewCustomerDetailsComponent,OtpScreenComponent,DeviceDocComponent,TrackedUntrackedVehiclesComponent,DownloadCertificateComponent,
AnnouncementComponent,SelectUntrackVehiclesComponent,ExpenselistComponent,AddPlanComponent,AddDriverComponent,ShowPullDataLinkComponent,HualtListComponent,ShoRoutePlanComponent,EChalanComponent,TrackedVehiclesComponent,ViewCertificateComponent,],
providers: [/* AuthService , */ AlertService, Data, SimpleTimer,DatainjectionService,ContactService,ReportService,
{ provide: MD_DIALOG_DATA, useValue: {} },
{ provide: MdDialogRef, useValue: {} }],
exports: [AllMenusComponent],
bootstrap: [AppComponent]
})
export class AppModule {
constructor(){
//for raw angular running on 4200
var a="http://localhost:3005";
//for built angular served by backend
//var a="";
}
}

565
src/app/app.router.ts Normal file
View file

@ -0,0 +1,565 @@
import { ServicesComponent } from './services/services.component';
import { AboutUsComponent } from './about-us/about-us.component';
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
// import { DetailsComponent } from './details/details.component';
import { RuleComponent } from './rule/rule.component';
import {AccountComponent} from './account/account.component';
import {DashComponent} from './dash/dash.component';
import { CommunityComponent } from './community/community.component';
import { LoginComponent } from './login/login.component';
import { SignupComponent } from './signup/signup.component';
import { SupportComponent } from './support/support.component';
import {GmapComponent} from './gmap/gmap.component';
import {SoonComponent} from './soon/soon.component';
import { GatewayComponent } from './gateway/gateway.component';
import { ConstComponent } from './const/const.component';
import { LocationComponent } from './location/location.component';
import { EditScheComponent } from './edit-sche/edit-sche.component';
import { GeofencingComponent } from './geofencing/geofencing.component';
import { GeofenceAddComponent } from './geofence-add/geofence-add.component';
import { GeofencingViewComponent } from './geofencing-view/geofencing-view.component';
import { GeofencingView2Component } from './geofencing-view2/geofencing-view2.component';
import { DeviceEditComponent } from './dashboard/device-edit/device-edit.component';
import { ResetpwdComponent } from './resetpwd/resetpwd.component';
import { GetdevdetailComponent } from './const/getdevdetail/getdevdetail.component';
import { MyaccountComponent } from './myaccount/myaccount.component';
import {DashboardComponent} from './dashboard/dashboard.component';
import {DialogContentExampleDialogComponent} from './dialog-content-example-dialog/dialog-content-example-dialog.component';
import { DeviceShareComponent } from './dashboard/device-share/device-share.component';
import { ShareUserComponent } from './dashboard/share-user/share-user.component';
import { SpeednotifyComponent } from './dashboard/speednotify/speednotify.component';
import { ShareLocComponent } from './location/share-loc/share-loc.component';
import { AddComponent } from './add/add.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { NotificationComponent } from './notification/notification.component';
import { AddCustComponent } from './add-cust/add-cust.component';
import { SpecDevComponent } from './spec-dev/spec-dev.component';
import { GroupComponent } from './group/group.component';
import { AddGroupComponent } from './add-group/add-group.component';
import { EditGroupComponent } from './edit-group/edit-group.component';
import { DeleteGroupComponent } from './delete-group/delete-group.component';
import { SidemenuFuelComponent } from './sidemenu-fuel/sidemenu-fuel.component';
import { VehicleRouteComponent } from './vehicle-route/vehicle-route.component';
import { RouteSetComponent } from './route-set/route-set.component';
import { ShowRouteComponent } from './show-route/show-route.component';
import { DealersInfoComponent } from './dealers-info/dealers-info.component';
import { RouteMappingComponent } from './route-mapping/route-mapping.component';
import { RouteMapAddComponent } from './route-map-add/route-map-add.component';
import { PointOfIntrestComponent } from './point-of-intrest/point-of-intrest.component';
import { RouteDeleteComponent } from './route-delete/route-delete.component';
import { AddDealerComponent } from './add-dealer/add-dealer.component';
import { NotificationMasterComponent } from './notification-master/notification-master.component';
import { EditCostumerComponent } from './edit-costumer/edit-costumer.component';
import { EditDealerComponent } from './edit-dealer/edit-dealer.component';
import { TripHistoryComponent } from './trip-history/trip-history.component';
import { PoiListComponent } from './poi-list/poi-list.component';
import { ShowCaliberationComponent} from './show-caliberation/show-caliberation.component';
import {VehicleTypeComponent} from './vehicle-type/vehicle-type.component';
import { DriverDetailComponent } from './driver-detail/driver-detail.component';
import { DeviceModelComponent } from './device-model/device-model.component';
import { AddEditVehicleTypeComponent } from './add-edit-vehicle-type/add-edit-vehicle-type.component';
import { AddDriverComponent } from './add-driver/add-driver.component';
import { AddDeviceModelComponent } from './add-device-model/add-device-model.component';
import { EditRouteMapComponent } from './edit-route-map/edit-route-map.component';
import { POIdetailsComponent } from './poidetails/poidetails.component';
import { PoiMenuComponent } from "./poi-menu/poi-menu.component";
import { LoadManagementComponent } from './load-management/load-management.component';
import { FuelReportGraphComponent } from './fuel-report-graph/fuel-report-graph.component';
import { EditVehicleTypeComponent } from './edit-vehicle-type/edit-vehicle-type.component';
import { UserMasterComponent } from './user-master/user-master.component'
import { DeviceComponent } from './device/device.component';
import { GpsMasterComponent } from './gps-master/gps-master.component';
import { CmdPacketMasterComponent } from './cmd-packet-master/cmd-packet-master.component';
import { POIreportComponent } from './poireport/poireport.component';
import { LRNumberComponent } from './lr-number/lr-number.component';
import { SOSAlertComponent } from './sosalert/sosalert.component';
import { HomeComponent } from './home/home.component';
import { EditDeviceModelComponent } from './edit-device-model/edit-device-model.component';
import { PoiMasterEditComponent } from './poi-master-edit/poi-master-edit.component';
import { NotificationSettingComponent } from './notification-setting/notification-setting.component';
import { LiveHistoryComponent } from './location/live-history/live-history.component';
import { DeviceEntryComponent } from './device-entry/device-entry.component';
import { InventoryListComponent } from './inventory-list/inventory-list.component';
import { GeneralSettingsComponent } from './dashboard/general-settings/general-settings.component';
import { DistributersListComponent } from './distributers-list/distributers-list.component';
import { AddDistributersComponent } from './add-distributers/add-distributers.component';
import { CostumerSupportComponent } from './costumer-support/costumer-support.component';
import { FuelObjectcomponentComponent } from './fuel-objectcomponent/fuel-objectcomponent.component';
import { ReportSettingComponent } from './add/report-setting/report-setting.component';
import { NormalCertComponent } from './device/normal-cert/normal-cert.component';
import { CertOptionComponent } from './device/cert-option/cert-option.component';
import { VehicleReminderComponent } from './vehicle-reminder/vehicle-reminder.component';
import { AddReminderComponent } from './vehicle-reminder/add-reminder/add-reminder.component';
import { ImmobilizeComponent } from './location/immobilize/immobilize.component';
import { ResetPasswordComponent } from './add/reset-password/reset-password.component';
import { DealerPermissionComponent } from './dealers-info/dealer-permission/dealer-permission.component';
import { DashboardContentComponent } from './add/dashboard-content/dashboard-content.component';
import { SharedDevicesComponent } from './const/shared-devices/shared-devices.component';
import { VehicleExpensesComponent } from './vehicle-expenses/vehicle-expenses.component';
import { AddVehicleExpensesComponent } from './vehicle-expenses/add-vehicle-expenses/add-vehicle-expenses.component';
import { VehicleExpenseDetailComponent } from './vehicle-expenses/vehicle-expense-detail/vehicle-expense-detail.component';
import { ProductSummaryComponent } from './product-summary/product-summary.component';
import { AddProductComponent } from './product-summary/add-product/add-product.component';
import { ProductShopComponent } from './product-shop/product-shop.component';
import { ProductOverviewComponent } from './product-shop/product-overview/product-overview.component';
import { PointShareComponent } from './point-share/point-share.component';
import { MessageUtilityComponent } from './message-utility/message-utility.component';
import { BuyNowComponent } from './product-shop/buy-now/buy-now.component';
import { BillingInfoComponent } from './product-shop/billing-info/billing-info.component';
import { OrderSummaryComponent } from './product-shop/order-summary/order-summary.component';
import { OrderDetailsComponent } from './product-shop/order-details/order-details.component';
import { DemoVideosComponent } from './const/demo-videos/demo-videos.component';
import { BillingDashboardComponent } from './billing-dashboard/billing-dashboard.component';
import { AccountDetailComponent } from './account-detail/account-detail.component';
import { CensorDisplayComponent } from './censor-display/censor-display.component';
import { ManualAddressComponent } from './const/manual-address/manual-address.component';
import { AddressUpdateComponent } from './address-update/address-update.component';
import { CmdUIComponent } from './location/cmd-ui/cmd-ui.component';
import { CommanQueueComponent } from './comman-queue/comman-queue.component';
import { CommandWindowComponent } from './location/command-window/command-window.component';
import { AddDeviceComponent } from './location/add-device/add-device.component';
import { SubAminComponent } from './sub-amin/sub-amin.component';
import { AddsubadminComponent } from './sub-amin/addsubadmin/addsubadmin.component';
import { PlayTripComponent } from './play-trip/play-trip.component';
import { DetailsComponent } from './details/details.component';
import { DisatanceReportComponent } from './report/report component/disatance-report/disatance-report.component';
import { MainComponent } from './report/main/main.component';
import { AcReportsComponent } from './report/report component/ac-report/ac-report.component';
import { DailyReportComponent } from './report/report component/daily-report/daily-report.component';
import { DailyLogssComponent } from './report/report component/daily-logs/daily-logs.component';
import { DayWiseReportComponent } from './report/report component/day-wise-report/day-wise-report.component';
import { GeofancingReportComponent } from './report/report component/geofancing-report/geofancing-report.component';
import { IdleReportComponent } from './report/report component/idle-report/idle-report.component';
import { IgnitionReportComponent } from './report/report component/ignition-report/ignition-report.component';
import { TripLoadUnloadComponent } from './report/report component/trip-load-unload/trip-load-unload.component';
import { OverSpeedComponent } from './report/report component/over-speed/over-speed.component';
import { POIReportComponent } from './report/report component/poi-report/poi-report.component';
import { RouteViolationComponent } from './report/report component/route-violation/route-violation.component';
import { DeviceSpeedReportComponent } from './report/report component/device-speed-report/device-speed-report.component';
import { SummaryReportComponent } from './report/report component/summary-report/summary-report.component';
import { StoppageReportComponent } from './report/report component/stoppage-report/stoppage-report.component';
import { DeviceSOSreportComponent } from './report/report component/device-sosreport/device-sosreport.component';
import { TripReportComponent } from './report/report component/trip-report/trip-report.component';
import { TravelPathReportComponent } from './report/report component/travel-path-report/travel-path-report.component';
import { WorkingHourReportComponent } from './report/report component/working-hour-report/working-hour-report.component';
import { MaintananceComponent } from './report/report component/maintanance/maintanance.component';
import { NotificationMastersComponent } from './report/report component/notification-master/notification-master.component';
import { DriversPerformanceReportComponent } from './report/report component/drivers-performance-report/drivers-performance-report.component';
import { DeviceRenewComponent } from './device-renew/device-renew.component';
import { ReportScheduleComponent } from './report-schedule/report-schedule.component';
import { DeviceFuelReportComponent } from './device-report/device-fuel-report/device-fuel-report.component';
import { NoReportComponent } from './report/report component/no-report/no-report.component';
import { StartComponent } from './report/report component/start/start.component';
import { TempretureReportComponent } from './device-report/tempreture-report/tempreture-report.component';
import { TempretureGraphComponent } from './device-report/tempreture-graph/tempreture-graph.component';
import { DeviceListComponent } from './device-list/device-list.component';
import { TollComponent } from './toll/toll.component';
import { NewTravelPathReportComponent } from './report/report component/new-travel-path-report/new-travel-path-report.component';
import { DeviceInventoryComponent } from './device-inventory/device-inventory.component';
import { IssueListComponent } from './issue-list/issue-list.component';
import { PushDataReportComponent } from './report/report component/push-data-report/push-data-report.component';
import { TechnicianComponent } from './technician/technician.component';
import { JobCardComponent } from './job-card/job-card.component';
import { AddJobCardComponent } from './job-card/add-job-card/add-job-card.component';
import { RechargeComponent } from './recharge/recharge.component';
import { RoutePlanComponent } from './route-plan/route-plan.component';
import { RoutPlanReportComponent } from './rout-plan-report/rout-plan-report.component';
import { RouteListComponent } from './route-plan/route-list/route-list.component';
import { InactiveAdminComponent } from './inactive-admin/inactive-admin.component';
import { UserFinderComponent } from './user-finder/user-finder.component';
import { ShowVehiclesComponent } from './show-vehicles/show-vehicles.component';
import { KycApprovalComponent } from './kyc-approval/kyc-approval.component';
import { FuelPriceComponent } from './fuel-price/fuel-price.component';
import { AddFuelPriceComponent } from './add-fuel-price/add-fuel-price.component';
import { RtoMasterComponent } from './rto-master/rto-master.component';
import { NewRoutePlanReportComponent } from './rout-plan-report/new-route-plan-report/new-route-plan-report.component';
import { ModelMasterComponent } from './model-master/model-master.component';
import { PerformanceReportComponent } from './report/report component/performance-report/performance-report.component';
import { NotificationForCCComponent } from './notification-for-cc/notification-for-cc.component';
import { AddNewDeviceComponent } from './dashboard/add-new-device/add-new-device.component';
// -----------------------------------------
// import { DriversPerformanceReportComponent } from './device-report/drivers-performance-report/drivers-performance-report.component';
// import { IdealReportComponent } from './device-report/ideal-report/ideal-report.component';
// import { DeviceSpeedReportComponent } from './device-report/device-speed-report/device-speed-report.component';
// import { IgnReportComponent } from './device-report/ign-report/ign-report.component';
// import { TripDetailsComponent } from './device-report/trip-details/trip-details.component';
// import { SummaryReportComponent } from './device-report/summary-report/summary-report.component';
// import { GeofancingReportComponent } from './device-report/geofancing-report/geofancing-report.component';
// import { OverSpeedComponent } from './device-report/over-speed/over-speed.component';
// import { RouteViolationComponent } from './device-report/route-violation/route-violation.component';
// import { StoppageReportComponent } from './device-report/stoppage-report/stoppage-report.component';
// import { IgnitionReportComponent } from './device-report/ignition-report/ignition-report.component';
// import { DistanceReportComponent } from './device-report/distance-report/distance-report.component';
// import { AlertReportComponent } from './device-report/alert-report/alert-report.component';
// import { TripReportComponent } from './device-report/trip-report/trip-report.component';
// import { POIReportComponent } from './device-report/poi-report/poi-report.component';
// import { DayWiseReportComponent } from './device-report/day-wise-report/day-wise-report.component';
// import { AcReportComponent } from './device-report/ac-report/ac-report.component';
import { FuelReportComponent } from './device-report/fuel-report/fuel-report.component';
import { NewEditDeviceComponent } from './dashboard/new-edit-device/new-edit-device.component';
// import { DeviceFuelReportComponent } from './device-report/device-fuel-report/device-fuel-report.component';
// import { DeviceSOSreportComponent } from './device-report/device-sosreport/device-sosreport.component';
// import { TripByDeviceComponent } from './device-report/trip-by-device/trip-by-device.component';
// import { IdleReportComponent } from './device-report/idle-report/idle-report.component';
// import { TravelPathReportComponent } from './device-report/travel-path-report/travel-path-report.component';
// import { ExpenseComponentComponent } from './device-report/trip-by-device/expense-component/expense-component.component';
// import { ExpenselistComponent } from './device-report/trip-by-device/expenselist/expenselist.component';
// import { WorkingHourReportComponent } from './device-report/working-hour-report/working-hour-report.component';
// import { ReportFilterComponent } from './device-report/report-filter/report-filter.component';
// import { TripLoadUnloadComponent } from './device-report/trip-load-unload/trip-load-unload.component';
// import { MaintananceComponent } from './device-report/maintanance/maintanance.component';
// import { WorkingHourDetailComponent } from './device-report/working-hour-detail/working-hour-detail.component';
// import { TempretureGraphComponent } from './device-report/tempreture-graph/tempreture-graph.component';
// import { TempretureReportComponent } from './device-report/tempreture-report/tempreture-report.component';
// import { DeviceReportComponent } from './device-report/device-report.component';
// import { DailyDetailsComponent } from './device-report/daily-details/daily-details.component';
export const router: Routes =[
{ path: '', redirectTo: 'login', pathMatch: 'full' },
{ path: 'community', component: CommunityComponent },
{ path: 'rule', component: RuleComponent },
{ path: 'login', component: LoginComponent },
{ path: 'home', component: HomeComponent },
{ path: 'signup', component: SignupComponent },
{ path: 'support', component: SupportComponent },
{ path: 'gmap', component: GmapComponent },
{ path: 'dash', component: DashComponent},
{ path: 'account', component: AccountComponent},
// {path: 'soon', component:SoonComponent},
{path: 'details', component:DetailsComponent},
{path: 'gateway', component:GatewayComponent},
{path: 'const', component:ConstComponent },
{path: 'location', component:LocationComponent},
{path : 'location/immobilize', component : ImmobilizeComponent},
{path: 'dashboard', component:DashboardComponent},
{path: 'dashboard/:id', component:DashboardComponent},
{path: 'edit-sche', component:EditScheComponent},
{path : 'device/certOptioon',component :CertOptionComponent},
{path: 'geofencing', component:GeofencingComponent},
{path : 'add/reset_password', component : ResetPasswordComponent},
{path: 'geofence-add', component:GeofenceAddComponent},
{path: 'geofencing-view', component: GeofencingViewComponent},
{path: 'geofencing-view2', component: GeofencingView2Component},
{path: 'add-device', component:DialogContentExampleDialogComponent},
{path: 'dashboard/device-edit', component:DeviceEditComponent},
{path: 'deealer/dealer_permission', component:DealerPermissionComponent},
{path: 'playTrip',component:PlayTripComponent},
{path : 'device/normal_cert', component : NormalCertComponent},
{path : 'add/report_sestting',component : ReportSettingComponent},
{path : 'add/dashboard_content', component : DashboardContentComponent},
// {path : 'device-report/dailyLogs',component : DailyLogsComponent},
{path: 'vehicleExpense',component : VehicleExpensesComponent},
{path :'addVehicleExpense', component : AddVehicleExpensesComponent},
{path : 'vehExpenseDetail', component : VehicleExpenseDetailComponent},
{path: 'dashboard/device-share', component:DeviceShareComponent},
{path : 'product-summary', component : ProductSummaryComponent},
{path :'product-summary/add_product',component: AddProductComponent},
{path : 'product-shop/product-overview', component : ProductOverviewComponent},
{path: 'dashboard/share-user', component:ShareUserComponent},
{path: 'dashboard/speednotify', component:SpeednotifyComponent},
{path: 'location/share-loc', component:ShareLocComponent},
{path: 'add', component:AddComponent},
{path : 'const/shared_devices',component : SharedDevicesComponent},
{path: 'resetpwd', component:ResetpwdComponent},
{path: 'const/getdevdetail', component:GetdevdetailComponent},
{path: 'sidebar', component:SidebarComponent},
{path: 'notification', component:NotificationComponent},
{path: 'myaccount', component:MyaccountComponent},
{path: 'add-cust',component:AddCustComponent},
{path: 'spec-dev', component:SpecDevComponent},
{path: 'about-us',component:AboutUsComponent},
{path: 'services',component:ServicesComponent},
{path:'device-details',component:DetailsComponent},
{path: 'location/live-history',component:LiveHistoryComponent},
{path:'vehicle/reminder_service',component:VehicleReminderComponent},
{path : "vehicle_reminder/add_reminder" , component:AddReminderComponent},
{path: 'productShop' , component : ProductShopComponent},
{path:'product-shop/buyProduct',component : BuyNowComponent},
{path :'product-shop/BillingInfo',component : BillingInfoComponent},
{path:"cmdWind",component:CommandWindowComponent},
{path : 'orderSummary',component : OrderSummaryComponent},
{path: 'orderDetail', component: OrderDetailsComponent},
{path : 'demoVideos', component : DemoVideosComponent},
{path: 'POI_list',component: POIreportComponent},
{path:'manualAddress',component : ManualAddressComponent},
{path :'add_device', component: AddDeviceComponent},
{path : 'CmdUIComponent',component:CmdUIComponent},
{path : 'addreessUpdate',component:AddressUpdateComponent},
{path: 'group_view',component: GroupComponent},
{path: 'addgroup',component: AddGroupComponent},
{path : 'sosalert', component: SOSAlertComponent},
{path: 'editgrp',component: EditGroupComponent},
{path: 'deleteGrp',component: DeleteGroupComponent},
{path : 'commanQueue',component: CommanQueueComponent},
{path: 'accountSettings',component: AccountDetailComponent},
{path: 'notifSettings',component: NotificationSettingComponent},
{path : 'PointShareComponent',component : PointShareComponent},
{path: 'messageUtility',component : MessageUtilityComponent},
{path: 'censor',component : CensorDisplayComponent},
// {path : 'live',component : LiveTrackingComponent},
{path: 'fuelComp',component: SidemenuFuelComponent},
{path: 'vehicleRoute',component: VehicleRouteComponent},
{path: 'setRoute',component: RouteSetComponent},
{path: 'viewRoute',component: ShowRouteComponent},
{path: 'dealerInfo',component: DealersInfoComponent},
{path: 'routeMapping',component: RouteMappingComponent},
{path: 'editrouteMap',component: EditRouteMapComponent},
{path : 'suAdmin', component : SubAminComponent},
{path: 'subAdmin/addSubAdmin',component:AddsubadminComponent},
{path: 'addRouteMap',component: RouteMapAddComponent},
{path: 'Point_Of_Intrest',component:PointOfIntrestComponent},
{path: 'POI_master_edit',component:PoiMasterEditComponent},
{path : 'cus_support', component : CostumerSupportComponent},
{path: 'routeDelete',component:RouteDeleteComponent},
{path: 'addDealer',component:AddDealerComponent},
{path: 'distributersList', component : DistributersListComponent},
{path : 'addDistributers', component : AddDistributersComponent},
{path: 'notifications',component:NotificationMasterComponent},
{path: 'edit-cust',component:EditCostumerComponent},
{path: 'edit-dealer',component:EditDealerComponent},
{path: 'tripHistory',component:TripHistoryComponent},
{path: 'fuelobj',component:FuelObjectcomponentComponent},
{path: 'poiList',component:PoiListComponent},
{path: 'loadManagement',component:LoadManagementComponent},
{path: 'lrinput',component:LRNumberComponent},
{path: 'showCaliberation',component:ShowCaliberationComponent},//----path
{path: 'VehicleType',component:VehicleTypeComponent},
{path: 'driverdetail',component:DriverDetailComponent},//path
{path: 'deviceModel',component:DeviceModelComponent},//path
{path: 'billingDashboard',component : BillingDashboardComponent},
{path : 'generalSetting', component : GeneralSettingsComponent},
{path: 'addEditVehicleType',component:AddEditVehicleTypeComponent},
{path: 'addDriver',component:AddDriverComponent},
{path: 'addDeviceModel',component:AddDeviceModelComponent},
{path: 'poilist',component:POIdetailsComponent},
{path: 'poimenu',component:PoiMenuComponent},
{path: 'fuel_Report',component:FuelReportGraphComponent},
{path: 'editVehicle_type',component:EditVehicleTypeComponent},
{path: 'editDeviceModel',component:EditDeviceModelComponent},
{path: 'userLogs',component:UserMasterComponent},
{path: 'deviceMaster',component:DeviceComponent},
{path: 'gpsMaster',component:GpsMasterComponent},
{path: 'cmdMaster',component:CmdPacketMasterComponent},
{path : 'deviceEntry', component : DeviceEntryComponent},
{path : 'Inventorylist', component : InventoryListComponent},
{path : 'RenewReport', component : DeviceRenewComponent},
{path : 'report-schedule', component : ReportScheduleComponent},
// --------------------OLD--------------------------/
// {path: 'device-report/tripsDetails',component:TripDetailsComponent},
// {path : 'device-report/tripexpense',component : ExpenseComponentComponent},
// {path: 'device-report/device-speed-report', component:DeviceSpeedReportComponent},
// {path:'daily-details',component:DailyDetailsComponent},
// {path: 'device-report', component:DeviceReportComponent},
// {path : 'device-report/expenseList',component : ExpenselistComponent},
// {path: 'device-report/ideal-report', component: IdealReportComponent },
// {path: 'device-report/ign-report', component:IgnReportComponent},
// {path : 'device-report/idle-report', component : IdleReportComponent},
// {path : 'workhourReport', component : WorkingHourReportComponent},
// {path : 'work_detail', component : WorkingHourDetailComponent},
// {path: 'device-report/devicesosReport',component:DeviceSOSreportComponent},
// {path: 'device-report/summary-report',component:SummaryReportComponent},
// {path: 'device-report/daywise-report',component:DayWiseReportComponent},
{path: 'device-report/dev-fuel-report',component:DeviceFuelReportComponent},
// {path: 'device-report/geofancing',component:GeofancingReportComponent},
// {path: 'device-report/overspeed',component: OverSpeedComponent},
// {path: 'device-report/routeViolation',component: RouteViolationComponent},
// {path: 'device-report/stoppage_report',component: StoppageReportComponent},
// {path: 'device-report/ignition_report',component: IgnitionReportComponent},
// {path: 'device-report/distance_report',component: DistanceReportComponent},
// {path: 'device-report/alert_report',component: AlertReportComponent},
// {path: 'device-report/trip_report',component: TripReportComponent},
// {path: 'device-report/POI_report',component: POIReportComponent},
// {path: 'device-report/deviceTrip',component: TripByDeviceComponent},
// {path: 'report_filter',component: ReportFilterComponent},
// {path: 'device-report/ac_report',component: AcReportComponent},
// {path: 'device-report/tripLoadUnload',component: TripLoadUnloadComponent},
// {path : 'device-report/travel_path' ,component : TravelPathReportComponent},
// // {path : 'device-report/ac_report/info',component:AcreportInfoComponent},
{path: 'device-report/fuel_report',component: FuelReportComponent},
{path : 'device-report/temp_report', component : TempretureReportComponent},
// {path: 'device-report/Driver-performance',component:DriversPerformanceReportComponent},
{path : 'device-report/tempGraph',component : TempretureGraphComponent},
// {path: 'maintananceReport',component: MaintananceComponent},
//--------------------------------
{path : 'deviceList',component : DeviceListComponent},
{path : 'toll',component : TollComponent},
{path : 'deviceInventory',component : DeviceInventoryComponent},
{path : 'technician',component : TechnicianComponent},
{path : 'JobCard',component : JobCardComponent},
{path : 'JobCardAdd',component : AddJobCardComponent},
{
path: 'reports',
component: MainComponent, // this is the component with the <router-outlet> in the template
// loadChildren: () => import('./report/report.module').then(m => m.ReportModule),
children: [
{
path: 'ac_report', // child route path
component: AcReportsComponent,
},
{
path: 'distance_report', // child route path
component: DisatanceReportComponent,
},
{
path: 'daily_report', // child route path
component: DailyReportComponent,
},
{
path: 'daily_logs',
component: DailyLogssComponent,
},
{
path: 'daywise_report',
component: DayWiseReportComponent,
},
{
path: 'geofence_report',
component: GeofancingReportComponent,
},
{
path: 'idle_report',
component: IdleReportComponent,
},
{
path: 'ignition_report',
component: IgnitionReportComponent,
},
{
path: 'loading_unloading_trip',
component: TripLoadUnloadComponent,
},
{
path: 'overspeed_report',
component: OverSpeedComponent,
},
{
path: 'poi_report',
component: POIReportComponent,
},
{
path: 'route_violation_report',
component: RouteViolationComponent,
},
{
path: 'speed_variation',
component: DeviceSpeedReportComponent,
},
{
path: 'summary_report',
component: SummaryReportComponent,
},
{
path: 'stoppage_report',
component: StoppageReportComponent,
},
{
path: 'sos_report',
component: DeviceSOSreportComponent,
},
{
path: 'trip_report',
component: TripReportComponent,
},
{
path: 'travel_path_report',
component: NewTravelPathReportComponent,
},
{
path: 'working_hours_report',
component: WorkingHourReportComponent,
},
{
path: 'maintanance_report',
component: MaintananceComponent,
},
{
path: 'notification_master',
component: NotificationMastersComponent,
},
{
path: 'driver_performance_report',
component: DriversPerformanceReportComponent,
},
{
path: 'no-report',
component: NoReportComponent,
},
{
path: 'start',
component: StartComponent,
},
{
path: 'dataPushReport',
component: PushDataReportComponent,
},
{path:"performanceReport",component:PerformanceReportComponent},
// AC_report','daily_report','daily_logs','dayWiseReport','distance_report','geofence_report','idle_report',
// 'ignition_report','loadunloadTrip','over_speed','poi_report','route_violation_report','speed_variation',
// 'summary_report','stoppage_report','device_sos_report',
// 'trip_report','travel_path-report','working_hours_report','maintanance_report'notification_master Driver_performance
],
},
{
path:'IEMI_Finder',component:SoonComponent
},
{
path:'USER_Finder',component:UserFinderComponent
},
{
path:'issueList',component:IssueListComponent
},
{
path:'recharge',component:RechargeComponent
},
{
path:'inactiveAdmins',component:InactiveAdminComponent
},
{
path:'routePlan',component:RouteListComponent
},
{
path:'addRoutePlan',component:RoutePlanComponent
},
{
path:'routePlanReport',component:RoutPlanReportComponent
},
{
path:'ViewVehicle',component:ShowVehiclesComponent
},
{
path:"add_newDevice",component:AddNewDeviceComponent
},
{path:'KycApproval',component:KycApprovalComponent},
{path:'NotificationForCC',component:NotificationForCCComponent},
{path:'FuelPrice',component:FuelPriceComponent},
{path:'addFuelPrice',component:AddFuelPriceComponent},
{path:'RTO_Master',component:RtoMasterComponent},
// {path:'routePlanReportNew',component:NewRoutePlanReportComponent},
{path:'routePlanReportNew',component:RoutPlanReportComponent},
{path:'ModelMaster',component:ModelMasterComponent},
{path:"editDevice",component:NewEditDeviceComponent},
{path: '**', redirectTo: 'login', pathMatch: 'full'},
];
export const routes: ModuleWithProviders = RouterModule.forRoot(router);

View file

@ -0,0 +1,46 @@
<app-all-menus></app-all-menus>
<div class="topDiv">
<div class="row" style="text-align: center; background: #426E86; padding-top: 10px; padding-bottom: 10px; color: white;box-shadow:3px 1px 5px 0px rgb(178, 176, 174)">
<div class="col-sm-12 col-md-12 col-lg-12">
<h4>{{'BILLING DETAIL' | translate}}</h4>
<div id="toast">
<div id="desc">{{data_descip}}</div>
</div>
</div>
</div>
<div class="row rowStyle">
<div class="col-sm-3 col-md-3 col-lg-3" style="padding-left: 20px; padding-right: 5px; padding-top: 5px; padding-bottom: 5px;">
<!-- <button style="background-color: #cc0000;color:#fdfdfd;font-size: 12px;" md-raised-button (click)="exportPdf()">{{'PDF' | translate}}</button> -->
<div class="row" style="margin:0px;height: 84vh;background: white;box-shadow: 3px 1px 5px 0px #b2b0ae;">
<div class="col-sm-12 col-md-12 col-lg-12" style="padding:0px">
<app-report-filter (onReportFIlter)= "getReport($event)" [componentIdentifier]="identifier"></app-report-filter>
</div>
</div>
</div>
<div class="col-sm-9 col-md-9 col-lg-9" style="padding-left: 5px; padding-right: 20px; padding-top: 5px;">
<div class="row" style="margin:0px;height: 84vh;padding-top:10px;padding-bottom:5px;background: white;box-shadow: 3px 1px 5px 0px #b2b0ae;">
<div class="col-sm-12 col-md-12 col-lg-12">
<div *ngIf="Load" class="loading">Loading&#8230;</div>
<div style="width: 100%;height:84vh;">
<table id="deviceTable" cellspacing="0" style="width: 100%;font-size: 14px;">
<thead style="background-color:#e0e0e0;color: #444444;">
<tr style="white-space: nowrap;">
<th >Transection ID </th>
<th >Distrubuter Name</th>
<th >Billing Date</th>
<th >No. of Device</th>
<th >Amount Paid</th>
<th >Rate</th>
<th >Status</th>
<th >Billing Type</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,90 @@
.topDiv{
padding-top: 59px;
background: whitesmoke;
height: 100vh;
}
.rowStyle{
// margin: 5px;
// background: white;
height: 84vh;
// box-shadow: 3px 1px 5px 0px #b2b0ae;
}
#deviceTable input {
border-radius: 5px;
}
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
background: rgb(153, 153, 153);
}
/* Handle */
::-webkit-scrollbar-thumb {
// background: rgb(74, 118, 184);
background: #868e96;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}
#toast {
visibility: hidden;
max-width: 250px;
height: 50px;
/*margin-left: -125px;*/
margin: auto;
background-color: #333;
color: #fff;
text-align: center;
border-radius: 2px;
position: fixed;
z-index: 1;
left: 60%;right:0;
bottom: 80%;
font-size: 13px;
white-space: nowrap;
}
#toast #img{
width: 250px;
height: s50px;
float: left;
padding-top: 16px;
padding-bottom: 16px;
box-sizing: border-box;
background-color: #111;
color: #fff;
}
#toast #desc{
color: #fff;
padding: 16px;
overflow: hidden;
white-space: nowrap;
}
#toast.show {
visibility: visible;
-webkit-animation: fadein 0.5s, expand 0.5s 0.5s,stay 3s 1s, shrink 0.5s 2s, fadeout 0.5s 2.5s;
animation: fadein 0.5s, expand 0.5s 0.5s,stay 3s 1s, shrink 0.5s 4s, fadeout 0.5s 4.5s;
}

Some files were not shown because too many files have changed in this diff Show more