Esempio n. 1
0
function mail_naiyou($gc) {

	$sql = "SELECT";
	$sql.= " anken_no,";
	$sql.= " relocation_flg,";
	$sql.= " chintai_flg,";
	$sql.= " sublease_flg,";
	$sql.= " purpose_flg,";
	$sql.= " buken_sbt,";
	$sql.= " buken_shikucyouson_no,";
	$sql.= " buken_banchi,";
	$sql.= " buken_tatemono,";
	$sql.= " chikunensu,";
	$sql.= " menseki,";
	$sql.= " input_val,";
	$sql.= " input_kbn,";
	$sql.= " land_val,";
	$sql.= " madori_no,";
	$sql.= " meigi_no,";
	$sql.= " genjyou_no,";
	$sql.= " room_cnt,";
	$sql.= " fudousan_flg,";
	$sql.= " fudousan_nm,";
	$sql.= " bikou,";
	$sql.= " lname,";
	$sql.= " fname,";
	$sql.= " lname_kn,";
	$sql.= " fname_kn,";
	$sql.= " tel,";
	$sql.= " e_mail,";
	$sql.= " sumai_flg,";
	$sql.= " sumai_shikucyouson_no,";
	$sql.= " sumai_banchi,";
	$sql.= " sumai_tatemono,";
	$sql.= " moushikomibi,";
	$sql.= " rank_no,";
	$sql.= " tesuryou,";
	$sql.= " ltime ";
	$sql.= "FROM";
	$sql.= " t_item ";
	$sql.= "WHERE";
	$sql.= " item_no = ".$gc->item_no;

	$rs = $gc->db->query($sql);

	if(!$rs->eof){

		$gc->anken_no = $rs->fields["anken_no"];

		$relocation_flg = $rs->fields["relocation_flg"];
		$chintai_flg = $rs->fields["chintai_flg"];
		$sublease_flg = $rs->fields["sublease_flg"];
		$purpose_flg = $rs->fields["purpose_flg"];

		$buken_sbt = $rs->fields["buken_sbt"];
		$buken_shikucyouson_no = $rs->fields["buken_shikucyouson_no"];
		$buken_banchi = $rs->fields["buken_banchi"];
		$buken_tatemono = $rs->fields["buken_tatemono"];
		$chikunensu = $rs->fields["chikunensu"];
		$menseki = $rs->fields["menseki"];
		$input_val = $rs->fields["input_val"];
		$input_kbn = $rs->fields["input_kbn"];
		$land_val = $rs->fields["land_val"];

		$madori_no = $rs->fields["madori_no"];
		$meigi_no = $rs->fields["meigi_no"];
		$genjyou_no = $rs->fields["genjyou_no"];
		$room_cnt = $rs->fields["room_cnt"];

		$fudousan_flg = $rs->fields["fudousan_flg"];
		$fudousan_nm = $rs->fields["fudousan_nm"];
		$bikou = $rs->fields["bikou"];
		$lname = $rs->fields["lname"];
		$fname = $rs->fields["fname"];
		$lname_kn = $rs->fields["lname_kn"];
		$fname_kn = $rs->fields["fname_kn"];
		$tel = $rs->fields["tel"];
		$e_mail = $rs->fields["e_mail"];
		$sumai_flg = $rs->fields["sumai_flg"];
		$sumai_shikucyouson_no = $rs->fields["sumai_shikucyouson_no"];
		$sumai_banchi = $rs->fields["sumai_banchi"];
		$sumai_tatemono = $rs->fields["sumai_tatemono"];
		$moushikomibi = $rs->fields["moushikomibi"];
		$rank_no = $rs->fields["rank_no"];
		$tesuryou = $rs->fields["tesuryou"];

		$arr = fdiv_set_buken_sbt_array();
		$buken_sbt_nm = $arr[$buken_sbt];

		$purpose_arr = fdiv_set_purpose_array();
		$purpose_str = $purpose_arr[$purpose_flg];

		$kibou_cnt = 0;
		$kibou_str ="";
		if($chintai_flg == 1){
			$kibou_str.= "賃貸募集・賃貸管理";
			$kibou_cnt++;
		}
		if($sublease_flg == 1) {
			if($kibou_cnt > 0){
				$kibou_str.= "/";
			}
			$kibou_cnt++;
			$kibou_str.= "サブリース";
		}
		if($relocation_flg == 1) {
			if($kibou_cnt > 0){
				$kibou_str.= "/";
			}
			$kibou_str.= "リロケーション";
		}


		$info = get_shikucyouson_info($gc, $buken_shikucyouson_no);
		$buken_syozaichi = $info["todoufuken_nm"].$info["shikucyouson_nm"];

		$chikunensu = (float)$chikunensu;
		if($chikunensu >= 0){
			$chikunensu = $chikunensu."年";
		}else{
			$chikunensu = "";
		}

		$menseki = (float)$menseki;
		$menseki = $menseki."平米";
		//土地面積
		$land_val = $land_val."平米";

		$arr = fdiv_set_madori_array();
		$madori_nm = $arr[$madori_no];

		$arr = fdiv_set_meigi_array();
		$meigi_nm = $arr[$meigi_no];

		$arr = fdiv_set_genjyou_array();
		$genjyou_nm = $arr[$genjyou_no];
		if($room_cnt > 0){
			$genjyou_nm = $genjyou_nm." 空き部屋数 ".$room_cnt;
		}

		$arr = fdiv_set_sumai_flg_array();
		$sumai_nm = $arr[$sumai_flg];

		if($sumai_flg==1){
			$info = get_shikucyouson_info($gc, $sumai_shikucyouson_no);
			$sumai_syozaichi = $info["todoufuken_nm"].$info["shikucyouson_nm"];
		}else{
			$sumai_syozaichi = $buken_syozaichi;
			$sumai_banchi = $buken_banchi;
			$sumai_tatemono = $buken_tatemono;
		}

		$moushikomibi = substr($moushikomibi, 0, 4)."/".substr($moushikomibi, 5, 2)."/".substr($moushikomibi, 8, 2)." ".substr($moushikomibi, 11);

		$gc->moushikomibi = $moushikomibi;

		$s_u = "";
		$s_u.= "\n";
		$s_u.= "───────────────────────────────────\n";
		$s_u.= "■物件情報■\n";
		$s_u.= "───────────────────────────────────\n";
		$s_s.= "ご利用目的.............: ".$purpose_str."\n";
		$s_s2.= "希望のサービス.........: ".$kibou_str."\n";
		$s_d.= "物件種別...............: ".$buken_sbt_nm."\n";
		$s_d.= "物件所在地.............: ".$buken_syozaichi."\n";
		$s_d.= "町名・番地.............: ".$buken_banchi."\n";
		if($buken_sbt != 3){
			if($buken_sbt == 2){
			$s_d.= "建物名.................: ".$buken_tatemono."\n";
			}else{
			$s_d.= "建物名・部屋番号.......: ".$buken_tatemono."\n";
			}
		}
		$s_d.= "築年数.................: ".$chikunensu."\n";
		$s_d.= "面積...................: ".$menseki."\n";
		if($buken_sbt != 1){
			$s_d.= "土地面積...............: ".$land_val."\n";
		}
		if($buken_sbt != 2){
		$s_d.= "間取り.................: ".$madori_nm."\n";
		}
		$s_d.= "名義...................: ".$meigi_nm."\n";
		$s_d.= "現況...................: ".$genjyou_nm."\n";
		$s_d.= "\n";
		$s_d.= "───────────────────────────────────\n";
		$s_d.= "■お客様情報■\n";
		$s_d.= "───────────────────────────────────\n";
		$s_d.= "お名前.................: ".$lname.$fname."\n";
		$s_d.= "フリガナ...............: ".$lname_kn.$fname_kn."\n";
		$s_d.= "電話番号...............: ".$tel."\n";
		$s_d.= "メールアドレス.........: ".$e_mail."\n";
		$s_d.= "お住まい...............: ".$sumai_syozaichi."\n";
		$s_d.= "町名・番地.............: ".$sumai_banchi."\n";
		$s_d.= "建物名・部屋番号.......: ".$sumai_tatemono."\n";
		$s_d.= "ご要望・ご質問など.....: ".$bikou."\n";
		$s_d.= "\n";

		$gc->naiyou_u = $s_u;
		$gc->naiyou_d = $s_d;

		$gc->naiyou_s = $s_s;

		$gc->user_naiyou = $s_u;
		$gc->user_naiyou.= "ご利用目的.............: ".$purpose_str."\n";
		$gc->user_naiyou.= $s_s2;
		$gc->user_naiyou.= $s_d;

		$gc->kanri_naiyou = $s_u;
		$gc->kanri_naiyou.= "ご利用目的.............: ".$purpose_str."\n";
		$gc->kanri_naiyou.= $s_s2;
		$gc->kanri_naiyou.= $s_d;

	}

	$rs->free_result();

	return $s;

}
Esempio n. 2
0
function fdiv_set_purpose_radio($gc, $cd, $name)
{
    $array = fdiv_set_purpose_array();
    fdiv_set_radio($gc, $cd, $name, $array);
}
Esempio n. 3
0
function mail_naiyou($gc) {
    require_once(dirname(__FILE__)."/../../../init.inc.php");
    require_once(C_INC_DIR_SSL."db_utils.php");
    require_once(C_INC_DIR_SSL."kenNo_ref.php");
    
    $db = connect_db();
    
	$sql = "SELECT";
	$sql.= " anken_no,";
	$sql.= " relocation_flg,";
	$sql.= " chintai_flg,";
	$sql.= " sublease_flg,";
	$sql.= " purpose_flg,";
	$sql.= " buken_sbt,";
	$sql.= " buken_shikucyouson_no,";
	$sql.= " buken_shozai,";
    $sql.= " sonota_jusho,";
	$sql.= " buken_tatemono,";
	$sql.= " chikunensu,";
	$sql.= " menseki,";
	$sql.= " input_val,";
	$sql.= " input_kbn,";
	$sql.= " land_val,";
	$sql.= " madori_no,";
	$sql.= " meigi_no,";
	$sql.= " genjyou_no,";
	$sql.= " room_cnt,";
	$sql.= " fudousan_flg,";
	$sql.= " fudousan_nm,";
	$sql.= " bikou,";
	$sql.= " fullname,";
	$sql.= " fullname_kn,";
	$sql.= " tel,";
	$sql.= " e_mail,";
	$sql.= " sumai_flg,";
	$sql.= " sumai_yubin,";
	$sql.= " sumai_jusho,";
	$sql.= " sumai_tatemono,";
	$sql.= " moushikomibi,";
	$sql.= " rank_no,";
	$sql.= " tesuryou,";
	$sql.= " ltime ";
	$sql.= "FROM";
	$sql.= " t_item ";
	$sql.= "WHERE";
	$sql.= " item_no = ".$_SESSION["item_no"];

	$stmt = $db->query($sql);
    $row = $stmt->fetch(PDO::FETCH_ASSOC);

    $_SESSION["anken_no"] = $row["anken_no"];

    $relocation_flg = $row["relocation_flg"];
    $chintai_flg = $row["chintai_flg"];
    $sublease_flg = $row["sublease_flg"];
    $purpose_flg = $row["purpose_flg"];

    $buken_sbt = $row["buken_sbt"];
    $buken_shikucyouson_no = $row["buken_shikucyouson_no"];
    $buken_shozai = $row["buken_shozai"];
    $sonota_jusho = $row["sonota_jusho"];
    $buken_tatemono = $row["buken_tatemono"];
    $chikunensu = $row["chikunensu"];
    $menseki = $row["menseki"];
    $input_kbn = $row["input_kbn"];
    $land_val = $row["land_val"];

    $madori_no = $row["madori_no"];
    $meigi_no = $row["meigi_no"];
    $genjyou_no = $row["genjyou_no"];
    $room_cnt = $row["room_cnt"];

    $fudousan_flg = $row["fudousan_flg"];
    $fudousan_nm = $row["fudousan_nm"];
    $bikou = $row["bikou"];
    $fullname = $row["fullname"];
    $fullname_kn = $row["fullname_kn"];
    $tel = $row["tel"];
    $e_mail = $row["e_mail"];
    $sumai_flg = $row["sumai_flg"];
    $sumai_jusho = $row["sumai_jusho"];
    $sumai_tatemono = $row["sumai_tatemono"];
    $moushikomibi = $row["moushikomibi"];
    $rank_no = $row["rank_no"];
    $tesuryou = $row["tesuryou"];

    $arr = fdiv_set_buken_sbt_array();
    $buken_sbt_nm = $arr[$buken_sbt];

    $purpose_arr = fdiv_set_purpose_array();
    $purpose_str = $purpose_arr[$purpose_flg];

    $kibou_cnt = 0;
    $kibou_str ="";
    if($chintai_flg == 1){
        $kibou_str.= "賃貸募集・賃貸管理";
        $kibou_cnt++;
    }
    if($sublease_flg == 1) {
        if($kibou_cnt > 0){
            $kibou_str.= "/";
        }
        $kibou_cnt++;
        $kibou_str.= "サブリース";
    }
    if($relocation_flg == 1) {
        if($kibou_cnt > 0){
            $kibou_str.= "/";
        }
        $kibou_str.= "リロケーション";
    }

    $buken_syozaichi = $buken_shozai;

    $chikunensu = (float)$chikunensu;
    if($chikunensu >= 0){
        $chikunensu = $chikunensu."年";
    }else{
        $chikunensu = "";
    }

    $menseki = $menseki."平米";
    //土地面積
    $land_val = $land_val."平米";

    $arr = fdiv_set_madori_array();
    $madori_nm = $arr[$madori_no];

    $arr = fdiv_set_meigi_array();
    $meigi_nm = $arr[$meigi_no];

    $arr = fdiv_set_genjyou_array();
    $genjyou_nm = $arr[$genjyou_no];
    if($room_cnt > 0){
        $genjyou_nm = $genjyou_nm." 空き部屋数 ".$room_cnt;
    }

    $arr = fdiv_set_sumai_flg_array();
    $sumai_nm = $arr[$sumai_flg];

    $moushikomibi = substr($moushikomibi, 0, 4)."/".substr($moushikomibi, 5, 2)."/".substr($moushikomibi, 8, 2)." ".substr($moushikomibi, 11);

    $_SESSION["moushikomibi"] = $moushikomibi;

    $s_u = "";
    $s_u.= "\n";
    $s_u.= "───────────────────────────────────\n";
    $s_u.= "■物件情報■\n";
    $s_u.= "───────────────────────────────────\n";
    $s_s = "ご利用目的.............: ".$purpose_str."\n";
    $s_s2= "希望のサービス.........: ".$kibou_str."\n";
    $s_d.= "物件種別...............: ".$buken_sbt_nm."\n";
    $s_d.= "物件所在地.............: ".$buken_shozai."\n";
    $s_d.= "その他住所.............: ".$sonota_jusho."\n";
    if($buken_sbt != 3){
        if($buken_sbt == 2){
        $s_d.= "建物名.................: ".$buken_tatemono."\n";
        }else{
        $s_d.= "建物名・部屋番号.......: ".$buken_tatemono."\n";
        }
    }
    $s_d.= "築年数.................: ".$chikunensu."\n";
    $s_d.= "延床面積...............: ".$menseki."\n";
    if($buken_sbt != 1){
        $s_d.= "土地面積...............: ".$land_val."\n";
    }
    if($buken_sbt != 2){
    $s_d.= "間取り.................: ".$madori_nm."\n";
    }
    $s_d.= "名義...................: ".$meigi_nm."\n";
    $s_d.= "現況...................: ".$genjyou_nm."\n";
    $s_d.= "\n";
    $s_d.= "───────────────────────────────────\n";
    $s_d.= "■お客様情報■\n";
    $s_d.= "───────────────────────────────────\n";
    $s_d.= "お名前.................: ".$fullname."\n";
    $s_d.= "フリガナ...............: ".$fullname_kn."\n";
    $s_d.= "電話番号...............: ".$tel."\n";
    $s_d.= "メールアドレス.........: ".$e_mail."\n";
	if($sumai_flg==1) {
    	$s_d.= "お住まい...............: ".$sumai_jusho."\n";
		$s_d.= "建物名・部屋番号.......: ".$sumai_tatemono."\n";
	} else {
		$s_d.= "お住まい...............: ".$buken_shozai."\n";
		$s_d.= "その他住所.............: ".$sonota_jusho."\n";
		$s_d.= "建物名・部屋番号.......: ".$buken_tatemono."\n";
	}
    $s_d.= "ご要望・ご質問など.....: ".$bikou."\n";
    $s_d.= "\n";

    $_SESSION["naiyou_u"] = $s_u;
    $_SESSION["naiyou_d"] = $s_d;

    $_SESSION["naiyou_s"] = $s_s;

    $_SESSION["user_naiyou"]  = $s_u;
    $_SESSION["user_naiyou"] .= "ご利用目的.............: ".$purpose_str."\n";
    $_SESSION["user_naiyou"] .= $s_s2;
    $_SESSION["user_naiyou"] .= $s_d;

    $_SESSION["kanri_naiyou"] = $s_u;
    $_SESSION["kanri_naiyou"] .= "ご利用目的.............: ".$purpose_str."\n";
    $_SESSION["kanri_naiyou"] .= $s_s2;
    $_SESSION["kanri_naiyou"] .= $s_d;


	$db = null;
        
	return $s;

}
Esempio n. 4
0
function download_csv($gc) {

	$crlf = "\r\n";

	$arr_todoufuken = fsel_get_arr_todoufuken($gc);
	$arr_purpose_arr = fdiv_set_purpose_array();
	$arr_buken_sbt = fdiv_set_buken_sbt_array();
	$arr_madori = fdiv_set_madori_array();
	$arr_meigi = fdiv_set_meigi_array();
	$arr_genjyou = fdiv_set_genjyou_array();

	$arr_rank = fdiv_set_rank_array();

	$file_str = "";

	unset($line);

	$line[] = csv_item_edit("案件番号");
	$line[] = csv_item_edit("申込日時");
	$line[] = csv_item_edit("ご利用目的");
	$line[] = csv_item_edit("希望のサービス");
	$line[] = csv_item_edit("物件種別");
	$line[] = csv_item_edit("物件所在地");
	$line[] = csv_item_edit("町名・番地");
	$line[] = csv_item_edit("建物名・部屋番号");
	$line[] = csv_item_edit("築年数");
	$line[] = csv_item_edit("面積");
	$line[] = csv_item_edit("間取り");
	$line[] = csv_item_edit("名義");
	$line[] = csv_item_edit("現況");
	$line[] = csv_item_edit("お名前");
	$line[] = csv_item_edit("フリガナ");
	$line[] = csv_item_edit("電話番号");
	$line[] = csv_item_edit("メールアドレス");
	$line[] = csv_item_edit("お住まい");
	$line[] = csv_item_edit("町名・番地");
	$line[] = csv_item_edit("建物名・部屋番号");
	$line[] = csv_item_edit("ご要望・ご質問など");
	$line[] = csv_item_edit("ランク");
//	$line[] = csv_item_edit("手数料");

	$file_str.= implode(",", $line).$crlf;

	/////////////////////////////////////////////////////////////

	$sql = "SELECT SQL_CALC_FOUND_ROWS";
	$sql.= " itm.item_no,";
	$sql.= " itm.anken_no,";
	$sql.= " itm.relocation_flg,";
	$sql.= " itm.chintai_flg,";
	$sql.= " itm.sublease_flg,";
	$sql.= " itm.purpose_flg,";
	$sql.= " itm.buken_sbt,";
	$sql.= " itm.buken_shikucyouson_no,";
	$sql.= " itm.buken_banchi,";
	$sql.= " itm.buken_tatemono,";
	$sql.= " itm.chikunensu,";
	$sql.= " itm.menseki,";
	$sql.= " itm.input_val,";
	$sql.= " itm.input_kbn,";
	$sql.= " itm.land_val,";
	$sql.= " itm.madori_no,";
	$sql.= " itm.meigi_no,";
	$sql.= " itm.genjyou_no,";
	$sql.= " itm.room_cnt,";
	$sql.= " itm.fudousan_flg,";
	$sql.= " itm.fudousan_nm,";
	$sql.= " itm.bikou,";
	$sql.= " itm.lname,";
	$sql.= " itm.fname,";
	$sql.= " itm.lname_kn,";
	$sql.= " itm.fname_kn,";
	$sql.= " itm.tel,";
	$sql.= " itm.e_mail,";
	$sql.= " itm.sumai_flg,";
	$sql.= " itm.sumai_shikucyouson_no,";
	$sql.= " itm.sumai_banchi,";
	$sql.= " itm.sumai_tatemono,";
	$sql.= " itm.moushikomibi,";
	$sql.= " itm.rank_no,";
	$sql.= " itm.tesuryou,";
	$sql.= " itm.mukou_flg,";
	$sql.= " itc.c_mukou_flg,";
	$sql.= " itc.company_no,";
	$sql.= " ad1.todoufuken_no AS buken_todoufuken_no,";
	$sql.= " ad1.shikucyouson_nm AS buken_shikucyouson_nm,";
	$sql.= " ad2.todoufuken_no AS sumai_todoufuken_no,";
	$sql.= " ad2.shikucyouson_nm AS sumai_shikucyouson_nm,";
	$sql.= " mco.company_no,";
	$sql.= " mco.company_nm ";
	$sql.= "FROM";
	$sql.= " t_item itm ";
	$sql.= "INNER JOIN";
	$sql.= " t_item_company itc ";
	$sql.= "ON";
	$sql.= " itm.item_no = itc.item_no ";
	$sql.= "INNER JOIN";
	$sql.= " m_company mco ";
	$sql.= "ON";
	$sql.= " itc.company_no = mco.company_no ";
	$sql.= "LEFT JOIN";
	$sql.= " m_shikucyouson ad1 ";
	$sql.= "ON";
	$sql.= " itm.buken_shikucyouson_no = ad1.shikucyouson_no ";
	$sql.= "LEFT JOIN";
	$sql.= " m_shikucyouson ad2 ";
	$sql.= "ON";
	$sql.= " itm.sumai_shikucyouson_no = ad2.shikucyouson_no ";
	$sql.= "WHERE itc.c_mukou_flg = 0 and itc.company_no=".$gc->login_company_no." ";
	$sql.= "ORDER BY";
	$sql.= " itm.moushikomibi DESC, mco.company_no";

	$rs = $gc->db->query($sql);

	$row_count = $gc->db->get_row_count();

	$i = 0;

	$wk_item_no = "";

	$arr_company_nm = array();

	while ($rs->eof==false) {

		$item_no = $rs->fields["item_no"];

		if($item_no != $wk_item_no){

			$wk_item_no = $item_no;

			if( $i > 0 ){

				unset($line);

				$line[] = csv_item_edit($anken_no);
				$line[] = csv_item_edit($moushikomibi);
				$line[] = csv_item_edit($purpose_str);
				$line[] = csv_item_edit($kibou_str);
				$line[] = csv_item_edit($buken_sbt_nm);
				$line[] = csv_item_edit($buken_todoufuken_nm.$buken_shikucyouson_nm);
				$line[] = csv_item_edit($buken_banchi);
				$line[] = csv_item_edit($buken_tatemono);
				$line[] = csv_item_edit($chikunensu);
				$line[] = csv_item_edit($menseki);
				$line[] = csv_item_edit($madori_nm);
				$line[] = csv_item_edit($meigi_nm);
				$line[] = csv_item_edit($genjyou_nm);
				$line[] = csv_item_edit($lname.$fname);
				$line[] = csv_item_edit($lname_kn.$fname_kn);
				$line[] = csv_item_edit($tel);
				$line[] = csv_item_edit($e_mail);
				$line[] = csv_item_edit($sumai_todoufuken_nm.$sumai_shikucyouson_nm);
				$line[] = csv_item_edit($sumai_banchi);
				$line[] = csv_item_edit($sumai_tatemono);
				$line[] = csv_item_edit($bikou);
				$line[] = csv_item_edit($rank_nm);
//				$line[] = csv_item_edit($tesuryou);

				$file_str.= implode(",", $line).$crlf;

				$arr_company_nm = array();

			}

			// --------------------------------------------------------------------

			$anken_no = $rs->fields["anken_no"];
			$relocation_flg = $rs->fields["relocation_flg"];
			$chintai_flg = $rs->fields["chintai_flg"];
			$sublease_flg = $rs->fields["sublease_flg"];
			$purpose_flg = $rs->fields["purpose_flg"];
			$buken_sbt = $rs->fields["buken_sbt"];
			$buken_shikucyouson_no = $rs->fields["buken_shikucyouson_no"];
			$buken_banchi = $rs->fields["buken_banchi"];
			$buken_tatemono = $rs->fields["buken_tatemono"];
			$chikunensu = $rs->fields["chikunensu"];
			$menseki = $rs->fields["menseki"];
			$input_val = $rs->fields["input_val"];
			$input_kbn = $rs->fields["input_kbn"];
			$land_val = $rs->fields["land_val"];
			$madori_no = $rs->fields["madori_no"];
			$meigi_no = $rs->fields["meigi_no"];
			$genjyou_no = $rs->fields["genjyou_no"];
			$room_cnt = $rs->fields["room_cnt"];
			$fudousan_flg = $rs->fields["fudousan_flg"];
			$fudousan_nm = $rs->fields["fudousan_nm"];
			$bikou = $rs->fields["bikou"];
			$lname = $rs->fields["lname"];
			$fname = $rs->fields["fname"];
			$lname_kn = $rs->fields["lname_kn"];
			$fname_kn = $rs->fields["fname_kn"];
			$tel = $rs->fields["tel"];
			$e_mail = $rs->fields["e_mail"];
			$sumai_flg = $rs->fields["sumai_flg"];
			$sumai_shikucyouson_no = $rs->fields["sumai_shikucyouson_no"];
			$sumai_banchi = $rs->fields["sumai_banchi"];
			$sumai_tatemono = $rs->fields["sumai_tatemono"];
			$moushikomibi = $rs->fields["moushikomibi"];
			$rank_no = $rs->fields["rank_no"];
			$tesuryou = $rs->fields["tesuryou"];
			$mukou_flg = $rs->fields["mukou_flg"];

			$purpose_str = $arr_purpose_arr[$purpose_flg];

			$arr_work = array();
			if($chintai_flg == 1){
				$arr_work[] = "賃貸募集・賃貸管理";
			}
			if($sublease_flg == 1) {
				$arr_work[] = "サブリース";
			}
			if($relocation_flg == 1) {
				$arr_work[] = "リロケーション";
			}
			$kibou_str = implode(" ", $arr_work);

			$buken_sbt_nm = $arr_buken_sbt[$buken_sbt];

			$madori_nm = $arr_madori[$madori_no];

			$meigi_nm = $arr_meigi[$meigi_no];

			$genjyou_nm = $arr_genjyou[$genjyou_no];
			if($room_cnt > 0){
				$genjyou_nm = $genjyou_nm." 空き部屋数 ".$room_cnt;
			}

			$buken_todoufuken_no = $rs->fields["buken_todoufuken_no"];
			$buken_todoufuken_nm = $arr_todoufuken[$buken_todoufuken_no];
			$buken_shikucyouson_nm = $rs->fields["buken_shikucyouson_nm"];

			$sumai_todoufuken_no = $rs->fields["sumai_todoufuken_no"];
			$sumai_todoufuken_nm = $arr_todoufuken[$sumai_todoufuken_no];
			$sumai_shikucyouson_nm = $rs->fields["sumai_shikucyouson_nm"];

			$rank_nm = $arr_rank[$rank_no];

			$mukou_str = "有効";
			if($mukou_flg==1){
				$mukou_str = "無効";
			}

		}

		$arr_company_nm[] = $rs->fields["company_nm"];

		$rs->move_next();

		$i++;

	}

	$rs->free_result();

	// ----------------------------------------------------------------

	unset($line);

	$line[] = csv_item_edit($anken_no);
	$line[] = csv_item_edit($moushikomibi);
	$line[] = csv_item_edit($purpose_str);
	$line[] = csv_item_edit($kibou_str);
	$line[] = csv_item_edit($buken_sbt_nm);
	$line[] = csv_item_edit($buken_todoufuken_nm.$buken_shikucyouson_nm);
	$line[] = csv_item_edit($buken_banchi);
	$line[] = csv_item_edit($buken_tatemono);
	$line[] = csv_item_edit($chikunensu);
	$line[] = csv_item_edit($menseki);
	$line[] = csv_item_edit($madori_nm);
	$line[] = csv_item_edit($meigi_nm);
	$line[] = csv_item_edit($genjyou_nm);
	$line[] = csv_item_edit($lname.$fname);
	$line[] = csv_item_edit($lname_kn.$fname_kn);
	$line[] = csv_item_edit($tel);
	$line[] = csv_item_edit($e_mail);
	$line[] = csv_item_edit($sumai_todoufuken_nm.$sumai_shikucyouson_nm);
	$line[] = csv_item_edit($sumai_banchi);
	$line[] = csv_item_edit($sumai_tatemono);
	$line[] = csv_item_edit($bikou);
	$line[] = csv_item_edit($rank_nm);
//	$line[] = csv_item_edit($tesuryou);

	$file_str.= implode(",", $line).$crlf;

	// ----------------------------------------------------------------

	$file_str = mb_convert_encoding($file_str, "sjis-win", C_ENCODING);

	$file_length = strlen($file_str);

	$file_name = "案件.csv";
	$agent = $_SERVER['HTTP_USER_AGENT'];
	if(strstr($agent, "MSIE")){
		$file_name = urlencode($file_name);
	}

	header("Content-Disposition: attachment; filename=".$file_name);
	header("Content-Length:".$file_length);
	header("Content-Type: application/octet-stream");

	echo $file_str;

	return true;

}
Esempio n. 5
0
function get_data($gc) {

	$sql = "SELECT";
	$sql.= " anken_no,";
	$sql.= " relocation_flg,";
	$sql.= " chintai_flg,";
	$sql.= " sublease_flg,";
	$sql.= " purpose_flg,";
	$sql.= " buken_sbt,";
	$sql.= " buken_shikucyouson_no,";
	$sql.= " buken_shozai,";
	$sql.= " sonota_jusho,";
	$sql.= " buken_tatemono,";
	$sql.= " chikunensu,";
	$sql.= " menseki,";
	$sql.= " input_val,";
	$sql.= " input_kbn,";
	$sql.= " land_val,";
	$sql.= " madori_no,";
	$sql.= " meigi_no,";
	$sql.= " genjyou_no,";
	$sql.= " room_cnt,";
	$sql.= " fudousan_flg,";
	$sql.= " fudousan_nm,";
	$sql.= " bikou,";
	$sql.= " fullname,";
	$sql.= " fullname_kn,";
	$sql.= " tel,";
	$sql.= " e_mail,";
	$sql.= " sumai_flg,";
	$sql.= " sumai_shikucyouson_no,";
	$sql.= " sumai_yubin,";
	$sql.= " sumai_jusho,";
	$sql.= " sumai_tatemono,";
	$sql.= " moushikomibi,";
	$sql.= " rank_no,";
	$sql.= " tesuryou,";
	$sql.= " mukou_flg ";
	$sql.= "FROM";
	$sql.= " t_item ";
	$sql.= "WHERE";
	$sql.= " item_no = ".$gc->item_no;

	$rs = $gc->db->query($sql);

	if(!$rs->eof){

		$gc->mukou_flg = $rs->fields["mukou_flg"];

		$anken_no = $rs->fields["anken_no"];

		$relocation_flg = $rs->fields["relocation_flg"];
		$chintai_flg = $rs->fields["chintai_flg"];
		$sublease_flg = $rs->fields["sublease_flg"];
		$purpose_flg = $rs->fields["purpose_flg"];

		$buken_sbt = $rs->fields["buken_sbt"];
		$buken_shozai = $rs->fields["buken_shozai"];
		$sonota_jusho = $rs->fields["sonota_jusho"];
		$buken_tatemono = $rs->fields["buken_tatemono"];
		$chikunensu = $rs->fields["chikunensu"];
		$menseki = $rs->fields["menseki"];
		$input_kbn = $rs->fields["input_kbn"];
		$land_val = $rs->fields["land_val"];

		$madori_no = $rs->fields["madori_no"];
		$meigi_no = $rs->fields["meigi_no"];
		$genjyou_no = $rs->fields["genjyou_no"];
		$room_cnt = $rs->fields["room_cnt"];

		$fudousan_flg = $rs->fields["fudousan_flg"];
		$fudousan_nm = $rs->fields["fudousan_nm"];
		$bikou = $rs->fields["bikou"];
		$fullname = $rs->fields["fullname"];
		$fullname_kn = $rs->fields["fullname_kn"];
		$tel = $rs->fields["tel"];
		$e_mail = $rs->fields["e_mail"];
		$sumai_flg = $rs->fields["sumai_flg"];
		$sumai_jusho = $rs->fields["sumai_jusho"];
		$sumai_tatemono = $rs->fields["sumai_tatemono"];
		$moushikomibi = $rs->fields["moushikomibi"];
		$rank_no = $rs->fields["rank_no"];
		$tesuryou = $rs->fields["tesuryou"];

		$arr = fdiv_set_buken_sbt_array();
		$buken_sbt_nm = $arr[$buken_sbt];

		$purpose_arr = fdiv_set_purpose_array();
		$purpose_str = $purpose_arr[$purpose_flg];

		$kibou_str ="";
		if($chintai_flg == 1){
			$kibou_str.= "賃貸募集・賃貸管理  ";
		}
		if($sublease_flg == 1) {
			$kibou_str.= "サブリース  ";
		}
		if($relocation_flg == 1) {
			$kibou_str.= "リロケーション";
		}

		//$info = get_shikucyouson_info($gc, $buken_shikucyouson_no);
		//$buken_syozaichi = $info["todoufuken_nm"].$info["shikucyouson_nm"];

		$chikunensu = (float)$chikunensu;

		if($chikunensu >= 0){
			$chikunensu = $chikunensu."年";
		}else{
			$chikunensu = "";
		}

		//$relocation_str = "いいえ";
		//if($relocation_flg==1){
		//	$relocation_str = "はい";
		//}


		$menseki = $menseki."平米";

		//土地面積
		$land_val = $land_val."平米";

		$arr = fdiv_set_madori_array();
		$madori_nm = $arr[$madori_no];

		$arr = fdiv_set_meigi_array();
		$meigi_nm = $arr[$meigi_no];

		$arr = fdiv_set_genjyou_array();
		$genjyou_nm = $arr[$genjyou_no];
		if($room_cnt > 0){
			$genjyou_nm = $genjyou_nm." 空き部屋数 ".$room_cnt;
		}

		$arr = fdiv_set_sumai_flg_array();
		$sumai_nm = $arr[$sumai_flg];

		$moushikomibi = substr($moushikomibi, 0, 4)."/".substr($moushikomibi, 5, 2)."/".substr($moushikomibi, 8, 2)." ".substr($moushikomibi, 11);

		$s = "\n";
		$s.= "案件番号...............: ".$anken_no."\n";
		$s.= "申込日時...............: ".$moushikomibi."\n";
		$s.= "\n";
		$s.= "───────────────────────────────────\n";
		$s.= "■物件情報■\n";
		$s.= "───────────────────────────────────\n";
		$s.= "ご利用目的.............: ".$purpose_str."\n";
//		$s.= "希望のサービス.........: ".$kibou_str."\n";
		$s.= "物件種別...............: ".$buken_sbt_nm."\n";
		$s.= "物件所在地.............: ".$buken_shozai."\n";
		$s.= "その他住所.............: ".$sonota_jusho."\n";
		if($buken_sbt != 3){
		$s.= "建物名・部屋番号.......: ".$buken_tatemono."\n";
		}
		$s.= "築年数.................: ".$chikunensu."\n";
		$s.= "延床面積...............: ".$menseki."\n";
		if($buken_sbt != 1){
			$s.= "土地面積...............: ".$land_val."\n";
		}
		if($buken_sbt != 2){
		$s.= "間取り.................: ".$madori_nm."\n";
		}
		$s.= "名義...................: ".$meigi_nm."\n";
		$s.= "現況...................: ".$genjyou_nm."\n";
		$s.= "\n";
		$s.= "───────────────────────────────────\n";
		$s.= "■お客様情報■\n";
		$s.= "───────────────────────────────────\n";
		$s.= "お名前.................: ".$fullname."\n";
   		$s.= "フリガナ...............: ".$fullname_kn."\n";
		$s.= "電話番号...............: ".$tel."\n";
		$s.= "メールアドレス.........: ".$e_mail."\n";
		if($sumai_flg==1) {
			$s.= "お住まい...............: ".$sumai_jusho."\n";
			$s.= "建物名・部屋番号.......: ".$sumai_tatemono."\n";
		} else {
			$s.= "お住まい...............: ".$buken_shozai."\n";
			$s.= "その他住所.............: ".$sonota_jusho."\n";
			$s.= "建物名・部屋番号.......: ".$buken_tatemono."\n";
		}
		$s.= "ご要望・ご質問など.....: ".$bikou."\n";
		$s.= "\n";

	}

	$rs->free_result();

	$gc->naiyou = $s;

}