|
@@ -41,9 +41,17 @@
|
41
|
41
|
|
42
|
42
|
|
43
|
43
|
<div class="col-md-9">
|
|
44
|
+ <div id="expected-outcome" class="panel panel-default" data-semester-id ="">
|
|
45
|
+ <div class="panel-heading">
|
|
46
|
+ <h3 class="panel-title">
|
|
47
|
+ Expected Target Outcomes
|
|
48
|
+ </h3>
|
|
49
|
+ <input style="width: 150px;" min="0" class="form-control" type="number" >
|
|
50
|
+ </div>
|
|
51
|
+ </div>
|
44
|
52
|
<div id="outcome-display" class="panel panel-default">
|
45
|
53
|
<div class="panel-heading">
|
46
|
|
- <h4 class=" panel-title" style="cursor:auto!important;">
|
|
54
|
+ <h4 class=" panel-title" >
|
47
|
55
|
Primer Semestre 2019-2020
|
48
|
56
|
</h4>
|
49
|
57
|
</div>
|
|
@@ -84,6 +92,8 @@ $(document).ready(function()
|
84
|
92
|
// --------------------------------------------------------------------------
|
85
|
93
|
|
86
|
94
|
// Hide accordion panel contents by default
|
|
95
|
+ // $('.panel-group .panel-body').hide();
|
|
96
|
+
|
87
|
97
|
$('.panel-group .panel-body').hide();
|
88
|
98
|
|
89
|
99
|
$('#outcome-display').parent().hide();
|
|
@@ -97,23 +107,50 @@ $(document).ready(function()
|
97
|
107
|
// --------------------------------------------------------------------------
|
98
|
108
|
|
99
|
109
|
// When list item is clicked, load corresponding info
|
|
110
|
+ $('#expected-outcome .form-control').on('change', function(){
|
|
111
|
+
|
|
112
|
+ program_id = {{$program->id}};
|
|
113
|
+
|
|
114
|
+ semester_id = $('#expected-outcome').data('semester-id');
|
|
115
|
+ $.post(
|
|
116
|
+ "../annual-plan-CreateOrEdit/{{$program->id}}",
|
|
117
|
+ {
|
|
118
|
+ program_id: program_id,
|
|
119
|
+ semester_id: semester_id,
|
|
120
|
+ expected_target: $('#expected-outcome .form-control').val(),
|
|
121
|
+ },
|
|
122
|
+
|
|
123
|
+ )
|
|
124
|
+
|
|
125
|
+ });
|
100
|
126
|
|
101
|
127
|
});
|
102
|
|
- function fetchEverything(li)
|
|
128
|
+ // function CreateOrEdit(id){
|
|
129
|
+ // //send data to the database
|
|
130
|
+ // console.log(id);
|
|
131
|
+ // annual_id = $("#"+id);
|
|
132
|
+ // console.log(console.log(annual_id));
|
|
133
|
+ // }
|
|
134
|
+
|
|
135
|
+ function fetchEverything(li)
|
103
|
136
|
{
|
104
|
137
|
var id = $(li).data('outcome-id');
|
105
|
138
|
var name = $(li).data('outcome-name');
|
106
|
139
|
var semester = $(li).data('semester-id');
|
107
|
140
|
var annual_plan = $(li).data('annual-plan');
|
|
141
|
+ $('#expected-outcome').data('semester-id', semester);
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
108
|
145
|
$('#theChange').data('annual-plan', annual_plan);
|
109
|
146
|
$.post(
|
110
|
147
|
"../annual-plan-fetchTYP/{{$program->id}}",
|
111
|
148
|
{ id: id,
|
112
|
149
|
semester: semester
|
113
|
150
|
},
|
|
151
|
+
|
114
|
152
|
function(json)
|
115
|
153
|
{
|
116
|
|
- // Retrieve datatable instance
|
117
|
154
|
|
118
|
155
|
|
119
|
156
|
|
|
@@ -139,6 +176,28 @@ $(document).ready(function()
|
139
|
176
|
|
140
|
177
|
//Display title and definition
|
141
|
178
|
$('#outcome-display .panel-title').html(name);
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+ var expected_target = json.expected_target;
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+ //check the data type of the expected target
|
|
185
|
+ //if the expected_target var is an empty array, set default value
|
|
186
|
+ if(expected_target.length == 0)
|
|
187
|
+ {
|
|
188
|
+ $('#expected-outcome .form-control').val(0);
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+ }
|
|
192
|
+ else
|
|
193
|
+ {
|
|
194
|
+ $('#expected-outcome .form-control').val(expected_target[0].expected_target);
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+ }
|
|
199
|
+
|
|
200
|
+
|
142
|
201
|
|
143
|
202
|
|
144
|
203
|
//Empty table
|