· 10 years ago · Sep 19, 2016, 06:08 PM
1<!DOCTYPE html>
2
3<!-- un-comment this code to enable service worker
4<script>
5 if ('serviceWorker' in navigator) {
6 navigator.serviceWorker.register('service-worker.js')
7 .then(() => console.log('service worker installed'))
8 .catch(err => console.log('Error', err));
9 }
10</script>-->
11
12<link href="lib/ionic/css/ionic.css" rel="stylesheet">
13<link href="css/style.css" rel="stylesheet">
14
15<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
16<link href="css/ionic.app.css" rel="stylesheet">
17
18<hr />
19 <div class="button-bar">
20 <button class="button button-block button-balanced" ng-click="cadastrar(estado.nome, estado.sigla)">
21 Cadastrar
22 </button>
23
24 </ion-content>
25</ion-pane>
26
27// Ionic Starter App
28
29// Don't remove this line unless you know what you are doing. It stops the viewport
30 // from snapping when text inputs are focused. Ionic handles this internally for
31 // a much nicer keyboard experience.
32 cordova.plugins.Keyboard.disableScroll(true);
33}
34if(window.StatusBar) {
35 StatusBar.styleDefault();
36}
37$cordovaSQLite.execute(db, 'CREATE TABLE IF NOT EXISTS estado (idestado integer PRIMARY KEY AUTOINCREMENT, nome text, sigla text)')
38$cordovaSQLite.execute(db, 'CREATE TABLE IF NOT EXISTS cidade (id integer PRIMARY KEY AUTOINCREMENT, nome text, idestado INTEGER CONSTRAINT fk_idestado REFERENCES estado (id) NOT NULL)')
39$cordovaSQLite.execute(db, 'CREATE TABLE IF NOT EXISTS cliente (idcliente integer PRIMARY KEY AUTOINCREMENT, nome text, cpf text, datanasc text, cep text, telefone text, email text, senha text, id INTEGER CONSTRAINT fk_id REFERENCES cidade (id) NOT NULL)')