示例#1
0
function viewArticle()
{
    if (!isset($_GET["articleId"]) || !$_GET["articleId"]) {
        homepage();
        return;
    }
    $results = array();
    $results['article'] = Article::getById((int) $_GET["articleId"]);
    $results['pageTitle'] = $results['article']->title . " | Widget News";
    require TEMPLATE_PATH . "/viewArticle.php";
}
示例#2
0
function viewArticle()
{
    if (!isset($_GET["articleId"]) || !$_GET["articleId"]) {
        homepage();
        return;
    }
    $results = array();
    $results['article'] = Article::getById((int) $_GET["articleId"]);
    $results['pageTitle'] = $results['article']->title;
    require "templates/viewArticle.php";
}
示例#3
0
function viewArticle()
{
    if (!isset($_GET["articleId"]) || !$_GET["articleId"]) {
        homepage();
        return;
    }
    $results = array();
    $results['article'] = Article::getById((int) $_GET["articleId"]);
    $results['category'] = Category::getById($results['article']->categoryId);
    $results['pageTitle'] = $results['article']->title . " | SystemBolaget";
    require TEMPLATE_PATH . "/viewArticle.php";
}
示例#4
0
文件: index.php 项目: neequole/sp2
function viewBlog()
{
    if (!isset($_GET["blogId"]) || !$_GET["blogId"]) {
        homepage();
        return;
    }
    $data = Page::getPageByTitle($_GET['action']);
    //body content
    echo "<div id='output'>";
    if ($data) {
        if ($data->page_protection == '1' && !isset($_SESSION['name'])) {
            echo "Please log-in to view this page.";
        } else {
            if ($data->page_status == 'draft') {
                echo "This page is not yet published. Contact the site admin.";
            } else {
                //show body and blog
                echo "<p>" . $data->page_body . "</p>";
                $results = array();
                $results['blog'] = Blog::getBlogById($_GET["blogId"]);
                $results['pageTitle'] = $results['blog']->title . " | Widget News";
                $row = $results['blog'];
                echo "<input type='hidden' value='" . $row->id . "' id='hBlogId'/>";
                echo '<h1 class="headSection">' . $row->title . '</h1><p class="smallText">' . $row->publicationDate . '</p><p>' . $row->content . '</p>';
                echo '<p style="font-weight:bold;">Share this!</p><a href="#"><img src="include/images/fb.png"/></a><a href="#"><img src="include/images/twit.png"/></a><a href="#"><img src="include/images/rss2.png"/></a><a href="#"><img src="include/images/google.png"/></a><a href="#"><img src="include/images/delicious.png"/></a><a href="#"><img src="include/images/stumbleupon.png"/></a><a href="#"><img src="include/images/digg.png"/></a><hr/>';
                echo '<div id="commentSection"><p class="smallText">Leave a comment...</p><textarea id="comment"  placeholder="Put your comment here" required maxlength="1000" style="height: 3em; width:90%; display: block;margin-left: auto;margin-right: auto;"></textarea><input type="button" id="submitComment" value="Post!" title="' . $_GET["blogId"] . '"/></div>';
                //existing comments
                getComment();
                //end of comment
            }
        }
    }
    echo "</div>";
    //end of body content
    //sidebar
    echo "<div id='sidebar'>";
    if ($data) {
        echo "<p>" . $data->page_sidebar . "</p>";
    }
    echo "</div>";
    //end of sidebar
}
示例#5
0
function viewArticle()
{
    if (!isset($_GET["articleId"]) || !$_GET["articleId"]) {
        /*what this does with ! is interesting. As you know, ! is a way to say NOT. != means not equal, !isset means not set, and so on. || is an OR operator. 
          So this line says that if $_GET["articleid"] isn't set to anything (no value was passed to the GET), OR if $_GET["articleID] equals 0 (boolean FALSE), execute the next few lines. 
           If either of those are true, it executes the next lines */
        homepage();
        return;
        /*so this block says that if there is no articleID passed by GET, or if the ID does not correspond to an existing article, go to the homepage and then return. 
          return is different from break because rather than exiting a conditional tree it exits the current method (function, constuctor, conditional, switch, anything really.). */
    }
    $results = array();
    /*same as line 22. I'm keeping the name the same so my HTML templates can just all pull from their respective $results array 
      (viewArticle.php will pull from the $results generated by the viewArticle() function, same for homepage() and archive() ) */
    $results['article'] = Article::getById((int) $_GET["articleId"]);
    /*this sets the article keyh equal to the article found by getById() when I pass it an integer version of $_GET["articleId"].
      While the user isn't actually inputting text to execute this GET, just clikcing on a link that modifies the url to have .php?id=whatever, someone could still use XSS to mess with my stuff. Hence (int) */
    $results['pageTitle'] = $results['article']->title . " | The Blag";
    /*unlike archive(), the pageTitle here will vary depending on what article it is that the user is viewing. 
      Therefore, the page title should vary as well, whcih it can easily do by grabbing the title out of the associative array that is an article in the database  (key/value pairs in the form of rows (values) and columns (keys) ) */
    require TEMPLATE_PATH . "/viewArticle.php";
    #I'mma need a template to display the article in HTML form, so my code should denote that by requiring it. Also, this is a cool little example of concatenation (the . operator).
}
示例#6
0
session_start();
//get action var: action|''
$action = isset($_POST['action']) ? $_POST['action'] : "";
//controls what to show in the front page
switch ($action) {
    case 'addComment':
        addComment();
        break;
    case 'deleteComment':
        deleteComment();
        break;
    case 'editComment':
        editComment();
        break;
    default:
        homepage();
}
function addComment()
{
    $comment = new Comment();
    $comment->storeFormValues($_POST);
    $comment->insertComment();
}
function deleteComment()
{
    $comment = new Comment();
    $comment->deleteComment($_POST['cId']);
}
function editComment()
{
    $comment = new Comment();
示例#7
0
\t\t\t<tbody>
table_head;
                    echo $tr;
                    echo <<<tableend
\t\t\t</tbody>
\t\t</table>
\t\t<br><div class='alert alert-info'><a class='close' data-dismiss='alert'>&times;</a><strong>CNYS </strong>: Classes Not Yet Started </div>
\t<br>
tableend;
                } else {
                    echo "<br><br><h6 class='text-error text-center'>&emsp;No Submissions Found<br></h6>";
                }
            }
            /* Subject WIse */
        } else {
            echo "<script type='text/javascript'>show_error('Error: Invalid Syntax given..');</script>";
        }
        echo <<<b
\t</div>
\t</div>
\t<div class='span3'>
b;
        go_home();
        sidepanel();
        echo "</div></div></div>";
        display_footer();
        echo "\n</body>\n</html>";
    }
}
homepage("Attendance Portal - Home");
示例#8
0
function viewPage()
{
    if (!isset($_GET["pageId"]) || !$_GET["pageId"]) {
        homepage();
        return;
    }
    $results = array();
    $results['page'] = page::getById((int) $_GET["pageId"]);
    $results['pageTitle'] = $results['page']->title . " | " . CMS_TITLE;
    require TEMPLATE_PATH . "/viewPage.php";
}
示例#9
0
function viewUser()
{
    if (!isset(Route::getCurrentRoute()->values["userId"]) || !Route::getCurrentRoute()->values["userId"]) {
        homepage();
        return;
    }
    $results = array();
    $results['user'] = User::getById((int) Route::getCurrentRoute()->values["userId"]);
    $results['pageTitle'] = 'Пользователь ' . $results['user']->username;
    require TEMPLATE_PATH . "/viewUser.php";
}
示例#10
0
            echo "<ul class='nav nav-tabs nav-stacked'>";
            for ($i = 1; $i <= $classno; $i++) {
                $branch = $globalbranch;
                $cls = $branch . $i;
                $table = $cls . '_Dates';
                $remaining = array();
                $j = 0;
                $q = mysql_query("select * from {$table} ; ") or die(mysql_error());
                while ($res = mysql_fetch_array($q)) {
                    if ($res["P1_Con"] != 'ok' or $res["P2_Con"] != 'ok' or $res["P3_Con"] != 'ok' or $res["P4_Con"] != 'ok') {
                        $remaining[$j++] = $res['Date'];
                    }
                }
                $str1 = count($remaining) != 0 ? "<i class='icon-remove pull-right text-error' style='padding-top:5px;'></i>" : "<i class='icon-ok pull-right text-success' style='padding-top:5px;'></i>";
                //echo $str1;
                echo <<<a
\t\t\t\t<li><a href="?{$branch}{$i}">{$branch}{$i}<i class="icon-chevron-right pull-left" style="padding-top:5px;"></i> {$str1} </a> </li>

a;
            }
            echo "</ul>";
            echo "</div></div></div>";
            display_footer();
            echo "\n</body>\n</html>";
        } else {
            echo "<script type='text/javascript'>document.location.href='404.php';</script>";
        }
    }
}
homepage('Attendance Portal - Confirm Attendance Deatils ');
示例#11
0
 public function home_list($row, $op = '', $page = 1, $tpl = 'index.html', $t = '', $ids = '', $fid = '', $sql = '', $return = FALSE, $if = true, $field = 'user')
 {
     $cache_id = $tpl . "_" . $op . "_" . $fid . "_" . $page;
     //页面缓存标示
     if (!$this->cache->start($cache_id)) {
         //缓存是否存在
         $dir = defined('PLUBPATH') ? PLUBPATH : '';
         $data = $data_content = $aliasname = '';
         if (empty($row['skins'])) {
             $row['skins'] = Home_Skins;
         }
         //装载模板
         $sid = defined('PLUBPATH') ? 1 : 0;
         $this->load->get_templates('home', $sid, $row['skins']);
         $template = $this->load->view($tpl, $data, true);
         //SEO标题
         $seo_title = !empty($t) ? $t : $row['nichen'] . '的个人主页';
         //SEO关键词
         $seo_keywords = str_decode(Web_Keywords);
         //SEO描述
         $seo_description = str_decode(Web_Description);
         $Mark_Text = $this->skins->topandend($template, $row['skins']);
         $Mark_Text = str_replace("{cscms:title}", $seo_title, $Mark_Text);
         $Mark_Text = str_replace("{cscms:keywords}", $seo_keywords, $Mark_Text);
         $Mark_Text = str_replace("{cscms:description}", $seo_description, $Mark_Text);
         $Mark_Text = str_replace("{cscms:fid}", $fid, $Mark_Text);
         //当前使用的fid
         //预先除了分页
         $pagenum = getpagenum($Mark_Text);
         preg_match_all('/{cscms:([\\S]+)\\s+(.*?pagesize=\\"([\\S]+)\\".*?)}([\\s\\S]+?){\\/cscms:\\1}/', $Mark_Text, $page_arr);
         if (!empty($page_arr) && !empty($page_arr[2])) {
             $fields = $page_arr[1][0];
             //前缀名
             //组装SQL数据
             $sqlstr = $this->skins->cscms_sql($page_arr[1][0], $page_arr[2][0], $page_arr[0][0], $page_arr[3][0], 'id', $ids, 0, $sql);
             $nums = $this->db->query($sqlstr)->num_rows();
             //总数量
             $Arr = homepage($sqlstr, $nums, $page_arr[3][0], $pagenum, $op, $row['id'], $row['name'], $fid, $page);
             if ($nums > 0) {
                 $sorti = 1;
                 $result_array = $this->db->query($Arr[0])->result_array();
                 foreach ($result_array as $row2) {
                     $datatmp = '';
                     $datatmp = $this->skins->cscms_skins($fields, $page_arr[0][0], $page_arr[4][0], $row2, $sorti);
                     $sorti++;
                     $data_content .= $datatmp;
                 }
             }
             $Mark_Text = page_mark($Mark_Text, $Arr);
             //分页解析
             $Mark_Text = str_replace($page_arr[0][0], $data_content, $Mark_Text);
         }
         unset($page_arr);
         $Mark_Text = $this->skins->cscms_common($Mark_Text, $row['skins']);
         $Mark_Text = $this->skins->csskins($Mark_Text, $ids);
         $Mark_Text = $this->skins->cscms_skins('user', $Mark_Text, $Mark_Text, $row);
         //解析当前数据标签
         $Mark_Text = $this->skins->template_parse($Mark_Text, true, $if);
         if ($return == FALSE) {
             echo $Mark_Text;
             $this->cache->end();
             //写入缓存
         } else {
             return $Mark_Text;
         }
     }
 }
示例#12
0
\t\t</tr>
</table>
tableend;
                if ($row['Position'] == "BA") {
                    echo <<<a
\t\t\t<form action='print.php' method='post' name='abc'>
\t\t\t<input type='hidden' name='Title1' value="{$branch} {$class} - Weekly Report">
\t\t\t<input type='hidden' name='Table1' value='{$html}'>
\t\t<center><button type="submit" class="btn btn-primary"><i class='icon-download-alt'></i>&nbsp;&nbsp;Save as PDF</button></center>
\t\t\t</form>
a;
                    echo <<<b
\t\t\t<form action='excel.php' method='post' name='abc'>
\t\t\t<input type='hidden' name='Title1' value="{$branch} {$class} - Weekly Report">
\t\t\t<input type='hidden' name="sheet" value='{$html}'>
\t\t<center><button type="submit" class="btn btn-primary"><i class='icon-download-alt'></i>&nbsp;&nbsp;Save as Excel Sheet</button></center>
\t\t\t</form>
b;
                }
                echo <<<tableend
</div>
</div>               
tableend;
            }
        }
        /* End of Weekly Period Wise Attendance*/
        echo '</div></body></html>';
    }
}
homepage("Attendance Portal - Weekly Report");
示例#13
0
function viewStore()
{
    if (!isset($_GET["storeId"]) || !$_GET["storeId"]) {
        homepage();
        return;
    }
    $results = array();
    $results['stores'] = Stores::getById((int) $_GET['storeId']);
    $results['pageTitle'] = $results['stores']->Address1 . " | SystemBolaget";
    require TEMPLATE_PATH . "/viewStore.php";
}