public ActionResult radio_buttons(int? symposium_id)
        {
            if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated == true)
            {
                if (symposium_id != null)
                {
                    Symposium symposium = db.Symposiums.Find(symposium_id);
                    ViewBag.Symposium = symposium;
                    ViewBag.Projects = symposium.Projects.ToList();
                    Project[] projects = symposium.Projects.Distinct().ToArray();
                    int array_length = projects.Count();
                    int[] course_ids = new int[array_length];
                    for (int i = 0; i < projects.Count(); i++)
                    {
                        course_ids[i] = projects[i].courseID;
                    }

                    Course[] found_courses = new Course[projects.Count()];

                    for (int i = 0; i < projects.Count(); i++)
                    {

                        found_courses[i] = db.Courses.Find(projects[i].courseID);
                    }
                    found_courses = found_courses.Distinct().ToArray();
                    ViewBag.Course_Count = found_courses.Count();
                    ViewBag.Courses = found_courses;

                }

                return View();
            }
            else
            {
                return RedirectToAction("desktop_vote", "Projects");
            }
        }
        public ActionResult upload_projects(HttpPostedFileBase projects, int symposium_id)
        {
            try
            {

                string filename = DateTime.Now.ToString("yyyy-MM-dd");
                string pathToSave = Server.MapPath(@"\StarVote\Content\");
                if (projects.ContentLength > 0)
                {
                    projects.SaveAs(Path.Combine(pathToSave, filename));
                }
                else
                {
                    return RedirectToAction("Details", "Symposiums", new { id = symposium_id });
                }
                var lines = System.IO.File.ReadAllLines(Server.MapPath(@"\StarVote\Content\" + filename)).Select(a => a.Split(';'));
                foreach (var CSVProject in lines)
                {
                    string courseNumber = CSVProject[1].ToString();
                    string courseName = CSVProject[2].ToString();
                    string Name = CSVProject[0].ToString();

                    if (db.Courses.Where(c => c.courseNumber == courseNumber && c.symposiumID == symposium_id).FirstOrDefault() == null)
                    {
                        Course course = new Course { courseName = courseName, courseNumber = courseNumber, symposiumID = symposium_id };
                        db.Courses.Add(course);
                        db.SaveChanges();
                    }
                    if (db.Projects.Where(p => p.Name == Name && p.symposiumID == symposium_id).FirstOrDefault() == null)
                    {
                        Project project = new Project()
                        {
                            Name = CSVProject[0],
                            CourseNumber = CSVProject[1],
                            students = CSVProject[3]
                        };
                        Course found_course = db.Courses.Where(c => c.courseNumber == courseNumber && c.symposiumID == symposium_id).FirstOrDefault();
                        project.symposiumID = symposium_id;
                        project.courseID = found_course.ID;
                        db.Projects.Add(project);
                    }

                }
                db.SaveChanges();
                return RedirectToAction("Details", "Symposiums", new { id = symposium_id });
                }
            catch
            {
                return View("upload_error");
            }
        }
        public ActionResult dropdown_for_courses(int? symposium_id)
        {
            if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated == true)
            {
                if (symposium_id == null)
                {
                    var symposiums = db.Symposiums.ToList();
                    int i = 0;
                    int count = 0;
                    foreach (var item in symposiums)
                    {

                        count = count + item.Courses.Count();
                    }
                    Course[] found_courses = new Course[db.Courses.Count()];
                    found_courses[0] = db.Courses.First();
                    int ix = 0;
                    var all_courses = db.Courses.ToList();
                    List<Course> list = new List<Course>();
                    foreach (var item in all_courses)
                    {
                        if (list.Where(x => x.courseNumber == item.courseNumber).FirstOrDefault() == null)
                        {
                            list.Add(item);
                            ix++;
                        }
                    }

                       ViewBag.CourseNames = db.Courses.Select(x=> x.courseName).ToArray();

                        ViewBag.CourseNumbers = db.Courses.Select(x => x.courseName);

                    ViewBag.Courses = list;
                    ViewBag.Course_Count = db.Courses.ToList().Count();
                }
                else
                {
                    Symposium found_symposium = db.Symposiums.Find(symposium_id);
                    Project[] projects = found_symposium.Projects.Distinct().ToArray();
                    int array_length = projects.Count();
                    int[] course_ids = new int[array_length];
                    for (int i = 0; i < projects.Count(); i++)
                    {
                        course_ids[i] = projects[i].courseID;
                    }

                    Course[] found_courses = new Course[projects.Count()];

                    for (int i = 0; i < projects.Count(); i++)
                    {

                        found_courses[i] = db.Courses.Find(projects[i].courseID);
                    }
                    found_courses = found_courses.Distinct().ToArray();

                    ViewBag.Course_Count = found_courses.Count();
                    ViewBag.Courses = found_courses;
                }
                return View();
            }
            else
            {
                return RedirectToAction("desktop_vote", "Projects");
            }
        }