/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     return view('projects.index');
     $projects = Project::all();
     return view('projects.index', compact('projects'));
 }
Example #2
0
 /**
  * Show the application dashboard.
  *
  * @return Response
  */
 public function index()
 {
     $clients = Client::all();
     $projects = Project::all();
     $notes = ClientNote::all();
     return view('home')->with('clientCount', count($clients))->with('projectCount', count($projects))->with('noteCount', count($notes));
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function directRe($id)
 {
     $proyecto = Project::find($id);
     $boolean = false;
     $projects = Project::all();
     return view('admin.residente.create', compact('proyecto', 'boolean', 'projects'));
 }
Example #4
0
 public function get_single(Request $request, $id)
 {
     $view = view::make("project");
     $view->projects = Project::all();
     $view->active_project = Project::find($id);
     return $view;
 }
 /**
  *  Bind variables to the navigation bar.
  */
 private function composeNavigation()
 {
     view()->composer('nav', function ($view) {
         $view->with('projects', Project::all());
         $view->with('user', Auth::User());
     });
 }
 public function create_project()
 {
     $project_name = $_POST['project_name'];
     $project = Project::create(['name' => $project_name]);
     $projects = Project::all()->toArray();
     return view('Pages.Projects.project_created', compact('projects'));
 }
 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     /**
      * sidebar pm filter (it shows the pm even though the pm is deleted)
      */
     view()->composer('includes.sidebar_home', function ($view) {
         $allprojects = Project::all();
         $fmanagers = [];
         foreach ($allprojects as $project) {
             if (!in_array($project['pm'], $fmanagers)) {
                 $fmanagers[] = $project['pm'];
             }
         }
         $view->with('fmanagers', $fmanagers);
     });
     view()->composer('includes.sidebar_show', function ($view) {
         $allprojects = Project::all();
         $fmanagers = [];
         foreach ($allprojects as $project) {
             if (!in_array($project['pm'], $fmanagers)) {
                 $fmanagers[] = $project['pm'];
             }
         }
         $view->with('fmanagers', $fmanagers);
     });
 }
 /**
  * Display a list of all of the user's tickets.
  *
  * @return Response
  */
 public function index()
 {
     $user = Auth::user();
     //dd($user);
     $projects = Project::all();
     $tickets = $this->tickets->forUser($user);
     return view('dashboard.index', ['projects' => $projects, 'tickets' => $tickets]);
 }
Example #9
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     // Ici on va faire en sorte d'afficher les taches des gens qui les ont créé , on vérifie ca grace a leur email
     // comme ca jean pourra pas voir ce que claude a fait par exemple
     $email = Auth::user();
     $projects = Project::all()->where('mail', $email->email);
     return view('pages.showProjects', compact('projects'));
 }
Example #10
0
 /**
  * @return Response
  */
 public function index()
 {
     $tokens = Token::all();
     $projects = Project::lists('name', 'pid');
     $all_projects = Project::all();
     //Second variable created here to get around weird indexing needed for pivot table in $projects
     return view('tokens.index', compact('tokens', 'projects', 'all_projects'));
 }
 /**
  * Deletes a $num project(s).
  *
  * @param $num
  */
 private function deleteProjects($num)
 {
     $entries = Project::all();
     $toDelete = min($num, count($entries));
     for ($i = 0; $i < $toDelete; $i++) {
         $entries[$i]->delete();
     }
     $this->line('Deleted ' . $toDelete . ' projects.');
 }
 function testRestoreProjectAction()
 {
     Project::find(1)->delete();
     // FIXED fails because Project::find(id) wouldn't return a trashed project
     $this->post('/projects/1/restore')->seeStatusCode(200)->shouldReturnJson();
     $json = $this->_parseJsonResponse();
     $this->assertCount(5, Project::all());
     $this->assertNull($json['deleted_at']);
 }
Example #13
0
 /**
  * Display Backend Area.
  */
 public function backend()
 {
     $users = User::where('id', '<>', 1)->get();
     $categories = Category::all();
     $projects = Project::all();
     $images = Image::all();
     $links = Link::all();
     return view('pages/backend/index')->with('users', $users)->with('categories', $categories)->with('projects', $projects)->with('links', $links)->with('images', $images);
 }
 private function getProjectsIdsArray()
 {
     $result = [];
     $projects = Project::all();
     foreach ($projects as $project) {
         $result[] = $project->id;
     }
     return $result;
 }
Example #15
0
 public function dashboard()
 {
     $prospeks = Prospek::all();
     $projects = Project::all();
     $pelatihans = Pelatihan::all();
     $rpds = Rpd::mine()->where('status', 'BACK TO INITIATOR')->orWhere('status', 'SUBMIT')->orderBy('kode')->paginate(10);
     $users = Pegawai::all();
     $lpds = Lpd::mine()->where('status', 'BACK TO INITIATOR')->orWhere('status', 'SUBMIT')->orWhere('status', 'TAKE PAYMENT')->where('status', 'BACK TO INITIATOR')->orWhere('status', 'PROCESS PAYMENT')->orderBy('kode')->paginate(10);
     return view('dashboard', compact('prospeks', 'projects', 'pelatihans', 'rpds', 'users', 'lpds'));
 }
 public function index()
 {
     $articles = Article::all();
     $tutorials = Tutorial::all();
     $users = User::where('is_sitepoint', false)->get();
     $meetups = Meetup::all();
     $projects = Project::all();
     $bugs = Bugreport::all();
     return view('backend.pages.dashboard', compact('articles', 'tutorials', 'users', 'meetups', 'projects', 'bugs'));
 }
 /**
  * Display a listing of all manageable projects.
  *
  * @return \Illuminate\View\View
  */
 public function manageProjectIndex(Request $request)
 {
     // If request is a search
     if ($request->method() === "PUT") {
         $projects = Project::where('name', 'LIKE', '%' . $request->search . '%')->get();
     } else {
         $projects = Project::all();
     }
     return view('admin.project.index', ['projects' => $projects]);
 }
Example #18
0
 public function get_labels_settings()
 {
     if (!Auth::user()) {
         //echo 'ingelogd';
         return Redirect::route('user_login');
     }
     $view = view::make("settings.labels");
     $view->projects = Project::all();
     $view->tasks = Todo::all();
     return $view;
 }
Example #19
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $users = User::all();
     $count = $users->count();
     $projects = Project::all();
     $comments = Comment::all();
     $categories = Category::all();
     $backers = Backer::all();
     $creators = Creator::all();
     $commentLast = Comment::all()->take(4);
     return view('Admin.index', compact('creators', 'count', 'projects', 'comments', 'categories', 'backers', 'commentLast'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data = Employee::all();
     $name = Auth::user()->name;
     $pos = ProjectOfficer::all();
     $adms = Admin::all();
     $tls = Teamleader::all();
     $mems = Member::all();
     $proj = Project::all();
     $ac = Auth::user()->id;
     $acc = AccessClient::where('id_users', $ac)->get();
     return view('dropmin.dashboard.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('projs', $proj)->with('accss', $acc)->with('datas', $data);
 }
Example #21
0
 public function getUpdateAll()
 {
     // Fetch all projects in Egypt
     $ch = curl_init();
     $projectsUrl = "https://api.betterplace.org/en/api_v4/projects.json?around=Egypt&scope=location&per_page=100";
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_URL, $projectsUrl);
     $projects = json_decode(curl_exec($ch), true);
     curl_close($ch);
     foreach ($projects['data'] as $project) {
         if ($project['country'] == 'Egypt') {
             $projectData = array('external_id' => $project['id'], 'city' => $project['city'], 'country' => $project['country'], 'title' => $project['title'], 'description' => $project['description'], 'tax_deductible' => $project['tax_deductible'], 'donations_prohibited' => $project['donations_prohibited'], 'completed_at' => $project['completed_at'], 'open_amount_in_cents' => $project['open_amount_in_cents'], 'positive_opinions_count' => $project['positive_opinions_count'], 'negative_opinions_count' => $project['negative_opinions_count'], 'donor_count' => $project['donor_count'], 'progress_percentage' => $project['progress_percentage'], 'incomplete_need_count' => $project['incomplete_need_count'], 'completed_need_count' => $project['completed_need_count']);
             // Insert new or update existing project
             $newProject = Project::firstOrNew(array('external_id' => $project['id']));
             $newProject->fill($projectData);
             $newProject->save();
         }
     }
     // Fetch all opinions for the given project
     $mh = curl_multi_init();
     $curl_arr = array();
     $projects = Project::all();
     $totalProjects = $projects->count();
     for ($i = 0; $i < $totalProjects; $i++) {
         $opinionsUrl = "https://api.betterplace.org/de/api_v4/projects/" . $projects[$i]['external_id'] . "/opinions.json?per_page=" . $projects[$i]['donor_count'];
         // Executing requests in parallel
         $curl_arr[$i] = curl_init($opinionsUrl);
         curl_setopt($curl_arr[$i], CURLOPT_SSL_VERIFYPEER, false);
         curl_setopt($curl_arr[$i], CURLOPT_RETURNTRANSFER, true);
         curl_multi_add_handle($mh, $curl_arr[$i]);
     }
     do {
         curl_multi_exec($mh, $running);
     } while ($running > 0);
     for ($i = 0; $i < $totalProjects; $i++) {
         $opinions = json_decode(curl_multi_getcontent($curl_arr[$i]), true);
         foreach ($opinions['data'] as $opinion) {
             // Excluding opinions witothout a donation
             if (isset($opinion['donated_amount_in_cents'])) {
                 $opinionData = array('external_id' => $opinion['id'], 'project_id' => $project['id'], 'donated_amount_in_cents' => $opinion['donated_amount_in_cents'], 'score' => $opinion['score'], 'author' => $opinion['author']['name'], 'message' => $opinion['message'], 'donated_at' => $opinion['created_at']);
                 // Insert new or update existing opinion
                 $newOpinion = Opinion::firstOrNew(array('external_id' => $opinion['id']));
                 $newOpinion->fill($opinionData);
                 $newOpinion->save();
             }
         }
     }
     curl_multi_close($mh);
     return view('projects.update');
 }
Example #22
0
 /**
  * Display all resource based on active project.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function showall()
 {
     $alluser = User::all();
     $logdata = Auth::user();
     if ($logdata->hak_akses == 1) {
         //full access ke data
         $projects = Project::all();
         //add nama dari tabel user
         foreach ($projects as $key => $pro) {
             $gp_nama = json_decode($pro->developer);
             for ($i = 0; $i < count($gp_nama); $i++) {
                 $nama[$i] = DB::table('users')->where('id', $gp_nama[$i])->value('name');
             }
             $res_nama[$key] = collect($nama);
             //////////////////////////////////////////////////////////////////////////////////////////
             //get progress
             $log_all = DB::table('project_logs')->where('project_id', $pro->id)->get();
             $log_done = DB::table('project_logs')->where('project_id', $pro->id)->Where('status', 'Done')->get();
             //$res = (count($log)!= 0)?round((count($log->where('status','Done'))/count($log))*100,0):0
             $prog = count($log_all) != 0 ? count($log_done) / count($log_all) * 100 : 0;
             ///////////////////////////////////////////////////////////////////////////////////////////
             $res_prog[$key] = collect($prog);
         }
         $fin_nama = collect($res_nama);
         $fin_progress = collect($res_prog);
     } else {
         //filter access ke data
         $containId = '%' . $logdata->id . '%';
         $projects = DB::table('projects')->where('developer', 'like', $containId)->get();
         //add nama dari tabel user
         foreach ($projects as $key => $pro) {
             $gp_nama = json_decode($pro->developer);
             for ($i = 0; $i < count($gp_nama); $i++) {
                 $nama[$i] = DB::table('users')->where('id', $gp_nama[$i])->value('name');
             }
             $res_nama[$key] = collect($nama);
             //////////////////////////////////////////////////////////////////////////////////////////
             //get progress
             $log_all = DB::table('project_logs')->where('project_id', $pro->id)->get();
             $log_done = DB::table('project_logs')->where('project_id', $pro->id)->Where('status', 'Done')->get();
             //$res = (count($log)!= 0)?round((count($log->where('status','Done'))/count($log))*100,0):0
             $prog = count($log_all) != 0 ? count($log_done) / count($log_all) * 100 : 0;
             ///////////////////////////////////////////////////////////////////////////////////////////
             $res_prog[$key] = collect($prog);
         }
         $fin_nama = collect($res_nama);
         $fin_progress = collect($res_prog);
     }
     return view('content.Project', ['projects' => $projects, 'fillname' => $fin_nama, 'fillprogress' => $fin_progress, 'users' => $alluser]);
 }
Example #23
0
 public function jsonStats()
 {
     $stats = [];
     $stats['people'] = Person::all()->count();
     $stats['projects'] = Project::all()->count();
     $stats['countries'] = Person::distinct('country_id')->count('country_id');
     $stats['orgs'] = Person::distinct('organization_id')->count('organization_id');
     $stats['peopleAppRole'] = $this->getNumbByCategory(new AppRole(), 'name');
     $stats['peopleCountry'] = $this->getNumbByCategory(new Country(), 'name');
     $stats['peopleReviewerType'] = $this->getNumbByCategory(new ReviewerType(), 'name');
     $stats['peopleReviewType'] = $this->getNumbByCategory(new ReviewType(), 'name');
     $stats['peopleCbType'] = $this->getNumbByCategory(new CBType(), 'name');
     $stats['peopleTopic'] = $this->getNumbByCategory(new Topic(), 'name');
     ksort($stats);
     return json_encode($stats, JSON_PRETTY_PRINT);
 }
Example #24
0
 /**
  *  EVENTS TESTS
  */
 public function stestProjectCreated()
 {
     $project = Project::create($this->projectdata);
     $user = User::firstOrFail();
     // $project->owner()->associate($this->user); // belongsTo
     // $project->owner()->save($this->user); // belongsTo
     $user->userable->ownProjects()->save($project);
     // hasMany
     event(new ProjectCreated($user, $project));
     $this->assertEquals(1, Project::all()->count());
     $this->assertEquals(ProjectCreated::class, $project->feed->type);
     $this->assertEquals(1, $user->userable->ownProjects()->count());
     $this->assertEquals($project->id, $project->feed->feedable_id);
     $this->assertEquals(Project::class, $project->feed->feedable_type);
     $this->assertEquals(0, $project->feed->project_id);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $projects = Project::all();
     //add nama dari tabel user
     foreach ($projects as $key => $pro) {
         //////////////////////////////////////////////////////////////////////////////////////////
         //get progress
         $log_all = DB::table('project_logs')->where('project_id', $pro->id)->get();
         $log_done = DB::table('project_logs')->where('project_id', $pro->id)->Where('status', 'Done')->get();
         //$res = (count($log)!= 0)?round((count($log->where('status','Done'))/count($log))*100,0):0
         $prog = count($log_all) != 0 ? count($log_done) / count($log_all) * 100 : 0;
         ///////////////////////////////////////////////////////////////////////////////////////////
         $res_prog[$key] = collect($prog);
     }
     $fin_progress = collect($res_prog);
     return view('content.summary', ['projects' => $projects, 'fillprogress' => $fin_progress]);
 }
Example #26
0
 public function __construct()
 {
     $A_authors = Author::all();
     view()->share('A_authors', $A_authors);
     $A_projects = Project::all();
     view()->share('A_projects', $A_projects);
     $A_blogs = Blog::all();
     view()->share('A_blogs', $A_blogs);
     $A_newsletters = Newsletter::all();
     view()->share('A_newsletters', $A_newsletters);
     $A_quotations = Quotation::all();
     view()->share('A_quotations', $A_quotations);
     $quotations = Quotation::all();
     //dump($quotations);
     $quotations = count($quotations) > 1 ? $quotations->random(2) : $quotations;
     view()->share('quotations', $quotations);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $author = Auth::user()->id;
     $authRole = Auth::user()->UserRoles->role;
     $undisplayRoleK = "undisplayRole";
     if ($authRole == 1 or $authRole == 3 or $authRole == 9) {
         $projects = Project::all();
     } elseif ($authRole == 5) {
         $projects = Project::where('creator', $author)->get();
     } else {
         $projects = Project::all();
     }
     if ($authRole == 5) {
         $undisplayRoleK = "";
     }
     return view('dropmin/project/index')->with('projs', $projects)->with('undisplayRoleK', $undisplayRoleK);
 }
 /**
  * Run the migrations.
  */
 public function up()
 {
     //
     Schema::table('projects', function (Blueprint $table) {
         $table->dateTime('service_end_time')->nullable();
     });
     foreach (Project::all() as $project) {
         if ($project->check_time) {
             switch ($project->service_unit) {
                 case Project::SERVICE_UNIT_MONTH:
                     $end_time = $project->check_time->copy()->addMonths($project->service_value);
                     break;
                 case Project::SERVICE_UNIT_YEAR:
                     $end_time = $project->check_time->copy()->addYears($project->service_value);
                     break;
                 case Project::SERVICE_UNIT_DAY:
                     $end_time = $project->check_time->copy()->addDays($project->service_value);
                     break;
             }
             $project->service_end_time = $end_time;
             $project->save();
         }
     }
 }
Example #29
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $projects = Project::all();
     return view('projects.home', compact('projects'));
 }
Example #30
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return view('projects.index', ['projects' => Project::all()]);
 }