<?php

$cs_lang = cs_translate('multislide');

$cs_multislide_tpl = array();
$cs_multislide_tpl['head']['mod']    = $cs_lang['mod_name'];
$cs_multislide_tpl['head']['action']  = $cs_lang['head_remove'];
$cs_multislide_tpl['head']['body']  = '-';

echo cs_subtemplate(__FILE__,$cs_multislide_tpl,'multislide','action_head');

$multislide_form = 1;
$multislide_id = $_REQUEST['id'];
settype($multislide_id,'integer');

if(isset($_GET['agree']))
{
  $where = "multislide_id = '" . $multislide_id . "'";
  $getpic = cs_sql_select(__FILE__,'multislide','multislide_picture',$where);
  
  if(file_exists($getpic['multislide_picture'])) {
    unlink($getpic['multislide_picture']);
  }
	
	
  $multislide_form = 0;
  cs_sql_delete(__FILE__,'multislide',$multislide_id);

  cs_redirect($cs_lang['del_true'], 'multislide');
}

if(isset($_GET['cancel']))
  cs_redirect($cs_lang['del_false'], 'multislide');

if(!empty($multislide_form))
{
  $cs_multislide_tpl['remove']['mode'] = 'multislide_remove';
  $cs_multislide_tpl['remove']['action'] = 'remove';
  $cs_multislide_tpl['remove']['id'] = $multislide_id;
  
  $cs_multislide_tpl['remove']['agree'] = cs_link($cs_lang['confirm'],'multislide','remove','id=' . $multislide_id . '&amp;agree');
  $cs_multislide_tpl['remove']['cancel'] = cs_link($cs_lang['cancel'],'multislide','remove','id=' . $multislide_id . '&amp;cancel');

  echo cs_subtemplate(__FILE__,$cs_multislide_tpl,'multislide','remove');
}