_Q_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[cim])) $cim=$_GET[cim]; else
Line #7:
Line #8:if (isset($_GET[view])) $view="?".$_GET[view]; else $view="?";
Line #9:if (isset($_GET[update])) $update="?".$_GET[update]; else $update="?";
Line #10:if (isset($_GET[datum_kod])) $datum_kod=$_GET[datum_kod]; else $_GET[datum_kod]="*";
Line #11:if (isset($_GET[tabla])) $sqlfile=$_GET[tabla];
Line #12:if (isset($_POST[Qszin]) and $_POST[Qszin]=="yellow" ) $Qszin="silver"; else $Qszin="yellow";
Line #13:
Line #14:if (isset($_GET[delete])) {
Line #15: $hivname="delete";
Line #16:
Line #17:
Line #18:} else {
Line #19: $hivname="submit";
Line #20:
Line #21:
Line #22:}
Line #23:
Line #24:if (isset($_SESSION[_Q_title])) {
Line #25:// echo($_SESSION[_Q_title]."<hr>");
Line #26:
Line #27: $t=split(';',$_SESSION[_Q_title]);
Line #28: $nurT=count($t)-1;
Line #29:
Line #30: for($j=0;$j<$nurT;$j++)
Line #31: {
Line #32: // echo($t[$j]."<hr>");
Line #33: }
Line #34:}
Line #35:
Line #36:// echo("~~$wjid~~~~$view~~~~$update~~~~$datum_kod~~~~$sqlfile~~~$Qszin~~~<hr>");
Line #37:
Line #38:$szin=" bgcolor='".$Qszin."' ";
Line #39:
Line #40:if (isset($_POST[delete])) {
Line #41:
Line #42:$datum_kod="_".substr($datum_kod,-9);
Line #43:
Line #44:$parancs = "UPDATE ".$sqlfile." SET datum_kod='$datum_kod' WHERE wid ='$wjid' LIMIT 1" ;
Line #45:
Line #46://
Line #47:
Line #48:
Line #49:
Line #50:// echo ($parancs.'<br>'.mysql_error().'<br>');
Line #51:// alert('$_SESSION[_Q_refress] ? $_SESSION[_Q_target]');
Line #52:
Line #53:if (isset($_SESSION[_Q_refress]))
Line #54: echo "<script language = javascript>
Line #55: window.open('$_SESSION[_Q_refress]','$_SESSION[_Q_target]');
Line #56: </script>";
Line #57:
Line #58:
Line #59:exit;
Line #60:}
Line #61:
Line #62:
Line #63:if (isset($_POST[dupla])) $szin=" bgcolor='aqua' ";
Line #64:
Line #65:if ($wjid==-1 or isset($_POST[dupla]))
Line #66:{
Line #67:
Line #68:$szin=" bgcolor='aqua' ";
Line #69:
Line #70:
Line #71:$newcim = "INSERT INTO `$sqlfile`
Line #72:( `usr_kod`
Line #73:) VALUES
Line #74:( '$_SESSION[Qusr_kod]'
Line #75:)";
Line #76:mysql_query($newcim) or die($newcim."Hiba a $sqlfile insertben");
Line #77:
Line #78:$keres = "SELECT * FROM `$sqlfile` order by wid DESC";
Line #79:$csor=mysql_query($keres) or die($keres."Hiba a $sqlfile select-ben");
Line #80:
Line #81:$cim_sor = mysql_fetch_array( $csor );
Line #82:$wjid=$cim_sor[wid];
Line #83:}
Line #84:
Line #85:$eredmeny = mysql_query('show fields from '.$sqlfile);
Line #86:$fid='';
Line #87:
Line #88:while ($row =mysql_fetch_row($eredmeny))
Line #89:{
Line #90: $fid.=$row[0] . ":";
Line #91:}
Line #92:
Line #93:$keres = "SELECT * FROM " . $sqlfile. ' WHERE wid='.$wjid;
Line #94:
Line #95:
Line #96:$h=split(':',$fid);
Line #97:$nur=count($h)-1;
Line #98:
Line #99:if ($_POST[W] or isset($_POST[dupla]))
Line #100:{
Line #101:
Line #102:
Line #103:$W=$_POST[W];
Line #104:$parancs = "UPDATE ".$sqlfile." SET ";
Line #105:$vesszo='';
Line #106:
Line #107:for($j=1;$j<$nur;$j++)
Line #108:{
Line #109:
Line #110:// if (isset($_POST[dupla]) and $h[$j]=="datum_kod") $W[$j]=$W[1]."D".substr("00000".$wjid,-5);
Line #111: if (isset($_POST[dupla]) and $h[$j]=="datum_kod") $W[$j]=$datum_kod;
Line #112: $adat=str_replace("'","~",$W[$j]);
Line #113:// $parancs .=$vesszo.$h[$j]."='".$W[$j]."' ";
Line #114: $parancs .=$vesszo.$h[$j]."='".$adat."' ";
Line #115: $vesszo=', ';
Line #116:}
Line #117:$parancs .= " WHERE wid ='$wjid' LIMIT 1" ;
Line #118:
Line #119://
Line #120:
Line #121:
Line #122:// echo ($parancs.'<br>'.mysql_error().'<br>');
Line #123:// alert('$_SESSION[_Q_refress] ? $_SESSION[_Q_target]');
Line #124:
Line #125:if (isset($_SESSION[_Q_refress]))
Line #126: echo "<script language = javascript>
Line #127: window.open('$_SESSION[_Q_refress]','$_SESSION[_Q_target]');
Line #128: </script>";
Line #129:
Line #130:
Line #131: $keres = "SELECT * FROM " . $sqlfile. ' WHERE wid='.$wjid;
Line #132:
Line #133:}
Line #134:
Line #135:$Qkeres = "SELECT wid FROM " . $sqlfile;
Line #136:
Line #137:$nurL=mysql_num_rows($Qeredmeny);
Line #138:
Line #139://echo("<a href=javascript:window.close()><font color=blue size=+4>Vissza...</a>");
Line #140:
Line #141:$bup="<FORM name=orderby action='_Q_sqlRECopy.php?&wjid=$wjid&tabla=$sqlfile&view=$view&update=$update&datum_kod=$datum_kod' method='post'>";
Line #142:$bup.="<table border=1 align=center $szin>";
Line #143:$bup.="<td align=center colspan=2><font size=+3><b>$hivfej ($wjid)</b></font>";
Line #144:$bup.="<tr><td align=right><input type='submit' value='>>> $hivir >>>' name='$hivname'>
Line #145:</td>";
Line #146:
Line #147:if ($_SESSION[login]=="BI(c)")
Line #148:$fulllink="<a target=infoframe href='_Q_sqlRECopy.php?&wjid=$wjid&tabla=$sqlfile&view=*&update=$update&datum_kod=$datum_kod'>
Line #149:Teljes update</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
Line #150:else $fulllink="";
Line #151:
Line #152:if ($_SESSION[login]=="BI(c)")
Line #153: $bup.="<td align=center colspan=4> $fulllink
Line #154: <b><font color=blue size=+1>$sqlfile:<font color=blue size=+2>$wjid</font><font color=red size=+2>/$nurL</font></b>";
Line #155:else
Line #156: $bup.="<td align=right colspan=4>&nbsp;";
Line #157:
Line #158:$bup.="<input type='hidden' value='$h[0]' name='Wjid'>";
Line #159:$bup.="<input type='hidden' value='$Qszin' name='Qszin'>";
Line #160:
Line #161://if ($_SESSION[login]=="BI(c)" and $sqlfile=="qj_ear")
Line #162:if ($sqlfile=="qj_ear" and !isset($_GET[delete]))
Line #163:
Line #164:else
Line #165: $bup.="</td></tr><tr>";
Line #166:
Line #167:$r=mysql_fetch_row($eredmeny);
Line #168:
Line #169:$tr="</tr><tr>";
Line #170:$colspan="";
Line #171:
Line #172:for($j=1;$j<$nur;$j++)
Line #173:{
Line #174: $bum='W['.$j.']';
Line #175:
Line #176: if (strpos($update,$h[$j])==0 and strpos("?".$view,"*")==0)
Line #177: $ronly="readonly STYLE='color : red; background-color:moccasin; font-size: 14px; font-weight: bold;' "; else
Line #178: $ronly="STYLE='font-size: 14px; font-weight: bold;' ";
Line #179:
Line #180: $title=$h[$j];
Line #181: for($k=0;$k<$nurT;$k++)
Line #182: {
Line #183: if(strpos($t[$k],$h[$j])>0) $title=substr($t[$k],0,strpos($t[$k],"="));
Line #184: }
Line #185:
Line #186: if (strpos($view,$h[$j])==0 and strpos("?".$view,"*")==0)
Line #187: $bup.="<input type='hidden' value='".$r[$j]."' name='".$bum."'></td>";
Line #188: else
Line #189: $bup.="<td align=right><b>$title</b></td><td $colspan >
Line #190: <input $ronly type='text' size=50 value='".$r[$j]."' name='".$bum."'></td>".$tr;
Line #191:}
Line #192:
Line #193:
Line #194:$bup.="</tr></table></form>";
Line #195:
Line #196:echo($bup);
Line #197://echo("<a href=javascript:window.close()><font color=blue size=+4>Vissza...</a>");
Line #198:?>