", "SJIS", "UTF-8" );
include( "/home/www/htdocs/share/error.htm" );
exit;
}
if( $satonoter && $satonoter->exist() ) {
//
}
else {
$error_msg = mb_convert_encoding( "ログインしていないと里山ノートを保存できません。
", "SJIS", "UTF-8" );
include( "/home/www/htdocs/share/error.htm" );
exit;
}
// DB 接続
if( ! ( $db = pg_connect( DB_CONN ) ) ) {
$error_msg = mb_convert_encoding( "現在サーバーが保守中か大変混雑しているためご利用いただけません。
", "SJIS", "UTF-8" );
include( "/home/www/htdocs/share/error.htm" );
exit;
}
// イメージ保存
$tmpfn = "../tmp/" . time() . ".png";
pg_query( $db, "BEGIN" );
pg_lo_export( $db, $satonoter->getVal( SATONOTER_ICONIMAGE ), $tmpfn );
pg_query( $db, "COMMIT" );
$username = $satonoter->getVal( SATONOTER_NICKNAME ) . "さんの";
$clearat = $satonoter->getAry( SATONOTER_A_COMPLETE, 1 - 1 );
$pdf = new TCPDF( 'L', 'pt', PDF_PAGE_FORMAT, true, 'utf-8', false );
$pdf->SetCreator( PDF_CREATOR );
$pdf->SetAuthor( 'House Wellness Foods Corporation., Ltd.' );
$pdf->SetTitle( 'Genkiiro no Sato' );
$pdf->SetSubject( 'My Satoyama Note' );
$pdf->SetPrintHeader( false );
$pdf->SetDefaultMonospacedFont( PDF_FONT_MONOSPACED );
$pdf->setImageScale( PDF_IMAGE_SCALE_RATIO );
$pdf->setLanguageArray( $l );
// set font
$pdf->SetFont( 'arialunicid0', '', 18 );
$pdf->AddPage();
// 背景イメージ
$pdf->Image( 'img/bg.png', 36, 52 );
// ニックネーム
$pdf->SetXY( 72, 200 );
$pdf->Write( 0, $username, '', 0, 'L', true, 0, false, false, 0 );
// クリア
$pdf->SetXY( 72, 500 );
$pdf->Write( 0, $clearat, '', 0, 'L', true, 0, false, false, 0 );
// アイコンイメージ
$pdf->Image( $tmpfn, 110, 320, 80, 80 );
// スタンプイメージ
$pdf->Image( "img/stamp01.png", 490, 408, 81, 78 );
$pdf->Image( "img/stamp02.png", 343, 365, 80, 78 );
$pdf->Image( "img/stamp03.png", 440, 307, 78, 76 );
$pdf->Image( "img/stamp04.png", 567, 267, 78, 76 );
$pdf->Image( "img/stamp05.png", 455, 204, 77, 80 );
$pdf->Image( "img/stamp06.png", 346, 144, 79, 81 );
// var_dump( $satonoter->getStatus( SATONOTER_TRIVIA, SATONOTE_VOL, 0 ) ); exit;
if( $satonoter->getStatus( SATONOTER_TRIVIA, 1, 0 ) == "1" ) {
$pdf->Image( "img/animal01.png", 450, 400, 58, 105 );
}
if( $satonoter->getStatus( SATONOTER_TRIVIA, 1, 1 ) == "1" ) {
$pdf->Image( "img/animal02.png", 250, 420, 103, 81 );
}
if( $satonoter->getStatus( SATONOTER_TRIVIA, 1, 2 ) == "1" ) {
$pdf->Image( "img/animal03.png", 380, 280, 68, 59 );
}
// var_dump( $satonoter->getStatus( SATONOTER_TRIVIA, 1, 3 ) ); exit;
if( $satonoter->getStatus( SATONOTER_TRIVIA, 1, 3 ) == "1" ) {
$pdf->Image( "img/animal04.png", 650, 260, 117, 68 );
}
if( $satonoter->getStatus( SATONOTER_TRIVIA, 1, 4 ) == "1" ) {
$pdf->Image( "img/animal05.png", 520, 200, 73, 49 );
}
if( $satonoter->getStatus( SATONOTER_TRIVIA, 1, 5 ) == "1" ) {
$pdf->Image( "img/animal06.png", 440, 140, 69, 56 );
}
$pdf->AddPage();
$pdf->Image( 'img/page1.jpg', 36, 52 );
$pdf->AddPage();
$pdf->Image( 'img/page2.jpg', 36, 52 );
$pdf->Output( 'mynote.pdf', 'I' );
unlink( $tmpfn );
?>