Example #1
0
 /**
  * Lists the posts in a specific category.
  *
  * @param string $slug The slug of the category.
  */
 public function category($slug = '')
 {
     $slug or redirect('news');
     // Get category data
     $category = $this->news_categories_m->get_by('slug', $slug) or show_404();
     // Get the news posts
     $params = array('stream' => 'news', 'namespace' => 'news', 'limit' => Settings::get('records_per_page'), 'where' => "`status` = 'live' AND `category_id` = '{$category->id}'", 'paginate' => 'yes', 'pag_segment' => 4);
     $posts = $this->streams->entries->get_entries($params);
     // Process posts
     foreach ($posts['entries'] as &$post) {
         $post['date'] = indonesian_date(date('Y-m-d H:i:s', $post['created_on']));
         if (file_exists(UPLOAD_PATH . 'news/' . $post['image']) && is_file(UPLOAD_PATH . 'news/' . $post['image'])) {
             $image = UPLOAD_PATH . 'news/' . $post['image'];
         } else {
             $image = UPLOAD_PATH . 'no_image.jpg';
         }
         //$post['thumb_100x100'] = $this->image_m->resize($image, 100, 100, 'crop');
         $post['thumb'] = $this->image_m->resize($image, 200, 145, 'crop');
         $this->_process_post($post);
     }
     // Set meta description based on post titles
     $meta = $this->_posts_metadata($posts['entries']);
     // Build the page
     $this->template->title($this->module_details['name'], $category->title)->set_metadata('description', $category->title . '. ' . $meta['description'])->set_metadata('keywords', $category->title)->set_breadcrumb(lang('news:news_title'), 'news')->set_breadcrumb($category->title)->set('pagination', $posts['pagination'])->set_stream($this->stream->stream_slug, $this->stream->stream_namespace)->set('posts', $posts['entries'])->set('category', (array) $category)->set_layout('detail.html')->build('posts');
 }
Example #2
0
 public function view($id = 0)
 {
     if (!$id) {
         redirect('gallery');
     }
     $id = $this->core->decode($id);
     $post = $this->gallery_m->get_by_id($id);
     $post->date = indonesian_date($post->created_on);
     $post->video = base_url(UPLOAD_PATH . 'gallery/' . $post->file);
     $this->template->title($this->module_details['name'])->set('post', array($post))->build('view', array('page' => array('title' => 'Gallery')));
 }
Example #3
0
 public function view($id = 0)
 {
     if (!$id) {
         redirect('videos');
     }
     $id = $this->core->decode($id);
     $post = $this->videos_m->get_by_id($id);
     $post->date = indonesian_date($post->created_on);
     //$post->video = base_url(UPLOAD_PATH.'videos/'.$post->file);
     $json_output = @file_get_contents("http://gdata.youtube.com/feeds/api/videos/{$post->video_id}?v=2&alt=json");
     $json = json_decode($json_output, TRUE);
     $post->title = $json['entry']['title']['$t'];
     $post->description = $json['entry']['media$group']['media$description']['$t'];
     $this->template->title($this->module_details['name'])->set('post', array($post))->build('view', array('page' => array('title' => 'Video')));
 }
Example #4
0
 public function show($id = 0, $extra = '')
 {
     if (!$id) {
         redirect('kasus');
     }
     $id = $this->core->decode($id);
     $post = new stdClass();
     $post = $this->kasus_m->get_by_id($id);
     if ($post) {
         $post->date = indonesian_date($post->created_on);
         if (file_exists(UPLOAD_PATH . 'kasus/' . $post->image) && is_file(UPLOAD_PATH . 'kasus/' . $post->image)) {
             $image = UPLOAD_PATH . 'kasus/' . $post->image;
         } else {
             $image = UPLOAD_PATH . 'no_image.jpg';
         }
         $this->load->model('files/image_m');
         $post->thumb_detail = $this->image_m->resize($image, 200, 150, 'crop');
     }
     $this->template->title($this->module_details['name'])->set('post', array($post))->build('show', array('page' => array('title' => 'kasus')));
 }
Example #5
0
 /**
  * Index
  *
  * List out the alert posts.
  *
  * URIs such as `alert/page/x` also route here.
  */
 public function index()
 {
     // Get our comment count whil we're at it.
     $this->row_m->sql['select'][] = "(SELECT COUNT(id) FROM " . $this->db->protect_identifiers('comments', true) . " WHERE module='alert'\n\t\t\t\tAND is_active='1' AND entry_key='alert:post' AND entry_plural='alert:posts'\n\t\t\t\tAND entry_id=" . $this->db->protect_identifiers('alert.id', true) . ") as `comment_count`";
     // Get the latest alert posts
     $params = array('stream' => 'alert', 'namespace' => 'alert', 'limit' => Settings::get('records_per_page'), 'where' => "`status` = 'live'", 'paginate' => 'yes', 'pag_base' => site_url('alert/page'), 'pag_segment' => 3);
     $posts = $this->streams->entries->get_entries($params);
     // Process posts
     foreach ($posts['entries'] as &$post) {
         $post['date'] = indonesian_date(date('Y-m-d H:i:s', $post['created_on']));
         if (file_exists(UPLOAD_PATH . 'alert/' . $post['image']) && is_file(UPLOAD_PATH . 'alert/' . $post['image'])) {
             $image = UPLOAD_PATH . 'alert/' . $post['image'];
         } else {
             $image = UPLOAD_PATH . 'no_image.jpg';
         }
         $post['thumb_100x100'] = $this->image_m->resize($image, 100, 100, 'crop');
         $this->_process_post($post);
     }
     // Set meta description based on post titles
     $meta = $this->_posts_metadata($posts['entries']);
     $data = array('pagination' => $posts['pagination'], 'posts' => $posts['entries']);
     $this->template->title($this->module_details['name'])->set_breadcrumb(lang('alert:alert_title'))->set_metadata('og:title', $this->module_details['name'], 'og')->set_metadata('og:type', 'alert', 'og')->set_metadata('og:url', current_url(), 'og')->set_metadata('og:description', $meta['description'], 'og')->set_metadata('description', $meta['description'])->set_metadata('keywords', $meta['keywords'])->set_stream($this->stream->stream_slug, $this->stream->stream_namespace)->set('posts', $posts['entries'])->set('pagination', $posts['pagination'])->build('posts', array('page' => array('title' => lang('alert:alert_title'))));
 }
Example #6
0
<?php

foreach ($post as $p) {
    ?>
	<div style="background:#ddd; margin:0 0 10px 0; padding: 10px; border-radius:10px;">
		<h4><a href="<?php 
    echo site_url('/news/' . date('Y/m/d', strtotime($p['created'])) . '/' . $p['slug']);
    ?>
"><?php 
    echo $p['title'];
    ?>
</a></h4>
		<span class="date"><?php 
    echo indonesian_date($p['created']);
    ?>
</span>
		
		<p style="margin:0 0 20px 0; width:auto;"><?php 
    echo $p['intro'];
    ?>
 <br /><br />
		<a href="<?php 
    echo site_url('/news/' . date('Y/m/d', strtotime($p['created'])) . '/' . $p['slug']);
    ?>
" class="btn btn-small btn-info" style="color:#fff;">Baca selengkapnya</a>
		</p>
		<div style="clear:both;"></div>
	</div>
<?php 
}
        $(".navbar-brand img").css('height', '50px');
    });
</script>
<div style="margin-top: 100px; margin-bottom: 100px;">
    <div class="col-md-8 col-md-offset-2">
        <h1><?php 
echo $entry->cal_name;
?>
</h1>
        <p>
            Mulai : <?php 
echo indonesian_date($entry->cal_begin);
?>
<br>
            Sampai : <?php 
echo indonesian_date($entry->cal_end);
?>
        </p>
        <p><?php 
echo tot($entry->cal_descr);
?>
</p>
        <p><?php 
echo $mytype->cal_type_name;
?>
</p>
        <div style="text-align: center; padding-top: 30px;">
            <button class="btn btn-default" style="width: 70%;">Daftar</button>
        </div>
    </div>
    <div class="clearfix"></div>
    function p()
    {
        $id = isset($_GET['id']) ? addslashes($_GET['id']) : 0;
        if ($id) {
            $page = new Page();
            $page->getByID($id);
            if (!isset($page->post_title) || $page->post_title == '') {
                die('Not Found');
            }
            //add channel feb 2015
            $a = NewsChannel::myChannels();
            if ($page->page_channel_id > 0) {
                if (!in_array($page->page_channel_id, $a)) {
                    echo 'Not Authorize To View';
                    return "";
                }
            }
            $pc = new PageContainer();
            if ($page->post_gallery_id > 0) {
                $pc->getByID($page->post_gallery_id);
            }
            $page->setSEO();
            $gw = new GalleryWeb();
            ?>
			<style>
				.pl_file_item {
					padding          : 10px;
					clear            : both;
					text-decoration  : underline;
					color            : #0072b1;
					cursor           : pointer;
					margin           : 5px;
					background-color : #efefef;
				}

				.if_text {
					height      : 30px;
					line-height : 30px;
					float       : left;
					margin-left : 10px;
				}

				.fotoIF {
					width    : 30px;
					height   : 30px;
					overflow : hidden;
					float    : left;
				}

				.fotoIF img {
					width : 30px;
				}

				.h3pv {
					font-size      : 18px;
					border-bottom  : 1px dashed #333;
					padding-bottom : 10px;
					margin-bottom  : 0px;
				}
			</style>
			<h1 style="padding-bottom: 0; margin-bottom: 0; margin-bottom: 10px;"><?php 
            echo stripslashes($page->post_title);
            ?>
</h1>
			<div class="breadcrumbs">Pages
				<?php 
            if ($page->post_gallery_id > 0) {
                ?>
/
					<a href="<?php 
                echo _SPPATH;
                ?>
pagecontainer?mode=<?php 
                echo $pc->container_id;
                ?>
"><?php 
                echo $pc->container_name;
                ?>
</a><?php 
            }
            ?>
			</div>

			<small style="font-size: 12px;"><?php 
            echo indonesian_date($page->post_modified);
            ?>
</small>

			<?php 
            if ($page->post_image != "") {
                ?>
				<div class="bigimage"
				     style="padding-bottom: 10px;">
					<img style="width: 100%; padding-top: 20px;"
					     src="<?php 
                echo _SPPATH . $gw->uploadURL . $page->post_image;
                ?>
">
				</div>
			<?php 
            }
            ?>

			<div class="postcontent">
				<?php 
            $content = stripslashes($page->post_content);
            $content = str_replace('#tbs_video#', '<video id="player_normal" width="100%" controls src="', $content);
            $content = str_replace('#/tbs_video#', '"></video>', $content);
            echo $content;
            ?>
			</div>
			<?php 
            if ($page->post_files != "") {
                ?>
				<div class="clearfix"
				     style="padding:  10px;">

					<h3 class="h3pv"><?php 
                echo Lang::t('Attachments');
                ?>
</h3>
				</div>
				<div style="">
				<?php 
                $exp = explode(",", trim(rtrim($page->post_files)));
                $arrNames = array();
                foreach ($exp as $fil) {
                    // echo $fil."<br>";
                    if ($fil == "") {
                        continue;
                    }
                    $exp2 = explode(".", $fil);
                    $if = new \InputFileModel();
                    // echo $exp2[0]."<br>";
                    $if->getByID($exp2[0]);
                    $arrNames[] = $if;
                    $text .= $if->printLink();
                }
                echo $text;
                ?>
</div><?php 
            }
            ?>
			<?php 
            if ($page->comment_allowed) {
                ?>
				<div class="clearfix"
				     style="padding:  10px;"></div>
				<?php 
                PageCommentWeb::beginComment($id);
            }
            // pr($page);
            /* $str = '';
            			 global $template;
            			 if($page->post_gallery_id != 0 || $page->post_event_id != 0){
            
            				 if($page->post_event_id!=0){
            					 $event = new Event();
            					 $event->getByID($page->post_event_id);
            					// pr($event);
            					 $str .= '<div class="event-item"><div class="event-name">'.$event->cal_name.'</div></div>';
            					 $efi = new EfiHome();
            					 $_GET['eid'] = $page->post_event_id;
            					 $efi->eventview(1);
            				 }
            				 if($page->post_gallery_id!=0){
            					 $gal = new Gallery();
            					 $gal->getByID($page->post_gallery_id);
            					 //pr($gal);
            					 $str .= '<div class="gallery-item"><div class="gallery-name">'.$gal->gallery_name.'</div></div>';
            					 $efi = new EfiHome();
            					 $_GET['gid'] = $page->post_gallery_id;
            					 $efi->galleryview(1);
            				 }
            				 //$template->useSidebar = 1;
            				 //$template->sideBar = $str;
            			 }*/
            /*
            			 ?>
            			 <div class="fb-comments" data-href="http://developers.facebook.com/docs/plugins/comments/" data-width="100%" data-numposts="5" data-colorscheme="light"></div>
            			 <?*/
        }
    }
Example #9
0
 function indonesian_date_custom($date)
 {
     return 'Pukul : ' . indonesian_date($date, 'H:i') . '<br>' . indonesian_date($date, 'l, j F Y', '');
 }
">
                    <h2 class="post-title">
                        <?php 
    echo $p->topic_title;
    ?>
                    </h2>
                    <h3 class="post-subtitle">
                        <?php 
    if ($text != "") {
        echo $text . "...";
    }
    ?>
                    </h3>
                    </a>
                <p class="post-meta">Posted on <?php 
    echo indonesian_date($p->topic_date);
    ?>
</p>
                <?php 
    if ($p->topic_image != "") {
        ?>
                </div><div class="clearfix"></div>
            <?php 
    }
    ?>


    </div>
    <hr>
<?php 
}
    function res()
    {
        //        echo IMBAuth::createOAuth();
        //        echo "<br>";
        //        echo $_GET['token'];
        IMBAuth::checkOAuth();
        $id = addslashes($_GET['id']);
        //        echo $id;
        if ($id == "" || $id < 1) {
            die("No ID");
        }
        $ps = new PushNotCamp();
        $ps->getByID($id);
        //        pr($ps);
        $pss = new GCMResult();
        $arrs = $pss->getWhere("camp_id = '{$id}' ORDER BY gcm_date DESC");
        ?>
    <html>
    <head>
        <link href="<?php 
        echo _SPPATH;
        ?>
themes/adminlte/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
        <link rel="stylesheet" href="<?php 
        echo _SPPATH;
        ?>
themes/adminlte/css/jqueryui.css">
        <script src="<?php 
        echo _SPPATH;
        ?>
themes/adminlte/js/jquery-1.11.1.min.js"></script>
        <script src="<?php 
        echo _SPPATH;
        ?>
js/jqueryui.js"></script>
        <script src="<?php 
        echo _SPPATH;
        ?>
themes/adminlte/js/bootstrap.min.js" type="text/javascript"></script>
    </head>
    <body>
    <div id="wait" style="display: none; position: absolute;  width: 100%; line-height: 30px; text-align: center; font-weight: bold;">
        <span style="background-color: red; color:white; padding: 10px; margin-top: 20px;">Loading....</span></div>
    <div class="container">
    <h1><?php 
        echo $ps->camp_name;
        ?>
</h1>

    <table class="table table-bordered">
        <thead>
            <tr>
                <th>No.</th>
                <th>Date</th>
                <th>Is Test?</th>
                <th>Success</th>
                <th>Failure</th>
                <th>Summary</th>
                <th>Results</th>
            </tr>
            <?php 
        $cnt = 0;
        foreach ($arrs as $cc) {
            $cnt++;
            ?>
            <tr>
                <td>
                    <?php 
            echo $cnt;
            ?>
                </td>
                <td>
                    <?php 
            echo indonesian_date($cc->gcm_date);
            ?>
                </td>
                <td>
                    <?php 
            if ($cc->gcm_test) {
                echo "Yes";
            } else {
                echo "No";
            }
            ?>
                </td>
                <td>
                    <?php 
            echo $cc->success;
            ?>
                </td>
                <td>
                    <?php 
            echo $cc->failure;
            ?>
                </td>
                <td>
                    <?php 
            echo round($cc->success / ($cc->failure + $cc->success) * 100, 3);
            echo " %";
            ?>
                </td>
                <td>
                    <button class="btn btn-primary" id="detail_<?php 
            echo $cc->multicast_id;
            ?>
">Details</button>
                    <div id="multicast_<?php 
            echo $cc->multicast_id;
            ?>
" style="padding: 10px; display: none;"></div>
                    <script>
                        $("#detail_<?php 
            echo $cc->multicast_id;
            ?>
").click(function(){

                            var isHidden = $( "#multicast_<?php 
            echo $cc->multicast_id;
            ?>
" ).is( ":hidden" );
                            if(isHidden) {
                                $.get("<?php 
            echo _SPPATH;
            ?>
PushNotResults/detail?id=<?php 
            echo $cc->multicast_id;
            ?>
", function (data) {
                                    $("#multicast_<?php 
            echo $cc->multicast_id;
            ?>
").html(data);
                                    $("#multicast_<?php 
            echo $cc->multicast_id;
            ?>
").show();
                                });
                            }
                            else{
                                $("#multicast_<?php 
            echo $cc->multicast_id;
            ?>
").hide();
                            }
                        });
                    </script>
                    <?php 
            //                    $ress = unserialize($cc->results);  pr($ress);
            ?>
                </td>
            </tr>
                <?php 
        }
        ?>
        </thead>

    </table>
    </div>

    <?php 
        //    pr($arrs);
        ?>
    <script>
        $(document).ajaxStart(function(){
            $("#wait").css("display", "block");
        });

        $(document).ajaxComplete(function(){
            $("#wait").css("display", "none");
        });
    </script>
    <style>
        .hasil{
            border: 1px dashed #cccccc;
            margin: 5px;
            padding: 5px;
        }
        .red{
            color:red;
        }
        .green{
            color :darkgreen;
        }
    </style>
    </body>

    </html>

    <?php 
    }
Example #12
0
                <script type="text/javascript">
                    // 1 detik = 1000
                    window.setTimeout("waktu()",1000);
                    function waktu() {
                        var tanggal = new Date();
                        setTimeout("waktu()",1000);
                        document.getElementById("output").innerHTML = tanggal.getHours()+":"+tanggal.getMinutes()+":"+tanggal.getSeconds();
                    }
                </script>
                <body onload="waktu()">

                <?php 
$hariIni = date('Y-m-d');
$bulanIni = date('m');
echo "<center><h3> Hari, Tanggal : " . indonesian_date() . " <span id='output'></span> WIB </h3>";
?>
                        <!-- time content -->

                <br>
                </>

                <h3 style="color:red"><u>Insert your Identity : </u></h3>
            <table width="800" border="0" align = "center">
                <tr>
                    <td colspan="3" bgcolor = "yellow"></td>
                </tr>
                <tr>
                    <td width="200"></td>
                    <td>
Example #13
0
{{ post }}

<div class="page-header">
	<h1>{{ title }}</h1>
	<time class="date-post"><?php 
echo indonesian_date(date('Y-m-d H:i:s', strtotime($post[0]['created_on'])));
?>
</time>

	<img src="{{ thumb_detail }}" />
</div>

<div class="content-description">
	<p>{{ short_desc }}</p>
</div>

<div class="content-body">
	{{ long_desc }}
</div>

{{ /post }}
    public function getLatestComments($pid = -1, $type = "page")
    {
        if (isset($_GET['pid'])) {
            $pid = isset($_GET['pid']) ? addslashes($_GET['pid']) : die("no pid");
            $type = isset($_GET['type']) ? addslashes($_GET['type']) : "page";
        }
        $pc = new PageComment();
        $acc = new Account();
        $q = "SELECT * FROM {$pc->table_name},{$acc->table_name} WHERE admin_id = comment_author AND comment_page_id = '{$pid}' AND comment_type = '{$type}' ORDER BY comment_date DESC LIMIT 0,10";
        global $db;
        $arr = $db->query($q, 2);
        //pr($arr);
        foreach ($arr as $c) {
            $src = Account::getMyFotoAcc($c->admin_foto);
            ?>
<div class="comment-item col-md-12" style="border-bottom: 1px solid #dedede; margin-bottom: 10px;">
    <div class="col-md-2 col-xs-3">
        <div style="padding:20px; padding-top: 0px;">
        <?php 
            Account::makeMyFoto100percent($src);
            ?>
        </div>
    </div>
    <div class="col-md-10 col-xs-9">
        <div class="admin-name" style="font-style: italic;"><?php 
            echo $c->admin_nama_depan;
            ?>
</div>
        <div class="admin-date" style="font-style: italic; font-size: 11px;"><?php 
            echo indonesian_date($c->comment_date);
            ?>
</div>
        <div class="commentext" style="padding:10px; padding-left: 0px;">
        <?php 
            echo stripslashes($c->comment_text);
            ?>
        </div>
    </div>
    <div class="clearfix"></div>
</div>
                  
             <?php 
        }
    }
    public function my()
    {
        $cartModel = new CartModel();
        $id = Account::getMyID();
        if (Role::hasRole('admin')) {
            if ($_GET['id'] != "") {
                $id = addslashes($_GET['id']);
            }
        }
        if ($id < 1) {
            die('Err');
        }
        //paymentstatus != deleted
        $arr = $cartModel->getWhere("userid = '{$id}' AND payment_status != 4 ORDER BY po_date DESC");
        // pr($arr);
        ?>
<h1 class="beli" style="padding-bottom: 30px;">Order History</h1>
<div class="table-responsive">
<table class="table table-bordered">
    <thead>
        <tr>
            <th>Tanggal</th>
            <th>Value</th>
            <th>Action</th>
            <th>Status</th>
            <th>Action</th>
        </tr>
    </thead>
        <?php 
        foreach ($arr as $cartModel) {
            ?>
    <tr>
        <td><?php 
            echo indonesian_date($cartModel->po_date);
            ?>
</td>
        <td style="text-align: right;">Rp.<?php 
            echo rupiah($cartModel->total_cost);
            ?>
</td>
        <td>
            <a target="blank" href="<?php 
            echo _SPPATH;
            ?>
cartorder/details?po=<?php 
            echo $cartModel->po_id;
            ?>
">lihat details</a><br>
            <a target="blank" href="<?php 
            echo _SPPATH;
            ?>
ordersuccesspage?po=<?php 
            echo $cartModel->po_id;
            ?>
">cara pembayaran</a>
        </td>
        <td><?php 
            echo $this->arrStatus[$cartModel->payment_status];
            ?>
</td>
        <td>
            <?php 
            if ($cartModel->payment_status == 0) {
                ?>
            <button onclick="if(confirm('Delete PO Anda ?'))document.location='<?php 
                echo _SPPATH;
                ?>
CartOrder/deleteOrder?po=<?php 
                echo $cartModel->po_id;
                ?>
';">Delete Order</button>
            <?php 
            }
            ?>
        </td>
    </tr>
            <?php 
        }
        ?>
</table>
</div>
         <?php 
    }
    public function attachmentDialog($id, $value)
    {
        $localID = get_class($this);
        $vv = stripslashes($value);
        $data = json_decode($vv);
        //        pr($data);
        $arr = $this->getAll();
        ?>
        <div class="attachment_event">
        Select Event :
        <select id="calendar_picker_<?php 
        echo $id;
        ?>
">
            <option value="0"></option>
            <?php 
        foreach ($arr as $g) {
            ?>
                <option <?php 
            if ($data->{$localID} == $g->cal_id) {
                echo "selected";
            }
            ?>
 value="<?php 
            echo $g->cal_id;
            ?>
"><?php 
            echo $g->cal_name;
            ?>
 <?php 
            echo indonesian_date($g->cal_begin);
            ?>
</option>
            <?php 
        }
        ?>
        </select>
        <script>
            $("#calendar_picker_<?php 
        echo $id;
        ?>
").change(function() {
                if($('#<?php 
        echo $id;
        ?>
').val()!=="")
                    var myObject = jQuery.parseJSON( $('#<?php 
        echo $id;
        ?>
').val() );
                else
                    var myObject = new Object();

                myObject.<?php 
        echo $localID;
        ?>
 = $("#calendar_picker_<?php 
        echo $id;
        ?>
").val();


                var myString = JSON.stringify(myObject);
                $('#<?php 
        echo $id;
        ?>
').val(myString);
            });


        </script>
        </div>

    <?php 
    }
    public function search()
    {
        $s = isset($_GET['s']) ? addslashes($_GET['s']) : die('please insert search text');
        $loc = isset($_GET['loc']) ? addslashes($_GET['loc']) : die('please define location');
        $_SESSION['DocumentPortal_view_only'] = 1;
        //$mode = isset($_GET['mode'])?addslashes($_GET['mode']):die('no mode');
        // if($mode<1)die("mode hrs integer");
        // $s = isset($_GET['s'])?addslashes($_GET['s']):"";
        /*
         * TODO Check CHANNEL Allowed
         */
        $halaman = isset($_GET['p']) ? addslashes($_GET['p']) : 1;
        $limit = 5;
        $begin = ($halaman - 1) * $limit;
        $searchText = "";
        if ($s != "") {
            $searchText = " ( file_url LIKE '%{$s}%' OR file_isi LIKE '%{$s}%')";
        }
        $page = new DocumentsPortal();
        $whereClause = " {$searchText}";
        $arrPage = $page->getWhere($whereClause . " ORDER BY file_url DESC LIMIT {$begin},{$limit}");
        $jml = $page->getJumlah($whereClause);
        $jmlpage = ceil($jml / $limit);
        $mode = 0;
        //$pc = new PageContainer();
        //$pc->getByID($mode);
        //$gw = new GalleryWeb();
        //$page->file_filename
        ?>

    <h1 class="tbsh1" style="margin-bottom:20px; background-color: #efefef; padding: 10px; color: #000;">
        <?php 
        echo Lang::t('Documents');
        ?>
            <div style="float: right; width: 200px; display: none;">
                <div class="input-group">
                    <input id="seachtext" type="text" value="<?php 
        echo $s;
        ?>
" class="form-control" placeholder="search ">
                    <span class="input-group-btn">
                        <button onclick="document.location='<?php 
        echo _SPPATH;
        ?>
pagecontainer?mode=<?php 
        echo $mode;
        ?>
&s='+$('#seachtext').val();" class="btn btn-default" type="button">
                            <i class="glyphicon glyphicon-search"></i>
                        </button>
                    </span>
                    <script>
                    $("#seachtext").keyup(function(){
                        if (event.keyCode == 13) { //on enter
                        var slc = $('#seachtext').val();
                        $('#<?php 
        echo $loc;
        ?>
').load('<?php 
        echo _SPPATH;
        ?>
PageWeb/search?s='+$('#seachtext').val());
                        }
                    });
                    </script>
              </div><!-- /input-group -->
            </div>
            <div style="float:right; font-size: 12px; line-height: 24px;">
            <?php 
        echo $jml;
        ?>
 <?php 
        echo Lang::t('results in');
        ?>
 <?php 
        echo $jmlpage;
        ?>
 <?php 
        echo Lang::t('pages');
        ?>
        </div>
        </h1>
        <style>
    .post-title{
        font-size: 18px !important;
        color:#333 !important;
        font-weight: bold;
    }
    .post-title a{
        color:#555 !important;
    }
</style>
        <?php 
        foreach ($arrPage as $num => $p) {
            $url = "dm";
            $link = _SPPATH . "docviewer?gurl=" . $url . "&id=" . $p->file_id;
            $onclick = "onclick=\"window.open('" . $link . "','_blank');\"";
            $arrParents = $p->findAllParents();
            //pr($arrParents);
            //pr($p);
            $arrpar = array();
            $arrParents = array_reverse($arrParents);
            foreach ($arrParents as $par) {
                $arrpar[] = $par->folder_name;
            }
            $strpar = implode("/", $arrpar);
            ?>
               <div class="post-preview">

                   <div class="col-md-12">
                       <div style="padding-left:10px;">
                           
                           <div class="post-meta" style="font-size:11px;font-style: italic; color:#555;"><?php 
            echo indonesian_date($p->file_date);
            ?>
  </div>
                           
                       <div <?php 
            echo $onclick;
            ?>
 class="post-title" style="cursor:pointer;">
                           <i class="glyphicon glyphicon-list-alt"></i> 
                            <?php 
            echo stripslashes($p->file_url);
            ?>
                           
                        </div>
                           <div class="locat" style="font-size:12px;font-style: italic; color:#555;"><?php 
            echo $strpar;
            ?>
</div>
                        <div class="post-subtitle" style="font-size:13px;font-style: italic; color:#555;">

                            <?php 
            echo substr(stripslashes(strip_tags($p->file_isi)), 0, 100);
            ?>
                            <?php 
            if (strlen($p->file_isi) > 100) {
                ?>
                            ...
                            <?php 
            }
            ?>
                            <?php 
            /*<a href="<?=_SPPATH.$page->upload_url;?><?=$p->file_filename;?>">
              <?=Lang::t('read more');?>
              </a>*/
            ?>
                        </div>
                       </div>
                   </div>

                   <div class="clearfix"></div>
                </div>
                <?php 
            if ($num < count($arrPage) - 1) {
                ?>
                <hr>
                <?php 
            }
            ?>
                <style>
                    .post-meta{
                        font-size: 14px;
                        padding-top: 0;
                        margin-top: 0;
                    }
                    .post-title{
                        margin-bottom: 0;
                        margin-top: 0;
                        padding: 0;
                    }
                    .post-subtitle{
                        padding-top: 10px;
                    }
                    .buttonefi{
                        margin: 0 auto; text-align: center; font-weight: bold; cursor: pointer; background-color: #dedede; border-radius: 5px; padding: 10px; margin: 10px;
                    }
                    .buttonefi:hover{
                        background-color: #efefef;
                    }
                </style>
             <?php 
        }
        $jmlpage = ceil($jml / $limit);
        ?>


 <nav>
  <ul class="pagination">
      <?php 
        if ($halaman > 1) {
            ?>
      <li><a onclick="$('#<?php 
            echo $loc;
            ?>
').load('<?php 
            echo _SPPATH;
            ?>
DMWeb/search?loc=<?php 
            echo $loc;
            ?>
&s=<?php 
            echo $s;
            ?>
&p=<?php 
            echo $halaman - 1;
            ?>
');" >
            <span aria-hidden="true">&laquo;</span><span class="sr-only">Previous</span>
        </a>
    </li>
    <?php 
        }
        ?>
    <?php 
        //ambil 3 bh terdekat //
        $mulai = $halaman - 2;
        $akhir = $halaman + 2;
        //echo $mulai.$akhir;
        $min = max($mulai, 1);
        $max = min($akhir, $jmlpage);
        //echo "<br> max :".$max;
        //echo "<br> min :".$min;
        for ($x = $min; $x <= $max; $x++) {
            ?>

    <li <?php 
            if ($x == $halaman) {
                ?>
class="active"<?php 
            }
            ?>
>
        <a onclick="$('#<?php 
            echo $loc;
            ?>
').load('<?php 
            echo _SPPATH;
            ?>
DMWeb/search?loc=<?php 
            echo $loc;
            ?>
&s=<?php 
            echo $s;
            ?>
&p=<?php 
            echo $x;
            ?>
');" >
        <?php 
            echo $x;
            ?>
        </a>
    </li>
    <?php 
        }
        ?>

    <?php 
        if ($jml > $begin + $limit) {
            ?>
    <li>
        <a onclick="$('#<?php 
            echo $loc;
            ?>
').load('<?php 
            echo _SPPATH;
            ?>
DMWeb/search?loc=<?php 
            echo $loc;
            ?>
&s=<?php 
            echo $s;
            ?>
&p=<?php 
            echo $halaman + 1;
            ?>
');" >
            <span aria-hidden="true">&raquo;</span><span class="sr-only">Next</span>
        </a>
    </li>
    <?php 
        }
        ?>
  </ul>
</nav>
       <!-- <h4><?php 
        echo $jml;
        ?>
 results in <?php 
        echo $jmlpage;
        ?>
 pages</h4>  -->

    <?php 
    }
    function galleryLoad()
    {
        $gal = new Gallery();
        $arrGal = $gal->getWhere("gallery_name != '' ORDER BY gallery_date DESC");
        foreach ($arrGal as $gal) {
            $gp = new Galleryphoto();
            $gp->getMainpic($gal->gallery_id);
            ?>
            <div class="gallery-item col-md-4" >
                <div style="position: absolute; width: 20px; height: 20px; padding: 5px; z-index:1;">
                    <input onclick="gallery_actived('<?php 
            echo $gal->gallery_id;
            ?>
');"  type="checkbox" <?php 
            if ($gal->gallery_active) {
                echo "checked";
            }
            ?>
>
                </div>
                <div class="paddingmargingallery">
                    <?php 
            if ($gp->photo_filename != "") {
                ?>

                            <img style="cursor: pointer;"  onclick="gallery_open(<?php 
                echo $gal->gallery_id;
                ?>
);" width="100%" src="<?php 
                echo _SPPATH . _PHOTOURL;
                ?>
thumbnail/<?php 
                echo $gp->photo_filename;
                ?>
">

                    <?php 
            }
            ?>

                        <div class="gallery-date ">
                            <small><?php 
            echo indonesian_date($gal->gallery_date);
            ?>
</small>
                        </div>
                        <div style="cursor: pointer;" class="gallery-name" onclick="gallery_open(<?php 
            echo $gal->gallery_id;
            ?>
);">

                            <?php 
            echo $gal->gallery_name;
            ?>

                        </div>


                    <div class="clearfix"></div>
                    <div class="gp_menu" style="margin:0 auto; padding-top: 5px;">
                        <button type="button" onclick="if(confirm('<?php 
            echo Lang::t("Are You Sure? This will delete the selected album and all the pictures within the album");
            ?>
'))gallery_delete(<?php 
            echo $gal->gallery_id;
            ?>
);event.preventDefault();" class="btn btn-default"><?php 
            echo Lang::t('delete');
            ?>
</button>
                    </div>
                </div>
            </div>
        <?php 
        }
    }
Example #19
0
    function myOrders()
    {
        ?>
<div class="container attop"  >
    <div class="col-md-10 col-md-offset-1">
        <h1>My Orders</h1>
        <?php 
        $orders = new PaypalOrder();
        $arrOrder = $orders->getWhere("user_id = '" . Account::getMyID() . "' ORDER BY created_time DESC");
        if (count($arrOrder) > 0) {
            ?>
        <div class="table-responsive" style="margin-top: 20px;">
            <table class="table table-striped table-bordered">
                <thead>
                <tr>
                    <th>
                        No.
                    </th>
                    <th>Order ID</th>
                    <th>Description</th>
                    <th>Status</th>
                    <th>Date</th>
                    <th>Amount</th>
                </tr>
                </thead>
                <tbody>
                <?php 
            foreach ($arrOrder as $num => $orders) {
                ?>
                    <tr>
                        <td><?php 
                echo $num + 1;
                ?>
</td>
                        <td><?php 
                echo $orders->order_id;
                ?>
</td>
                        <td><?php 
                echo $orders->description;
                ?>
</td>
                        <td><?php 
                echo $orders->state;
                ?>
</td>
                        <td><?php 
                echo indonesian_date($orders->created_time);
                ?>
</td>
                        <td>
                            <?php 
                echo $orders->currency . " " . $orders->amount;
                ?>
                        </td>
                    </tr>
                <?php 
            }
            ?>
                </tbody>
            </table>
        </div>

            <?php 
        } else {
            ?>
            No orders made yet
        <?php 
        }
        ?>
        </div>
    </div>
        <?php 
    }
    function galleryLoad()
    {
        $gal = new Gallery();
        $arrGal = $gal->getWhere("gallery_name != '' ORDER BY gallery_date DESC");
        foreach ($arrGal as $gal) {
            $gp = new Galleryphoto();
            $gp->getMainpic($gal->gallery_id);
            ?>
            <div class="gallery-item col-md-4">
                <div class="paddingmargingallery">
                    <?php 
            if ($gp->photo_filename != "") {
                ?>
                        <div class="col-md-4 col-sm-4 col-xs-4">
                            <img class="img-responsive img-rounded"
                                 src="<?php 
                echo _SPPATH;
                echo $this->uploadURLThumb;
                echo $gp->photo_filename;
                ?>
">
                        </div>
                    <?php 
            }
            ?>
                    <div class="col-md-8 col-sm-8 col-xs-8">
                        <div class="gallery-date ">
                            <small><?php 
            echo indonesian_date($gal->gallery_date);
            ?>
</small>
                        </div>
                        <div class="gallery-name" onclick="gallery_open(<?php 
            echo $gal->gallery_id;
            ?>
);">

                            <?php 
            echo $gal->gallery_name;
            ?>

                        </div>
                    </div>

                    <div class="clearfix"></div>
                    <div class="gp_menu" style="margin:0 auto; padding-top: 5px;">
                        <button type="button"
                                onclick="if(confirm('<?php 
            echo Lang::t("Are You Sure? This will delete the selected album and all the pictures within the album");
            ?>
'))gallery_delete(<?php 
            echo $gal->gallery_id;
            ?>
);event.preventDefault();"
                                class="btn btn-default"><?php 
            echo Lang::t('delete');
            ?>
</button>
                    </div>
                </div>
            </div>
        <?php 
        }
    }
    function fmenu($if)
    {
        $acc = new Account();
        $acc->getByID($if->file_author);
        $path = _SPPATH . $if->upload_url;
        $fil = $if->file_filename;
        ?>
		<div class="col-md-4">
			<h3 class="h3pv"
			    style="width: 100%; overflow: hidden;"><?php 
        echo $if->file_url;
        ?>
</h3>

			<div class="metadata"><?php 
        echo Lang::t('Author');
        ?>
 : <?php 
        echo $acc->admin_nama_depan;
        ?>
 </div>
			<div class="metadata"><?php 
        echo Lang::t('Size');
        ?>
 : <?php 
        echo formatSizeUnits($if->file_size);
        ?>
 </div>
			<div class="metadata"><?php 
        echo Lang::t('Date');
        ?>
 : <?php 
        echo indonesian_date($if->file_date);
        ?>
 </div>
			<?php 
        $inp = new \Leap\View\InputFile();
        if (in_array($if->file_ext, $inp->arrVideoExt)) {
            ?>
				<!--				<div class="metadata">Embed Code : <br/>--><?php 
            //= '#tbs_video#' . _BPATH . $if->upload_url . $if->file_filename .
            //					'#/tbs_video#'
            ?>
<!--</div>-->
				<div class="clone-url open"
				     data-protocol-type="subversion"
				     data-url="/users/set_protocol?protocol_selector=subversion&amp;protocol_type=clone">
					Embed Code :

					<div class="input-group js-zeroclipboard-container">
						<input type="text"
						       class="input-mini input-monospace js-url-field js-zeroclipboard-target"
						       value="<?php 
            echo '#tbs_video#' . _BPATH . $if->upload_url . $if->file_filename . '#/tbs_video#';
            ?>
"
						       readonly="readonly" />
					</div>
				</div>
			<?php 
        }
        ?>
			<?php 
        if ($if->file_ext == "pdf") {
            ?>
				<?php 
            /*<button style="margin-top: 10px;"
              onclick="window.open('<?= _SPPATH; ?>js/ViewerJS/leappdf.php?nn=<?= $if->file_url; ?>&dd=<?= $if->bolehsave; ?>#<?= base64_encode($path .
               $if->file_filename); ?>.pdf','_blank');"
              class="btn btn-primary"><?= Lang::t('Open'); ?></button>*/
            ?>
			<?php 
        } else {
            ?>
				<button style="margin-top: 10px;"
				        onclick="window.open('<?php 
            echo $path . $fil;
            ?>
','_blank');"
				        class="btn btn-primary"><?php 
            echo Lang::t('Open');
            ?>
</button>
			<?php 
        }
        //pr($if);
        ?>
		</div>
	<?php 
    }
Example #22
0
 public function posts()
 {
     $limit = $this->attribute('limit', null);
     $this->db->where('status', 1);
     $this->db->limit($limit);
     $rows = $this->download_m->get_all();
     foreach ($rows as &$row) {
         //$row->url = site_url('download/view/'.$this->core->encode($row->id));
         $row->date = indonesian_date($row->created_on);
         if (file_exists(UPLOAD_PATH . 'download/' . $row->cover) && is_file(UPLOAD_PATH . 'download/' . $row->cover)) {
             $cover = UPLOAD_PATH . 'download/' . $row->cover;
         } else {
             $cover = UPLOAD_PATH . 'no_image.jpg';
         }
         $row->cover_thumb = $this->image_m->resize($cover, 300, 76, 'crop');
         $row->download_file = base_url(UPLOAD_PATH . 'download/' . $row->file);
         $row->download_ext = strtolower(strrchr($row->file, '.'));
     }
     return $rows;
 }
    function WhoIsOnline()
    {
        $min = isset($_GET['min']) ? addslashes($_GET['min']) : 10;
        $ret = BLogger::getUserOnlineLastXMinutes($min);
        //pr($ret);
        echo '<h1>' . Lang::t('Number of Users Online : ') . $ret['nr'] . "</h1>";
        $t = time();
        ?>
<div class="table-responsive">
    <div style="padding-bottom:  20px;">
        <?php 
        echo Lang::t('Select Time Frame');
        ?>
 :
    <select id="selectortime_<?php 
        echo $t;
        ?>
">
        <option <?php 
        if ($min == '5') {
            echo "selected";
        }
        ?>
 value="5">5 Min</option>
        <option <?php 
        if ($min == '10') {
            echo "selected";
        }
        ?>
 value="10">10 Min</option>
        <option <?php 
        if ($min == '30') {
            echo "selected";
        }
        ?>
 value="30">30 Min</option>
        <option <?php 
        if ($min == '60') {
            echo "selected";
        }
        ?>
 value="60">60 Min</option>
        <option <?php 
        if ($min == '120') {
            echo "selected";
        }
        ?>
 value="120">2 Hours</option>
        <option <?php 
        if ($min == '360') {
            echo "selected";
        }
        ?>
 value="360">6 Hours</option>
        <option <?php 
        if ($min == '720') {
            echo "selected";
        }
        ?>
 value="720">12 Hours</option>
        <option <?php 
        if ($min == '1440') {
            echo "selected";
        }
        ?>
 value="1440">1 Day</option>
    </select>
    </div>

    <script>
        $('#selectortime_<?php 
        echo $t;
        ?>
').change(function(){
           var slc =  $('#selectortime_<?php 
        echo $t;
        ?>
').val();
           openLw('WhoIsOnline','<?php 
        echo _SPPATH;
        ?>
BLoggerWeb/WhoIsOnline?min='+slc,'fade');
        });
    </script>
    <table class="table table-bordered table-hover">
        <thead>
            <tr>
                <th><?php 
        echo Lang::t('Time');
        ?>
</th>
                <th><?php 
        echo Lang::t('ID');
        ?>
</th>
                <th><?php 
        echo Lang::t('Username');
        ?>
</th>
                <th><?php 
        echo Lang::t('Role');
        ?>
</th>
                <th><?php 
        echo Lang::t('URL');
        ?>
</th>
                <th><?php 
        echo Lang::t('IP');
        ?>
</th>
                <th><?php 
        echo Lang::t('Action');
        ?>
</th>
                <th><?php 
        echo Lang::t('Device');
        ?>
</th>
                <th><?php 
        echo Lang::t('Note');
        ?>
</th>
            </tr>
        </thead>
        <?php 
        foreach ($ret['all'] as $log) {
            ?>
        <tr>
            <td>
                <?php 
            echo indonesian_date($log->b_log_time);
            ?>
            </td>
            <td>
                <?php 
            echo $log->b_log_userid;
            ?>
            </td>
            <td>
                <?php 
            echo $log->b_log_username;
            ?>
            </td>
            <td>
                <?php 
            echo $log->b_log_userrole;
            ?>
            </td>
            <td>
                <?php 
            echo $log->b_log_url;
            ?>
            </td>
            <td>
                <?php 
            echo $log->b_log_ip;
            ?>
            </td>
            <td>
                <?php 
            echo $log->b_log_action;
            ?>
            </td>
            <td>
                <?php 
            echo $log->b_log_user_agent;
            ?>
            </td>
            <td>
                <?php 
            echo $log->b_log_keterangan;
            ?>
            </td>
        </tr>
        <?php 
        }
        ?>
    </table>
</div>
        <?php 
    }
Example #24
0
 /**
  * Program List
  *
  * Creates a list of blog posts. Takes all of the parameters
  * available to streams, sans stream, where, and namespace.
  *
  * Usage:
  * {{ program:posts limit="5" }}
  *		<h2>{{ title }}</h2>
  * {{ /program:posts }}
  *
  * @param	array
  * @return	array
  */
 public function posts()
 {
     $this->load->driver('Streams');
     // Get all of our default entry items:
     $params = $this->streams->entries->entries_params;
     // Override them with some settings
     // that should be these values:
     $overrides = array('stream' => 'program', 'namespace' => 'programs', 'where' => array("`status` = 1"), 'order_by' => 'created_on', 'sort' => 'desc', 'show_past' => 'yes', 'date_by' => 'created_on', 'limit' => $this->attribute('limit', null), 'offset' => $this->attribute('offset'));
     foreach ($overrides as $k => $v) {
         $params[$k] = $v;
     }
     // Convert our two non-matching posts params to their
     // stream counterparts. This is for backwards compatability.
     // Order by
     if ($this->attribute('order-by')) {
         $params['order_by'] = $this->attribute('order-by');
     } elseif ($this->attribute('order_by')) {
         $params['order_by'] = $this->attribute('order_by');
     }
     // Sort
     if ($this->attribute('order-dir')) {
         $params['sort'] = $this->attribute('order-dir');
     } elseif ($this->attribute('order_by')) {
         $params['sort'] = $this->attribute('sort');
     }
     // See if we have any attributes to contribute.
     foreach ($params as $key => $default_value) {
         if (!in_array($key, array('where', 'stream', 'namespace'))) {
             $params[$key] = $this->attribute($key, $default_value);
         }
     }
     // Categories
     // We need to filter by certain categories
     if ($category_string = $this->attribute('category')) {
         $categories = explode('|', $category_string);
         $cate_filter_by = array();
         foreach ($categories as $category) {
             $cate_filter_by[] = '`' . $this->db->dbprefix('program_categories') . '`.`' . (is_numeric($category) ? 'id' : 'slug') . '` = \'' . $category . "'";
         }
         if ($cate_filter_by) {
             $params['where'][] = implode(' OR ', $cate_filter_by);
         }
     }
     // Extra join and selects for categories.
     $this->row_m->sql['select'][] = $this->db->protect_identifiers('program_categories.title', true) . " as 'category_title'";
     $this->row_m->sql['select'][] = $this->db->protect_identifiers('program_categories.slug', true) . " as 'category_slug'";
     $this->row_m->sql['select'][] = $this->db->protect_identifiers('program_categories.title', true) . " as 'category||title'";
     $this->row_m->sql['select'][] = $this->db->protect_identifiers('program_categories.slug', true) . " as 'category||slug'";
     $this->row_m->sql['join'][] = 'LEFT JOIN ' . $this->db->protect_identifiers('program_categories', true) . ' ON ' . $this->db->protect_identifiers('program_categories.id', true) . ' = ' . $this->db->protect_identifiers('program.category_id', true);
     // Get our posts.
     $posts = $this->streams->entries->get_entries($params);
     if ($posts['entries']) {
         // Process posts.
         // Each post needs some special treatment.
         foreach ($posts['entries'] as &$post) {
             $this->load->helper('text');
             $this->load->model('files/image_m');
             // Keywords array
             /*$keywords = Keywords::get($post['keywords']);
             				$formatted_keywords = array();
             				$keywords_arr = array();
             
             				foreach ($keywords as $key)
             				{
             					$formatted_keywords[] 	= array('keyword' => $key->name);
             					$keywords_arr[] 		= $key->name;
             
             				}
             				$post['keywords'] = $formatted_keywords;
             				$post['keywords_arr'] = $keywords_arr;*/
             // Full URL for convenience.
             $post['url'] = site_url('program/' . $post['id'] . '/' . date('Y/m/d', strtotime($post['created_on'])) . '/' . $post['slug']);
             $post['date'] = indonesian_date(date('Y/m/d H:i:s', strtotime($post['created_on'])));
             $post['intro'] = word_limiter($post['short_desc'], 15);
             if (file_exists(UPLOAD_PATH . 'program/' . $post['image']) && is_file(UPLOAD_PATH . 'program/' . $post['image'])) {
                 $image = UPLOAD_PATH . 'program/' . $post['image'];
             } else {
                 $image = UPLOAD_PATH . 'no_image.jpg';
             }
             $post['thumb_70x70'] = $this->image_m->resize($image, 70, 70, 'crop');
             //$post['thumb_690x370'] = $this->image_m->resize($image, 690, 370, 'crop');
             // What is the preview? If there is a field called intro,
             // we will use that, otherwise we will cut down the blog post itself.
             $post['preview'] = isset($post['intro']) ? $post['intro'] : $post['body'];
         }
     }
     // {{ entries }} Bypass.
     // However, users can use {{ entries }} if using pagination.
     $loop = false;
     if (preg_match('/\\{\\{\\s?entries\\s?\\}\\}/', $this->content()) == 0) {
         $posts = $posts['entries'];
         $loop = true;
     }
     // Return our content.
     return $this->streams->parse->parse_tag_content($this->content(), $posts, 'program', 'programs', $loop);
 }
Example #25
0
{{ post }}

<div class="post">

	<h3>{{ title }}</h3>
	<div class="date-post"><?php 
echo indonesian_date(date('Y-m-d H:i:s', $post[0]['created_on']));
?>
</div>

	<!--
	<div class="meta">
		<div class="date">
			{{ helper:lang line="blog:posted_label" }}
			<span>{{ helper:date timestamp=created_on }}</span>
		</div>

		<div class="author">
			{{ helper:lang line="blog:written_by_label" }}
			<span><a href="{{ url:site }}user/{{ created_by:user_id }}">{{ created_by:display_name }}</a></span>
		</div>

		{{ if category }}
		<div class="category">
			{{ helper:lang line="blog:category_label" }}
			<span><a href="{{ url:site }}alert/category/{{ category:slug }}">{{ category:title }}</a></span>
		</div>
		{{ endif }}

		{{ if keywords }}
		<div class="keywords">
Example #26
0
 public function posts()
 {
     $limit = $this->attribute('limit', null);
     $this->db->where('status', 1);
     $this->db->limit($limit);
     $rows = $this->gallery_m->get_all();
     foreach ($rows as &$row) {
         $row->url = site_url('gallery/view/' . $this->core->encode($row->id));
         $row->date = indonesian_date($row->created_on);
         if (file_exists(UPLOAD_PATH . 'gallery/' . $row->image) && is_file(UPLOAD_PATH . 'gallery/' . $row->image)) {
             $image = UPLOAD_PATH . 'gallery/' . $row->image;
         } else {
             $image = UPLOAD_PATH . 'no_image.jpg';
         }
         $row->thumb_154x110 = $this->image_m->resize($image, 154, 110, 'crop');
     }
     return $rows;
 }
    public static function portalIndex()
    {
        $mode = isset($_GET['mode']) ? addslashes($_GET['mode']) : die('no mode');
        if ($mode < 1) {
            die("mode hrs integer");
        }
        /*
         * LOAD page con, cek apakah bisa ini sub atau main con
         */
        $a = NewsChannel::myChannels();
        //pr($a);
        foreach ($a as $chn) {
            $str = " page_channel_id = '{$chn}' ";
            $imp[] = $str;
        }
        $wherechannel = implode("OR", $imp);
        $wherechannel = "(" . $wherechannel . ")";
        $pc = new PageContainer();
        $pc->getByID($mode);
        $gw = new GalleryWeb();
        if ($pc->container_parent_id == 0) {
            //self::subconMenu($mode);
            $class = "col-md-7 col-md-offset-1";
            $yangdipakai = "post_gallery_id";
        } else {
            $pc2 = new PageContainer();
            $pc2->getByID($pc->container_parent_id);
            $breadcrumbs = "<a href='" . _SPPATH . "pagecontainer?mode=" . $pc2->container_id . "'>" . $pc2->container_name . "</a> / <a href='" . _SPPATH . "pagecontainer?mode=" . $pc->container_id . "'>" . $pc->container_name . "</a>";
            $class = "col-md-8 col-md-offset-2";
            $yangdipakai = "post_subcon_id";
        }
        $s = isset($_GET['s']) ? addslashes($_GET['s']) : "";
        $halaman = isset($_GET['p']) ? addslashes($_GET['p']) : 1;
        $limit = 10;
        $begin = ($halaman - 1) * $limit;
        $searchText = "";
        if ($s != "") {
            $searchText = " AND ( post_title LIKE '%{$s}%' OR post_content LIKE '%{$s}%')";
        }
        $page = new Page();
        $whereClause = "{$yangdipakai} = '{$mode}' AND post_status = 'publish' AND {$wherechannel} {$searchText}";
        $arrPage = $page->getWhere($whereClause . " ORDER BY post_modified DESC LIMIT {$begin},{$limit}");
        $jml = $page->getJumlah($whereClause);
        if (count($arrPage) == 0) {
            ?>
<h3><?php 
            echo Lang::t('No Page on this category yet');
            ?>
</h3>    
            <?php 
            return "";
        }
        ?>

<div class="<?php 
        echo $class;
        ?>
">
    <?php 
        echo $breadcrumbs;
        ?>
    <h1 class="tbsh1" style="margin-bottom:20px;">
            <div style="float: right; width: 200px;">
                <div class="input-group">
                    <input id="seachtext" type="text" value="<?php 
        echo $s;
        ?>
" class="form-control" placeholder="search <?php 
        echo $pc->container_name;
        ?>
">
                    <span class="input-group-btn">
                        <button onclick="document.location='<?php 
        echo _SPPATH;
        ?>
pagecontainer?mode=<?php 
        echo $mode;
        ?>
&s='+$('#seachtext').val();" class="btn btn-default" type="button">
                            <i class="glyphicon glyphicon-search"></i>
                        </button>
                    </span>
                    <script>
                    $("#seachtext").keyup(function(){
                        if (event.keyCode == 13) { //on enter
                        var slc = $('#seachtext').val();
                        document.location='<?php 
        echo _SPPATH;
        ?>
pagecontainer?mode=<?php 
        echo $mode;
        ?>
&s='+$('#seachtext').val();
                        }
                    });
                    </script>
              </div><!-- /input-group -->
            </div>
            <?php 
        echo $pc->container_name;
        ?>
        </h1>    
        <style>
    .post-title{
        font-size: 18px !important;
        color:#333 !important;
        font-weight: bold;
    }
    .post-title a{
        color:#555 !important;
    }
</style>    
        <?php 
        foreach ($arrPage as $num => $p) {
            ?>
               <div class="post-preview">
                   <div class="col-md-4">
                       <img class="img-responsive" src="<?php 
            echo _SPPATH . $gw->uploadURL . $p->post_image;
            ?>
">
                   </div>
                   <div class="col-md-8">
                       <div style="padding-left:10px;">
                       <div class="post-meta"><?php 
            echo indonesian_date($p->post_modified);
            ?>
</div>
                        <div class="post-title">
                            <a href="<?php 
            echo _SPPATH;
            ?>
page?id=<?php 
            echo $p->ID;
            ?>
">
                            <?php 
            echo stripslashes($p->post_title);
            ?>
                            </a>
                        </div>
                        <div class="post-subtitle">
                            
                            <?php 
            echo substr(stripslashes(strip_tags($p->post_content)), 0, 100);
            ?>
                            <?php 
            if (strlen($p->post_content) > 100) {
                ?>
                            ...
                            <?php 
            }
            ?>
<br>
                            <a href="<?php 
            echo _SPPATH;
            ?>
page?id=<?php 
            echo $p->ID;
            ?>
">
                            <?php 
            echo Lang::t('read more');
            ?>
                            </a>
                        </div>
                       </div>
                   </div>
                    
                   <div class="clearfix"></div>
                </div>
                <?php 
            if ($num < count($arrPage) - 1) {
                ?>
                <hr> 
                <?php 
            }
            ?>
                <style>
                    .post-meta{
                        font-size: 14px;
                        padding-top: 0;
                        margin-top: 0;
                    }
                    .post-title{
                        margin-bottom: 0;
                        margin-top: 0;
                        padding: 0;
                    }
                    .post-subtitle{
                        padding-top: 10px;
                    }
                    .buttonefi{
                        margin: 0 auto; text-align: center; font-weight: bold; cursor: pointer; background-color: #dedede; border-radius: 5px; padding: 10px; margin: 10px;
                    }
                    .buttonefi:hover{
                        background-color: #efefef;
                    }
                </style>
             <?php 
        }
        $jmlpage = ceil($jml / $limit);
        ?>
                  
                
 <nav>
  <ul class="pagination">
      <?php 
        if ($halaman > 1) {
            ?>
    <li><a href="<?php 
            echo _SPPATH;
            ?>
pagecontainer?mode=<?php 
            echo $mode;
            ?>
&s=<?php 
            echo $s;
            ?>
&p=<?php 
            echo $halaman - 1;
            ?>
"><span aria-hidden="true">&laquo;</span><span class="sr-only">Previous</span></a></li>
    <?php 
        }
        ?>
    <?php 
        //ambil 3 bh terdekat //
        $mulai = $halaman - 2;
        $akhir = $halaman + 2;
        //echo $mulai.$akhir;
        $min = max($mulai, 1);
        $max = min($akhir, $jmlpage);
        //echo "<br> max :".$max;
        //echo "<br> min :".$min;
        for ($x = $min; $x <= $max; $x++) {
            ?>
    
    <li <?php 
            if ($x == $halaman) {
                ?>
class="active"<?php 
            }
            ?>
><a href="<?php 
            echo _SPPATH;
            ?>
pagecontainer?mode=<?php 
            echo $mode;
            ?>
&s=<?php 
            echo $s;
            ?>
&p=<?php 
            echo $x;
            ?>
"><?php 
            echo $x;
            ?>
</a></li>
    <?php 
        }
        ?>
    
    <?php 
        if ($jml > $begin + $limit) {
            ?>
    <li><a href="<?php 
            echo _SPPATH;
            ?>
pagecontainer?mode=<?php 
            echo $mode;
            ?>
&s=<?php 
            echo $s;
            ?>
&p=<?php 
            echo $halaman + 1;
            ?>
"><span aria-hidden="true">&raquo;</span><span class="sr-only">Next</span></a></li>
    <?php 
        }
        ?>
  </ul>
</nav>
        <h4><?php 
        echo $jml;
        ?>
 results in <?php 
        echo $jmlpage;
        ?>
 pages</h4>  
</div><?php 
        if ($pc->container_parent_id == 0) {
            self::subconMenu($mode);
            //$class = "col-md-7";
        }
    }
Example #28
0
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="field-4" class="col-sm-3 control-label">Format Tanggal</label>

                            <?php 
$mydate = getdate(date("U"));
?>

                            <div class="col-sm-5">
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="format_tanggal" id="optionsRadios1" value="1" checked>
                                        <?php 
echo indonesian_date("{$mydate['weekday']}, {$mydate['mday']} {$mydate['month']} {$mydate['year']}");
?>
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="format_tanggal" id="optionsRadios2" value="2">
                                        <?php 
echo "{$mydate['mday']}/{$mydate['mon']}/{$mydate['year']}";
?>
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="format_tanggal" id="optionsRadios3" value="3">
                                        <?php 
    public function searchMe()
    {
        $s = isset($_GET['s']) ? addslashes($_GET['s']) : die('please insert search text');
        $loc = isset($_GET['loc']) ? addslashes($_GET['loc']) : die('please define location');
        //$mode = isset($_GET['mode'])?addslashes($_GET['mode']):die('no mode');
        // if($mode<1)die("mode hrs integer");
        // $s = isset($_GET['s'])?addslashes($_GET['s']):"";
        $halaman = isset($_GET['p']) ? addslashes($_GET['p']) : 1;
        $limit = 2;
        $begin = ($halaman - 1) * $limit;
        $searchText = "";
        if ($s != "") {
            $searchText = " AND ( post_title LIKE '%{$s}%' OR post_content LIKE '%{$s}%')";
        }
        $page = new Page();
        $whereClause = "post_status = 'publish' {$searchText}";
        $arrPage = $page->getWhere($whereClause . " ORDER BY post_modified DESC LIMIT {$begin},{$limit}");
        $jml = $page->getJumlah($whereClause);
        $mode = 0;
        //$pc = new PageContainer();
        //$pc->getByID($mode);
        $gw = new GalleryWeb();
        ?>

    <h1 class="tbsh1" style="margin-bottom:20px; background-color: #efefef; padding: 10px; color: #000;">
        Pages
            <div style="float: right; width: 200px; display: none;">
                <div class="input-group">
                    <input id="seachtext" type="text" value="<?php 
        echo $s;
        ?>
" class="form-control" placeholder="search ">
                    <span class="input-group-btn">
                        <button onclick="document.location='<?php 
        echo _SPPATH;
        ?>
pagecontainer?mode=<?php 
        echo $mode;
        ?>
&s='+$('#seachtext').val();" class="btn btn-default" type="button">
                            <i class="glyphicon glyphicon-search"></i>
                        </button>
                    </span>
                    <script>
                    $("#seachtext").keyup(function(){
                        if (event.keyCode == 13) { //on enter
                        var slc = $('#seachtext').val();
                        $('#<?php 
        echo $loc;
        ?>
').load('<?php 
        echo _SPPATH;
        ?>
PageWeb/search?s='+$('#seachtext').val());
                        }
                    });
                    </script>
              </div><!-- /input-group -->
            </div>
            
        </h1>    
        <style>
    .post-title{
        font-size: 18px !important;
        color:#333 !important;
        font-weight: bold;
    }
    .post-title a{
        color:#555 !important;
    }
</style>    
        <?php 
        foreach ($arrPage as $num => $p) {
            ?>
               <div class="post-preview">
                  
                   <div class="col-md-12">
                       <div style="padding-left:10px;">
                       <div class="post-meta"><?php 
            echo indonesian_date($p->post_modified);
            ?>
</div>
                        <div class="post-title">
                            <a href="<?php 
            echo _SPPATH;
            ?>
page?id=<?php 
            echo $p->ID;
            ?>
">
                            <?php 
            echo stripslashes($p->post_title);
            ?>
                            </a>
                        </div>
                        <div class="post-subtitle">
                            
                            <?php 
            echo substr(stripslashes(strip_tags($p->post_content)), 0, 100);
            ?>
                            <?php 
            if (strlen($p->post_content) > 100) {
                ?>
                            ...
                            <?php 
            }
            ?>
<br>
                            <a href="<?php 
            echo _SPPATH;
            ?>
page?id=<?php 
            echo $p->ID;
            ?>
">
                            <?php 
            echo Lang::t('read more');
            ?>
                            </a>
                        </div>
                       </div>
                   </div>
                    
                   <div class="clearfix"></div>
                </div>
                <?php 
            if ($num < count($arrPage) - 1) {
                ?>
                <hr> 
                <?php 
            }
            ?>
                <style>
                    .post-meta{
                        font-size: 14px;
                        padding-top: 0;
                        margin-top: 0;
                    }
                    .post-title{
                        margin-bottom: 0;
                        margin-top: 0;
                        padding: 0;
                    }
                    .post-subtitle{
                        padding-top: 10px;
                    }
                    .buttonefi{
                        margin: 0 auto; text-align: center; font-weight: bold; cursor: pointer; background-color: #dedede; border-radius: 5px; padding: 10px; margin: 10px;
                    }
                    .buttonefi:hover{
                        background-color: #efefef;
                    }
                </style>
             <?php 
        }
        $jmlpage = ceil($jml / $limit);
        ?>
                  
                
 <nav>
  <ul class="pagination">
      <?php 
        if ($halaman > 1) {
            ?>
      <li><a onclick="$('#<?php 
            echo $loc;
            ?>
').load('<?php 
            echo _SPPATH;
            ?>
PageWeb/search?loc=<?php 
            echo $loc;
            ?>
&s=<?php 
            echo $s;
            ?>
&p=<?php 
            echo $halaman - 1;
            ?>
');" >
            <span aria-hidden="true">&laquo;</span><span class="sr-only">Previous</span>
        </a>
    </li>
    <?php 
        }
        ?>
    <?php 
        //ambil 3 bh terdekat //
        $mulai = $halaman - 2;
        $akhir = $halaman + 2;
        //echo $mulai.$akhir;
        $min = max($mulai, 1);
        $max = min($akhir, $jmlpage);
        //echo "<br> max :".$max;
        //echo "<br> min :".$min;
        for ($x = $min; $x <= $max; $x++) {
            ?>
    
    <li <?php 
            if ($x == $halaman) {
                ?>
class="active"<?php 
            }
            ?>
>
        <a onclick="$('#<?php 
            echo $loc;
            ?>
').load('<?php 
            echo _SPPATH;
            ?>
PageWeb/search?loc=<?php 
            echo $loc;
            ?>
&s=<?php 
            echo $s;
            ?>
&p=<?php 
            echo $x;
            ?>
');" >
        <?php 
            echo $x;
            ?>
        </a>
    </li>
    <?php 
        }
        ?>
    
    <?php 
        if ($jml > $begin + $limit) {
            ?>
    <li>
        <a onclick="$('#<?php 
            echo $loc;
            ?>
').load('<?php 
            echo _SPPATH;
            ?>
PageWeb/search?loc=<?php 
            echo $loc;
            ?>
&s=<?php 
            echo $s;
            ?>
&p=<?php 
            echo $halaman + 1;
            ?>
');" >
            <span aria-hidden="true">&raquo;</span><span class="sr-only">Next</span>
        </a>
    </li>
    <?php 
        }
        ?>
  </ul>
</nav>
       <!-- <h4><?php 
        echo $jml;
        ?>
 results in <?php 
        echo $jmlpage;
        ?>
 pages</h4>  -->

    <?php 
    }
					<tr>
						<td width="52%">Waktu mulai</td>
						<td>: <?php 
if (isset($data['waktu'])) {
    echo indonesian_date($data['waktu']->time_start, 'H:i');
} else {
    echo "-";
}
?>
</td>
					</tr>
					<tr>
						<td>Waktu berakhir</td>
						<td>:  <?php 
if (isset($data['waktu'])) {
    echo indonesian_date($data['waktu']->time_end, 'H:i');
} else {
    echo "-";
}
?>
</td>
					</tr>
					<tr>
						<td>Masa Ujian</td>
						<td>: <?php 
if (isset($data['ujian'])) {
    echo $data['ujian']->durasi_ujian;
}
?>
 Menit</td>
					</tr>