CMXX - Translations - updates
This commit is contained in:
@@ -43,7 +43,10 @@ if(isset($get_content) && $get_content!=''){
|
||||
|
||||
if ($v[0] == 'page' || $v[0] =='p' || $v[0] =='totals' || $v[0] =='list' || $v[0] =='history'|| $v[0] =='success_msg'){
|
||||
//do nothing
|
||||
}
|
||||
}
|
||||
elseif ($v[0] == 'generatefile') {
|
||||
$clause .= ' AND language_key = :'.$v[0];
|
||||
}
|
||||
elseif ($v[0] == 'search') {
|
||||
//build up search
|
||||
$clause .= ' AND variable like :'.$v[0];
|
||||
@@ -62,7 +65,9 @@ if(isset($get_content) && $get_content!=''){
|
||||
if(isset($criterias['totals']) && $criterias['totals'] ==''){
|
||||
//Request for total rows
|
||||
$sql = 'SELECT count(*) as count FROM text_variables '.$whereclause.'';
|
||||
}
|
||||
} elseif (isset($criterias['generatefile']) && $criterias['generatefile'] !=''){
|
||||
$sql = 'SELECT tv.variable,tvt.translation FROM text_variables tv JOIN text_variables_translations tvt ON tv.rowID = tvt.variable_ID '.$whereclause.'';
|
||||
}
|
||||
else {
|
||||
//SQL for Paging
|
||||
$sql = 'SELECT * FROM text_variables '.$whereclause.' LIMIT :page,:num_products';
|
||||
@@ -82,7 +87,7 @@ if (!empty($criterias)){
|
||||
if ($key == 'search'){
|
||||
$search_value = '%'.$value.'%';
|
||||
$stmt->bindValue($key, $search_value, PDO::PARAM_STR);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$stmt->bindValue($key, $value, PDO::PARAM_STR);
|
||||
}
|
||||
@@ -95,10 +100,15 @@ if(isset($criterias['totals']) && $criterias['totals']==''){
|
||||
$stmt->execute();
|
||||
$messages = $stmt->fetch();
|
||||
$messages = $messages[0];
|
||||
} elseif(isset($criterias['generatefile']) && $criterias['generatefile'] !=''){
|
||||
//Excute Query
|
||||
$stmt->execute();
|
||||
//Get results
|
||||
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
else {
|
||||
$current_page = isset($criterias['p']) && is_numeric($criterias['p']) ? (int)$criterias['p'] : 1;
|
||||
$stmt->bindValue('page', ($current_page - 1) * $page_rows_products, PDO::PARAM_INT);
|
||||
$stmt->bindValue('page', ($current_page - 1) * $page_rows_translations, PDO::PARAM_INT);
|
||||
$stmt->bindValue('num_products', $page_rows_translations, PDO::PARAM_INT);
|
||||
|
||||
//Excute Query
|
||||
|
||||
Reference in New Issue
Block a user