<?php
include_once("postget.php");
include_once("common.php");
checklevel(4,$_REQUEST['clientid']);

require_once('phpmydatagrid.class.php');
$charset = $config[72][1];
// $lenguaje = substr($currentlang,0,2);

$objGrid = new datagrid('languagescode.php','1');

$objGrid-> conectadb($db__server,$db__user,$db__password, $db__name);
$objGrid-> tabla ("hd_langcodes");
$objGrid-> keyfield ("code");

$objGrid -> debug = false;

$objGrid -> AjaxChanged('#257104');
$objGrid -> buttons(false, false, false, false, -1, '');
//$objGrid-> buttons(true,true,true,true,0);
$objGrid -> charset = 'UTF-8';
$objGrid -> sqlDataCoding = "SET NAMES 'utf8'";
$objGrid -> sqlcharset = "utf8";
$objGrid -> closeTags(true);  
$objGrid -> datarows(20);
$objGrid -> friendlyHTML();
// $objGrid -> language($lenguaje);
$objGrid -> orderby('name','ASC');
$objGrid -> paginationmode('mixed',false);
$objGrid -> pathtoimages("images/dgimages/");
$objGrid -> poweredby = false;
$objGrid -> reload = true;

$objGrid -> strSearchInline = true;
$objGrid -> toolbar = true;
// $objGrid -> zebraLines = '1';

//$objGrid-> strSearchInline = true;
//$objGrid-> strExportInline = true;


$result = mysql_query("SHOW COLUMNS FROM hd_langcodes");
if (!$result) {
	echo 'Could not run query: ' . mysql_error();
	exit;
}
if (mysql_num_rows($result) > 0) {
	while ($row = mysql_fetch_assoc($result)) {
		if ($row[Field]=='code'){
			$objGrid-> FormatColumn($row[Field],$row[Field],'0','1000','1','20','center','text','','');
			$searchby = 'code';
		}else{
			$objGrid-> FormatColumn($row[Field],$row[Field],'0','1000','0','250','left','text','','');
			$searchby .= ','.$row[Field];
		}
	}
}

$objGrid -> searchby($searchby);

$objGrid -> setHeader('languagescode_grid.php', 'js/data_grid.js', 'css/data_grid.css', '', '',  '');
$objGrid-> ajax('silent');
$objGrid -> AjaxChanged('#CCCCCC');

$objGrid-> grid();

$objGrid -> desconectar();
?>
