<?php
	if($_POST['oid']*1>0&&$_POST['newid']*1>0)
	{
		$oid=$_POST['oid']*1;
		$newid=$_POST['newid']*1;
		$s=$oid.'00';
		$b=$oid.'99';
		
		$sql="update ".PRO." set catid='$newid' where catid='$oid'";
		$db->query($sql);
		$sql="update ".PRO." set catid=replace(catid,$oid,$newid) where catid>=$s and catid<=$b";
		$db->query($sql);
	}
	/*
	$sql="update ".INFO." set catid='$id' where catid='".$_GET['id']."'";
	$db->query($sql);
	
	$sql="update ".INFO." set catid=replace(catid,$_GET[id],$id) where catid>=$s and catid<=$b";
	$db->query($sql);
		
	elseif($cat_table==ALBUMCAT)
	{
		$sql="update ".ALBUM." set catid='$id' where catid='".$_GET['id']."'";
		$db->query($sql);
		
		$sql="update ".ALBUM." set catid=replace(catid,$_GET[id],$id) where catid>=$s and catid<=$b";
		$db->query($sql);
	}
	elseif($cat_table==COMPANYCAT)
	{
		$sql="update ".COMPANY." set catid=replace(catid,$_GET[id],$id)";
		$db->query($sql);
	}
	*/
?>
<!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>
<TITLE><?php echo lang_show('admin_system');?></TITLE> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="main.css" rel="stylesheet" type="text/css" />
<script src="../script/my_lightbox.js" language="javascript"></script>
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="main.js"></script>
</HEAD>
<body>
<div class="bigbox">
	<div class="bigboxhead">
		<span class="cbox"><a href="module.php?m=offer&s=offerlist.php"><?php echo lang_show('business_list');?></a></span>
		<span class="cbox on"><a href="module.php?m=offer&s=offer_move.php"><?php echo lang_show('shift_product');?></a></span>
	</div>
  <div class="bigboxbody">
    <form id="form1" name="form1" method="post" action="">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="15%"><?php echo lang_show('old_catid');?></td>
          <td width="85%"><label><input class="text" type="text" name="oid" /></label></td>
        </tr>
        <tr>
          <td><?php echo lang_show('new_catid');?></td>
          <td><label><input class="text" type="text" name="newid" /></label></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><label><input class="btn" type="submit" name="Submit" value="<?php echo lang_show('submit');?>" /></label></td>
        </tr>
      </table>
        </form>
  </div>
</div>