Skip to content

Commit d301f5d

Browse files
committed
commit3
1 parent e1dc2e1 commit d301f5d

29 files changed

+278
-163
lines changed

backend/db.json

Lines changed: 21 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,6 @@
77
"password": "123333",
88
"email": "manel@gmail.com"
99
},
10-
{
11-
"id": "89l7OUM",
12-
"name": "",
13-
"username": "",
14-
"email": "hh",
15-
"password": "123"
16-
},
17-
{
18-
"id": "x_wlCej",
19-
"name": "",
20-
"username": "",
21-
"email": "manel@gmail.com",
22-
"password": "123"
23-
},
24-
{
25-
"id": "0D-X1QD",
26-
"name": "",
27-
"username": "",
28-
"email": "manel@gmail.com",
29-
"password": "123"
30-
},
31-
{
32-
"id": "c4XbIGP",
33-
"name": "",
34-
"username": "",
35-
"email": "",
36-
"password": ""
37-
},
38-
{
39-
"id": "N9H9-xm",
40-
"name": "",
41-
"username": "",
42-
"email": "",
43-
"password": ""
44-
},
4510
{
4611
"id": "h",
4712
"name": "h",
@@ -56,20 +21,6 @@
5621
"email": "h",
5722
"password": "h"
5823
},
59-
{
60-
"id": "GRtoBGW",
61-
"name": "",
62-
"username": "",
63-
"email": "",
64-
"password": ""
65-
},
66-
{
67-
"id": "Gn3L1q3",
68-
"name": "",
69-
"username": "",
70-
"email": "",
71-
"password": ""
72-
},
7324
{
7425
"id": "22",
7526
"name": "takwa",
@@ -268,6 +219,27 @@
268219
"email": "ahmed@gmail.com",
269220
"mobile": "25252525",
270221
"position": "chefahmed"
222+
},
223+
{
224+
"id": "21",
225+
"name": "mouhamed",
226+
"email": "mouhamed@gmail.com",
227+
"mobile": "25595696",
228+
"position": "chef"
229+
},
230+
{
231+
"id": "22",
232+
"name": "mounir",
233+
"email": "mounir@gmail.com",
234+
"mobile": "12987452",
235+
"position": "chef"
236+
},
237+
{
238+
"id": "23",
239+
"name": "omar",
240+
"email": "omar@gmail.com",
241+
"mobile": "90526485",
242+
"position": "serveur"
271243
}
272244
]
273245
}

src/app/app-routing.module.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {RouterModule, Routes} from '@angular/router';
2-
import {UsersComponent} from './users/users.component';
2+
//import {UsersComponent} from './users/users.component';
33
import {EdituserComponent} from './edituser/edituser.component';
44
import {DeleteuserComponent} from "./deleteuser/deleteuser.component";
55
import { UpdateComponent } from './update/update.component';
@@ -17,13 +17,14 @@ import { EditplatComponent } from './plat/editplat/editplat.component';
1717
import { AddplatComponent } from './plat/addplat/addplat.component';
1818
import { ListcategoryComponent } from './category/listcategory/listcategory.component';
1919
import { CalculprixComponent } from './plat/calculprix/calculprix.component';
20+
import { ListemployeComponent } from './listemploye/listemploye.component';
2021

2122
const APP_ROUTING: Routes = [
2223
{ path: '', pathMatch: 'full', redirectTo: 'list' },
2324
//{path: '**', redirectTo: 'list'},
2425
{path: 'add/employe', component: EmployeComponent},
2526
{path: 'update/user/:id', component: UpdateComponent},
26-
{path: 'user', component: UsersComponent},
27+
//{path: 'user', component: UsersComponent},
2728
{path: 'user/:id', component: EdituserComponent},
2829
{path: 'delete/user/:id', component: DeleteuserComponent},
2930
{path: 'add/user', component: AdduserComponent},
@@ -39,6 +40,7 @@ const APP_ROUTING: Routes = [
3940
{path: 'add/plat', component: AddplatComponent},
4041
{path: 'list/category', component: ListcategoryComponent},
4142
{path: 'prix', component: CalculprixComponent},
43+
{path: 'list/employe', component: ListemployeComponent},
4244

4345

4446

src/app/app.module.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BrowserModule } from '@angular/platform-browser';
22
import { NgModule } from '@angular/core';
33
import { AppComponent } from './app.component';
4-
import { UsersComponent } from './users/users.component';
4+
//import { UsersComponent } from './users/users.component';
55
import { EdituserComponent } from './edituser/edituser.component';
66
import { DeleteuserComponent } from './deleteuser/deleteuser.component';
77
import {RouterModule} from '@angular/router';
@@ -40,11 +40,13 @@ import { Ng2OrderModule } from 'ng2-order-pipe';
4040
import { NgxPaginationModule} from 'ngx-pagination';
4141
import { pdfMake } from 'pdfmake/build/pdfmake';
4242
import { pdfFonts} from 'pdfmake/build/vfs_fonts';
43+
import { ListemployeComponent } from './listemploye/listemploye.component';
44+
import { CategoryComponent } from './category/category/category.component';
4345

4446
@NgModule({
4547
declarations: [
4648
AppComponent,
47-
UsersComponent,
49+
//UsersComponent,
4850
EdituserComponent,
4951
DeleteuserComponent,
5052
UpdateComponent,
@@ -65,6 +67,8 @@ import { pdfFonts} from 'pdfmake/build/vfs_fonts';
6567
AddplatComponent,
6668
ListcategoryComponent,
6769
CalculprixComponent,
70+
ListemployeComponent,
71+
CategoryComponent,
6872

6973

7074

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.style1{
2+
3+
background-color: #ECDB36;
4+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<td>{{categoryy.id}}</td>
2+
<td>{{categoryy.name}}</td>
3+
<td>{{categoryy.quantity}}</td>
4+
<td>{{categoryy.nbplat}}</td>
5+
<td [ngClass] ="'style1'" > {{like1}}</td>
6+
<td>
7+
<a class="btn btn-sm btn-info text-white" ><i [routerLink]="['/edit/plat/',categoryy.id]" class="fa fa-pencil">edit</i></a>
8+
<a class="btn btn-sm btn-danger text-white ml-1" ><i [routerLink]="['/delete/plat/',categoryy.id]"class="fa fa-trash">delete</i></a>
9+
<a [ngClass] ="'style1'" class="btn btn-sm btn-info text-white ml-1" ><i (click)= "addLike()" class="fa addLike">like</i></a>
10+
11+
12+
</td>

src/app/users/users.component.spec.ts renamed to src/app/category/category/category.component.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
22

3-
import { UsersComponent } from './users.component';
3+
import { CategoryComponent } from './category.component';
44

5-
describe('UsersComponent', () => {
6-
let component: UsersComponent;
7-
let fixture: ComponentFixture<UsersComponent>;
5+
describe('CategoryComponent', () => {
6+
let component: CategoryComponent;
7+
let fixture: ComponentFixture<CategoryComponent>;
88

99
beforeEach(async(() => {
1010
TestBed.configureTestingModule({
11-
declarations: [ UsersComponent ]
11+
declarations: [ CategoryComponent ]
1212
})
1313
.compileComponents();
1414
}));
1515

1616
beforeEach(() => {
17-
fixture = TestBed.createComponent(UsersComponent);
17+
fixture = TestBed.createComponent(CategoryComponent);
1818
component = fixture.componentInstance;
1919
fixture.detectChanges();
2020
});
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Component, OnInit, Input, Output , EventEmitter } from '@angular/core';
2+
import { Category } from 'src/app/model/category';
3+
4+
@Component({
5+
selector: 'app-category',
6+
templateUrl: './category.component.html',
7+
styleUrls: ['./category.component.css']
8+
})
9+
export class CategoryComponent implements OnInit {
10+
@Input() categoryy :Category;
11+
@Output() liked = new EventEmitter() ;
12+
like1: any =0 ;
13+
constructor() { }
14+
SendNotif () {
15+
this.liked.emit() ;
16+
}
17+
ngOnInit(): void {
18+
}
19+
20+
21+
addLike() {
22+
23+
this.like1++ ;
24+
}
25+
26+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
h1 {
2+
color: #F272AC ;
3+
text-shadow: 1px 1px grey;
4+
font-weight: bold;
5+
}

src/app/category/listcategory/listcategory.component.html

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,23 @@
1-
1+
<div class="form-group text-center">
2+
<br><h1> List category </h1>
3+
</div>
24
<table class="table table-borderless">
35
<thead class="thead-light">
46
<th>Id</th>
57
<th>name</th>
68
<th>quantity</th>
79
<th>nbplat</th>
810
<th>like</th>
9-
<th>like</th>
1011

1112

1213
<th>
13-
14-
1514
<a class="btn btn-sm btn-success text-white"[routerLink]="['/add/plat/']"><i class="fa fa-plus"></i> Add Item</a>
1615
</th>
1716
</thead>
1817
<tbody>
1918

2019
<tr *ngFor="let categoryy of category" >
21-
<td>{{categoryy.id}}</td>
22-
<td>{{categoryy.name}}</td>
23-
<td>{{categoryy.quantity}}</td>
24-
<td>{{categoryy.nbplat}}</td>
25-
<td>{{categoryy.like}}</td>
26-
<td>{{like}}</td>
27-
28-
<td>
29-
<a class="btn btn-sm btn-info text-white" ><i [routerLink]="['/edit/plat/',categoryy.id]" class="fa fa-pencil">edit</i></a>
30-
<a class="btn btn-sm btn-danger text-white ml-1" ><i [routerLink]="['/delete/plat/',categoryy.id]"class="fa fa-trash">delete</i></a>
31-
32-
</td>
20+
<app-category [categoryy]="categoryy"></app-category>
3321
</tr>
3422
</tbody>
3523
</table>

src/app/employe/employe.component.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@ h2{
66
.btn{
77
background-color: #F272AC !important;
88
box-shadow :4px 4px 4px grey;
9-
}
9+
}
10+
11+
h1 {
12+
color: #F272AC ;
13+
text-shadow: 1px 1px grey;
14+
font-weight: bold;
15+
}

0 commit comments

Comments
 (0)