Example #1
0
 function get_intranet_data()
 {
     include 'themes/msosocial/odbc_connect.php';
     $this->load->helper('html');
     $rs_intranet = $db->Execute("select * from INTRANET_ACTCALENDAR WHERE ROWNUM <=12 ORDER BY ID DESC");
     //insert data to db mso
     foreach ($rs_intranet as $row) {
         dbConvert($row);
         $intranet_id = $row['id'];
         $type_cal = $row['actcalendar_type_id'];
         $type_name = 'อบรม';
         if ($type_cal == '7') {
             $type_name = 'อบรม';
         } elseif ($type_cal == '8') {
             $type_name = 'ประชุม';
         } elseif ($type_cal == '9') {
             $type_name = 'กิจกรรม';
         }
         $rs_check = new content_calendar();
         $rs_check->where('intranet_id = "' . $intranet_id . '"')->order_by('id', 'desc')->get();
         if (!$rs_check->id) {
             $rs = new content_calendar();
             $rs->title = $row['title'];
             $rs->detail = $row['detail'];
             $rs->image = 'no image';
             $rs->created = date('Y-m-d H:i:s');
             $rs->updated = date('Y-m-d H:i:s');
             $rs->module = 'mso';
             $rs->category = $row['actcalendar_type_id'];
             $rs->slug = $type_name;
             $rs->status = 'approve';
             $rs->user_id = 49;
             $rs->orderlist = 0;
             $rs->counter = 0;
             $rs->start_date = date('Y-m-d H:i:s');
             $rs->end_date = date('Y-m-d H:i:s');
             $rs->intranet_id = $row['id'];
             $rs->source_data = 'mso';
             $rs->place = 'mso';
             $rs->save();
         }
     }
     //set_notify('success', lang('save_data_complete'));
     //**********
     $data['rs'] = new content_calendar();
     $data['rs']->where("module = 'mso'")->order_by('id desc')->get();
     $this->template->append_metadata(js_checkbox('approve'));
     $this->template->build('admin/index', $data);
 }
Example #2
0
 function get_intranet_data()
 {
     include 'themes/fundv2/odbc_connect.php';
     $this->load->helper('html');
     $rs_intranet = $db->Execute("select * from WEB_NEWS WHERE ROWNUM <=12 ORDER BY ID DESC");
     //insert data to db mso
     $count_news_mso = 0;
     foreach ($rs_intranet as $row) {
         dbConvert($row);
         //http://intranet.m-society.go.th/upload/newsletters/
         $intranet_id = $row['id'];
         $rs_check = new Info();
         $rs_check->where('intranet_id = "' . $intranet_id . '"')->order_by('id', 'desc')->get();
         if (!$rs_check->id) {
             $rs = new Info();
             $rs->title = $row['title'];
             $rs->detail = $row['detail'];
             $rs->image = $row['img_title'];
             $rs->created = date('Y-m-d H:i:s');
             $rs->updated = date('Y-m-d H:i:s');
             $rs->start_date = date('Y-m-d H:i:s');
             $rs->end_date = date('Y-m-d H:i:s');
             $rs->module = 'ข่าวประชาสัมพันธ์';
             $rs->slug = 'mso';
             $rs->status = 'approve';
             $rs->user_id = 49;
             $rs->counter = 0;
             $rs->intranet_id = $row['id'];
             $rs->save();
             $count_news_mso++;
         }
     }
     //set_notify('success', lang('save_data_complete'));
     //**********
     $data['count_news_mso'] = $count_news_mso;
     $data['get_intranet'] = 'mso';
     $data['rs'] = new Info();
     $data['rs']->where('module = "ข่าวประชาสัมพันธ์"')->order_by('id', 'desc')->get();
     $this->template->append_metadata(js_checkbox('approve'));
     $this->template->build('admin/index', $data);
 }
Example #3
0
			                  </table>
			                  
			                   </form>           
			                    
			                </div><!--#nav-search-->
                            
                            <div style="clear:both; margin-top:15px; margin-bottom:5px;">&nbsp;</div>

							<div id='loading' style='display:none;' align="center"><img src="media/images/ajax-loader.gif" /></div>
							<div id='calendar1'></div>
                            
						  <div style="clear:both; margin-top:15px; margin-bottom:5px;">&nbsp;</div>
                            <?php 
$bg_bulet = "#77c705";
foreach ($rs_type as $row_type) {
    dbConvert($row_type);
    $bg_bulet = $row_type['color'];
    ?>
							
							<div style="float:left; background-color:<?php 
    echo $bg_bulet;
    ?>
; width:74px; height:24px;border-radius:4px;
-webkit-border-radius:4px;-moz-border-radius:4px;
padding:15px 15px 30px 15px; margin-left:15px;  text-align:center; font-weight:normal; color:#FFF;">
								
								<?php 
    echo $row_type['name'];
    ?>
								
							</div>
Example #4
0
 public function testdb()
 {
     $this->load->library('adodb');
     $row = $this->ado->pageexecute('SELECT * FROM ACT_PROVINCE', 10, 1);
     //dbConvert($row);
     foreach ($row as $item) {
         dbConvert($item);
         echo $item['province_name'] . '<br />';
     }
 }
Example #5
0
<div id="title-blank">ข่าวประชาสัมพันธ์</div>
<div id="breadcrumb"><a href="/home/index">หน้าแรก</a> > <span class="b1">ข่าวประชาสัมพันธ์</span></div>
<div id="page">
	<?php 
$this->load->helper('html');
foreach ($rs as $row) {
    dbConvert($row);
    ?>
		<div class="media col-lg-6">
		  <div class="media-left media-middle">
		    
		    <a href="infos/view_mso/<?php 
    echo $row['id'];
    ?>
" target="_blank" >
		    
		    <?php 
    $file = "http://intranet.m-society.go.th/upload/newsletters/" . $row['img_title'];
    //$file = 'http://www.domain.com/somefile.jpg';
    $file_headers = @get_headers($file);
    if ($file_headers[0] == 'HTTP/1.1 404 Not Found') {
        ?>
		
				    <img src="themes/fundv2/images/NoImg.jpg" width="158" height="110" class="img-pr-news">	
				
				
			<?php 
    } else {
        ?>
					
				    <img src="http://intranet.m-society.go.th/upload/newsletters/<?php