Minor - spacing, variables names and quoting

1.10.x
Yannick Warnier 10 years ago
parent 469eb65d64
commit e47798649d
  1. 6
      main/inc/lib/thematic.lib.php

@ -662,7 +662,7 @@ class Thematic
// protect data
$id = intval($this->thematic_advance_id);
$tematic_id = intval($this->thematic_id);
$thematic_id = intval($this->thematic_id);
$attendance_id = intval($this->attendance_id);
$content = Database::escape_string($this->thematic_advance_content);
$start_date = Database::escape_string($this->start_date);
@ -673,7 +673,7 @@ class Thematic
if (empty($id)) {
// Insert
$sql = "INSERT INTO $tbl_thematic_advance (c_id, thematic_id, attendance_id, content, start_date, duration)
VALUES ($this->course_int_id, $tematic_id, $attendance_id, '$content', '".api_get_utc_datetime($start_date)."', '$duration') ";
VALUES ($this->course_int_id, $thematic_id, $attendance_id, '$content', '".api_get_utc_datetime($start_date)."', '$duration') ";
$result = Database::query($sql);
$last_id = Database::insert_id();
@ -685,7 +685,7 @@ class Thematic
}
} else {
// update
$sql = "UPDATE $tbl_thematic_advance SET thematic_id = '$tematic_id', attendance_id = '$attendance_id', content = '$content', start_date = '".api_get_utc_datetime($start_date)."', duration = '$duration'
$sql = "UPDATE $tbl_thematic_advance SET thematic_id = $thematic_id, attendance_id = $attendance_id, content = '$content', start_date = '".api_get_utc_datetime($start_date)."', duration = '$duration'
WHERE c_id = {$this->course_int_id} AND id = $id ";
$result = Database::query($sql);
if (Database::affected_rows($result)) {

Loading…
Cancel
Save