This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AngularFireAuth } from 'angularfire2/auth'; | |
import { FirebaseStorageProvider } from './../firebase-storage/firebase-storage'; | |
import { File } from '@ionic-native/file'; | |
import { FilePath } from '@ionic-native/file-path'; | |
import { FileChooser } from '@ionic-native/file-chooser'; | |
import { Camera, CameraOptions } from '@ionic-native/camera'; | |
import { MediaCapture, | |
CaptureVideoOptions, | |
MediaFile, | |
CaptureError, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Estrutura do Firebase Database | |
// { | |
// "formulario": { // Aqui ficam salvo as entradas que gerarão o grafico | |
// "formularioID":{ | |
// "uid": "464165dsada", | |
// "contador1": "dado 1", | |
// "contador2": "dado 2" | |
// } | |
// }, | |
// "grafico": { // Aqui fica salvo os dados para o grafico |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
templateUrl: 'app.html' | |
}) | |
export class MyApp { | |
public activeProfile: Profile; | |
constructor( | |
private afAuth: AngularFireAuth, | |
private profileProvider: ProfileProvider, | |
) { | |
afAuth.auth.onAuthStateChanged( user => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Pipe } from '@angular/core'; | |
import { File } from '@ionic-native/file'; | |
import { Network } from '@ionic-native/network'; | |
import { LocalNotifications } from '@ionic-native/local-notifications'; | |
import { AngularFireAuth } from 'angularfire2/auth'; | |
import { LoadingController } from 'ionic-angular'; | |
import * as firebase from 'firebase'; | |
import { Observable } from "rxjs/Observable"; | |
import { Observer } from "rxjs/Observer"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Os cheboxes são gerados dinamimcamente a partir do array customTypes | |
* Exemplo do HTML responsável pelo Checkbox | |
*/ | |
` | |
<ion-item *ngFor="let customType of customTypes" (press)="editCustomType(customType)" > | |
<ion-label>{{customType?.name}}</ion-label> | |
<ion-label>{{customType?.description}}</ion-label> | |
<ion-checkbox color="customType?.color" (ionChange)="addType(customType)" [checked]="isChecked(customType)"></ion-checkbox> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Report { | |
values: ReportValues | |
metadata: ReportMetadata | |
media: string[] | |
} | |
class ReportMetadata { | |
//Esses timestamp é um objeto mas considere ele apenas como uma data | |
createdServerTime? = firebase.firestore.FieldValue.serverTimestamp() | |
lastUpdateServerTime? = firebase.firestore.FieldValue.serverTimestamp() | |
createdLocalTime: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as moment from 'moment'; | |
import { Injectable } from '@angular/core'; | |
import { isArray } from 'ionic-angular/util/util'; | |
import { ReplaySubject, Observable } from 'rxjs'; | |
import { ChartData, ChartDataSets } from 'chart.js'; | |
import { Profile } from './../../models/profile/profile'; | |
import { Report } from './../../models/report/report'; | |
import { ReportProvider } from './../report/report'; | |
import { ProfileProvider } from './../profile/profile'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dados que veem do Database | |
const dados = [ | |
{ | |
values: { | |
date: '2018-02-01', | |
id: '1351316', | |
triggers: [{ | |
id: '02125', | |
name: 'nome do tringger01', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$date1 = new DateTime('Mon, 15 Aug 05 15:52:01 +0000'); | |
$date2 = new DateTime('Mon, 15 Aug 05 09:52:01 +0000'); | |
$date3 = new DateTime('Mon, 15 Aug 05 10:32:01 +0000'); | |
$paraSerOrdenado = [ | |
'array1' => [ | |
'datareal' => $date1, | |
'datastr' => $date1->getTimestamp(), //timestamp é int | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const images = [ | |
{ | |
file: '00.txt', | |
source: '00' | |
}, | |
{ | |
file: '01.txt', | |
source: '01' | |
}, | |
{ |
OlderNewer