1
|
1 <?php
|
|
2
|
|
3 // ライブラリ
|
|
4
|
|
5 function toTimestamp( $string ) {
|
|
6 sscanf( $string, "%4d-%2d-%2d %2d:%2d:%2d", $y, $mon, $day, $h, $min, $s );
|
|
7 return mktime( $h, $min, $s, $mon, $day, $y );
|
|
8 }
|
|
9
|
|
10 function toDatetime( $timestamp ) {
|
|
11 return date("Y-m-d H:i:s", $timestamp);
|
|
12 }
|
|
13
|
|
14
|
|
15 function jdialog( $message, $url = "index.php" ) {
|
|
16 header( "Content-Type: text/html;charset=utf-8" );
|
|
17 exit( "<script type=\"text/javascript\">\n" .
|
|
18 "<!--\n".
|
|
19 "alert(\"". $message . "\");\n".
|
|
20 "window.open(\"".$url."\",\"_self\");".
|
|
21 "// -->\n</script>" );
|
|
22 }
|
|
23
|
|
24 ?> |