Location: PHPKode > projects > Esvon Personals > esvon-personals/modules/Mailing_Lists/admin/indexm.php
<?php

// --------------------------------------------------------------------------
//
// Esvon Classifieds v.4.0
// Copyright(C), Esvon LTD, 2001-2010, All Rights Reserved.
// E-mail: hide@address.com
//
// All forms of reproduction, including, but not limited to, internet posting, 
// printing, e-mailing, faxing and recording are strictly prohibited.
// One license required per site running Esvon Classifieds. 
// To obtain a license for using Esvon Classifieds, please register at
// http://www.esvon.com/pg/products/p_classifieds/
//
// --------------------------------------------------------------------------

if(!defined('SITE_PATH')) die('Access denied');

if($_POST['go']) GoDelete();
ListItems();


//sub area

function ListItems() {
global $db;

 $tpl = new HawkTpl;
 $tpl->InitArray('row');

 $num = 0;
 $res = $db->query('SELECT id,name,descr FROM '.TBL_ML_IDX.' WHERE id>0 ORDER BY id'); // id>0
 while($v = mysql_fetch_assoc($res)) {
   $v['number']=++$num;
   $tpl->AddCell('row',$v);
 }
 $tpl->Parse(HW_MOD_TPL.'ml.htm','',1);

}


function GoDelete() {
  global $db;

  if(is_array($_POST['chk_id'])) {

    $s_ids = '"'.implode('","', array_map('intval', $_POST['chk_id'])).'"';
    
    $db->query('DELETE FROM '.TBL_ML_PENDING.' WHERE list_id IN ('.$s_ids.')');
    $db->query('DELETE FROM '.TBL_ML.' WHERE list_id IN ('.$s_ids.')');

    $a_log = $db->one_col_array('SELECT id FROM '.TBL_ML_LOG.' WHERE list_id IN ('.$s_ids.')');
    if($a_log){
      $db->query('DELETE FROM '.TBL_ML_TEMP.' WHERE log_id IN ('.implode(',',$a_log).')');
    }

    $db->query('DELETE FROM '.TBL_ML_LOG.' WHERE list_id IN ('.$s_ids.')');
    $db->query('DELETE FROM '.TBL_ML_UNSUB.' WHERE list_id IN ('.$s_ids.')');
    $db->query('DELETE FROM '.TBL_ML_IDX.' WHERE id IN ('.$s_ids.')');
  }
}

?>
Return current item: Esvon Personals