PHP Classes

File: docs/functions.php

Recommend this page to a friend!
  Classes of Temperini Mirko   APIQL   docs/functions.php   Download  
File: docs/functions.php
Role: Auxiliary script
Content type: text/plain
Description: docs function class
Class: APIQL
Define and run commands of a data query language
Author: By
Last change:
Date: 12 years ago
Size: 3,631 bytes
 

Contents

Class file image Download
<?php
include '../class/apiql.class.php';


//check the current value of 'check_func_exists' setting
$check_fn=apiql::get('check_func_exists');
if(
$check_fn == true){
   
//do not cheche if binding funciton exists
   
apiql::set('check_func_exists',false);
    }

//check the current value of 'display_errors' setting
$error_dis=apiql::get('display_errors');
if(
$error_dis == false){
   
//show all error occurred
   
apiql::set('display_errors',true);
    }

//check the current value of 'errorr_level' setting
$error_lev=apiql::get('error_level');
if(
$error_lev == false){
   
//set eorro level using built in PHP constants
   
apiql::set('error_level',E_USER_ERROR);
    }


function
config_table(){
   
?>
<table border="1" cellpadding="3">
        <tr style="background-color:#f2f2f2;font-weight:bold">
            <td>check_func_exists</td>
            <td>display_errors</td>
            <td>error_level</td>
        </tr>
        <tr>
            <td><?php echo (apiql::get('check_func_exists')==true)?'true':'false' ?></td>
            <td><?php echo (apiql::get('display_errors')==true)?'true':'false' ?></td>
            <td><?php echo apiql::get('error_level')?></td>
        </tr>
    </table>
    <?php
   
}


function
showcode($code){
    echo
'<div class="code">';
   
highlight_string('<?php'."\n".$code."\n".'?'.'>');
    echo
'</div><br />';
    }

function
showresults($data){
    echo
'<br />
    <div class="results">'
;
   
var_dump($data);
    echo
'</div><br />';
    }


function
html_header($section=''){
   
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta name="generator" content="PSPad editor, www.pspad.com" />
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>APIQL :: Examples and Documentation</title>
        <style>
        html, body {font-family:Arial;font-size:13px;margin:0 20px;padding:0 5px;}
        #header {height:50px;background:silver;font-size:46px;font-weight:bold;padding:5px;}
        #footer {height:50px;background:silver;margin: 20px 0;border-top: 2px solid #000;font-size:11px;text-align:center}
        .section {font-size:24px;margin-left: 20px;}
        table {border-collapse:collapse;}
        hr {margin:15px;}
        table.menu {margin:4px 0;width:100%}
        table.menu td{width:20%;text-align:center;vertical-align:middle;height:30px;font-size:18px;}
        .code {background-color:#f2f2f2;border:1px solid silver;padding:8px;}
        .results {border: 1px solid red; background-color:#ffcc99;padding:8px;}
        </style>
    </head>
    <body>
    <div id="header">APIQL<span class="section"><?php echo $section ?></span></div>
    <div style="border-top:2px solid #000;border-bottom:2px solid #000;">
        <table class="menu" cellpadding="4">
            <tr>
                <td><a href="index.php">HOME</a></td>
                <td><a href="base.php">BASE EXAMPLE</a></td>
                <td><a href="subqueries.php">SUBQUERIES</a></td>
                <td><a href="errors.php">ERRORS CONFIG</a></td>
                <td><a href="syntax.php">SYNTAX</a></td>
            </tr>
        </table>
    </div>
    <br /><br />
    <?php
   
}


function
html_footer(){
   
?>
<div id="footer">
       
    </div>
    </body>
</html>
    <?php
   
}
?>