Sfoglia il codice sorgente

cleaned expected target outcome

eduardo-santin 2 anni fa
parent
commit
dc38c8012d

+ 6
- 6
app/controllers/AnnualPlansController.php Vedi File

@@ -292,21 +292,21 @@ class AnnualPlansController extends \BaseController
292 292
   }
293 293
 
294 294
   public function CreateOrEdit($program_id){
295
+
295 296
     $semester_id = Input::get('semester_id');
296 297
     $expected_target = Input::get('expected_target');
297
-    $created_at = Input::get('created_at');
298
-    $updated_at = Input::get('updated_at');
298
+    
299 299
     $exist = DB::select("select * from target_outcomes_program where program_id = {$program_id} and semester_id = {$semester_id}");
300
-    //log both semester and program id
300
+    
301 301
     
302 302
     if($exist){
303
-      //log the in the laravel log
304
-      Log::info("Updating target_outcomes_program");
303
+      //update
305 304
       DB::update("update target_outcomes_program set expected_target = {$expected_target}, updated_at = now() where program_id = {$program_id} and semester_id = {$semester_id}");
306 305
     }
306
+
307
+
307 308
     else{
308 309
       //create a new one
309
-      Log::info("Creating target_outcomes_program");
310 310
       DB::insert("insert into target_outcomes_program (program_id, semester_id, expected_target, created_at, updated_at) values({$program_id}, {$semester_id}, '{$expected_target}', '{now()}', '{now()}')");
311 311
     }
312 312
     return;

+ 7
- 7
app/views/local/managers/shared/annual-plans.blade.php Vedi File

@@ -96,7 +96,7 @@ $(document).ready(function()
96 96
 
97 97
   $('.panel-group .panel-body').hide();
98 98
 
99
-  // $('#outcome-display').parent().hide();
99
+  $('#outcome-display').parent().hide();
100 100
 
101 101
   // --------------------------------------------------------------------------
102 102
   // Functions
@@ -108,8 +108,9 @@ $(document).ready(function()
108 108
 
109 109
    // When list item is clicked, load corresponding info
110 110
    $('#expected-outcome .form-control').on('change', function(){
111
-            //create the expected target in the database
111
+          
112 112
            program_id = {{$program->id}};
113
+
113 114
            semester_id = $('#expected-outcome').data('semester-id');
114 115
             $.post(
115 116
             "../annual-plan-CreateOrEdit/{{$program->id}}",
@@ -118,6 +119,7 @@ $(document).ready(function()
118 119
               semester_id: semester_id,
119 120
               expected_target: $('#expected-outcome .form-control').val(),
120 121
             },
122
+
121 123
             ) 
122 124
       
123 125
            });
@@ -177,12 +179,10 @@ $(document).ready(function()
177 179
 
178 180
 
179 181
         var expected_target = json.expected_target;
180
-        //check the data type of the expected target
181
-        // console.log(expected_target);
182
+
183
+
184
+        //check the data type of the expected target   
182 185
         //if the expected_target var is an empty array, set default value
183
-        var created_at = new Date();
184
-            created_at = created_at.getFullYear()+"-"+created_at.getMonth()+"-"+created_at.getDate()
185
-             + " " + created_at.getHours() + ":" + created_at.getMinutes() + ":" + created_at.getSeconds();
186 186
         if(expected_target.length == 0)
187 187
         {
188 188
           $('#expected-outcome .form-control').val(0);