Index: PostgreSqlDotnetCore/Controllers/PetCaresController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/PetCaresController.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Controllers/PetCaresController.cs	(revision a850333d2357c1139a7902482a700bca9f59f04c)
@@ -36,4 +36,15 @@
             ViewBag.VetCenters = new SelectList(vetCenters, "id", "name");
 
+
+            // check if the user is authenticated so we can take only his pets
+            if (customerClass != null)
+            {
+                var queryPetsByUser = from st in db.PetsObj
+                                      where st.usersid == customerClass.id
+                                      select st;
+                var userPets = await queryPetsByUser.ToListAsync<PetsClass>();
+                ViewBag.Pets = new SelectList(userPets, "id", "name");
+
+            }
             return View();
         }
@@ -63,29 +74,8 @@
                             select st;
 
-                var userPets =
-                    //db.PetCaresObj.FromSql($"SELECT * FROM pets where usersid={customerClass.id}").ToListAsync();
+                var userPetCares =
                     await query.ToListAsync<Pet_CaresClass>();
 
-                return View(userPets);
-
-                PetCareAllData petCareAllData = new PetCareAllData();
-                petCareAllData.PetCares = userPets;
-
-
-                // query
-                var queryVetCenters = from kk in db.VetCentersObj
-                                      select kk;
-
-                // query
-                var queryUsers = from st in db.CustomerObj
-                                 select st;
-
-                var users = await queryUsers.ToListAsync<UsersClass>();
-                petCareAllData.Users = users;
-
-                //var vetCenters = await queryVetCenters.ToListAsync<VetCenter>();
-                //petCareAllData.VetCenters = vetCenters;
-
-                return View(petCareAllData);
+                return View(userPetCares);
             }
             else
@@ -133,5 +123,5 @@
         [HttpPost]
         [ValidateAntiForgeryToken]
-        public async Task<ActionResult> CreateAsync([Bind(include: "id,title,description,dateending, start_date, usersid, vetcentersid")] Pet_CaresClass peClass)
+        public async Task<ActionResult> CreateAsync([Bind(include: "id,title,description,dateending, start_date, usersid, vetcentersid, pet_id")] Pet_CaresClass peClass)
         {
             bool isAuthenticated = User.Identity.IsAuthenticated;
@@ -143,5 +133,5 @@
             // no access for standard user
             ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
-
+            UsersClass customerClass =  null;
             if (ModelState.IsValid)
             {
@@ -150,5 +140,5 @@
                 peClass.start_date = DateTime.SpecifyKind(peClass.start_date, DateTimeKind.Utc);
                 var user = await _userManager.GetUserAsync(User);
-                var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
+                customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
                 peClass.usersid = customerClass.id;
                 db.PetCaresObj.Add(peClass);
@@ -159,13 +149,14 @@
             ViewBag.VetCenters = new SelectList(vetCenters, "id", "name");
 
-            return View(peClass);
-        }
-
-
-
-
-
-
-
+
+            var queryPetsByUser = from st in db.PetsObj
+                                  where st.usersid == customerClass.id
+                                  select st;
+            var userPets =await queryPetsByUser.ToListAsync<PetsClass>();
+            ViewBag.Pets= new SelectList(userPets, "id", "name");
+
+
+            return View(peClass);
+        }
 
 
@@ -219,5 +210,16 @@
             ViewBag.VetCenters = new SelectList(vetCenters, "id", "name", peClass.vetcentersid);
             // dodadeno na 22.08
-            ViewBag.isAuthenticated = await getCrrentUser();
+            UsersClass customerClass = await getCrrentUser();
+            // check if the user is authenticated so we can take only his pets
+            if (customerClass != null)
+            {
+                var queryPetsByUser = from st in db.PetsObj
+                                      where st.usersid == customerClass.id
+                                      select st;
+                var userPets = await queryPetsByUser.ToListAsync<PetsClass>();
+                ViewBag.Pets = new SelectList(userPets, "id", "name");
+
+            }
+            ViewBag.isAuthenticated = customerClass;
             return View(peClass);
         }
@@ -230,5 +232,5 @@
         [HttpPost]
         [ValidateAntiForgeryToken]
-        public async Task<ActionResult> EditAsync([Bind(include: "id,title,description,dateending, vetcentersid")] Pet_CaresClass peClass)
+        public async Task<ActionResult> EditAsync([Bind(include: "id,title,description,dateending, vetcentersid, pet_id")] Pet_CaresClass peClass)
         {
             bool isAuthenticated = User.Identity.IsAuthenticated;
