BI_sqlRECopy.inc
Line #0:<?php // include("QJ_start.php"); //_inc_BI// 2012.10.28. 18:38:38
 
Line #1:
 
Line #2:$szin=" bgcolor='gold' ";
 
Line #3:
 
Line #4:if (isset($_GET[wjid])) $wjid=$_GET[wjid]; else $wjid=$_POST[wjid];
 
Line #5:
 
Line #6:if (isset($_GET[sqlfile])) $sqlfile=$_GET[sqlfile]; else
 
Line #7:if (isset($_GET[tabla])) $sqlfile=$_GET[tabla]; else
 
Line #8:if (isset($_POST[tabla])) $sqlfile=$_POST[tabla];
 
Line #9:
 
Line #10:if (isset($_POST[Qszin]) and $_POST[Qszin]=="yellow" ) $Qszin="silver"; else $Qszin="yellow";
 
Line #11:
 
Line #12://BI_alert($sqlfile);
 
Line #13:
 
Line #14:$szin=" bgcolor='".$Qszin."' ";
 
Line #15:
 
Line #16:if (isset($_POST[dupla])) $szin=" bgcolor='aqua' ";
 
Line #17:
 
Line #18:if ($wjid==-1 or isset($_POST[dupla]))
 
Line #19:{
 
Line #20:
 
Line #21:$szin=" bgcolor='aqua' ";
 
Line #22:
 
Line #23:
 
Line #24:$newcim = "INSERT INTO `$sqlfile`
 
Line #25:( `usr_kod`
 
Line #26:) VALUES
 
Line #27:( '$_SESSION[Qusr_kod]'
 
Line #28:)";
 
Line #29:mysql_query($newcim) or die($newcim."Hiba a $sqlfile insertben");
 
Line #30:
 
Line #31:$keres = "SELECT * FROM  `$sqlfile`  order by wid DESC";
 
Line #32:$csor=mysql_query($keres) or die($keres."Hiba a $sqlfile select-ben");
 
Line #33:
 
Line #34:$cim_sor = mysql_fetch_array( $csor );
 
Line #35:$wjid=$cim_sor[wid];
 
Line #36:}
 
Line #37:
 
Line #38:$eredmeny = mysql_query('show fields from '.$sqlfile);
 
Line #39:$fid='';
 
Line #40:
 
Line #41:while ($row =mysql_fetch_row($eredmeny))
 
Line #42:{
 
Line #43:      $fid.=$row[0] . ":";
 
Line #44:}
 
Line #45:
 
Line #46:$keres = "SELECT * FROM " . $sqlfile. ' WHERE wid='.$wjid;
 
Line #47: 
Line #48:
 
Line #49:$h=split(':',$fid);
 
Line #50:$nur=count($h)-1;
 
Line #51:
 
Line #52:if ($_POST[W]  or isset($_POST[dupla]))
 
Line #53:{
 
Line #54:
 
Line #55:
 
Line #56:$W=$_POST[W];
 
Line #57:$parancs = "UPDATE ".$sqlfile." SET ";
 
Line #58:$vesszo='';
 
Line #59:
 
Line #60:for($j=1;$j<$nur;$j++)
 
Line #61:{
 
Line #62:
 
Line #63: if (isset($_POST[dupla]) and $h[$j]=="datum_kod") $W[$j]=$W[1]."D".substr("00000".$wjid,-5);
 
Line #64: $adat=str_replace("'","~",$W[$j]);
 
Line #65:// $parancs .=$vesszo.$h[$j]."='".$W[$j]."' ";
 
Line #66: $parancs .=$vesszo.$h[$j]."='".$adat."' ";
 
Line #67: $vesszo=', ';
 
Line #68:}
 
Line #69:$parancs .= " WHERE wid ='$wjid' LIMIT 1" ;
 
Line #70:
 
Line #71://BI_alert($parancs);
 
Line #72:
 
Line #73: 
Line #74:
 
Line #75://       echo ($parancs.'<br>'.mysql_error().'<br>');
 
Line #76:       $keres = "SELECT * FROM " . $sqlfile. ' WHERE wid='.$wjid;
 
Line #77: 
Line #78:}
 
Line #79:
 
Line #80:$Qkeres = "SELECT wid FROM " . $sqlfile;
 
Line #81: 
Line #82:$nurL=mysql_num_rows($Qeredmeny);
 
Line #83:
 
Line #84:echo("<a href=javascript:window.close()><font color=blue size=+4>Vissza...</a>");
 
Line #85:
 
Line #86:$bup="<FORM name=orderby action='BI_sqlRECopy.php?&wjid=$wjid&tabla=$sqlfile&sqlfile=$sqlfile' method='post'>";
 
Line #87://$bup="<FORM name=orderby action='../".$_SESSION['Qpath']."/BI_sqlRECopy.php?&wjid=$wjid&tabla=$sqlfile&sqlfile=$sqlfile' method='post'>";
 
Line #88: 
Line #89:$bup.="<table border=1 align=center $szin>";
 
Line #90:$bup.="<td align=left>";
 
Line #91:$bup.="<tr><td align=right><input type='submit' value='Ment' name='submit'>
 
Line #92:</td>";
 
Line #93:$bup.="<td align=center colspan=4><b><font color=blue size=+1>$sqlfile:<font color=blue size=+2>$wjid</font><font color=red size=+2>/$nurL</font></b>";
 
Line #94:$bup.="<input type='hidden' value='$h[0]' name='Wjid'>";
 
Line #95:$bup.="<input type='hidden' value='$Qszin' name='Qszin'>";
 
Line #96:
 
Line #97:
 
Line #98: 
Line #99:
 
Line #100:
 
Line #101:$r=mysql_fetch_row($eredmeny);
 
Line #102:
 
Line #103:$tr="</tr><tr>";
 
Line #104:$colspan="";
 
Line #105:
 
Line #106:for($j=1;$j<$nur;$j++)
 
Line #107:
 
Line #108:{
 
Line #109:
 
Line #110:   $bum='W['.$j.']';
 
Line #111:
 
Line #112:if (strpos($h[$j],"memo")>0 or strpos($h[$j],"parancs")>0 or
 
Line #113:    strpos($h[$j],"_Title")>0 or strpos($h[$j],"_jpg")>0) {
 
Line #114:   $bup.="<tr><td align=right  bgcolor=$Fszin ><b>".$h[$j]."</b></td><td><textarea rows=10 cols=100 name='".$bum."'>".$r[$j]."</textarea></td></tr>";
 
Line #115:} else {
 
Line #116:
 
Line #117:
 
Line #118:   $bup.="<td align=right>".$h[$j]."</td><td $colspan ><input $ronly type='text' size=120 value='".$r[$j]."' name='".$bum."'></td>".$tr;
 
Line #119:}
 
Line #120:
 
Line #121:
 
Line #122:}
 
Line #123:
 
Line #124:
 
Line #125:$bup.="</tr></table></form>";
 
Line #126:
 
Line #127:echo($bup);
 
Line #128:
 
Line #129:echo("<a href=javascript:window.close()><font color=blue size=+4>Vissza...</a>");
 
Line #130:
 
Line #131:
 
Line #132:?>