4 <div id="brapi_home_study_observations_div">
6 <h4>Study Observations</h4>
7 <input name="brapi_home_studyobservationsdbid" id="brapi_home_studyobservationsdbid" class="form-control" type="text" placeholder="StudyDbId e.g. 139" value="139"/>
8 <input name="brapi_home_studyobservationdbid1" id="brapi_home_studyobservationdbid1" class="form-control" type="text" placeholder="ObservationDbId e.g. 70741" value="70741"/>
9 <input name="brapi_home_studyobservationdbid2" id="brapi_home_studyobservationdbid2" class="form-control" type="text" placeholder="ObservationDbId e.g. 70666" value="70666"/>
10 <select name="brapi_home_studyobservations_level" id="brapi_home_studyobservations_level" class="form-control" />
11 <option value="all">All</option>
12 <option value="plot">Plot</option>
13 <option value="plant">Plant</option>
15 <button class="btn btn-primary" name="brapi_home_studyobservations_submit" id="brapi_home_studyobservations_submit">Get Observations</button>
17 <div id="brapi_studyobservations_data_result_div">
24 jQuery(document).ready(function() {
25 jQuery("#brapi_home_studyobservations_submit").click(function() {
27 'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/studies/'+jQuery('#brapi_home_studyobservationsdbid').val()+'/observations?observationVariableDbId='+jQuery('#brapi_home_studyobservationdbid1').val()+'&observationVariableDbId='+jQuery('#brapi_home_studyobservationdbid2').val()+'&observationLevel='+jQuery('#brapi_home_studyobservations_level').val(),
29 'beforeSend': function() {
30 jQuery('#working_modal').modal('show');
32 'success': function(response) {
33 jQuery('#working_modal').modal('hide');
34 console.log(response);
35 brapi_create_paginated_table(response.result.data, response.metadata.pagination, 'brapi_studyobservations_data_result_div', jQuery('#brapi_home_url_select').val()+'/brapi/v1/studies/'+jQuery('#brapi_home_studyobservationsdbid').val()+'/observations?observationVariableDbId='+jQuery('#brapi_home_studyobservationdbid1').val()+'&observationVariableDbId='+jQuery('#brapi_home_studyobservationdbid2').val()+'&observationLevel='+jQuery('#brapi_home_studyobservations_level').val(), undefined);
38 error: function(response) {
39 jQuery('#working_modal').modal('hide');
40 alert('An error occurred');