e-gru_user_dump.php 1.55 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:e-gru
//* プログラムID:toroku.php
//* 機能        :DB作成、登録
//* 作成者      :K.Yoshimura(MTC)
//* 
//*****************************************************************************

header("Content-type: text/html; charset=EUC-JP");

include("../include/dbcon_e-gru_admin.inc");
include("../include/jcode.phps");
include("../include/mime.php");


	//dbcon.inc作成
	$file_path = '';
	$make_file = 'dump.txt'; 
	if(!is_file($file_path.$make_file)){ // ファイルの確認 
		touch($file_path.$make_file); // 空のファイルを作成 
	}else{ 
		echo("ファイル作成失敗");
	} 
	chmod($file_path.$make_file,0644); // パーミッション変更 

	$strSql = " select kokyaku_no,kokyaku_name,mail_add from kokyaku_info_tbl RIGHT OUTER JOIN kokyaku_tbl USING ( kokyaku_no )";
	$rsResult = pg_exec($pg_con,$strSql);

	for ($intCnt=0; $intCnt < pg_numrows($rsResult); $intCnt++){
		$objData = pg_fetch_object($rsResult, $intCnt);
		$kokyaku_name=$objData->kokyaku_name;
		$mail_add=$objData->mail_add;
		$forder_name=$objData->forder_name;
//		if(!is_file("/home/webusr/WWW/e-gru/".$forder_name."/index.php")){
		if(!is_file("/usr/local/apache/htdocs/WWW/e-gru/".$forder_name."/index.php")){
			$incstr .= $kokyaku_name.",".$mail_add."\n";
		}else{ 

		} 
		
	}

	if (!$handle = fopen($file_path.$make_file, 'a')) {
		print "Cannot open file ($file_path.$make_file)";
		exit;
	}
	if (!fwrite($handle, $incstr)) {
		print "Cannot write to file ($file_path.$make_file)";
		exit;
	}
	fclose($handle);


?>