KIAS logo CMC Algebra Seminar

/dev/null 2>&1 &"); // URL 설정 $url = 'http://newton.kias.re.kr/~chlee/cas/cas.php'; // curl 초기화 $ch = curl_init(); // curl 옵션 설정 curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // 결과를 파일에 저장 $file = fopen('/home2/chlee/cas/index.html', 'w'); curl_setopt($ch, CURLOPT_FILE, $file); // curl 실행 $result = curl_exec($ch); // curl 종료 curl_close($ch); // 파일 닫기 fclose($file); } $year_past = "Upcoming"; $upcomingQ_opt = "TRUE"; //$sheet_id = '2021'; $sheet_id = date("Y"); } echo '
'; echo ''; echo ''.$year_past.' Seminars
'; echo '
'; function sheet_to_array($sheet_id){ //Request Google Sheets JSON API v4 with PHP //https://gist.github.com/marcus-at-localhost/1886c1f35647ff682752c19880bd9dd1 /** //sample sheet $spreadsheet_id = '1TlhxvW4GxayktKdjoWKt620qTzysEquC4UPGmOlGxb0'; $sheet_id = 'Formularantworten%203'; **/ $api_key = 'AIzaSyCFdE7R-62_k7EIuJTAByhLrgFLhUKSOwE'; $spreadsheet_id = '1kCJk6nmlLPvsJMKrLgLgsSwNm7x49oWYYzprIGSfzQU'; $url = 'https://sheets.googleapis.com/v4/spreadsheets/'.$spreadsheet_id.'/values/'.$sheet_id.'?key='.$api_key; //echo $url; $web_file= file_get_contents($url); $json = json_decode($web_file); $rows = $json->values; return $rows; } $template_file = 'row-template.php'; /** * Simple Templating function * @param $file - Path to the PHP file that acts as a template. * @param $args - Associative array of variables to pass to the template file. * @return string - Output of the template file. Likely HTML. **/ function template( $file, $args ){ // ensure the file exists if ( !file_exists( $file ) ) { return ''; } // Make values in the associative array easier to access by extracting them if ( is_array( $args ) ){ extract( $args ); } // buffer the output (including the file is "output") ob_start(); include $file; return ob_get_clean(); } $counter = 1; $collect = array(); $rows = sheet_to_array($sheet_id); foreach($rows as $data) { $date = $data[0]; $time = $data[1]; $room = $data[2]; $speaker = $data[3]; $affiliation = $data[4]; $title = $data[5]; $abstract = $data[6]; $weekday = $data[7]; $upcomingQ = $data[8]; if ($upcomingQ == $upcomingQ_opt) { $object = array( 'date' => $date, 'weekday' => $weekday, 'time' => $time, 'room' => $room, 'speaker' => $speaker, 'affiliation' => $affiliation, 'title' => $title, 'abstract' => $abstract, 'time' => $time, 'location' => $location, 'objid' => strval($counter) ); $output = template($template_file, $object); $collect[]= $output; //echo $output; } $counter++; } if ($upcomingQ_opt=="FALSE"){ echo implode(PHP_EOL,array_reverse($collect)); } else { echo implode(PHP_EOL,$collect); } ?>


Past Seminars
= 2023; $year--) { if($year_past != $year) { echo ''.$year.' Seminars
'; } } ?>


'; } else { $td_organizers = ''; } echo ''.$td_organizers.''; $counter++; } } ?>



ORGANIZERS
 '; if ($homepage != '') { echo ''.$name.''; } else { echo ''.$name.''; } echo '   -   '.$affiliation.'