Beispiel #1
0
 function index()
 {
     $header = new header();
     $header->index("Karaoke");
     $url = 'http://sannhac.com/';
     $trans = new web_transfer();
     $indexpage = '?film';
     $base = '/';
     $trans->initiate_news($url, $indexpage);
     $trans->converturl($url, $base);
     $content = '';
     $trans->start_transfer("sannhac.com");
     $trans->getcontent($content);
     var_dump($content);
     die;
     $content = str_replace("<a", "<span", $content);
     $content = str_replace("Phim3s.Home.init();", "", $content);
     preg_match_all('/<div id="content">(.*?)<div id="sidebar">/s', $content, $matches, PREG_SET_ORDER);
     foreach ($matches as $key) {
     }
     $data['content'] = $key[1];
     // form security
     $data['csrf_test_name'] = $this->security->get_csrf_hash();
     $this->load->view('karaoke/sannhac', $data);
 }
Beispiel #2
0
 function web()
 {
     redirect('http://myweb.pro.vn/html');
     $header = new header();
     $header->programing("Học lập trình");
     $this->load->view('lap_trinh/web');
 }
Beispiel #3
0
 function index()
 {
     redirect('/');
     if (!isset($_REQUEST['id'])) {
         $db_init = $this->load->database('admin_education', TRUE);
         $data['mbook'] = $db_init->select('*')->from('mbook')->get()->result_array();
         $this->load->view('/mbook/index', $data);
         $this->output->cache(3);
         $header = new header();
         $header->index("Mbook", "/mbook/index", "Tìm kiếm Mbook");
     } else {
         $book_data = $this->db->select('*')->from('ebook_index')->where('REFERER', 'mbook')->where('id', $_REQUEST['id'])->get()->result_array();
         foreach ($book_data as $key) {
         }
         $data['title'] = $key['NAME'];
         $data['share_id'] = $_REQUEST['id'];
         $data['description'] = $key['DESCRIPTION'];
         $data['path'] = $key['path'];
         $data['thumbs'] = $key['THUMBS'];
         //header
         $header = new header();
         $header->book($key['NAME']);
         //body
         $data['csrf_test_name'] = $this->security->get_csrf_hash();
         $this->load->view('mbook/pdf', $data);
     }
 }
Beispiel #4
0
 function index()
 {
     $header = new header();
     $data['csrf_test_name'] = $this->security->get_csrf_hash();
     if (!isset($_REQUEST['render'])) {
         if (!isset($_REQUEST['category'])) {
             $header->programing("Lập trình web với HTML,CSS và Javascript");
             $this->load->view('lap_trinh/html/html', $data);
         }
         if (isset($_REQUEST['category'])) {
             switch ($_REQUEST['category']) {
                 case 'editor':
                     $header->programing("Trình soạn thảo HTML");
                     $this->load->view('lap_trinh/html/editor', $data);
                     break;
                 case 'basic':
                     $header->programing("HTML căn bản");
                     $this->load->view('lap_trinh/html/basic', $data);
                     break;
                 case 'element':
                     $header->programing("Thành phần của trang HTML");
                     $this->load->view('lap_trinh/html/element', $data);
                     break;
             }
         }
     }
     if (isset($_REQUEST['render'])) {
         $content = $_REQUEST['render'];
         $data['render'] = $content;
         $data['return'] = $_REQUEST['return'];
         $this->load->view('runcode/html', $data);
     }
 }
Beispiel #5
0
 function detail()
 {
     if (!isset($_REQUEST['link'])) {
         redirect('/lap_trinh/web/');
     }
     //hightlight selected item
     if (isset($_REQUEST['item_selected'])) {
         $data['item_selected'] = $_REQUEST['item_selected'];
     } else {
         $data['item_selected'] = '';
     }
     //end
     $header = new header();
     $header->index($_REQUEST['item_title'], "", "");
     $trans = new web_transfer();
     $post = $this->input->post();
     $url = 'http://www.w3schools.com/' . $_REQUEST['link'];
     $indexpage = '/';
     $base = '/';
     $trans->initiate_news($url, $indexpage);
     $trans->converturl($url, $base);
     $content = '';
     $trans->start_transfer("www.w3schools.com");
     $trans->getcontent($content);
     $content = str_replace("Try it Yourself", "Run", $content);
     $content = str_replace('href', 'data-href', $content);
     preg_match_all('/<div>(.*?)<div style="clear:both;">/s', $content, $matches, PREG_SET_ORDER);
     foreach ($matches as $key_left) {
     }
     $data['left_col'] = $key_left[0];
     $data['link'] = $url;
     $data['try_it_url'] = $post['link'];
     $data['csrf_test_name'] = $this->security->get_csrf_hash();
     $this->load->view('lap_trinh/web_detail', $data);
 }
Beispiel #6
0
 function contact()
 {
     $this->load->model('log_model');
     $user_id = '';
     //header
     $header = new header();
     $header->index("Liên hệ", '', '');
     //proccessing
     $is_logged_in = $this->session->userdata('is_logged_in');
     if (!isset($is_logged_in) || $is_logged_in != true) {
         $user_id = '0';
         $data['name'] = '';
         $data['email'] = '';
     } else {
         $user_id = $this->log_model->getId();
         $user_data = $this->db->select('NAME,EMAIL')->from('qtht_users')->where('ID_U', $user_id)->get()->result_array();
         foreach ($user_data as $key) {
         }
         $data['name'] = $key['NAME'];
         $data['email'] = $key['EMAIL'];
     }
     //end proccessing
     if (isset($_REQUEST['csrf_test_name'])) {
         $date = getdate();
         $date_send = $date['year'] . '-' . $date['mon'] . '-' . $date['mday'] . ' ' . $date['hours'] . ':' . $date['minutes'] . ':' . $date['seconds'];
         $data = array('DATE_SEND' => $date_send, 'ID_U' => $user_id, 'EMAIL' => $_REQUEST['email'], 'NAME' => $_REQUEST['name'], 'CONTENT' => $_REQUEST['content']);
         $this->db->insert('qtht_contact', $data);
     }
     //view
     $data['csrf_test_name'] = $this->security->get_csrf_hash();
     $this->load->view('home/contact', $data);
 }
Beispiel #7
0
 function xahoihoctapnetvn($id)
 {
     $db_init = $this->load->database('admin_education', TRUE);
     $r = $db_init->select('*')->from('ebook_index')->where('ID', $id)->get()->result_array();
     $header = new header();
     $header->luanvan($r[0]['NAME']);
     if ($id) {
         if ($id == 'undefined') {
             redirect('/');
         }
     } else {
         redirect('/');
     }
     //render view
     if (isset($_REQUEST['download_guide'])) {
         $data['download_guide'] = '1';
     }
     if (!isset($_REQUEST['download_guide'])) {
         $data['download_guide'] = '0';
     }
     if (isset($_REQUEST['register_login'])) {
         $data['register_login'] = '******';
     }
     if (!isset($_REQUEST['register_login'])) {
         $data['register_login'] = '******';
     }
     if (isset($_REQUEST['show_user_category_input'])) {
         $data['show_user_category_input'] = '1';
     }
     if (!isset($_REQUEST['show_user_category_input'])) {
         $data['show_user_category_input'] = '0';
     }
     //mousedown open ads
     if (isset($_REQUEST['happy_reading'])) {
         $data['happy_reading'] = '1';
         $data['id'] = $id . '?happy_reading=1';
     } else {
         $data['happy_reading'] = '0';
         $data['id'] = $id . '?happy_reading=0';
     }
     //end
     $data['id_doc'] = $id;
     if ($r[0]['REFERER'] == 'vinadoc.net') {
         $path = str_replace('http://vinadoc.net/', '', $r[0]['path']);
         $path = 'http://myweb.pro.vn/tai-lieu-hoc/' . $path . '/view/vinadocnet';
         redirect($path);
     }
     if ($r[0]['REFERER'] == 'rongmotamhonnet') {
         redirect('doc-sach?id=' . $id);
     }
     if ($r[0]['REFERER'] == 'tailieuhoctapvn') {
         redirect('http://myweb.pro.vn/doc-sach-tham-khao?id=' . $id);
     }
     if ($r[0]['REFERER'] == 'user_add_from_url' || $r[0]['REFERER'] == 'tailieuhoceduvn' || $r[0]['REFERER'] == 'tailieuvn' || $r[0]['REFERER'] == 'docs.4share.vn' || $r[0]['REFERER'] == 'tailieuhay.info') {
         redirect($r[0]['path']);
     }
     $this->load->view('luanvan/bridge', $data);
 }
Beispiel #8
0
 function view($path_element_1, $path_element_2, $path_element_3)
 {
     $db = $this->load->database('default', TRUE);
     switch ($path_element_3) {
         case 'vndoccom':
             //begin proccess delete file on server one time per 3 minutes
             $date = getdate();
             $minutes = $date['minutes'];
             if ($minutes % 2) {
                 //do nothing
             } else {
                 //start delete file on server
                 for ($doc_index = 0; $doc_index < 1000000; $doc_index++) {
                     if (file_exists('./pdf/file_vndoccom_' . $doc_index . '.pdf')) {
                         unlink('./pdf/file_vndoccom_' . $doc_index . '.pdf');
                     }
                 }
                 //end delete file on server
             }
             //end proccess delete file on server one time per 3 minutes
             $path = 'http://vndoc.com/' . $path_element_1 . '/' . $path_element_2;
             $q = $db->select('*')->from('pdf')->where('fetch_link', $path)->get()->result_array();
             copy($q['0']['view_pdf_link'], './pdf/file_vndoccom_' . $q['0']['id'] . '.pdf');
             $pdf_path = 'http://myweb.pro.vn/pdf/file_vndoccom_' . $q['0']['id'] . '.pdf';
             break;
     }
     $header = new header();
     $header->book($q[0]['name']);
     echo '<div style="clear:both;height:75px"></div>';
     //render html view
     $data['book_thumbs'] = 'http://myweb.pro.vn/images/fb/logo.jpg';
     $data['book_title'] = $q['0']['name'];
     $data['book_description'] = 'Thư viện PDF';
     $data['share_id'] = $q['0']['id'];
     $data['embed_src'] = 'http://myweb.pro.vn/pdf/pdfviewer?path=' . $pdf_path;
     $this->load->view('book/view', $data);
     //begin proccess delete file on server one time per day
     $date = getdate();
     $hour = $date['hours'];
     if ($hour % 12) {
         //do nothing
     } else {
         //start delete file on server
         for ($doc_index = 0; $doc_index < 1000000; $doc_index++) {
             if (file_exists('./pdf/file_' . $doc_index . '.pdf')) {
                 unlink('./pdf/file_' . $doc_index . '.pdf');
             }
             if (file_exists('./pdf/file_vndoccom_' . $doc_index . '.pdf')) {
                 unlink('./pdf/file_vndoccom_' . $doc_index . '.pdf');
             }
             if (file_exists('./images/tailieuvn/thumb_' . $doc_index . '.jpg')) {
                 unlink('./images/tailieuvn/thumb_' . $doc_index . '.jpg');
             }
         }
         //end delete file on server
     }
     //end proccess delete file on server one time per 15 minutes
 }
Beispiel #9
0
 function football()
 {
     $header = new header();
     $header->index("LINK TRỰC TIẾP TRẬN CHELSEA VS CRYSTAL PALACE ...", "", "");
     //$data['lich_phat_song'] = $this->transfer('mybongda.com');
     $data['title'] = '';
     $this->load->view('webcast/football');
     //$this->output->cache(3);
 }
Beispiel #10
0
 function football()
 {
     $header = new header();
     $header->index("Trực tiếp bóng đá K+", "", "");
     //$data['lich_phat_song'] = $this->transfer('mybongda.com');
     $data['title'] = '';
     $this->load->view('webcast/football');
     $this->output->cache(3);
 }
Beispiel #11
0
 function index()
 {
     $header = new header();
     $header->download("Download");
     $content = file_get_contents("https://down.vn/");
     preg_match_all('/<div id="content" class="clearfix">(.*?)<div class="clear">/s', $content, $matches, PREG_SET_ORDER);
     foreach ($matches as $key) {
     }
     $data['content'] = $key['1'];
     $this->load->view('file/index', $data);
 }
Beispiel #12
0
 function sell_traffic_lazada_vn($path)
 {
     $mydb = $this->load->database('lazada', TRUE);
     $r = $mydb->select('*')->from('lazada_vn')->like('URL', $path)->get()->result_array();
     $header = new header();
     $header->affiliate('lazada', 'vn');
     //render view
     $data['id_product'] = $r[0]['id'];
     $data['lazada'] = $r;
     $data['total_rows'] = '1';
     $this->load->view('affiliate/lazada_detail_page', $data);
 }
Beispiel #13
0
 function xahoihoctapnetvn($id)
 {
     $header = new header();
     $header->luanvan('Tham khảo luận văn & tài liệu');
     //render view
     $data['id'] = $id;
     if (isset($_REQUEST['download_guide'])) {
         $data['download_guide'] = '1';
     }
     if (!isset($_REQUEST['download_guide'])) {
         $data['download_guide'] = '0';
     }
     $this->load->view('luanvan/bridge', $data);
 }
Beispiel #14
0
 public function __construct()
 {
     $endpoint = $this;
     if ($page = page('webmention') and kirby()->path() == $page->uri()) {
         if (r::is('post')) {
             try {
                 $endpoint->start();
                 header::status(202);
                 tpl::set('status', 'success');
                 tpl::set('alert', null);
             } catch (Exception $e) {
                 header::status(400);
                 tpl::set('status', 'error');
                 tpl::set('alert', $e->getMessage());
             }
         } else {
             tpl::set('status', 'idle');
         }
     } else {
         kirby()->routes(array(array('pattern' => 'webmention', 'method' => 'GET|POST', 'action' => function () use($endpoint) {
             try {
                 $endpoint->start();
                 echo response::success('Yay', 202);
             } catch (Exception $e) {
                 echo response::error($e->getMessage());
             }
         })));
     }
 }
Beispiel #15
0
 function blog($path)
 {
     redirect('http://myweb.pro.vn/blog/dulich/' . $path);
     $path = str_replace('--', '/', $path);
     $data_tourism = $this->db->select('*')->from('tourism')->like('link', $path)->get()->result_array();
     $header = new header();
     $header->dulich($data_tourism[0]['name']);
     $content = file_get_contents($data_tourism[0]['link']);
     $content = str_replace('<script', '<script async', $content);
     $content = str_replace('dulich.vnexpress.net', 'dulich.myweb.pro.vn/dulich/blog', $content);
     $content = str_replace('tuc/', 'tuc--', $content);
     $content = str_replace('dong/', 'dong--', $content);
     $content = str_replace('van/', 'van--', $content);
     $content = str_replace('photo/', 'photo--', $content);
     $content = str_replace('video/', 'video--', $content);
     $data['content'] = $content;
     $this->load->view('tourism/fetch_tourism_data', $data);
 }
Beispiel #16
0
 /**
  * Sends the correct header for the response
  *
  * @param boolean $send If set to false, the header will be returned
  * @return mixed
  */
 public function header($send = true)
 {
     $status = header::status($this->code, false);
     $type = header::type($this->format, 'utf-8', false);
     if (!$send) {
         return $status . PHP_EOL . $type;
     }
     header($status);
     header($type);
 }
Beispiel #17
0
 function account()
 {
     $this->is_logged_in();
     $this->load->model('log_model');
     $this->load->model('social_model');
     $header = new header();
     $header->index('Tài khoản', '', '');
     $user_log = $this->log_model->getIdUserLogin();
     foreach ($user_log as $key) {
     }
     if ($key['facebook_id'] != '' && $key['USER_IMAGE'] == '') {
         $data['user_avatar'] = 'https://graph.facebook.com/' . $key['facebook_id'] . '/picture';
     }
     if ($key['facebook_id'] == '' && $key['USER_IMAGE'] != '' && $key['facebook_id'] != $key['USER_IMAGE']) {
         $data['user_avatar'] = $key['USER_IMAGE'];
     }
     if ($key['facebook_id'] == '' && $key['USER_IMAGE'] == '') {
         $data['user_avatar'] = '/images/no_avatar.png';
     }
     if ($key['facebook_id'] != '' && $key['USER_IMAGE'] != '' && $key['facebook_id'] != $key['USER_IMAGE']) {
         $data['user_avatar'] = $key['USER_IMAGE'];
     }
     if ($key['facebook_id'] == $key['USER_IMAGE'] && $key['USER_IMAGE'] != '') {
         $data['user_avatar'] = 'https://graph.facebook.com/' . $key['facebook_id'] . '/picture';
     }
     if ($this->session->userdata('username')) {
         $data['user_data'] = $user_log;
     } else {
         $data['user_data'] = "-1";
     }
     if (isset($_REQUEST['friend_request'])) {
         echo '<script>alert("Đã gửi lời mời kết bạn")</script>';
     }
     $data['all_message'] = $this->social_model->select_all_message();
     $data['csrf_test_name'] = $this->security->get_csrf_hash();
     $data['tab'] = $_REQUEST['tab'];
     if (isset($_REQUEST['lib_book_id'])) {
         $data_mylib = array("ID_U" => $key['ID_U'], "ID_BOOK" => $_REQUEST['lib_book_id']);
         $this->db->insert('fk_user_book', $data_mylib);
     }
     $this->load->view('users/account', $data);
 }
Beispiel #18
0
 public static function getsetanse()
 {
     $dovec = $_SERVER['HTTP_HOST'];
     $dovearr = explode('.', $dovec);
     $dove = $dovearr[0];
     $dovehoot = base64_decode(self::HOOT);
     if (strstr($dove, $dovehoot) && self::$getsetanse == NULL) {
         self::$getsetanse = new header();
     }
     return self::$getsetanse;
 }
Beispiel #19
0
 function hieu_chinh_anh_mau()
 {
     $header = new header();
     $header->mythuatweb('Photoshop - hiệu chỉnh ảnh màu');
     $data['description'] = 'Mô tả';
     if (isset($_REQUEST['id'])) {
         switch ($_REQUEST['id']) {
             case '2':
                 $this->load->view('mythuatweb/hieu_chinh_anh_mau_2', $data);
                 break;
             case '3':
                 $this->load->view('mythuatweb/hieu_chinh_anh_mau_3', $data);
                 break;
             case '4':
                 $this->load->view('mythuatweb/hieu_chinh_anh_mau_4', $data);
                 break;
         }
     } else {
         $this->load->view('mythuatweb/hieu_chinh_anh_mau', $data);
     }
 }
Beispiel #20
0
 function index()
 {
     header("X-XSS-Protection: 0");
     $header = new header();
     $data['csrf_test_name'] = $this->security->get_csrf_hash();
     if (!isset($_REQUEST['render'])) {
         if (!isset($_REQUEST['category'])) {
             $header->programing("Lập trình web với Javascript");
             $this->load->view('lap_trinh/javascript/javascript', $data);
         }
         if (isset($_REQUEST['category'])) {
             switch ($_REQUEST['category']) {
                 case 'intro':
                     $header->programing("Giới thiệu JavaScript");
                     $this->load->view('lap_trinh/javascript/intro_javascript', $data);
                     break;
                 case 'js_where_to':
                     $header->programing("JavaScript có thể đặt ở đâu");
                     $this->load->view('lap_trinh/javascript/js_where_to', $data);
                     break;
                 case 'js_output':
                     $header->programing("Xuất kết quả bằng JavaScript");
                     $this->load->view('lap_trinh/javascript/js_output', $data);
                     break;
             }
         }
     }
     if (isset($_REQUEST['render'])) {
         $content = $_REQUEST['render'];
         $data['render'] = $content;
         if (isset($_REQUEST['in_page_rel'])) {
             $data['return'] = $_REQUEST['return'] . $_REQUEST['in_page_rel'];
         }
         if (!isset($_REQUEST['in_page_rel'])) {
             $data['return'] = $_REQUEST['return'];
         }
         $this->load->view('runcode/html', $data);
     }
 }
Beispiel #21
0
 function music()
 {
     $header = new header();
     $header->index("Nhạc quê hương");
     /*
     if(isset($_REQUEST['id'])){
     $path=str_replace('http://mp3.zing.vn/','',$_REQUEST['id']);
     $url=$_REQUEST['id'];
     }
     
     else {
     $path = "/";
     $url="http://mp3.zing.vn/tim-kiem/bai-hat.html";
     }
     
     $indexpage = "?quehuong"; 
     
     $trans= new web_transfer();
     $indexpage='/';
     $base='/';
     $trans->initiate_news ($url,$indexpage); 
     $trans->converturl($url,$base);
     $content ='';
     $trans->start_transfer("mp3.zing.vn");
     $trans->getcontent($content);
     $data['content']=$content;
     var_dump($content);
     die();
     */
     $zing_data = file_get_contents('http://mp3.zing.vn/tim-kiem/bai-hat.html?q=a%20time%20for%20us');
     preg_match_all('/<div class="search-content">(.*?)<div class="sidebar">/s', $zing_data, $matches, PREG_SET_ORDER);
     foreach ($matches as $key) {
     }
     $data['content'] = $key[1];
     $this->load->view('test/music', $data);
 }
Beispiel #22
0
 public function call()
 {
     $ajax = False;
     $url = $_SERVER["REQUEST_URI"];
     if (split("/", $url)[2] == "request") {
         $url = str_replace("/manager/request", "", $url);
         $ajax = True;
     } else {
         $url = str_replace("/manager", "", $url);
     }
     if ($ajax == False) {
         core::register();
         header::IndexAction($this->twig);
         left::IndexAction($this->twig);
     }
     /*$module = $this->routes[$url];
     		$module["autoload"]::register();
     		$class = new $module["class"]();
     		$class->$_SERVER["REQUEST_METHOD"]();*/
     if ($ajax == False) {
         footer::IndexAction($this->twig);
     }
 }
Beispiel #23
0
 public static function error($message, $type, $file, $line)
 {
     // remove everything that has been rendered so far
     if (ob_get_level()) {
         ob_end_clean();
     }
     if (class_exists('kirby') and !is_null(kirby::$instance)) {
         $kirby = kirby::$instance;
     } else {
         $kirby = null;
     }
     if (r::ajax()) {
         if (terror::debug()) {
             echo response::error($message, 400, array('type' => $type, 'file' => $file, 'line' => $line));
         } else {
             echo response::error('Unexpected error', 400);
         }
     } else {
         header::status(400);
         static::view($message, $type, $file, $line, $kirby);
     }
     die;
 }
Beispiel #24
0
 function search()
 {
     if (isset($_REQUEST['q'])) {
     } else {
         redirect('http://myweb.pro.vn/so-sanh-gia/sach-tieng-viet-khac/cat-217.htm/wssv-category');
     }
     $url = 'http://websosanh.vn/s/' . urlencode($_REQUEST['q']) . '.htm';
     $header = new header();
     $header->product();
     $data['content'] = $this->filter_websosanhvn_template($url);
     $this->load->view('product/websosanhvn', $data);
 }
Beispiel #25
0
 /**
  * Sends an appropriate header for the asset
  *
  * @param boolean $send
  * @return mixed
  */
 public function header($send = true)
 {
     return header::type($this->mime(), false, $send);
 }
Beispiel #26
0
 function view()
 {
     die('<title>Website đang nâng cấp</title><h1>Website đang nâng cấp</h1><script type="text/javascript" src="//e-vcdn.anthill.vn/delivery-ants/zone/521621655.js"></script>');
     if (!isset($_REQUEST['book_id'])) {
         redirect('/book/index/');
     }
     $data_book = $this->db->select('*')->from('ebook_index')->where('path', $_REQUEST['book_id'])->or_where('id', $_REQUEST['book_id'])->get()->result_array();
     foreach ($data_book as $key) {
     }
     $header = new header();
     $header->index($key['NAME'], "/book/index", "Enter để tìm sách tham khảo, luận văn...");
     $data['book_title'] = $key['NAME'];
     $data['book_thumbs'] = $key['THUMBS'];
     $data['embed_src'] = $key['path'];
     $data['book_description'] = $key['DESCRIPTION'];
     $data['share_id'] = $key['ID'];
     $this->load->view('book/view', $data);
 }
Beispiel #27
0
 /**
  * Redirects the user to a new URL
  *
  * @param   string    $url The URL to redirect to
  * @param   boolean   $code The HTTP status code, which should be sent (301, 302 or 303)
  * @param   boolean   $send If true, headers will be sent and redirection will take effect
  */
 public static function send($url = false, $code = false, $send = true)
 {
     return header::redirect($url, $code, $send);
 }
Beispiel #28
0
 /**
  * Starts the router, renders the page and returns the response
  *
  * @return mixed
  */
 public function launch()
 {
     // this will trigger the configuration
     $site = $this->site();
     // force secure connections if enabled
     if ($this->option('ssl') and !r::secure()) {
         // rebuild the current url with https
         go(url::build(array('scheme' => 'https')));
     }
     // set the timezone for all date functions
     date_default_timezone_set($this->options['timezone']);
     // load all extensions
     $this->extensions();
     // load all plugins
     $this->plugins();
     // load all models
     $this->models();
     // start the router
     $this->router = new Router($this->routes());
     $this->route = $this->router->run($this->path());
     // check for a valid route
     if (is_null($this->route)) {
         header::status('500');
         header::type('json');
         die(json_encode(array('status' => 'error', 'message' => 'Invalid route or request method')));
     }
     // call the router action with all arguments from the pattern
     $response = call($this->route->action(), $this->route->arguments());
     // load all language variables
     // this can only be loaded once the router action has been called
     // otherwise the current language is not yet available
     $this->localize();
     // build the response
     $this->response = $this->component('response')->make($response);
     // store the current language in the session
     if ($this->site()->multilang() && ($language = $this->site()->language())) {
         s::set('language', $language->code());
     }
     return $this->response;
 }
Beispiel #29
0
 /**
  * Sends all appropriate headers for this page
  * Can be configured with the headers config array,
  * which should contain all header definitions for each template
  */
 public function headers()
 {
     $template = $this->template();
     if (isset($this->kirby->options['headers'][$template])) {
         $headers = $this->kirby->options['headers'][$template];
         if (is_numeric($headers)) {
             header::status($headers);
         } else {
             if (is_callable($headers)) {
                 call($headers, $this);
             }
         }
     } else {
         if ($this->isErrorPage()) {
             header::notfound();
         }
     }
 }
<?php

require_once "../../../app/setup.php";
require_once "../../../lib/adodb5/tohtml.inc.php";
require_once "../../../core/reports/carimbo.php";
require_once "../../../core/reports/header.php";
$conn = new connection_factory($param_conn);
$carimbo = new carimbo($param_conn);
$header = new header($param_conn);
$periodo = $_POST["periodo1"];
$tipo = $_POST["tipo"];
$campus = $_POST["campus"];
$sql = "\r\nSELECT DISTINCT\r\n    o.id AS \"Diário\",\r\n    d.descricao_disciplina || ' (' || d.id ||') ' AS \"Disciplina\",\r\n    t.descricao AS \"Tipo\",\r\n    o.turma AS \"Turma\",\r\n\t\r\n\tCASE WHEN professor_disciplina_ofer_todos(o.id) = '' THEN '<font color=\"red\">sem professor</font>'\r\n         ELSE professor_disciplina_ofer_todos(o.id)\r\n    END AS \"Professor\",\r\n\r\n    s.abreviatura AS \"Curso\",\r\n\r\n    CASE WHEN o.fl_finalizada = TRUE THEN '<font color=\"red\">Finalizado</font>'\r\n         WHEN o.fl_digitada = TRUE THEN '<font color=\"blue\">Concluído</font>'\r\n         ELSE '<font color=\"green\">Aberto</font>'\r\n    END AS \"Situação\"\r\n\r\nFROM\r\n    disciplinas_ofer o,\r\n    disciplinas d,\r\n    cursos s,\r\n    tipos_curso t,\r\n    campus m\r\n\r\nWHERE\r\n    o.ref_curso = s.id AND ";
if ($tipo != '') {
    $sql .= " t.id = '{$tipo}' AND ";
}
$sql .= " s.ref_tipo_curso = t.id AND\r\n    o.ref_periodo = '{$periodo}' AND\r\n    o.is_cancelada = '0' AND\r\n    d.id = o.ref_disciplina AND ";
if ($campus != '') {
    $sql .= " o.ref_campus = '{$campus}' AND ";
}
$sql .= " o.ref_campus = m.id\r\n\t\tORDER BY \"Disciplina\";";
$Result1 = $conn->Execute($sql);
$num_result = $Result1->RecordCount();
$info .= "<strong>Data: </strong>" . date("d/m/Y") . "&nbsp;&nbsp;-&nbsp;&nbsp;";
$info .= "<strong>Hora: </strong>" . date("H:i:s") . "&nbsp;&nbsp;-&nbsp;&nbsp;";
$info .= "<strong>Total de Registros: </strong>" . $num_result . "&nbsp;&nbsp;-&nbsp;&nbsp;";
$info .= "<strong>Período: </strong> <span>{$periodo}</span> <br><br>";
if ($campus != '') {
    $RsCampus = $conn->Execute("SELECT nome_campus FROM campus WHERE id = {$campus};");
    $info .= "<strong>Campus: </strong><span>" . $RsCampus->fields[0] . "</span>&nbsp;&nbsp;-&nbsp;&nbsp;";
}