Code Duplication    Length = 10-10 lines in 3 locations

app/Controller/ProdutoController.php 2 locations

@@ 33-42 (lines=10) @@
30
			$conditions['limit'] = $_GET['iDisplayLength'];
31
		}
32
33
		if ( isset( $_GET['iSortCol_0'] ) )
34
		{
35
			for ( $i=0 ; $i < intval( $_GET['iSortingCols'] ) ; $i++ )
36
			{
37
				if ( $_GET[ 'bSortable_' . intval($_GET['iSortCol_' . $i]) ] == "true" )
38
				{
39
					$conditions['order'] = array('Produto.' . $aColumns[intval($_GET['iSortCol_' . $i])] => $_GET['sSortDir_'.$i]);
40
				}
41
			}
42
		}
43
44
		if ( isset( $_GET['sSearch'] ) && !empty( $_GET['sSearch'] ) )
45
		{
@@ 130-139 (lines=10) @@
127
			$sql .= ' LIMIT ' . $_GET['iDisplayLength'] . ' OFFSET ' . $_GET['iDisplayStart'];
128
		}
129
130
		if ( isset( $_GET['iSortCol_0'] ) )
131
		{
132
			for ( $i=0 ; $i < intval( $_GET['iSortingCols'] ) ; $i++ )
133
			{
134
				if ( $_GET[ 'bSortable_' . intval($_GET['iSortCol_' . $i]) ] == "true" )
135
				{
136
					$conditions['order'] = array('Produto.' . $aColumns[intval($_GET['iSortCol_' . $i])] => $_GET['sSortDir_'.$i]);
137
				}
138
			}
139
		}
140
		
141
		if ( isset( $_GET['sSearch'] ) && !empty( $_GET['sSearch'] ) )
142
		{

app/Controller/VendaController.php 1 location

@@ 93-102 (lines=10) @@
90
			$conditions['limit'] = $_GET['iDisplayLength'];
91
		}
92
93
		if ( isset( $_GET['iSortCol_0'] ) )
94
		{
95
			for ( $i=0 ; $i < intval( $_GET['iSortingCols'] ) ; $i++ )
96
			{
97
				if ( $_GET[ 'bSortable_' . intval($_GET['iSortCol_' . $i]) ] == "true" )
98
				{
99
					$conditions['order'] = array('Venda.' . $aColumns[intval($_GET['iSortCol_' . $i])] => $_GET['sSortDir_'.$i]);
100
				}
101
			}
102
		}
103
104
		if ( isset( $_GET['sSearch'] ) && !empty( $_GET['sSearch'] ) )
105
		{