root/trunk/install/php/foltialib.php

リビジョン 84, 17.8 kB (コミッタ: sorshi, コミット時期: 15 年 前)

SQLが不正だったのを修正。
数字の評価をする関数getgetnumformを負の数にも対応。

Line 
1 <?php
2         
3 include("./foltia_config2.php");
4
5 /*
6 こちらのモジュールは
7 Apache + PHP + PostgreSQL 実験室
8 http://www.hizlab.net/app/
9 のサンプルを使わせていただいております。
10 ありがとうございます。
11 */
12
13     /* エラー表示の抑制 */
14     //error_reporting(0);
15
16     
17     //GET用フォームデコード
18       function getgetform($key) {
19     if ($_GET["{$key}"] != "") {
20         $value = $_GET["{$key}"];
21                    escape_string($value);
22                    htmlspecialchars($value);
23     return ($value);
24     }
25   }
26     //GET用数字フォームデコード
27       function getgetnumform($key) {
28     if ($_GET["{$key}"] != "") {
29         $value = $_GET["{$key}"];
30         escape_string($value);
31         htmlspecialchars($value);
32         $value = ereg_replace("[^-0-9]", "", $value);
33         $value = escape_numeric($value);
34     return ($value);
35     }
36   }
37     
38     //フォームデコード
39       function getform($key) {
40             //    global $where;
41     if ($_POST["{$key}"] != "") {
42         $value = $_POST["{$key}"];
43                    escape_string($value);
44                    htmlspecialchars($value);
45     return ($value);
46     }
47   }
48     //数字専用フォームデコード
49       function getnumform($key) {
50     if ($_POST["{$key}"] != "") {
51         $value = $_POST["{$key}"];
52                    escape_string($value);
53                    htmlspecialchars($value);
54                    $value = ereg_replace("[^0-9]", "", $value);
55         $value = escape_numeric($value);
56     return ($value);
57     }
58   }
59
60     /* 全角カタカナ化してスペースを削除してインデックス用にする */
61     function name2read($name) {
62     $name = mb_convert_kana($name, "KVC", "EUC-JP");
63     $name = mb_convert_kana($name, "s", "EUC-JP");
64     $name = ereg_replace(" ", "", $name);
65
66         return $name;
67     }
68
69     /* 数字を半角化して数字化してインデックス用にする */
70     function pnum2dnum($num) {
71     $num = mb_convert_kana($num, "a", "EUC-JP");
72     $num = ereg_replace("[^0-9]", "", $num);
73
74         return $num;
75     }
76     
77     /* 終了関数の定義 */
78     function die_exit($message) {
79         ?>
80         <p class="error"><?= $message ?></p>
81         <div class="index"><a href="./">トップ</a></div>
82     </body>
83 </html><?
84         exit;
85     }
86     
87     /* 入力した値のサイズをチェック */
88     function check_length($str, $maxlen, $must, $name) {
89         $len = strlen($str);
90         if ($must && $len == 0) {
91             die_exit("$name が入力されてません。必須項目です。");
92         }
93         if ($len > $maxlen) {
94             die_exit("$name は $len 文字以下で入力して下さい。全角文字は、一文字で二文字分と計算されます。");
95         }
96     }
97     
98     /* LIKE 用の文字列のエスケープ */
99     function escape_like($sql, $quote = TRUE) {
100         return ($quote ? "'" : "") .
101                str_replace(array("\\\\",     "%"    , "_"    ),
102                            array("\\\\\\\\", "\\\\%", "\\\\_"),
103                            pg_escape_string($sql)) .
104                ($quote ? "'" : "");
105     }
106     
107     /* SQL 文字列のエスケープ */
108     function escape_string($sql, $quote = TRUE) {
109         if ($quote && strlen($sql) == 0) {
110             return "null";
111         }
112         return ($quote ? "'" : "") .
113                pg_escape_string($sql) .
114                ($quote ? "'" : "");
115     }
116     
117     /* SQL 数値のエスケープ */
118     function escape_numeric($sql) {
119         if (strlen($sql) == 0) {
120             return "null";
121         }
122         if (!is_numeric($sql)) {
123             die_exit("$sql は数値ではありません。");
124         }
125         return $sql;
126     }
127     
128     /* PostgreSQL サーバに接続 */
129     function m_connect() {
130 /*        $con = @pg_connect("host=".DBHOST ." dbname=".DATABASE_NAME .
131                            " user=".USER_NAME .
132                            " password=".USER_PASSWORD);
133 */
134         $con = @pg_pconnect("host=".DBHOST ." dbname=".DATABASE_NAME .
135                            " user=".USER_NAME .
136                            " password=".USER_PASSWORD);
137
138
139         if (!$con) {
140             die_exit("データベースに接続出来ませんでした。");
141         }
142         /* データベースと、PHP の内部文字コードが違う場合 */
143         return($con);
144     }
145
146     /* データベースとの接続を切り離す */
147     function m_close($con) {
148         return @pg_close($con);
149     }
150
151     /* SQL 文を実行 */
152     function m_query($con, $query, $errmessage) {
153         $rtn = @pg_query($con, $query);
154         if (!$rtn) {
155             /* エラーメッセージに SQL 文を出すのはセキュリティ上良くない!! */
156             $msg = $errmessage . "<br>\n" .
157                    @pg_last_error($con) . "<br>\n" .
158                    "<small><code>" . htmlspecialchars($query) .
159                    "</code></small>\n";
160                    $rtn = @pg_query($con, "rollback");//04.4.8
161             m_close($con);
162             die_exit($msg);
163         }
164         return($rtn);
165     }
166
167     /* select した結果をテーブルで表示 */
168     function m_showtable($rs) {
169         /* 検索件数 */
170         $maxrows = pg_num_rows($rs);
171         
172         if ($maxrows == 0) {
173             echo("<p class=\"msg\">データが存在しません</p>\n");
174             return 0;
175         }
176         
177         /* フィールド数 */
178         $maxcols = pg_num_fields($rs);
179         ?>
180 <table class="list" summary="データ検索結果を表示" border="1">
181     <thead>
182         <tr>
183             <?php
184                 /* テーブルのヘッダーを出力 */
185                 for ($col = 1; $col < $maxcols; $col++) {
186                     /* pg_field_name() はフィールド名を返す */
187                     $f_name = htmlspecialchars(pg_field_name($rs, $col));
188                     echo("<th abbr=\"$f_name\">$f_name</th>\n");
189                 }
190             ?>
191         </tr>
192     </thead>
193     <tbody>
194         <?php
195             /* テーブルのデータを出力 */
196             for ($row = 0; $row < $maxrows; $row++) { /* 行に対応 */
197                 echo("<tr>\n");
198                 /* pg_fetch_row で一行取り出す */
199                 $rowdata = pg_fetch_row($rs, $row);
200                 /* 1列目にリンクを張る */
201                 echo("<td><a href=\"edit.php?q_code=" .
202                      urlencode($rowdata[0]) . "\">" .
203                      htmlspecialchars($rowdata[1]) . "</a></td>\n");
204                 for ($col = 2; $col < $maxcols; $col++) { /* 列に対応 */
205                     echo("<td>".htmlspecialchars($rowdata[$col])."<br></td>\n");
206                 }
207                 echo("</tr>\n");
208             }
209         ?>
210     </tbody>
211 </table>
212         <?php
213         return $maxrows;
214     }
215
216     /* 指定したコードのデータを表示 */
217     function m_viewdata($con, $code) {
218         /* コードに該当するデータを検索 */
219         $query = "
220 select p.code
221       ,p.name
222       ,p.email
223       ,p.pseudonym
224       ,s.name as job
225       ,p.profile
226       ,to_char(p.editdate, 'YYYY/MM/DD HH24:MI:SS') as editdate
227   from inet_profile p left join inet_job s on p.job = s.code
228  where p.code = $code";
229         $rs = m_query($con, $query, "個人情報の取得に失敗しました。");
230         if (pg_num_rows($rs) == 0) {
231             echo("<p class=\"msg\">データが存在しません</p>\n");
232             return FALSE;
233         }
234         
235         /* フィールド数 */
236         $maxcols = pg_num_fields($rs);
237         /* 先頭行 */
238         $rowdata = pg_fetch_row($rs, 0);
239         ?>
240 <table class="view" summary="データベース上のデータを表示" border="1">
241     <tr>
242         <td class="name"><?= htmlspecialchars(pg_field_name($rs, 1)) ?></td>
243         <td><a href="edit.php?q_code=<?= $rowdata[0] ?>"
244              ><?= htmlspecialchars($rowdata[1]) ?></a></td>
245     </tr>
246     <?php for ($col = 2; $col < $maxcols; $col++) { ?>
247     <tr>
248         <td class="name"><?= htmlspecialchars(pg_field_name($rs, $col)) ?></td>
249         <td><?= htmlspecialchars($rowdata[$col]) ?></td>
250     </tr>
251     <?php } ?>
252 </table>
253         <?php
254         /* クエリーを解放 */
255         pg_free_result($rs);
256         
257         return TRUE;
258     }
259     
260
261 function printhtmlpageheader(){
262
263 global $useenvironmentpolicy;
264
265 $serveruri = getserveruri();
266 $username = $_SERVER['PHP_AUTH_USER'];
267
268 print "<p align='left'><font color='#494949'><A HREF = 'http://www.dcc-jpl.com/soft/foltia/' target=\"_blank\">foltia</A> | <A HREF = './index.php'>放映予定</A> | <A HREF = './index.php?mode=new'>新番組</A> | <A HREF = './listreserve.php'>予約一覧</A> | <A HREF = './titlelist.php'>番組一覧</A> | <A HREF = './viewepg.php'>番組表</A> | 録画一覧(<A HREF = './showplaylist.php'>録画順</A>・<A HREF = './showplaylist.php?list=title'>番組順</A>・<A HREF = './showplaylist.php?list=raw'>全</A>) | <A HREF = './showlib.php'>録画ライブラリ</A> |  <A HREF = './folcast.php'>Folcast</A>[<a href=\"itpc://$serveruri/folcast.php\">iTunesに登録</a>] | ";
269 if ($useenvironmentpolicy == 1){
270     print "【 $username 】";
271 }
272
273 print "</font></p>\n";
274
275 }
276
277
278 function renderepgstation($con,$stationname,$start){ //戻り値 なし EPGの局表示
279
280 $now = date("YmdHi");
281 $today = date("Ymd");   
282 $tomorrow = date ("Ymd",mktime(0, 0, 0, date("m")  , date("d")+1, date("Y")));
283 //$today = "20051013";   
284 //$tomorrow = "20051014";
285 //$epgstart = $today . "2000";
286 $epgstart = $start ;
287 //$epgend = $tomorrow . "0400";
288 $epgend = calcendtime($start , (8*60));
289 $query = "
290 SELECT startdatetime , enddatetime , lengthmin , epgtitle , epgdesc , epgcategory  ,ontvchannel  ,epgid
291 FROM foltia_epg
292 WHERE foltia_epg.ontvchannel = '$stationname' AND
293 enddatetime  > $epgstart  AND
294 startdatetime  < $epgend 
295 ORDER BY foltia_epg.startdatetime  ASC
296     ";
297     $rs = m_query($con, $query, "DBクエリに失敗しました");
298     $maxrows = pg_num_rows($rs);
299 if ($maxrows == 0) {
300         print("番組データがありません<BR>");           
301 }else{
302 print "<table width=\"100%\"  border=\"0\">\n";
303 //print "<ul><!-- ($maxrows) $query -->\n";
304
305 for ($row = 0; $row < $maxrows; $row++) {
306     
307 $rowdata = pg_fetch_row($rs, $row);
308
309 $printstarttime = substr($rowdata[0],8,2) . ":" substr($rowdata[0],10,2);
310 $tdclass = "t".substr($rowdata[0],8,2) .  substr($rowdata[0],10,2);
311 $title = htmlspecialchars($rowdata[3]);
312 $title = z2h($title);
313 $desc = htmlspecialchars($rowdata[4]);
314 $desc = z2h($desc);
315 $height htmlspecialchars($rowdata[2]) * 3;
316 $epgid htmlspecialchars($rowdata[7]);
317
318 print"
319       <tr>
320         <td height = \"$height\" >$printstarttime  <A HREF=\"./reserveepg.php?epgid=$epgid\">$title</A> $desc <!-- $rowdata[0] - $rowdata[1] --></td>
321       </tr>
322 ";
323 /*print"<li style=\"height:" . $height ."px;\" class=\"$tdclass\">
324 $printstarttime  <A HREF=\"./reserveepg.php?epgid=$epgid\">$title</A> $desc($rowdata[0] - $rowdata[1])
325 </li>\n";
326 */
327 }//for
328 //print "</ul>\n";
329 print "</table>\n";
330
331 }//if
332 }//end function
333
334 function calcendtime($start,$lengthmin){//戻り値 終了時刻(Ex:200510170130)
335 $startyear =   substr($start,0,4);
336 $startmonth =   substr($start,4,2);
337 $startday =   substr($start,6,2);
338 $starthour =   substr($start,8,2);
339 $startmin =   substr($start,10,2);
340 //int mktime ( [int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]] )
341 $endtime = date ("YmdHi",mktime($starthour  , $startmin + $lengthmin , 0, $startmonth  , $startday, $startyear));
342
343 return ($endtime );
344 }//end function
345
346
347 function z2h($string){ //戻り値 半角化した文字
348     $stringh = mb_convert_kana($string, "a", "EUC-JP");
349  return ($stringh );
350 }
351
352 function foldate2rfc822($start){//戻り値 RFC822スタイルの時刻表記
353     $startyear =   substr($start,0,4);
354     $startmonth =   substr($start,4,2);
355     $startday =   substr($start,6,2);
356     $starthour =   substr($start,8,2);
357     $startmin =   substr($start,10,2);
358
359     $rfc822 = date ("r",mktime($starthour  , $startmin , 0, $startmonth  , $startday, $startyear));
360     
361     return ($rfc822);
362 }//end sub
363
364 function foldate2print($start){//戻り値 日本語風時刻表記
365     $startyear =   substr($start,0,4);
366     $startmonth =   substr($start,4,2);
367     $startday =   substr($start,6,2);
368     $starthour =   substr($start,8,2);
369     $startmin =   substr($start,10,2);
370
371     $printabledate = date ("Y/m/d H:i",mktime($starthour  , $startmin , 0, $startmonth  , $startday, $startyear));   
372     return ($printabledate);
373 }//end sub
374
375 function getserveruri(){//戻り値 サーバアドレス Ex.www.dcc-jpl.com:8800/soft/foltia/
376
377 //リンクURI組み立て
378 $sv6 = $_SERVER['SCRIPT_NAME'];///dameNews/sarasorjyu/archives.php
379 $sv8 = $_SERVER['SERVER_NAME'];//sync.dcc-jpl.com
380 $sv9 = $_SERVER['SERVER_PORT'];
381 if ($sv9 == 80){
382     $port = "";
383 }else{
384     $port = ":$sv9";
385 }
386 $a = split("/", $sv6);
387 array_pop($a);
388
389 $scriptpath = implode("/", $a);
390
391 $serveruri = "$sv8$port$scriptpath";
392 return ($serveruri );
393 }//end sub
394
395
396 function getserverfqdn(){//戻り値 サーバアドレス Ex.www.dcc-jpl.com:8800
397
398 //リンクURI組み立て
399 $sv6 = $_SERVER['SCRIPT_NAME'];///dameNews/sarasorjyu/archives.php
400 $sv8 = $_SERVER['SERVER_NAME'];//sync.dcc-jpl.com
401 $sv9 = $_SERVER['SERVER_PORT'];
402 if ($sv9 == 80){
403     $port = "";
404 }else{
405     $port = ":$sv9";
406 }
407 $a = split("/", $sv6);
408 array_pop($a);
409
410 $scriptpath = implode("/", $a);
411
412 $serveruri = "$sv8$port";
413 return ($serveruri );
414 }//end sub
415
416
417 function printdiskusage(){//戻り値 なし
418 list (, $all, $use , $free, $usepercent) =  getdiskusage();
419
420 print "
421 <div style=\"width:100%;border:1px solid black;text-align:left;\"><span style=\"float:right;\">$free</span>
422 <div style=\"width:$usepercent;border:1px solid black;background:white;\">$use/$all($usepercent)</div>
423 </div>
424 ";
425 //exec('ps ax | grep ffmpeg |grep MP4 ' ,$ffmpegprocesses);
426 }//end sub
427
428
429 function getdiskusage(){//戻り値 配列 [,全体容量, 使用容量 , 空き容量, 利用割合]
430
431 global $recfolderpath,$recfolderpath;
432
433     exec ( "df -h  $recfolderpath | grep $recfolderpath", $hdfreearea);
434     $freearea = preg_split ("/[\s,]+/", $hdfreearea[0]);
435
436     return $freearea;
437     
438 }//endsub
439
440
441 function printtrcnprocesses(){
442
443 $ffmpegprocesses = `ps ax | grep ffmpeg | grep -v grep |  wc -l `;
444 $uptime = exec('uptime');
445
446 print "<div style=\"text-align:left;\">";
447 print "$uptime<br>\n";
448 print "トラコン稼働数:$ffmpegprocesses<br>\n";
449 print "</div>";
450
451 }//endsub
452
453
454 function warndiskfreearea(){
455
456 global $demomode;
457
458 if ($demomode){
459 print "<!-- demo mode -->";
460 }else{
461
462 global $recfolderpath,$hdfreearea ;
463
464     exec ( "df   $recfolderpath | grep $recfolderpath", $hdfreearea);
465     $freearea = preg_split ("/[\s,]+/", $hdfreearea[0]);
466 $freebytes = $freearea[3];
467 if ($freebytes == "" ){
468 //
469 //print "<!-- err:\$freebytes is null -->";
470 }elseif($freebytes > 1024*1024*100 ){// 100GB以上あいてれば
471 //なにもしない
472 print "<style type=\"text/css\"><!-- --></style>";
473 }elseif($freebytes > 1024*1024*50 ){// 100GB以下
474 print "<style type=\"text/css\"><!--
475     body {
476     background-color: #CCCC99;
477      }
478 -->
479 </style>
480 ";
481 }elseif($freebytes > 1024*1024*30 ){// 50GB以下
482 print "<style type=\"text/css\"><!--
483     body {
484     background-color:#CC6666;
485      }
486 -->
487 </style>
488 ";
489 }elseif($freebytes > 0 ){// 30GB以下
490 print "<style type=\"text/css\"><!--
491     body {
492     background-color:#FF0000;
493      }
494 -->
495 </style>
496 ";
497 }else{ //空き容量 0バイト
498 print "<style type=\"text/css\"><!--
499     body {
500     background-color:#000000;
501      }
502 -->
503 </style>
504 ";
505 }//endif freebytess
506
507 }//endif demomode
508
509 }//endsub
510
511
512
513 function foldatevalidation($foldate){
514
515 if (strlen($foldate) == 12 ){
516
517     $startyear =   substr($foldate,0,4);
518     $startmonth =   substr($foldate,4,2);
519     $startday =   substr($foldate,6,2);
520     $starthour =   substr($foldate,8,2);
521     $startmin =   substr($foldate,10,2);
522
523     $startepoch = date ("U",mktime($starthour  , $startmin , 0, $startmonth  , $startday, $startyear));   
524     $nowe = time();
525     if ($startepoch > $nowe){
526     //print "$foldate:$startepoch:$nowe";
527         return TRUE;
528     }else{
529         return FALSE;
530     }    //end if $startepoch > $nowe
531 }else{
532     return FALSE;
533 }//end if ($foldate) == 12
534
535 }//end function
536
537
538
539 function login($con,$name,$passwd){
540 global $environmentpolicytoken;
541
542 //入力内容確認
543  if (((mb_ereg('[^0-9a-zA-Z]', $name)) ||(mb_ereg('[^0-9a-zA-Z]', $passwd) ))){
544     
545     //print "エラー処理\n";
546     //print "<!-- DEBUG name/passwd format error-->";
547     redirectlogin();
548     
549 }else{
550 //print "正常処理\n";
551 //db検索
552 escape_string($name);
553 escape_string($passwd);
554
555 $query = "
556 SELECT memberid ,userclass,name,passwd1
557 FROM foltia_envpolicy
558 WHERE foltia_envpolicy.name  = '$name' 
559     ";
560     $useraccount = m_query($con, $query, "DBクエリに失敗しました");
561     $useraccountrows = pg_num_rows($useraccount);
562     
563     if ($useraccountrows == 1 ){
564         $rowdata = pg_fetch_row($useraccount, 0);
565         $memberid = $rowdata[0];
566         $userclass = $rowdata[1];
567         $username $rowdata[2];
568         $dbpasswd = $rowdata[3];
569     }else{
570         header("HTTP/1.0 401 Unauthorized");
571         //print "<!-- DEBUG DB record error ($useraccountrows)-->";
572         redirectlogin();
573     }//end if
574
575
576 // passwdをdbから取りだし
577 if ($userclass == 0){
578 $dbpasswd = "$dbpasswd";
579 }else{
580 // db passwdとトークンを連結し
581 $dbpasswd = "$dbpasswd"."$environmentpolicytoken";
582 }
583 //それが入力と一致すれば認証
584 if ($passwd == $dbpasswd) {
585 //print "認証成功<br>$dbpasswd  $passwd\n";
586 }else{
587 //print "認証失敗<br>$dbpasswd  $passwd\n";
588         header("HTTP/1.0 401 Unauthorized");
589         //print "<!-- DEBUG passwd unmatch error>";
590         redirectlogin();
591 }
592 }//end if mb_ereg
593 }//end function login
594
595
596
597
598 function redirectlogin(){
599 global $environmentpolicytoken;
600
601 print "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n";
602 print "<html><head>\n";
603 print "<title>foltia:Invalid login</title>\n";
604 print "</head><body>\n";
605 print "<h1>Invalid login</h1>";
606 print "<p>foltiaヘのアクセスにはログインが必要です。再ログインはリロードやブラウザ再起動で、新規アカウント登録は<a href=\"./accountregist.php\">こちらから。</a></p>";
607 if ($environmentpolicytoken == ""){
608 }else{
609     print "<p>突然この画面が表示された場合にはセキュリティコードが変更されたかも知れません。</p>";
610 }
611 print "</p><hr>\n";
612 print "<address>foltia by DCC-JPL Japan/foltia Project.  <a href = \"http://www.dcc-jpl.com/soft/foltia/\">http://www.dcc-jpl.com/soft/foltia/</a></address>\n";
613 print "</body></html>\n";
614
615
616
617 exit;
618 }//end function redirectlogin
619
620 function getuserclass($con){
621 global $useenvironmentpolicy;
622 $username = $_SERVER['PHP_AUTH_USER'];
623
624 if ($useenvironmentpolicy == 1){
625 $query = "
626 SELECT memberid ,userclass,name,passwd1
627 FROM foltia_envpolicy
628 WHERE foltia_envpolicy.name  = '$username' 
629     ";
630         $useraccount = m_query($con, $query, "DBクエリに失敗しました");
631     $useraccountrows = pg_num_rows($useraccount);
632     
633     if ($useraccountrows == 1 ){
634         $rowdata = pg_fetch_row($useraccount, 0);
635         //$userclass = $rowdata[1];
636         return ($rowdata[1]);
637     }else{
638     return (99);//エラー
639     }//end if
640     
641 }else{
642     return (0);//環境ポリシー使わないときはつねに特権モード
643 }//end if
644 }//end function getuserclass
645
646
647
648 function getmymemberid($con){
649 global $useenvironmentpolicy;
650 $username = $_SERVER['PHP_AUTH_USER'];
651
652 if ($useenvironmentpolicy == 1){
653 $query = "
654 SELECT memberid ,userclass,name,passwd1
655 FROM foltia_envpolicy
656 WHERE foltia_envpolicy.name  = '$username' 
657     ";
658         $useraccount = m_query($con, $query, "DBクエリに失敗しました");
659     $useraccountrows = pg_num_rows($useraccount);
660     
661     if ($useraccountrows == 1 ){
662         $rowdata = pg_fetch_row($useraccount, 0);
663         //$userclass = $rowdata[1];
664         return ($rowdata[0]);
665     }else{
666     return (-1);//エラー
667     }//end if
668     
669 }else{
670     return (0);//環境ポリシー使わないときはつねに特権モード
671 }//end if
672 }//end function getuserclass
673
674
675 function getmemberid2name($con,$memberid){
676 global $useenvironmentpolicy;
677 //$username = $_SERVER['PHP_AUTH_USER'];
678
679 if ($useenvironmentpolicy == 1){
680 $query = "
681 SELECT memberid ,userclass,name,passwd1
682 FROM foltia_envpolicy
683 WHERE foltia_envpolicy.memberid  = '$memberid' 
684     ";
685         $useraccount = m_query($con, $query, "DBクエリに失敗しました");
686     $useraccountrows = pg_num_rows($useraccount);
687     
688     if ($useraccountrows == 1 ){
689         $rowdata = pg_fetch_row($useraccount, 0);
690         return ($rowdata[2]);
691     }else{
692     return ("");//エラー
693     }//end if
694     
695 }else{
696     return ("");
697 }//end if
698
699
700
701 }//end function getmemberid2name
702
703 ?>
704
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed