<?php
/*
	欢迎使用DM企业建站系统，本系统由www.demososo.com开发。
*/
if(!defined('IN_DEMOSOSO')) {
	exit('this is wrong page,please back to homepage');
}

if($act=='insert')
 {
  if($abc1=="") {
  	$abc1 = 'pls input title'; exit;
  }

  $pidname='region'.$bshou;


			$ss = "insert into ".TABLE_REGION." (pid,pidstylebh,pidname,pbh,name,cssname,haswow,effect,lang) values ('0','$ppid','$pidname','$user2510','$abc1','$abc2','$abc3','$abc4','".LANG."')";
			  //echo $ss;exit;
			iquery($ss);
			//alert('添加成功！');
			jump($jumpv);


 }
 if($act=='update')
 {
     if($abc1=="")  {
	  	$abc1 = 'pls input title'; exit;
	  }

	  $addcss =  htmlentitdm(@$_POST['addcss']);
	  $addcss=str_replace("\\","/",$addcss);
	  $addcss=str_replace(chr(13),"|",$addcss);
	  $addcss=str_replace(chr(32),"",$addcss);

	  $addjs =  htmlentitdm(@$_POST['addjs']);
	  $addjs=str_replace("\\","/",$addjs);
	  $addjs=str_replace(chr(13),"|",$addjs);
	  $addjs=str_replace(chr(32),"",$addjs);

 $effect='default';
       $ss = "update ".TABLE_REGION." set name='$abc1',cssname='$abc2',haswow='$abc3',effect='$abc4',addcss='$addcss',addjs='$addjs' where id='$tid'  $andlangbh limit 1";
      // echo $ss;exit;
			iquery($ss);
			$jumpv = $jumpvedit.'&tid='.$tid;
			 jump($jumpv);

 }


 if($act=='add')
 { $titleh2= '添加区域';
 $name=$cssname= $addcss=$addjs='';
 $effect = ''; $haswow = 'n';
 }

 if($act=='edit')
 {
 $titleh2= '修改区域';

 $jumpvinsert = $jumpvupdate.'&tid='.$tid;

$sql = "SELECT * from ".TABLE_REGION."  where id='$tid'   $andlangbh order by id limit 1";
$row = getrow($sql);
if($row=='no'){echo 'no record...';exit;}
//$desp=zbdesp_imgpath($row['desp']);
$name= $row['name'];
$cssname= $row['cssname'];
 //$effect= $row['effect']; 
 $effect='default';
   $haswow= $row['haswow'];

$addcss=$row['addcss'];
$addcss=str_replace("|",chr(13),$addcss);
$addjs=$row['addjs'];
$addjs=str_replace("|",chr(13),$addjs);

 }

 if($act=='add' or $act=='edit')
 {
?>

<form  onsubmit="javascript:return checkhere(this)" action="<?php echo $jumpvinsert?>" method="post">
  <table class="formtab">
    <tr>
      <td width="22%" class="tr">页面区域标题：</td>
      <td width="77%"> <input name="name" type="text" value="<?php echo $name?>" class="form-control" />
       </td>
    </tr>


<tr>
            <td   class="tr"> <?php echo $text_cssname; ?> </td>
            <td  >
                <input name="cssname" type="text"  class="inputcss form-control" value="<?php echo $cssname; ?>"  /><?php echo $xz_maybe; ?>

            </td>
        </tr>
        <tr>
            <td   class="tr">开启wow动画</td>
            <td  >
            <select name="haswow"> <?php select_from_arr($arr_yn,$haswow,'');?>
     </select>

            </td>
        </tr>
   

  <?php
   require_once HERE_ROOT.'mod_style/plugin_style_addcssjs.php';
 ?>

<tr>
      <td></td>
      <td>
      <input  class="mysubmit" type="submit" name="Submit" value="<?php echo $titleh2;?>"></td>
    </tr>
  </table>
</form>



<?php
}
?>

<script>
function checkhere(thisForm) {
   if (thisForm.name.value=="")
	{
		alert("请输入页面区域标题。");
		thisForm.name.focus();
		return (false);
	}



   // return;

}


</script>
