<?php
include("includes/db.inc.php");
include("includes/config.php");
$msql=new SHARP_SQL;
$fsql=new SHARP_SQL;
if(!isset($AUTOUSERID) || $AUTOUSERID=="" || $AUTOUSERID=="deleted"){
header("Location: log.php3?fm=addcon.php3");
}else{
$userid=$AUTOUSERID;
}
?><HTML><HEAD><TITLE></TITLE>



<META content="text/html; charset=big5" http-equiv=Content-Type>



<STYLE>HTML {TEXT-DECORATION: none}



A:link {COLOR: #000000; TEXT-DECORATION: underline}



A:hover {COLOR: rgb(0,147,43); TEXT-DECORATION: underline}



EM {FONT-FAMILY: CourierNew; FONT-SIZE: 16pt; FONT-STYLE: normal}



A {FONT-SIZE: 9pt}



TD {FONT-SIZE: 9pt}



P {



FONT-SIZE: 9pt



}



.hh input {background-color: #ffffff; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}



</STYLE>



</HEAD>



<BODY aLink=#000000 bgColor=#FFCC99 leftMargin=0 link=#000000 topMargin=0 vLink=#000000 marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr valign="bottom"> 
    <td height="27" bgcolor="#0099FF"><font color="#FFFFFF">¡½ ·s¼Wºô¯¸¤º®e</font><font color="#FFFFFF"></font></td>
  </tr>
  <tr bgcolor="#FF3300"> 
    <td height="1"><img src="images/dot.gif" width="22" height="1"></td>
  </tr>
  <tr valign="top"> 
    <td height="413" bgcolor="#99CCFF"> 
      <div align="center"></div>
      <div align="center"></div>
      <?php
if($step=="2"){
if($title=="" || $con==""){
sendback('½Ð¶ñ¼g¼ÐÃD©M¤º®e');
}
if(strlen($con)>15000){
sendback('¹ï¤£°_¡Aºô­¶¤º®e¤£¯à¶W¹L15000¦r²Å¡A½Ðªð¦^­×§ï');
}
if(strlen($title)>100){
sendback('¹ï¤£°_¡A¼ÐÃD¦WºÙ¤£¯à¶W¹L100¦r²Å¡A½Ðªð¦^­×§ï');
}
if($ttype=="html"){
$con=str_replace("\n","",$con);
}else{
$con=str_replace("  ","–R",$con);
$con=str_replace("¡@","–R",$con);
}
//////////////
if ($jpg_size >= 60000)  {
	sendback("¹ï¤£°_¡A±z¤W¶Çªº¹Ï¤ù¤j©ó60KB¡A³o±N·|¼vÅT«È¤áªºÂsÄý¡C½ÐÀ£ÁY±zªº¹Ï¤ù!");
}
if ($jpg_size != 0)  {
	$size = GetImageSize($jpg);
	if($size[0]>800 || $size[1]>2560){
	sendback("¬°¤F±zºô¯¸ªº¬üÆ[¡A¹Ï¤ù¤Ø¤o¤£¯à¶W¹L600*1280¶H¯À¡A½Ð³B²z±zªº¹Ï¤ù!");
	}
}

$msql->query("select max(id) from auto_con");
if($msql->next_record()){
$id=$msql->f('max(id)');
$id=$id+1;
}


if ($jpg_size != 0)  {
  			
  			$save_directory = "comimg/";
  			$savefile=$save_directory.$id.".jpg";
  			copy ($jpg,$savefile);
  			

} 

///////////

$msql->query("insert into auto_con (id, userid, dirid, title, ms1, ms2, con, iftj, xuhao) values (
0,
'$userid',
'$dirid',
'$title',
'$ms1',
'$ms2',
'$con',
'$iftj',
'0'
)");

?> <br>
      <br>
      <table width="600" border="1" cellspacing="2" cellpadding="0" align="center" bordercolor="#333333">
        <tr bgcolor="#FFCC66" align="center" valign="middle"> 
          <form method="post" action="">
            <td height="65" width="29%"> 
              <input type="hidden" name="dirid" value="<?php echo "$dirid"; ?>">
                
              <input type="submit" name="Submit" value="Ä~Äò¤W¶Ç">
       
            
          </td>     </form>    <form method="post" action="addcon.php3">
            <td height="65" width="40%"> 
              <div align="center">
                <input type="submit" name="Submit2" value="¤W¶Ç¨ä¥LÄæ¥Ø¤º®e">
              </div>
          
          </td>  </form> <form method="post" action="goto.php3" target=_blank>
            <td height="65" width="31%"> 
              <input type="submit" name="Submit22" value="§ó·s¨Ã¹wÄýºô¯¸">
              <input type="hidden" name="userid" value="<?php echo "$AUTOUSERID"; ?>">
           
          </td> </form>
        </tr>
      </table>
      <?php
}
if($step!="2"){
?>
      <form method="post" action="" enctype="multipart/form-data">
        <table width="600" border="1" cellspacing="2" cellpadding="0" align="center" bordercolor="#333333">
          <tr bgcolor="#FFCC66"> 
            <td height="22" width="101" bgcolor="#FF6600"> 
              <div align="right">¼Ð¡@ÃD¡G</div>
            </td>
            <td height="22" width="487"> 
              <input type="text" name="title" size="30">
              [¦p¤å³¹¼ÐÃD¡B²£«~¦WºÙ¡BªA°È¶µ¥Ø¦WºÙµ¥] <font color="#FF0000">*</font></td>
          </tr>
          <tr bgcolor="#FFCC66"> 
            <td height="29" width="101" bgcolor="#FF6600"> 
              <div align="right">µùÄÀ¤@¡G</div>
            </td>
            <td height="29" width="487"> 
              <input type="text" name="ms1" size="30">
              [¦p²£«~³W®æ«¬¸¹¡B¤å³¹§@ªÌµ¥] </td>
          </tr>
          <tr bgcolor="#FFCC66"> 
            <td height="22" width="101" bgcolor="#FF6600"> 
              <div align="right">µùÄÀ¤G¡G</div>
            </td>
            <td height="22" width="487"> 
              <input type="text" name="ms2" size="30">
              [¦p¥]¸Ë¡B»ù®æµ¥] 
              <input type="hidden" name="dirid" value="<?php echo "$dirid"; ?>">
              <input type="hidden" name="step" value="2">
            </td>
          </tr>
          <tr bgcolor="#FFCC66"> 
            <td height="22" width="101" bgcolor="#FF6600"> 
              <div align="right">¤º®e¡G</div>
            </td>
            <td height="22" width="487"> 
              <textarea name="con" cols="60" rows="8"></textarea>
              <font color="#FF0000">*</font> </td>
          </tr>
          <tr bgcolor="#FFCC66"> 
            <td height="22" width="101" bgcolor="#FF6600"> 
              <div align="right">¤º®eÃþ«¬¡G</div>
            </td>
            <td height="22" width="487"> 
              <input type="radio" name="ttype" value="text" checked>
              ¤å¦r 
              <input type="radio" name="ttype" value="html">
              HTML½X </td>
          </tr>
          <tr bgcolor="#FFCC66"> 
            <td height="22" width="101" bgcolor="#FF6600"> 
              <div align="right">¹Ï¤ù¡G</div>
            </td>
            <td height="22" width="487"> 
              <input type="file" name="jpg">
              <input type="hidden" name="iftj" value="0">
            </td>
          </tr>
          <tr bgcolor="#FFCC66"> 
            <td height="22" width="101" bgcolor="#FF6600">&nbsp;</td>
            <td height="22" width="487"> 
              <input type="submit" name="Submit3" value="¤W¶Ç">
            </td>
          </tr>
        </table>
      </form>
<?php
}
?>
    </td>
  </tr>
</table>
</BODY></HTML>



