/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $scholarship = Scholarship::find($id)->toArray(); $bioData = BioData::find($id)->toArray(); $basicQualification = BasicQualifications::find($id)->toArray(); $highInst = HigherInst::find($id)->toArray(); $profQualification = ProfQualifications::find($id)->toArray(); return Response::json(array($scholarship, $bioData, $basicQualification, $highInst, $profQualification), 200); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { // $scholarship = Scholarship::find($id); $biodata = BioData::find($id); $highinst = HigherInst::find($id); $profQualification = ProfQualifications::find($id); $singleApplicant = new stdClass(); $singleApplicant->scholarship = $scholarship ? $scholarship->toArray() : null; $singleApplicant->bioData = $biodata ? $biodata->toArray() : null; $singleApplicant->higherInst = $highinst ? $highinst->toArray() : null; $singleApplicant->profQualification = $profQualification ? $profQualification->toArray() : null; return Response::json($singleApplicant, 200); }
static function show($prefix) { parent::show($prefix, self::$postfix); }
</div> </div> <div class="sidebar-box"> <form method="get" action="<?php echo get_category_link(4); ?> "> <p class="sidebar-explanatory-text"> Please select any filter terms below and press the submit button to display results </p> <div class="filter category-filter" id="additive-filter"> <h2>View by Scholarship Type</h2> <select multiple id="scholarship_category" class="multiSelect category-select" name="category[]"> <?php Scholarship::getOptionsFromSubcategories(); ?> </select> </div> <div class="filter status-filter"> <h2>Filter By Publication Status</h2> <input type="radio" name="status" value="complete" ><span class="radio-label">Complete</span><br/> <input type="radio" name="status" value="forthcoming" ><span class="radio-label">Forthcoming</span><br /> <input type="radio" name="status" value="both" ><span class="radio-label">Both</span><br/> </div> <div class="filter orderby-filter"> <h2>Order By Date </h2> <h3>Publication Date</h3> <input type="radio" name="orderby" value="pubdate_ASC" ><span class="radio-label">Old to New</span><br/> <input type="radio" name="orderby" value="pubdate_DESC" ><span class="radio-label">New to Old</span> <h3>Posted on Website Date</h3>
public function saveStartApp() { $input = Input::all(); $scholarship = Scholarship::where('user_id', '=', $input['user_id'])->first(); $appData = ApplicationData::where('user_id', '=', $input['user_id'])->first(); $form_comp_data = FormCompleteData::find(Input::all()['user_id']); //checks to see if user already has scholaship details and return the details if they exist, //if it doesnt exist, it inserts a new row in the database with //return var_dump($appData); if (!is_null($scholarship)) { $essayfile_path = $scholarship->essay_url; $essayfile_name = new SplFileInfo($essayfile_path); $essayfile_name = $essayfile_name->getFilename(); $scholarship->reg_number = $scholarship->generateRegNumber($input['user_id'], $input['scholarship_type']['name']); $scholarship->scholarship_type = $input['scholarship_type']['name']; $scholarship->course_of_study = $input['course_of_study']; $scholarship->government_bounded = $input['ready_to_bound'] == 'YES' ? 'YES' : 'NO'; $scholarship->already_in_school = $input['already_in_school'] == 'YES' ? 'YES' : 'NO'; $scholarship->has_admission = $input['has_an_admission'] == 'YES' ? 'YES' : 'NO'; $scholarship->essay_url = $input['path_to_essay']; $scholarship->save(); return Response::json(array("user_id" => $scholarship->user_id, "reg_number" => $scholarship->reg_number, "course_of_study" => $scholarship->course_of_study, "scholarship_type" => $scholarship->scholarship_type, "government_bounded" => $scholarship->government_bounded, "already_in_school" => $scholarship->already_in_school, "has_admission" => $scholarship->has_admission, "essay_url" => $essayfile_name), 200); } else { $scholarship = new Scholarship(); $scholarship->user_id = $input['user_id']; $scholarship->reg_number = $scholarship->generateRegNumber($input['user_id'], $input['scholarship_type']['name']); $scholarship->scholarship_type = $input['scholarship_type']['name']; $scholarship->course_of_study = $input['course_of_study']; $scholarship->government_bounded = $input['ready_to_bound'] == 'YES' ? 'YES' : 'NO'; $scholarship->already_in_school = $input['already_in_school'] == 'YES' ? 'YES' : 'NO'; $scholarship->has_admission = $input['has_an_admission'] == 'YES' ? 'YES' : 'NO'; $scholarship->essay_url = $input['path_to_essay']; $scholarship->push(); $form_comp_data->scholarship_app_completed = "1"; $form_comp_data->save(); $appData->app_progress = 20 + $appData->app_progress; $appData->save(); return Response::json(array("Message" => "Just added New stuff")); } }
<div role="tabpanel" class="tab-pane" id="scholarship"> <?php $author = bp_displayed_user_id(); $rows = $wpdb->get_results($wpdb->prepare("\n SELECT post_id\n FROM wp_postmeta\n WHERE\n \t\t(meta_key = %s\n \t\tAND meta_value = %s)\n \tOR\n \t\t(meta_key LIKE %s \n \t\tAND meta_value = %s\n \t\t)\n ", 'scholarship_author_member', $author, 'scholarship_secondary_authors_%_scholarship_author_member', $author)); $ids = array(); foreach ($rows as $row) { $ids[] = $row->post_id; } if (!empty($ids)) { $args = array('post__in' => $ids, 'meta_key' => 'scholarship_date', 'orderby' => 'meta_value'); $author_query = new WP_Query($args); if ($author_query->have_posts()) { while ($author_query->have_posts()) { $author_query->the_post(); $child_category = Scholarship::get_child_category(get_the_ID()); $class_name = nameToClassName("Scholarship", $child_category); ?> <div class="post"> <div class="post-meta"> <?php $class_name::show('feed'); ?> </div> </div> <?php } } wp_reset_query(); } ?>