Thanks that just took care of that.
It just came to my attention that if i use this code.
</tr>
<?php
if ($helptopic=='Desktops / Tablets') {
} elseif ($helptopic=='Misys Support') {
echo '<tr><th width="20%">Visit Date</th><td><input type="text" name="visit_date"><font class="error"> *</font>  YY-MM-DD <font class="error">'.$errors.'</font></td></tr>';
echo '<tr><th width="20%">Patient #</th><td><input type="text" name="patient_number"><font class="error"> * <font class="error">'.$errors.'</font></td></tr>';
echo '<tr><th width="20%">Can you sync?</th><td><input type="radio" name="sync" value="Yes" /> Yes <input type="radio" name="sync" value="No" /> No</td></tr>';
echo '<tr><th width="20%">Host or Field Mode</th><td><input type="radio" name="field_host" value="Host" /> Host <input type="radio" name="field_host" value="Field" /> Field</td></tr>';
} else {
}
?>
<tr>
And i make the 4 echoed fields required in the class.ticket.php file then my other two ticket pages will not work. They will continually say that data is missing from the page when it's not whenever you try and submit a ticket. I assume this is because while the echoed fields arn't shown they are still being called by the form. The only ticket page that does work when all that data is required is the one with the 4 echoed fields.
These are the 4 entries that i had to change from 1 to 0 to get all my pages to work. However i do need that information and cant let users submit tickets if they forget one of those fields.
$fields = array('type'=>'string', 'required'=>0, 'error'=>'Valid response required');
$fields = array('type'=>'string', 'required'=>0, 'error'=>'Valid response required');
$fields = array('type'=>'int', 'required'=>0, 'error'=>'Patient number required');
$fields = array('type'=>'date', 'required'=>0, 'error'=>'Invalid date - must be YY-MM-DD');
After looking at all the functions would i need something like an If statement. Something like this? I know its not right but to get the general idea.
function create($var,&$errors,$origin,$autorespond=true,$alertstaff=true) {
global $cfg,$thisclient,$_FILES;
$id=0;
$fields=array();
$fields = array('type'=>'string', 'required'=>1, 'error'=>'Name required');
$fields = array('type'=>'email', 'required'=>1, 'error'=>'Valid email required');
If( $helptopic; )
$fields = array('type'=>'string', 'required'=>0, 'error'=>'Valid response required');
$fields = array('type'=>'string', 'required'=>0, 'error'=>'Valid response required');
$fields = array('type'=>'int', 'required'=>0, 'error'=>'Patient number required');
$fields = array('type'=>'date', 'required'=>0, 'error'=>'Invalid date - must be YY-MM-DD');
$fields = array('type'=>'string', 'required'=>1, 'error'=>'Subject required');
$fields = array('type'=>'text', 'required'=>1, 'error'=>'Message required');
else(strcasecmp($origin,'web')==0) { //Help topic only applicable on web tickets.
$fields = array('type'=>'int', 'required'=>1, 'error'=>'Select help topic');
}elseif(strcasecmp($origin,'staff')==0){ //tickets created by staff...e.g on callins.
$fields = array('type'=>'int', 'required'=>1, 'error'=>'Dept. required');
$fields = array('type'=>'string', 'required'=>1, 'error'=>'Indicate source');
$fields = array('type'=>'date', 'required'=>0, 'error'=>'Invalid date - must be MM/DD/YY');
}elseif { //Incoming emails
$fields = array('type'=>'int', 'required'=>1, 'error'=>'Email unknown');
}
$fields = array('type'=>'int', 'required'=>0, 'error'=>'Invalid Priority');
$fields = array('type'=>'phone', 'required'=>0, 'error'=>'Valid phone # required');
Also do you know how to set the date here so it's Day, Month, Year? Right now i have to have the field save as Year, Month, Day because if i look at the ticket the correct date isnt being saved into the data base. It is often coming back as the incorrect day and month but somehow 1969.
$fields = array('type'=>'date', 'required'=>0, 'error'=>'Invalid date - must be YY-MM-DD');
Screenshot
