root/trunk/install/php/foltialib.php

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

表記ミス修正

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