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

92
.angular-cli.json Normal file
View file

@ -0,0 +1,92 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "OneQlik"
},
"map": {
"moment": "npm:moment",
"moment-timezone": "npm:moment-timezone/builds",
"ng-pick-datetime":"npm:ng-pick-datetime"
},
"apps": [
{
"root": "src",
"outDir": "app_client",
"assets": [
"assets",
"faviconn.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css",
"bootstrap.css",
"../node_modules/ngx-bootstrap/datepicker/bs-datepicker.css",
"../node_modules/ng-pick-datetime/assets/style/picker.min.css",
"../node_modules/datatables.net-dt/css/jquery.dataTables.css"
],
"moment": {
"main": "./moment.js",
"defaultExtension": "js"
},
"ng-pick-datetime": {
"main": "picker.bundle.js",
"defaultExtension": "js"
},
"moment-timezone": {
"main": "./moment-timezone-with-data-2010-2020.min.js",
"defaultExtension": "js"
},
"scripts": [
"../node_modules/hammerjs/hammer.min.js",
"../node_modules/moment/min/moment.min.js",
"../node_modules/crypto-js/crypto-js.js",
"../node_modules/jquery/dist/jquery.js",
"../node_modules/datatables.net/js/jquery.dataTables.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {}
}
}

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
node_modules/**

3
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"git.ignoreLimitWarning": true
}

122
GPS_x03.js Normal file
View file

@ -0,0 +1,122 @@
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* COBAN GPS_103/GPS303 communication tools (c) Pavitra Rastogi 23rd July,2018 */
/* MIT Licence */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
'use strict';
//if (typeof module!='undefined' && module.exports) var Dms = require('./dms'); // ≡ import Dms from 'dms.js'
/**
* Creates a header object from device data packet.
*
* @constructor
* @param {string} raw - utf8 encoded packet.
* @param {obj} socket - socket from tcp connection between server and device.
*
* @example
* var parsedHead = new GPS_x03(raw);
*/
function GPS_x03(raw, socket) {
// do not allow instantiation without 'new'
if (!(this instanceof GPS_x03)) throw new TypeError('Object is not GPS_x03 type');
this.imei = raw.substr(raw.indexOf('imei:') + 5, 15);
this.socket = socket;
this.raw = raw;
if (raw.search(/^##,imei:/) != -1 && raw.search(/,A;$/) !=-1){
this.command = 'login';
}
else {
this.command = 'tracker';
}
}
/**
* Logs in device in our server.
*
*
* @returns {boolean} Returns 'true' if login was successful.
*
* @example
* var gps_x03 = new GPS_x03(raw);
* if(gps_x03.doLogin()){
* //perform some action
* }
*
*/
GPS_x03.prototype.doLogin = function() {
if (!(this instanceof GPS_x03)) throw new TypeError('Object is not GPS_x03 type');
this.socket.write('LOAD');
return true;
};
/**
* Returns the parsed data for device protocol command 'tracker'.
*
* @returns {obj} Parsed ping data from device.
*
* @example
* var gps_x03p1 = new GPS_x03(raw, socket);
* if(gps_x03.doLogin()){
* var parsedData = gps_x03.getPingData();
* }
*/
GPS_x03.prototype.getPingData = function() {
if (!(this instanceof GPS_x03)) throw new TypeError('Object not of type GPS_x03');
if ((this.command != 'tracker')) throw new TypeError('packet is not of type tracker');
var msg_parts = this.raw.split(',');
var date = new Date(
parseInt('20' + msg_parts[2].substr(0, 2)),
parseInt(msg_parts[2].substr(2, 2))-1,
parseInt(msg_parts[2].substr(4, 2)),
parseInt(msg_parts[2].substr(6, 2)),
parseInt(msg_parts[2].substr(8, 2)),
parseInt(msg_parts[2].substr(10, 2))
);
var latitude = msg_parts[8] == 'N' ?
parseFloat(msg_parts[7].substr(0, 2)) + (parseFloat(msg_parts[7].substr(2)) / 60) :
parseFloat(msg_parts[7].substr(0, 2)) + (parseFloat(msg_parts[7].substr(2)) / 60) * -1;
var longitude = msg_parts[10] == 'E' ?
parseFloat(msg_parts[9].substr(0, 3)) + (parseFloat(msg_parts[9].substr(3)) / 60) :
parseFloat(msg_parts[9].substr(0, 3)) + (parseFloat(msg_parts[9].substr(3)) / 60) * -1;
return {
"imei": this.imei,
"command": msg_parts[1],
"date": date,
"dateString": msg_parts[2],
"sim" : msg_parts[3],
"latDecimal": latitude,
"longDecimal": longitude,
"insertionTime": new Date(),
"raw": this.raw,
"speed": parseInt(msg_parts[11]).toString(),
"timeString": msg_parts[5],
"heading": (msg_parts[12]).toString(),
"altitude": (msg_parts[13]).toString(),
"ignition": (msg_parts[14]).toString(),
"door" : (msg_parts[15]).toString(),
"geoJSON": {
"type": "Point",
"coordinates": [longitude, latitude ]
},
'GPS positioned': msg_parts[4] == 'F' ? '1' : '0'
};
};
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
if (typeof module != 'undefined' && module.exports) module.exports = GPS_x03; // ≡ export default GPS_x03

28
README.md Normal file
View file

@ -0,0 +1,28 @@
# AdnateIot
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.3.0.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

25
config.json Normal file
View file

@ -0,0 +1,25 @@
{
"dbDomain" : "13.126.36.205",
"dbPort" : "27017",
"dbAuthSource" : "admin",
"dbUserName" : "pFacADM",
"dbPass" : "adnate@16/09",
"dbPassUrlEncoded" : "adnate%4016%2F09",
"cookieDomain" : "localhost",
"EPort" : "3000",
"TcpPort" : "1155",
"hostMail" : "smtp.gmail.com",
"mailUserName" : "contact@adnatesolutions.com",
"mailPassWord" : "Adnate@123",
"smsUrl" : "http://198.24.149.4/API/pushsms.aspx?senderid=DEMOOO&route_id=2&Unicode=0&loginID=gauravgta&password=Gaurav@123",
"smsUrl_zogo" : "http://sms.gblsms.com/vendorsms/pushsms.aspx?user=zogord&password=123456&sid=ZOGORD&fl=0&gwid=2",
"smsApiMobileKeyzogo" : "&msisdn=",
"smsApiTextKeyzogo" : "&msg=",
"mqqtUrl":"mqtt://13.126.36.205",
"mqqtPort" : 1883,
"googleApiKey":"AIzaSyCNT3eO1wPQHUhY_cmQ9N_9BkLzJ_GB9j8",
"redisDomain" : "127.0.0.1",
"redisPort" : 6379
}

3112
dataprocessing.js Normal file

File diff suppressed because it is too large Load diff

225
dms.js Normal file
View file

@ -0,0 +1,225 @@
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Geodesy representation conversion functions (c) Chris Veness 2002-2017 */
/* MIT Licence */
/* www.movable-type.co.uk/scripts/latlong.html */
/* www.movable-type.co.uk/scripts/geodesy/docs/module-dms.html */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
'use strict';
/* eslint no-irregular-whitespace: [2, { skipComments: true }] */
/**
* Latitude/longitude points may be represented as decimal degrees, or subdivided into sexagesimal
* minutes and seconds.
*
* @module dms
*/
/**
* Functions for parsing and representing degrees / minutes / seconds.
* @class Dms
*/
var Dms = {};
// note Unicode Degree = U+00B0. Prime = U+2032, Double prime = U+2033
/**
* Parses string representing degrees/minutes/seconds into numeric degrees.
*
* This is very flexible on formats, allowing signed decimal degrees, or deg-min-sec optionally
* suffixed by compass direction (NSEW). A variety of separators are accepted (eg 3° 37 09W).
* Seconds and minutes may be omitted.
*
* @param {string|number} dmsStr - Degrees or deg/min/sec in variety of formats.
* @returns {number} Degrees as decimal number.
*
* @example
* var lat = Dms.parseDMS('51° 28 40.12″ N');
* var lon = Dms.parseDMS('000° 00 05.31″ W');
* var p1 = new LatLon(lat, lon); // 51.4778°N, 000.0015°W
*/
Dms.parseDMS = function(dmsStr) {
// check for signed decimal degrees without NSEW, if so return it directly
if (typeof dmsStr == 'number' && isFinite(dmsStr)) return Number(dmsStr);
// strip off any sign or compass dir'n & split out separate d/m/s
var dms = String(dmsStr).trim().replace(/^-/, '').replace(/[NSEW]$/i, '').split(/[^0-9.,]+/);
if (dms[dms.length-1]=='') dms.splice(dms.length-1); // from trailing symbol
if (dms == '') return NaN;
// and convert to decimal degrees...
var deg;
switch (dms.length) {
case 3: // interpret 3-part result as d/m/s
deg = dms[0]/1 + dms[1]/60 + dms[2]/3600;
break;
case 2: // interpret 2-part result as d/m
deg = dms[0]/1 + dms[1]/60;
break;
case 1: // just d (possibly decimal) or non-separated dddmmss
deg = dms[0];
// check for fixed-width unseparated format eg 0033709W
//if (/[NS]/i.test(dmsStr)) deg = '0' + deg; // - normalise N/S to 3-digit degrees
//if (/[0-9]{7}/.test(deg)) deg = deg.slice(0,3)/1 + deg.slice(3,5)/60 + deg.slice(5)/3600;
break;
default:
return NaN;
}
if (/^-|[WS]$/i.test(dmsStr.trim())) deg = -deg; // take '-', west and south as -ve
return Number(deg);
};
/**
* Separator character to be used to separate degrees, minutes, seconds, and cardinal directions.
*
* Set to '\u202f' (narrow no-break space) for improved formatting.
*
* @example
* var p = new LatLon(51.2, 0.33); // 51°1200.0″N, 000°1948.0″E
* Dms.separator = '\u202f'; // narrow no-break space
* var pʹ = new LatLon(51.2, 0.33); // 51°1200.0″N, 000°1948.0″E
*/
Dms.separator = '';
/**
* Converts decimal degrees to deg/min/sec format
* - degree, prime, double-prime symbols are added, but sign is discarded, though no compass
* direction is added.
*
* @private
* @param {number} deg - Degrees to be formatted as specified.
* @param {string} [format=dms] - Return value as 'd', 'dm', 'dms' for deg, deg+min, deg+min+sec.
* @param {number} [dp=0|2|4] - Number of decimal places to use default 0 for dms, 2 for dm, 4 for d.
* @returns {string} Degrees formatted as deg/min/secs according to specified format.
*/
Dms.toDMS = function(deg, format, dp) {
if (isNaN(deg)) return null; // give up here if we can't make a number from deg
// default values
if (format === undefined) format = 'dms';
if (dp === undefined) {
switch (format) {
case 'd': case 'deg': dp = 4; break;
case 'dm': case 'deg+min': dp = 2; break;
case 'dms': case 'deg+min+sec': dp = 0; break;
default: format = 'dms'; dp = 0; // be forgiving on invalid format
}
}
deg = Math.abs(deg); // (unsigned result ready for appending compass dir'n)
var dms, d, m, s;
switch (format) {
default: // invalid format spec!
case 'd': case 'deg':
d = deg.toFixed(dp); // round/right-pad degrees
if (d<100) d = '0' + d; // left-pad with leading zeros (note may include decimals)
if (d<10) d = '0' + d;
dms = d + '°';
break;
case 'dm': case 'deg+min':
d = Math.floor(deg); // get component deg
m = ((deg*60) % 60).toFixed(dp); // get component min & round/right-pad
if (m == 60) { m = 0; d++; } // check for rounding up
d = ('000'+d).slice(-3); // left-pad with leading zeros
if (m<10) m = '0' + m; // left-pad with leading zeros (note may include decimals)
dms = d + '°'+Dms.separator + m + '';
break;
case 'dms': case 'deg+min+sec':
d = Math.floor(deg); // get component deg
m = Math.floor((deg*3600)/60) % 60; // get component min
s = (deg*3600 % 60).toFixed(dp); // get component sec & round/right-pad
if (s == 60) { s = (0).toFixed(dp); m++; } // check for rounding up
if (m == 60) { m = 0; d++; } // check for rounding up
d = ('000'+d).slice(-3); // left-pad with leading zeros
m = ('00'+m).slice(-2); // left-pad with leading zeros
if (s<10) s = '0' + s; // left-pad with leading zeros (note may include decimals)
dms = d + '°'+Dms.separator + m + ''+Dms.separator + s + '″';
break;
}
return dms;
};
/**
* Converts numeric degrees to deg/min/sec latitude (2-digit degrees, suffixed with N/S).
*
* @param {number} deg - Degrees to be formatted as specified.
* @param {string} [format=dms] - Return value as 'd', 'dm', 'dms' for deg, deg+min, deg+min+sec.
* @param {number} [dp=0|2|4] - Number of decimal places to use default 0 for dms, 2 for dm, 4 for d.
* @returns {string} Degrees formatted as deg/min/secs according to specified format.
*/
Dms.toLat = function(deg, format, dp) {
var lat = Dms.toDMS(deg, format, dp);
return lat===null ? '' : lat.slice(1)+Dms.separator + (deg<0 ? 'S' : 'N'); // knock off initial '0' for lat!
};
/**
* Convert numeric degrees to deg/min/sec longitude (3-digit degrees, suffixed with E/W)
*
* @param {number} deg - Degrees to be formatted as specified.
* @param {string} [format=dms] - Return value as 'd', 'dm', 'dms' for deg, deg+min, deg+min+sec.
* @param {number} [dp=0|2|4] - Number of decimal places to use default 0 for dms, 2 for dm, 4 for d.
* @returns {string} Degrees formatted as deg/min/secs according to specified format.
*/
Dms.toLon = function(deg, format, dp) {
var lon = Dms.toDMS(deg, format, dp);
return lon===null ? '' : lon+Dms.separator + (deg<0 ? 'W' : 'E');
};
/**
* Converts numeric degrees to deg/min/sec as a bearing (0°..360°)
*
* @param {number} deg - Degrees to be formatted as specified.
* @param {string} [format=dms] - Return value as 'd', 'dm', 'dms' for deg, deg+min, deg+min+sec.
* @param {number} [dp=0|2|4] - Number of decimal places to use default 0 for dms, 2 for dm, 4 for d.
* @returns {string} Degrees formatted as deg/min/secs according to specified format.
*/
Dms.toBrng = function(deg, format, dp) {
deg = (Number(deg)+360) % 360; // normalise -ve values to 180°..360°
var brng = Dms.toDMS(deg, format, dp);
return brng===null ? '' : brng.replace('360', '0'); // just in case rounding took us up to 360°!
};
/**
* Returns compass point (to given precision) for supplied bearing.
*
* @param {number} bearing - Bearing in degrees from north.
* @param {number} [precision=3] - Precision (1:cardinal / 2:intercardinal / 3:secondary-intercardinal).
* @returns {string} Compass point for supplied bearing.
*
* @example
* var point = Dms.compassPoint(24); // point = 'NNE'
* var point = Dms.compassPoint(24, 1); // point = 'N'
*/
Dms.compassPoint = function(bearing, precision) {
if (precision === undefined) precision = 3;
// note precision could be extended to 4 for quarter-winds (eg NbNW), but I think they are little used
bearing = ((bearing%360)+360)%360; // normalise to range 0..360°
var cardinals = [
'N', 'NNE', 'NE', 'ENE',
'E', 'ESE', 'SE', 'SSE',
'S', 'SSW', 'SW', 'WSW',
'W', 'WNW', 'NW', 'NNW' ];
var n = 4 * Math.pow(2, precision-1); // no of compass points at reqd precision (1=>4, 2=>8, 3=>16)
var cardinal = cardinals[Math.round(bearing*n/360)%n * 16/n];
return cardinal;
};
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
if (typeof module != 'undefined' && module.exports) module.exports = Dms; // ≡ export default Dms

127
gpsFunctions.js Normal file
View file

@ -0,0 +1,127 @@
/*****************************************
FUNCTIONS
******************************************/
exports.rad = function (x) {
return x * Math.PI / 180;
};
/*
@param p1: {lat:X,lng:Y}
@param p2: {lat:X,lng:Y}
*/
exports.get_distance = function (p1, p2) {
var R = 6378137; // Earths mean radius in meter
var dLat = exports.rad(p2.lat - p1.lat);
var dLong = exports.rad(p2.lng - p1.lng);
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(exports.rad(p1.lat)) * Math.cos(exports.rad(p2.lat)) *
Math.sin(dLong / 2) * Math.sin(dLong / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d; // returns the distance in meter
};
exports.send = function (socket, msg) {
socket.write(msg);
};
exports.parse_data = function (data) {
data = data.replace(/(\r\n|\n|\r)/gm, ''); //Remove 3 type of break lines
var cmd_start = data.indexOf('B'); //al the incomming messages has a cmd starting with 'B'
if (cmd_start > 13)throw 'Device ID is longer than 12 chars!';
var parts = {
'start': data.substr(0, 1),
'device_id': data.substring(1, cmd_start),
'cmd': data.substr(cmd_start, 4),
'data': data.substring(cmd_start + 4, data.length - 1),
'finish': data.substr(data.length - 1, 1)
};
return parts;
};
exports.parse_gps_data = function (str) {
var data = {
'date': str.substr(0, 6),
'availability': str.substr(6, 1),
'latitude': gps_minute_to_decimal(parseFloat(str.substr(7, 9))),
'latitude_i': str.substr(16, 1),
'longitude': gps_minute_to_decimal(parseFloat(str.substr(17, 9))),
'longitude_i': str.substr(27, 1),
'speed': str.substr(28, 5),
'time': str.substr(33, 6),
'orientation': str.substr(39, 6),
'io_state': str.substr(45, 8),
'mile_post': str.substr(53, 1),
'mile_data': parseInt(str.substr(54, 8), 16)
};
return data;
};
exports.send_to = function (socket, cmd, data) {
if (typeof(socket.device_id) == 'undefined')throw 'The socket is not paired with a device_id yet';
var str = gps_format.start;
str += socket.device_id + gps_format.separator + cmd;
if (typeof(data) != 'undefined') str += gps_format.separator + data;
str += gps_format.end;
send(socket, str);
//Example: (<DEVICE_ID>|<CMD>|<DATA>) - separator: | ,start: (, end: )
};
exports.minute_to_decimal = function (pos, pos_i) {
if (typeof(pos_i) === 'undefined') pos_i = 'N';
var dg = parseInt(pos / 100);
var minutes = pos - (dg * 100);
var res = (minutes / 60) + dg;
return (pos_i.toUpperCase() === 'S' || pos_i.toUpperCase() === 'W') ? res * -1 : res;
};
// Send a message to all clients
exports.broadcast = function (message, sender) {
clients.forEach(function (client) {
if (client === sender) return;
client.write(message);
});
process.stdout.write(message + '\n');
};
exports.data_to_hex_array = function (data) {
var arr = [];
for (var i = 0; i < data.length; i++)arr.push(data[i].toString(16));
return arr;
};
/* RETRUN AN INTEGER FROM A HEX CHAR OR integer */
exports.hex_to_int = function (hex_char) {
return parseInt(hex_char, 16);
};
exports.sum_hex_array = function (hex_array) {
var sum = 0;
for (var i in hex_array)sum += exports.hex_to_int(hex_array[i]);
return sum;
};
exports.hex_array_to_hex_str = function (hex_array) {
var str = '';
for (var i in hex_array) {
var char;
if (typeof(hex_array[i]) === 'number') char = hex_array[i].toString(16);
else char = hex_array[i].toString();
str += exports.str_pad(char, 2, '0');
}
return str;
};
exports.str_pad = function (input, length, string) {
string = string || '0';
input = input + '';
return input.length >= length ? input : new Array(length - input.length + 1).join(string) + input;
};
exports.crc_itu_get_verification = function (hex_data) {
var crc16 = require('crc-itu').crc16;
if (typeof(hex_data) === 'String') str = hex_data;
else str = exports.hex_array_to_hex_str(hex_data);
return crc16(str, 'hex');
};

98
kafka-consumer.js Normal file
View file

@ -0,0 +1,98 @@
module.exports = function(socketNamespaces) {
const kafka = require("kafka-node");
const client = new kafka.Client("localhost:2181");
const topics = [
{
topic: "tcp.realtime"
}
];
/* const options = {
autoCommit: true,
fetchMaxWaitMs: 1000,
fetchMaxBytes: 1024 * 1024,
encoding: "buffer"
}; */
var options = {
//host: 'zookeeper:2181', // zookeeper host omit if connecting directly to broker (see kafkaHost below)
kafkaHost: 'localhost:9092', // connect directly to kafka broker (instantiates a KafkaClient)
zk : undefined, // put client zk settings if you need them (see Client)
batch: undefined, // put client batch settings if you need them (see Client)
ssl: false, // optional (defaults to false) or tls options hash
groupId: 'ws.realtime',
sessionTimeout: 15000,
// An array of partition assignment protocols ordered by preference.
// 'roundrobin' or 'range' string for built ins (see below to pass in custom assignment protocol)
protocol: ['roundrobin'],
// Offsets to use for new groups other options could be 'earliest' or 'none' (none will emit an error if no offsets were saved)
// equivalent to Java client's auto.offset.reset
fromOffset: 'latest', // default
commitOffsetsOnFirstJoin: true, // on the very first time this consumer group subscribes to a topic, record the offset returned in fromOffset (latest/earliest)
// how to recover from OutOfRangeOffset error (where save offset is past server retention) accepts same value as fromOffset
outOfRangeOffset: 'latest', // default
migrateHLC: false, // for details please see Migration section below
migrateRolling: false,
// Callback to allow consumers with autoCommit false a chance to commit before a rebalance finishes
// isAlreadyMember will be false on the first connection, and true on rebalances triggered after that
onRebalance: null//(isAlreadyMember, callback) => { callback(); } // or null
};
const consumer = new kafka.ConsumerGroup(options, 'tcp.realtime');
consumer.on("message", function (message) {
/* Print latest offset. */
/* var offset = new kafka.Offset(client);
offset.fetch([{ topic: 'tcp.realtime', partition: 0, time: -1 }], function (err, data) {
var latestOffset = data['tcp.realtime']['0'][0];
console.log("Consumer current offset: " + latestOffset);
}); */
// Read string into a buffer.
var buf = new Buffer(message.value, "binary");
var decodedMessage = JSON.parse(buf.toString());
//console.log(decodedMessage);
switch (decodedMessage.namespace) {
case 'gpsio':
if (decodedMessage.channel.endsWith('acc')) {
socketNamespaces[decodedMessage.namespace]
.to(decodedMessage.room)
.emit(decodedMessage.channel, decodedMessage.data[0], decodedMessage.data[1], decodedMessage.data[2], decodedMessage.data[3]);
}
else {
socketNamespaces[decodedMessage.namespace]
.to(decodedMessage.room)
.emit(decodedMessage.channel, decodedMessage.data[0], decodedMessage.data[1], decodedMessage.data[2]);
}
break;
case 'notifIO':
socketNamespaces[decodedMessage.namespace]
.emit(decodedMessage.channel, decodedMessage.data[0]);
break;
case 'sbNotifIO':
socketNamespaces[decodedMessage.namespace]
.emit(decodedMessage.channel, decodedMessage.data[0]);
break;
default:
break;
}
});
consumer.on("error", function(err) {
console.log("error", err);
});
consumer.on('offsetOutOfRange', function (err) {
console.log("offsetOutOfRange", err);
});
process.on("SIGINT", function() {
consumer.close(true, function() {
process.exit();
});
});
}

68
kafka-producer.js Normal file
View file

@ -0,0 +1,68 @@
const kafka = require("kafka-node");
const uuid = require("uuid");
const client = new kafka.Client("localhost:2181", "my-client-id", {
sessionTimeout: 300,
spinDelay: 100,
retries: 2
});
client.on('ready', function (){
console.log('producer client ready');
})
client.on('error', function (err){
console.log('client error: ' + err);
})
const producer = new kafka.HighLevelProducer(client);
producer.on("ready", function() {
console.log("Kafka Producer is connected and ready.");
/* KafkaService.sendRecord({ namespace: 'b', room: 'c', channel: 'c', data: 'd' }, function (err, data) {
console.log('incallback')
console.log(err, data)
producer.close();
process.exit()
}); */
});
// For this demo we just log producer errors to the console.
producer.on("error", function(error) {
console.error(error);
});
const KafkaService = {
sendRecord: ({ namespace, room, channel, data }, callback = () => {}) => {
if (!namespace) {
//return callback(new Error(`A namespace must be provided.`));
}
const event = {
id: uuid.v4(),
timestamp: Date.now(),
namespace: namespace,
room: room,
channel: channel,
data: data
};
const buffer = new Buffer.from(JSON.stringify(event));
// Create a new payload
const record = [
{
topic: "tcp.realtime",
messages: buffer,
attributes: 1 /* Use GZip compression for the payload */
}
];
//Send record to Kafka and log result/error
producer.send(record, function (err, data) {
//console.log(err, data);
});
}
};
module.exports = KafkaService;

11
kafka-test.js Normal file
View file

@ -0,0 +1,11 @@
require('./kafka-consumer');
var kafka_producer = require('./kafka-producer');
/* kafka_producer.sendRecord({ type: 'a', userId: 'b', sessionId: 'c', data: 'd' }, function () {
console.log('incallback')
}); */

33
karma.conf.js Normal file
View file

@ -0,0 +1,33 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};

25394
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

152
package.json Normal file
View file

@ -0,0 +1,152 @@
{
"name": "oneqlik",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.3.6",
"@angular/cdk": "^7.3.7",
"@angular/cli": "^1.7.3",
"@angular/common": "^4.2.4",
"@angular/compiler": "^4.2.4",
"@angular/core": "^4.2.4",
"@angular/flex-layout": "^9.0.0-beta.29",
"@angular/forms": "^4.2.4",
"@angular/http": "^4.2.4",
"@angular/material": "^5.2.5",
"@angular/platform-browser": "^4.2.4",
"@angular/platform-browser-dynamic": "^4.2.4",
"@angular/router": "^4.2.4",
"@ng-bootstrap/ng-bootstrap": "^4.1.3",
"@ngui/popup": "0.5.1",
"@types/jquery": "3.3.1",
"angular-bootstrap-md": "^6.2.3",
"angular-gauge": "2.0.0",
"angular-resizable-element": "1.2.3",
"angular-stormpath": "0.1.6",
"angular2-draggable": "1.0.7",
"angular2-flash-message": "1.0.2",
"angular2-flash-messages": "1.0.8",
"angular2-google-maps": "0.17.0",
"angular2-image-upload": "1.0.0-rc.0",
"angular2-material-datepicker": "^0.5.0",
"angular2-recaptcha": "^1.1.0",
"angular2-resizable": "0.4.1",
"angular2-time-duration-picker": "1.1.0",
"angular2-wizard": "0.4.0",
"apn": "2.2.0",
"async": "^2.6.1",
"body-parser": "^1.19.0",
"chart": "0.1.2",
"chart.js": "2.6.0",
"core-js": "2.4.1",
"cors": "2.8.4",
"crypto-js": "3.1.9-1",
"datatables.net-dt": "^1.10.19",
"emailjs": "1.0.11",
"express": "^4.17.1",
"express-jwt": "^5.3.1",
"express-oas-generator": "^1.0.3",
"express-unless": "^0.5.0",
"fcm-node": "^1.5.2",
"file-saver": "^2.0.0-rc.4",
"geo-convex-hull": "^1.3.0",
"geojson-area": "^0.2.1",
"google-distance-matrix": "^1.1.1",
"googlemaps": "^1.12.0",
"hammerjs": "2.0.8",
"http": "0.0.0",
"hull.js": "^0.2.10",
"jquery": "^3.4.1",
"jsonwebtoken": "^8.3.0",
"kafka-node": "^3.0.1",
"lodash.set": "^4.3.2",
"md-dialog": "0.0.1-alpha.1",
"moment": "^2.22.1",
"moment-range": "^4.0.1",
"moment-timezone": "^0.5.17",
"mongo-xlsx": "^1.0.12",
"mongodb": "2.2.33",
"mongoose": "4.13.12",
"mongoose-datatable": "^1.0.6",
"morgan": "^1.9.1",
"mydatepicker": "^2.0.31",
"nexmo": "^2.0.2",
"ng-bootstrap": "^1.6.3",
"ng-multiselect-dropdown": "^0.2.3",
"ng-pick-datetime": "^4.3.4",
"ng2-charts": "^1.6.0",
"ng2-date-countdown": "0.0.4",
"ng2-datetime": "^1.4.0",
"ng2-dragula": "1.5.0",
"ng2-dropdown": "0.0.21",
"ng2-expansion-panels": "0.0.6",
"ng2-file-upload": "1.3.0",
"ng2-if-scrollbars": "2.0.0",
"ng2-json-editor": "^0.25.12",
"ng2-jsoneditor": "0.1.1",
"ng2-material-dropdown": "0.7.10",
"ng2-order-pipe": "^0.1.5",
"ng2-pagination": "2.0.2",
"ng2-password-strength-bar": "1.1.3",
"ng2-popup": "0.4.0",
"ng2-progress-bar": "0.0.8",
"ng2-recaptcha": "1.7.0",
"ng2-search-filter": "^0.4.7",
"ng2-simple-timer": "^6.0.0",
"ng2-translate": "^5.0.0",
"ngx-bootstrap": "^2.0.5",
"ngx-facebook": "2.4.0",
"ngx-pagination": "3.1.0",
"node-gcm": "0.14.10",
"node-red": "0.17.5",
"node-schedule": "1.3.0",
"otplib": "5.1.1",
"pbkdf2-sha256": "1.1.1",
"redis": "^2.8.0",
"regression": "^2.0.1",
"rxjs": "5.4.1",
"sendgrid": "5.2.2",
"server": "^1.0.18",
"socket.io": "2.0.3",
"tk102": "1.3.1",
"vhost": "^3.0.2",
"xlsx": "^0.13.5",
"zone.js": "0.8.14"
},
"devDependencies": {
"@angular/compiler-cli": "^4.2.4",
"@angular/language-service": "^4.2.4",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"@types/socket.io-client": "1.4.30",
"codelyzer": "~3.1.1",
"express-stormpath": "4.0.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"ol": "^6.2.1",
"parcel-bundler": "^1.12.4",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "2.3.0"
},
"description": "",
"main": "app.js",
"author": "Anshul_Saxena"
}

BIN
public/images/m1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
public/images/poi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

204
public/index.html Normal file
View file

@ -0,0 +1,204 @@
<head>
<title>Adnate IOT</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
@media all and (max-width: 480px){*[class].ib_t{min-width:100% !important}*[class].ib_row{display:block !important}*[class].ib_ext{display:block !important;padding:10px 0 5px 0;vertical-align:top !important;width:100% !important}*[class].ib_img,*[class].ib_mid{vertical-align:top !important}*[class].mb_blk{display:block !important;padding-bottom:10px;width:100% !important}*[class].mb_hide{display:none !important}*[class].mb_inl{display:inline !important}}.d_mb_show{display:none}.d_mb_show_center{display:table;margin:auto}@media only screen and (max-device-width: 480px){.d_mb_hide{display:none !important}.d_mb_show{display:block !important}}.mb_text h1,.mb_text h2,.mb_text h3,.mb_text h4,.mb_text h5,.mb_text h6{line-height:normal}.mb_work_text h1{font-size:18px;line-height:normal;margin-top:4px}.mb_work_text h2,.mb_work_text h3{font-size:16px;line-height:normal;margin-top:4px}.mb_work_text h4,.mb_work_text h5,.mb_work_text h6{font-size:14px;line-height:normal}.mb_work_text a{color:#1270e9}.mb_work_text p{margin-top:4px}
</style>
</head>
<body style="max-width:532px;margin:0 auto;padding:0;" dir="ltr" bgcolor="#ffffff" onload="myFunction()">
<script type="text/javascript">
window.onload = function () {
document.myform.Submit1.click();
}
</script>
<form method="post" action="/" name="myform">
<input type="hidden" name="data" value="1">
<input name="Submit1" type="submit"
style="position: absolute; left: -9999px; width: 1px; height: 1px;"
tabindex="-1" />
</form>
<table border="0" width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse;">
<tbody>
<tr>
<td width="100%" align="center" style="">
<table border="0" cellspacing="0" cellpadding="0" align="center" style="border-collapse:collapse;">
<tbody>
<tr>
<td width="1064" align="center" style="">
<table border="0" cellspacing="0" cellpadding="0" align="center" id="email_table" style="border-collapse:collapse;max-width:532px;margin:0 auto;">
<tbody>
<tr>
<td id="email_content" style="font-family:Helvetica Neue,Helvetica,Lucida Grande,tahoma,verdana,arial,sans-serif;background:#ffffff;">
<table border="0" width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse;">
<tbody>
<tr>
<td colspan="5" style="">
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;">
<tbody>
<tr style="">
<td height="8" style="line-height:8px;">&nbsp;</td>
</tr>
<tr>
<td width="16" style="display:block;width:16px;">&nbsp;&nbsp;&nbsp;</td>
<td width="24" align="left" valign="middle" colspan="1" style="height:24;line-height:0px;"><img class="logo" src="./logo1.jpg" alt="My_Logo" width="170" height="50" style="border:0; margin-left: 4cm;"></td>
<td colspan="1" style="padding-left:8px;"></td>
</tr>
<tr style="">
<td height="8" style="line-height:8px;">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="5" style="">
<table border="0" width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse;background-color:#083064;background-size:100%;">
<tbody>
<tr>
<td style=""></td>
<td style="">
<table border="0" width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse;background-color:#083064;background-size:100%;">
<tbody>
<tr style="">
<td height="32" style="line-height:32px;" colspan="3">&nbsp;</td>
</tr>
<tr>
<td width="8" style="display:block;width:8px;">&nbsp;&nbsp;&nbsp;</td>
<td width="20" style="display:block;width:20px;" class="mb_hide">&nbsp;&nbsp;&nbsp;</td>
<td align="center" style="">
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:100%;">
<tbody>
<tr>
<td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding-bottom:10px;">
<center><span class="mb_work_text" style="font-family:Helvetica Neue,Helvetica,Lucida Grande,tahoma,verdana,arial,sans-serif;font-size:17px;line-height:31px;font-weight:normal;color:#FFFFFF;letter-spacing:0.2px;text-shadow:1px 1px 2px rgba(0,0,0,0.19);">
Congratulations you have success fully verified your email id
</span></center>
</td>
</tr>
<tr>
<td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding-top:10px;">
<center>
<a href="http://localhost:4200/login"
style="color:#3b5998;text-decoration:none;" target="_blank">
<table border="0" width="200px" cellspacing="0" cellpadding="0" style="border-collapse:collapse;">
<tbody>
<tr>
<td style="border-collapse:collapse;border-radius:2px;text-align:center;display:block;border-radius:4px;box-shadow:0 1px 6px rgba(0, 0, 0, 0.08);background:#42B72A;margin:0px 0px 0px 0px;padding:4px 0px 4px 0px;padding:14px 16px 14px 16px;"><a href="http://localhost:4200/login"
style="color:#3b5998;text-decoration:none;" target="_blank"><span style="font-family:Helvetica Neue,Helvetica,Lucida Grande,tahoma,verdana,arial,sans-serif;white-space:nowrap;font-weight:bold;vertical-align:middle;font-family:Helvetica Neue,Helvetica,Lucida Grande,tahoma,verdana,arial,sans-serif;color:#ffffff;font-size:16px;line-height:18px;font-weight:500;">Click here to Login</span></a></td>
</tr>
</tbody>
</table>
</a>
</center>
</td>
</tr>
</tbody>
</table>
</td>
<td width="8" style="display:block;width:8px;">&nbsp;&nbsp;&nbsp;</td>
<td width="20" style="display:block;width:20px;" class="mb_hide">&nbsp;&nbsp;&nbsp;</td>
</tr>
<tr style="">
<td height="24" style="line-height:24px;" colspan="3">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
<td style=""></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr style="">
<td height="4" style="line-height:4px;" colspan="3">&nbsp;</td>
</tr>
<tr class="mb_hide" style="">
<td height="4" style="line-height:4px;" colspan="3">&nbsp;</td>
</tr>
<tr style="align:center;">
<td width="8" style="display:block;width:8px;">&nbsp;&nbsp;&nbsp;</td>
<td width="16" style="display:block;width:16px;">&nbsp;&nbsp;&nbsp;</td>
<td style="">
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:100%;">
<tbody>
<tr>
<td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding:0px 0px 0px 0px;background-color:#ffffff;border-left:1px solid #ccc;border-right:1px solid #ccc;border-top:1px solid #ccc;border-bottom:1px solid #ccc;border-radius:0px;border:0px;">
<table border="0" width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse;">
<tbody>
<tr style="">
<td height="28" style="line-height:28px;">&nbsp;</td>
</tr>
<tr>
<td style="">
<table border="0" width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse;">
<tbody>
<tr>
<td align="center" style="">
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:100%;">
<tbody>
<tr>
<td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding-bottom:12px;">
<table border="0" cellspacing="0" cellpadding="0" align="center" style="border-collapse:collapse;">
<tbody>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="font-size:11px;font-family:LucidaGrande,tahoma,verdana,arial,sans-serif;padding-top:12px;padding-bottom:12px;">
<table border="0" cellspacing="0" cellpadding="0" align="center" style="border-collapse:collapse;">
<tbody>
<tr style="border-top:solid 1px #e5e5e5;">
<td height="24" style="line-height:24px;">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr style="">
<td height="14" style="line-height:14px;">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td width="16" style="display:block;width:16px;">&nbsp;&nbsp;&nbsp;</td>
<td width="8" style="display:block;width:8px;">&nbsp;&nbsp;&nbsp;</td>
</tr>
<tr style="">
<td height="10" style="line-height:10px;" colspan="3">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>

BIN
public/logo1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

2869
spec.json Normal file

File diff suppressed because it is too large Load diff

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;
}

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