...

View Full Version : Errors, Errors and More Errors ...



lumper
04-17-2012, 05:26 PM
Hi there, I am having trouble with the code below on more than one of my pages where a "mysqli_fetch_array()" is being called. I get the following errors from MySQL:

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in D:\wamp\www\tester\admin\editPageList.php on line 70

and

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in D:\wamp\www\tester\admin\editPageList.php on line 70




<?php
require_once("Includes/db.php");
$userID = PageDB::getInstance()->get_user_id_by_name($_SESSION['user']);
$result = PageDB::getInstance()->get_pages_by_user_id($userID);
while ($row = mysqli_fetch_array($result)):
echo "<tr><td></td>";
echo "<td>" . htmlentities($row['msg_txt']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['created_date']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['idnorm_msg']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_iddisplay']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_pg_no']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_msg_txt']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_monday']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_tuesday']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_wednesday']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_thursday']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_friday']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_saturday']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_sunday']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_scheduled']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_invert']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_centre']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_foreignlang']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_bold1_2']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_bold3_4']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_bold5_6']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_bold7_8']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_pagefunc']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_pagetype']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_pagetempo']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_starttime']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_endtime']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_lastsend']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_lastmodified']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_showtime']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_showtemp']) . "&nbsp;</td>";
echo "<td>" . htmlentities($row['nm_flashing']) . "&nbsp;</td>";
$pageID = $row['id'];

?>


What am I getting wrong?

Fou-Lu
04-17-2012, 05:32 PM
What's the code for the PageDB class?
The error indicates either a query has failed, or that a result is returned that is a boolean.

lumper
04-17-2012, 07:03 PM
Hi Fou-Lu

Here is my DB.php file contents:



<?php

class PageDB extends mysqli {

// single instance of self shared among all instances
private static $instance = null;
// db connection config vars
private $user = "root";
private $pass = "";
private $dbName = "test";
private $dbHost = "localhost";
private $con = null;

//This method must be static, and must return an instance of the object if the object
//does not already exist.
public static function getInstance() {
if (!self::$instance instanceof self) {
self::$instance = new self;
}
return self::$instance;
}

// The clone and wakeup methods prevents external instantiation of copies of the Singleton class,
// thus eliminating the possibility of duplicate objects.
public function __clone() {
trigger_error('Clone is not allowed.', E_USER_ERROR);
}

public function __wakeup() {
trigger_error('Deserializing is not allowed.', E_USER_ERROR);
}

// private constructor
private function __construct() {
parent::__construct($this->dbHost, $this->user, $this->pass, $this->dbName);
if (mysqli_connect_error()) {
exit('Connect Error (' . mysqli_connect_errno() . ') '
. mysqli_connect_error());
}
parent::set_charset('utf-8');
}

public function get_user_id_by_name($name) {
$name = $this->real_escape_string($name);
$user = $this->query("SELECT id FROM users WHERE name = '" . $name . "'");

if ($user->num_rows > 0){
$row = $user->fetch_row();
return $row[0];
} else
return null;
}



public function get_pages_by_user_id($userID) {
return $this->query("SELECT id, msg_txt, created_date, nm_iddisplay, nm_pg_no, nm_msg_txt, nm_monday, nm_tuesday, nm_wednesday, nm_thursday, nm_friday, nm_saturday, nm_sunday, nm_scheduled, nm_invert, nm_centre, nm_foreignlang, nm_bold1_2, nm_bold3_4, nm_bold5_6, nm_bold7_8, nm_pagefunc, nm_pagetype, nm_pagetempo, nm_starttime, nm_endtime, nm_lastsend, nm_lastmodified, nm_showtime, nm_showtemp, nm_flashing FROM pages WHERE user_id = " . $userID);
}
public function create_user($name, $email, $organisation, $password) {
$name = $this->real_escape_string($name);
$email = $this->real_escape_string($email);
$organisation = $this->real_escape_string($organisation);
$password = $this->real_escape_string($password);
$this->query("INSERT INTO users (name, email, organisation, password) VALUES ('" . $name . "', '" . $email . "', '" . $organisation . "', '" . $password . "')");

}

public function verify_user_credentials($name, $password) {
$name = $this->real_escape_string($name);
$password = $this->real_escape_string($password);
$result = $this->query("SELECT 1 FROM users WHERE name = '" . $name . "' AND password = '" . $password . "'");
return $result->data_seek(0);
}

function capture_date_for_sql($createdDate){


}


function insert_page($userID,$message, $createdDate) {
$message = $this->real_escape_string($message);
if ($this->capture_date_for_sql($createdDate)==null){
$this->query("INSERT INTO pages (user_id, msg_txt, created_date, nm_iddisplay, nm_pg_no, nm_msg_txt, nm_monday, nm_tuesday, nm_wednesday, nm_thursday, nm_friday, nm_saturday, nm_sunday, nm_scheduled, nm_invert, nm_centre, nm_foreignlang, nm_bold1_2, nm_bold3_4, nm_bold5_6, nm_bold7_8, nm_pagefunc, nm_pagetype, nm_pagetempo, nm_starttime, nm_endtime, nm_lastsend, nm_lastmodified, nm_showtime, nm_showtemp, nm_flashing)" .
" VALUES (" . $userID . ", '" . $message . "')");
} else
$this->query("INSERT INTO pages (user_id, msg_txt, created_date,nm_iddisplay, nm_pg_no, nm_msg_txt, nm_monday, nm_tuesday, nm_wednesday, nm_thursday, nm_friday, nm_saturday, nm_sunday, nm_scheduled, nm_invert, nm_centre, nm_foreignlang, nm_bold1_2, nm_bold3_4, nm_bold5_6, nm_bold7_8, nm_pagefunc, nm_pagetype, nm_pagetempo, nm_starttime, nm_endtime, nm_lastsend, nm_lastmodified, nm_showtime, nm_showtemp, nm_flashing)" .
" VALUES (" . $userID . ", '" . $message . "', " .$createdDate . ", " . $displayid. ", " . $pgno . ", " . $messcode . ", " . $monday . ", " . $tuesday . ", " . $wednesday . ", " . $thursday . ", " . $friday . ", " . $saturday . ", " . $sunday . ", " . $scheduled . ", " . $reversed . ", " . $centered . ", " . $langs . ", " . $bold1 . ", " . $bold2 . ", " . $bold3 . ", " . $bold4 . ", " . $funct . ", " . $pgtype . ", " . $pgtempo . ", " . $starting . ", " . $ending . ", " . $lastsent . ", " . $lastmod . ", " . $showtime . ", " . $showtemp . ", " . $flashes .")");
}

public function update_page($pageID, $message, $createdDate) {
$message = $this->real_escape_string($message);
$this->query("UPDATE pages SET msg_txt = '" . $message . "', created_date =" . $createdDate . ", nm_iddisplay = " . $displayid . ", nm_pg_no = " . $pgno . ", nm_msg_txt = " . $messcode . ", nm_monday = " . $monday . ", nm_tuesday = " . $tuesday . ", nm_wednesday = " . $wednesday . ", nm_thursday = " . $thursday . ", nm_friday = " . $friday . ", nm_saturday = " . $saturday . ", nm_sunday = " . $sunday . ", nm_scheduled = " . $scheduled . ", nm_invert = " . $reversed . ", nm_centre = " . $centered . ", nm_foreignlang = " . $langs . ", nm_bold1_2 = " . $bold1 . ", nm_bold3_4 = " . $bold2 . ", nm_bold5_6 = " . $bold3 . ", nm_bold7_8 = " . $bold4 . ", nm_pagefunc = " . $funct . ", nm_pagetype = " . $pgtype . ", nm_pagetempo = " . $pgtempo . ", nm_starttime = " . $starting . ", nm_endtime = " . $ending . ", nm_lastsend = " . $lastsent . ", nm_lastmodified = " . $lastmod . ", nm_showtime = " . $showtime . ", nm_showtemp = " . $showtemp . ", nm_flashing = " . $flashes . " WHERE id =" . $pageID);
}

public function get_page_by_page_id($pageID) {
return $this->query("SELECT msg_txt, created_date, nm_iddisplay, nm_pg_no, nm_msg_txt, nm_monday, nm_tuesday, nm_wednesday, nm_thursday, nm_friday, nm_saturday, nm_sunday, nm_scheduled, nm_invert, nm_centre, nm_foreignlang, nm_bold1_2, nm_bold3_4, nm_bold5_6, nm_bold7_8, nm_pagefunc, nm_pagetype, nm_pagetempo, nm_starttime, nm_endtime, nm_lastsend, nm_lastmodified, nm_showtime, nm_showtemp, nm_flashing FROM pages WHERE id = " . $pageID);
}


public function delete_page($pageID) {
$this->query("DELETE FROM pages WHERE id = " . $pageID);
}

}

?>


Thanks for looking into this

Fou-Lu
04-17-2012, 08:24 PM
What's the value of $userID and $result?


printf("Userid: %d", $userID);
printf("Result: %s", print_r($result, true));

lumper
04-17-2012, 09:23 PM
Hi Fou-Lu, the values returned were as follows:
Userid: 1 Result:
So result returns nothing, but user id is returing the users ID number which at this point is 1

lumper
04-17-2012, 09:39 PM
I have fixed a statement that I had pasted over in my DB.php file:


public function get_pages_by_user_id($userID) {
return $this->query("SELECT id, user_id FROM pages WHERE user_id = " . $userID);
}


I have cleared all of the errors from my pages now, BUT they are not returning any values from the DB nor are they posting !!?? Ai-Karamba I have seriously donw something wrong here and just can't figure it out !:(

Fou-Lu
04-17-2012, 09:49 PM
Right after $result = PageDB::getInstance()->get_pages_by_user_id($userID); add this line:


$db = PageDB::getInstance();
printf("Error: %s (%d)" . PHP_EOL, $db->error, $db->errno);


It looks to me that the query is failing.


Wait, something changed here.
Still run the above. If it indicates no errors, check the $result->num_rows. If its 0, it simply found no matches.

lumper
04-17-2012, 10:04 PM
It returns Error: (0)
So it's not finding a match, but it has to in order to show the Page List.
Can I cross refference this statement to another table?

Wait ... I just made sure the ID was = to User ID and it wasn't, I have corrected the error and now .... Errors Galore!!!
Notice: Undefined index: msg_txt ... every one of my row entities from the echo "<td>" . htmlentities($row['msg_txt']) . "&nbsp;</td>" 's

Whare must these be indexed to? (I haven' mad any changes to my DB.php file)



Maybe I am getting my wires crossed in my database layout ...

Fou-Lu
04-17-2012, 10:48 PM
The notice is caused by the alteration you made in the query. You now only select the id and user_id, but previously you queried for id, msg_txt, created_date, nm_iddisplay, nm_pg_no, nm_msg_txt, nm_monday, nm_tuesday, nm_wednesday, nm_thursday, nm_friday, nm_saturday, nm_sunday, nm_scheduled, nm_invert, nm_centre, nm_foreignlang, nm_bold1_2, nm_bold3_4, nm_bold5_6, nm_bold7_8, nm_pagefunc, nm_pagetype, nm_pagetempo, nm_starttime, nm_endtime, nm_lastsend, nm_lastmodified, nm_showtime, nm_showtemp, nm_flashing. So most of these will no longer be available for use.

You can join tables in any way you like. Obviously it will only have meaning if it actually has referring data, but you can join on an appropriate field.

lumper
04-18-2012, 09:14 AM
Awesome ! !!!

I have that page working, it is reflecting everything from the DB in the table as needed... Now I need to fix up the input page, which has no errors, but is not posting when adding new data to the DB and is not reflecting the DB entriees in the fields when editing:




<?php
//Start session
session_start();
if (!array_key_exists("user", $_SESSION)) {
header('Location: index.php');
exit;
}
//Create a new database object
require_once("Includes/db.php");

//Retrieve the ID of the user who is trying to add a Page
$userID = PageDB::getInstance()->get_user_id_by_name($_SESSION['user']);
//Initialize $pageMessageIsEmpty
$pageMessageIsEmpty = false;


if ($_SERVER['REQUEST_METHOD'] == "POST") {

//Checks whether the a "message" field is empty
if ($_POST['message'] == "") {
$pageMessageIsEmpty = true;
}
//The "idnorm_msg" is not empty and adds the message into DB
else if ($_POST['idnorm_msg'] == "") {
PageDB::getInstance()->insert_page($userID, $_POST['message'] , $_POST['createdDate'], $_POST['displayid'] , $_POST['pgno'] , $_POST['messcode'] , $_POST['monday'] , $_POST['tuesday'] , $_POST['wednesday'] , $_POST['thursday'] , $_POST['friday'] , $_POST['saturday'] , $_POST['sunday'] , $_POST['scheduled'] , $_POST['reversed'] , $_POST['centered'] , $_POST['langs'] , $_POST['bold1'] , $_POST['bold2'] , $_POST['bold3'] , $_POST['bold4'] , $_POST['funct'] , $_POST['pgtype'] , $_POST['pgtempo'] , $_POST['starting'] , $_POST['ending'] , $_POST['lastsent'] , $_POST['lastmod'] , $_POST['showtime'] , $_POST['showtemp'] , $_POST['flashes']);
header('Location: editPageList.php');
exit;
} else if ($_POST['idnorm_msg'] != "") {
PageDB::getInstance()->update_page($_POST['id'],$_POST['idnorm_msg'], $_POST['message'] ,$_POST['createdDate'], $_POST['displayid'] , $_POST['pgno'] , $_POST['messcode'] , $_POST['monday'] , $_POST['tuesday'] , $_POST['wednesday'] , $_POST['thursday'] , $_POST['friday'] , $_POST['saturday'] , $_POST['sunday'] , $_POST['scheduled'] , $_POST['reversed'] , $_POST['centered'] , $_POST['langs'] , $_POST['bold1'] , $_POST['bold2'] , $_POST['bold3'] , $_POST['bold4'] , $_POST['funct'] , $_POST['pgtype'] , $_POST['pgtempo'] , $_POST['starting'] , $_POST['ending'] , $_POST['lastsent'] , $_POST['lastmod'] , $_POST['showtime'] , $_POST['showtemp'] , $_POST['flashes']);
header('Location: editPageList.php');
exit;
}
}

//printf("Userid: %d", $userID);
//printf("Result: %s", print_r($result, true));
//$db = PageDB::getInstance();
//printf("Error: %s (%d)" . PHP_EOL, $db->error, $db->errno);


function create_time_range($start, $end, $by='60 mins') {

$start_time = strtotime($start);
$end_time = strtotime($end);

$times = array();
for ( ;$start_time < $end_time; ) {
$times[] = $start_time;
$start_time = strtotime('+'.$by, $start_time);
}
$times[] = $start_time;
return $times;
}

// create array of time ranges
$times = create_time_range('0:00', '23:00', '1 hour');


// $times = create_time_range('9:30am', '5:30pm', '30 mins');

// format the unix timestamps
foreach ($times as $key => $time) {
$times[$key] = date('H:i', $time);
}

//print '<pre>'. print_r($times, true).'</pre>';

$days = array(
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
);

$s_day = array(
'Sun',
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat',
);

?>
<!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">
<head>
<title>Page Creator</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="pagelist.css" type="text/css" rel="stylesheet" media="all" />
<link href="Includes/buttons.css" type="text/css" rel="stylesheet" media="all" />

<script type="text/javascript" src="Includes/current_time.js"></script>
<script type="text/javascript" src="Includes/buttons.js"></script>
<!--Fetch Language Value Character Map-->
<script type="text/javascript" src="Includes/eng_chars.js"></script>
<!-- <script type="text/javascript" src="Includes/heb_chars.js"></script>-->
<script type="text/javascript" src="Includes/format_text.js"></script>
<script type="text/javascript" src="Includes/all_tricks.js"></script>

</head>
<body role="application">

<?php

function get_current_creation($createdDate){
$createdDate = new DateTime( new date('Y-m-d H:i:s'));
echo $createdDate->format('Y-m-d H:i:s');

$createdDate = "INSERT INTO pages (created_date) VALUE ('TIMESTAMP: Auto NOW()', NOW() )";
}


if ($_SERVER['REQUEST_METHOD'] == "POST")
$page = array("id" => $_POST['idnorm_msg'], "msg_txt" => $_POST['message'], "created_date" => $_POST['createdDate'], "nm_iddisplay" => $_POST['displayid'] , "nm_pg_no" => $_POST['pgno'] , "nm_msg_txt" => $_POST['messcode'] , "nm_monday" => $_POST['monday'] , "nm_tuesday" => $_POST['tuesday'] , "nm_wednesday" => $_POST['wednesday'] , "nm_thursday" => $_POST['thursday'] , "nm_friday" => $_POST['friday'] , "nm_saturday" => $_POST['saturday'] , "nm_sunday" => $_POST['sunday'] , "nm_scheduled" => $_POST['scheduled'] , "nm_invert" => $_POST['reversed'] , "nm_centre" => $_POST['centered'] , "nm_foreignlang" => $_POST['langs'] , "nm_bold1_2" => $_POST['bold1'] , "nm_bold3_4" => $_POST['bold2'] , "nm_bold5_6" => $_POST['bold3'] , "nm_bold7_8" => $_POST['bold4'] , "nm_pagefunc" => $_POST['funct'] , "nm_pagetype" => $_POST['pgtype'] , "nm_pagetempo" => $_POST['pgtempo'] , "nm_starttime" => $_POST['starting'] , "nm_endtime" => $_POST['ending'] , "nm_lastsend" => $_POST['lastsent'] , "nm_lastmodified" => $_POST['lastmod'] , "nm_showtime" => $_POST['showtime'] , "nm_showtemp" => $_POST['showtemp'] , "nm_flashing" => $_POST['flashes'], );
else if (array_key_exists("idnorm_msg", $_GET)){
$page = mysqli_fetch_array(PageDB::getInstance()->get_page_by_page_id($_GET['idnorm_msg']));
}else{
$page = array("id" => "", "nm_iddisplay" => "" , "msg_txt" => "", "created_date" => "", "nm_pg_no" => "" , "nm_msg_txt" => "" , "nm_monday" => "" , "nm_tuesday" => "" , "nm_wednesday" => "" , "nm_thursday" => "" , "nm_friday" => "" , "nm_saturday" => "" , "nm_sunday" => "" , "nm_scheduled" => "" , "nm_invert" => "" , "nm_centre" => "" , "nm_foreignlang" => "" , "nm_bold1_2" => "" , "nm_bold3_4" => "" , "nm_bold5_6" => "" , "nm_bold7_8" => "" , "nm_pagefunc" => "" , "nm_pagetype" => "" , "nm_pagetempo" => "" , "nm_starttime" => "" , "nm_endtime" => "" , "nm_lastsend" => "" , "nm_lastmodified" => "" , "nm_showtime" => "" , "nm_showtemp" => "" , "nm_flashing" => "");


}
?>
<!-- Start the Page Explorer Form -->
<form name="editPage" method="post" id="pageForm" action="editPage.php">
<table width="997" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="gradient_bg">


<table width="1000" border="0" cellpadding="0" cellspacing="0">
<tr colspan="2">
<td height="20" colspan="2" class="header_bg">&nbsp;</td>
</tr>
<tr colspan="2">
<td width="426" align="left" valign="top"><!-- Start the Page Form

<input type="hidden" name="idnorm_msg" value="cho $page['id']; ?>" />-->
<fieldset class="message_grad">
<legend>Message:</legend>
<table width="360" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="223">
<div id="showmessage" style="display:block">
<textarea name="message" id="message" value="<?php echo $page['msg_txt']; ?>" rows="4" cols="24" onkeyup="copy_data(this)"></textarea>
<br/>
<?php
if ($pageMessageIsEmpty)
echo '<div class="error">Please enter message</div>';
?>
<textarea name="messageCode" id="copy_to" value="<?php echo $page['nm_msg_txt']; ?>" readonly="readonly"></textarea>
</div>
</td>
<td width="137" align="left" valign="top">

<table width="139" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="35" align="right"><div id="nm-button">
<label>
<input type="checkbox" value="1" <?php if ('bold1') echo 'checked="checked"' ?> id="bold1" name="bold1" onClick="changebold1()"><span>&nbsp;</span>
</label>
</div></td>
<td width="35"><div id="lg-button">
<label>
<input type="checkbox" value="1" id="bold2" name="bold2" <?php if ('bold2') echo 'checked="unchecked"' ?> onClick="changebold2()"><span>&nbsp;</span>
</label>
</div></td>
<td width="35"><div id="bd-button">
<label>
<input type="checkbox" value="1" id="bold3" name="bold3" <?php if ('bold3') echo 'checked="unchecked"' ?> onClick="changebold3();"><span>&nbsp;</span>
</label>
</div></td>
<td width="31"><div id="bl-button">
<label>
<input type="checkbox" value="1" id="bold4" name="bold4" <?php if ('bold4') echo 'checked="unchecked"' ?> onClick="changebold4()"/>
<span>&nbsp;</span> </label>
</div></td>
</tr>
<tr>
<td align="right"><div id="cn-button">
<label>
<input type="checkbox" value="1"><span>&nbsp;</span>
</label>
</div></td>
<td><div id="fl-button">
<label>
<input type="checkbox" value="1" name="flashes" id="flashes" <?php if ('flashes') echo 'checked="unchecked"' ?>/>
<span>&nbsp;</span> </label>
</div>
</td>
<td><div id="tm-button">
<label>
<input type="checkbox" value="1" id="showtime" name="showtime" <?php if ('showtime') echo 'checked="unchecked"' ?> onclick="changetim()"/>
<span>&nbsp;</span> </label>
</div></td>
<td><div id="tp-button">
<label>
<input type="checkbox" value="1" id="showtemp" name="showtemp" <?php if ('showtemp') echo 'checked="unchecked"' ?>onClick="changetemp()"/>
<span>&nbsp;</span> </label>
</div></td>
</tr>
<tr>
<td align="right"><div id="rv-button">
<label>
<input type="checkbox" value="1" name="invt" id="invt" <?php if ('reversed') echo 'checked="unchecked"' ?>/>
<span>&nbsp;</span></label>
</div></td>
<td><a href="#" class="char_btn" onclick="return false;">&nbsp;</a></td>
<td><div id="ln-button">
<label>
<input type="checkbox" <?php if ('reversed') echo 'checked="unchecked"' ?> value="1" />
<span>&nbsp;</span></label>
</div></td>
<td>&nbsp;</td>
</tr>
</table></td>
</tr>
</table>
</fieldset>

<br/></td>
<td width="574" align="left" valign="top">
<label for="tempo_DD2">Tempo</label>
<select name="tempo_DD" id="tempo_DD2">
<option value="" selected="selected"></option>
<option value="1">2 Sec</option>
<option value="2">5 Sec</option>
<option value="3">10 Sec</option>
<option value="4">20 Sec</option>
<option value="5">30 Sec</option>
<option value="6">45 Sec</option>
<option value="7">60 Sec</option>
<option value="8">90 Sec</option>
<option value="9">120 Sec</option>
</select>
&nbsp;&nbsp;


<label for="transDD">Transition</label>
<select name="transDD[]" id="trans_dd" >
<option value="0" selected="selected" id="trans_dd" >Auto</option>
<option value="1" id="trans_dd" >Appear</option>
<option value="2" id="trans_dd" >Wipe</option>
<option value="3" id="trans_dd" >Open</option>
<option value="4" id="trans_dd" >Lock</option>
<option value="5" id="trans_dd" >Rotate</option>
<option value="6" id="trans_dd" >Right</option>
<option value="7" id="trans_dd" >Left</option>
<option value="8" id="trans_dd" >Roll Up</option>
<option value="9" id="trans_dd" >Roll Down</option>
<option value="12" id="trans_dd" >Paint</option>
<option value="13" id="trans_dd" >Fade In</option>
<option value="14" id="trans_dd" >Jump</option>
<option value="15" id="trans_dd" >Slide</option>
</select>



&nbsp;&nbsp;

<?php $scheduled = 'unchecked';
if (isset($_POST['nm_scheduled']))
if ($scheduled=='1'){
$scheduled ='checked';
}
else ($scheduled='0');

?>
<label for="nm_schedule">Set a Schedule</label>
<input type="checkbox" name="nm_schedule" id="nm_schedule" onClick="schedhow()" />
<br />
<div id="scheduley" style="display:none;">
<?php
// Days Active
$scheduled = 'unchecked';
if (isset($_POST['nm_scheduled']))
if ($scheduled=='1'){
$scheduled ='checked';
}

echo("<fieldset class=\"active_day\"><legend>Days Active:</legend>");

for ($i=0; $i<sizeof($days); $i++){
echo("<div class=\"on_lbl\">
<input type=\"checkbox\" name=\"dayOption\" value=\"" . $i . "\" id=\"onoption" . $i . "\" checked=\"checked\" onClick=\"dissad('$i')\">
<label for=\"option" . $i . "\">" . $days[$i] . "</label>
</div>");

}
echo ("</fieldset>");

// Select Days for Schedule
echo ("<fieldset class=\"sched_day\"><legend>Schedule Times:</legend>");
for ($i=0; $i<sizeof($s_day); $i++)
{

echo("<span id=\"daycell" . $i . "\" style=\"display:table-cell;\">
<input type=\"radio\" name=\"sdayOption\" value=\"" . $i . "\" id=\"dayopt" . $i . " \" onClick=\"disshow('$i')\" >
<label class=\"short\">$s_day[$i]</label></span>");

}
echo("</fieldset>");
// Day: Schedule show Hours
echo "<div id=\"myfield\">";
echo("<fieldset><legend id=\"legend\">day</legend>");

for ($i=0; $i<sizeof($times); $i++)

{
echo("<span id=\"t_option" . $i . "\" style=\"background-image:url(images/ton.png); padding-top:5px; padding-bottom:5px; min-width:120px; width:120px; max-width:120px;\">
<input type=\"checkbox\" name=\"timeOption" . $i . "\" value=\"" . $i . "\" checked=\"checked\" id=\"toption" . $i . "\" onClick=\"changeColour('$i')\" />
<label for=\"timeOption" . $i . "\" style=\"padding-right:2px;\">" . $times[$i] . "</label></span>");
}

echo ("<br><br>");
echo ("<input type=\"button\" value=\"Update\" onClick=\"\">");
echo ("</fieldset>");
echo "</div>";
?>
</div></td>
</tr>
<tr colspan="2">
<td colspan="2" align="left" valign="top">&nbsp;</td>
</tr>
<tr colspan="2">
<td colspan="2" align="left" valign="top">&nbsp;</td>
</tr>
<tr colspan="2">
<td colspan="2" align="center" valign="top" style="background:url(images/td_rad.png) left top repeat-x;"><div id="marquee_hold" style="text-align:left;">
<table border="0" align="left" cellpadding="0" cellspacing="0" >
<tr>
<td align="left" valign="top" style="height:64px; width:302px; background:url(images/led_holder.png) no-repeat center top;padding-left:10px; padding-right:10px;">
<marquee behavior="scroll" direction="left" loop="0" id="ticker" style="display:block;">
</marquee>
</td></tr></table>
</div></td>
</tr>
<tr colspan="2">
<td colspan="2" align="center" valign="top" ><input type="submit" name="savePage" value="Save Changes"/>
<input type="button" name="clear" value="Clear Form" onclick="document.getElementById('pageForm').reset();"/></td>
</tr>
</table></td>
</tr>
</table>
</form>
<!-- End Form -->
</body>
</html>

lumper
04-18-2012, 04:43 PM
I have uploaded the project so far in a Zip file here:
www.gautruss.co.za/project/page_project.zip

The page I am having the most trouble with is editPage.php
Any help is appreciated.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum