I’m frustrated. If a persons acct status is 0, everything is fine, if its 1… the buttons like contiune etc, vanish from the profiles… I’ve looked and looked, but I just dont see it… anyone have any ideas?
[php]
<?php
session_start();
require_once('includes/config.php');
require_once('includes/functions.php');
require_once('includes/db_config.php');
$page_title = "EMS Pet Register: Manage Pets";
$custID = (!empty($_SESSION['id_customers'])?$_SESSION['id_customers']:$_SESSION['custID']);
if(empty($custID)){
header("location: login.php?r=myaccount.php");
die();
}
//printFormVars();
//************Form processing************
$_SESSION["debug"]=false;
$errorStr="";
//Clear for if new
if($_GET['a']=="new"){
$_SESSION['id_pets']="";
}
if(isset($_GET['id'])){
$_SESSION['id_pets'] = $_GET['id'];
}
$ID = (!empty($_GET['id'])?$_GET['id']:$_POST['id']);
$SC = (!empty($_GET['sc'])?$_GET['sc']:$_POST['sc']);
include_once("includes/class.formhandler.php");
$form1 = new FormHandler();
$form1->addCheck('petName',1,'Pet Name','Text',true);
$form1->addCheck('petVetPhone',10,'Vet Phone','Phone',false);
$form1->addCheck('petRelocatePhone',10,'Relocate Phone','Phone',false);
$form1->table = "pets";
$form1->table_idName = "petID";
$form1->table_prefixStr = "pet";
$form1->init();
if(!empty($_POST['isSubmit']))
{
preFormProcessing();
$_POST['petCustID'] = $custID;
//Process form and update database
$_POST['custAccountType'] = ($AccountType=="free"?0:1);
$form1->processForm();
$errorStr .= $form1->getErrors();
//Check to see if procceed
if($form1->getGo()){
$form1->start_session();
header("location: pet_pics.php");
die();
}
else{
$form1->debug("Go1: " . $form1->getGo());
}
}
else {
$form1->prefill();
$form1->start_session();
}
$petID = $form1->table_idValue;
//echo $petID . "--Pet ID
";
$petCount = mysql_num_rows(mysql_query("Select * from pets where petCustID='$custID'"));
$accountType = getAccountType($custID);
//echo $errorStr . "
";
//*************Include Header************************
$step = 2;
//Get Account Status
$custStatus=mysql_result(mysql_query("select custStatus from customers where custID=$custID"),0);
if($custStatus==0){
$noMenu="yes";
$showSteps="yes";
}
require_once('header.php');
//*************Done with Header**********************
?>
<?php echo (!empty($errorStr)? "
Please fix the following fields:
$errorStr" : ""); ?>
<?php generateHiddenFields(); $form1->generateHiddenFields();?>
Pet Info<?php echo (!empty($_POST['petName'])? " for "" . $_POST['petName'] . """:"");?>
<?php
if($accountType==0){
echo "*** When filling out your pet's profile, you can also place your own health info in the spot provided as well. Each pet will have a seperate field for your personal info, however you only need to fill out the box for ONE pet, you can leave the other box's under other pet's blank.*** Greyed out areas are only available for premium accounts."; }
?>
<?php
if($accountType==1){
echo "*** When filling out your pet's profile, you can also place your own health info in the spot provided as well. Each pet will have a seperate field for your personal info, however you only need to fill out the box for ONE pet, you can leave the other box's under other pet's blank.***";
}
?>
</td>
</tr>
<tr class=fieldName1>
<td width=125 align=left>Pet Name<BR>
<input type=text name=petName value='<?php echo $_POST['petName']?>'>
</td>
<td width=125 align=left>Age<BR>
<input type=text name=petAge value='<?php echo $_POST['petAge']?>'>
</td>
</tr>
<tr class=fieldName2>
<td align=left >Type<BR>
<select name=petType>
<?php if(!empty($_POST['petType'])){
echo "<option value='" . $_POST['petType'] . "'>" . $_POST['petType'] . "</option>";
}?>
<option value='Dog'>Dog</option>
<option value='Cat'>Cat</option>
<option value='Bird'>Bird</option>
<option value='Reptile/Amphibian'>Reptile/Amphibian</option>
<option value='Farm Animal'>Farm Animal</option>
<option value='Other'>Other</option>
</select>
</td>
<td align=left>Breed<BR>
<input type=text name=petBreed value='<?php echo $_POST['petBreed'];?>'>
</td>
</tr>
<tr class=fieldName1>
<td width=125 align=left>Vet's Name<BR>
<input type=text name=petVetName value='<?php echo $_POST['petVetName']?>'>
</td>
<td width=125 align=left>Vet's Phone<BR>
<input type=text name=petVetPhone value='<?php echo $_POST['petVetPhone']?>'>
</td>
</tr>
<tr class=fieldName2>
<td width=125 align=left valign=top>Select Type of Emergency Contact<BR>
<?php if($accountType==0 && 1==2){
echo "<input type=text name=petRelocateType style='background-color:cccccc' readonly";
}else{
?>
<select name=petRelocateType>
<?php if(!empty($_POST['petRelocateType'])){
echo "<option value='" . $_POST['petRelocateType'] . "'>" . $_POST['petRelocateType'] . "</option>"; }
?>
<option value='Person'>Person</option>
<option value='Kennel'>Kennel</option>
<option value='Day Care'>Day Care</option>
<option value='Pet Rescure Group'>Pet Rescure Group</option>
<option value='Other'>Other</option>
</select>
<?php
}
?>
</td>
<td width=125 align=left valign=top><BR>Emergency Contact<BR>
<input type=text name=petRelocateName value='<?php echo $_POST['petRelocateName']?>'<?php if($accountType==0 && 1==2) echo ' style="background-color:cccccc" readonly';?>>
Emergency Contact Number<BR>
<input type=text name=petRelocatePhone value='<?php echo $_POST['petRelocatePhone']?>'<?php if($accountType==0 && 1==2) echo ' style="background-color:cccccc" readonly';?>>
</td>
</tr>
<tr class=fieldName2>
<td colspan=2>
<hr>
</td>
</tr>
<tr class=fieldName2>
<td width=125 align=left valign=top>2nd Emergency Contact Type<BR>
<?php if($accountType==0){
echo "<input type=text name=petRelocateType style='background-color:cccccc' readonly";
}else{
?>
<select name=petRelocateType2>
<?php if(!empty($_POST['petRelocateType'])){
echo "<option value='" . $_POST['petRelocateType2'] . "'>" . $_POST['petRelocateType2'] . "</option>";
}
?>
<option value='Person'>Person</option>
<option value='Kennel'>Kennel</option>
<option value='Day Care'>Day Care</option>
<option value='Pet Rescure Group'>Pet Rescure Group</option>
<option value='Other'>Other</option>
</select>
<?php
}
?>
</td>
<td width=125 align=left valign=top>2nd Emergency Contact<BR>
<input type=text name=petRelocateName2 value='<?php echo $_POST['petRelocateName2']?>'<?php if($accountType==0) echo ' style="background-color:cccccc" readonly';?>>
2nd Emergency Contact Number<BR>
<input type=text name=petRelocatePhone2 value='<?php echo $_POST['petRelocatePhone2']?>'<?php if($accountType==0) echo ' style="background-color:cccccc" readonly';?>>
</td>
|
Please provide as much detailed information as needed.
|
Health Information
><?php if($accountType==0){echo " ";}else{echo $_POST['petHealth'];}?>
|
Medicines Needed
><?php if($accountType==0){echo " ";}else{echo $_POST['petMedicine'];}?>
|
<tr class=fieldName2>
<td colspan=2 align=left>Provide as much detailed information as necessary for your pet's relocation needs.<BR>
<textarea type=text name=petRelocateInfo rows=15 cols=60<?php if($accountType==0) echo ' style="background-color:cccccc" readonly';?>><?php if($accountType==0){echo " ";}else{echo $_POST['petRelocateInfo'];}?></textarea>
</td>
</tr>
Pet Owner & Family Members Important Medical
information & Emergency Contact Phone Numbers.
Provide as much Detailed information as Necessary
><?php if($accountType==0){echo " ";}else{echo $_POST['petOwnerHealth'];}?>
|
|
<?php
if($custStatus!=1){
?>
<?php
}
?>
</td>
|
<?php
require_once('footer.php');
?>
[/php]
ADMIN EDIT: Changed the QUOTE tags to PHP tags. Please see http://phphelp.com/guidelines.php for posting guidelines.