Ejemplo n.º 1
0
 */
//include 'includes/constants.php';
require_once 'includes/constants.php';
require_once 'includes/form.php';
?>

<!doctype html>
<html lang="en">
<head>
     <meta charset="UTF-8">
     <title>A test Form</title>
</head>
<body>

<?php 
output_form(METHOD, TARGET_PAGE);
?>

<br>
<pre>
     <?php 
print_r(MY_FRUITS);
echo urlencode(json_encode(MY_FRUITS));
?>
</pre>
<a href="<?php 
echo TARGET_PAGE . '?' . USER_INPUT_KEY . '=' . urlencode(json_encode(MY_FRUITS));
?>
 ">Click Here</a>
</body>
</html>
Ejemplo n.º 2
0
 * Date: 11/4/2015
 * Time: 1:36 AM
 */
require_once 'includes/poker_constants.php';
require_once 'includes/poker_code.php';
$deck = make_deck();
$hand = deal($deck);
?>

<!doctype html>
<html lang="en">
<head>
     <meta charset="UTF-8">
     <title>Video Poker</title>
     <link rel="stylesheet" type="text/css" href="includes/poker.css.php">
     <script src="includes/poker.js.php"></script>
</head>
<body onload="javascript:init();">

     <div id="spacer"></div>

     <?php 
show_content($hand);
?>
     <?php 
output_form($hand, $deck);
?>

</body>
</html>
 function one_cell($miniCal, $datenum, $show_month, $cellform, $indent = "")
 {
     //If $show_month='1' then the first date will be preceded by the month,
     //  regardless of which day it is (typically used for the first row of
     //  dates displayed)  (ie. February 27  28  March 1  2  3  4  5)
     switch ($cellform) {
         case 'write_javascript':
             $dbDate = date("Y-m-d", $datenum);
             $day31 = date("j", $datenum);
             $month = '';
             //($day31==1 or $show_month!="") ? date("M ",$datenum): "";
             $eventIndexes = $this->getTodaysEvents($miniCal, $datenum);
             $numEventsToday = count($eventIndexes);
             switch ($numEventsToday) {
                 case 0:
                     $colorclass = "";
                     $title = "";
                     $id = "";
                     break;
                 case 1:
                     $colorclass = "background-color:green";
                     //"events_one";
                     $index = $eventIndexes[0];
                     $time = $miniCal->occurrence[$index]['timestr'];
                     //$output = "events[$index]: " . print_r($miniCal->occurrence[$index],true);
                     if ($time < 0 or $time > 24) {
                         $time = '';
                     } else {
                         $timestamp = strtotime($time);
                         $minutes = date("i", $timestamp);
                         $time = $minutes > 0 ? date("g:ia ", $timestamp) : date("ga ", $timestamp);
                     }
                     $title = $time . $miniCal->title2disp[$index] . "\n" . $miniCal->occurrence[$index]['css_class'] . "\n";
                     $id = $miniCal->occurrence[$index]['id'];
                     break;
                 default:
                     $colorclass = "background-color:blue";
                     //events_multi";
                     $index = $eventIndexes[0];
                     $title = "Sorry, there are {$numEventsToday} events on this day, and " . "I do not know how to deal with the same event multiple times per day." . " You will have to use the main CalUpdate page.";
                     $id = $miniCal->occurrence[$index]['id'];
                     //$id         = "";
                     break;
             }
             $output = "{$indent}  <TD id='d{$dbDate}" . "_{$id}' width='14%' " . "onclick='updateCell(this,\"{$dbDate}\")' style='{$colorclass}' " . "title='{$title}'>{$month}{$day31}</td>\n";
             $datenum += 86400;
             //Next Day
             break;
         default:
             $output = "{$indent}  <td>";
             $output .= output_form(array('form' => $cellform));
             $output .= "{$indent}  </td>";
             //echo "<!--output_form is:\n$output-->";
             break;
     }
     return $output;
 }
Ejemplo n.º 4
0
echo CMTX_DESC_LAYOUT_THEME_2;
?>

<p />

<div id="parts" class="sortable">

	<?php 
$elements = explode(',', cmtx_setting('sort_order_parts'));
foreach ($elements as $element) {
    switch ($element) {
        case '1':
            output_comments();
            break;
        case '2':
            output_form();
            break;
    }
}
?>
	
	<?php 
function output_comments()
{
    ?>
 <div id="part_1" class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span><?php 
    echo CMTX_FIELD_VALUE_COMMENTS;
    ?>
</div> <?php 
}
?>
Ejemplo n.º 5
0
if ($action = $_GET["action"]) {
    $fname = $_GET["file"];
    debug_msg("processing {$fname}");
    if ($action == "Overwrite pre-existing tutorial") {
        debug_msg("overwrite {$fname}");
        overwrite_old_file($fname);
    }
    remove_temp_file($fname);
}
$files = getDirectoryList("../users/{$username}/temp");
$num = count($files);
if ($num > 0) {
    echo "{$num} uploaded tutorial(s) already exist. What would you like to do?";
    echo "<ul>";
    foreach ($files as $file) {
        output_form($file);
    }
    echo "</ul>";
} else {
    header("Location: file_manager.php?msg=All files processed.");
}
function getDirectoryList($directory)
{
    // create an array to hold directory list
    $results = array();
    // create a handler for the directory
    $handler = opendir($directory);
    // open directory and walk through the filenames
    while ($file = readdir($handler)) {
        // if file isn't this directory or its parent, add it to the results
        if ($file != "." && $file != "..") {
		margin: 0 15px 0 15px;
	}
	
	p.footer{
		text-align: right;
		font-size: 11px;
		border-top: 1px solid #D0D0D0;
		line-height: 32px;
		padding: 0 10px 0 10px;
		margin: 20px 0 0 0;
	}
	
	#container{
		margin: 10px;
		border: 1px solid #D0D0D0;
		-webkit-box-shadow: 0 0 8px #D0D0D0;
	}
	</style>
</head>
<body>

<div id="container">
	<h1>Welcome to CodeIgniter!</h1>
        
        <?php 
echo output_form(array('fields' => $form));
?>
</div>

</body>
</html>