<?php

/**********************************************************
* File         : retry_auto_members.php
* Authors      : mie tsutsui
* Date         : 2013.01.10
* Last Update  : 2013.01.10
* Copyright    :
***********************************************************/
set_include_path('.:/usr/share/pear:/var/www/phplib');
require_once "mgr/common_mgr.class.php";
$oMgr = new common_mgr();
$sql = "\nSELECT\n    log_cd,\n    mlist_id\nFROM\n    mlist_members_errlog\nWHERE\n    complete_flg='0'\n";
$aryId = $oMgr->oDb->getAssoc2Ary($sql);
if (is_array($aryId)) {
    foreach ($aryId as $log_cd => $mlist_id) {
        $oMgr->relationAutoMembers($mlist_id);
        // 結果にかかわらず完了フラグ1を立てる
        $sql = "UPDATE mlist_members_errlog SET complete_flg = '1' WHERE log_cd = '" . $log_cd . "'";
        $oMgr->oDb->query($sql);
    }
}
exit;