function make_id($type, $db = null) { global $sg; if ($db == null) { // DB渡って来ないと接続〜解放までやってあげる $db = new DBLib($sg); $db->connect(); $id = _make_id($type, $db); $db->close(); return $id; } return _make_id($type, $db); }
function write() { global $sg; $this->fin(); $sql = "insert into access_log (log_date,accept_date,proc_time,status,url,uri,from_ip,from_addr,referer,referer_full,ua,\r\ncarrier,ment_flg,option1,option2,option3,option4,option5,option6) values (\r\nsysdate(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $db = new DBLib($sg); $db->connect(); $db->prepare($sql); $db->bind(date("Y/m/d H:i:s", $this->accept_date / 1000)); $db->bind(floor($this->proc_time)); $db->bind($this->status); $db->bind($this->url); $db->bind($this->uri); $db->bind($this->from_ip); $db->bind($this->from_addr); $db->bind($this->referer); $db->bind($this->referer_full); $db->bind($this->ua); $db->bind($this->carrier); $db->bind($this->ment_flg); $db->bind($this->option1); $db->bind($this->option2); $db->bind($this->option3); $db->bind($this->option4); $db->bind($this->option5); $db->bind($this->nowment); $r = $db->execute_update(false); if (!$r) { print ht(mysql_error()); $db->rollback(); } else { $db->commit(false); } $db->close(); }
} return $ret; } function make_pr($db) { $sql1 = "select id,name,movie_path,date_format(term, '%Y年%m月%d日') as term from practice \r\nwhere delete_flg = '0'\r\norder by create_date desc\r\nlimit 2"; $db->prepare($sql1); $arr = $db->execute(); $ret = ""; foreach ($arr as $ar) { $ret .= sprintf("<li><a href=\"s_pr.php?i=%s\">%s 様</a> <p class=\"small2\">(%sの練習風景)</p></li>\n", $ar["id"], g_name(ht($ar["name"])), ht($ar["term"])); } return $ret; } $db = new DBLib($sg); $db->connect(); $sch = make_schedule($db); $news = make_news($db); $pr = make_pr($db); if ($news == "") { $news = "<li><span>ニュースは特にありません</span></li>"; } $db->close(); ?> <h4><img src="img/arrow21-006-03.gif" style="vertical-align: -2px"> 今月の営業日</h4> <div class="x"> <ul id="ul3"> <?php print $sch; ?> </ul>