 |
|
Code (PHP)
<?php
set_time_limit(0);
$g=$_GET['group'];
$dbname=$_GET['dbn'];
$hostmsql=$_POST['hmsql'];
$cport=$_GET['port'];
$usermysql=$_GET['umysql'];
$passmysql=$_GET['pmysql'];
$tb=$_GET['tname'];
$objConnect=oci_connect("$usermysql","$passmysql","$dbname")or die("<font color=red><b>Database connection failed !!</b></font>");
$strSQL = "SELECT * FROM $usermysql.$tb";
$objParse = oci_parse ($objConnect, $strSQL);
oci_execute ($objParse,OCI_DEFAULT);
$intNumField = oci_num_fields($objParse);
$i = 0;
?>
<script language="JavaScript">
function ClickCheckAll(vol)
{
var i=1;
for(i=1;i<=document.frmMain.hdnCount.value;i++)
{
if(vol.checked == true)
{
eval("document.frmMain.chk"+i+".checked=true");
}
else
{
eval("document.frmMain.chk"+i+".checked=false");
}
}
}
</script>
<style type="text/css">
<!--
.style1 {color: #FF0000}
#apDiv1 {
position:absolute;
left:112px;
top:417px;
width:573px;
height:18px;
z-index:1;
}
-->
</style>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="image/banner_small.jpg" width="698" height="189" /></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">กลุ่มแชร์ข้อมูล : <?php echo $g;?></div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><fieldset>
<legend>Table : <?php echo $tb." ".$intNumField." Fields";?></legend>
<div align="center">
<form action="Aindex.php?a=17&group=<?php echo $g;?>&tbn=<?php echo $tb;?>&prot=<?php echo $cport;?>&umysql=<?php echo $usermysql;?>&hmsql=<?php echo $hostmsql;?>&dbn=<?php echo $dbname;?>&pmysql=<?php echo $passmysql;?>" name="frmMain" id="frmMain" method="post" OnSubmit="return onDelete();">
<table width="668" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="73" bgcolor="#C0DEED"><div align="center" class="style1">ลำดับ</div></td>
<td width="510" bgcolor="#C0DEED"><div align="center" class="style1">ชื่อฟิวล์</div></td>
<td width="65" bgcolor="#C0DEED"><div align="center">
<label>
<input name="CheckAll" type="checkbox" id="CheckAll" value="Y" onClick="ClickCheckAll(this);">
</label>
</div></td>
</tr>
<?php
for($i=1;$i<=$intNumField;$i++)
{
$fnameok[$i]=oci_field_name($objParse,$i);
//$typedb[$i]=oci_field_type($objParse,$i);
?>
<tr>
<td bgcolor="#F5F5F5"><div align="center"><?php echo $i;?></div>
<div align="center"></div><div align="center"></div></td>
<td bgcolor="#F5F5F5"><div align="left"><?php echo oci_field_name($objParse,$i);?></div></td>
<td bgcolor="#F5F5F5"><div align="center">
<label>
<input type="checkbox" name="chk[]" id="chk<?php echo $i;?>" value="<?php echo oci_field_name($objParse,$i);?>"/>
<input type="hidden" name="tdb[]" id="tdb<?php echo $i;?>" value="<?php echo oci_field_type($objParse,$i);?>"/>
</label>
</div></td>
</tr>
<?php
}
?>
</table>
<table width="665" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="107"> </td>
<td width="187"> </td>
<td width="301"><div align="right"> </div></td>
<td width="70"><label>
<input type="submit" name="button" id="button" value="แชร์ข้อมูล" />
<input type="hidden" name="hdnCount" value="<?php echo $i;?>"/>
</label></td>
</tr>
</table>
</form>
<br />
</div>
</fieldset> </td>
</tr>
<tr>
<td align="center">
<div style="width: 690px; height: 500px; overflow: scroll;">
<table width="322" border="0" align="center" cellpadding="2" cellspacing="2">
<?php
$shosql = "SELECT * FROM $usermysql.$tb";
$ssq = oci_parse ($objConnect, $shosql);
oci_execute ($ssq);
$s=0;
?>
<tr>
<?php
for($s=1;$s<$i;$s++){
$fname=oci_field_name($objParse,$s);
?>
<td bgcolor="#C0DEED" align="left"><?php echo $fname;?></td>
<?php
}
while($memus=oci_fetch_array($ssq)){
$m++;
?>
</tr>
<tr>
<?php
for($o=1;$o<$s;$o++){
$fname=oci_field_name($objParse,$o);
$fieldn[$o]=$fname;
?>
<td bgcolor="#F5F5F5" align="left"><?php echo $memus[$fnameok[$o]];?></td>
<?php
}
?>
</tr>
<?php
}
?>
</table></div></td>
</tr>
</table>
|
ประวัติการแก้ไข 2011-08-18 13:46:04
 |
 |
 |
 |
Date :
2011-08-18 13:43:05 |
By :
ds |
|
 |
 |
 |
 |
|
|
 |