LoadTemplatefile("gbookreg.tpl.html"); // cat for($i=1;$isetCurrentBlock("cat"); $it->setVariable("DT_CAT_LIST",$array_cat[$i]); $it->parseCurrentBlock("cat"); } // top $it->setCurrentBlock("top"); $it->setVariable("BT_MODE",BT_INSERT); $it->setVariable("URL_SELF",URL_SELF); $it->setVariable("URL_RETURN",URL_RETURN); $it->parseCurrentBlock("top"); $it->show(); } // edit form function gb_form_edit($_num = ""){ global $array_cat; if($_num==="" || !is_numeric($_num)) exit; $sql="select id,name,mail,url,mess,cat,date from tdata where id=$_num"; // $db=new pgsql_fetch(DB_NAME,DB_USER); if(!$db->connect()){ print "ERROR:".$db->errprmessage; exit;} if(!$db->execute($sql)){ print "ERROR:".$db->errprmessage; exit;} if(!$r=$db->assoc()){ print "ERROR:指定データは存在しません."; exit;} // htmlデータセット $it = new pear_it(); $it->LoadTemplatefile("gbookedit.tpl.html"); // cat for($i=1;$isetCurrentBlock("cat"); $it->setVariable("DT_CAT_LIST",$array_cat[$i]); if($r["cat"] == $array_cat[$i]) $it->setVariable("DT_CAT_SELECTED","SELECTED"); $it->parseCurrentBlock("cat"); } // top $it->setCurrentBlock("top"); $it->setVariable("DT_ID",$r["id"]); $it->setVariable("DT_NAME",$r["name"]); $it->setVariable("DT_MAIL",$r["mail"]); $it->setVariable("DT_URL",$r["url"]); $it->setVariable("DT_MESS",$r["mess"]); $it->setVariable("BT_EDIT",BT_UPDATE); $it->setVariable("BT_DEL",BT_DELETE); $it->setVariable("URL_SELF",URL_SELF); $it->setVariable("URL_RETURN",URL_RETURN); $it->parseCurrentBlock("top"); $it->show(); } ?>