本文整理汇总了PHP中renderPage函数的典型用法代码示例。如果您正苦于以下问题:PHP renderPage函数的具体用法?PHP renderPage怎么用?PHP renderPage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了renderPage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: throwErrorPage
function throwErrorPage($code)
{
if ($code == "404") {
$header = $_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found';
} else {
if ($code == "403") {
$header = $_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden';
} else {
$header = $_SERVER['SERVER_PROTOCOL'] . ' ' . $code;
}
}
header($header);
$errorPage = sConfig()->getVar('CONFIG/ERRORPAGES/ERROR_' . $code);
if ($errorPage && $errorPage != '') {
$request_path_string = getRequestPathString(explode('/', 'page' . $errorPage));
$request_path = getRequestPathArray($request_path_string);
$psite = $request_path[1];
if ((int) $psite > 0) {
$sinfo = sSites()->get($psite);
$siteID = (int) $psite;
} else {
$sinfo = sSites()->getByPName($psite);
$siteID = $sinfo['ID'];
}
$pageMgr = new PageMgr($siteID);
$pageID = $pageMgr->getPageIdByPname($request_path[count($request_path) - 1]);
$page = $pageMgr->getPage($pageID);
$pageInfo = $page->get();
$version = $page->getLatestVersion();
renderPage($page, $version, $pageInfo, $pageMgr, $sinfo);
} else {
echo $header;
}
die;
}
示例2: form
function form()
{
$data = initializeData($this, "Form");
$data['page_url'] = main_url() . 'leave_credits';
$leave = '';
$dp = '';
$stat = '';
$dept = '';
if (isset($_GET['id'])) {
if (!empty($_GET['id'])) {
$data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
$leave = $data['data'][0]->leave_types_id;
$dept = $this->mod->getEmpTypeOfLeaveCredit($data['data'][0]->id);
$stat = $this->mod->getStatOfLeaveCredit($data['data'][0]->id);
$dept = $dept[0]->id;
$stat = $stat[0]->id;
}
}
$sJs = 'class="form-control form-text"';
$list1 = $this->emp_types_model->getObjectList('');
$list2 = $this->status_model->getObjectList('');
$data['emptypes_list'] = genEmpTypesListUI($this, $list1, $dept);
$data['status_list'] = genStatusListUI($this, $list2, $stat);
$this->load->model('leave_types_model');
$list2 = $this->leave_types_model->getObjectList('');
$data['leave'] = generateSelectUI($this, $list2, 'leave_types_id', 'id', 'title', $leave, $sJs);
renderPage($this, $this->table . '/form', $data);
}
示例3: render
function render($storeName)
{
$data = array();
$index = select_to_array($storeName, 'SELECT DISTINCT ?o WHERE {?s a ?o}');
$content = '';
$content .= '<form method="post" action="find.php"';
$content .= '<input type="hidden" name="storeName" size="15%" value="' . $storeName . '"/> ';
$content .= '<div align="center">';
$content .= '<input type="text" name="resourceUri" size="80%" value=""/> ';
$content .= '<input type="submit" name="submit" value="Find"/>';
$content .= '</div>';
$content .= '</form>';
if (count($index) > 0) {
$content .= 'Found ' . count($index) . ' data types<p>';
$content .= '<div class="findResults">';
$content .= '<ul>';
foreach ($index as $item) {
$itemUri = $item['o']['value'];
$label = $itemUri;
$showUri = 'find.php?storeName=' . $storeName . '&resourceUri=' . urlencode($itemUri);
$content .= '<li><span class="lnkShowItem" ><a href="' . $showUri . '">' . $label . '</a></span></li>';
}
$content .= '</ul>';
$content .= '</div>';
} else {
$content .= 'No data types found<p>';
}
renderPage($storeName, null, 'Data types', $content);
}
示例4: render
function render($storeName, $message = null, $error = null)
{
$content = '';
if (!empty($message)) {
$content .= '<div align="center">';
$content .= $message;
$content .= '</div>';
}
if (!empty($error)) {
$content .= '<pre>';
$content .= $error;
$content .= '</pre>';
$content .= '<br/>';
}
$content .= '<form enctype="multipart/form-data" action="upload.php" method="post">';
$content .= '<input type="hidden" name="storeName" value="' . $storeName . '" />';
$content .= '<div align="center">';
$content .= '<br/>';
$content .= '<p><input type="file" name="uploadedfile" size="80" />';
$content .= '<br/>';
$content .= '<br/>';
$content .= '<p><input type="submit" name="submit" value="Upload"/>';
$content .= '</div>';
$content .= '</form>';
renderPage($storeName, null, 'Upload file', $content);
}
示例5: doPost
function doPost()
{
$storeName = $_POST['storeName'];
if (!empty($_POST['btnOK'])) {
$store = getStore($storeName);
$job_queue = $store->get_job_queue();
$response = $job_queue->schedule_reset_data();
$content = '';
if ($response->is_success()) {
$jobUri = $response->headers['location'];
$message = 'Scheduled reset job';
$content .= 'Reset job details<p>';
$content .= '<div class="findResults">';
$content .= '<ul>';
$content .= '<li><span class="lnkShowItem" ><a href="' . $jobUri . '">' . $jobUri . '</a></span></li>';
$content .= '</ul>';
$content .= '</div>';
} else {
$message = 'Failed to schedule reset job';
$content .= 'Response details<p>';
$content .= '<pre>';
$content .= $response->to_string();
$content .= '</pre>';
}
renderPage($storeName, null, $message, $content);
} else {
header('Location: find.php?storeName=' . $storeName . '&resourceUri=');
}
}
示例6: render
function render($storeName, $token, $from, $to, $type)
{
$content = '';
$content .= '<form method="get"';
$content .= '<input type="hidden" name="storeName" size="15%" value="' . $storeName . '"/> ';
$content .= '<div align="center">';
$content .= '<label>Start Date</label>';
$content .= '<input id="from" name="from" type="text" value="' . $from . '" maxlength="30" size="30" />';
// $content .= '<img class="ui-datepicker-trigger" src="images/datepicker.gif" alt="Pick a start date" title="Pick a start date"/>';
// $content .= '<script type="text/javascript">';
// $content .= '$(document).ready(function(){$("#from").datepicker({showOn: "button", buttonImage: "images/datepicker.gif", buttonImageOnly: true, dateFormat: "yy-mm-dd", changeMonth: true, changeYear: true});});';
// $content .= '</script>';
$content .= '<p>';
$content .= '<label>End Date</label>';
$content .= '<input id="to" name="to" type="text" value="' . $to . '" maxlength="30" size="30" />';
// $content .= '<img class="ui-datepicker-trigger" src="images/datepicker.gif" alt="Pick an end date" title="Pick an end date"/>';
// $content .= '<script type="text/javascript">';
// $content .= '$(document).ready(function(){$("#to").datepicker({showOn: "button", buttonImage: "images/datepicker.gif", buttonImageOnly: true, dateFormat: "yy-mm-dd", changeMonth: true, changeYear: true});});';
// $content .= '</script>';
$content .= '<p>';
$content .= '<input type="submit" name="submit" value="List"/>';
$content .= '<input type="submit" name="submit" value="Graph"/>';
$content .= '</div>';
$content .= '</form>';
if ($type == 'Graph') {
$content .= renderGraph($storeName, $from, $to);
} else {
$content .= renderList($storeName, $token, $from, $to);
}
renderPage($storeName, null, null, $content);
}
示例7: index
public function index()
{
//get the posted values
$username = $this->input->post("username");
$password = $this->input->post("password");
//set validations
$this->form_validation->set_rules("username", "Username", "trim|required");
$this->form_validation->set_rules("password", "Password", "trim|required");
if ($this->form_validation->run() == FALSE) {
$data = array('isLoggedIn' => FALSE);
//validation fails
renderPage('login_view', $data, '');
} else {
//validation succeeds
if ($this->input->post('btn_login') == "Login") {
//check if username and password is correct
$usr_result = $this->login_model->get_user($username, $password);
if ($usr_result > 0) {
//set the session variables
$sessiondata = array('username' => $username, 'loginuser' => TRUE);
$this->session->set_userdata($sessiondata);
$this->load->library('user_lib');
$this->user_lib->redirect();
} else {
$this->session->set_flashdata('msg', '<div class="alert alert-danger text-center">Invalid username and password!</div>');
redirect('login');
}
}
}
}
示例8: render
function render($storeName, $resourceUri)
{
$content = '';
$content .= '<form method="get" action="find.php"';
$content .= '<input type="hidden" name="storeName" size="15%" value="' . $storeName . '"/> ';
$content .= '<div align="center">';
$content .= '<input type="text" name="resourceUri" size="80%" value="' . $resourceUri . '"/> ';
$content .= '<input type="submit" name="submit" value="Find"/>';
$content .= '</div>';
$content .= '</form>';
if (!empty($resourceUri)) {
if (substr($resourceUri, 0, 5) == 'http:') {
$index = describe_to_simple_index($storeName, $resourceUri);
if (isset($index[$resourceUri])) {
$content .= 'Found as subject<p>';
$content .= '<div class="findResults">';
$content .= '<ul>';
$itemUri = $resourceUri;
$showUri = 'show.php?storeName=' . $storeName . '&resourceUri=' . urlencode($itemUri);
$content .= '<li><span class="lnkShowItem" ><a href="' . $showUri . '">' . $itemUri . '</a></span></li>';
$content .= '</ul>';
$content .= '</div>';
} else {
$content .= 'Not found as subject<p>';
}
$select = 'SELECT ?s where {?s ?p <' . $resourceUri . '>}';
$selectResults = select_to_array($storeName, $select);
if (!empty($selectResults)) {
$content .= 'Found as object<p>';
$content .= '<div class="findResults">';
$content .= '<ul>';
foreach ($selectResults as $selectResult) {
$itemUri = $selectResult['s']['value'];
$showUri = 'show.php?storeName=' . $storeName . '&resourceUri=' . urlencode($itemUri);
$content .= '<li><span class="lnkShowItem" ><a href="' . $showUri . '">' . $itemUri . '</a></span></li>';
}
$content .= '</ul>';
$content .= '</div>';
} else {
$content .= 'Not found as object<p>';
}
} else {
$results = search_to_resource_list($storeName, $resourceUri);
$content .= 'Found ' . $results->total_results . ' items in indexes<p>';
$content .= '<div class="findResults">';
$content .= '<ul>';
foreach ($results->items as $item) {
$itemUri = $item['http://purl.org/rss/1.0/link'][0];
$showUri = 'show.php?storeName=' . $storeName . '&resourceUri=' . urlencode($itemUri);
$content .= '<li><span class="lnkShowItem" ><a href="' . $showUri . '">' . $itemUri . '</a></span></li>';
}
$content .= '</ul>';
$content .= '</div>';
}
}
renderPage($storeName, null, null, $content);
}
示例9: render
function render($storeName, $resourceUri)
{
$data = array();
$index = describe_to_simple_index($storeName, $resourceUri);
if (isset($index[$resourceUri])) {
$data = $index[$resourceUri];
ksort($data);
}
$content = '';
$content .= '<form method="post"';
$content .= '<input type="hidden" name="storeName" size="15%" value="' . $storeName . '"/> ';
$content .= '<div align="center">';
$content .= '<input type="text" name="resourceUri" size="80%" value="' . $resourceUri . '"/> ';
$content .= '<input type="submit" name="submit" value="Find"/>';
$content .= '</div>';
$content .= '</form>';
if (count($data) > 0) {
$content .= '<table>';
$content .= '<thead>';
$content .= '<tr><th>actions</th><th>predicate</th><th>object</th></tr>';
$content .= '</thead>';
$content .= '<tbody>';
$content .= '<tr>';
$content .= '<td>';
$content .= '<span class="lnkDeleteTriple"><a title="delete all triples for resource" href="delete.php?storeName=' . $storeName . '&resourceUri=' . urlencode($resourceUri) . '"> </a></span>';
$content .= '<span class="lnkDeleteTriple"><a title="delete all triples for resource" href="delete.php?storeName=' . $storeName . '&resourceUri=' . urlencode($resourceUri) . '"> </a></span>';
$content .= '</td>';
$content .= '<td></td>';
$content .= '<td></td>';
$content .= '</tr>';
foreach ($data as $predicate => $objects) {
$index = 0;
foreach ($objects as $object) {
$value = $object['value'];
$type = $object['type'];
$content .= '<tr>';
$content .= '<td>';
$content .= '<span class="lnkDeleteTriple"><a title="delete triple" href="delete.php?storeName=' . $storeName . '&resourceUri=' . urlencode($resourceUri) . '&predicate=' . urlencode($predicate) . '&type=' . urlencode($type) . '&value=' . urlencode($value) . '"> </a></span>';
$content .= '<span class="lnkEditTriple"><a title="edit triple" href="edit.php?storeName=' . $storeName . '&resourceUri=' . urlencode($resourceUri) . '&predicate=' . urlencode($predicate) . '&type=' . urlencode($type) . '&value=' . urlencode($value) . '"> </a></span>';
$content .= '</td>';
$content .= '<td>' . $predicate . '</td>';
$content .= '<td>';
if ($type == 'uri') {
$content .= '<a href="?storeName=' . $storeName . '&resourceUri=' . urlencode($value) . '">' . $value . '</a>';
} else {
$content .= $value;
}
$content .= '</td>';
$content .= '</tr>' . "\n";
$index++;
}
}
$content .= '</tbody>';
$content .= '</table>';
}
renderPage($storeName, $resourceUri, null, $content);
}
示例10: render
function render($storeName)
{
$content = '';
$status = get_store_status($storeName);
$content .= '<div style="text-align: center;"><br/>';
$content .= $status;
$content .= '</div>';
renderPage($storeName, null, 'Store status', $content);
}
示例11: form
function form()
{
$data = initializeData($this, "Department Form");
$data['page_url'] = main_url() . 'departments';
if (isset($_GET['id'])) {
if (!empty($_GET['id'])) {
$data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
}
}
renderPage($this, $this->table . '/form', $data);
}
示例12: form
function form()
{
$data = initializeData($this, "Rank Form");
$data['page_url'] = main_url() . 'ranks';
if (isset($_GET['id'])) {
if (!empty($_GET['id'])) {
$data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
}
}
$sJs = 'class="form-control form-text"';
renderPage($this, $this->table . '/form', $data);
}
示例13: reports2
function reports2()
{
$data = initializeData($this, "Statistics and Reports");
$data['page_url'] = main_url() . 'employment';
$sJs = 'class="form-control form-text"';
$list1 = $this->emp_types_model->getObjectList('');
$list2 = $this->status_model->getObjectList('');
$list3 = $this->departments_model->getObjectList('');
$data['dept_list'] = genDepartmentListUI($this, $list3, '');
$data['emptypes_list'] = genEmpTypesListUI($this, $list1, '');
$data['status_list'] = genStatusListUI($this, $list2, '');
renderPage($this, $this->table . '/reports2', $data);
}
示例14: index
public function index()
{
// get the posted values
$name = $this->input->post("name");
$username = $this->input->post("username");
$password = $this->input->post("password");
// set validations
$this->form_validation->set_rules("username", "Username", "trim|required|is_unique[users.username]", array('is_unique' => 'This %s already exists.'));
$this->form_validation->set_rules("password", "Password", "trim|required");
$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required|matches[password]');
$this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]');
if ($this->form_validation->run() == FALSE) {
$data = array('isLoggedIn' => FALSE);
// validation fails
renderPage('register_view', $data, '');
} else {
// validation succeeds
if ($this->input->post('btn_login') == "Register") {
$this->db->trans_begin();
try {
$this->user->name = $this->input->post('name');
$this->user->username = $this->input->post('username');
$this->user->email = $this->input->post('email');
$this->user->password = md5($this->input->post('password'));
$token = md5($this->input->post('username') . random_string('alnum', 10) . time());
$this->user->emailToken = $token;
if (!$this->send_verified_email($this->input->post('email'), $token)) {
throw new ErrorException('Send email failed.');
}
//$register = $this->user->insert ( $this->user );
$register = false;
if (!$register) {
throw new ErrorException('Register failed.');
} else {
$this->user->assignRole('user', $register);
$this->user_id = $register;
//$this->insert_related_table ();
//$this->db->trans_commit ();
$this->session->set_flashdata('msg', '<div class="alert alert-danger text-center">Register success Bro, silahkan cek email untuk melakukan verifikasi!</div>');
$data = array('isLoggedIn' => false);
renderPage('register_success', $data, '');
}
} catch (ErrorException $e) {
$this->db->trans_rollback();
$this->session->set_flashdata('msg', '<div class="alert alert-danger text-center">' . $e->getMessage() . '</div>');
redirect('register/');
}
}
}
}
示例15: form
function form()
{
$data = initializeData($this, "Employee Types Form");
$data['page_url'] = main_url() . 'emp_types';
$da = '';
if (isset($_GET['id'])) {
if (!empty($_GET['id'])) {
$data['data'] = $this->mod->getObjectById($this->table, 'id', $_GET['id']);
$da = $data['data'][0]->time_unit;
}
}
$sJs = 'class="form-control form-text"';
$data['time_unit_list'] = form_dropdown('time_unit', array('h' => 'Hours', 'd' => 'Days'), $da, $sJs);
renderPage($this, $this->table . '/form', $data);
}