function _theme_header($title = NULL, $inc_menu = TRUE) { global $PHP_SELF; global $HTTP_VARS; if (function_exists('theme_header')) { header("Cache-control: no-store"); header("Pragma: no-store"); header("Expires: 0"); if (is_site_public_access()) { $user_id = NULL; } else { $user_id = get_opendb_session_var('user_id'); } $include_menu = $inc_menu !== FALSE && $inc_menu !== 'N' ? TRUE : FALSE; if (!$include_menu && strlen($HTTP_VARS['mode']) == 0) { $HTTP_VARS['mode'] = 'no-menu'; } $pageId = basename($PHP_SELF, '.php'); return theme_header($pageId, $title, $include_menu, $HTTP_VARS['mode'], $user_id); } else { return NULL; } }
function popularity_page() { print theme_header(FALSE); print <<<EOS <h1>How do we calculate popularity?</h1> <p>In Status Time Capsule, your popularity depends on:</p> <ul> <li>average number of comments per status,</li> <li>average number of likes per status, and</li> <li>variance of these numbers among your statuses.</li> </ul> <p>Therefore, someone that consistently attracts comments and likes to all of his/her statuses may be ranked as more popular, compared to someone that has occasional popular statuses (with lots of likes and comments).</p> <p>Technically, we calculate the lower bound of Wilson score confidence interval for a Bernoulli parameter for each user of our app. Then, we rank these lower bound values and derive the top most popular users as well as the percentage of people ranked below yours. For more explanation about the algorithm, see <a href="http://www.evanmiller.org/how-not-to-sort-by-average-rating.html">the article by Evan Miller</a>.</p> EOS; print theme_links(); print theme_footer(); // Ugly error suppression @log_insert('popularity_hit'); }
<?php include 'include.php'; theme_header('Home'); theme_navbar($verified_user, $roll); ?> <div class="col-lg-8 "> <img src="img/csebuilding.jpg" alt="..." class="img-thumbnail"> <br /> <br /> <table class="table table-hover"> <thead> <tr> <td class="warning" colspan="2"><i class="fa fa-globe fa-lg"> CSE 500 Internet Programming Project</i></td> </tr> </thead> <tbody> <tr> <td><i class="fa fa-star"> Project Superviser</i></td> <td><strong>Boshir Ahmed</strong>, Assistant Professor, CSE, RUET </td> </tr> <tr> <td><i class="fa fa-tag"> Project Name</i></td> <td>Student Information Registration and Browsing System </td> </tr> <tr> <td><i class="fa fa-user"> Project Member 1</i></td> <td><a href="details.php?roll=103001">Md. Minhazul Haque</a>, Roll # 103001
$login_success = false; if ($_POST) { $roll = $_POST['roll']; $password = $_POST['password']; $result = db_select_where('students', 'roll,name', 'roll=' . $roll . ' and md5("' . $password . '")=password'); if ($result) { $token = uniqid(); setcookie("roll", $roll); setcookie("token", $token); $login_query = 'update students set token="' . $token . '" where roll=' . $roll; if (db_exec_only($login_query)) { $login_success = true; } } } theme_header('Login'); theme_navbar($login_success, $roll); ?> <div class="col-lg-5"> <h2><i class="fa fa-sign-in fa-fw"></i> Login <small>Get access student database</small></h2> <? if($login_success) login_success(); else { if($_POST) { login_error(); } theme_login_form(); } ?> </div>
<?php theme_header(); ?> <article> <header> <h1><?php post_title(); ?> </h1> </header> <?php post_content(); ?> </article> <?php theme_sidebar(); ?> <?php theme_footer();
<?php include 'include.php'; theme_header('All Students'); theme_navbar($verified_user, $roll); if($verified_user) { ?> <div class="col-lg-6"> <h2><i class="fa fa-list fa-fw"></i> All Students <small>Roll and Name of all students</small></h2> <div class="table-responsive"> <table class="table table-hover"> <thead> <tr> <th><i class="fa fa-list-ol"> Roll</i></th> <th><i class="fa fa-user"> Name</i></th> </tr> </thead> <tbody> <? foreach(db_select('students', 'roll, name') as $student) { ?> <tr> <td><a class="btn btn-link" href="details.php?roll=<? echo $student['roll']; ?>"><? echo $student['roll']; ?></a></td> <td><a class="btn btn-link" href="details.php?roll=<? echo $student['roll']; ?>"><? echo $student['name']; ?></a></td> </tr> <? } ?>
$password = $_POST['password']; if (empty($roll) or empty($name)) { $field_incomplete = true; } else { $result = db_select_where('students', 'roll', 'roll=' . $roll); if ($result) { $user_exists = true; } else { $register_query = sprintf('insert into students (roll,name,password) values (%d, "%s", md5("%s"))', $roll, $name, $password); if (db_exec_only($register_query)) { $register_success = true; } } } } theme_header('Register'); theme_navbar($verified_user, $roll); ?> <div class="col-lg-5"> <h2><i class="fa fa-plus fa-fw"></i> Register <small>Add a new student to database</small></h2> <? if($user_exists) { reg_already_exists(); theme_reg_form(); } else if($field_incomplete) { reg_field_error(); theme_reg_form(); } else if($register_success) { reg_success(); } else {
{ if($key != 'roll') $params[] = $key . '="' . mysql_escape_string($value) . '"'; } $querystr = $querystr . join(', ', $params) . ' where roll = ' . $roll; $success = db_exec_only($querystr); } $student = db_select_where('students', 'roll,name,birthdate,email,cell_number,emergency_number,hall_name,room_no,address', 'roll='.$roll); $student = $student[0]; $fields = array_keys($student); foreach(db_select('icons', 'field,icon') as $icon) $icons[$icon['field']] = $icon['icon']; theme_header('Edit Profile | ' . $student['name']); theme_navbar($verified_user, $roll); if($verified_user) { ?> <div class="col-lg-9"> <h2><i class="fa fa-user fa-fw"></i><? echo $student['name']; ?><small> Edit details</small></h2> </div> <div class="col-lg-5"> <? if($_POST) { if($success) { ?> <div class="alert alert-success"> Details successfully updated </div>
<?php include 'include.php'; $logout_success = false; $roll = $_COOKIE['roll']; if ($roll) { setcookie("roll", ""); setcookie("token", ""); $logout_query = 'update students set token="" where roll=' . $roll; $logout_success = db_exec_only($logout_query); } theme_header('Logout'); theme_navbar(); ?> <div class="col-lg-5"> <h2>Logout <small>End your session</small></h2> <? if($logout_success) logout_success(); else logout_error(); ?> </div> <? theme_footer(); db_close(); ?>
<?php include 'include.php'; $chpasswd_success = false; if ($_POST) { $password = $_POST['password']; $chpasswd_query = 'update students set password=md5("' . $password . '") where roll=' . $roll; if (db_exec_only($chpasswd_query)) { $chpasswd_success = true; } } theme_header('Change Password'); theme_navbar($verified_user, $roll); ?> <div class="col-lg-8"> </div> <h2><i class="fa fa-sign-in fa-fw"></i> Change Password <small>Change your login credential</small></h2> <div class="col-lg-5"> <? if($chpasswd_success) chpasswd_success(); else { if($_POST) { chpasswd_error(); } theme_chpasswd_form(); } ?> </div> <? theme_footer();
<?php include 'include.php'; if ($_POST) { $confirm = $_POST['confirm']; $delete_query = 'delete from students where roll=' . $roll; if (db_exec_only($delete_query)) { header('Location: index.php'); } } theme_header('Delete Account'); theme_navbar($verified_user, $roll); ?> <div class="col-lg-9"> <h2><i class="fa fa-ban fa-fw"></i>Delete Account <small>Remove your all details</small></h2> <h3>Are you sure that you want to delete your account?</h3> <? theme_delete_form(); ?> </div> <? theme_footer(); db_close(); ?>
function privacy_page() { print theme_header(FALSE); print <<<EOS <h1>Privacy Policy</h1> <p>This Privacy Policy describes how users' personal information is handled in order to engage in the services available on our application. It applies generally to web pages where this policy appears in the footer. By accepting the Privacy Policy, you express consent to our collection, storage, use and disclosure of your personal information as described in this Privacy Policy. This Privacy Policy is effective upon acceptance for new users and is otherwise effective on August 08, 2011.</p> <h2>Definitions</h2> <ol> <li>References to "Our", "We", "Us" and Status Time Capsule shall be references to Status Time Capsule.</li> <li>References to "You", "Users" and "Your" shall mean references to user(s) visiting this web site, as the context requires.</li> </ol> <h2>Information Collection</h2> <p>Browsing our websites does not require your identities to be revealed. However, under the following circumstances, you are not anonymous to us.</p> <h2>User</h2> <p>We will ask for your personal information. The personal information collected includes but not restricting to the following:</p> <ol> <li>Private information such as name and birthdate</li> <li>Contact information such as email address, mobile number and physical address</li> <li>Additional information which we may ask for if we believe the site policies are violated</li> </ol> <p>Once you log into the account, your identity will be revealed to us.</p> <h2>Information Usage</h2> <p>The primary purpose in collecting personal information is to provide the users with a smooth and customized experience.</p> <p>We will use the information collected for the following purposes</p> <ol> <li>To provide its intended services</li> <li>To resolve disputes, and troubleshoot problems and errors</li> <li>To assist in law enforcement purposes and prevent/restrict the occurrences of potentially illegal or prohibited activities</li> </ol> <h2>Disclosure of information</h2> <p>We may share information with governmental agencies or other companies assisting us in fraud prevention or investigation. We may do so when:</p> <ol> <li>permitted or required by law; or,</li> <li>trying to protect against or prevent actual or potential fraud or unauthorized transactions; or,</li> <li>investigating fraud which has already taken place.</li> </ol> <p>The information is not provided to these companies for marketing purposes.</p> <h2>Usage of Cookies</h2> <p>Cookies are small files placed in your computer hard drives. We use it to analyse our site traffic. We have also used cookies to maintain your signed in status when you login to our websites.</p> <h2>Commitment to Data Security</h2> <p>Your personally identifiable information is kept secure. Only authorized employees, agents and contractors (who have agreed to keep information secure and confidential) have access to this information. All emails and newsletters from this site allow you to opt out of further mailings.</p> <h2>Changes to the policies</h2> <p>We reserved the rights to amend this Privacy Policy at any time. Upon posting of new policies, it will take immediate effect. We may notify you should there be any major changes to the policies.</p> EOS; print theme_links(); print theme_footer(); // Ugly error suppression @log_insert('tos_hit'); }
<?php /** * Template Name: Login Page */ if (is_user_logged_in()) { $loc = home_url(); if (!empty($_REQUEST['redirect'])) { $loc = $_REQUEST['redirect']; } wp_redirect($loc); exit; } theme_header('none'); ?> <div class="ui middle aligned center aligned stackable grid" id="login-container"> <main class="five wide column"> <?php template_part($theme->content_sub_path . '/login-form', $theme->post_type); ?> </main> </div> <style type="text/css"> html { height: 100% !important; } html, body, #page-wrapper, #page-container, #main-content-grid { height: 100%; background: #EFEFEF; } #login-container {
<?php include 'include.php'; if(empty($_GET['roll'])) $_GET['roll'] = $roll; $student = db_select_where('students', 'roll,name,birthdate,email,cell_number,emergency_number,hall_name,room_no,address', 'roll='.$_GET['roll']); $student = $student[0]; $fields = array_keys($student); foreach(db_select('icons', 'field,icon') as $icon) $icons[$icon['field']] = $icon['icon']; theme_header($student['name']); theme_navbar($verified_user, $roll); if($verified_user) { ?> <div class="col-lg-9"> <h2><i class="fa fa-user fa-fw"></i><? echo $student['name']; ?> <small>Details</small></h2> </div> <div class="col-lg-8"> <div class="table-responsive"> <table class="table table-hover"> <tbody> <? foreach($fields as $key) { ?> <tr>
function index_page() { global $user; print theme_header(TRUE); // Print a welcome message // $user['name'] print <<<EOS <h1>Status Time Capsule</h1> <div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=162720610474682&xfbml=1"></script> <input type="button" value="Invite friends" class="uibutton" id="button-invite" width="110" style="width:110px;vertical-align:top;" title="Invite your friends!" /> <fb:like href="http://www.facebook.com/apps/application.php?id=233868763323548" send="true" width="605" show_faces="false" font=""></fb:like> EOS; print theme_footer(); }