get_path() . '/agent/'.$agt.'/'.$tpl_path)) { $TPL->define('index', 'agent/'.$agt.'/'.$tpl_path); } else { $TPL->define('index', $tpl_path); } //sdump($mem_infos); $CAL = $WEB->load('HanCalendar'); $MEM = $WEB->load('HanMember'); $year = $WEB->get_arg('year',date('Y')); $month = $WEB->get_arg('month',date('m')); $dam = $WEB->get_arg('dam',$SES_MEM_NUM); //$today = date("d"); $today = date("d", $g4['server_time']); $pn_date = $DATE->get_prev_next_month($year,$month,date('d'),1); $table = 'schedule'; $weeks = $CAL->getTable($year,$month); $wh .= " and ding = 2"; $sql = "select * from $table where (ddate like '{$year}-{$month}%' or dcost = 1 or dadd!='') $wh"; $info = $DB->getAll($sql); foreach($info as $key => $val) { $__dates = explode(" ",$val['ddate']); $_dates = explode("-",$__dates[0]); $__dates2 = explode(" ",$val['edate']); $_dates2 = explode("-",$__dates2[0]); for($i=$_dates[2];$i<=$_dates2[2];$i++) { $z = sprintf("%02d",$i); if(!$val['dadd']) { $schedule[$year][$month][$z][$key]['number'] = $val['number']; $schedule[$year][$month][$z][$key]['subject'] = $val['dsubject']; $schedule[$year][$month][$z][$key]['ing'] = $val['ding']; $schedule[$year][$month][$z][$key]['add1'] = $val['ding']; $schedule[$year][$month][$z][$key]['addr2'] = $val['addr2']; } } if($val['dadd']) { $_dadd = explode(",",$val['dadd']); foreach($_dadd as $k => $v) { $_dadd2 = explode("-",$v); /* if($val['number'] == 78) { dump($val['number']); dump($_dadd2); } */ $schedule[$_dadd2[0]][$_dadd2[1]][$_dadd2[2]][$key]['number'] = $val['number']; $schedule[$_dadd2[0]][$_dadd2[1]][$_dadd2[2]][$key]['subject'] = $val['dsubject']; $schedule[$_dadd2[0]][$_dadd2[1]][$_dadd2[2]][$key]['ing'] = $val['ding']; $schedule[$_dadd2[0]][$_dadd2[1]][$_dadd2[2]][$key]['add1'] = $val['ding']; $schedule[$_dadd2[0]][$_dadd2[1]][$_dadd2[2]][$key]['addr2'] = $val['addr2']; } } } //부서 $busu_code = array( 'AD01' => '관리부', 'AD02' => '연구개발부', 'AD03' => '체인사업부', 'AD04' => '영업부', ); /* foreach($gmem as $k => $v) { $gmem_dam[$v['mem_code']][$v['number']] = $v['name']; } */ $TPL->assign(array( 'weeks' => $weeks, 'pn_date' => $pn_date, 'busu_code' => $busu_code, 'gmem' => $gmem, )); //뷰 출력 $TPL->print_frame(); //모든 객체 소멸 $WEB->unload();