File tree 4 files changed +25
-2
lines changed
4 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ public function users(){
245
245
return view ('admin.users ' ,compact ('usersData ' , $ usersData ));
246
246
}
247
247
public function updateRole (Request $ request ){
248
- $ userId =$ request ->userID ;
248
+ $ userId = $ request ->userID ;
249
249
$ role_val = $ request ->role_val ;
250
250
251
251
$ upd_role = DB ::table ('users ' )->where ('id ' ,$ userId )->update (['admin ' =>$ role_val ]);
@@ -254,6 +254,12 @@ public function updateRole(Request $request){
254
254
}
255
255
}
256
256
257
+ public function import_products (Request $ request ){
258
+ $ this ->validate ($ request ,[
259
+ 'file ' => 'required|mimes:csv,txt '
260
+ ]);
261
+
262
+ }
257
263
258
264
259
265
}
Original file line number Diff line number Diff line change 227
227
<span class =" profile-ava" >
228
228
<img alt =" " src =" {{ asset (' admin_theme/img/avatar1_small.jpg' )} }" >
229
229
</span >
230
- <span class =" username" >Admin Name </span >
230
+ <span class =" username" >{{ Auth :: user () -> name } } </span >
231
231
<b class =" caret" ></b >
232
232
</a >
233
233
<ul class =" dropdown-menu extended logout" >
Original file line number Diff line number Diff line change 32
32
});
33
33
// end loop
34
34
<?php } ? >
35
+ $ (' #import_products' ).hide ();
36
+ $ (' #open_importDiv' ).click (function (){
37
+ $ (' #import_products' ).fadeIn ();
38
+ $ (' #open_importDiv' ).hide ();
39
+ });
35
40
});
36
41
37
42
</script >
38
43
<section id =" container" class =" " >
39
44
@include (' admin.sidebar' )
40
45
<section id =" main-content" >
41
46
<section class =" wrapper" >
47
+ <!-- import div here-->
48
+ <div style =" padding :10px ;" class =" col-md-12" >
49
+ <form action =" {{ url (' /admin/import_products' )} }" method =" post" enctype =" multipart/form-data" >
50
+ {{ csrf_field ()} }
51
+ <input type =" file" name =" file" >
52
+ <p style =" color :red " >{{ $errors -> first (' file' )} } </p >
53
+ <input type =" submit" value =" import" class =" btn btn-success" />
54
+ </form >
55
+ </div >
42
56
<div class =" content-box-large" >
43
57
<h1 >Products</h1 >
44
58
<table class =" table table-striped" >
Original file line number Diff line number Diff line change 91
91
Route::get ('/updateRole ' ,'AdminController@updateRole ' );
92
92
93
93
94
+ //import products
95
+ Route::post ('import_products ' ,'AdminController@import_products ' );
96
+
94
97
});
95
98
Route::get ('/logout ' , 'Auth\LoginController@logout ' );
96
99
Route::post ('addToWishList ' , 'HomeController@wishList ' );
You can’t perform that action at this time.
0 commit comments