Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<form id="form1" name="form1" method="post" ction="somepage.php">
<input name = "Suburb" type="text" size="30" value="somevalue from db" />
<input name = "DLApp" type="checkbox" value="1"/>
<?php include('_form.php');?>
<input type="submit" value="update" />
</form>
<?php
function update_data();
$DLapp = isset($_POST['DLApp'])?1:0;
$query = "update tablename set DLApp = $DLApp where recordId = ID"
?>
<input name = "DLPros" type="checkbox"
[red]<?php echo (empty($post['DLPros'])) ? '' : ' checked="checked" ';?>[/red]value="1"/>
<fieldset>
<?php echo $params['users']?>
<legend> Add / Edit Students</legend>
<table align="center" width="80%" cellpadding="2" border ="0">
<tr>
<td width="26%" align="right" bgcolor="#DDDDDD">Surname</td>
<td width="22%"><input name = "student[Surname]" type="text" size="30" value="<?php echo element_value($errors['Surname'], $post['Surname'],$params['student']['Surname']);?>" /></td>
<td colspan="2" bgcolor="#DDDDDD">Comments</td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">First name</td>
<td><input name = "student[FirstName]" type="text" size="30" value="<?php echo element_value($errors['FirstName'], $post['FirstName'],$params['student']['FirstName']);?>" /></td>
<td colspan="2" rowspan="11" align="left" valign="top"><textarea name = student[Comments] cols="50" rows="15" wrap="ON" hieght = "10"><?php echo element_value($errors['Comments'], $post['Comments'],$params['student']['Comments']);?></textarea></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">Street</td>
<td><input name = "student[Street]" type="text" size="30" value="<?php echo element_value($errors['Street'], $post['Street'],$params['student']['Street']);?>" /></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">Suburb</td>
<td><input name = "student[Suburb]" type="text" size="30" value="<?php echo element_value($errors['Suburb'], $post['Suburb'],$params['student']['Suburb']);?>" /></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">City</td>
<td><input name = "student[City]" type="text" size="30" value="<?php echo element_value($errors['City'], $post['City'],$params['student']['City']);?>" /></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">State</td>
<td><input name = "student[State]" type="text" size="30" value="<?php echo element_value($errors['State'], $post['State'],$params['student']['State']);?>" /></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">Postcode</td>
<td><input name = "student[PCode]" type="text" size="30" value="<?php echo element_value($errors['PCode'], $post['PCode'],$params['student']['PCode']);?>" /></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">Email</td>
<td><input name = "student[Email]" type="text" size="30" value="<?php echo element_value($errors['Email'], $post['Email'],$params['student']['Email']);?>" /></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">Phone</td>
<td><input name = "student[Phone]" type="text" size="30" value="<?php echo element_value($errors['Phone'], $post['Phone'],$params['student']['Phone']);?>" /></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">Login Name</td>
<td><input name = "student[Login]" type="text" size="30" value="<?php echo element_value($errors['Login'], $post['Login'],$params['student']['Login']);?>" /></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">Password</td>
<td><input name = "student[Pwd]" type="text" size="30" value="<?php echo element_value($errors['Pwd'], $post['Pwd'],$params['student']['Pwd']);?>" /></td>
</tr>
<tr>
<td height="23" bgcolor="#DDDDDD">Downloads</td>
<td>Student ID: <?php echo $post['StudentID'];?></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">Application</td>
<td>[red]<input name = "DLApp" type="checkbox"
<?php echo (empty($post['DLApp'])) ? '' : ' checked="checked" ';?> value="1"/>[/red]</td>
<td width="11%" bgcolor="#DDDDDD">Last update</td>
<td width="41%"><?php echo $post['LastUD'];?></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">Prospectus</td>
<td>[red]<input name = "DLPros" type="checkbox"
<?php echo (empty($post['DLPros'])) ? '' : ' checked="checked" ';?>value="1"/>[/red]</td>
<td bgcolor="#DDDDDD">By</td>
<td><input name = "student[UDBy]" type="text" size="30" value="<?php echo current_user('Firstname').' '.current_user('Surname');?>" readonly/></td>
</tr>
<tr>
<td align="right" bgcolor="#DDDDDD">Student Has Registered</td>
<td>[red]<input name = "Registered" type="checkbox"
<?php echo (empty($post['Registered'])) ? '' : ' checked="checked" ';?> value="1"/>[/red]</td>
<td bgcolor="#DDDDDD"> </td>
<td> </td>
</tr>
</table>
<input type="submit" value="update" />
</fieldset>
function update_student($params)
{
[red]$DLapp = isset($_POST['DLApp'])?1:0 ;
$DLPros = isset($_POST['DLPros'])?1:0;
$Reg = isset($_POST['Registered'])?1:0;[/red]
$connection = db_connect();
$query = sprintf("update students
set
Surname = '%s',
FirstName = '%s',
Email = '%s',
Street = '%s',
Suburb = '%s',
City = '%s',
PCode = '%s',
State = '%s',
Comments = '%s',
Phone = '%s',
Login = '%s',
Pwd = '%s',
[red]DLApp = $DLapp,
DLPros = $DLPros,
Registered = $Reg,[/red]
UDBy = '%s'
where
StudentID = '%s'
",
mysql_real_escape_string($params['Surname']),
mysql_real_escape_string($params['FirstName']),
mysql_real_escape_string($params['Email']),
mysql_real_escape_string($params['Street']),
mysql_real_escape_string($params['Suburb']),
mysql_real_escape_string($params['City']),
mysql_real_escape_string($params['PCode']),
mysql_real_escape_string($params['State']),
mysql_real_escape_string($params['Comments']),
mysql_real_escape_string($params['Phone']),
mysql_real_escape_string($params['Login']),
mysql_real_escape_string($params['Pwd']),
mysql_real_escape_string($params['UDBy']),
mysql_real_escape_string($params['StudentID'])
);
$result = mysql_query($query);
if(!$result){
return false;
//echo mysql_error();
}else{
return true;
//echo mysql_error();
}
}