<?php
$status=array('-1'=>lang_show('notpass'),'0'=>lang_show('wpass'),'1'=>lang_show('auditpass'));
if(isset($_POST["action"]))
{
	$sql = "update ".CERTIFICATION." set com_reg_name='$_POST[com_reg_name]',com_reg_id='$_POST[com_reg_id]',com_reg_add='$_POST[com_reg_add]',com_deputy='$_POST[com_deputy]',com_reg_capital='$_POST[com_reg_capital]',com_reg_type='$_POST[com_reg_type]',com_reg_time='$_POST[com_reg_time]',com_reg_time_ex='$_POST[com_reg_time_ex]',com_reg_area='$_POST[com_reg_area]',com_reg_unit='$_POST[com_reg_unit]',com_check='$_POST[com_check]',statu='$_POST[statu]' where id='$_POST[id]'";
	$re=$db->query($sql);
	
	$sql="update ".COMPANY." set certification='$_POST[statu]' where company_id='$_POST[company_id]'";
	$db->query($sql);
	
	if($re)
		msg("module.php?m=company&s=business_info_list.php");
}
//================================
$sql="select * from ".CERTIFICATION." where id='$_GET[id]'";
$db->query($sql);
$re=$db->fetchRow();
?>
<!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="main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="bigbox">
  <div class="bigboxhead"><?php echo lang_show('business_info_manager');?></div>
  <div class="bigboxbody">
    <table width='98%' border='0' cellspacing='0' cellpadding='0'>
      <form method="post" action=""  name="cityform">
        <input type="hidden" name="id" value="<?php echo $_GET["id"]; ?>">
		<input type="hidden" name="company_id" value="<?php echo $re["company_id"]; ?>">
        <tr class="theader">
          <td width="10%"><?php echo lang_show('business_info_uptime');?></td>
          <td width="90%"><?php echo $re['uptime'];?></td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_name');?></td>
          <td><?php echo $re['person_name']; ?></td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_job');?></td>
          <td><?php echo $re['job'];?></td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_com');?></td>
          <td><input name="com_reg_name" type="text" value="<?php echo $re['com_reg_name']; ?>" class="text"/>
          </td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_id');?></td>
          <td><input name="com_reg_id" type="text" value="<?php echo $re['com_reg_id']; ?>" class="text"/></td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_add');?></td>
          <td><input name="com_reg_add" type="text" value="<?php echo $re['com_reg_add']; ?>" class="text"/></td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_deputy');?></td>
          <td><input name="com_deputy" type="text" value="<?php echo $re['com_deputy']; ?>" class="text"/></td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_capital');?></td>
          <td><input name="com_reg_capital" type="text" value="<?php echo $re['com_reg_capital']; ?>" class="text"/></td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_type');?></td>
          <td><input name="com_reg_type" type="text" value="<?php echo $re['com_reg_type']; ?>" class="text"/></td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_time');?></td>
          <td><input name="com_reg_time" type="text" value="<?php echo $re['com_reg_time']; ?>" class="text"/></td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_time_ex');?></td>
          <td><input name="com_reg_time_ex" type="text" value="<?php echo $re['com_reg_time_ex']; ?>" class="text"/></td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_time_unit');?></td>
          <td><input name="com_reg_unit" type="text" value="<?php echo $re['com_reg_unit']; ?>" class="text"/></td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_time_area');?></td>
          <td><textarea class="text" name="com_reg_area" id="com_reg_area" rows="8"><?php echo $re['com_reg_area']; ?></textarea>
          </td>
        </tr>
        <tr>
          <td><?php echo lang_show('business_info_time_check');?></td>
          <td><input class="text" type="text" id="tel" name="com_check" value="<?php echo $re['com_check']; ?>"/></td>
        </tr>
        <tr>
          <td><?php echo lang_show('statu');?></td>
          <td>
            <select class="select" name="statu">
              <?php 
				foreach($status as $key=>$v)
				{
				?>
              <option value="<?php echo $key;?>" <?php if($re['statu']=="$key")echo "selected";?>><?php echo $v;?></option>
              <?php
				 }
				?>
            </select>
          </td>
        </tr>
        <?php if(!empty($re['pic'])){ ?>
        <tr>
          <td>&nbsp;</td>
          <td><img src="<?php echo $re['pic'];?>" /></td>
        </tr>
        <?php } ?>
        <tr>
          <td>&nbsp;</td>
          <td><input class="btn" type='submit' name='Submit3' value='<?php echo lang_show('edit');?>'>
            <input name="action" type="hidden" id="action" value="submit">
          </td>
        </tr>
      </form>
    </table>
  </div>
</div>
</body>
</html>
