<?php
/**
 * @copyright ONE/DEPO Project
 * @license   PHP License 3.01 <http://www.php.net/license/3_01.txt>
 */


/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * キャスト削除確認
 *
 * @package     Admin.Datamanage.Cast.Delete.Check
 * @author      netnee T.Otogawa <tomokazu.otogawa@netnee.jp>
 * @access      public
 */
class Admin_Datamanage_Cast_Delete_Check
{
    var $c_cast;
    var $session;
    var $c_pref;
    var $c_name;

    var $code;
    var $name;
    var $kana;
    var $castdiv;
    var $recommenddiv;
    var $comment;
    var $debutdate;
    var $birthplace;
    var $birthplacecd;
    var $birthdate;
    var $img_count_s;
    var $img_count_m;
    var $img_count_l;
    var $updcnt;
    var $data;

    var $title;
    var $pagename;
    var $actionnm;
    var $from;    //ページID
    var $div;

    var $srcword;            //検索値
    var $srccastdiv;         //キャスト種別
    var $srcrecommenddiv;    //おすすめ区分

    var $srcdispnum;        // 表示件数

    function execute()
    {
        $div = (empty($this->div)) ? 2 : 1;
        $this->data = $this->c_cast->viewselectKey($div, $this->code);

        $postdata = array("code"=>$this->code, "updcnt"=>$this->data["updcnt"]);
        $this->session->removeParameter("cast");
        $this->session->setParameter("cast", $postdata);

        
        if (!isset($this->name) && 
            !isset($this->kana) && 
            !isset($this->castdiv) && 
            !isset($this->recommenddiv) && 
            !isset($this->comment) && 
            !isset($this->debutdate) && 
            !isset($this->birthplacecd) && 
            !isset($this->birthdate) && 
            !isset($this->img_count_s) && 
            !isset($this->img_count_m) && 
            !isset($this->img_count_l) && 
            !isset($this->updcnt)) {

            $this->name = $this->data["castnm"];
            $this->kana = $this->data["castnmkana"];
            $this->castdiv = $this->data["castdiv"];
            $this->recommenddiv = $this->data["recommenddiv"];
            $this->comment = $this->data["comment"];
            $this->debutdate = $this->data["debutdate"];
            $this->birthplacecd = $this->data["birthplacecd"];
            $this->birthdate = $this->data["birthdate"];
            $this->img_count_s  = $this->data["img_count_s"];
            $this->img_count_m  = $this->data["img_count_m"];
            $this->img_count_l  = $this->data["img_count_l"];
            $this->updcnt = $this->data["updcnt"];
        }
        
        return 'success';
    }

    function getPrefnm()
    {
        if (empty($this->birthplacecd)) return "";
        $pref = $this->c_pref->selectKey($this->birthplacecd);
        return $pref["prefnm"];
    }
    
    function getCastdivradio(){
        // キャスト種別取得（キャスト種別は"６"）
        return $this->c_name->selectDivAll(6);
    }
}
?>
