Commit a5afefc8 authored by <roger's avatar <roger

listocrud

parents
## [2.1.0] - 2018-04-27
### Fixes
- changed file structure
- moved documentation online
## [2.0.0] - 2018-04-20
### Fixes
- added bootstrap 4
- added angular 5
## [1.4.2] - 2017-10-01
### Fixes
- added Perfect Scrollbar
- added scrollTop on route change
- added closeSidebar on mobile
- autocompile scss files
- fixes for IE
- update package dependencies to 4.4.4
## [1.4.1] - 2017-09-19
### Material
- added material.init()
- fixed input float problem
- fixed checkboxes in tabs
## [1.4.0] - 2017-08-23
### Changes for Angular 4
- added angular-cli
- update to Angular 4
## [v1.3.0] 2017-08-23
### skipped for sync with Angular 4 version convention
## [1.2.0] - 2017-04-05
### Added
- added Upgrade to PRO page
- update package
- made sidebar dynamic
## [1.1.1] - 2017-03-21
### Added
- added "@types/core-js": "0.9.35" in package
## [1.1.0] - 2017-03-20
### small fix
## [1.0.0] - 2017-01-30
### initial Release
MIT License
Copyright (c) 2017 Creative Tim (www.creative-tim.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# [Material Dashboard Angular - Free Bootstrap Material Design Admin](https://www.creative-tim.com/product/material-dashboard-angular2)[![version][version-badge]][CHANGELOG]
![alt text](http://s3.amazonaws.com/creativetim_bucket/products/53/original/opt_md_angular_thumbnail.jpg "Material Dashboard Angular Free")
**[Material Dashboard Angular](https://www.creative-tim.com/product/material-dashboard-angular2/)** is a free Material Bootstrap Admin with a fresh, new design inspired by Google's Material Design. We are very excited to introduce our take on the material concepts through an easy to use and beautiful set of components. Material Dashboard was built over the popular Bootstrap framework and it comes with a couple of third-party plugins redesigned to fit in with the rest of the elements.
Material Dashboard makes use of light, surface and movement. The general layout resembles sheets of paper following multiple different layers, so that the depth and order is obvious. The navigation stays mainly on the left sidebar and the content is on the right inside the main panel.
This product came as a result of users asking for a material dashboard after we released our successful [Material Kit](http://www.creative-tim.com/product/material-kit). We developed it based on your feedback and it is a powerful bootstrap admin dashboard, which allows you to build products like admin panels, content managements systems and CRMs.
Material Dashboard comes with 5 color filter choices for both the sidebar and the card headers (blue, green, orange, red and purple) and an option to have a background image on the sidebar.
Material Dashboard uses a framework built by our friend [Federico - Bootstrap Material Design](http://fezvrasta.github.io/bootstrap-material-design/), who did an amazing job creating the backbone for the material effects, animations, ripples and transitions. Big thanks to his team for the effort and forward thinking they put into it.
Special thanks go to:
[Robert McIntosh](https://github.com/mouse0270/bootstrap-notify) for the notification system.
[Chartist](https://gionkunz.github.io/chartist-js/) for the wonderful charts.
We are very excited to share this dashboard with you and we look forward to hearing your feedback!
You can find the Github Repo here.
## Links:
+ [Live Preview](https://www.creative-tim.com/product/material-dashboard-angular2)
+ [Material Kit - For Front End Development](http://www.creative-tim.com/product/material-kit?ref=github-md-angular)
## Quick start
Quick start options:
- [Download from Github](https://github.com/tiniestory/material-dashboard-angular/archive/master.zip).
- [Download from Creative Tim](http://www.creative-tim.com/product/material-dashboard-angular2).
- Clone the repo: `git clone https://github.com/tiniestory/material-dashboard-angular.git`.
## Terminal Commands
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0 and angular 4.x.
1. Install NodeJs from [NodeJs Official Page](https://nodejs.org/en).
2. Open Terminal
3. Go to your file project
4. Make sure you have installed [Angular CLI](https://github.com/angular/angular-cli) already. If not, please install.
5. Run in terminal: ```npm install```
6. 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.
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).
### What's included
Within the download you'll find the following directories and files:
```
md-free-angular-cli
├── CHANGELOG.md
├── LICENSE.md
├── README.md
├── angular-cli.json
├── documentation
├── e2e
├── karma.conf.js
├── package-lock.json
├── package.json
├── protractor.conf.js
├── src
│   ├── app
│   │   ├── app.component.css
│   │   ├── app.component.html
│   │   ├── app.component.spec.ts
│   │   ├── app.component.ts
│   │   ├── app.module.ts
│   │   ├── app.routing.ts
│   │   ├── components
│   │   │   ├── components.module.ts
│   │   │   ├── footer
│   │   │   │   ├── footer.component.css
│   │   │   │   ├── footer.component.html
│   │   │   │   ├── footer.component.spec.ts
│   │   │   │   └── footer.component.ts
│   │   │   ├── navbar
│   │   │   │   ├── navbar.component.css
│   │   │   │   ├── navbar.component.html
│   │   │   │   ├── navbar.component.spec.ts
│   │   │   │   └── navbar.component.ts
│   │   │   └── sidebar
│   │   │   ├── sidebar.component.css
│   │   │   ├── sidebar.component.html
│   │   │   ├── sidebar.component.spec.ts
│   │   │   └── sidebar.component.ts
│   │   ├── dashboard
│   │   │   ├── dashboard.component.css
│   │   │   ├── dashboard.component.html
│   │   │   ├── dashboard.component.spec.ts
│   │   │   └── dashboard.component.ts
│   │   ├── icons
│   │   │   ├── icons.component.css
│   │   │   ├── icons.component.html
│   │   │   ├── icons.component.spec.ts
│   │   │   └── icons.component.ts
│   │   ├── layouts
│   │   │   └── admin-layout
│   │   │   ├── admin-layout.component.html
│   │   │   ├── admin-layout.component.scss
│   │   │   ├── admin-layout.component.spec.ts
│   │   │   ├── admin-layout.component.ts
│   │   │   ├── admin-layout.module.ts
│   │   │   └── admin-layout.routing.ts
│   │   ├── maps
│   │   │   ├── maps.component.css
│   │   │   ├── maps.component.html
│   │   │   ├── maps.component.spec.ts
│   │   │   └── maps.component.ts
│   │   ├── notifications
│   │   │   ├── notifications.component.css
│   │   │   ├── notifications.component.html
│   │   │   ├── notifications.component.spec.ts
│   │   │   └── notifications.component.ts
│   │   ├── table-list
│   │   │   ├── table-list.component.css
│   │   │   ├── table-list.component.html
│   │   │   ├── table-list.component.spec.ts
│   │   │   └── table-list.component.ts
│   │   ├── typography
│   │   │   ├── typography.component.css
│   │   │   ├── typography.component.html
│   │   │   ├── typography.component.spec.ts
│   │   │   └── typography.component.ts
│   │   ├── upgrade
│   │   │   ├── upgrade.component.css
│   │   │   ├── upgrade.component.html
│   │   │   ├── upgrade.component.spec.ts
│   │   │   └── upgrade.component.ts
│   │   └── user-profile
│   │   ├── user-profile.component.css
│   │   ├── user-profile.component.html
│   │   ├── user-profile.component.spec.ts
│   │   └── user-profile.component.ts
│   ├── assets
│   │   ├── css
│   │   │   └── demo.css
│   │   ├── img
│   │   └── scss
│   │   ├── core
│   │   └── material-dashboard.scss
│   ├── environments
│   ├── favicon.ico
│   ├── index.html
│   ├── main.ts
│   ├── polyfills.ts
│   ├── styles.css
│   ├── test.ts
│   ├── tsconfig.app.json
│   ├── tsconfig.spec.json
│   └── typings.d.ts
├── tsconfig.json
├── tslint.json
└── typings
```
## Useful Links
More products from Creative Tim: <http://www.creative-tim.com/bootstrap-themes>
Tutorials: <https://www.youtube.com/channel/UCVyTG4sCw-rOvB9oHkzZD1w>
Freebies: <http://www.creative-tim.com/products>
Affiliate Program (earn money): <http://www.creative-tim.com/affiliates/new>
Social Media:
Twitter: <https://twitter.com/CreativeTim>
Facebook: <https://www.facebook.com/CreativeTim>
Dribbble: <https://dribbble.com/creativetim>
Google+: <https://plus.google.com/+CreativetimPage>
Instagram: <https://instagram.com/creativetimofficial>
[CHANGELOG]: ./CHANGELOG.md
[version-badge]: https://img.shields.io/badge/version-2.1.0-blue.svg
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"material-dashboard-angular": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico"
],
"styles": [
"node_modules/primeicons/primeicons.css",
"node_modules/primeng/resources/themes/nova-light/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/perfect-scrollbar/css/perfect-scrollbar.css",
"src/assets/scss/material-dashboard.scss",
"src/assets/css/demo.css"
],
"scripts": [
"node_modules/jquery/dist/jquery.js",
"node_modules/popper.js/dist/umd/popper.js",
"node_modules/bootstrap-material-design/dist/js/bootstrap-material-design.min.js",
"node_modules/arrive/src/arrive.js",
"node_modules/moment/moment.js",
"node_modules/perfect-scrollbar/dist/perfect-scrollbar.min.js",
"node_modules/bootstrap-notify/bootstrap-notify.js",
"node_modules/chartist/dist/chartist.js"
]
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "material-dashboard-angular:build"
},
"configurations": {
"production": {
"browserTarget": "material-dashboard-angular:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "material-dashboard-angular:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [
"node_modules/jquery/dist/jquery.js",
"node_modules/popper.js/dist/umd/popper.js",
"node_modules/bootstrap-material-design/dist/js/bootstrap-material-design.min.js",
"node_modules/arrive/src/arrive.js",
"node_modules/moment/moment.js",
"node_modules/perfect-scrollbar/dist/perfect-scrollbar.min.js",
"node_modules/bootstrap-notify/bootstrap-notify.js",
"node_modules/chartist/dist/chartist.js"
],
"styles": [
"node_modules/primeicons/primeicons.css",
"node_modules/primeng/resources/themes/nova-light/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/perfect-scrollbar/css/perfect-scrollbar.css",
"src/assets/scss/material-dashboard.scss",
"src/assets/css/demo.css"
],
"assets": [
"src/assets",
"src/favicon.ico"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": []
}
}
}
},
"material-dashboard-angular-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "material-dashboard-angular:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": []
}
}
}
}
},
"defaultProject": "material-dashboard-angular",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
\ No newline at end of file
import { MaterialDashboardAngularPage } from './app.po';
describe('material-dashboard-angular App', () => {
let page: MaterialDashboardAngularPage;
beforeEach(() => {
page = new MaterialDashboardAngularPage();
});
it('should display message saying app works', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('app works!');
});
});
import { browser, element, by } from 'protractor';
export class MaterialDashboardAngularPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types":[
"jasmine",
"node"
]
}
}
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
],
preprocessors: {
},
mime: {
'text/x-typescript': ['ts','tsx']
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'coverage-istanbul']
: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
This diff is collapsed.
{
"name": "sistema-pagos-espe",
"version": "1.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": {
"@agm/core": "1.0.0-beta.2",
"@angular/animations": "^5.2.9",
"@angular/cdk": "5.2.4",
"@angular/common": "5.2.9",
"@angular/compiler": "5.2.9",
"@angular/core": "5.2.9",
"@angular/forms": "5.2.9",
"@angular/http": "5.2.9",
"@angular/material": "5.2.4",
"@angular/platform-browser": "5.2.9",
"@angular/platform-browser-dynamic": "5.2.9",
"@angular/platform-server": "5.2.9",
"@angular/router": "5.2.9",
"ajv": "6.4.0",
"arrive": "2.4.1",
"bootstrap": "4.1.0",
"bootstrap-material-design": "4.1.1",
"bootstrap-notify": "3.1.3",
"chartist": "0.11.0",
"classlist.js": "1.1.20150312",
"core-js": "2.4.1",
"font-awesome": "^4.7.0",
"googleapis": "28.1.0",
"hammerjs": "2.0.8",
"jquery": "3.2.1",
"moment": "^2.24.0",
"perfect-scrollbar": "1.1.0",
"popper.js": "1.14.3",
"primeicons": "^1.0.0",
"primeng": "^6.1.7",
"rxjs": "5.5.10",
"sweetalert2": "^8.8.7",
"tslib": "^1.9.0",
"typescript": "^3.1.1",
"web-animations-js": "2.3.1",
"zone.js": "0.8.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.8",
"@angular/cli": "^7.3.8",
"@angular/compiler-cli": "^7.2.14",
"@angular/language-service": "5.2.9",
"@types/bootstrap": "3.3.32",
"@types/chartist": "0.9.34",
"@types/googlemaps": "^3.30.19",
"@types/jasmine": "2.5.38",
"@types/jquery": "1.10.31",
"@types/node": "6.0.73",
"codelyzer": "4.2.1",
"jasmine-core": "3.1.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "^4.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.4.2",
"karma-jasmine": "1.1.1",
"protractor": "^5.4.2",
"ts-node": "5.0.1",
"tslint": "5.9.1"
}
}
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
beforeLaunch: function() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
},
onPrepare() {
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
<router-outlet></router-outlet>
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app works!'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app works!');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('app works!');
}));
});
import { Component} from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
}
import { PersonaService } from './services/Persona.service';
import { GeneroService } from './services/Genero.service';
import { EstudianteService } from './services/Estudiante.service';
import { CrugerUserService } from './services/CrugeUser.service';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { HttpClientModule } from '@angular/common/http';
import { RouterModule } from '@angular/router';
import { AppRoutingModule } from './app.routing';
import { ComponentsModule } from './components/components.module';
import { AppComponent } from './app.component';
import { NgModule, LOCALE_ID} from '@angular/core';
import { FieldsetModule } from 'primeng/fieldset';
import { ToastModule } from 'primeng/toast';
import { InputMaskModule} from 'primeng/inputmask';
import { AdminLayoutComponent } from './layouts/admin-layout/admin-layout.component';
import { CalendarModule } from 'primeng/calendar';
import { PaginatorModule } from 'primeng/paginator';
@NgModule({
imports: [
BrowserAnimationsModule,
FormsModule,
HttpModule,
ComponentsModule,
RouterModule,
HttpClientModule,
FieldsetModule,
ToastModule,
CalendarModule,
PaginatorModule,
InputMaskModule,
AppRoutingModule
],
declarations: [
AppComponent,
AdminLayoutComponent,
],
providers: [CrugerUserService, EstudianteService, GeneroService, PersonaService, { provide: LOCALE_ID, useValue: 'es' },
],
bootstrap: [AppComponent]
})
export class AppModule { }
import { NgModule } from '@angular/core';
import { CommonModule, } from '@angular/common';
import { BrowserModule } from '@angular/platform-browser';
import { Routes, RouterModule } from '@angular/router';
import { AdminLayoutComponent } from './layouts/admin-layout/admin-layout.component';
const routes: Routes = [
{
path: '',
redirectTo: 'publicaciones/list',
pathMatch: 'full',
}, {
path: '',
component: AdminLayoutComponent,
children: [
{
path: '',
loadChildren: './layouts/admin-layout/admin-layout.module#AdminLayoutModule'
}],
runGuardsAndResolvers: 'always',
},
];
@NgModule({
imports: [
CommonModule,
BrowserModule,
RouterModule.forRoot(routes, {onSameUrlNavigation: 'reload'})
],
exports: [
],
})
export class AppRoutingModule { }
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { FooterComponent } from './footer/footer.component';
import { NavbarComponent } from './navbar/navbar.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { FieldsetModule } from 'primeng/fieldset';
import { ToastModule } from 'primeng/toast';
import { InputMaskModule } from 'primeng/inputmask';
import { CalendarModule } from 'primeng/calendar';
import {PaginatorModule} from 'primeng/paginator';
@NgModule({
imports: [
CommonModule,
RouterModule,
ToastModule,
InputMaskModule,
CalendarModule,
PaginatorModule,
FieldsetModule
],
declarations: [
FooterComponent,
NavbarComponent,
SidebarComponent
],
exports: [
FooterComponent,
NavbarComponent,
SidebarComponent
]
})
export class ComponentsModule { }
<footer class="footer text-white" >
<div class="container-fluid">
<!-- Copyright -->
<div class="copyright text-center">
Universidad de las Fuerzas Armadas ESPE
{{test | date: 'yyyy'}}, &copy; Todos los derechos reservados. -
<img class="img img-responsive" src="/assets/img/logo-blanco-placetoPay.png" alt="placeToPay" width="100">
</div>
<!-- Copyright -->
</div>
</footer><!-- Footer -->
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FooterComponent } from './footer.component';
describe('FooterComponent', () => {
let component: FooterComponent;
let fixture: ComponentFixture<FooterComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FooterComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FooterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
})
export class FooterComponent implements OnInit {
test: Date = new Date();
constructor() { }
ngOnInit() {
}
}
<nav class="navbar navbar-expand-lg navbar-brand navbar-absolute fixed-top">
<div class="container-fluid">
<div class="navbar-wrapper">
<img src="/assets/img/mano.png" alt="EspePay">
<a class="navbar-brand" >Help Desk</a>
</div>
<button mat-raised-button class="navbar-toggler" type="button" (click)="sidebarToggle()">
<span class="sr-only">Toggle navigation</span>
<span class="navbar-toggler-icon icon-bar"></span>
<span class="navbar-toggler-icon icon-bar"></span>
<span class="navbar-toggler-icon icon-bar"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navigation">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link" href="http://example.com" id="navbarDropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="material-icons">help</i>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="#">Mike John responded to your email</a>
<a class="dropdown-item" href="#">You have 5 new tasks</a>
<a class="dropdown-item" href="#">You're now friend with Andrew</a>
<a class="dropdown-item" href="#">Another Notification</a>
<a class="dropdown-item" href="#">Another One</a>
</div>
</li>
</ul>
</div>
</div>
</nav>
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NavbarComponent } from './navbar.component';
describe('NavbarComponent', () => {
let component: NavbarComponent;
let fixture: ComponentFixture<NavbarComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ NavbarComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(NavbarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, ElementRef } from '@angular/core';
import { ROUTES } from '../sidebar/sidebar.component';
import { Location, LocationStrategy, PathLocationStrategy } from '@angular/common';
import { Router } from '@angular/router';
@Component({
selector: 'app-navbar',
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.css']
})
export class NavbarComponent implements OnInit {
private listTitles: any[];
location: Location;
mobile_menu_visible: any = 0;
private toggleButton: any;
private sidebarVisible: boolean;
constructor(location: Location, private element: ElementRef, private router: Router) {
this.location = location;
this.sidebarVisible = false;
}
ngOnInit() {
this.listTitles = ROUTES.filter(listTitle => listTitle);
const navbar: HTMLElement = this.element.nativeElement;
this.toggleButton = navbar.getElementsByClassName('navbar-toggler')[0];
this.router.events.subscribe((event) => {
this.sidebarClose();
const $layer: any = document.getElementsByClassName('close-layer')[0];
if ($layer) {
$layer.remove();
this.mobile_menu_visible = 0;
}
});
}
sidebarOpen() {
const toggleButton = this.toggleButton;
const body = document.getElementsByTagName('body')[0];
setTimeout(function () {
toggleButton.classList.add('toggled');
}, 500);
body.classList.add('nav-open');
this.sidebarVisible = true;
};
sidebarClose() {
const body = document.getElementsByTagName('body')[0];
this.toggleButton.classList.remove('toggled');
this.sidebarVisible = false;
body.classList.remove('nav-open');
};
sidebarToggle() {
// const toggleButton = this.toggleButton;
// const body = document.getElementsByTagName('body')[0];
const $toggle = document.getElementsByClassName('navbar-toggler')[0];
if (this.sidebarVisible === false) {
this.sidebarOpen();
} else {
this.sidebarClose();
}
const body = document.getElementsByTagName('body')[0];
if (this.mobile_menu_visible === 1) {
// $('html').removeClass('nav-open');
body.classList.remove('nav-open');
setTimeout(function () {
$toggle.classList.remove('toggled');
}, 400);
this.mobile_menu_visible = 0;
} else {
setTimeout(function () {
$toggle.classList.add('toggled');
}, 430);
const $layer = document.createElement('div');
$layer.setAttribute('class', 'close-layer');
if (body.querySelectorAll('.main-panel')) {
document.getElementsByClassName('main-panel')[0].appendChild($layer);
} else if (body.classList.contains('off-canvas-sidebar')) {
document.getElementsByClassName('wrapper-full-page')[0].appendChild($layer);
}
setTimeout(function () {
$layer.classList.add('visible');
}, 100);
$layer.onclick = function () { // asign a function
body.classList.remove('nav-open');
this.mobile_menu_visible = 0;
$layer.classList.remove('visible');
setTimeout(function () {
$layer.remove();
$toggle.classList.remove('toggled');
}, 400);
}.bind(this);
body.classList.add('nav-open');
this.mobile_menu_visible = 1;
}
};
getTitle() {
let titlee = this.location.prepareExternalUrl(this.location.path());
if (titlee.charAt(0) === '#') {
titlee = titlee.slice(2);
}
titlee = titlee.split('/').pop();
for (let item = 0; item < this.listTitles.length; item++) {
if (this.listTitles[item].path === titlee) {
return this.listTitles[item].title;
}
}
return titlee;
}
}
oja{
background: "white";
color: "white";
}
\ No newline at end of file
<div class="logo">
<img class="mx-auto d-block" src="/assets/img/Espe-Angular-Logo.png" />
</div>
<div class="sidebar-wrapper">
<div class="container">
<fieldset class="form-group">
<legend>Búsqueda:</legend>
<span class="bmd-form-group">
<label for="cedula" class="font-weight-bold">Cédula/Pasaporte:
</label>
<div class="input-group no-border">
<input type="text" #cedula class="form-control" placeholder="Ingrese su cédula...">
</div>
</span>
<div class="row">
<div class="col-12">
<button mat-raised-button class="btn btn-success btn-round btn-sm pull-center" (click)="buscar(cedula.value)">
<i class="material-icons">search</i>Buscar</button>
<button mat-raised-button class="btn btn-danger btn-round btn-sm pull-center" [routerLink]="['/publicaciones/list']" routerLinkActive="router-link-active" >
Cancelar</button>
</div>
</div>
</fieldset>
</div>
<p-toast [style]="{'marginTop': '80px'}" [style.z-index]="9999"></p-toast>
</div>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SidebarComponent } from './sidebar.component';
describe('SidebarComponent', () => {
let component: SidebarComponent;
let fixture: ComponentFixture<SidebarComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SidebarComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SidebarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { MessageService } from 'primeng/components/common/messageservice';
import { BusquedaComponent } from '../../publicaciones/busqueda/busqueda.component';
declare const $: any;
declare interface RouteInfo {
path: string;
title: string;
icon: string;
class: string;
}
export const ROUTES: RouteInfo[] = [
{ path: '/busqueda', title: 'Buscar', icon: 'search', class: 'nav-pills-info' },
];
@Component({
selector: 'app-sidebar',
templateUrl: './sidebar.component.html',
styleUrls: ['./sidebar.component.css'],
providers: [MessageService]
})
export class SidebarComponent implements OnInit {
menuItems: any[];
busqueda: BusquedaComponent;
constructor(private router: Router, private messageService: MessageService) {
}
ngOnInit() {
this.menuItems = ROUTES.filter(menuItem => menuItem);
}
isMobileMenu() {
if ($(window).width() > 991) {
return false;
}
return true;
}
inicio() {
this.router.navigate(['/publicaciones/list']);
}
buscar(param: string) {
if (param.length) {
// this.inicio();
setTimeout(() => {
this.router.navigate(['/publicaciones/busqueda', param]);
this.messageService.add({ severity: 'success', summary: 'Correcto', detail: 'Se ha realizado la búsqueda' });
}, 50);
} else {
this.messageService.add({ severity: 'error', summary: 'Validación', detail: 'Ingrese una cédula valida' });
}
}
numberOnly(event): boolean {
const charCode = (event.which) ? event.which : event.keyCode;
if (charCode === 13) {
if (event.srcElement.value.length < 10) {
this.messageService.add({ severity: 'error', summary: 'Validación', detail: 'Ingrese una cedula válida' });
} else {
this.buscar(event.srcElement.value);
}
}
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
this.messageService.add({ severity: 'warn', summary: 'Validación', detail: 'Ingrese solo números' });
return false;
}
return true;
}
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { InicioComponent } from './inicio.component';
describe('InicioComponent', () => {
let component: InicioComponent;
let fixture: ComponentFixture<InicioComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ InicioComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(InicioComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-inicio',
templateUrl: './inicio.component.html',
styleUrls: ['./inicio.component.css']
})
export class InicioComponent {
}
<div class="wrapper">
<div class="sidebar" data-color="danger" data-background-color="white" data-image="../assets/img/sidebar-1.jpg">
<app-sidebar></app-sidebar>
<div class="sidebar-background" style="background-image: url(../assets/img/sidebar-4.jpg)"></div>
</div>
<div class="main-panel">
<app-navbar></app-navbar>
<router-outlet></router-outlet>
<div *ngIf="isMaps('maps')">
<app-footer></app-footer>
</div>
</div>
</div>
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AdminLayoutComponent } from './admin-layout.component';
describe('AdminLayoutComponent', () => {
let component: AdminLayoutComponent;
let fixture: ComponentFixture<AdminLayoutComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AdminLayoutComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AdminLayoutComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
import { Location, LocationStrategy, PathLocationStrategy, PopStateEvent } from '@angular/common';
import 'rxjs/add/operator/filter';
import { NavbarComponent } from '../../components/navbar/navbar.component';
import { Router, NavigationEnd, NavigationStart } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import PerfectScrollbar from 'perfect-scrollbar';
@Component({
selector: 'app-admin-layout',
templateUrl: './admin-layout.component.html',
styleUrls: ['./admin-layout.component.scss']
})
export class AdminLayoutComponent implements OnInit {
private _router: Subscription;
private lastPoppedUrl: string;
private yScrollStack: number[] = [];
constructor(public location: Location, private router: Router) { }
ngOnInit() {
const isWindows = navigator.platform.indexOf('Win') > -1 ? true : false;
if (isWindows && !document.getElementsByTagName('body')[0].classList.contains('sidebar-mini')) {
// if we are on windows OS we activate the perfectScrollbar function
document.getElementsByTagName('body')[0].classList.add('perfect-scrollbar-on');
} else {
document.getElementsByTagName('body')[0].classList.remove('perfect-scrollbar-off');
}
const elemMainPanel = <HTMLElement>document.querySelector('.main-panel');
const elemSidebar = <HTMLElement>document.querySelector('.sidebar .sidebar-wrapper');
this.location.subscribe((ev: PopStateEvent) => {
this.lastPoppedUrl = ev.url;
});
this.router.events.subscribe((event: any) => {
if (event instanceof NavigationStart) {
if (event.url !== this.lastPoppedUrl) {
this.yScrollStack.push(window.scrollY);
}
} else if (event instanceof NavigationEnd) {
if (event.url === this.lastPoppedUrl) {
this.lastPoppedUrl = undefined;
window.scrollTo(0, this.yScrollStack.pop());
} else {
window.scrollTo(0, 0);
}
}
});
this._router = this.router.events.filter(event => event instanceof NavigationEnd).subscribe((event: NavigationEnd) => {
elemMainPanel.scrollTop = 0;
elemSidebar.scrollTop = 0;
});
if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac()) {
let ps = new PerfectScrollbar(elemMainPanel);
ps = new PerfectScrollbar(elemSidebar);
}
}
isMaps(path) {
let titlee = this.location.prepareExternalUrl(this.location.path());
titlee = titlee.slice(1);
if (path === titlee) {
return false;
} else {
return true;
}
}
runOnRouteChange(): void {
if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac()) {
const elemMainPanel = <HTMLElement>document.querySelector('.main-panel');
const ps = new PerfectScrollbar(elemMainPanel);
ps.update();
}
}
isMac(): boolean {
let bool = false;
if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) {
bool = true;
}
return bool;
}
}
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AdminLayoutRoutes } from './admin-layout.routing';
import { InicioComponent } from '../../inicio/inicio.component';
import { ListComponent } from '../../publicaciones/list/list.component';
import { EditComponent } from '../../publicaciones/edit/edit.component';
import { CreateComponent } from '../../publicaciones/create/create.component';
import { InputMaskModule} from 'primeng/inputmask';
import { CalendarModule } from 'primeng/calendar';
import { BusquedaComponent } from '../../publicaciones/busqueda/busqueda.component';
import {
MatButtonModule,
MatInputModule,
MatRippleModule,
MatTooltipModule,
} from '@angular/material';
@NgModule({
imports: [
CommonModule,
RouterModule.forChild(AdminLayoutRoutes),
FormsModule,
MatButtonModule,
CalendarModule,
MatRippleModule,
MatInputModule,
MatTooltipModule,
InputMaskModule
],
declarations: [
InicioComponent,
ListComponent,
EditComponent,
CreateComponent,
BusquedaComponent,
]
})
export class AdminLayoutModule {}
import { Routes } from '@angular/router';
import { InicioComponent } from '../../inicio/inicio.component';
import { ListComponent } from '../../publicaciones/list/list.component';
import { EditComponent } from '../../publicaciones/edit/edit.component';
import { CreateComponent } from '../../publicaciones/create/create.component';
import { BusquedaComponent } from '../../publicaciones/busqueda/busqueda.component';
export const AdminLayoutRoutes: Routes = [
{ path: 'inicio', component: InicioComponent },
{ path: 'publicaciones/list', component: ListComponent },
{ path: 'publicaciones/edit', component: EditComponent },
{ path: 'publicaciones/create', component: CreateComponent },
{ path: 'publicaciones/busqueda/:cedula', component: BusquedaComponent },
];
export class CrugerUser {
public iduser: number;
public username: string;
public email: string;
public password: string;
public state: number;
public totalsessioncounter: number;
public currentsessioncounter: string;
}
export class Estudiante {
public TIE_CODIGO: number;
public TIE_NOMBRE: string;
}
export class Genero{
public GEN_CODIGO: number;
public GEN_NOMBRE: string;
public GEN_BANNER: string;
}
export class Persona {
public PER_CODIGO: number;
public PER_CEDULA: string;
public PER_APELLIDO: string;
public PER_NOMBRE: string;
public PER_DIRECCION: string;
public PER_CELULAR: string;
public PER_TELEFONO: string;
public PER_CORREO: string;
public PER_PASSWORD: string;
public PER_CORREOA: string;
public ETN_CODIGO: string;
}
<div class="main-content" >
<div class="container-fluid">
<div class="card">
<div class="card-header card-header-danger">
<h4 class="card-title">Persona</h4>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<table>
<tr>
<th scope="col" class="th-sm">NOMBRES</th>
<th scope="col" class="th-sm">APELLIDOS</th>
<th scope="col" class="th-sm">CÉDULA</th>
<th scope="col" class="th-sm">GENERO</th>
<th scope="col" class="th-sm">ETNIA</th>
<th scope="col" class="th-sm">ESTUDIANTE</th>
<th scope="col" class="th-sm">TELEFONO</th>
<th scope="col" class="th-sm">CELULAR</th>
<th scope="col" class="th-sm">CORREO PERSONAL</th>
<th scope="col" class="th-sm">CORREO ESPE</th>
<th scope="col" class="th-sm">DIRECCION</th>
<th scope="col" class="th-sm">CONTRASEÑA</th>
<th scope="col" class="th-sm">ACCIONES</th>
</tr>
</table>
</thead>
<tbody>
<table *ngIf="personaData">
<tr>
<td>{{personaData.nombre}}</td>
<td>{{personaData.apellido}}</td>
<td>{{personaData.cedula}}</td>
<td>{{personaData.genero.nombre}}</td>
<td>{{personaData.etniaCodigo}}</td>
<td>{{personaData.estudiante.nombre}}</td>
<td>{{personaData.telefono}}</td>
<td>{{personaData.celular}}</td>
<td>{{personaData.correoPersonal}}</td>
<td>{{personaData.correoEspe}}</td>
<td>{{personaData.direccion}}</td>
<td>{{personaData.password}}</td>
<td>
<input class="editIcon" type="image" src="./../../../assets/img/edit.png" [routerLink]="['/publicaciones/edit']" routerLinkActive="router-link-active" (click)="edit(personaData,crugeruserData)">
<p></p>
<input class="editIcon" type="image" src="./../../../assets/img/delete.png" (click)="Borrar(personaData,crugeruserData)">
</td>
</tr>
</table>
<table>
<tr>
<td><b>CÉDULA</b></td>
<td><b>CORREOESPE</b></td>
<td><b>PASSWORD</b></td>
</tr>
</table>
<table *ngIf="crugeruserData">
<tr>
<td>{{crugeruserData.cedula}}</td>
<td>{{crugeruserData.correoEspe}}</td>
<td>{{crugeruserData.password}}</td>
</tr>
</table>
</tbody>
</table>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { CrugerUserService } from './../../services/CrugeUser.service';
import { CrugerUser } from './../../models/CrugerUser';
import { Persona } from '../../models/Persona';
import { PersonaService } from '../../services/Persona.service';
import { Component, OnInit, OnDestroy } from '@angular/core';
import { RouterModule, ActivatedRoute, Router, NavigationEnd } from '@angular/router';
import Swal from 'sweetalert2';
@Component({
selector: 'app-busqueda',
templateUrl: './busqueda.component.html',
styleUrls: ['./busqueda.component.css']
})
export class BusquedaComponent implements OnInit, OnDestroy {
navigationSubcription;
public personaData: Array<Persona>;
public crugeruserData: Array<CrugerUser>;
cedula: number;
datos: boolean;
title = 'sweetalert';
// tslint:disable-next-line: max-line-length
constructor(private personaService: PersonaService, private crugeruserService: CrugerUserService, private route: ActivatedRoute, private router: Router) {
this.cedula = this.route.snapshot.params.cedula;
this.navigationSubcription = this.router.events.subscribe((e: any) => {
if (e instanceof NavigationEnd) {
this.Busqueda_por_CEDULA();
}
});
}
Busqueda_por_CEDULA() {
this.cedula = this.route.snapshot.params.cedula;
console.log(this.cedula);
this.buscarDatosPersonaCed(this.cedula);
this.buscarDatosCrugeruserCed(this.cedula);
}
ngOnInit() {
const url = this.route.snapshot.pathFromRoot.pop().url.map(u => u.path).join('/');
this.router.navigateByUrl(url);
}
buscarDatosPersonaCed(cedula) {
this.personaService.buscarDatosPersonaCedula(cedula).subscribe
(data => {
if (data) {
this.personaData = JSON.parse(data._body);
console.log('this.personaData', this.personaData);
this.datos = true;
if (Object.keys(data).length === 0) {
this.datos = false;
}
}
},
err => {
console.log(err);
});
}
buscarDatosCrugeruserCed(cedula) {
this.crugeruserService.buscarDatosCrugeruserCedula(cedula).subscribe
(data => {
if (data) {
this.crugeruserData = JSON.parse(data._body);
console.log('this.crugeruserData', this.crugeruserData);
this.datos = true;
if (Object.keys(data).length === 0) {
this.datos = false;
}
}
},
err => {
console.log(err);
});
}
enviar(cedula: Number) {
this.router.navigate(['/confirmacion/', cedula]);
}
// tslint:disable-next-line: use-life-cycle-interface
ngOnDestroy() {
if (this.navigationSubcription) {
this.navigationSubcription.unsubscribe();
}
}
Borrar(personaData: Persona, crugeruserData: CrugerUser) {
if (personaData === undefined) {return; }
this.personaService.deletePersonas(personaData)
.subscribe( respuesta => {
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000
});
Toast.fire({
type: 'success',
title: 'Se borro con exito'
});
this.personaData = respuesta;
console.log (respuesta)
});
if (crugeruserData === undefined) {return; }
this.crugeruserService.deleteCrugeruser(crugeruserData)
.subscribe( respuesta => {
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000
});
Toast.fire({
type: 'success',
title: 'Se borro con exito'
});
this.crugeruserData = respuesta;
console.log (respuesta)
});
}
public edit(personaData: Persona, crugeruserData: CrugerUser): void {
sessionStorage.setItem('personaData', JSON.stringify(personaData));
sessionStorage.setItem('crugeruserData', JSON.stringify(crugeruserData));
}
}
body{
background: #000000;
color:#fff;
}
editIcon{
cursor: pointer;
}
\ No newline at end of file
<div class="main-content">
<div class="container-fluid">
<div class="card">
<div class="card-header card-header-danger">
<h4 class="card-title">Persona</h4>
</div>
<div class="table-responsive-xl">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" class="th-sm">NOMBRES</th>
<th scope="col" class="th-sm">APELLIDOS</th>
<th scope="col" class="th-sm">CEDULA</th>
<th scope="col" class="th-sm">GENERO</th>
<th scope="col" class="th-sm">ETNIA</th>
<th scope="col" class="th-sm">ESTUDIANTE</th>
<th scope="col" class="th-sm">TELEFONO</th>
<th scope="col" class="th-sm">CELULAR</th>
<th scope="col" class="th-sm">CORREO PERSONAL</th>
<th scope="col" class="th-sm">CORREO ESPE</th>
<th scope="col" class="th-sm">DIRECCION</th>
<th scope="col" class="th-sm">ACCIONES</th>
</tr>
</thead>
<tbody *ngFor="let persona of personas">
<tr>
<td>{{persona.nombre}}</td>
<td>{{persona.apellido}}</td>
<td>{{persona.cedula}}</td>
<td>{{persona.genero.nombre}}</td>
<td>{{persona.etniaCodigo}}</td>
<td>{{persona.estudiante.nombre}}</td>
<td>{{persona.telefono}}</td>
<td>{{persona.celular}}</td>
<td>{{persona.correoPersonal}}</td>
<td>{{persona.correoEspe}}</td>
<td>{{persona.direccion}}</td>
<td>
<input class="editIcon" type="image" src="./../../../assets/img/edit.png" >
<p></p>
<input class="editIcon" type="image" src="./../../../assets/img/delete.png" (click)="deletePersonas(persona)">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CreateComponent } from './create.component';
describe('CreateComponent', () => {
let component: CreateComponent;
let fixture: ComponentFixture<CreateComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CreateComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CreateComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Estudiante } from './../../models/Estudiante';
import { EstudianteService } from './../../services/Estudiante.service';
import { Genero } from './../../models/Genero';
import { GeneroService } from './../../services/Genero.service';
import { Persona } from './../../models/Persona';
import { PersonaService } from './../../services/Persona.service';
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { RouterModule, ActivatedRoute, NavigationEnd, Router } from '@angular/router';
@Component({
selector: 'app-create',
templateUrl: './create.component.html',
styleUrls: ['./create.component.css']
})
export class CreateComponent implements OnInit {
PersonaService: any;
personas: any;
persona: Persona;
date: Date;
constructor(
private http: HttpClient,
private personaDataService: PersonaService,
private router: Router,
) { }
ngOnInit() {
this.buscarDatosPersona();
}
buscarDatosPersona() {
this.personaDataService.buscarDatosPersona( ).subscribe(respuesta => {
this.personas = JSON.parse(respuesta._body);
console.log('this.personas', this.personas);
},
err => {
console.log(err);
}
);
}
public deletePersonas(persona: Persona): void {
this.personaDataService.deletePersonas(persona);
}
}
body{
background: #000000;
color:#fff;
}
\ No newline at end of file
<div class="main-content">
<div class="container-fluid">
<div class="card">
<div class="card-header card-header-danger">
<h4 class="card-title">Mesa De Ayuda</h4>
</div>
<div class="card-body">
<div id="typography">
<div class="container">
<div class="bd-example">
<div class="carousel-item active">
<img src="../../assets/img/imagen5.JPG" class="img3">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DeleteComponent } from './delete.component';
describe('DeleteComponent', () => {
let component: DeleteComponent;
let fixture: ComponentFixture<DeleteComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DeleteComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DeleteComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-delete',
templateUrl: './delete.component.html',
styleUrls: ['./delete.component.css']
})
export class DeleteComponent implements OnInit {
date: Date;
constructor() { }
ngOnInit() {
}
}
body{
background: #000000;
color:#fff;
}
\ No newline at end of file
<div class="main-content">
<div class="container-fluid">
<div class="card">
<div class="card-header card-header-danger">
<h4 class="card-title">EDITAR PERSONA</h4>
<p class="card-category">Help Desk</p>
</div>
<table class="table table-hover">
<tbody>
<table>
<th>
Nombres
<input type="text" class="form-control" name="nombre" id="nombre"
[(ngModel)]="persona.nombre" placeholder="NOMBRES">
</th>
<th>
Apellidos
<input type="text" class="form-control" name="apellido" id="apellido"
[(ngModel)]="persona.apellido" placeholder="APELLIDO">
</th>
<th>
Cédula
<input type="text" class="form-control" name="cedula" id="cedula"
[(ngModel)]="persona.cedula" placeholder="CEDULA">
</th>
<th>
Genero
<input type="text" class="form-control" name="genero" id="genero"
[(ngModel)]="persona.genero.nombre" placeholder="GENERO ">
</th>
<th>
Etnia
<input type="text" class="form-control" name="etnia" id="etnia"
[(ngModel)]="persona.etniaCodigo" placeholder="ETNIA ">
</th>
<th>
Tipo Estudiante
<input type="text" class="form-control" name="estudiante" id="estudiante"
[(ngModel)]="persona.estudiante.nombre" placeholder="ESTUDIANTE ">
</th>
<th>
Telefono
<input type="text" class="form-control" name="telefono" id="telefono"
[(ngModel)]="persona.telefono" placeholder="TELEFONO">
</th>
<th>
Celular
<input type="text" class="form-control" name="celular" id="celular"
[(ngModel)]="persona.celular" placeholder="CELULAR">
</th>
<th>
Correo Personal
<input type="text" class="form-control" name="correo personal" id="correo personal"
[(ngModel)]="persona.correoPersonal" placeholder="CORREO PERSONAL">
</th>
<th>
Correo Institucional
<input type="text" class="form-control" name="correo" id="correo"
[(ngModel)]="persona.correoEspe" placeholder="CORREO ESPE">
</th>
<th>
Direccion Domicilio
<input type="text" class="form-control" name="direccion" id="direccion"
[(ngModel)]="persona.direccion" placeholder="DIRECCION">
</th>
<th>
Contraseña
<input type="text" class="form-control" name="contraseña" id="contraseña"
[(ngModel)]="persona.password" placeholder="CONTRASEÑA">
</th>
</table>
<table>
<th>
Cédula
<input type="text" class="form-control" name="cedula" id="cedula"
[(ngModel)]="crugeruser.cedula" placeholder="CEDULA">
</th>
<th>
Correo
<input type="text" class="form-control" name="correoespe" id="correoespe"
[(ngModel)]="crugeruser.correoEspe" placeholder="CORREOESPE">
</th>
<th>
Contraseña
<input type="text" class="form-control" name="password" id="password"
[(ngModel)]="crugeruser.password" placeholder="CONTRASEÑA">
</th>
</table>
<button type="submit" class="btn btn-success" (click)="Actualizar(persona,crugeruser)"
[routerLink]="['/publicaciones/list']" routerLinkActive="router-link-active">Guardar</button>
<button type="button" class="btn btn-danger" [routerLink]="['/publicaciones/list']"
routerLinkActive="router-link-active">Cancelar </button>
<style type="text/css">
option {
font-family: Verdana, Arial;
font-size: 12px;
background-color: #e9e9e9;
}
</style>
</tbody>
</table>
</div>
</div>
</div>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EditComponent } from './edit.component';
describe('EditComponent', () => {
let component: EditComponent;
let fixture: ComponentFixture<EditComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EditComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EditComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { CrugerUserService } from './../../services/CrugeUser.service';
import { CrugerUser } from './../../models/CrugerUser';
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { PersonaService } from './../../services/Persona.service';
import { Persona } from './../../models/Persona';
import Swal from 'sweetalert2';
@Component({
selector: 'app-edit',
templateUrl: './edit.component.html',
styleUrls: ['./edit.component.css']
})
export class EditComponent implements OnInit {
persona: Persona = new Persona();
crugeruser: CrugerUser = new CrugerUser();
title = 'sweetalert';
constructor(private personaDataService: PersonaService, private crugeruserDataService: CrugerUserService) {
if (sessionStorage.getItem('personaData'), sessionStorage.getItem('crugeruserData')) {
this.persona = JSON.parse(sessionStorage.getItem('personaData'));
console.log('hay esta');
this.crugeruser = JSON.parse(sessionStorage.getItem('crugeruserData'));
console.log('hay esta2');
} else {
this.persona = new Persona();
this.crugeruser = new CrugerUser();
}
}
ngOnInit() {
}
Actualizar(personas: Persona, crugerusers: CrugerUser): void {
this.personaDataService.crearOActualizarPersona(personas)
.subscribe(data => {
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000
});
Toast.fire({
type: 'success',
title: 'Se guardo con exito'
});
})
this.crugeruserDataService.saveOrUpdateCrugeUser(crugerusers)
.subscribe(data => {
const Toast = Swal.mixin({
toast: true,
position: 'top-left',
showConfirmButton: false,
timer: 3000
});
Toast.fire({
type: 'success',
title: 'Se guardo con exito'
});
})
}
}
img.img3{
width: 900px;height: 500px;
display:block;
margin:auto;
}
<div class="main-content">
<div class="container-fluid">
<div class="card">
<div class="card-header card-header-danger">
<h4 class="card-title">Sistema de cooperación en la corrección de datos</h4>
</div>
<div class="card-body">
<div id="typography">
<div class="container">
<div class="bd-example">
<div class="carousel-item active">
<img src="../../assets/img/imagen5.JPG" class="img3">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ListComponent } from './list.component';
describe('PublicacionesComponent', () => {
let component: ListComponent;
let fixture: ComponentFixture<ListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { catchError, tap } from 'rxjs/operators';
@Component({
selector: 'app-list',
templateUrl: './list.component.html',
styleUrls: ['./list.component.css']
})
export class ListComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { BusquedaComponent } from './busqueda/busqueda.component';
import { DeleteComponent } from '../publicaciones/delete/delete.component';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { EditComponent } from './edit/edit.component';
import { ListComponent } from './list/list.component';
import { FieldsetModule } from 'primeng/fieldset';
import { ToastModule } from 'primeng/toast';
import { InputMaskModule } from 'primeng/inputmask';
import { CalendarModule } from 'primeng/calendar';
import { PaginatorModule } from 'primeng/paginator';
@NgModule({
imports: [
CommonModule,
RouterModule,
ToastModule,
InputMaskModule,
CalendarModule,
PaginatorModule,
FieldsetModule
],
declarations: [
EditComponent,
ListComponent,
DeleteComponent,
BusquedaComponent
],
exports: [
EditComponent,
ListComponent,
DeleteComponent,
BusquedaComponent
]
})
export class PublicacionesModule { }
import { CrugerUser } from './../models/CrugerUser';
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import { Http , Headers } from '@angular/http';
const httpOptions = {
headers: new Headers({ 'Content-Type': 'aplication/json'})
};
const API_URL_CREATE = 'http://localhost:8080/saveOrUpdateCrugeUser';
const API_URL_CEDULA = 'http://localhost:8080//getCrugeUser/Cedula/cedula?cedula=';
const API_URL_DELETE = 'http://localhost:8080//deleteCrugeUser';
@Injectable()
export class CrugerUserService {
constructor(private http: Http) {}
saveOrUpdateCrugeUser(crugeruser: CrugerUser): Observable<any> {
return this.http.post(API_URL_CREATE, JSON.stringify(crugeruser));
}
buscarDatosCrugeruserCedula(cedula): Observable<any> {
return this.http.get(API_URL_CEDULA + cedula);
}
deleteCrugeruser(crugeruser: CrugerUser): Observable<any> {
return this.http.post(API_URL_DELETE, JSON.stringify(crugeruser));
}
}
import { Observable } from 'rxjs';
import { Estudiante } from '../models/Estudiante';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'aplication/json'})
};
const API_URL = 'http://localhost:8080/getEstudiante';
const API_URL_CREATE = 'http://localhost:8080/saveOrUpdateEstudiante';
@Injectable()
export class EstudianteService {
apiUrl: string;
constructor(private http:HttpClient) {}
buscarEstudiante(): Observable<any>{
return this.http.get(API_URL);
}
crearOActualizarEstudiante(estudiante: Estudiante): Observable<Estudiante[]>{
return this.http.post<Estudiante[]>(API_URL_CREATE,estudiante );
}
}
\ No newline at end of file
import { Observable } from 'rxjs';
import { Genero } from '../models/Genero';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'aplication/json'})
};
const API_URL = 'http://localhost:8080/getGenero';
const API_URL_CREATE = 'http://localhost:8080/saveOrUpdateGenero';
@Injectable()
export class GeneroService {
apiUrl: string;
constructor(private http:HttpClient) {}
buscarGenero(): Observable<any>{
return this.http.get(API_URL);
}
crearOActualizarGenero(genero: Genero): Observable<Genero[]>{
return this.http.post<Genero[]>(API_URL_CREATE,genero );
}
}
\ No newline at end of file
import { Http, Response, Headers} from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { Persona } from '../models/Persona';
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
const httpOptions = {
headers: new Headers({ 'Content-Type': 'aplication/json'})
};
const API_URL = 'http://localhost:8080/getPersonas';
const API_URL_CEDULA = 'http://localhost:8080//getPersonas/Cedula/cedula?cedula=';
const API_URL_APELLIDOS = 'http://localhost:8080//getPersonas/Apellido/apellido?apellido=';
const API_URL_NOMBRES = 'http://localhost:8080//getPersonas/Nombre/{nombre}';
const API_URL_CORREOE = 'http://localhost:8080//getPersonas/CorreoEspe/{correoEspe}';
const API_URL_CORREOP = 'http://localhost:8080//getPersonas/CorreoPersonal/{correoPersonal}';
const API_URL_CREATE = 'http://localhost:8080/saveOrUpdatePersona';
const API_URL_DELETE = 'http://localhost:8080/deletePersonas';
@Injectable()
export class PersonaService {
constructor(private http: Http) {}
buscarDatosPersona(): Observable<any> {
return this.http.get(API_URL);
}
buscarDatosPersonaCedula(cedula): Observable<any> {
return this.http.get(API_URL_CEDULA + cedula);
}
buscarDatosPersonaApellidos(): Observable<any> {
return this.http.get(API_URL_APELLIDOS);
}
buscarDatosPersonaNombres(): Observable<any> {
return this.http.get(API_URL_NOMBRES);
}
buscarDatosPersonaCorreoE(): Observable<any> {
return this.http.get(API_URL_CORREOE);
}
buscarDatosPersonaCorreoP(): Observable<any> {
return this.http.get(API_URL_CORREOP);
}
crearOActualizarPersona(persona: Persona): Observable<any> {
return this.http.post(API_URL_CREATE, JSON.stringify(persona ));
}
deletePersonas(persona: Persona): Observable<any> {
console.log('service', persona)
return this.http.post(API_URL_DELETE, JSON.stringify(persona));
}
}
// import { HttpClient, HttpHeaders, HttpErrorResponse, HttpResponse } from '@angular/common/http';
// import { Http, Response } from '@angular/http';
// import { Injectable, Type } from '@angular/core';
// import { Observable } from 'rxjs/Observable';
// import 'rxjs/add/operator/map';
// import 'rxjs/add/operator/catch';
// import {Publicaciones} from '../models/Publicaciones'
// const httpOptions = {
// headers: new HttpHeaders({ 'Content-type': 'aplication/json' })
// };
// const API_URL = 'http://localhost:8080/sisEventosWs/getDestinos/';
// @Injectable()
// export class PublicacionService {
// apiUrl: string;
// constructor(private http: HttpClient) { }
// buscarPublicaciones(): Observable<Publicaciones[]> {
// return this.http.get<Publicaciones[]>(API_URL);
// }
// }
/*my-app .main-panel .main-content .card{
animation-duration: 750ms;
opacity: 0;
animation-name: fadeIn;
animation-fill-mode: forwards;
}*/
.tim-typo{
padding-left: 25%;
margin-bottom: 40px;
position: relative;
width: 100%;
}
.tim-typo .tim-note{
bottom: 5px;
color: #c0c1c2;
display: block;
font-weight: 400;
font-size: 13px;
line-height: 15px;
left: 0;
margin-left: 20px;
position: absolute;
width: 260px;
}
.font-weight-bold{
font-weight: bold !important;
color: #000;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment