Esempio n. 1
1
function getProduct($productID, $db_handle)
{
    try {
        $statement_handle = $db_handle->prepare("SELECT * FROM products WHERE productID=(:productID)");
        if (ALL_PRODUCTS == $productID) {
            $statement_handle->bindParam(':productID', ALL_PRODUCTS);
        } else {
            $statement_handle->bindParam(':productID', $productID);
        }
        $statement_handle->execute();
    } catch (PDOException $e) {
        clearAndInitErrors();
        addError($e->getMessage());
    }
    $db_handle = null;
    return $statement_handle->fetchAll();
    displayErrors();
}
Esempio n. 2
0
?>
">
                    <label for="password">Password</label>
                    <input type="password" name="password" id="password" />
                    <?php 
echo displayErrors($validationErrors, 'password');
?>
                </div>
                <div class="<?php 
echo getFieldClass($validationErrors, 'confirm_password');
?>
">
                    <label for="password">Confirm Password</label>
                    <input type="password" name="confirm_password" id="confirm_password" />
                    <?php 
echo displayErrors($validationErrors, 'confirm_password');
?>
                </div>
                <div>
                    <input type="submit" id="submit-btn"/>
                </div>
            </form>
        </div>
        <?php 
if (empty($errors)) {
    ?>
        	<p>Your username is <?php 
    echo $username . ' and your password is ' . md5($password);
    ?>
</p>
        <?php 
Esempio n. 3
0
function doStage2()
{
    if (doSystemChecks()) {
        displayWarnings();
        if (checkFields()) {
            if (checkConfigFiles()) {
                if (doInstall()) {
                    return true;
                }
            }
        }
        displayErrors();
        displayFields();
    } else {
        displayErrors();
    }
    return false;
}
Esempio n. 4
0
	<meta charset="UTF-8">
	<title>Task 04</title>
	<link href="libraries/bootstrap-3.3.6-dist/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
	<div class="container" style="width: 30%">
		<form action="" method="post" role="form">
			<div class="form-group"> </div>
			<div class="form-group <?php 
echo getFieldClass($validationErrors, 'number');
?>
">
				<label for="number" class="control-label">Number</label>
				<input type="number" id="number" name="number" class="form-control"/>
				<?php 
echo displayErrors($validationErrors, 'number', 'control-label');
?>
			</div>
			<div class="form-group">
				<label for="number-counter" class="control-label">Remaining numbers <?php 
echo $numberCounter;
?>
</label>
				<textarea name="number-counter" id="number-counter" class="form-control hidden"><?php 
echo $numberCounter;
?>
</textarea>
			</div>
			<div class="form-group">
				<input type="submit" class="btn btn-primary" value="Send number"/>
			</div>
Esempio n. 5
0
 /**
  * displayDeleteSubmit 
  * 
  * @return void
  */
 function displayDeleteSubmit()
 {
     $aid = $_GET['delete'];
     $cat = $_GET['cat'];
     $validator = new FormValidator();
     if ($this->fcmsUser->access >= 2) {
         $this->displayHeader();
         echo '
         <p class="error-alert">' . T_('You do not have permission to perform this task.') . '</p>';
         $this->fcmsBook->displayAddressList($cat);
         $this->displayFooter();
         return;
     }
     $errors = $validator->validate($_GET, $this->fcmsBook->getProfile('delete'));
     if ($errors !== true) {
         $this->displayHeader();
         displayErrors($errors);
         $this->fcmsBook->displayAddressList($cat);
         $this->displayFooter();
         return;
     }
     $sql = "SELECT a.`user`, u.`phpass`\n                FROM `fcms_address` AS a, `fcms_users` AS u\n                WHERE a.`id` = ?\n                AND a.`user` = u.`id`";
     $r = $this->fcmsDatabase->getRow($sql, $aid);
     if ($r === false) {
         $this->displayHeader();
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     $user = $r['user'];
     $pass = $r['phpass'];
     if ($r['phpass'] !== 'NONMEMBER' && $r['phpass'] !== 'PRIVATE') {
         $this->displayHeader();
         echo '
         <p class="error-alert">' . T_('You cannot delete the address of a member.') . '</p>';
         $this->fcmsBook->displayAddressList($cat);
         $this->displayFooter();
         return;
     }
     $sql = "DELETE FROM `fcms_users` \n                WHERE `id` = ?";
     if (!$this->fcmsDatabase->delete($sql, $user)) {
         $this->displayHeader();
         $this->fcmsDatabase->displayError();
         $this->displayFooter();
         return;
     }
     $sql = "DELETE FROM fcms_address \n                WHERE id = ?";
     if (!$this->fcmsDatabase->delete($sql, $aid)) {
         $this->displayHeader();
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     $this->displayAddressList();
     displayOkMessage(T_('Address Deleted Successfully.'));
     $this->displayFooter();
 }
Esempio n. 6
0
// Note: we don't check the existance of the database or its tables yet, since
// the installer can install the database if needed. Here, we just check if PHP
// was compiled with the correct database support.
$dbs = array("mysqli" => "mysqli_connect", "oci8" => "OCILogon", "oci9" => "OCILogin", "pgsql" => "pg_connect");
$dbconfig = atkconfig("db");
if (!function_exists($dbs[$dbconfig["default"]["driver"]])) {
    $errors[] = "Your PHP installation seems to be compiled without <b>" . $dbconfig["default"]["driver"] . "</b>\n                 database support.\n                 <br>Please recompile PHP with support for " . $dbconfig["default"]["driver"] . ", or, if you\n                 installed from rpm, install the php rpm for this database.\n                 <br>Alternatively, select a different database in the config.inc.php file (<b>\$config_database</b>).";
}
// If there are any errors when we reach this point, it's no use continuing because
// we don't have a correct database setup, so we can't continue setup.
if (count($errors) > 0) {
    displayErrors($errors);
    exit;
}
// Create node
$obj =& atkGetNode("setup.setup");
if ($ATK_VARS["atkaction"] == "") {
    $ATK_VARS["atkaction"] = "intro";
}
if (is_object($obj)) {
    $obj->dispatch($ATK_VARS);
} else {
    $errors[] = "Achievo will not run for a (yet) unkown reason. The install-script will dump\n                 some information below.\n                 <br>Please e-mail this entire page to bugs@achievo.org for analysis, so we might\n                 be able to help you, or fix Achievo to work with your setup.\n                 <br><br>PHP version: " . phpversion() . "\n                 <br><br>Please mention which operating system, which webserver, and\n                 which database you are using.\n                 <br>If possible, include their version numbers as well.";
    // Something went wrong, but it is uncertain what it is. To investigate these
    // kinds of issues, we force $config_debug to 'on' and ask the user politely
    // to mail us the debugoutput.
    displayErrors($errors, false);
    $config_debug = 1;
}
$output =& atkOutput::getInstance();
$output->outputFlush();
Esempio n. 7
0
 if (checkReferer() == 1) {
     // Process any FTP actions
     processActions();
     // Display content when logged in
     if ($_SESSION["loggedin"] == 1) {
         if ($ajaxRequest == 0) {
             displayFormStart();
             displayFtpActions();
             displayAjaxDivOpen();
         }
         // Display FTP folder history
         displayFtpHistory();
         // Display folder/file listing
         displayFiles();
         // Load error window
         displayErrors();
         if ($ajaxRequest == 0) {
             displayAjaxDivClose();
             displayAjaxIframe();
             displayUploadProgress();
             displayAjaxFooter();
             loadJsLangVars();
             loadAjax();
             writeHiddenDivs();
             displayFormEnd();
             //displayAjaxIframe();
             loadEditableExts();
         }
     }
     if ($ajaxRequest == 0) {
         // Include the footer
Esempio n. 8
0
		<div id="content">
			<h2 id="excerpt"><strong>Whoops!</strong> An error occured that prevented you from being able to install Tweet Nest until it is fixed.</h2>
			<?php 
    echo displayErrors($e);
    ?>
		</div>
<?php 
} else {
    ?>
		<form id="content" action="" method="post">
<?php 
    if ($e && $post) {
        ?>
			<h2 id="excerpt"><strong>Whoops!</strong> An error occured that prevented you from being able to install Tweet Nest until it is fixed.</h2>
			<?php 
        echo displayErrors($e);
        ?>
<!--
INSTALL LOG: <?php 
        var_dump($log);
        ?>
-->
<?php 
    } else {
        ?>
			<h2 id="excerpt">To <strong>install</strong> Tweet Nest on this server and <strong>customize</strong> it to your likings, please fill in the below <strong>one-page</strong> setup configuration. If you want to change any of these values, you can edit the file <code>config.php</code> at any time to do so.</h2>
<?php 
    }
    ?>
			<h2>Basic settings</h2>
			<div id="greennotice"><span></span>Green color means the value is <strong>required</strong></div>
Esempio n. 9
0
    ago.
  </p>
  
  <strong>Based on <?php 
echo number_format($total);
?>
 users.</strong>
  <br />
  
  <?php 
// If filters are applied, offer to remove them
if (isset($_GET['item']) && isset($_GET['member']) || isset($_GET['interval'])) {
    echo "<br /><a href=\"index.php?page=main\">Remove filter</a>";
}
// If we have errors to show, do so
echo displayErrors($err);
?>
  <div style="width:75em">
  <div style="float:left; display:inline;">
    <h2>Mumble version/snapshot</h2>
    <?php 
echo mkTbl($snapshot, $multiplier, $builds);
?>
    
    <h2>Operating System</h2>
    <?php 
echo mkTbl($os, $multiplier, $builds, "osver");
?>
    
    <h2>Platform</h2>
    <?php 
Esempio n. 10
0
?>
>
		<label for="password1">Password:</label>
		<input type="password" id="password1" name="password1"/>
			<?php 
echo displayErrors(getValue($errors, 'password1', []));
?>
		</div>
		<div <?php 
echo getErrorClass(getValue($errors, 'password2', []));
?>
>
		<label for="password2">Retype Password:</label>
		<input type="password" id="password2" name="password2"/>
			<?php 
echo displayErrors(getValue($errors, 'password2', []));
?>
		</div>
		<div>
		<input type="submit" />
		</div>
	</form>
	<div id="result">
		<?php 
echo "<p>Username: {$username}</p>";
?>
		<?php 
echo "<p>Encrypted password: {$password}</p>";
?>
	</div>
</body>
Esempio n. 11
0
?>
                </div>
                <div class="<?php 
echo getFieldClass($validationErrors, 'operation');
?>
">
                    <label for="operation">Select Operation</label>
                    <select name="operation" id="operation">
                        <option value="">----Select----</option>
                        <option value="+">addition</option>
                        <option value="-">subtraction</option>
                        <option value="*">multiplication</option>
                        <option value="/">division</option>
                    </select>
                    <?php 
echo displayErrors($validationErrors, 'operation');
?>
                </div>
                <div>
                    <input type="submit" value="Calculate"/>
                </div>
            </form>
        </div>
        <?php 
if (!empty($_POST) && empty($validationErrors)) {
    ?>
            <p>
                <?php 
    echo $firstInput . ' ' . $operation . ' ' . $secondInput . ' = ' . $result;
    ?>
            </p>
Esempio n. 12
0
                </select>
                <?php 
echo displayErrors($validationErrors, 'DOBDay');
?>

                <select name="DOBYear" class="<?php 
echo getFieldClass($validationErrors, 'DOBYear');
?>
">
                    <option value=""> - Year - </option>
                    <?php 
echo options($years, $year);
?>
                </select>
                <?php 
echo displayErrors($validationErrors, 'DOBYear');
?>
            </div>

            <div>
                <input type="submit">
            </div>

            <div name="result">
                <?php 
foreach ($result as $label => $value) {
    ?>
                    <p><?php 
    echo $label;
    ?>
 : <?php 
Esempio n. 13
0
echo displayErrors($validationErrors, 'secondNumber', 'control-label');
?>
			</div>
			<div class="form-group <?php 
echo getFieldClass($validationErrors, 'chooseAction');
?>
">
				<label for="choose-action" class="control-label">Choose Action</label>
				<select name="choose-action" id="choose-action" class="form-control">
					<option value="">--choose-action--</option>
					<?php 
echo options([CHOOSE_ACTION_COLLECT => 'collect', CHOOSE_ACTION_SUBTRACT => 'subtract', CHOOSE_ACTION_DIVIDE => 'divide', CHOOSE_ACTION_MULTIPLY => 'multiply'], $chooseAction);
?>
				</select>
				<?php 
echo displayErrors($validationErrors, 'chooseAction', 'control-label');
?>
			</div>
			<!--<div class="clearfix"></div>-->
			<div class="form-group">
				<input type="submit" class="btn btn-primary" value="Calculate"/>
				<!--<input type="reset" class="btn btn-success" value="Clear Form"/>-->
			</div>
			<div class="form-group">
				<label for="result" class="control-label">Result</label>
				<textarea name="result" id="result" class="form-control" cols="1" rows="1">
					<?php 
echo $result;
?>
				</textarea>
			</div>
Esempio n. 14
0
?>
">
				<?php 
echo displayErrors($validationErrors, 'secondNumber');
?>
            </span>
            <span class="<?php 
echo getFieldClass($validationErrors, 'mathSing');
?>
">
                <label for="sing">Select sing</label><select id="sing" name="mathSing">
                    <option value="">Select</option>
                    <option value="1">+</option>
                    <option value="2">-</option>
                    <option value="3">/</option>
                    <option value="4">*</option>
                </select>
				<?php 
echo displayErrors($validationErrors, 'mathSing');
?>
            </span>

            <span><button type="submit">Calc</button> </span>
        </form>
    <p><?php 
echo $print;
?>
</p>
    </body>
</html>
Esempio n. 15
0
?>
" method="post">
    <div id="form_wrap" class="container">
        <nav class="navbar-default navbar-fixed-top navbar">
        <div class="navbar-header">
        <div class="navbar-collapse collapse"><ul class="nav navbar-nav">
                <li><a href="home.php" >Home</a></li>
                <li><a href="logout.php" >Logout</a> </li>
                <li><a href="#">Refresh</a> </li>
                <li><a href="#">Link</a> </li>
        </ul></div></div>
        </nav>
        <div id="form">
            <div class="row">
                <?php 
displayErrors($error_msg);
if ($success) {
    echo '<p class="app-success">Appointment added successfully</p>';
}
?>
            </div>
            <div class="row">
                <div class="label">Patient name:</div>
                <!-- end .label -->
                <div class="input">
                    <input type="text" id="fullname" class="detail" name="patient_name"
                           value="<?php 
displayValue('patient_name');
?>
"/>
Esempio n. 16
0
?>
">
					<label for="quantity" class="control-label">Quantity</label>
					<input
						type="number"
						id="quantity"
						name="quantity"
						class="form-control"
						value="<?php 
echo htmlentities($quantity);
?>
"
						min="0"
					/>
					<span class="glyphicon glyphicon-remove form-control-feedback"></span>
					<?php 
echo displayErrors($validationErrors, 'quantity', 'control-label');
?>
				</div>

				<div class="form-group">
					<input type="submit" class="btn btn-primary"/>
				</div>

			</form>
		</div>
	</div>
</div>
</body>
</html>
Esempio n. 17
0
                <span class="<?php 
echo getFieldClass($validationErrors, 'password');
?>
">
                    <label for="password">Password</label>
                    <input type="password" name="password" id="password" />
                    <?php 
echo displayErrors($validationErrors, 'password');
?>
                </span>
                <span class="<?php 
echo getFieldClass($validationErrors, 'password');
?>
">
                    <label for="rePassword">Re Password</label>
                    <input type="password" name="rePassword" id="rePassword" />
                    <?php 
echo displayErrors($validationErrors, 'rePassword');
?>
                </span>
                <span>
                    <button type="submit">Register</button>
                </span>
            </form>
            <p><?php 
echo $print;
?>
</p>
        </div>
    </body>
</html>
Esempio n. 18
0
<?php

// Change the following parameters according to the instructions beside them
define("SITE_URL", "http://" . $_SERVER['HTTP_HOST'] . "/aurora");
// path to directory
define("SQL_USER", "aurora");
// Database username
define("SQL_PASS", "aurora");
// Database password
define("SQL_DB", "aurora_main");
// Database name
define("SQL_HOST", "127.0.0.1");
// Database host
define("SQL_PORT", "3306");
// Database port
displayErrors(FALSE);
// Display PHP errors or not.
// Language specific variables
$brush = array("AWK" => "text", "Bash" => "sh", "Brain" => "text", "C" => "c", "C++" => "cpp", "C#" => "csharp", "Java" => "java", "Java", "JavaScript" => "js", "Pascal" => "pascal", "Perl" => "perl", "PHP" => "php", "Python" => "python", "Python3" => "python", "Ruby" => "ruby", "Text" => "text");
$cmmode = "'C': 'text/x-csrc', 'C++': 'text/x-c++src', 'C#': 'text/x-csharp', 'Java': 'text/x-java', 'JavaScript': 'javascript', 'Pascal': 'text/x-pascal', 'Perl': 'text/x-perl', 'PHP': 'text/x-php', 'Python': 'text/x-python', 'Python3': 'text/x-python', 'Ruby': 'text/x-ruby'";
$valtoname = array("AWK" => "AWK", "Bash" => "Bash", "Brain" => "Brainf**k", "C" => "C", "C++" => "C++", "Java" => "Java", "C#" => "C#", "JavaScript" => "JavaScript", "Pascal" => "Pascal", "Perl" => "Perl", "PHP" => "PHP", "Python" => "Python", "Python3" => "Python3", "Ruby" => "Ruby", "Text" => "Text");
$valtoext = array("AWK" => "awk", "Bash" => "sh", "Brain" => "b", "C" => "c", "C++" => "cpp", "Java" => "java", "C#" => "cs", "JavaScript" => "js", "Pascal" => "pas", "Perl" => "pl", "PHP" => "php", "Python" => "py", "Python3" => "py", "Ruby" => "rb", "Text" => "txt");
/* 
 * 
 * NO NEED TO CHANGE THE CODE BELOW
 * 
 * 
 */
session_start();
session_set_cookie_params(0, substr(SITE_URL, strlen("http://" . $_SERVER['HTTP_HOST'])));
ini_set("session.gc_maxlifetime", 86400);
Esempio n. 19
0
			<?php 
echo displayErrors($validationErrors, 'password', 'control-label');
?>
		</div>
		<div class="form-group <?php 
echo getFieldClass($validationErrors, 'confirmPassword');
?>
">
			<label for="confirm-password" class="control-label">Confirm Password</label>
			<input type="password" id="confirm-password" name="confirm-password" class="form-control" value="<?php 
echo htmlentities($confirmPassword);
?>
"/>
			<span class="glyphicon glyphicon-remove form-control-feedback"></span>
			<?php 
echo displayErrors($validationErrors, 'confirmPassword', 'control-label');
?>
		</div>

		<div class="form-group">
			<input type="submit" class="btn btn-primary"/>
			<!--<input type="reset" class="btn btn-success" value="Clear Form"/>-->
		</div>
		<div class="form-group">
			<label for="result" class="control-label">Result</label>
			<textarea name="result" id="result" class="form-control" cols="30" rows="3">
				<?php 
echo $result;
?>
			</textarea>
		</div>
Esempio n. 20
0
">
				<?php 
echo displayErrors($validationErrors, 'first_name');
?>
        </span>
        <span class="<?php 
echo getFieldClass($validationErrors, 'last_name');
?>
">
            <label for="first-name">Last Name:</label>
            <input type="text" id="last_name" placeholder="John" name="last_name" value="<?php 
echo htmlentities("{$lastName}");
?>
" ">
				<?php 
echo displayErrors($validationErrors, 'last_name');
?>
        </span>
    <span class="select">
            <label>Birth date:</label>
        <span class="<?php 
echo getFieldClass($validationErrors, 'birthMount');
?>
">
            <select name="birthMount">
                <option value=""> Select </option>
                <?php 
echo options([JANUARY => 'JANUARY', FEBRUARY => 'FEBRUARY', MARCH => 'MARCH', APRIL => 'APRIL'], $birth_mount);
?>
            </select>
        </span>
Esempio n. 21
0
function drawPageTitle($title, $message = null, $message_type = '')
{
    echo '<div class="HeaderPageTitle">' . $title . '</div>';
    echo '<div class="Content">';
    if ($message != null) {
        if ($message_type == '') {
            $message_type = 'error';
        }
        if (strtolower($message_type) == 'error') {
            displayErrors($message);
        } elseif (strtolower($message_type) == 'system') {
            displayMessage($message);
        } elseif (strtolower($message_type) == 'tip') {
            displayTip($message);
        } else {
            displayInfo($message);
        }
    }
}
Esempio n. 22
0
 /**
  * displayCreateUserFormSubmit 
  * 
  * @return void
  */
 function displayCreateUserFormSubmit()
 {
     $type = $_POST['type'];
     $id = (int) $_POST['id'];
     $validator = new FormValidator();
     $errors = $validator->validate($_POST, $this->fcmsFamilyTree->getProfile('create'));
     if ($errors !== true) {
         $this->displayHeader();
         displayErrors($errors);
         $this->displayFooter();
         return;
     }
     $uniq = uniqid("");
     // birthday
     list($bYear, $bMonth, $bDay) = formatYMD($_POST['byear'], $_POST['bmonth'], $_POST['bday']);
     // death
     list($dYear, $dMonth, $dDay) = formatYMD($_POST['dyear'], $_POST['dmonth'], $_POST['dday']);
     $fname = strip_tags($_POST['fname']);
     $mname = strip_tags($_POST['mname']);
     $lname = strip_tags($_POST['lname']);
     $sex = $_POST['sex'];
     $maiden = isset($_POST['maiden']) ? strip_tags($_POST['maiden']) : '';
     // Insert new user
     $sql = "INSERT INTO `fcms_users`\n                (\n                    `access`, `joindate`, `fname`, `mname`, `lname`, `maiden`, `sex`, `dob_year`, `dob_month`, `dob_day`,\n                    `dod_year`, `dod_month`, `dod_day`, `username`, `phpass`, `activated`\n                )\n                VALUES (10, NOW(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1)";
     $params = array($fname, $mname, $lname, $maiden, $sex, $bYear, $bMonth, $bDay, $dYear, $dMonth, $dDay, 'NONMEMBER-' . $uniq, 'NONMEMBER');
     $lastId = $this->fcmsDatabase->insert($sql, $params);
     if ($lastId === false) {
         $this->displayHeader();
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     // Create empty address
     $sql = "INSERT INTO `fcms_address`\n                    (`user`, `created_id`, `created`, `updated_id`, `updated`) \n                VALUES \n                    (?, ?, NOW(), ?, NOW())";
     $params = array($lastId, $this->fcmsUser->id, $this->fcmsUser->id);
     if (!$this->fcmsDatabase->insert($sql, $params)) {
         $this->displayHeader();
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     // Create empty settings
     $sql = "INSERT INTO `fcms_user_settings` (`user`) \n                VALUES (?)";
     if (!$this->fcmsDatabase->insert($sql, array($lastId))) {
         $this->displayHeader();
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     // Add this new user as a relationship
     switch ($type) {
         case 'father':
         case 'mother':
             $worked = $this->fcmsFamilyTree->addParent(array('id' => $lastId), $id);
             break;
         case 'brother':
         case 'sister':
             $worked = $this->fcmsFamilyTree->addSibling($id, $lastId, $_POST['parent']);
             break;
         case 'spouse':
             $children = isset($_POST['child']) ? $_POST['child'] : array();
             $worked = $this->fcmsFamilyTree->addSpouse(array('id' => $id), array('id' => $lastId), $children);
             break;
         case 'child':
             $parent2 = array();
             if (isset($_POST['other-parent'])) {
                 $parent2['id'] = $_POST['other-parent'];
             }
             $worked = $this->fcmsFamilyTree->addChildren(array($lastId), array('id' => $id), $parent2);
             break;
     }
     if ($worked === false) {
         $this->displayHeader();
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     $_SESSION['ok'] = 1;
     header("Location: familytree.php?view=" . $this->fcmsFamilyTree->currentTreeUserId);
 }
Esempio n. 23
0
<?php

// Change the following parameters according to the instructions beside them
define("SITE_URL", "http://" . $_SERVER['HTTP_HOST']);
// patth to directory
define("SQL_USER", "hackbase");
// Database username
define("SQL_PASS", "nonopapaji");
// Database password
define("SQL_DB", "hackbase");
// Database name
define("SQL_HOST", "127.0.0.1");
// Database host
define("SQL_PORT", "3306");
// Database port
displayErrors(TRUE);
// Display PHP errors or not.
/*
 *
 * NO NEED TO CHANGE THE CODE BELOW
 *
 *
 */
ini_set("session.gc_maxlifetime", 86400);
function displayErrors($option = true)
{
    if ($option) {
        error_reporting(E_ALL | E_STRICT);
        ini_set('display_errors', '1');
    } else {
        error_reporting(0);
Esempio n. 24
0
</p>
    <form id="checkDate" action="" method="post" class="form-group">
        <label for="day">Day</label>
        <input id="day" type="number" name="day" class="form-control" value="<?php 
echo $day;
?>
">
        <?php 
echo displayErrors($errors, 'day');
?>
        <label for="month">month</label>
        <input id="month" type="number" name="month" class="form-control" value="<?php 
echo $month;
?>
">
        <?php 
echo displayErrors($errors, 'month');
?>
        <label for="year">year</label>
        <input id="year" type="number" name="year" class="form-control" value="<?php 
echo $year;
?>
">
        <?php 
echo displayErrors($errors, 'year');
?>
        <button type="submit" class="btn-default btn btn-lg">Check</button>
    </form>
</main>
</body>
</html>
Esempio n. 25
0
">

							<input type="text" class="hidden" name="search" value="<?php 
echo $search;
?>
">

							<input type="text" class="hidden" name="counter" value="<?php 
echo $counterMistakes;
?>
">

							<input type="text" id="character" name="character" class="form-control" placeholder="Enter character" "/>

							<?php 
echo displayErrors($validationErrors, 'character', 'control-label');
?>
						</div>

						<div class="form-group">
							<input type="submit" class="btn btn-primary"/>
							<!--<input type="reset" class="btn btn-success" value="Clear Form"/>-->
						</div>

					</form>
				</div>
			</div>
		</div>
	</div>

Esempio n. 26
0
?>
            <label class="form-group" for="minutes">Minutes</label>
            <input type="number" class="form-control input-lg" value="<?php 
echo $minutes;
?>
" name="minutes" id="minutes">
            <?php 
echo displayErrors($errors, 'minutes');
?>
            <label class="form-group" for="seconds">Second</label>
            <input type="number" class="form-control input-lg" value="<?php 
echo $seconds;
?>
" name="seconds" id="seconds">
            <?php 
echo displayErrors($errors, 'seconds');
?>
        </fieldset>
        <fieldset>
            <legend>Add date & time Interval</legend>
            <label class="form-group" for="interval_year">Interval year</label>
            <input type="number" class="form-control input-lg" value="<?php 
echo $interval_year ? $interval_year : 0;
?>
"
                   name="interval_year" id="interval_year">
            <label class="form-group" for="interval_month">Interval month</label>
            <input type="number" class="form-control input-lg" value="<?php 
echo $interval_month ? $interval_month : 0;
?>
"
require_once 'model/general/UserProfile.php';
$userProfile = UserProfilePeer::retrieveByPK(1);
$form =& $creator->create($userProfile);
//$wikipage = WikipagePeer::retrieveByPK('wiki');
//$form =& $creator->create($wikipage);
// create the needed renderer
$renderer =& patForms::createRenderer("Array");
// set the renderer
$form->setRenderer($renderer);
// use auto-validation
$form->setAutoValidate('save');
// serialize the elements
$elements = $form->renderForm();
// ERROR DISPLAY ------------------------------------------------------
if ($form->isSubmitted()) {
    displayErrors($form);
    // see patExampleGen/customFunctions.php
}
// DISPLAY FORM ------------------------------------------------------
displayForm($form, $elements);
// see patExampleGen/customFunctions.php
/**
 * Takes a patForms object, asks it if there are any validation
 * errors and displays them if need be.
 *
 * NOTE: this is just a helper method for our examples collection,
 * so that you may concentrate on the relevant parts of the examples.
 * It does in no way represent the way it should be done :)
 *
 * @access     public
 * @param      object  &$form  The patForms object to use
Esempio n. 28
0
                            <input type="password" name="reg_password_confirmation" id="password_confirmation"
                                   class="form-control input-lg" placeholder="Confirm Password">
                            <?php 
echo displayErrors($errors, 'reg_password_confirmation');
?>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-4 col-sm-3 col-md-3">
                            <span class="button-checkbox">
                                <label for="agree" class="btn">I Agree</label>
                                <input type="checkbox" name="agree" id="agree">
                            </span>
                        <?php 
echo displayErrors($errors, 'agree');
?>
                    </div>
                    <div class="col-xs-8 col-sm-9 col-md-9">
                        <p>By clicking Register, you agree to the <a href="#" data-toggle="modal"
                                                                     data-target="#t_and_c_m">
                                Terms and Conditions</a> set out by this site, including our Cookie Use.</p>
                    </div>
                </div>
                <hr class="colorgraph">
                <div class="row">
                    <div class="col-xs-12 col-sm-4 col-md-6 col-dm-offset-4 col-sm-offset-3">
                        <input type="submit" value="Register" name="register" class="btn btn-primary btn-block btn-lg"
                               tabindex="7">
                    </div>
                </div>
Esempio n. 29
0
echo checkboxesOrRadios([COLOR_RED => 'Red', COLOR_GREEN => 'Green', COLOR_BLUE => 'Blue'], $colors, 'color[]');
?>
			</div>
			<div class="<?php 
echo getFieldClass($validationErrors, 'form_of_address');
?>
">
				<label for="form_of_address">Password</label>
				<select name="form_of_address" id="">
					<option value="">--Choose Form Of Address--</option>
					<?php 
echo options([FORM_OF_ADDRESS_MR => 'Mr.', FORM_OF_ADDRESS_MRS => 'Mrs.', FORM_OF_ADDRESS_MS => 'Ms.'], $formOfAddress);
?>
				</select>
				<?php 
echo displayErrors($validationErrors, 'form_of_address');
?>
			</div>
			<div>
				<label for="text">Text</label>
				<textarea rows="" cols="" name="text" id="text"><?php 
echo htmlentities($text);
?>
</textarea>
			</div>
			<div>
				<input type="submit" />
			</div>
		
		</form>
	
Esempio n. 30
0
				<label for="temperature" class="control-label">Temperature</label>
				<input type="number" id="temperature" name="temperature" class="form-control"/>
				<?php 
echo displayErrors($validationErrors, 'temperature', 'control-label');
?>
			</div>
			<div class="form-group">
				<div class="<?php 
echo getFieldClass($validationErrors, 'inputTemperature');
?>
">
					<?php 
echo checkboxesOrRadios(['celsius' => 'Celsius', 'fahrenheit' => 'Fahrenheit'], $inputTemperature, 'input-temperature', 'radio');
?>
					<?php 
echo displayErrors($validationErrors, 'inputTemperature', 'control-label');
?>
				</div>
			</div>
			<div class="form-group">
				<input type="submit" class="btn btn-primary" value="Calculate"/>
			</div>
			<div class="form-group">
				<label for="output-temperature" class="control-label">Temperature in <?php 
echo $outputTemperature;
?>
</label>
				<textarea name="output-temperature" id="output-temperature" class="form-control" cols="30" rows="2">
					<?php 
echo $result;
?>