AskToledo Signup Child

[insert_php]
$s_first=””;
if (isset($_POST[“first”])){$s_first=$_POST[“first”];}
// Connecting, selecting database
$link = mysqli_connect(‘localhost:3309’, ‘webuser’, ‘Op10n’)
or die(‘Could not connect: ‘ . mysqli_error($link));
mysqli_select_db($link,’op_panel’) or die(‘Could not select database’);
echo ““;
$ch_num=1;
$loopcount=0;
$colcount=0;
$col=0;
$bl=” “;
if (!empty($_POST[‘s_pfn’])){$_POST[‘s_pfn’]=str_replace(“\'”,”'”,$_POST[‘s_pfn’]); }
if (!empty($_POST[‘s_pln’])){$_POST[‘s_pln’]=str_replace(“\'”,”'”,$_POST[‘s_pln’]); }
if (!empty($_POST[‘s_pci’])){$_POST[‘s_pci’]=str_replace(“\'”,”'”,$_POST[‘s_pci’]); }
if (!empty($_POST[‘s_ad1’])){$_POST[‘s_ad1’]=str_replace(“\'”,”'”,$_POST[‘s_ad1’]); }
if (!empty($_POST[‘s_ad2’])){$_POST[‘s_ad2’]=str_replace(“\'”,”'”,$_POST[‘s_ad2’]); }
if (!empty($_POST[‘s_pad1’])){$_POST[‘s_pad1’]=str_replace(“\'”,”'”,$_POST[‘s_pad1’]); }
if (!empty($_POST[‘s_pad2’])){$_POST[‘s_pad2’]=str_replace(“\'”,”'”,$_POST[‘s_pad2’]); }
if (!empty($_POST[‘s_ci’])){$_POST[‘s_ci’]=str_replace(“\'”,”'”,$_POST[‘s_ci’]); }

$section=”section1″;
if ($section==”section1″){
//Build data from tables
$query = ‘SELECT * FROM referrer order by referrer’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_ref=”“;
$query = ‘SELECT * FROM month order by monthnum’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_month=”“;

$query = ‘SELECT * FROM year order by year’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_year=”“;

$lp=$lp+1;
$pst=””;
if(isset($_POST[‘s_st’])){$pst=$_POST[‘s_st’];}
if (isset($_POST[‘child’])){
$pst=$_POST[‘s_pst’];
}
while ($row = mysqli_fetch_array($result)){
$id=$row[‘state’];
//$name=$row[‘referrer’];
$desc=$row[‘statename’];

if (isset($_POST[‘s_st’])){

if ($pst==$id){
$option_block_state .= ““;
}else {
$option_block_state .= ““;
}

} else {

if ($id==”OH”){
$option_block_state .= ““;
}else{
$option_block_state .= ““;
}
}
}
$option_block_state .= ““;

$query = ‘SELECT * FROM county order by county’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_county=”“;

$query = ‘SELECT * FROM education order by education’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_education=”“;

$query = ‘SELECT * FROM polparty order by party’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_party=”“;

$query = ‘SELECT * FROM marital order by marital’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_marital=”“;

$query = ‘SELECT * FROM income order by income’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_income=”“;

$query = ‘SELECT * FROM prefix order by porder’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_prefix=”“;

$query = ‘SELECT * FROM suffix order by sorder’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_suffix=”“;

$query = ‘SELECT * FROM ethnicity order by ethnicity’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_ethnicity=”“;

$query = ‘SELECT * FROM occupationstatus’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_occupationstatus=”“;

$query = ‘SELECT * FROM profession order by profession’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_profession=”“;

$query = ‘SELECT * FROM home’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_home=”“;

$query = ‘SELECT * FROM housevalue’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$option_block_housevalue=”“;

$option_block_gender=”“;
$query=’select * from gender’;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$numrow=mysqli_num_rows($result);
$lp=0;
$lp=$lp+1;
while ($row = mysqli_fetch_array($result)){
$id=$row[‘gender’];
//$name=$row[‘value’];
//$desc=number_format($row[‘endvalue’]);

$option_block_gender .= ““;
}
$option_block_gender .= ““;

$query = ‘SELECT * FROM master where `desc`=”ref”‘;
//echo $query;
$result = mysqli_query($link,$query) or die(‘Query failed: ‘ . mysqli_error($link));
$row = mysqli_fetch_array($result);
$refsav=$row[‘cvalue’];

if (trim($refsav)==”None”){
$refsav=”Skip this”;
}

//check adult-child

$adult=”No”;

// Should have the data now, lets do the input
echo ‘‘;

$nad1=””;
$nad2=””;
$nci=””;
$nst=”” ;
$zni=””;
$nct=””;
$cname=””;
$nad1=””;
$nad2=””;
$nci=””;
$nst=””;
$nzi=””;
$nct=””;
$naln=””;
$nafn=””;
$naph=””;
$naem=””;
$cname=””;

if (isset($_POST[‘s_adult’])){
$nad1=$_POST[‘s_ad1’];
$nad2=$_POST[‘s_ad2’];
$nci=$_POST[‘s_ci’];
$nst=$_POST[‘s_st’];
$nzi=$_POST[‘s_zi’];
$nct=$_POST[‘s_ct’];
$cname=””;
}

$nad1=$_POST[‘s_pad1’];
$nad2=$_POST[‘s_pad2’];
$nci=$_POST[‘s_pci’];
$nst=$_POST[‘s_pst’];
$nzi=$_POST[‘s_pzi’];
$nct=$_POST[‘s_pct’];
$naln=$_POST[‘s_pln’];
$nafn=$_POST[‘s_pfn’];
$naph=$_POST[‘s_pph’];
$naem=$_POST[‘s_pem’];
$cname=”Child”;

//print_r($_POST);
$display = ‘

‘;
$display_msg=””;
$display_focus=” “;
if (!isset($_POST[‘credit’])){
$display.=’Please select who referred you ‘ . $option_block_ref . “
“;
$display.=$_GET[‘testadult’];
}

if ($_POST[‘credit’]==$refsav){
$display .= “

Please enter your friend/family member information in the fields below so they can receive proper credit for you joining our database.

Name of friend/family member Email of friend/family member Phone of friend/family member

“;
$display_msg .= ““;
$display_focus .= ““;

}
else{$display .= ““;}
$display.=”

“;

if ($adult==”No”){
$display .= “

Please review contact information for this child’s parent or legal guardian.
Adult First Name Adult Last Name
Adult Phone Adult Email

“;
}
else{ $display .=”“;}

$display .=”

” . $option_block_state . “” . $option_block_county . ”

Please enter the child’s information in the fields below.“;
$display .= “
Prefix ” . $option_block_prefix . “ First Name MI Last Name Suffix ” . $option_block_suffix . “
Gender ” . $option_block_gender . “ Ethnicity ” . $option_block_ethnicity . “
Birth Date (MM/DD/YYYY)


“;
if ($s_first==”Yes”){
$display .= “

Re-enter Email Address

“;
}

$display .= “”;
if ($adult == “Yes” ){
$display .= “

Occupation ” . $option_block_profession . “


;
} else {
$display .= ““;
}

//$display .= “

Do you use the internet on a mobile device? Yes No Unknown

“;
//echo “Please enter this contacts Information”;
$display .= ““;
$display .=”“;
$display.=”“;
Echo “Fields in RED are required”;
$display .= $display_msg;
echo $display;

if ($adult==”Yes”){
echo ““;
}else{
echo ““;
}
echo $display_focus;
echo ‘

‘;

echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ““;
echo “

“;
if ($adult==”Yes”){
echo ““;
}else{
echo ““;
}
echo $display_focus;
}

[/insert_php]