public function returnView($projects, $map, $cat_name) { $id = Utils::getUserID(); $user = User::getUser($id); $user_number = User::getUserNumber(); $like_number = Projects::countLikes(); $download_number = Projects::countDownloads(); $projects_number = Projects::countProjects(); $cat = Projects::getAllCategory(); $latest_projects = Projects::getLatestProjects(); $map = $this->getMapp($map, $cat_name); $premium = Projects::isPremium($id); $notification = User::getNotification($id); return View::make('home')->with('details_header', $user)->with('total_users', $user_number)->with('projects', $projects)->with("category", $cat)->with("latest_pro", $latest_projects)->with("total_likes", $like_number)->with("total_downloads", $download_number)->with("total_projects", $projects_number)->with("map", $map)->with("premium", $premium)->with("notification", $notification)->with("user_id", $id)->with("success", Input::get('success')); }
public function getProjectToUpdate() { $id = $_GET['i']; Utils::setProjectID($id); $pro_details = Projects::getProjectbyId($id); $category = Projects::getAllCategory(); $t = '<div class="row"> <div class="col-md-12">'; $t .= Form::open(array('class' => 'form-horizontal', 'autocomplete' => 'off', 'id' => 'editProjectForm', 'role' => 'form', 'route' => array('edit', $pro_details[0]->project_id))); $t .= '<div class="form-group"> <label for="title" class="col-sm-2 control-label">Title</label> <div class="col-sm-10"> <input type="text" class="form-control" value="' . $pro_details[0]->title . '" name="pro-title-e" placeholder="Title"/> </div> </div> <div class="form-group"> <label for="description" class="col-sm-2 control-label">Description</label> <div class="col-sm-10"> <textarea rows="5" class="form-control" name="description1" placeholder="Description">' . $pro_details[0]->description . '</textarea> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label" for="Category" >Category</label> <div class="col-sm-10"> <select name="category1" class="form-control">'; foreach ($category as $cat) { if ($pro_details[0]->category_id == $cat->category_id) { $t .= '<option selected value="' . $cat->category_id . '"> ' . $cat->name . ' </option>'; } else { $t .= '<option value="' . $cat->category_id . '">' . $cat->name . ' </option>'; } } $t .= '</select> </div> </div> <div class="modal-footer"> <div class="row"> <div class="col-sm-2"> </div> <div class="col-sm-10"> <input type="button" onclick="d_p_u(' . $pro_details[0]->project_id . ')" id="delete" value="Delete" class="btn btn-m btn-danger pull-left" > </input> <button type="submit" id="update" class="btn btn-primary pull-right" > Update </button> </div> </div> </div>'; $t .= Form::close(); $t .= '</div> </div>'; return $t; }