Code Duplication    Length = 7-7 lines in 5 locations

main/gradebook/lib/be/abstractlink.class.php 1 location

@@ 604-610 (lines=7) @@
601
     * @param int $locked 1 or unlocked 0
602
     *
603
     * */
604
    public function lock($locked)
605
    {
606
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
607
        $sql = "UPDATE $table SET locked = '".intval($locked)."'
608
                WHERE id='".$this->id."'";
609
        Database::query($sql);
610
    }
611
612
    /**
613
     * Get current user ranking

main/gradebook/lib/be/category.class.php 2 locations

@@ 732-738 (lines=7) @@
729
    /**
730
     * Not delete this category from the database,when visible=3 is category eliminated
731
     */
732
    public function update_category_delete($course_id)
733
    {
734
        $tbl_grade_categories = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
735
        $sql = 'UPDATE '.$tbl_grade_categories.' SET visible=3
736
                WHERE course_code ="'.Database::escape_string($course_id).'"';
737
        Database::query($sql);
738
    }
739
740
    /**
741
     * Show message resource delete
@@ 1868-1874 (lines=7) @@
1865
1866
     * @return boolean|null
1867
     * */
1868
    public function lock($locked)
1869
    {
1870
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
1871
        $sql = "UPDATE $table SET locked = '".intval($locked)."'
1872
                WHERE id='".intval($this->id)."'";
1873
        Database::query($sql);
1874
    }
1875
1876
    /**
1877
     * @param $locked

main/gradebook/lib/be/evaluation.class.php 1 location

@@ 506-512 (lines=7) @@
503
	/**
504
	 * Delete all results for this evaluation
505
	 */
506
	public function delete_results()
507
	{
508
		$tbl_grade_results = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);
509
		$sql = 'DELETE FROM '.$tbl_grade_results.'
510
				WHERE evaluation_id = '.intval($this->id);
511
		Database::query($sql);
512
	}
513
514
	/**
515
	 * Delete this evaluation and all underlying results.

main/inc/lib/course.lib.php 1 location

@@ 2547-2553 (lines=7) @@
2544
     * @param string $course_code
2545
     * @return integer if exists, false else
2546
     */
2547
    public static function course_exists($course_code)
2548
    {
2549
        $sql = 'SELECT 1 FROM ' . Database::get_main_table(TABLE_MAIN_COURSE) . '
2550
                WHERE code="' . Database::escape_string($course_code) . '"';
2551
2552
        return Database::num_rows(Database::query($sql));
2553
    }
2554
2555
    /**
2556
     * Send an email to tutor after the auth-suscription of a student in your course