<?php 
	session_start(); 
	require_once('../../../../ru/update/2.55/ls_admin/inc/conn.php');
	require_once('../../../../ru/update/2.55/ls_admin/inc/constant.php');
	require_once('../../../../ru/update/2.55/ls_admin/inc/ls_syscode.php');
	require_once('../../../../ru/update/2.55/ls_admin/inc/check.php');
	$opendb=new mydb();
	require_once('../../../../ru/update/2.55/ls_admin/inc/char_set.php'); 
	
	require_once('../../../../ru/update/2.55/ls_admin/generalpicrequire.php');  //generalpic类型选择语句, 表名、图片文件存储目录、字段变量名 存储变量在此定义


	$id=$_GET['id'];
	$ls=$_GET['ls'];   

if($ls=="insert")
{
	$genOper="添加";
	$modiGeneralpicsText=$_POST['modiGeneralpicsText'];
	$folderPic=($_POST['Pic']==""?"images/picture.gif":"../".$folder2."/".$_POST['Pic']);
	$Pic=($_POST['Pic']==""?"":$_POST['Pic']);
}else{
	$genOper="修改";
	$generalpics_sql="select * from ".$generalTable." where ID=".$id." ";
	$generalpics_query=$opendb->query($generalpics_sql);
	$generalpics_rows=mysql_fetch_assoc($generalpics_query);
	$modiGeneralpicsText=$generalpics_rows[$generalpicsText];
	$folderPic="../".$folder2."/".$generalpics_rows[$generalpicsPic];
	$Pic=$generalpics_rows[$generalpicsPic];
}
	$ls_msg=$genOper.$showstr."操作";


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link href="../../../../ru/update/2.55/ls_admin/css/admin.css" rel="stylesheet" type="text/css">
		<script language="JavaScript" src="../../../../ru/update/2.55/ls_admin/js/ls.js"></script>
		<title>无标题文档</title>
		
	</head>

	<body>
		<table width="96%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#6396d6">
			<tr>
				<td height="18" background="../../../../ru/update/2.55/ls_admin/images/admin_bg.gif"><div align="center"><font color="#ffffff"><strong>修改<?=$showstr?>图片</strong></font></div>
				</td>
			</tr>
			<tr>
				<td height="213" valign="top" bgcolor="#dee7ff"><br>
				 <form name="myform" enctype="multipart/form-data" method="post" action="../../../../ru/update/2.55/ls_admin/savegeneralpics.php?gen=<?=$gen?>" >
					<input type="hidden" value="<?php echo $ls;?>" name="ls">
					<input type="hidden" value="<?php echo $id;?>" name="id">
					<input type="hidden" value="<?php echo $Pic;?>" name="Pic">
					<input type="hidden" name="ChangecatePagePic" value="no">
					<table border="0" width="96%" align="center">
						<tr>
							<td>提示：<font color="#FF0000"><?php echo $ls_msg; ?></font></td>
							<td align="right"><img src="../../../../ru/update/2.55/ls_admin/images/shao.gif">&nbsp;<a href="../../../../ru/update/2.55/ls_admin/generalpics.php?gen=<?=$gen?>"><u>返回</u></a></td>
						</tr>
					</table>
					<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
					  <tr bgcolor="#B9DAFF">
					    <td height="28" colspan="3"></td>
				      </tr>
					  <tr bgcolor="#f4f4f4">
					    <td style="padding-left:50px;" >缩略图：</td>
					    <td colspan="2"   style="padding-left:60px;" ><img src="<?php echo $folderPic?>" width="<?=(isset($thisPicW)?$thisPicW:$SmallPicW)?>" height="<?=(isset($thisPicH)?$thisPicH:$SmallPicH)?>" border="1" name="pic" style="float:left;" /> <span style="padding-left:50px;">*</span><br />
					      <br />
					      <br />
					      <span style="padding-left:30px;">
					        <?=$generalpicsTips?>
				          </span></td>
				      </tr>
					  <tr bgcolor="#f4f4f4">
					    <td style="padding-left:50px;" >					      图片：</td>
					    <td colspan="2"  style="padding-left:60px;" ><input type="file" name="productPic" style="width:300px;" onblur="document.pic.src=myform.productPic.value"; onchange="myform.ChangecatePagePic.value='yes';" /></td>
				      </tr>
						<?php file_exists("../../../../ru/update/2.55/ls_admin/widget/generalpics/addmodi.php")?include "../../../../ru/update/2.55/ls_admin/widget/generalpics/addmodi.php" :"" ?>

					  <tr bgcolor="#f4f4f4">
					    <td width="14%" style="padding-left:50px;">					      简介：</td>
					    <td colspan="2"   style="padding-left:60px;">
                        <?php
								require_once('../../../../ru/update/2.55/ls_admin/fckeditor/fckeditor.php');
								$sBasePath=$_SERVER['PHP_SELF'];
								$sBasePath=substr($sBasePath,0,strpos($sBasePath,"ls_admin"));
								$sBasePath.="ls_admin/fckeditor/";
									
								$oFCKeditor=new FCKeditor('modiGeneralpicsText');
								$oFCKeditor->BasePath=$sBasePath;
								$oFCKeditor->Config['SkinPath']=$sBasePath.'editor/skins/silver/';
								//$oFCKeditor->Config['AutoDetectLanguage']=true;
								$oFCKeditor->ToolbarSet='Default';
								$oFCKeditor->Height='190';
								$oFCKeditor->Width = '96%' ;
								$oFCKeditor->Value=htmlspecialchars_decode($modiGeneralpicsText,ENT_QUOTES);
								$oFCKeditor->Create();
							?>
                       <!-- <textarea name="modiGeneralpicsText" style="width:400px; height:80px;" ><?php echo $modiGeneralpicsText;?></textarea></td> -->
				      </tr>
					  <tr bgcolor="#B9DAFF">
					    <td height="25" align="center">&nbsp;</td>
					    <td width="70%" height="25" align="center"><input type="submit" value="<?=$genOper.$showstr?>图片" />
                        <input name="重置" type="reset"  value="重置"  onclick="document.pic.src='<?php echo $folderPic?>';myform.ChangecatePagePic.value='no';" /></td>
					    <td width="16%" align="right"><img src="../../../../ru/update/2.55/ls_admin/images/shao.gif" alt="" />&nbsp;<a href="../../../../ru/update/2.55/ls_admin/generalpics.php?gen=<?=$gen?>"><u>返回</u></a></td>
				      </tr>
				   </table>
					<br />
                 </form>
				</td>
			</tr>
		</table>
</body>
    <?  if($_SESSION["refreshModi"]){?>
	<script> document.execCommand('Refresh') ;</script>
	<? 
	$_SESSION["refreshModi"]=false;
	}?>
</html>