Changed trials-in-common page to use a single database query to get analyses. Changed...
[sgn.git] / mason / breeders_toolbox / cross / add_cross_dialogs.mas
blobbb030f5843af7835074529cbee704e84802a25e8
1 <%args>
2 $locations
3 </%args>
5 <style>
6   .ui-autocomplete {
7   max-height: 100px;
8   overflow-y: auto;
9   /* prevent horizontal scrollbar */
10   overflow-x: hidden;
11   }
13   /* IE 6 doesn't support max-height
14   * we use height instead, but this forces the menu to always be this tall
15   */
16   * html .ui-autocomplete {
17   height: 100px;
18   }
19 </style>
21 <div class="modal fade" id="create_cross" name="create_cross" tabindex="-1" role="dialog" aria-labelledby="createNewCrossesDialog">
22     <div class="modal-dialog modal-xl" role="document">
23         <div class="modal-content ui-front">
24             <div class="modal-header">
25                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
26                 <h4 class="modal-title" id="createNewCrosses">Add New Cross</h4>
27             </div>
28             <div class="modal-body">
29                 <div class="container-fluid">
31                     <&| /util/workflow.mas, id=> "add_cross_workflow" &>
32                         <&| /util/workflow.mas:step, title=> "Intro" &>
33                             <& /page/page_title.mas, title=>"What is a cross?" &>
35                             <ul>
36                                 <li>The Cross Tool can track any pollinations in a breeding program.</li>
37                                 <li>Each cross has a globally unique cross id.</li>
38                                 <li>Supported cross types are: biparental, self, open, backcross, sib, polycross, bulk, bulk_self, bulk_open, doubled_haploid, or dihaploid_induction</li>
39                                 <li>For an open pollinated cross, the cross can be defined as between female accession A and male population P1 (populations in the database are defined strictly as groups of accessions). If the male parent is not known, it can be left blank.</li>
40                                 <li>For backcross cross type, cross unique id can be used as one of the parents.</li>
41                                 <li>An individual cross can be linked to the specific female plot or plant, as well as to the specific male plot or plant.</li>
42                                 <li>A cross can have other data associated to it, such as number of flowers, pollination date, etc.</li>
43                                 <li>Seed produced by a cross can be managed using a seedlot.</li>
44                                 <li>Progenies from a cross can become named accessions in the database.</li>
45                             </ul>
47                             <br/>
48                             <center>
49                                 <button id="next_step_cross_intro" class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
50                             </center>
51                         </&>
52                         <&| /util/workflow.mas:step, title=> "Crossing Experiment" &>
53                             <& /page/page_title.mas, title=>"Select a crossing experiment" &>
55                             <p>Crossing experiments are for grouping crosses together. The grouping is most often done for crosses derived from the same field trial, the same year, or for crosses that have the same breeding objective.</p>
56                             <center>
57                                 <button class="btn btn-info" name="create_crossingtrial_link">If you need to create a crossing experiment, click here</button><br/><br/>
58                                 <button id="next_step_cross_experiment" class="btn btn-primary" onclick="Workflow.complete(this);">Once you have a crossing experiment, go to Next Step</button>
59                             </center>
61                         </&>
63                         <form class="form-horizontal" role="form" name="create_cross_form" id="create_cross_form">
65                             <&| /util/workflow.mas:step, title=> "Enter cross information" &>
66                                 <& /page/page_title.mas, title=>"Enter basic information about the cross" &>
68                                 <&| /page/explanation.mas, title=>'Cross Type information' &>
69                                     <p>
70                                         <b>Cross type information</b>
71                                         <br>
72                                         <a id="cross_type_info">Descriptions of cross types</a>
73                                     </p>
74                                 </&>
75                                 <div class="form-group">
76                                     <label class="col-sm-3 control-label">Breeding Program: </label>
77                                     <div class="col-sm-9">
78                                         <div id="add_cross_breeding_program_select_div" name="add_cross_breeding_program_select_div">
79                                         </div>
80                                     </div>
81                                 </div><br/><br/><br/>
82                                 <div class="form-group">
83                                     <label class="col-sm-3 control-label">Crossing Experiment: </label>
84                                     <div class="col-sm-9">
85                                         <div id="add_cross_crossing_experiment_select_div" name="add_cross_crossing_experiment_select_div" >
86                                         </div>
87                                     </div>
88                                 </div><br/><br/>
89                                 <div class="form-group">
90                                     <label class="col-sm-3 control-label">Cross Unique ID: </label>
91                                     <div class="col-sm-9">
92                                         <input class="form-control" type="text" id="cross_name" name="cross_name" />
93                                     </div>
94                                 </div><br/><br/>
95                                 <div class="form-group">
96                                     <label class="col-sm-3 control-label">Cross Combination (optional): </label>
97                                     <div class="col-sm-9">
98                                         <input class="form-control" type="text" id="dialog_cross_combination" name="dialog_cross_combination" placeholder="e.g. female_name/male_name"/>
99                                     </div>
100                                 </div><br/><br/>
101                                 <div class="form-group">
102                                     <label class="col-sm-3 control-label">Cross Type: </label>
103                                     <div class="col-sm-9">
104                                         <select class="form-control" id="cross_type">
105                                             <option value="">Select a cross type</option>
106                                             <option value="biparental">biparental</option>
107                                             <option value="self">self</option>
108                                             <option value="open">open pollinated</option>
109                                             <option value="backcross">backcross</option>
110                                             <option value="sib">sib</option>
111                                             <option value="bulk">bulk</option>
112                                             <option value="bulk_self">bulk selfed</option>
113                                             <option value="bulk_open">bulk and open pollinated</option>
114                                             <option value="doubled_haploid">doubled haploid</option>
115                                             <option value="dihaploid_induction">dihaploid induction</option>
116                                             <option value="polycross">polycross</option>
117                                             <option value="reciprocal">reciprocal</option>
118                                             <option value="multicross">multicross</option>
119                                         </select>
120                                     </div>
121                                 </div>
122                                 <br/><br/>
123                                 <center>
124                                     <button id="next_step_cross_information" class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
125                                 </center>
126                             </&>
127                             <&| /util/workflow.mas:step, title=> "Enter parentage information" &>
128                                 <& /page/page_title.mas, title=>"Enter basic information about the cross" &>
130                                 <div class="form-group" id="get_maternal_parent" style="display: none">
131                                     <label class="col-sm-2 control-label">Female Parent: </label>
132                                     <div class="col-sm-10">
133                                         <input class="form-control" id="maternal_parent" type="text" name="maternal" placeholder="Enter female parent name" />
134                                     </div><br/><br/>
135                                 </div>
136                                 <div class="form-group" id="get_paternal_parent" style="display: none">
137                                     <label class="col-sm-2 control-label">Male Parent: </label>
138                                     <div class="col-sm-10">
139                                         <input class="form-control" id="paternal_parent" type="text" name="paternal" placeholder="Enter male parent name"  />
140                                     </div><br/><br/>
141                                 </div>
142                                 <div class="form-group" id="get_selfed_parent" style="display: none">
143                                     <label class="col-sm-2 control-label">Selfed Parent: </label>
144                                     <div class="col-sm-10">
145                                         <input class="form-control" id="selfed_parent" type="text" name="selfed" placeholder="Enter parent name" />
146                                     </div><br/><br/>
147                                 </div>
148                                 <div class="form-group" id="get_open_maternal_parent" style="display: none">
149                                     <label class="col-sm-2 control-label">Female Parent: </label>
150                                     <div class="col-sm-10">
151                                         <input class="form-control" id="open_maternal_parent" type="text" name="open maternal" placeholder="Enter female parent name" />
152                                     </div><br/><br/>
153                                 </div>
154                                 <div class="form-group" id="get_open_paternal_population" style="display: none">
155                                     <div class="col-sm-2"><center><label class="control-label">Male Population: </label><i>(optional)</i></center></div>
156                                     <div class="col-sm-10">
157                                         <input class="form-control" id="open_paternal_population" type="text" name="open paternal" placeholder="Enter male population name" />
158                                     </div><br/><br/>
159                                 </div>
160                                 <div class="form-group" id="get_bulk_maternal_population" style="display: none">
161                                     <label class="col-sm-2 control-label">Female Population: </label>
162                                     <div class="col-sm-10">
163                                         <input class="form-control" id="bulk_maternal_population" type="text" name="bulk maternal" placeholder="Enter female population name" />
164                                     </div><br/><br/>
165                                 </div>
166                                 <div class="form-group" id="get_bulk_paternal_parent" style="display: none">
167                                     <label class="col-sm-2 control-label">Male Parent: </label>
168                                     <div class="col-sm-10">
169                                         <input class="form-control" id="bulk_paternal_parent" type="text" name="bulk paternal" placeholder="Enter male parent name" />
170                                     </div><br/><br/>
171                                 </div>
172                                 <div class="form-group" id="get_bulk_selfed_population" style="display: none">
173                                     <label class="col-sm-2 control-label">Selfed Population: </label>
174                                     <div class="col-sm-10">
175                                         <input class="form-control" id="bulk_selfed_population" type="text" name="bulk selfed" placeholder="Enter parent population name" />
176                                     </div><br/><br/>
177                                 </div>
178                                 <div class="form-group" id="get_bulk_open_maternal_population" style="display: none">
179                                     <label class="col-sm-2 control-label">Female Population: </label>
180                                     <div class="col-sm-10">
181                                         <input class="form-control" id="bulk_open_maternal_population" type="text" name="bulk open maternal" placeholder="Enter female population name" />
182                                     </div><br/><br/>
183                                 </div>
184                                 <div class="form-group" id="get_bulk_open_paternal_population" style="display: none">
185                                     <div class="col-sm-2"><center><label class="control-label">Male Population: </label><i>(optional)</i></center></div>
186                                     <div class="col-sm-10">
187                                         <input class="form-control" id="bulk_open_paternal_population" type="text" name="bulk open paternal" placeholder="Enter male population name" />
188                                     </div><br/><br/>
189                                 </div>
190                                 <div class="form-group" id="get_doubled_haploid_parent" style="display: none">
191                                     <label class="col-sm-2 control-label">Doubled Haploid Parent: </label>
192                                     <div class="col-sm-10">
193                                         <input class="form-control" id="doubled_haploid_parent" type="text" name="doubled haploid" placeholder="Enter parent name" />
194                                     </div><br/><br/>
195                                 </div>
196                                 <div class="form-group" id="get_dihaploid_induction_parent" style="display: none">
197                                   <label class="col-sm-2 control-label">Dihaploid induction Parent: </label>
198                                   <div class="col-sm-10">
199                                     <input class="form-control" id="dihaploid_induction_parent" type="text" name="dihaploid_induction" placeholder="Enter parent name" />
200                                   </div><br/><br/>
201                                 </div>
202                                 <div class="form-group" id="polycross_accessions" style="display: none">
203                                     <label class="col-sm-2 control-label">Accessions to use in Polycross: </label>
204                                     <div class="col-sm-10">
205                                         <div id="polycross_accession_list"></div>
206                                     </div><br/><br/>
207                                 </div>
208                                 <div class="form-group" id="reciprocal_accessions" style="display: none">
209                                     <label class="col-sm-2 control-label">Accessions to use in Reciprocal cross: </label>
210                                     <div class="col-sm-10">
211                                         <div id="reciprocal_accession_list"></div>
212                                     </div><br/><br/>
213                                 </div>
214                                 <div class="form-group" id="maternal_accessions" style="display: none">
215                                     <label class="col-sm-2 control-label">Multicross Female Parents: </label>
216                                     <div class="col-sm-10">
217                                         <div id="maternal_accession_list"></div>
218                                     </div><br/><br/>
219                                 </div>
220                                 <div class="form-group" id="paternal_accessions" style="display: none">
221                                     <label class="col-sm-2 control-label">Multicross Male Parents: </label>
222                                     <div class="col-sm-10">
223                                         <div id="paternal_accession_list"></div>
224                                     </div><br/><br/>
225                                 </div>
226                                 <div class="form-group" id="exact_parents" style="display: none">
227                                     <& /page/page_title.mas, title=>"Optional: If you choose to record exact cross parents, you can do so." &>
229                                     <div class="form-group">
230                                         <label class="col-sm-2 control-label">Field Trial: </label>
231                                         <div class="col-sm-10">
232                                             <div class="input-group">
233                                                 <input type ="text" class ="form-control" id ="field_trial" placeholder="Enter trial name">
234                                                 <div class ="input-group-btn">
235                                                     <button class = "btn btn-info" id ="search_plots"></i>Search Plots</button>
236                                                 </div>
237                                             </div>
238                                         </div>
239                                     </div><br/><br/>
240                                     <div class="form-group">
241                                         <label class="col-sm-2 control-label">Female Plot: </label>
242                                         <div class="col-sm-10">
243                                             <select class="form-control" id="female_plot" name="female_plot">
244                                                 <option value="">Enter trial name first</option>
245                                             </select>
246                                         </div>
247                                     </div><br/><br/>
248                                     <div class="form-group">
249                                         <label class="col-sm-2 control-label">Male Plot: </label>
250                                         <div class="col-sm-10">
251                                             <select class="form-control" id="male_plot" name="male_plot">
252                                                 <option value="">Enter trial name first</option>
253                                             </select>
254                                         </div>
255                                     </div><br/><br/>
256                                 </div>
257                                 <br>
258                                 <center>
259                                     <button id="next_step_basic_information" class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
260                                 </center>
261                             </&>
262                             <&| /util/workflow.mas:step, title=> "Additional cross info" &>
263                                 <& /page/page_title.mas, title=>"If you would like to add auto-generated progeny names for this cross, you can add it here" &>
264                                 <h3>Optional:</h3>
265                                 <table>
266                                 <!--
267                                     <tr>
268                                         <td>
269                                             <div class="form-group">
270                                                 <label class="col-sm-9 control-label">Specify Pollination Date: </label>
271                                                 <div class="col-sm-3">
272                                                     <input id= "pollination_date_checkbox" type="checkbox" />
273                                                 </div>
274                                             </div>
275                                         </td>
276                                         <td>
277                                             <div class="form-group" id="get_pollination_date" style="display: none">
278                                                 <label class="col-sm-6 control-label">Pollination Date (YYYY/MM/DD): </label>
279                                                 <div class="col-sm-6">
280                                                     <input class="form-control" type="text" id="pollination_date" />
281                                                 </div>
282                                             </div>
283                                         </td>
284                                     </tr>
285                                     <tr>
286                                         <td>
287                                             <div class="form-group">
288                                                 <label class="col-sm-9 control-label">Specify Number of Flowers: </label>
289                                                 <div class="col-sm-3">
290                                                     <input id= "flower_number_checkbox" type="checkbox" />
291                                                 </div>
292                                             </div>
293                                             <div class="form-group">
294                                                 <label class="col-sm-9 control-label">Specify Number of Fruits: </label>
295                                                 <div class="col-sm-3">
296                                                     <input id= "fruit_number_checkbox" type="checkbox" />
297                                                 </div>
298                                             </div>
299                                         </td>
300                                         <td>
301                                             <div class="form-group" id="get_flower_number" style="display: none">
302                                                 <label class="col-sm-6 control-label">Number of Flowers: </label>
303                                                 <div class="col-sm-6">
304                                                     <input class="form-control" type="text" id="flower_number" />
305                                                 </div>
306                                             </div>
307                                             <div class="form-group" id="get_fruit_number" style="display: none">
308                                                 <label class="col-sm-6 control-label">Number of Fruits: </label>
309                                                 <div class="col-sm-6">
310                                                     <input class="form-control" type="text" id="fruit_number" />
311                                                 </div>
312                                             </div>
313                                         </td>
314                                     </tr>
315                                     <tr>
316                                         <td>
317                                             <div class="form-group">
318                                                 <label class="col-sm-9 control-label">Specify Number of Seeds: </label>
319                                                 <div class="col-sm-3">
320                                                     <input id= "seed_number_checkbox" type="checkbox" />
321                                                 </div>
322                                             </div>
323                                         </td>
324                                         <td>
325                                             <div class="form-group" id="get_seed_number" style="display: none">
326                                                 <label class="col-sm-6 control-label">Number of Seeds: </label>
327                                                 <div class="col-sm-6">
328                                                     <input class="form-control" type="text" id="seed_number" />
329                                                 </div>
330                                             </div>
331                                         </td>
332                                     </tr>
333                                     -->
334                                     <tr>
335                                         <td>
336                                             <div class="form-group">
337                                                 <label title="You may choose to create accessions for the progeny of the cross at this time." class="col-sm-9 control-label">Add New Accessions for Progeny: </label>
338                                                 <div class="col-sm-3">
339                                                     <input id="create_progeny_checkbox" type="checkbox"/>
340                                                 </div>
341                                             </div>
342                                         </td>
343                                         <td>
344                                             <div class="form-group" id="create_progeny_number" style="display: none">
345                                                 <label class="col-sm-6 control-label">Number of progeny: </label>
346                                                 <div class="col-sm-6">
347                                                     <input class="form-control" type="text" id="progeny_number" />
348                                                 </div>
349                                             </div>
350                                         </td>
351                                     </tr>
352                                     <tr id="use_prefix_suffix" style = "display: none">
353                                         <td>
354                                             <div class="form-group">
355                                                 <label class="col-sm-9 control-label">Use Prefix and/or Suffix: </label>
356                                                 <div class="col-sm-3">
357                                                     <input id="use_prefix_suffix_checkbox" type="checkbox" checked/>
358                                                 </div>
359                                             </div>
360                                         </td>
361                                         <td id="get_prefix_suffix" style="display: none">
362                                             <div class="form-group" >
363                                                 <label class="col-sm-6 control-label">Prefix: </label>
364                                                 <div class="col-sm-6">
365                                                     <input class="form-control" id="prefix" name="prefix" value="P" size="5" />
366                                                 </div>
367                                             </div>
368                                             <div class="form-group" >
369                                                 <label class="col-sm-6 control-label">Suffix: </label>
370                                                 <div class="col-sm-6">
371                                                     <input class="form-control" id="suffix" name="suffix" size="5" />
372                                                 </div>
373                                             </div>
374                                         </td>
375                                     </tr>
376                                 </table>
377                                 <br/>
378                                 <center>
379                                     <button class="btn btn-primary" name="create_cross_submit" id="create_cross_submit" onclick="Workflow.complete(this, false);">Submit Cross</button>
380                                 </center>
381                             </&>
382                         </form>
384                         <&| /util/workflow.mas:complete, title=> "Complete" &>
385                             <& /page/page_title.mas, title=>"Finished! Your cross is now in the database" &>
386                             <p>
387                                 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
388                                 The cross was added successfully
389                             </p>
391                             <ul>
392                                 <li>You may want to proceed to the cross detail page for the cross you just created.</li>
393                                 <li>You can print barcodes for the cross.</li>
394                                 <li>You can add crossing information as it becomes available (e.g. number of seeds, progeny, etc).</li>
395                             </ul>
396                             <br/>
397                         </&>
398                     </&><!-- End of workflow -->
399                 </div>
400             </div>
401             <div class="modal-footer">
402                 <button id="new_cross_close_modal" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
403             </div>
404         </div>
405     </div>
406 </div>
408 <div class="modal fade" id="cross_type_dialog" name="cross_type_dialog" tabindex="-1" role="dialog" aria-labelledby="crossTypeDialog">
409     <div class="modal-dialog modal-lg" role="document">
410         <div class="modal-content">
411             <div class="modal-header">
412                 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
413                 <h4 class="modal-title" id="crossTypeDialog">Template Information</h4>
414             </div>
415             <div class="modal-body">
416                 <div class="container-fluid">
417                     <h2>
418                         Individual Crosses:
419                     </h2>
421                     <p><b>biparental:</b> An individual plant pollinated by another individual plant.</p>
422                     <p><b>self:</b> A self pollinated individual plant.</p>
423                     <p><b>open pollinated:</b> An individual plant pollinated by a group of plants or open pollinated (pollen may be from a group with known or unknown members).</p>
424                     <p><b>backcross:</b> An individual plant pollinated by one of its parents.</p>
425                     <p><b>sib:</b> Mating between individuals that have at least one parent in common. Generally between two individuals within the same plot.</p>
426                     <p><b>bulk:</b> A group of plants (usually a related family) pollinated by an individual plant.</p>
427                     <p><b>bulk selfed:</b> A group of plants (usually a related family) that are self pollinated (each individual selfed, not combined pollen).</p>
428                     <p><b>bulk and open pollinated:</b> A group of plants (usually a related family) that are pollinated by another group of plants or open pollinated (pollen may be from a group with known or unknown members).</p>
429                     <p><b>doubled haploid:</b> Plants derived from doubling the chromosome number of haploid tissue.</p>
430                     <p><b>dihaploid induction:</b> Plants derived from a chromosome reduction from tetraploid to diploid</p>
431                     <br>
433                     <h2>
434                       Group of Crosses:
435                     </h2>
437                     <p><b>polycross:</b> Creates a group of open pollinated crosses. Each accession in the selected list becomes the female parent in an open cross, and all the members of the list grouped together form the male parent.<p>
438                     <p><b>reciprocal:</b> Creates a group of biparental crosses. Starting with a list of accessions, all possible biparental cross combinations are made between them.<p>
439                     <p><b>multicross:</b> Creates a group of biparental crosses. Starting with a list of maternal accessions and a list of paternal accessions, direct crosses are made in order.<p>
440                 </div>
441             </div>
442             <div class="modal-footer">
443                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
444             </div>
445         </div>
446     </div>
447 </div>
449 <div class="modal fade" id="cross_saved_dialog_message" name="cross_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="crossSavedDialog">
450   <div class="modal-dialog" role="document">
451     <div class="modal-content">
452       <div class="modal-header">
453         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
454         <h4 class="modal-title" id="crossSavedDialog">Success</h4>
455       </div>
456       <div class="modal-body">
457         <div class="container-fluid">
458             <p>
459           <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
460           The cross or crosses were saved successfully.
461           </p>
462         </div>
463       </div>
464       <div class="modal-footer">
465         <button id="dismiss_cross_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
466       </div>
467     </div>
468   </div>
469 </div>
471 <script>
473 jQuery.noConflict();
475 jQuery(document).ready(function($) {
477     jQuery("#field_trial").autocomplete({
478         source:'/ajax/stock/project_autocomplete',
479     });
481     $("#search_plots").click(function(e){
482         e.preventDefault();
484         var maternal_parent;
485         if ($('#maternal_parent').val() != ''){
486             maternal_parent = $('#maternal_parent').val();
487         }
489         if ($('#selfed_parent').val() != ''){
490             maternal_parent = $('#selfed_parent').val();
491         }
493         if ($('#open_maternal_parent').val() != ''){
494             maternal_parent = $('#open_maternal_parent').val();
495         }
497         console.log(maternal_parent);
499         jQuery.ajax({
500             url:'/ajax/breeders/get_accession_plots',
501             data:{'field_trial':$('#field_trial').val(),
502                   'parent_accession':maternal_parent,
503                   },
504             success: function(response){
505             console.log(response);
506             var html = '<select id = "female_plot" >';
507             for (var i=0; i<response.data.length; i++) {
508             html = html + "<option value='"+response.data[i][0]+ "'>" + response.data[i][1] + "</option>";
509             }
510             html = html + "</select>";
511             console.log(html);
513             if(i ==''){
514             alert("No female plot");
515             return;
516             }
518             jQuery('#female_plot').html(html);
520             },
521             error:function(response){
522             alert("An error occurred getting female plots.");
523             }
524         });
526         var paternal_parent;
528         if ($('#paternal_parent').val() != ''){
529         paternal_parent = $('#paternal_parent').val();
530         }
532         if ($('#selfed_parent').val() != ''){
533         paternal_parent = $('#selfed_parent').val();
534         }
536         jQuery.ajax({
537             url:'/ajax/breeders/get_accession_plots',
538             data:{'field_trial':$('#field_trial').val(),
539                   'parent_accession':paternal_parent,
540                   },
541             success: function(response){
542             console.log(response);
543             var html = '<select id = "male_plot" >';
544             for (var i=0; i<response.data.length; i++) {
545             html = html + "<option value='"+response.data[i][0]+ "'>" + response.data[i][1] + "</option>";
546             }
547             html = html + "</select>";
548             console.log(html);
550             if(i ==''){
551             alert("No male plot");
552             return;
553             }
555             jQuery('#male_plot').html(html);
557             },
558         });
559     });
562 </script>