<?php
/*	欢迎使用DM企业建站系统，本系统由www.demososo.com开发。
*/
require_once '../config_a/common.inc2010.php';
//
 if($act <> "pos") zb_insert($_POST);
 
 if($pidname<>'') {ifhaspidname(TABLE_BLOCK,$pidname);}
 
//ifhaspidname(TABLE_NODE,$pid);
//ifhaspidname(TABLE_CATE,$catpid);
ifhave_lang(LANG);//TEST if have lang,if no ,then jump

$jumpv='mod_imgmanager.php?lang='.LANG;
$jumpv_pidname=$jumpv.'&pidname='.$pidname;
$jumpv_file=$jumpv.'&file='.$file;
$jumpv_pidnamefile=$jumpv_pidname.'&file='.$file;


//----
$submenu='module';
$title = '';

 $res= array();
//-----------

  if($act=='del') {
	 
   // pre($_POST);
  //  exit;
	 
	   
	 if(isset($_POST['content']))  {
		 
		  $content = $_POST['content'];
		  $arr = explode('===', $content);
		  unset($arr[0]);
		 // pre($arr);
		  foreach($arr as $v){
		  	$v  = htmlentitdm($v);
			   $postarr = explode('=',$v);
			   if(is_array($postarr)){
			   $tid = $postarr[0];
					if(isset($postarr[1])){
							$img = $postarr[1];
							$imgv = UPLOADROOTIMAGE.$img;
							$imgvsm = UPLOADROOTIMAGE.gl_img_s($img).'_s.'.gl_imgtype($img);
						// echo '<br>'.$imgvsm.'<br>';
								
							unlinkdm($imgv);
							unlinkdm($imgvsm);
					}
			   }

			 $ss = "delete from ".TABLE_ALBUM." where id='$tid'  ". ANDLANGBH ." limit 1";
			// echo $ss.'<br>';
		     iquery($ss);
			
				
		  }
	   $res['id']='ok';
		  
	 }
	 else {
		  $res['id']='error';
		  
	 }
 }
 
  if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
      $res = json_encode($res);
      echo $res;
        die();
   }
    else {
    //header("Location: ".$_SERVER["HTTP_REFERER"]);
      echo 'pls do not access here directly';
   }


?>

 
 