コード例 #1
0
ファイル: addhours.php プロジェクト: rogerapras/php_timeclock
include_php_dir("includes");
mysql_init();
document_header();
echo include_javascript_dir("js", $debug);
echo include_stylesheet_dir("stylesheets", $debug);
check_validated();
//Pre-page logic goes here:
if (isset($_POST['addhours-submit'])) {
    add_hours($_POST['user_id'], $_SESSION['user_id'], $_POST['amount'], $_POST['pp']);
}
if (isset($_GET['pp'])) {
    $pp = $_GET['pp'];
} else {
    $pp = current_payperiod();
}
open_page("Add Hours");
draw_page();
close_page();
ob_end_flush();
// Flush the buffer out to client
document_footer();
mysql_end();
function draw_page()
{
    ?>
	<div class="container">
		<?php 
    open_panel('userlist', 'User List');
    draw_userlist();
    close_panel();
    open_panel('addhours', 'Add Hours');
コード例 #2
0
echo include_javascript_dir("js",$debug);
echo include_stylesheet_dir("stylesheets",$debug);

check_validated();
//Any pre-page logic should go here!
if (isset($_POST['qual-input-submit'])){
	echo 'new qual submitted';
	$qualinfo = array();
	$qualinfo['name'] = $_POST['qual_name'];
	$qualinfo['url'] = $_POST['qual_url'];
	$qualinfo['level'] = $_POST['qual_level'];
	$qualinfo['value'] = $_POST['qual_value'];
	add_qual($qualinfo);
}

open_page("Manage Quals");	
draw_page();
close_page();
ob_end_flush(); // Flush the buffer out to client
document_footer(); mysql_end();


function draw_page() 
{	
?>
	<div class="container">
	<?php open_panel("qual_table","List of Quals", false); ?>
	<?php draw_quals_table(); ?>
	<?php close_panel(); ?>

	<?php open_panel("qual_input","Add a New Qual", false); ?>
コード例 #3
0
ファイル: urls.php プロジェクト: salahbj/smoothoperator
 function open_page($url, $f = 1, $c = 2, $r = 0, $a = 0, $cf = 0, $pd = "")
 {
     global $oldheader;
     $url = str_replace("http://", "", $url);
     if (preg_match("#/#", "{$url}")) {
         $page = $url;
         $url = @explode("/", $url);
         $url = $url[0];
         $page = str_replace($url, "", $page);
         if (!$page || $page == "") {
             $page = "/";
         }
         $ip = gethostbyname($url);
     } else {
         $ip = gethostbyname($url);
         $page = "/";
     }
     $open = fsockopen($ip, 80, $errno, $errstr, 60);
     if ($pd) {
         $send = "POST {$page} HTTP/1.0\r\n";
     } else {
         $send = "GET {$page} HTTP/1.0\r\n";
     }
     $send .= "Host: {$url}\r\n";
     if ($r) {
         $send .= "Referer: {$r}\r\n";
     } else {
         if ($_SERVER['HTTP_REFERER']) {
             $send .= "Referer: {$_SERVER['HTTP_REFERER']}\r\n";
         }
     }
     if ($cf) {
         if (@file_exists($cf)) {
             $cookie = urldecode(@file_get_contents($cf));
             if ($cookie) {
                 $send .= "Cookie: {$cookie}\r\n";
                 $add = @fopen($cf, 'w');
                 fwrite($add, "");
                 fclose($add);
             }
         }
     }
     $send .= "Accept-Language: en-us, en;q=0.50\r\n";
     if ($a) {
         $send .= "User-Agent: {$a}\r\n";
     } else {
         $send .= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n";
     }
     if ($pd) {
         $send .= "Content-Type: application/x-www-form-urlencoded\r\n";
         $send .= "Content-Length: " . strlen($pd) . "\r\n\r\n";
         $send .= $pd;
     } else {
         $send .= "Connection: Close\r\n\r\n";
     }
     fputs($open, $send);
     while (!feof($open)) {
         $return .= fgets($open, 4096);
     }
     fclose($open);
     $return = @explode("\r\n\r\n", $return, 2);
     $header = $return[0];
     if ($cf) {
         if (preg_match("/Set\\-Cookie\\: /i", "{$header}")) {
             $cookie = @explode("Set-Cookie: ", $header, 2);
             $cookie = $cookie[1];
             $cookie = explode("\r", $cookie);
             $cookie = $cookie[0];
             $cookie = str_replace("path=/", "", $cookie[0]);
             $add = @fopen($cf, 'a');
             fwrite($add, $cookie, strlen($read));
             fclose($add);
         }
     }
     if ($oldheader) {
         $header = "{$oldheader}<br /><br />\n{$header}";
     }
     $header = str_replace("\n", "<br />", $header);
     if ($return[1]) {
         $body = $return[1];
     } else {
         $body = "";
     }
     if ($c === 2) {
         if ($body) {
             $return = $body;
         } else {
             $return = $header;
         }
     }
     if ($c === 1) {
         $return = $header;
     }
     if ($c === 3) {
         $return = "{$header}{$body}";
     }
     if ($f) {
         if (preg_match("/Location\\:/", "{$header}")) {
             $url = @explode("Location: ", $header);
             $url = $url[1];
             $url = @explode("\r", $url);
             $url = $url[0];
             $oldheader = str_replace("\r\n\r\n", "", $header);
             $l = "&#76&#111&#99&#97&#116&#105&#111&#110&#58";
             $oldheader = str_replace("Location:", $l, $oldheader);
             return open_page($url, $f, $c, $r, $a, $cf, $pd);
         } else {
             return $return;
         }
     } else {
         return $return;
     }
 }
コード例 #4
0
mysql_init();

document_header();
echo include_javascript_dir("js",$debug);
echo include_stylesheet_dir("stylesheets",$debug);

check_validated();
//Any pre-page logic should go here!

if (isset($_POST['teamchange-submit']))
	add_to_team($_POST['user_id'],$_POST['tl_id']);

if (isset($_POST['teamremove-submit']))
	remove_from_team($_POST['user_id']);

open_page("Manage Teams");	
draw_page();
close_page();
ob_end_flush(); // Flush the buffer out to client
document_footer(); mysql_end();


function draw_page() 
{	
?>
	<div class="container">

		<?php open_panel("teamlist", "Teams", false) ?>
		<div class="row">
		<!-- LIST OF TEAMS AND MEMBERS -->
		<?php
コード例 #5
0
ファイル: quals.php プロジェクト: rogerapras/php_timeclock
<?php

ob_start();
// Output buffering - allows header rewrites to happen at anytime before flushing the buffer
session_start();
require_once "incdir.php.inc";
require_once "config.php";
include_php_dir("includes");
mysql_init();
document_header();
echo include_javascript_dir("js", $debug);
echo include_stylesheet_dir("stylesheets", $debug);
check_validated();
//Any pre-page logic should go here!
open_page("Quals Progress");
draw_page();
close_page();
ob_end_flush();
// Flush the buffer out to client
document_footer();
mysql_end();
function draw_page()
{
    ?>
	<div class="container">
		<?php 
    open_panel('quals', 'Quals');
    draw_user_list();
    close_panel();
    ?>
	</div>
コード例 #6
0
<?php

ob_start();
// Output buffering - allows header rewrites to happen at anytime before flushing the buffer
session_start();
require_once "incdir.php.inc";
require_once "config.php";
include_php_dir("includes");
mysql_init();
document_header();
echo include_javascript_dir("js", $debug);
echo include_stylesheet_dir("stylesheets", $debug);
check_validated();
//Any pre-page logic should go here!
open_page("Timecards");
draw_page();
close_page();
ob_end_flush();
// Flush the buffer out to client
document_footer();
mysql_end();
function draw_page()
{
    ?>
	<div class="container">
		<?php 
    open_panel('userlist', 'Users');
    ?>
			<?php 
    draw_userlist();
    ?>
コード例 #7
0
ファイル: qmse.php プロジェクト: rogerapras/php_timeclock
			$resolved = ' inactive';

		$output = '<li class="qmse '.appt_type_to_classname($appt['type']).$resolved.'" id="appt-'.$appt['quest_id'].'" onclick="openEdit('.$appt['quest_id'].')">'.$appt['tt'].': '.str_replace('_',' ',ucfirst($appt['building'])).' '.$appt['room'].'</li>';
		$class = appt_type_to_classname($appt['type']);
		$event = $calendar->event()
			->condition('timestamp',$timestamp)
			->title($title)
			->output($output)
			->add_class($class);
		$calendar->attach($event);
	}

is_appointment();

if (isset($_SESSION['user_id']))
  open_page("QMSE");
else
  open_qmse();

draw_page();
close_page();
ob_end_flush(); // Flush the buffer out to client
document_footer(); mysql_end();


function draw_page() 
{	
	global $calendar
	?>
	<div class="container">
	<?php
コード例 #8
0
ファイル: admin.php プロジェクト: evmuc/mydns-ng
function db_get_known_types()
{
    global $dbname, $rr_table_name, $use_pgsql, $available_rr_types;
    global $rrtype_table_name;
    $type_values = array();
    if ($rrtype_table_name) {
        $res = sql_query("select type from {$rrtype_table_name}");
        if (!$res) {
            open_page();
            ErrSQL("Error getting available values for " . quote("type") . " column in RR table.");
        }
        while ($row = sql_fetch_row($res)) {
            $val = $row[0];
            foreach ($available_rr_types as $rr_type) {
                if (!strcasecmp($val, $rr_type)) {
                    $type_values[] = $val;
                }
            }
        }
    } elseif ($use_pgsql) {
        $res = sql_query("SELECT consrc FROM pg_constraint" . " WHERE conname LIKE '" . esc($rr_table_name) . "%'");
        if (!$res) {
            open_page();
            ErrSQL("Error getting available values for " . quote("type") . " column in RR table.");
        }
        while ($row = sql_fetch_row($res)) {
            $constraints = explode(" OR ", $row[0]);
            foreach ($constraints as $con) {
                $val = substr(strstr($con, "'"), 1);
                $val = substr($val, 0, strpos($val, "'"));
                reset($available_rr_types);
                foreach ($available_rr_types as $rr_type) {
                    if (!strcasecmp($val, $rr_type)) {
                        $type_values[] = $val;
                    }
                }
            }
        }
    } else {
        /* MySQL */
        $res = sql_query("SHOW COLUMNS FROM {$dbname}.{$rr_table_name}");
        if (!$res) {
            open_page();
            ErrSQL("Error getting available values for " . quote("type") . " column in RR table.");
        }
        while ($col = mysql_fetch_array($res)) {
            if (!strcasecmp($col['Field'], "Type")) {
                $values = explode(",", substr($col['Type'], 5));
                foreach ($values as $value) {
                    $val = substr($value, 1);
                    $val = substr($val, 0, strpos($val, "'"));
                    reset($available_rr_types);
                    foreach ($available_rr_types as $rr_type) {
                        if (!strcasecmp($val, $rr_type)) {
                            $type_values[] = $val;
                        }
                    }
                }
            }
        }
    }
    return $type_values;
}
コード例 #9
0
ファイル: modules.php プロジェクト: salahbj/smoothoperator
?>
<div id="loading2" class="thin_700px_box">
Module Repository
</div>
<div class="thin_700px_box">
    <table>
        <?php 
$url = "http://www.venturevoip.com/so_modules.php";
$f = 1;
$c = 2;
//1 for header, 2 for body, 3 for both
$r = NULL;
$a = NULL;
$cf = NULL;
$pd = NULL;
$page = open_page($url, $f, $c, $r, $a, $cf, $pd);
$line = split("\n", $page);
//print_pre($page);
?>
        <script type="text/javascript">
            if(document.all){ //IS IE 4 or 5 (or 6 beta)
                eval("document.all.loading.style.display = none");
            }
            if (document.layers) { //IS NETSCAPE 4 or below
                document.layers['loading'].display = 'none';
            }
            if (document.getElementById &&!document.all) {
                hza = document.getElementById('loading');
                hza.style.display = 'none';
            }
        </script>
コード例 #10
0
}

//If trying to update pp-length:
if (isset($_POST['pp-length-submit'])) {
	update_payperiod_length($_POST['pp-length']);
}

document_header();
echo include_javascript_dir("js",$debug);
echo include_stylesheet_dir("stylesheets",$debug);

//stupid datepicker
echo '<script src="http://eternicode.github.io/bootstrap-datepicker/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>';

check_validated();
open_page("Maintenance");
draw_page();
close_page();
ob_end_flush(); // Flush the buffer out to client
document_footer(); mysql_end();


function draw_page() 
{	

?>
	<div class="container">

		<?php 
		open_panel('payperiod-info','Payperiod Information', false);
		draw_first_payperiod_form();
コード例 #11
0
ファイル: points.php プロジェクト: rogerapras/php_timeclock
<?php

ob_start();
// Output buffering - allows header rewrites to happen at anytime before flushing the buffer
session_start();
require_once "incdir.php.inc";
require_once "config.php";
include_php_dir("includes");
mysql_init();
document_header();
echo include_javascript_dir("js", $debug);
echo include_stylesheet_dir("stylesheets", $debug);
check_validated();
//Any pre-page logic should go here!
open_page("Race for Excellence");
draw_page();
close_page();
ob_end_flush();
// Flush the buffer out to client
document_footer();
mysql_end();
function draw_page()
{
    ?>
	<div class="container">
	<?php 
    open_panel('teamlist', 'Race For Excellence', false);
    draw_team_panel();
    close_panel();
    open_panel('userlist', 'Points', false);
    draw_user_list();
コード例 #12
0
ファイル: newpage.php プロジェクト: rogerapras/php_timeclock
<?php

ob_start();
// Output buffering - allows header rewrites to happen at anytime before flushing the buffer
session_start();
require_once "incdir.php.inc";
require_once "config.php";
include_php_dir("includes");
mysql_init();
document_header();
echo include_javascript_dir("js", $debug);
echo include_stylesheet_dir("stylesheets", $debug);
check_validated();
//Any pre-page logic should go here!
open_page("newpage");
draw_page();
close_page();
ob_end_flush();
// Flush the buffer out to client
document_footer();
mysql_end();
function draw_page()
{
}
コード例 #13
0
ファイル: testpage.php プロジェクト: rogerapras/php_timeclock
<?php

//$debug=true;
ob_start();
// Output buffering - allows header rewrites to happen at anytime before flushing the buffer
session_start();
require_once "incdir.php.inc";
require_once "config.php";
include_php_dir("includes", $debug);
mysql_init();
document_header();
echo include_javascript_dir("js", $debug);
echo include_stylesheet_dir("stylesheets", $debug);
check_validated();
open_page("Main Page");
page_logic();
close_page();
ob_end_flush();
// Flush the buffer out to client
document_footer();
mysql_end();
function page_logic()
{
    ?>

<div class="container">
    <!-- insert dummy data -->

    <?php 
    /*
    $userinfo = array();
コード例 #14
0
ファイル: profile.php プロジェクト: rogerapras/php_timeclock
		if(validate_data($userinfo))
		{  // data checks out
			update_userinfo($userinfo);
			$userinfo = get_user_info();
		}
		else
		{  // data doesn't check out
			$help=true;
			
		}
	}

$userinfo = get_user_info($_SESSION['user_id']);

open_page("Profile");
draw_page();
close_page();

ob_end_flush(); // Flush the buffer out to client
document_footer(); mysql_end();


function draw_page() {
	global $userinfo;
?>
<div class="container">
	<?php open_panel('edituser','User Information', false); ?>
	<div class="form-group col-md-6">
	<?php draw_edit_form($userinfo); ?>
	</div>
コード例 #15
0
document_header();

echo include_javascript_dir("js",$debug);
echo include_stylesheet_dir("stylesheets",$debug);

if (isset($_POST['barcode']) && $_POST['barcode']!="") {
  $punch = punch($_POST['barcode']);
}

if (isset($_POST['barcode']) && $_POST['barcode']=="") {
  $punch = punch(id_to_barcode($_SESSION['user_id']));
}

if (isset($_SESSION['user_id']))
  open_page("Punchclock");
else
  open_punchclock();

page_logic();
close_page();
ob_end_flush(); // Flush the buffer out to client
document_footer(); mysql_end();
?>
<script type="text/javascript">
window.onload = function startTime()
 {
 var today=new Date();
 var h=today.getHours();
 var m=today.getMinutes();
 var s=today.getSeconds();
コード例 #16
0
ファイル: goals.php プロジェクト: rogerapras/php_timeclock
session_start();
require_once "incdir.php.inc";
require_once "config.php";
include_php_dir("includes", $debug);
mysql_init();
document_header();
echo include_javascript_dir("js", $debug);
echo include_stylesheet_dir("stylesheets", $debug);
/* I know the script for the calendar was giving you trouble, but I'm thinking, eventually, if you can make the date picker smaller, it
would be better than an element stretching the length of the container. Just a thought.*/
echo '<script src="http://eternicode.github.io/bootstrap-datepicker/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>';
check_validated();
if (isset($_POST['goal'])) {
    add_goal($_POST['goal'], $_POST['due_date']);
}
open_page("Goals");
page_logic();
close_page();
ob_end_flush();
// Flush the buffer out to client
document_footer();
mysql_end();
function page_logic()
{
    ?>
<!-- PAGE CONTAINER -->
<div class="container">
    <?php 
    open_panel("dash2_toggle", "Goals");
    ?>
      <?php 
コード例 #17
0
include_php_dir("includes", $debug);
mysql_init();
handle_ajax();
document_header();
echo include_javascript_dir("js", $debug);
echo include_stylesheet_dir("stylesheets", $debug);
check_validated();
//If a new user was submitted!
if (isset($_POST['newuser-submit'])) {
    $userinfo = array("username" => $_POST['username'], "fname" => $_POST['fname'], "lname" => $_POST['lname'], "emplid" => $_POST['emplid'], "password" => $_POST['password'], "email" => $_POST['email'], "phone" => $_POST['phone'], "address" => $_POST['address'], "pwconfirm" => $_POST['pwconfirm']);
    adduser($userinfo);
}
if (!check_app_admin()) {
    header('Location: index.php');
}
open_page("Not User Management");
draw_page();
close_page();
ob_end_flush();
// Flush the buffer out to client
document_footer();
mysql_end();
//The actual page.
function draw_page()
{
    ?>

<div class="container">

  <?php 
    open_panel("userlist", "User List", false);
コード例 #18
0
require_once("config.php");

include_php_dir("includes");

mysql_init();

document_header();
echo include_javascript_dir("js",$debug);
echo include_stylesheet_dir("stylesheets",$debug);

check_validated();
//Any pre-page logic should go here!
if (isset($_POST['submit']))
	submit_message($_POST['message']);

open_page("Messaging");	
draw_page();
close_page();
ob_end_flush(); // Flush the buffer out to client
document_footer(); mysql_end();


function draw_page() 
{	
?>
	<div class="container">
		<?php open_panel("messagebox","Messaging",false); ?>
			<?php open_panel_item("Messaging","mssg","7")?>
					<?php draw_message_box(); ?>
			<?php close_panel_item()?>
			<?php draw_message_input(); ?>