getAll("$sql$where$order$limit"); $cnt = count($data); //Àüü »çÁø °¹¼ö $total = $PDBC->getOne("SELECT count(*) as t_cnt FROM $table "); // ÆäÀÌ¡ if($page < 1) $page=1; //Ãѱۼö ±¸Çϱâ // $total = $rec_count[total]; //°Ë»ö ½ÃÀÛ row, ³¡ row ±¸Çϱâ if ($total <= $list_num || $page == 1) $begin_row = 0; else $begin_row = (($page-1)*$list_num); $param = "gno=$gno"; $PageList= $myFunction->PageIndex1($total, $list_num, $param, $page) ; //¼ø¼­ - »ç¿ë¾ÊÀ½ $index_num = $total-(($page-1)*$list_num); //ÇØ´ç»çÁø°¹¼ö $p_qry = "select count(*) as pics from $file_table where gno = ? "; $sth = $PDBC->prepare("$p_qry"); for($i=0;$i<$cnt;$i++){ $res = $PDBC->execute($sth, $data[$i][no]); $row = $res->fetchRow(DB_FETCHMODE_ORDERED); $data[$i][pics] = $row[0]; $data[$i][idx] = $index_num--; // $index_num--; } if (PEAR::isError($data)) { die($data->getMessage()); } $smarty->assign("PageList",$PageList); $smarty->assign("index_num",$index_num); $output = 'gallery.tpl'; $smarty->assign("rowData",$data); }elseif($mode == "read"){ $g_rlt = $PDBC->query("SELECT * FROM $table WHERE no=$gno"); $g_rlt->fetchInto($g_data); //ÀÐÀº°Í ¾÷µ¥ÀÌÆ® $g_read_sql = "update $table set hit=hit+1 WHERE no=$gno"; $PDBC->query($g_read_sql); $list_num = 12; if($page < 1) $page=1; $start = ($list_num*($page-1)); $sql = "SELECT * FROM $file_table "; $where = " WHERE gno=$gno"; $limit =" LIMIT $start , $list_num"; $data = $PDBC->getAll("$sql$where$limit"); $rows = 3; $cols =4; $array = array_fill(0, 12 ,""); if (PEAR::isError($data)) { die($data->getMessage()); } //Àüü »çÁø °¹¼ö // $total = $PDBC->getOne("SELECT count(*) as t_cnt FROM $table "); // ÆäÀÌ¡ $total = $PDBC->getOne("SELECT * FROM $file_table WHERE gno=$gno "); //Ãѱۼö ±¸Çϱâ // $total = $rec_count[total]; //°Ë»ö ½ÃÀÛ row, ³¡ row ±¸Çϱâ if ($total <= $list_num || $page == 1) $begin_row = 0; else $begin_row = (($page-1)*$list_num); $param = "mode=read&gno=$gno"; $PageList= $myFunction->PageIndex1($total, $list_num, $param, $page) ; //¼ø¼­ - »ç¿ë¾ÊÀ½ $output = 'gallery_view2.tpl'; $smarty->assign("PageList",$PageList); $smarty->assign("array",$array); $smarty->assign("g_data",$g_data); $smarty->assign("rowData",$data); }elseif($mode == "insert"){ if(!$gid) $gid='osstem'; $smarty->assign("mode","$mode"); $smarty->assign("gid","$gid"); $output = 'gallery_input.tpl'; }elseif($mode == "modify"){ $output = ''; } $smarty->assign('aboutCLASS3','m2'); $smarty->assign('overCLASS3',' class=link2 '); $smarty->assign("company_over_img",2); $smarty->assign("gid",$gid); $smarty->assign("gno",$gno); $smarty->display($output); ?>