Пример #1
0
function article($id, $name)
{
    $data = DB::table('tb_article')->where('category_id', $id)->where('status', '=', 1)->count();
    $article = '';
    if ($data > 0) {
        $article = "<li><a href='" . Url() . "/category/" . Convert_string::tosmall($name) . "'>" . $name . " <span class='badge'>{$data}</span></a></li>";
    }
    return $article;
}
Пример #2
0
            foreach($data as $row){
                echo "
                    <div class='row'>
                        <div class='col-xs-12 col-sm-2 text-center'>
                            <div class='entry-meta'>
                                <span id='publish_date'>".date('d M', strtotime($row->created_at))."</span>
                                <span><i class='fa fa-user'></i> <a href='#'>".$row->user."</a></span>
                                <span><i class='fa fa-clock-o'></i> <a href='#'>".date('H:i:s', strtotime($row->created_at))."</a></span>
                                <span><i class='fa fa-eye'></i><a href='#'>".$row->read." View</a></span>
                            </div>
                        </div>
                            
                        <div class='col-xs-12 col-sm-10 blog-content'>
                            <a onclick=javascript:add_view('".$row->id."','/home/addview') href='".Url()."/read/".date('Y/m/d')."/".$row->cat."/".$row->id."/".Convert_string::sluggify($row->title)."'><img class='img-responsive img-blog' src='".Url()."/assets/img/article/".$row->picture."' width='100%' alt='' />
                            <h2>".$row->title."</h2></a>
                            <h3>".Convert_string::cut($row->content)."</h3>
                            <a onclick=javascript:add_view('".$row->id."','/home/addview') class='btn btn-primary readmore' href='".Url()."/read/".date('Y/m/d')."/".$row->cat."/".$row->id."/".Convert_string::sluggify($row->title)."'>Read More <i class='fa fa-angle-right'></i></a>
                        </div>
                    </div>    
                ";
            }
        }else{
            echo "<center>There is no content in this category</center>";
        }
        echo "<center>".$data->links()."</center></div><!--/.blog-item-->
        
    </div><!--/.col-md-8-->";
    ?>
@include('user.template.tp_right')
@stop
Пример #3
0
}
echo "<li class='{$active}'><a href='" . Url() . "'>Home</a></li>";
$head_cat = DB::table('tb_category')->orderBy('name', 'asc')->where('prnt', '=', 0)->get();
foreach ($head_cat as $row) {
    //echo "<li><a href='".Url()."/category/".Convert_string::tosmall($row->name)."'>".$row->name."</a></li>";
    $active = '';
    if ($url == strtolower($row->name) || $ur2 == $row->id) {
        $active = 'active';
    }
    $head_cat_sub = DB::table('tb_category')->orderBy('name', 'asc')->where('prnt', '=', $row->id)->get();
    if (count($head_cat_sub) > 0) {
        $link = array();
        $id = array();
        foreach ($head_cat_sub as $item) {
            $link[] = strtolower($item->name);
            $id[] = $item->id;
        }
        $active = '';
        if (in_array($url, $link) || in_array($ur2, $id)) {
            $active = 'active';
        }
        echo "\n\t\t\t\t\t\t\t<li class='dropdown {$active}'>\n\t\t\t\t\t\t\t\t<a href='" . Url() . "/category/" . Convert_string::tosmall($row->name) . "' class='dropdown-toggle' data-toggle='dropdown'>" . $row->name . " <i class='fa fa-angle-down'></i></a>\n\t\t\t\t\t\t\t\t<ul class='dropdown-menu'>";
        foreach ($head_cat_sub as $item) {
            echo "<li><a href='" . Url() . "/category/" . Convert_string::tosmall($item->name) . "'>" . $item->name . "</a></li>";
        }
        echo "</ul>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t";
    } else {
        echo "<li class='{$active}'><a href='" . Url() . "/category/" . Convert_string::tosmall($row->name) . "'>" . $row->name . "</a></li>";
    }
}
echo "\n\t\t\t\t\n\t\t\t\t<!--<li class='dropdown'>\n\t\t\t\t\t<a href='#' class='dropdown-toggle' data-toggle='dropdown'>Categories <i class='fa fa-angle-down'></i></a>\n\t\t\t\t\t<ul class='dropdown-menu'>\n\t\t\t\t\t\t<li><a href='" . Url() . "'>Blog Single</a></li>\n\t\t\t\t\t\t<li><a href='pricing.html'>Pricing</a></li>\n\t\t\t\t\t\t<li><a href='404.html'>404</a></li>\n\t\t\t\t\t\t<li><a href='shortcodes.html'>Shortcodes</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li><a href='about-us.html'>Profile</a></li>\n\t\t\t\t<li><a href='services.html'>Skills</a></li>\n\t\t\t\t<li><a href='portfolio.html'>Portfolio</a></li>\n\t\t\t\t<li><a href='contact-us.html'>Contact</a></li>\n\t\t\t\t-->\n\t\t\t</ul>\n\t\t</div>\n\t</div><!--/.container-->\n</nav><!--/nav-->";
Пример #4
0
echo "\n    \n    <div class='span12'>\n        <div class='widget widget-nopad'>\n            <div class='widget-header'> <i class='icon-list-alt'></i>\n                <h3> {$title} </h3>\n                <span class='search-right'>\n                    <form method='post' action='" . url() . "/zadmin/{$ctrl}/filter'>";
$value = '';
if (isset($filter)) {
    $value = $filter;
}
echo "<input type='text' class='search-input search' placeholder='Search {$title}' name='filter' value='{$value}'/>\n                        <input type='submit' value='Search' class='btn btn-info search-btn' />\n                    </form>\n                </span>\n            </div>\n            <!-- /widget-header -->\n            <div class='widget-content'>\n                <span class='btn-area'>\n                    <a class='btn btn-success btn-margin' href='" . Url() . "/zadmin/{$ctrl}/add'  >Add</a>\n                    <a class='btn btn-danger btn-margin' onClick=javascript:confirm_table('{$ctrl}','delete') >Delete</a>\n                </span>";
if (Session::has('success')) {
    echo "\n                        <div class='alert alert-success'>\n                            <button type='button' class='close' data-dismiss='alert'>&times;</button>\n                            " . Session::get('success') . "\n                        </div>\n                    ";
}
if (Session::has('failed')) {
    echo "\n                        <div class='alert'>\n                            <button type='button' class='close' data-dismiss='alert'>&times;</button>\n                            <strong>Warning!</strong> " . Session::get('failed') . "\n                        </div>\n                    ";
}
echo "<table class='table table-striped'>\n                    <thead>\n                        <tr>\n                            <th width='50px'><input type='checkbox' id='checkall'/></th>\n                            <th>Category Name</th>\n                            <th>Title</th>\n                            <th>Content</th>\n                            <th>Created Date</th>\n                            <th>Author</th>\n                            <th>Status</th>\n                            <th>Action</th>\n                        </tr> \n                    </thead>\n                    <tbody>";
if (count($data) > 0) {
    foreach ($data as $row) {
        $status = "<a class='btn btn-success' href='" . Url() . "/zadmin/article/inactive/" . $row->id . "'>Active</a>";
        if ($row->status == 0) {
            $status = "<a class='btn btn-danger'  href='" . Url() . "/zadmin/article/active/" . $row->id . "'>Inactive</a>";
        }
        echo "\n                                    <tr>\n                                        <td><input type='checkbox' name='delete[]' class='checkboxDelete' value='" . $row->id . "'></td>\n                                        <td>" . $row->category . "</td>\n                                        <td>" . $row->title . "</td>\n                                        <td>" . Convert_string::cut($row->content, 200) . "</td>\n                                        <td>" . Convert_date::english($row->created_at) . "</td>\n                                        <td>" . $row->user . "</td>\n                                        <td>{$status}</td>\n                                        <td>\n                                            <a href='" . Url() . "/zadmin/{$ctrl}/edit/" . $row->id . "' class='btn btn-info'>Edit</a>\n                                        </td>\n                                    </tr>\n                                ";
    }
} else {
    if (isset($filter)) {
        echo "<tr><td colspan='7' style='text-align:center'>No data with keyword <b>{$filter}</b><td></tr>";
    } else {
        echo "<tr><td colspan='7' style='text-align:center'>Empty Data<td></tr>";
    }
}
echo "</tbody>\n                </table>\n                <div class='pagination-area'>\n                    " . $data->links() . "\n                </div>\n            </div>\n        </div>\n        <!-- /widget -->\n    </div>";
?>
@stop