"강좌명", "author"=>"강사명", ); $add_sql = " AND a.is_secret NOT LIKE 'Y' "; $add_sql = " "; if($keyword!='') { $add_sql = " AND `{$key}` LIKE '%{$keyword}%' "; $_GET['key'] = $key; $_GET['keyword'] = $keyword; } $key_opt = ''; if(is_array($keys) ) { foreach($keys as $k=>$v) { $sel = ($key==$k) ? " selected ": "" ; $key_opt .= ""; } } // 기업아이디 별 검색 $add_sql .= " and a.company_id = '".$_config[company_id]."' "; $add_sql .= " and b.company_id = '".$_config[company_id]."' "; // 옵션처리 if($pcode!="") $add_sql .= " and bcategory_code like '{$pcode}' "; if($code!="") $add_sql .= " and scategory_code like '$code' "; // 지사모드 $company_id = getNowCompanyId(); $add_sql .= " and b.company_id like '$company_id' and a.company_id like '$company_id' "; if( $company_id !="" ) { $add_join_on = " and a.company_id = b.company_id"; $add_join_on2 = " and b.company_id = c.company_id"; } // ---------------------------------------------- // 페이징 처리 // ---------------------------------------------- if($order_by=="") $order_by = " product_year desc,lecture_code desc "; if($page=="") $page = 1; $sql = " select count(*) as cnt from $Lecture->table_name a left join $Category->table_name b on a.scategory_code = b.code left join $Category->table_name c on b.pcode = c.code and c.company_id = '{$_config[company_id]}' where a.use_yn='Y' and b.use_yn <> 'N' $add_sql "; $total_record = $DB->getOne($sql); $start = intval(($page - 1) * $perPage); $Member =& load("Member"); $sql = " select a.*,b.title as scategory_title, c.title as bcategory_title from $Lecture->table_name a left join $Category->table_name b on a.scategory_code = b.code left join $Category->table_name c on b.pcode = c.code and c.company_id = '{$_config[company_id]}' where a.use_yn='Y' and b.use_yn <> 'N' $add_sql order by $order_by limit {$start},{$perPage} "; /* select a.*,b.title as scategory_title, c.title as bcategory_title from mdr_lecture a left join mdr_mcategory b on a.scategory_code = b.code left join mdr_mcategory c on b.pcode = c.code and c.company_id = 'seocho' where a.use_yn='Y' and b.use_yn <> 'N' AND a.is_secret NOT LIKE 'Y' and a.company_id = 'seocho' and b.company_id = 'seocho' and bcategory_code like '001' and scategory_code like '001003' and b.company_id like 'seocho' and a.company_id like 'seocho' order by product_year desc,binary(lecture_title) asc limit 0,10 */ // echo $sql; $rlt = $DB->query($sql); $rows = $DB->fetchAll($rlt); $no = $total_record - (($page-1) * $perPage); $Paging =& load("BootstrapPaging"); $Paging->BootstrapPaging($total_record,$perPage); $pages = $Paging->getLink(); if(is_array($rows) && sizeof($rows) > 0 ) { foreach($rows as $k=>$v) { $sql = "select count(*) as cnt from $Chapter->table_name where lecture_code='{$v[lecture_code]}' "; $rows[$k][cnt] = $DB->getOne($sql); $sql = "select sum(play_sec) as play_sec from $Chapter->table_name where lecture_code='{$v[lecture_code]}' "; $v[play_sec] = $DB->getOne($sql); $rows[$k][play_time] = secToStrTime($v[play_sec]); } } // ---------------------------------------------- // 분류 카테고리 // ---------------------------------------------- $Category = load("MCategory"); // 기업아이디 별 검색 $add_sql = " and company_id = '".$_config[company_id]."' "; // 대분류 $sql = " select title,code,pcode from $Category->table_name where 1=1 and use_yn <> 'N' and depth='0' $add_sql order by code ASC "; $rlt = $DB->query($sql); $bcr = $DB->fetchAll($rlt); $btab_rows = $bcr; // 소분류 $sql = " select title,code,pcode from $Category->table_name where pcode='$pcode' and use_yn <> 'N' and depth='1' $add_sql order by code ASC "; $rlt = $DB->query($sql); $scr = $DB->fetchAll($rlt); // 강좌수 foreach($scr as $k=>$v) { $sql = " select count(*) as cnt from $Lecture->table_name where scategory_code='$v[code]' and use_yn <> 'N' $add_sql "; $cnt = $DB->getOne($sql); $scr[$k][cnt] = $cnt; } // 페이징 관련 $php_self = $load_page; $total_page = ceil($total_record / $perPage); // 수강신청 URL $buy_url = "course_proc.html"; // 신착강좌 $sql = "select * from $Lecture->table_name where is_new='Y' and use_yn <> 'N' and is_secret not like 'Y' $add_sql order by rand() limit 4 "; $rlt = $DB->query($sql); $toprows[0] = $DB->fetchAll($rlt); // 인기강좌 $sql = "select * from $Lecture->table_name where is_hot='Y' and use_yn <> 'N' and is_secret not like 'Y' $add_sql order by rand() limit 4 "; $rlt = $DB->query($sql); $toprows[1] = $DB->fetchAll($rlt); // 히트강좌 $sql = "select * from $Lecture->table_name where is_hit='Y' and use_yn <> 'N' $add_sql order by rand() limit 4 "; $rlt = $DB->query($sql); $toprows[2] = $DB->fetchAll($rlt); // 추천강좌 $sql = "select * from $Lecture->table_name where is_recommend='Y' and use_yn <> 'N' $add_sql order by rand() limit 4 "; $rlt = $DB->query($sql); $toprows[3] = $DB->fetchAll($rlt); // 할인강좌 $sql = "select * from $Lecture->table_name where is_discount='Y' and use_yn <> 'N' $add_sql order by rand() limit 4 "; $rlt = $DB->query($sql); $toprows[4] = $DB->fetchAll($rlt); ?>

THEME FILE ERROR!