<?php
require('../setClassPath.php');
require_once('db/TransManager.php');
require_once('util/InputHelper.php');

$input = InputHelper::getInstance();

$age        = $input->fullySanitize($_POST['age']);
$gender     = $input->fullySanitize($_POST['gender']);
$status     = $input->fullySanitize($_POST['status']);
if (strlen($age) == 0 || strlen($gender) == 0 || strlen($status) == 0) {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Take the Famous Dating Quiz at Dating Diversions</title>
<link rel="stylesheet" type="text/css" href="dd.css">
<link rel="stylesheet" type="text/css" href="lq.css">
<script type="text/javascript">
var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-628020-4']);_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();
</script>
</head>
<body>
<h1>Cannot Display Your Results of the Quiz</h1>
<br>
The DatingDiversions.com loneliness quotient quiz did not receive your gender, age and other info and cannot continue. 
<a href="/lonequiz1.html">Go to the first page</a> and begin taking the test from the beginning.
</body></html>

<?php
}
else {
    $friends    = $input->fullySanitize($_POST['friends']);
    $family     = $input->fullySanitize($_POST['family']);
    $area       = $input->fullySanitize($_POST['area']);
    $religious  = $input->fullySanitize($_POST['religious']);
    $disorder   = array();
    $dis        = $_POST['disorder'];
    if ($dis) {
        foreach ($dis as $val)
            $disorder[] = $input->fullySanitize($val);
    }
    $past       = $input->fullySanitize($_POST['past']);
    $beingsingle = $input->fullySanitize($_POST['beingsingle']);
    $find       = $input->fullySanitize($_POST['find']);
    $looking    = $input->fullySanitize($_POST['looking']);
    $satisfied  = $input->fullySanitize($_POST['satisfied']);
    $treat      = $input->fullySanitize($_POST['treat']);
    $connect    = $input->fullySanitize($_POST['connect']);
    $theone     = $input->fullySanitize($_POST['theone']);
    $family2    = $input->fullySanitize($_POST['family2']);
    $friends2   = $input->fullySanitize($_POST['friends2']);
    $alone      = $input->fullySanitize($_POST['alone']);
    $shy        = $input->fullySanitize($_POST['shy']);
    $friday     = $input->fullySanitize($_POST['friday']);
    $cry        = $input->fullySanitize($_POST['cry']);
    $pets       = $input->fullySanitize($_POST['pets']);
    $comm       = $input->fullySanitize($_POST['comm']);
    $distance   = $input->fullySanitize($_POST['distance']);
    $fantasy    = $input->fullySanitize($_POST['fantasy']);
    $anxiety    = $input->fullySanitize($_POST['anxiety']);
    $gonowhere  = $input->fullySanitize($_POST['gonowhere']);
    $coworkers  = $input->fullySanitize($_POST['coworkers']);
    $timealone  = $input->fullySanitize($_POST['timealone']);
                
    $lonely         = 0;
    $friendissues   = 0;
    $familyissues   = 0;
    $loveissues     = 0;
    $shyness        = 0;
    $location       = 0;
    $insecurity     = 0;

    $gay = 'f';
    if (($gender == 'gmale') || ($gender == 'gfemale'))
        $gay = 't';

    $osex = 'man';
    if (($gender == 'smale') || ($gender == 'gfemale')) {
        if (($age == 'teens') || ($age == 'twenties'))
            $osex = 'girl';
        else
            $osex = 'woman';
    }
    else if (($age == 'teens') || ($age == 'twenties'))
        $osex = 'guy';

    $pronoun1 = 'he';
    $pronoun2 = 'him';
    if (($gender == 'smale') || ($gender == 'gfemale')) {
        $pronoun1 = 'she';
        $pronoun2 = 'her';
    }

    if ($friends == 'none') {
        $lonely++;
        $friendissues++;
    }
    if ($family == 'none') {
        $lonely++;
        $familyissues++;
    }

    if ($disorder) {
        foreach ($disorder as $val) {
            if ($val == 'avoidant') {
                $lonely += 2;
                $shyness++;
                $insecurity++;
            }
            else if (($val == 'dependent') || ($val == 'schizotypal') || ($val == 'paranoid')) {
                $lonely++;
                if ($val == 'dependent')
                    $insecurity++;
            }
            else if ($val == 'schizoid')
                $lonely--;
        }
    }

    if ($area == 'plenty')
        $lonely--;
    else if ($area == 'no') {
        $lonely++;
        $location++;
    }

    if (($past == 'never') || ($past == 'recent')) {
        $lonely += 2;
        $loveissues++;
    }
    else if (($past == 'casual') || ($past == 'notrecent'))
        $lonely++;

    if ($beingsingle == 'okay')
        $lonely -= 4;
    else if ($beingsingle == 'rather')
        $lonely -= 2;
    else if ($beingsingle == 'need') {
        $lonely += 2;
        $loveissues++;
        $insecurity++;
    }

    if ($status == 'single') {
        if (($age == 'teens') || ($age == 'thirties') || ($age == 'forties'))
            $lonely += 2;
        else if ($age == 'twenties')
            $lonely++;
        $loveissues++;
    }

    if ($looking == 'yes') {
        if ($find == 'very') {
            $lonely += 3;
            $location++;
        }
        if ($find == 'somewhat')
            $lonely += 2;
        else if ($find == 'nottoo')
            $lonely++;
    }
    else if ($looking == 'offon') {
        if ($find == 'very') {
            $lonely += 2;
            $location++;
        }
        else if ($find == 'somewhat')
            $lonely++;
    }
    else if ($looking == 'no') {
        if ($find == 'very')
            $lonely++;
        else if ($find == 'nottoo')
            $lonely--;
    }

    if ($satisfied == 'fantastic')
        $lonely -= 2;
    else if ($satisfied == 'connect') {
        $lonely += 2;
        $loveissues++;
    }

    if ($treat == 'always')
        $lonely--;
    else if ($treat == 'sometimes')
        $lonely++;
    else if ($treat == 'never') {
        $lonely += 2;
        $loveissues++;
    }

    if ($connect == 'yes')
        $lonely -= 2;
    else if ($connect == 'no') {
        $lonely++;
        $loveissues++;
    }

    if ($theone == 'yes')
        $lonely -= 2;
    else if ($theone == 'no') {
        $lonely++;
        $loveissues++;
    }

    if (($treat == 'sometimes') && ($theone == 'notsure'))
        $loveissues++;

    if ($family2 == 'happy') {
        if ($family == 'largec')
            $lonely -= 2;
        else if ($family == 'smallc')
            $lonely--;
    }
    else if ($family2 == 'okay')
        $lonely--;
    else if ($family2 == 'depress') {
        $lonely += 2;
        $familyissues++;
    }

    if (($friends2 == 'new') || ($friends2 == 'wish') || ($friends2 == 'dontget') || ($friends2 == 'shallow'))
        $lonely++;
    else if (($friends2 == 'okay') || ($friends2 == 'happy') || ($friends2 == 'popular'))
        $lonely--;
    else if ($friends2 == 'upset') {
        $lonely += 2;
        $friendissues;
    }

    if ($alone == 'none') 
        $lonely -= 2;
    else if ($alone == 'onetwo')
        $lonely--;
    else if ($alone == 'five')
        $lonely++;

    if ($shy == 'very')
        $shyness++;
    if (($shy == 'very') && ($status != 'relationship'))
        $lonely++;
    else if ($shy == 'outgoing')
        $lonely--;
    else if ($shy == 'party')
        $lonely -= 2;

    if ($friday == 'alone') {
        $lonely += 2;
        $friendissues++;
    }
    else if (($friday == 'inspecial') || ($friday == 'outspecial'))
        $lonely -= 2;
    else if ($friday == 'friends')
        $lonely--;

    if ($cry == 'often')
        $lonely += 2;
    else if ($cry == 'sometimes')
        $lonely++;

    if ($pets == 'dogscats')
        $lonely--;
    else if ($pets == 'none')
        $lonely++;

    if ($comm == 'internet')
        $lonely++;
    else if ($comm == 'face')
        $lonely--;

    if ($distance == 'far') {
        $lonely += 2;
        $location++;
    }
    else if ($distance == 'around')
        $lonely--;

    if ($fantasy == 'love') {
        $lonely++;
        $loveissues++;
    }
    else if ($fantasy == 'else') {
        $lonely += 2;
        $insecurity++;
    }
    else if ($fantasy == 'success')
        $lonely--;

    if ($anxiety == 'yes') {
        $lonely++;
        $shyness++;
    }
    else if ($anxiety == 'no')
        $lonely--;

    if ($gonowhere == 'yes') {
        $lonely += 2;
        $friendissues++;
    }
    else if ($gonowhere == 'no')
        $lonely--;

    if ($coworkers == 'close')
        $lonely--;
    else if ($coworkers == 'distant')
        $lonely++;

    if ($timealone == 'comfortable')
        $lonely--;
    else if ($timealone == 'uncomfortable') {
        if ($friends == 'none')
            $lonely += 2;
        else if ($friends == 'few')
            $lonely++;
        if ($status == 'single')
            $lonely++;
    }

    if ($disorder)
        $lonely += 25;
    else
        $lonely += 23;
    $lonely = round($lonely * 100 / 62);

    if ($lonely < 21)
        $lonely -= 2;
    else if (($lonely > 20) && ($lonely < 31))
        $lonely -= 1;
    else if (($lonely > 40) && ($lonely < 51))
        $lonely -= 2;
    else if (($lonely > 50) && ($lonely < 61))
        $lonely -= 4;
    else if (($lonely > 60) && ($lonely < 76))
        $lonely -= 5;
    else if (($lonely > 75) && ($lonely < 86))
        $lonely -= 3;
    else if (($lonely > 85) && ($lonely < 95))
        $lonely += 2;

    if ($lonely > 100)
        $lonely = 100;
    else if ($lonely < 0)
        $lonely = 0;

    $color = 'ee0033';
    if ($lonely < 18)
        $color = '22dd55';
    else if ($lonely < 30)
        $color = '88ff44';
    else if ($lonely < 44)
        $color = 'ddff44';
    else if ($lonely < 58)
        $color = 'ffaa33';
    else if ($lonely < 72)
        $color = 'ff6622';
    else if ($lonely < 85)
        $color = 'ff2222';

    // can range from 0 to 57
    ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>The Loneliness Quotient Quiz Dating Diversions</title>
<link rel="stylesheet" type="text/css" href="/dd.css">
<link rel="stylesheet" type="text/css" href="/lq.css">
<script type="text/javascript">
var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-628020-4']);_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();
</script>
</head>
<body>

<h1 style="margin-bottom: 2px;">Your Loneliness Quotient Test Results</h1>
<a href="/">Home</a> | 
<a href="/advice.html">Dating Advice</a> | 
<a href="/stories.mv">Dating Stories</a> | 
<a href="/dating_jokes.html">Dating Jokes</a> | 
<a href="/singles-US/main.html">Geographical Dating Tips</a> | 
<a href="/gift_ideas.html">Great Gift Ideas</a><br>
<?php
    /*
    echo "friendissues: $friendissues<br>\r\n";
    echo "familyissues: $familyissues<br>\r\n";
    echo "loveissues: $loveissues<br>\r\n";
    echo "shyness: $shyness<br>\r\n";
    echo "location: $location<br>\r\n";
    echo "insecurity: $insecurity<br>\r\n";
    */

    $x4 = (int)date('H') % 4;
    $x2 = (int)date('H') % 2;
    $report = loneliness($lonely, $x4) . ' ' . friendissues($friendissues, ($lonely > 49 ? 'bad' : 'good'), $x2) . ' ' . familyissues($familyissues, ($friendissues > 0 ? 'bad' : 'good'), $x2) . ' ' . loveissues($loveissues, ($familyissues > 0 ? 'bad' : 'good'), $x2, $osex, $status) . ' ' . shyness($shyness, ($friendissues > 0 ? 'bad' : 'good'), ($loveissues > 0 ? 'bad' : 'good'), $x2, $osex) . ' ' . location($location, ($shyness > 0 ? 'bad' : 'good'), $x2) . ' ' . insecurity($insecurity, $x2);

    echo '<div class="reportbox"><div class="meterbox fll"><h3>Loneliness Quotient: '. $lonely .'%</h3>';
    echo '<div style="border: 1px solid #000; background-color: #fff; width: 200px; margin: 0; padding: 0; text-align: left;">';
    echo '<div style="background-color: #'. $color .'; width: '. $lonely .'%; overflow: hidden; padding: 0px; margin: 0px; border: none;">&nbsp;</div>';
    echo '</div></div>';
    echo '<h2>Your Personalized Assessment Report:</h2>';
    echo $report;
    echo '<p>** Continue reading down this page for more detail **</p>';
    echo '</div>';
?>

<br><h2>Copy and Paste Your Report to Your Blog, Journal, or Message Board</h2>

<textarea rows="8" cols="65" onclick="this.focus();this.select()">
<div style="background-color: #ffffff; color: #000000; border: 1px solid #999999; padding: 6px;"><div style="float: left; margin: 0px 6px 6px 0px; border: 1px solid #bbbbbb; background-color: #eeeeee; width: 204px; padding: 4px; padding-bottom: 8px;"><h3 style="font: bold 15px arial, sans-serif; margin: 0px; margin-bottom: 10px;">Loneliness Quotient: <?= $lonely ?>%</h3><div style="border: 1px solid #000000; background-color: #ffffff; width: 200px; margin: 0px; padding: 0px;"><div style="background-color: #<?= $color ?>; width: <?= $lonely ?>%; float: left; overflow: hidden; padding: 0px; margin: 0px; border: none;">&nbsp;</div></div></div><h2  style="font: bold 16px arial, sans-serif; margin: 0px; margin-bottom: 8px;">Your Personalized Assessment Report:</h2><?= $report ?><br><br>Take the <a href="http://www.datingdiversions.com/lq.html">Loneliness Quotient Test</a> at Dating Diversions</div>
</textarea><br>

<br><h1>Trouble Areas That Were Identified</h1>

<?php
    if ($loveissues > 0) {
?>
<div class="reportbox">
<h2>Love/Romance Issues</h2>

<?php
        if ($status == 'single') {
            if ($age != 'teens') {
?>
<p>You can reduce your level of loneliness by finding love.  Loneliness leads to many negative feelings, 
  even including the belief that you will never find that special <?= $osex ?> to complete you.  This is most certainly
  not the case.  Millions of people are single, and many of them believe they'll never find the love of their life. However, 
  they are finding how wrong those self-defeating thoughts are once they try out sites like <a href="http://www.anrdoezrs.net/3566ox52x4KMRRUUQRKMQMQOOU" target="_top" onmouseover="window.status='http://www.metrodate.com/';return true;" onmouseout="window.status=' ';return true;">Metrodate.com</a>.
  <img src="http://www.tqlkg.com/nn75fz2rxvGINNQQMNGIMIMKKQ" width="1" height="1" border="0"/> 
<?php
                if ($gender == 'gmale') {
?>
or a gay-specific matching site like <a href="http://www.anrdoezrs.net/65102ox52x4KMRRUUQRKSMLLRTU" target="_top" onmouseover="window.status='http://www.glimpse.com/default.asp?prm=11514';return true;" onmouseout="window.status=' ';return true;">glimpse.com</a><img src="http://www.lduhtrp.net/1681elpdjh2499CC892A4339BC" width="2" height="3" border="0"> 
or <a href="http://www.anrdoezrs.net/id102ft1zt0GINNQQMNGIHJOMPJJ" target="_top" onmouseover="window.status='http://www.gay.com';return true;" onmouseout="window.status=' ';return true;">Gay.com.</a><img src="http://www.lduhtrp.net/pt112jy1qwuFHMMPPLMFHGINLOII" width="3" height="9" border="0">
<?php
                }
                else if ($gender == 'gfemale') {
?>
or a matching site to find you a compatible female partner, like <a href="http://www.anrdoezrs.net/65102ox52x4KMRRUUQRKSMLLRTU" target="_top" onmouseover="window.status='http://www.glimpse.com/default.asp?prm=11514';return true;" onmouseout="window.status=' ';return true;">glimpse.com</a><img src="http://www.lduhtrp.net/1681elpdjh2499CC892A4339BC" width="2" height="3" border="0">
or <a href="http://www.anrdoezrs.net/4h102ar-xrzEGLLOOKLEOJNLOJJ" target="_top" onmouseover="window.status='http://www.planetout.com';return true;" onmouseout="window.status=' ';return true;">PlanetOut Personals</a>.<img src="http://www.afcyhf.com/de81jy1qwuFHMMPPLMFPKOMPKK" width="6" height="6" border="0">
<?php
                }
                else if ($religious == 'yes') {
?>
or, since you said you are religious, maybe a <a href="http://www.tkqlhce.com/qr114shqnhp46BBEEAB4658CA877" target="_top" onmouseover="window.status='http://www.wherechristiansmeet.com';return true;" onmouseout="window.status=' ';return true;">Christian Dating</a> site<img src="http://www.tqlkg.com/4h102nswkqo9BGGJJFG9BADHFDCC" width="2" height="8" border="0">
or a <a href="http://www.jdoqocy.com/pk97zw41w3JLQQTTPQJLKNQMPPS" target="_top" onmouseover="window.status='http://www.jdate.com/default.asp?prm=41330';return true;" onmouseout="window.status=' ';return true;">Jewish Singles</a><img src="http://www.tqlkg.com/5j104uuymsqBDIILLHIBDCFIEHHK" width="2" height="7" border="0"> site will find the <?= $osex ?> who matches with your values.
<?php
                }
                else {
?>
  and <a href="http://www.dpbolvw.net/bc74mu2-u1HJOORRNOHJIKPQKIN" target="_top" onmouseover="window.status='http://personals.yahoo.com';return true;" onmouseout="window.status=' ';return true;">Yahoo! Personals</a>.<img src="http://www.awltovhc.com/bn104uuymsqBDIILLHIBDCEJKECH" width="3" height="5" border="0">
<?php
                }
?>
  These matchmaking sites allow you to search for people in your area who match your interests.  
<?php
                if ($gay == 'f') {
?>
  And for people with marriage as a goal, there are sites like <a href="http://www.dpbolvw.net/oj105r09608OQVVYYUVOTPVQTUY" target="_top" onmouseover="window.status='http://www.eharmony.com';return true;" onmouseout="window.status=' ';return true;">eharmony.com</a><img src="http://www.lduhtrp.net/bi103g04tzxIKPPSSOPINJPKNOS" width="3" height="5" border="0"> and 
  <a href="http://www.dpbolvw.net/g677r09608OQVVYYUVOQPSWPRYQ" target="_top" onmouseover="window.status='http://www.true.com';return true;" onmouseout="window.status=' ';return true;">True.com</a><img src="http://www.awltovhc.com/o9105iw-ousDFKKNNJKDFEHLEGNF" width="4" height="6" border="0"> 
  which cater exclusively to people seeking serious, long-term relationships.
<?php
                }
?>  
</p>

<p>It's the 21st Century, there's no reason not to use these tools we have available to us.  Our modern world often isolates 
  us, but technology can also bring us together. Dating Diversions does not currently offer any matching services of our own, 
  however you can <a href="/singles-US/main.html">browse through our growing database of dating advice</a> to 
  get additional ideas for meeting people in your area, if you're not ready to give the match-making sites a try.</p>

  <?= ($religious == 'yes' ? '<p>Finally, a neat book you may be interested in is <a href="http://www.amazon.com/exec/obidos/ASIN/0830813535/4degreezcom">Singles at the Crossroads: A Fresh Perspective on Christian Singleness</a>.</p>' : '') ?>
<?php
            }
            else {
?>
  <p>You can reduce your level of loneliness by finding love.  Loneliness leads to many negative feelings, 
  even including the belief that you will never find that special <?= $osex ?> to complete you.  This is most certainly
  not the case.  Millions of people are single, and many of them believe they'll never find the love of their life.  This is not true.
  You are young, and such feelings are common among teenagers.</p>

  <p>You can <a href="/singles-US/main.html">browse through our growing database of dating advice</a> to get some 
  ideas about how to meet other people in your area.  Common suggestions include coffee shops, the local mall,
  the park, karaoke, and nightclubs.  Go to school dances.  Take advantage of the internet, if you don't 
  already.  The modern world often isolates us, but technology can also bring us together!</p>
<?php
            }
        }
        else {
?>
<p>You are having trouble in your current relationship, and this needs to be worked out. 
<?= ($theone == 'notsure' ? "You said you are not sure $pronoun1 is \"the one\" for you. " : '') ?>
<?= ($theone == 'no' ? "You said you do not think $pronoun1 is \"the one\" for you. " : '') ?>
<?= ($treat == 'sometimes' ? "You said $pronoun1 is often distant. " : '') ?>
<?= ($treat == 'never' ? "You said $pronoun1 makes you sad. " : '') ?>
<?= ((($connect == 'no') || ($satisfied == 'connect')) ? "You said you don't connect with $pronoun2. " : '') ?>
You need to get to the bottom of what is causing the issues and work on solving them.</p>

<p>If you love your <?= $osex ?>, you should not delay in opening up the channels of communication and try to start over fresh. 
But if you think this relationship may be going nowhere, you should consider moving on.  Always put yourself first.
If <?= $pronoun1 ?> isn't treating you the way you want to be treated, then you deserve better.  Sometimes two people 
just weren't meant to be together.</p>

<?php
            if ($age != 'teens') {
?>
<p>You could always try a site like <a href="http://www.anrdoezrs.net/3566ox52x4KMRRUUQRKMQMQOOU" target="_top" onmouseover="window.status='http://www.metrodate.com/';return true;" onmouseout="window.status=' ';return true;">Metrodate.com</a> <img src="http://www.tqlkg.com/nn75fz2rxvGINNQQMNGIMIMKKQ" width="1" height="1" border="0"/>
or <a href="http://www.dpbolvw.net/bc74mu2-u1HJOORRNOHJIKPQKIN" target="_top" onmouseover="window.status='http://personals.yahoo.com';return true;" onmouseout="window.status=' ';return true;">Yahoo! Personals</a><img src="http://www.awltovhc.com/bn104uuymsqBDIILLHIBDCEJKECH" width="1" height="5" border="0">, to see
who else is out there.  An estimated 20 million people have used the internet to search for someone for romance or even just friendship. You never know who you might meet and your life could change forever.</p>
<?php
            }
            else {
?>
  <p>You're young, there's no need to stress out over a relationship.  If your current one isn't working,
  know that there are other fish in the sea.  Get your current situation in order or start looking for 
  someone who will truely make you happy!</p>
<?php
            }
        }
        echo '</div>';
    }
    if ($friendissues > 0) {
?>
<div class="reportbox">
<h2>Friend Issues</h2>

<p>You can reduce loneliness by expanding your circle of friends.  Dating Diversions does not currently 
offer friendship matching services, but you can <a href="http://www.kqzyfj.com/rd65p-85-7NPUUXXTUNPORXUQPP" target="_top" onmouseover="window.status='http://www.meetup.com/';return true;" onmouseout="window.status=' ';return true;">find people near you who share your interests</a> at MeetUp.com.
<?php
        if ($gay == 't') {
?>
And, especially in some areas, it can be hard for gay individuals to establish deep and meaningful friendships. Glimpse.com 
does <a href="http://www.kqzyfj.com/22111vpyvpxCEJJMMIJCKEDDKHE" target="_top" onmouseover="window.status='http://www.glimpse.com/default.asp?prm=11514';return true;" onmouseout="window.status=' ';return true;">friendship matches</a><img src="http://www.ftjcfx.com/n9121uuymsqBDIILLHIBJDCCJGD" width="1" height="6" border="0"> for gays and lesbians. 
<?php
        }
        else
            echo 'They are out there, you just aren\'t finding them!';
?>
</p>

<p>Dating Diversions is currently building a database of <a href="/singles-US/main.html">localized advice</a> that may be 
of help to you.  Most of it is currently geared toward daters, but it could be useful to friend-seekers as well.  Common advice 
is to meet people at coffee shops, bars, <?= ($religious == 'yes' ? 'church groups, ' : '') ?> and local events.  Try new things.  You won't meet
   new people if you keep doing what you've been doing.<img src="http://www.tqlkg.com/jh115jy1qwuFHMMPPLMFHGJPMIHH" width="3" height="7" border="0"></p>

<?php
        if ($age == 'twenties')
            echo '<p>Finally, if you want to make online friends, give <a href="http://www.4thkingdom.com/index.html">4thKingdom.com</a> a look.</p>';
?>

</div>
<?php
    }
    if ($familyissues > 0) {
?>
<div class="reportbox">
<h2>Family Issues</h2>

<p>They say you can pick your friends, but you can't pick your family.  Sometimes you simply get dealt an unlucky 
hand. Family issues are tough, and it would take another whole test to discover why you are having 
  trouble with your family matters.  If you can see a psychologist to work out these issues, it 
  would probably be a big help.</p>

  <p>In the future, Dating Diversions will be expanding our advice on how to deal with family issues.
  Please check back at a later time for advice in this area.</p>
</div>
<?php
    }
    if ($shyness > 0) {
?>
<div class="reportbox">
<h2>Shyness and Social Anxiety</h2>

<p>Shyness can be quite a difficult obstacle to overcome, and many shy people simply feel doomed to a higher 
  degree of loneliness than the rest of the population.  Talk therapy and medication can yield 
  incredible results, but there is a catch-22 involved: If you are shy, you're not likely to go and 
  see someone to talk out your problem with. If you can build up the determination to do it, go for it.</p>
<p>There are self-help books for overcoming shyness and social anxiety, however, which may be a help
  to some people.  You can order <a href="http://www.anrdoezrs.net/k6115p-85-7NPUUXXTUNPOQWPTTP?url=http%3A%2F%2Fwww.ebooks.com%2Fcj.asp%3FIID%3D118698" target="_top" onmouseover="window.status='http://www.ebooks.com';return true;" onmouseout="window.status=' ';return true;">
Triumph Over Shyness: Conquering Shyness & Social Anxiety</a> in e-book form from eBooks.com at a reasonable price. Or 
  try <a href="http://www.amazon.com/exec/obidos/redirect-home/4degreezcom" onmouseover="window.status='http://www.amazon.com';return true;" onmouseout="window.status=' ';return true;">Amazon.com</a>.. some good 
  books are:
  <ul>
    <li><a href="http://www.amazon.com/exec/obidos/ASIN/1572242167/4degreezcom">The Shyness & Social Anxiety Workbook: Proven Techniques for Overcoming Your Fears</a></li>
    <li><a href="http://www.amazon.com/exec/obidos/ASIN/1879237237/4degreezcom">Dying of Embarrassment: Help for Social Anxiety & Phobia</a></li>
    <li><a href="http://www.amazon.com/exec/obidos/ASIN/0743200756/4degreezcom">The Gift of Shyness : Embrace Your Shy Side and Find Your Soul Mate</a></li>
    <li><a href="http://www.amazon.com/exec/obidos/ASIN/0312316232/4degreezcom">Painfully Shy: How to Overcome Social Anxiety and Reclaim Your Life</a></li>
  </ul>
<img src="http://www.afcyhf.com/h3108snrflj46BBEEAB4657D6AA6" height="8" width="2" border="0">
</div>
<?php
    }
    if ($location > 0) {
?>
<div class="reportbox">
<h2>Location</h2>

<p>Location issues are difficult to overcome, unless you're ready to pack up and move!  Actually, the truth is you do not
have to move to find people, unless you are in an extremely rural area.  Some advice: spend more time in a nearby town
or city.  If you don't have a car, take public transportation.  Visit an area nearby that you've never been to before. 
Try to find like-minded people in your area using a site like <a href="http://www.anrdoezrs.net/np82shqnhp46BBEEAB4658C885B" target="_top" onmouseover="window.status='http://friendfinder.com';return true;" onmouseout="window.status=' ';return true;">FriendFinder.com</a>, 
<img src="http://www.awltovhc.com/ei77m-3sywHJOORRNOHJILPLLIO" width="2" height="8" border="0">
or <a href="http://www.kqzyfj.com/gc66p-85-7NPUUXXTUNPORXUQPO" target="_top" onmouseover="window.status='http://www.meetup.com/';return true;" onmouseout="window.status=' ';return true;">meet local people in certain interest groups</a> at Meetup.com.
<img src="http://www.lduhtrp.net/69117wquiom79EEHHDE798BHEA98" width="3" height="3" border="0">. 
Odds are there are more 
people like you in your area, and you just haven't found them.  They are sitting around just like you are, thinking what 
a boring town they live in, not realizing others are thinking the same thing.  Try to get to know new people and you 
might find that your town isn't as lonely as you had first thought.</p>
</div>
<?php
    }
    if ($insecurity > 0) {
?>
<div class="reportbox">
<h2>Insecurity and Self-Esteem</h2>

<p>The LQ test revealed a degree of underlying self-esteem issues, which are likely having a negative impact on your life. 
The best advice to give you is to see a psychologist and get started on a program to improve your self-image.  You can 
find psychologists in your area simply by opening up the yellowpages. They are professionals trained to get to 
the root of your insecurity issues and work on solving them.</p>

<p>If therapy isn't something you would consider right now, you could try one of the self-help books written by experts
in the field.  Spend some time in the Self Help section of your local book store. You'll be amazed 
  at how much advice is out there. Or browse around at <a href="http://www.amazon.com/exec/obidos/redirect-home/4degreezcom" onmouseover="window.status='http://www.amazon.com';return true;" onmouseout="window.status=' ';return true;">Amazon.com</a>. 
  Some great titles include:
  <ul>
    <li><a href="http://www.amazon.com/exec/obidos/ASIN/0966431537/4degreezcom">The Personal Workbook for Breaking the Chain of Low Self-Esteem</a></li>
  <?= ($religious == 'yes' ? '<li><a href="http://www.amazon.com/exec/obidos/ASIN/0890815534/4degreezcom">Biblical View of Self Esteem, Self Love and Self Image</a></li>' : '<li><a href="http://www.amazon.com/exec/obidos/ASIN/0312155700/4degreezcom">Life\'s Too Short! : Pull The Plug On Self-Defeating Behavior And Turn On The Power Of Self-Esteem</a></li>') ?>
  <?= ((($gender == 'sfemale') || ($gender == 'gfemale')) ? '<li><a href="http://www.amazon.com/exec/obidos/ASIN/0140082255/4degreezcom">Women and Self-Esteem</a></li>' : '<li><a href="http://www.amazon.com/exec/obidos/ASIN/0688094554/4degreezcom">Ten Days to Self-Esteem</a></li>') ?>
  <?= ((($gender == 'gfemale') || ($gender == 'gmale')) ? '<li><a href="http://www.amazon.com/exec/obidos/ASIN/1575664240/4degreezcom">Empowering the Tribe: A Positive Guide to Gay and Lesbian Self-Esteem</a></li>' : '<li><a href="http://www.amazon.com/exec/obidos/ASIN/1572242140/4degreezcom">The Relaxation & Stress Reduction Workbook</a></li>') ?>
  </ul>
  </p>
  <p>If you're too impatient for ordering books, you could download an e-book like <a href="http://www.anrdoezrs.net/ta122biroiq57CCFFBC5768E7BB7?url=http%3A%2F%2Fwww.ebooks.com%2Fcj.asp%3FIID%3D149313" target="_top" onmouseover="window.status='http://www.ebooks.com';return true;" onmouseout="window.status=' ';return true;">Boost Your Self-Esteem</a>
  <img src="http://www.ftjcfx.com/jo105vvzntrCEJJMMIJCEDFLEIIE" height="5" width="2" border="0"> or other 
  <a href="http://www.jdoqocy.com/j1108ft1zt0GINNQQMNGOKKHMPK" target="_top" onmouseover="window.status='http://www.ebooks.com';return true;" onmouseout="window.status=' ';return true;">self help eBooks</a> from eBooks.com.<img src="http://www.lduhtrp.net/kj122uuymsqBDIILLHIBJFFCHKF" width="3" height="5" border="0">
  </p>
</div>
<?php
    }
?>

<?php
    if (($loveissues == 0) && ($familyissues == 0) && ($friendissues == 0) && ($shyness == 0) && ($location == 0) && ($insecurity == 0)) {
?>

<div class="reportbox">
<h2>None!</h2>

  <p>Congratulations, the LQ test did not identify any trouble areas for you.  Your relationships
  are healthy, and you are likely a happier person as a result.  Good for you! =)</p>

  <p>Treat yourself to a <a href="http://www.kqzyfj.com/md117p-85-7NPUUXXTUNPORVTSVT" target="_top" onmouseover="window.status='http://www.jamster.com';return true;" onmouseout="window.status=' ';return true;">free ringtone at Jamster</a><img src="http://www.lduhtrp.net/fr121o26v0zKMRRUUQRKMLOSQPSQ" width="3" height="5" border="0">
   or a <a href="http://www.anrdoezrs.net/3a74biroiq57CCFFBC5769DF69F" target="_top" onmouseover="window.status='http://www.spreadshirt.com/shop.php?sid=1000';return true;" onmouseout="window.status=' ';return true;">custom T-Shirt</a> that you can design!<img src="http://www.awltovhc.com/d977qmqeki35AADD9A3547BD47D" width="5" height="5" border="0"></p>

  <?= ($status != 'single' ? '<p>And take a look at these <a href="/gift_ideas.html">great gift ideas</a> for your '. $osex .'.</p>' : '') ?>
</div>

<?php
    }
    if ($friendissues == 0) {
?>
<div class="reportbox">
<h2>The Test Revealed No Friend Issues</h2>

  <p>Since you have no problems in the friend department, maybe you could offer some advice to others on how to 
  meet people and build strong friendships.  For now this applies to US residents only, because you must select
  a US state or city.  Your advice can be general or specific to your area:<br>

  <form action="friendadvice.php" method="post">
  <table>
      <tr>
        <td>
          Your Area:
        </td>
        <td><select name="loc">
<option value="noloc" selected>Select a Location</option>
<optgroup label="United States">
<optgroup label="Alabama">
<option value="AL">Alabama, General</option>
<option value="birmingham_al">Birmingham</option>
<option value="huntsville_al">Huntsville</option>
<option value="mobile_al">Mobile</option>
<option value="montgomery_al">Montgomery</option>
</optgroup>
<optgroup label="Alaska">
<option value="AK">Alaska, General</option>
<option value="anchorage_ak">Anchorage</option>
</optgroup>
<optgroup label="Arizona">
<option value="AZ">Arizona, General</option>
<option value="chandler_az">Chandler</option>
<option value="gilbert_town_az">Gilbert Town</option>
<option value="glendale_az">Glendale</option>
<option value="mesa_az">Mesa</option>
<option value="peoria_az">Peoria</option>
<option value="phoenix_az">Phoenix</option>
<option value="scottsdale_az">Scottsdale</option>
<option value="tempe_az">Tempe</option>
<option value="tucson_az">Tucson</option>
</optgroup>
<optgroup label="Arkansas">
<option value="AR">Arkansas, General</option>
<option value="little_rock_ar">Little Rock</option>
</optgroup>
<optgroup label="California">
<option value="CA">California, General</option>
<option value="anaheim_ca">Anaheim</option>
<option value="bakersfield_ca">Bakersfield</option>
<option value="chula_vista_ca">Chula Vista</option>
<option value="concord_ca">Concord</option>
<option value="corona_ca">Corona</option>
<option value="el_monte_ca">El Monte</option>
<option value="escondido_ca">Escondido</option>
<option value="fontana_ca">Fontana</option>
<option value="fremont_ca">Fremont</option>
<option value="fresno_ca">Fresno</option>
<option value="fullerton_ca">Fullerton</option>
<option value="garden_grove_ca">Garden Grove</option>
<option value="glendale_ca">Glendale</option>
<option value="hayward_ca">Hayward</option>
<option value="huntington_beach_ca">Huntington Beach</option>
<option value="irvine_ca">Irvine</option>
<option value="lancaster_ca">Lancaster</option>
<option value="long_beach_ca">Long Beach</option>
<option value="los_angeles_ca">Los Angeles</option>
<option value="modesto_ca">Modesto</option>
<option value="moreno_valley_ca">Moreno Valley</option>
<option value="oakland_ca">Oakland</option>
<option value="oceanside_ca">Oceanside</option>
<option value="ontario_ca">Ontario</option>
<option value="orange_ca">Orange</option>
<option value="oxnard_ca">Oxnard</option>
<option value="palmdale_ca">Palmdale</option>
<option value="pasadena_ca">Pasadena</option>
<option value="pomona_ca">Pomona</option>
<option value="rancho_cucamonga_ca">Rancho Cucamonga</option>
<option value="riverside_ca">Riverside</option>
<option value="sacramento_ca">Sacramento</option>
<option value="salinas_ca">Salinas</option>
<option value="san_bernardino_ca">San Bernardino</option>
<option value="san_diego_ca">San Diego</option>
<option value="san_francisco_ca">San Francisco</option>
<option value="san_jose_ca">San Jose</option>
<option value="santa_ana_ca">Santa Ana</option>
<option value="santa_clarita_ca">Santa Clarita</option>
<option value="santa_rosa_ca">Santa Rosa</option>
<option value="simi_valley_ca">Simi Valley</option>
<option value="stockton_ca">Stockton</option>
<option value="sunnyvale_ca">Sunnyvale</option>
<option value="thousand_oaks_ca">Thousand Oaks</option>
<option value="torrance_ca">Torrance</option>
<option value="vallejo_ca">Vallejo</option>
</optgroup>
<optgroup label="Colorado">
<option value="CO">Colorado, General</option>
<option value="aurora_co">Aurora</option>
<option value="colorado_springs_co">Colorado Springs</option>
<option value="denver_co">Denver</option>
<option value="fort_collins_co">Fort Collins</option>
<option value="lakewood_co">Lakewood</option>
</optgroup>
<optgroup label="Connecticut">
<option value="CT">Connecticut, General</option>
<option value="bridgeport_ct">Bridgeport</option>
<option value="hartford_ct">Hartford</option>
<option value="new_haven_ct">New Haven</option>
<option value="stamford_ct">Stamford</option>
</optgroup>
<optgroup label="Delaware">
<option value="DE">Delaware, General</option>
</optgroup>
<optgroup label="Florida">
<option value="FL">Florida, General</option>
<option value="cape_coral_fl">Cape Coral</option>
<option value="coral_springs_fl">Coral Springs</option>
<option value="fort_lauderdale_fl">Fort Lauderdale</option>
<option value="hialeah_fl">Hialeah</option>
<option value="hollywood_fl">Hollywood</option>
<option value="jacksonville_fl">Jacksonville</option>
<option value="miami_fl">Miami</option>
<option value="orlando_fl">Orlando</option>
<option value="pembroke_pines_fl">Pembroke Pines</option>
<option value="st_petersburg_fl">St. Petersburg</option>
<option value="tallahassee_fl">Tallahassee</option>
<option value="tampa_fl">Tampa</option>
</optgroup>
<optgroup label="Georgia">
<option value="GA">Georgia, General</option>
<option value="atlanta_ga">Atlanta</option>
<option value="augusta_ga">Augusta</option>
<option value="columbus_ga">Columbus</option>
<option value="savannah_ga">Savannah</option>
</optgroup>
<optgroup label="Hawaii">
<option value="HI">Hawaii, General</option>
<option value="honolulu_hi">Honolulu</option>
</optgroup>
<optgroup label="Idaho">
<option value="ID">Idaho, General</option>
<option value="boise_id">Boise</option>
</optgroup>
<optgroup label="Illinois">
<option value="IL">Illinois, General</option>
<option value="aurora_il">Aurora</option>
<option value="chicago_il">Chicago</option>
<option value="joliet_il">Joliet</option>
<option value="naperville_il">Naperville</option>
<option value="rockford_il">Rockford</option>
</optgroup>
<optgroup label="Indiana">
<option value="IN">Indiana, General</option>
<option value="evansville_in">Evansville</option>
<option value="fort_wayne_in">Fort Wayne</option>
<option value="indianapolis_in">Indianapolis</option>
</optgroup>
<optgroup label="Iowa">
<option value="IA">Iowa, General</option>
<option value="cedar_rapids_ia">Cedar Rapids</option>
<option value="des_moines_ia">Des Moines</option>
</optgroup>
<optgroup label="Kansas">
<option value="KS">Kansas, General</option>
<option value="kansas_city_ks">Kansas City</option>
<option value="overland_park_ks">Overland Park</option>
<option value="topeka_ks">Topeka</option>
<option value="wichita_ks">Wichita</option>
</optgroup>
<optgroup label="Kentucky">
<option value="KY">Kentucky, General</option>
<option value="lexington_ky">Lexington</option>
<option value="louisville_ky">Louisville</option>
</optgroup>
<optgroup label="Louisiana">
<option value="LA">Louisiana, General</option>
<option value="baton_rouge_la">Baton Rouge</option>
<option value="new_orleans_la">New Orleans</option>
<option value="shreveport_la">Shreveport</option>
</optgroup>
<optgroup label="Maine">
<option value="ME">Maine, General</option>
</optgroup>
<optgroup label="Maryland">
<option value="MD">Maryland, General</option>
<option value="baltimore_md">Baltimore</option>
</optgroup>
<optgroup label="Massachusetts">
<option value="MA">Massachusetts, General</option>
<option value="boston_ma">Boston</option>
<option value="springfield_ma">Springfield</option>
<option value="worcester_ma">Worcester</option>
</optgroup>
<optgroup label="Michigan">
<option value="MI">Michigan, General</option>
<option value="detroit_mi">Detroit</option>
<option value="flint_mi">Flint</option>
<option value="grand_rapids_mi">Grand Rapids</option>
<option value="lansing_mi">Lansing</option>
<option value="sterling_heights_mi">Sterling Heights</option>
<option value="warren_mi">Warren</option>
</optgroup>
<optgroup label="Minnesota">
<option value="MN">Minnesota, General</option>
<option value="minneapolis_mn">Minneapolis</option>
<option value="st_paul_mn">St. Paul</option>
</optgroup>
<optgroup label="Mississippi">
<option value="MS">Mississippi, General</option>
<option value="jackson_ms">Jackson</option>
</optgroup>
<optgroup label="Missouri">
<option value="MO">Missouri, General</option>
<option value="kansas_city_mo">Kansas City</option>
<option value="springfield_mo">Springfield</option>
<option value="st_louis_mo">St. Louis</option>
</optgroup>
<optgroup label="Montana">
<option value="MT">Montana, General</option>
</optgroup>
<optgroup label="Nebraska">
<option value="NE">Nebraska, General</option>
<option value="lincoln_ne">Lincoln</option>
<option value="omaha_ne">Omaha</option>
</optgroup>
<optgroup label="Nevada">
<option value="NV">Nevada, General</option>
<option value="henderson_nv">Henderson</option>
<option value="las_vegas_nv">Las Vegas</option>
<option value="north_las_vegas_nv">North Las Vegas</option>
<option value="reno_nv">Reno</option>
</optgroup>
<optgroup label="New Hampshire">
<option value="NH">New Hampshire, General</option>
</optgroup>
<optgroup label="New Jersey">
<option value="NJ">New Jersey, General</option>
<option value="elizabeth_nj">Elizabeth</option>
<option value="jersey_city_nj">Jersey City</option>
<option value="newark_nj">Newark</option>
<option value="paterson_nj">Paterson</option>
</optgroup>
<optgroup label="New Mexico">
<option value="NM">New Mexico, General</option>
<option value="albuquerque_nm">Albuquerque</option>
</optgroup>
<optgroup label="New York">
<option value="NY">New York, General</option>
<option value="buffalo_ny">Buffalo</option>
<option value="new_york_city_ny">New York City</option>
<option value="rochester_ny">Rochester</option>
<option value="syracuse_ny">Syracuse</option>
<option value="yonkers_ny">Yonkers</option>
</optgroup>
<optgroup label="North Carolina">
<option value="NC">North Carolina, General</option>
<option value="charlotte_nc">Charlotte</option>
<option value="durham_nc">Durham</option>
<option value="fayetteville_nc">Fayetteville</option>
<option value="greensboro_nc">Greensboro</option>
<option value="raleigh_nc">Raleigh</option>
<option value="winston-salem_nc">Winston-Salem</option>
</optgroup>
<optgroup label="North Dakota">
<option value="ND">North Dakota, General</option>
</optgroup>
<optgroup label="Ohio">
<option value="OH">Ohio, General</option>
<option value="akron_oh">Akron</option>
<option value="cincinnati_oh">Cincinnati</option>
<option value="cleveland_oh">Cleveland</option>
<option value="columbus_oh">Columbus</option>
<option value="dayton_oh">Dayton</option>
<option value="toledo_oh">Toledo</option>
</optgroup>
<optgroup label="Oklahoma">
<option value="OK">Oklahoma, General</option>
<option value="oklahoma_city_ok">Oklahoma City</option>
<option value="tulsa_ok">Tulsa</option>
</optgroup>
<optgroup label="Oregon">
<option value="OR">Oregon, General</option>
<option value="eugene_or">Eugene</option>
<option value="portland_or">Portland</option>
<option value="salem_or">Salem</option>
</optgroup>
<optgroup label="Pennsylvania">
<option value="PA">Pennsylvania, General</option>
<option value="philadelphia_pa">Philadelphia</option>
<option value="pittsburgh_pa">Pittsburgh</option>
</optgroup>
<optgroup label="Rhode Island">
<option value="RI">Rhode Island, General</option>
<option value="providence_ri">Providence</option>
</optgroup>
<optgroup label="South Carolina">
<option value="SC">South Carolina, General</option>
<option value="columbia_sc">Columbia</option>
</optgroup>
<optgroup label="South Dakota">
<option value="SD">South Dakota, General</option>
<option value="sioux_falls_sd">Sioux Falls</option>
</optgroup>
<optgroup label="Tennessee">
<option value="TN">Tennessee, General</option>
<option value="chattanooga_tn">Chattanooga</option>
<option value="knoxville_tn">Knoxville</option>
<option value="memphis_tn">Memphis</option>
<option value="nashville_tn">Nashville</option>
</optgroup>
<optgroup label="Texas">
<option value="TX">Texas, General</option>
<option value="amarillo_tx">Amarillo</option>
<option value="arlington_tx">Arlington</option>
<option value="austin_tx">Austin</option>
<option value="brownsville_tx">Brownsville</option>
<option value="corpus_christi_tx">Corpus Christi</option>
<option value="dallas_tx">Dallas</option>
<option value="el_paso_tx">El Paso</option>
<option value="fort_worth_tx">Fort Worth</option>
<option value="garland_tx">Garland</option>
<option value="grand_prairie_tx">Grand Prairie</option>
<option value="houston_tx">Houston</option>
<option value="irving_tx">Irving</option>
<option value="laredo_tx">Laredo</option>
<option value="lubbock_tx">Lubbock</option>
<option value="mesquite_tx">Mesquite</option>
<option value="pasadena_tx">Pasadena</option>
<option value="plano_tx">Plano</option>
<option value="san_antonio_tx">San Antonio</option>
<option value="waco_tx">Waco</option>
</optgroup>
<optgroup label="Utah">
<option value="UT">Utah, General</option>
<option value="salt_lake_city_ut">Salt Lake City</option>
</optgroup>
<optgroup label="Vermont">
<option value="VT">Vermont, General</option>
</optgroup>
<optgroup label="Virginia">
<option value="VA">Virginia, General</option>
<option value="alexandria_va">Alexandria</option>
<option value="arlington_va">Arlington</option>
<option value="chesapeake_va">Chesapeake</option>
<option value="hampton_va">Hampton</option>
<option value="newport_news_va">Newport News</option>
<option value="norfolk_va">Norfolk</option>
<option value="richmond_va">Richmond</option>
<option value="virginia_beach_va">Virginia Beach</option>
</optgroup>
<optgroup label="Washington">
<option value="WA">Washington, General</option>
<option value="seattle_wa">Seattle</option>
<option value="spokane_wa">Spokane</option>
<option value="tacoma_wa">Tacoma</option>
<option value="vancouver_wa">Vancouver</option>
</optgroup>
<optgroup label="Washington DC">
<option value="DC">Washington DC, General</option>
</optgroup>
<optgroup label="West Virginia">
<option value="WV">West Virginia, General</option>
</optgroup>
<optgroup label="Wisconsin">
<option value="WI">Wisconsin, General</option>
<option value="madison_wi">Madison</option>
<option value="milwaukee_wi">Milwaukee</option>
</optgroup>
<optgroup label="Wyoming">
<option value="WY">Wyoming, General</option>
</optgroup>
</optgroup>
</select>
        </td>
      </tr>
      <tr>
        <td colspan="2">
        Your advice:<br>
          <textarea name="locbody" cols="60" rows="10"></textarea>
        </td>
      </tr>
      <tr>
        <td>Your Name: </td>
        <td><input type="text" size="30" name="locname" maxlength="60"></td>
      </tr>
      <tr>
        <td>Your Email: </td>
        <td><input type="text" size="30" name="locemail" maxlength="80"></td>
      </tr>
      <tr>
        <td>Your town/neighborhood: </td>
        <td><input type="text" size="30" name="loclocation" maxlength="80"></td>
      </tr>
      <tr>
        <td colspan="2">Your advice may be displayed for other Dating Diversions visitors in the future.</td>
      </tr>
      <tr>
        <td colspan="2"><input type="submit" value="Submit Advice"></td>
      </tr>
    </table>
  </form>
</div>  

<?php
    }
    echo '<div class="ctr" style="border: none;">';
    if ($age == 'teens') {
        echo '<a href="http://www.dpbolvw.net/qs112vpyvpxCEJJMMIJCEDGLEKIL" target="_top" onmouseover="window.status=\'http://www.freescholarshipguide.com/?af=CJ_ID1\';return true;" onmouseout="window.status=\' \';return true;">';
        echo '<img src="http://www.afcyhf.com/ia66fz2rxvGINNQQMNGIHKPIOMP" alt="" border="0"></a>';
    }
    else if (($gay != 't') && ($status == 'single')) {
        echo '<a href="http://www.jdoqocy.com/n498mu2-u1HJOORRNOHJNJMRPK" target="_top" onmouseover="window.status=\'http://www.metrodate.com/\';return true;" onmouseout="window.status=\' \';return true;">';
        echo '<img src="http://www.awltovhc.com/jn121nswkqo9BGGJJFG9BFBEJHC" alt="Metrodate.com - the Ultimate Singles Resource" border="0"/></a>';
    }
    else if (($gender == 'gfemale') && ($status == 'single')) {
        echo '<a href="http://www.kqzyfj.com/ra98xdmjdl0277AA670213A23A3" target="_top" onmouseover="window.status=\'http://www.metrodate.com/\';return true;" onmouseout="window.status=\' \';return true;">Metrodate.com welcomes alternative lifestyle singles and couples to explore their fantasies with our singles service.</a>';
        echo '<img src="http://www.tqlkg.com/d7108tkocig1388BB781324B34B4" width="1" height="1" border="0"/>';
    }
    else if (($gender == 'gmale') && ($status == 'single')) {
        echo '<a href="http://www.dpbolvw.net/qd122wktqks79EEHHDE798D9AADD" target="_top" onmouseover="window.status=\'http://www.gay.com\';return true;" onmouseout="window.status=\' \';return true;">';
        echo '<img src="http://www.awltovhc.com/c9102xjnbhf0277AA67021623366" alt="gay.com premium personals" border="0"/></a>';
    }
    else if ($age == 'twenties') {
        echo '<a href="http://www.tkqlhce.com/6i104y1A719PRWWZZVWPRQTWZWSW" target="_top" onmouseover="window.status=\'http://www.gameaccount.com\';return true;" onmouseout="window.status=\' \';return true;">';
        echo '<img src="http://www.tqlkg.com/tn83c37w1-LNSSVVRSLNMPSVSOS" alt="Win a Nintendo DS" border="0"></a>';
    }
    else {
        echo '<a href="http://www.kqzyfj.com/s9118ar-xrzEGLLOOKLEGFHNMFOH" target="_top" onmouseover="window.status=\'http://www.astrology.com\';return true;" onmouseout="window.status=\' \';return true;">';
        echo '<img src="http://www.tqlkg.com/47102tkocig1388BB781324A92B4" alt="Try a FREE sample Compatability Report!" border="0"></a>';
    }
?>
</div>

<div class="ctr" style="border: none;">
<a href="http://www.dpbolvw.net/l965qgpmgo35AADD9A3547BD76C" target="_top" onmouseover="window.status='http://www.spreadshirt.com/shop.php?sid=1000';return true;" onmouseout="window.status=' ';return true;">
<img src="http://www.ftjcfx.com/4i77c37w1-LNSSVVRSLNMPTVPOU" alt="Spreadshirt Designer" border="0"></a>
</div><br>

<?php
    if ($age == 'twenties') {
        echo '<h2>Interested in Joining a Message Board Community?</h2>';
        echo '<a href="http://www.4thkingdom.com/index.html">The 4thKingdom</a> is a unique, private community seeking new members.<br><b>It\'s not your typical online community:</b> No pop-ups or ad banners, friendly and intelligent members, everything is kept private, oh yeah and it\'s free to be a member.  You\'ll meet some great people, guaranteed. <a href="http://www.4thkingdom.com/index.html">Have a look.</a><br><br>';
    }
    else
        echo '<h2><a href="/">Check out the rest of our site</a></h2>We have a lot more to offer than just this test! For one thing, we have another test. ;) And check out today\'s articles, advice, jokes, and more.';
?>

<?php
     /*
<h2>One Final Word From Our Sponsor:</h2>

<b>Jamster is having a promotion, <a href="http://www.dpbolvw.net/r365ox52x4KMRRUUQRKMLOSPSRS" target="_top" onmouseover="window.status='http://www.jamster.com';return true;" onmouseout="window.status=' ';return true;">get a free screen saver for your cell phone!</a><br>
Examples of screen savers Jamster carries are below.<br>
There is also a <a href="http://www.dpbolvw.net/s265xdmjdl0277AA67021486586" target="_top" onmouseover="window.status='http://www.jamster.com';return true;" onmouseout="window.status=' ';return true;">Free Ringtone Promotion</a>.</b><br><br>
<table><tr><td style="padding: 10px;"><img src="/store/jam/dice.gif"></td><td style="padding: 10px;"><img src="/store/jam/hypno.gif"></td><td style="padding: 10px;"><img src="/store/jam/heart.gif"></td><td style="padding: 10px;"><img src="/store/jam/scorp.gif"></td></tr>
<tr><td style="padding: 10px;"><img src="/store/jam/pimp.gif"></td><td style="padding: 10px;"><img src="/store/jam/puppy.gif"></td><td style="padding: 10px;"><img src="/store/jam/summer.gif"></td><td style="padding: 10px;"><img src="/store/jam/fire.gif"></td></tr></table>
<img src="http://www.lduhtrp.net/27103xjnbhf0277AA67021485878" width="14" height="4" border="0"><img src="http://www.awltovhc.com/jt82z15u-yJLQQTTPQJLKNRPORP" width="15" height="2" border="0"><br>
*/
  ?>

</body></html>
<?php
    $trans = TransManager::getInstance();
    $trans->beginTrans();
    $pdo = $trans->getPDO();

    $year = date('Y');
    $month = date('M');
    $monthnum = date('m');
    $day = date('d');
    $stmt = $pdo->prepare('SELECT lq_stats_id FROM lq_stats WHERE year = ? AND month = ? AND day = ?');
    $stmt->bindParam(1, $year);
    $stmt->bindParam(2, $month);
    $stmt->bindParam(3, $day);
    $stmt->execute();
    $lqstatsid = 0;
    if ($myrow = $stmt->fetch(PDO::FETCH_NUM))
        $lqstatsid = $myrow[0];

    if ($lqstatsid == 0) {
        $stmt = $pdo->prepare('INSERT INTO lq_stats (year, month, day, month_num) VALUES (?, ?, ?, ?)');
        $stmt->bindParam(1, $year);
        $stmt->bindParam(2, $month);
        $stmt->bindParam(3, $day);
        $stmt->bindParam(4, $monthnum);
        $stmt->execute();

        $stmt = $pdo->prepare('SELECT max(lq_stats_id) FROM lq_stats');
        $stmt->execute();
        $myrow = $stmt->fetch(PDO::FETCH_NUM);
        $profstatsid = $myrow[0];
    }

    $stmt = $pdo->prepare('UPDATE lq_stats SET total = total + 1 WHERE lq_stats_id = ?');
    $stmt->bindParam(1, $lqstatsid);
    $stmt->execute();

    $trans->commit();
    $trans->disconnect();
}

function loneliness($lonely, $x) {
    if ($lonely < 10) {
        if ($x < 2)
            return 'Your LQ is incredibly low, indicative of quite a satisfying social life.  Congratulations on scoring so low.';
        else 
            return 'Your LQ of '. $lonely .' is incredibly low, meaning your level of loneliness is practically non-existent. This is great news for you.';
    }
    else if ($lonely < 20) {
        if ($x == 0)
            return 'Your LQ is very low, suggesting that you are living a satisfying social life. You\'re score is on the healthy end of the spectrum.';
        else if ($x == 1)
            return 'This is a low LQ indeed.  You are not a very lonely person at all and your social life seems to be very much in order.';
        else if ($x == 2)
            return 'An LQ of '. $lonely .' is quite low indeed, meaning your social life is quite satisfying to you. Let\'s see how the major areas of interest  measure up for you.';
        else if ($x == 3)
            return $lonely .' is quite a low LQ, suggesting your social life is about what you want it to be. You are definitely on the low-end of the spectrum.';
    }
    else if ($lonely < 35) {
        if ($x == 0)
            return 'Your LQ score is definitely on the lower end, which suggests your social interactions are on track. There is, of course, some room for improvement. Let\'s look a little bit deeper.';
        else if ($x == 1)
            return 'Your LQ score suggests your relationships are rather healthy. Your score is on the lower end of the spectrum. Let\'s take a look at each area of interest.';
        else if ($x == 2)
            return 'An LQ of '. $lonely .' is on the lower end, and this is quite a good thing. You may experience occassional loneliness, but you are definitely on the healthier side of the spectrum.';
        else if ($x == 3)
            return $lonely .' is a rather low LQ, meaning your social relations are rather on track. There is some room for improvement, but overall you are doing well.';
    }
    else if ($lonely < 50) {
        if ($x == 0)
            return 'Your LQ is below 50, suggesting that there are some issues, but overall your situation is not bad. However there is room for improvement. Let\'s try to discover your problem areas.';
        else if ($x == 1)
            return 'Your LQ score could be better, but you are certainly not in an unhealthy zone.  You should take care, however, to resolve some of the issues that prevent you from achieving a lower score.';
        else if ($x == 2)
            return 'An LQ score of '. $lonely .' not the best, however it is still on the healthier side of the meter. This score is indicative of some problems that could be worked out, and we will take a closer look at specific areas of interest.';
        else if ($x == 3)
            return $lonely .' is still a somewhat decent score, however there is definite room for improvement. We will examine the issues that could use work and see what can be done about them.';
    }
    else if ($lonely < 65) {
        if ($x == 0)
            return 'Your LQ score is a bit on the higher end, meaning you\'ve got some issues that need to be worked out. We will examine them and then suggest possible remedies.';
        else if ($x == 1)
            return 'Because your LQ is above 50, it is clear there is significant loneliness in your life. On the bright side, there are things you can do to reduce your LQ. We will take a look at some specific areas where loneliness may stem from.';
        else if ($x == 2)
            return 'An LQ score of '. $lonely .' is approaching the higher end, meaning you\'ve got some relationship issues to sort out. We will examine these issues in greater depth and see what can be done about them.';
        else if ($x == 3)
            return 'A score of '. $lonely .' is certainly not the best, underscoring a definite need for improvement. Your loneliness appears to be rather high, and this ought to be addressed.';
    }
    else if ($lonely < 81) {
        if ($x == 0)
            return 'This LQ score reveals significant loneliness in your life that must be dealt with. We will examine possible causes and present suggestions on how to lower your score.';
        else if ($x == 1)
            return 'An LQ this high definitely signals a need to take action to decrease your level of loneliness. No one should be lonely, and we will now explore some possible sources of your high LQ.';
        else if ($x == 2)
            return 'An LQ of '. $lonely .' is rather high and shows the clear need to address your level of loneliness. Possible causes will be discussed and below you will find several suggestions to improve your LQ score.';
        else if ($x ==3)
            return $lonely .' is a high score on the loneliness meter, suggesting that changes must be made to improve your situation. You must learn why you score highly and then what you can do to change it.';
    }
    else if ($lonely < 101) {
        if ($x == 0)
            return 'Your LQ score is significantly high, and action must be taken on your part to solve your loneliness. We will look at possible causes and then suggest potential courses of action.';
        else if ($x == 1)
            return 'This LQ score is on the far end of the meter, revealing significant loneliness that must be overcome. You don\'t have to continue being this lonely, and it is definitely solveable.';
        else if ($x == 2)
            return 'An LQ score of '. $lonely .' is very high, and should be addressed immediately. We will try to understand some of the causes of your high LQ and what can be done to lower it.';
        else if ($x == 3)
            return $lonely .' is a very high LQ score, meaning you have definite loneliness issues that must be addressed.  Such a high score means action ought to be taken to lower it to a more healthy level.';
    }
    else return '';
}

function friendissues($friendissues, $goodbad, $x) {
    if ($friendissues == 0) {
        if ($x == 0)
            return ($goodbad == 'bad' ? 'Thankfully your' : 'Your') .' relationships with friends are not a source of loneliness for you. You are doing well in this area.';
        else if ($x == 1)
            return 'You are okay in your relations with your friends'. ($goodbad == 'bad' ? ', thankfully' : '') .'. This is good.';
    }
    else if ($friendissues == 1) {
        if ($x == 0)
            return 'You\'ve got some difficulties with having friends that need improvement. This is one area you should work on.';
        else if ($x == 1)
            return 'You could help yourself by working on your relationships with friends. There is room for improvement in this area.';
    }
    else if ($friendissues > 1) {
        if ($x == 0)
            return ($goodbad == 'bad' ? 'One of your weak points' : 'A weak point for you') .' is the situation with your friends, who are one source of your loneliness problem. This is an area that needs attention.';
        else if ($x == 1)
            return ($goodbad == 'bad' ? 'One spot of weakness is your friend situation.' : 'Your friend issues are one blemish on your situation.') .' Difficulties in this area are having an impact on your loneliness, and this is something that needs improvement.';
    }
    else
        return '';
}

function familyissues($familyissues, $goodbad, $x) {
    if ($familyissues == 0) {
        if ($x == 0)
            return ($goodbad == 'bad' ? 'Thankfully, your family is' : 'Your family is also') .' not a source of loneliness for you. Sometimes family can put a strain on your life, but in your case things seem to be okay.';
        else if ($x == 1)
            return ($goodbad == 'bad' ? 'Luckily in your case, ' : 'Additionally,') .' your family situation is not causing you any troubles. A positive family situation is definitely helpful.';
    }
    if ($familyissues == 1) {
        if ($x == 0)
            return ($goodbad == 'bad' ? 'Additionally,' : 'However,') .' some family-related issues are partly to blame for your level of loneliness. Solving family issues can often be tricky, but doing so will improve your score.';
        else if ($x == 1)
            return ($goodbad == 'bad' ? 'In addition,' : 'However,') .' your family relations, or lack thereof, are '. ($goodbad == 'bad' ? 'another weak spot in terms of' : 'partly to blame for') .' your loneliness. This is an area that can use improvement.';
    }
    else if ($familyissues > 1) {
        if ($x == 0)
            return ($goodbad == 'bad' ? 'Another' : 'A') .' definite source of loneliness for you is your family, or lack thereof. See if you can counteract this negative effect by improving relations, if at all possible.';
        else if ($x == 1)
            return 'Part of your loneliness '. ($goodbad == 'bad' ? 'also' : '') .' stems from your family situation.  If any improvements can be made in this area, you should go for it.  Improving your family situation can lower your LQ.';
    }
    else return '';
}

function loveissues($loveissues, $goodbad, $x, $osex, $status) {
    if ($loveissues == 0) {
        if ($x == 0)
            return 'Importantly, your current romantic situation seems not to be a source of unhappiness for you. You and your special '. $osex .' don\'t seem to have any major difficulties.';
        else if ($x == 1)
            return ($goodbad == 'bad' ? 'On the bright side,' : 'Furthermore,') .' your current romantic situation is not a source of loneliness in your life. This is a bright spot for you.';
    }
    else if ($loveissues == 1) {
        if ($x == 0)
            return 'You are not completely fulfilled in your romantic life, and this is an area that can be improved upon.  However, it does not seem like anything drastic is in order.';
        else if ($x == 1)
            return 'An '. ($goodbad == 'bad' ? 'additional' : '') .' area for improvement is your love life, which is not in terrible shape, but can be improved.';
    }
    else if ($loveissues == 2) {
        if ($x == 0)
            return 'Your romantic life'. ($goodbad == 'bad' ? ' is another' : ', however, is a') .' source of some dissatisfaction. It is imperative that improvements be made in this area to lower your LQ.'. ($status == 'single' ? ' Finding a '. $osex .' to share your life with will help.' : ' You need to work through your troubles with your significant other.');
        else if ($x == 1)
            return 'Your romantic life'. ($goodbad == 'bad' ? ' also' : ', however,') .' needs work. There is a lot of room for improvement there, and you really need to ' . ($status == 'single' ? 'search for that '. $osex .' of your dreams.' : 'work things out with your partner.');
    }
    else if ($loveissues > 2) {
        if ($x == 0)
            return ($goodbad == 'bad' ? 'Another major weak spot for you is your romantic life.' : 'Your romantic life is, however, not a pretty picture.') .' Significant improvements need to be made in this area to combat your loneliness. Finding a '. $osex .' who compliments you '. ($status == 'single' ? '' : 'better') .' will greatly reduce your LQ.';
        else if ($x == 1)
            return ($goodbad == 'bad' ? 'An even worse area for you is your romantic life.' : 'Things look much more bleak in your romantic life.') .' Making improvements here by finding a good '. $osex .' can drastically cut your level of loneliness.'. ($status == 'single' ? '' : ' Your current relationship is far from ideal.');
    }
    else return '';
}

function shyness($shyness, $friendgoodbad, $lovegoodbad, $x, $osex) {
    if ($shyness == 0) {
        if (($lovegoodbad == 'bad') && ($friendgoodbad == 'bad')) {
            if ($x == 0)
                return 'Luckily, shyness is not a setback for you, which makes resolving the sources of your loneliness easier.';
            else if ($x == 1)
                return 'Thankfully you do not have a problem with shyness, so pursuing romantic leads and finding friends will not be as difficult as it might have been.';
        }
        else if ($lovegoodbad == 'bad') {
            if ($x == 0)
                return 'Luckily, shyness is not a setback for you, which makes solving your romance issues easier.';
            else if ($x == 1)
                return 'Thankfully you do not have a problem with shyness, so pursuing romantic leads will not be as difficult for you.';
        }
        else if ($friendgoodbad == 'bad') {
            if ($x == 0)
                return 'You do not appear to be shy, therefore completing achieving well-roundedness by pursuing friendships should not be difficult.';
            else if ($x == 1)
                return 'And because you are not shy, you can compliment your romantic relationship by pursuing stronger friendships.';
        }
        else
            return '';
    }
    if ($shyness == 1) {
        if (($lovegoodbad == 'bad') && ($friendgoodbad == 'bad')) {
            if ($x == 0)
                return 'You have a degree of shyness, so you must try to overcome that in order to bring love and friendships into your life.';
            else if ($x == 1)
                return 'Some shyness is evident in you and must be overcome in order to make friends and find true love.';
        }
        else if ($lovegoodbad == 'bad') {
            if ($x == 0)
                return 'You\'re a bit shy, which will be an obstacle in finding satisfying romance, but you should overcome this.';
            else if ($x == 1)
                return 'You need to learn to be more outgoing in order to solve your issues with love and intimacy.';
        }
        else if ($friendgoodbad == 'bad') {
            if ($x == 0)
                return 'Though you don\'t have major issues in the love and romance department, you must overcome shyness to develop a larger network of friends in order to reduce your LQ.';
            else if ($x == 1)
                return 'Even though your love life is on track, you may be finding that shyness is preventing you from achieving a well-rounded network of aquaintances in your life.';
        }
        else
            return '';
    }
    else if ($shyness > 1) {
        if (($lovegoodbad == 'bad') && ($friendgoodbad == 'bad')) {
            if ($x == 0)
                return 'Shyness is one major factor holding you back.  In order to eliminate your loneliness you must overcome your difficulty with interacting with others.';
            else if ($x == 1)
                return 'In order to find true love and friendships you must learn to defeat your shyness and increase your interactions with people.';
        }
        else if ($lovegoodbad == 'bad') {
            if ($x == 0)
                return 'One main thing holding you back from finding that '. $osex .' of your dreams is your introversion.  You must overcome your shyness to improve your odds of finding true love.';
            else if ($x == 1)
                return 'But how can you be sure to find that love of your life when you face such an obstacle due to shyness?  You must overcome this in order to find your true love.';
        }
        else if ($friendgoodbad == 'bad') {
            if ($x == 0)
                return 'Despite being satisfied in the arena of love, your high level of shyness is holding you back from truely reducing your LQ.  Expanding your circle of friends will come more easily if you can overcome this obstacle.';
            else if ($x == 1)
                return 'Shyness, however, is a limiting factor for you.  Overcoming your shyness can help reduce overall loneliness by allowing you to expand your social interactions.';
        }
        else
            return 'The test has also revealed a high level of shyness, and if you can overcome this obstacle you can decrease your LQ further by expanding your social interactions.';
    }
    else return '';
}

function location($location, $goodbad, $x) {
    if ($location == 0) {
        if ($x == 0)
            return ($goodbad == 'bad' ? 'Thankfully you live in an area where there are your type of people around.' : '');
        else if ($x == 1)
            return ($goodbad == 'bad' ? 'At least you live in an area with good people around you.' : '');
    }
    if ($location == 1) {
        if ($x == 0)
            return ($goodbad == 'bad' ? 'Things are a little more difficult since you are not surrounded by people who match well with you, but good people are out there.' : '');
        else if ($x == 1)
            return ($goodbad == 'bad' ? 'It\'s a shame that you don\'t live in an area where you are surrounded by people similar to you, but certainly there are some out there.' : '');
    }
    else if ($location > 1) {
        if ($x == 0)
            return ($goodbad == 'bad' ? 'Complicating the situation further is the fact that you don\'t live in a good location for finding similar people.  You may need to look outside your current area or simply dig deeper.' : 'It\'s a shame that your area doesn\'t have a lot of like-minded people, which is one factor making it difficult to lower your LQ further.');
        else if ($x == 1)
            return ($goodbad == 'bad' ? 'Compounding the shyness problem is the lack of people in your area who you can get along with. It\'s difficult, but you must look that much harder to find people to interact with.' : 'Even though you\'re a relatively outgoing person, it\'s hard for you to meet interesting people due to the area you live in.  You need to look harder or expand your boundaries to further lower your LQ score.');
    }
    else return '';
}

function insecurity($insecurity, $x) {
    if ($insecurity == 0) {
        if ($x == 0)
            return 'Finally, a bright spot for you is that you don\'t suffer any major insecurity issues.  This fact helps keep your LQ lower than what it might have been.';
        else if ($x == 1)
            return 'You definitely don\'t have any major insecurity issues holding you back, so your pursuit of elimating loneliness will not be held back by this potential pitfall.';
    }
    if ($insecurity == 1) {
        if ($x == 0)
            return 'Finally, there are some insecurity issues that you should work out.  Improving your self-esteem will help you improve your LQ score.';
        else if ($x == 1)
            return 'On a final note, there seem to be some insecurity issues that you need to work through.  Improving self-esteem will aid you in lowering your LQ.';
    }
    else if ($insecurity > 1) {
        if ($x == 0)
            return 'Personal insecurity is playing a major role in limiting your healthy interactions with others, and by working on this factor you can help decrease your LQ further.';
        else if ($x == 1)
            return 'Finally, it is important that you address some major insecurity issues you seem to have. This will enable you to further improve your social interactions and reduce your loneliness even further.';
    }
    else return '';
}

?>
