Inner Child Card Pick

  • Home
  • Inner Child Card Pick

Lightworker Cards

 

 


<?
include (‘header_main.php’);
echo ”
“;

/* **************************************************************************************************************
PrevScreen: pickcard1.php
Inputs: DeckID (the deck of cards to use) (default = 1)
Cards (the number of cards to be displayed) (default = 1)
User Question (optional question by user)
Outputs: Display 1 or 3 cards or display 1 goddess card plus chakra card
Link to redraw
Links to other Lightworker sections
**************************************************************************************************************
*/

// ====================== M A I N P R O G R A M =====================

// ******************************* set variables ********************

$dbhost = “localhost”;
$user = “cards”;
$password = “humanLight”;
$db = “cards”;

$numOfCards = $_POST[‘numOfCards’];

// FEB02 – added deckID code here
$inDeckID = $_POST[‘deckID’]; // either 1 for innerChild or 2 for flowers
if ($inDeckID == “”) { $inDeckID = 1; }

switch ($inDeckID) {
case 1:
$imageWidth = 150; // inner child cards
$imgDir = “ $imgHeader = ““;
$backLink = “Draw Again“;
break;
case 2:
$imageWidth = 200; // flower cards
$imgDir = “ $imgHeader = ““;
$backLink = “Draw Again“;
break;
case 3:
$imageWidth = 216; // goddess cards
$imgDir = “ $imgHeader = ““;
$backLink = “Draw Again“;
break;
case 4:
$imageWidth = 200; // chakra cards not shown on their own
$imgDir = “ $imgHeader = ““;
$backLink = “Draw Again“;
break;
case 5:
$imageWidth = 300; // eol cards
$imgDir = “ $imgHeader = ““;
$backLink = “Draw Again“;
break;
}

// ************************************** open table that encloses entire page ****************************************
echo ”

“;

// ************************************************ show heading in a table *****************************************************************************************************
echo ”

“;
echo ”

“;
echo $imgHeader;
echo “
“;
echo “” . $backLink . “

“;

// ************************************************ show user’s question *******************************************************************************************************
echo ”


” . $question . “

” ;

// ************************************************ get card IDs from database ***********************************************
mysql_connect($dbhost,$user,$password) or die(“server error”);
mysql_select_db($db) or die(“database error”);

srand(mktime());

// FEB02 – modified line below for deckID
$result = mysql_query(“SELECT cardID from cards where deckID = $inDeckID”);

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if doing 3 card %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if ($numOfCards == 3) {

$rnum1 = rand() % mysql_numrows($result);

while ($rnum2 == “” || $rnum2 == $rnum1) {
$rnum2 = rand() % mysql_numrows($result);
}
while ($rnum3 == “” || $rnum3 == $rnum1 || $rnum3 == $rnum2) {
$rnum3 = rand() % mysql_numrows($result);
}

$cardID1 = mysql_result($result,$rnum1,”cardID”);
$cardID2 = mysql_result($result,$rnum2,”cardID”);
$cardID3 = mysql_result($result,$rnum3,”cardID”);

$IDarray = array (1=>$cardID1, 2=>$cardID2, 3=>$cardID3); // (1=>80, 2=>10, 3=>20)
asort ($IDarray); // (2=>10, 3=>20, 1=>80) sort array by number order but maintain keys
reset ($IDarray); // put pointer at 1st item
$i = 0;
while (list ($key, $val) = each ($IDarray) ) { // for each key/value pair
$displayRow[$key] = $i; // build array showing which SQL row to display in which order eg. array(3,1,2)
$i = $i + 1;
} // echo “$key => $val
“;
$sql = “SELECT cardImage, cardName, cardName2, cardInfo, cardType, archetype, planet, zodiac FROM cards where cardID in (” . $cardID1 . “,” . $cardID2 . “,” . $cardID3 . “)”;
$result = mysql_query($sql);

// ************************************* Display 3 Cards in Row *************************************************
?>

The Past

<?
print “” . mysql_result($result,$displayRow[1],”cardName”) . ““;
?>

<? print $imgDir . mysql_result($result,$displayRow[1],”cardImage”) . “‘ width='” . $imageWidth .”‘ height=’237’>”;

?>

The Present

<?
print “” . mysql_result($result,$displayRow[2],”cardName”) . ““;
?>

<? print $imgDir . mysql_result($result,$displayRow[2],”cardImage”) . “‘ width='” . $imageWidth . “‘ height=’237’>”;
?>

The Future

<?
print “” . mysql_result($result,$displayRow[3],”cardName”) . ““;

?>

<? print $imgDir . mysql_result($result,$displayRow[3],”cardImage”) . “‘ width='” . $imageWidth . “‘ height=’237’>”;
?>

<? // ************************************* Display Card Details ************************************************* ?>

The Past



<? echo mysql_result($result,$displayRow[1],”cardName”); ?>
<?
if (mysql_result($result,$displayRow[1],”cardName2″) <> “”)
echo ”
” . mysql_result($result,$displayRow[1],”cardName2″);
?>


<? echo mysql_result($result,$displayRow[1],”cardInfo”); ?>
<?
if (mysql_result($result,$displayRow[1],”archetype”) <> “”)
echo ”
Traditional Archetype: ” . mysql_result($result,$displayRow[1],”archetype”) . ““;
if (mysql_result($result,$displayRow[1],”planet”) <> “”)
echo ”
Planetary ruler: ” . mysql_result($result,$displayRow[1],”planet”) . ““;
if (mysql_result($result,$displayRow[1],”zodiac”) <> “”)
echo ”
Zodiacal ruler:: ” . mysql_result($result,$displayRow[1],”zodiac”) . ““;
?>

The Present



<? echo mysql_result($result,$displayRow[2],”cardName”); ?>
<?
if (mysql_result($result,$displayRow[2],”cardName2″) <> “”)
echo ”
” . mysql_result($result,$displayRow[2],”cardName2″);
?>


<? echo mysql_result($result,$displayRow[2],”cardInfo”); ?>
<?
if (mysql_result($result,$displayRow[2],”archetype”) <> “”)
echo ”
Traditional Archetype: ” . mysql_result($result,$displayRow[2],”archetype”) . ““;
if (mysql_result($result,$displayRow[2],”planet”) <> “”)
echo ”
Planetary ruler: ” . mysql_result($result,$displayRow[2],”planet”) . ““;
if (mysql_result($result,$displayRow[2],”zodiac”) <> “”)
echo ”
Zodiacal ruler:: ” . mysql_result($result,$displayRow[2],”zodiac”) . ““;
?>

The Future



<? echo mysql_result($result,$displayRow[3],”cardName”); ?>
<?
if (mysql_result($result,$displayRow[3],”cardName2″) <> “”)
echo ”
” . mysql_result($result,$displayRow[3],”cardName2″);
?>


<? echo mysql_result($result,$displayRow[3],”cardInfo”); ?>
<?
if (mysql_result($result,$displayRow[3],”archetype”) <> “”)
echo ”
Traditional Archetype: ” . mysql_result($result,$displayRow[3],”archetype”) . ““;
if (mysql_result($result,$displayRow[3],”planet”) <> “”)
echo ”
Planetary ruler: ” . mysql_result($result,$displayRow[3],”planet”) . ““;
if (mysql_result($result,$displayRow[3],”zodiac”) <> “”)
echo ”
Zodiacal ruler:: ” . mysql_result($result,$displayRow[3],”zodiac”) . ““;
?>

 

Return to top

<? // *********************************** close database **************************************** mysql_close(); } // end of if cards = 3 else { //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if doing 1 card %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% $rnum1 = rand() % mysql_numrows($result); $cardID1 = mysql_result($result,$rnum1,”cardID”); $sql = “SELECT cardImage, cardName, cardName2, cardInfo, cardType, archetype, planet, zodiac FROM cards where cardID = ” . $cardID1; $result = mysql_query($sql); // ************************************* Display 1 Card then Detail across page ***************************************** ?>

<? print $imgDir . mysql_result($result,$displayRow[1],”cardImage”) . “‘ width='” . $imageWidth . “‘>”;
?>

<? echo mysql_result($result,$displayRow[1],”cardName”); ?>
<?
if (mysql_result($result,$displayRow[1],”cardName2″) <> “”)
echo ”
” . mysql_result($result,$displayRow[1],”cardName2″);
?>

<? echo mysql_result($result,$displayRow[1],”cardInfo”); ?>

<?
if (mysql_result($result,$displayRow[1],”archetype”) <> “”)
echo ”
Traditional Archetype: ” . mysql_result($result,$displayRow[1],”archetype”) . ““;
if (mysql_result($result,$displayRow[1],”planet”) <> “”)
echo ”
Planetary ruler: ” . mysql_result($result,$displayRow[1],”planet”) . ““;
if (mysql_result($result,$displayRow[1],”zodiac”) <> “”)
echo ”
Zodiacal ruler:: ” . mysql_result($result,$displayRow[1],”zodiac”) . ““;
?>

<?

if ($inDeckID == 3) { // also display a chakra card as well if doing goddess cards

$imgDir = “

<? print $imgDir . mysql_result($result,$displayRow[1],”cardImage”) . “‘ width='” . $imageWidth . “‘>”;
?>

<? echo mysql_result($result,$displayRow[1],”cardName”); ?>

<? echo mysql_result($result,$displayRow[1],”cardInfo”); ?>

 

<? } // end of if $inDeckID == 3 ?>

<? // *********************************** close database **************************************** mysql_close(); } // end of if cards = 1 ?>

<?

// ********************************************** display footer & credits ****************************************
if ($inDeckID == “5”) {
include (‘includes/james.inc’);
} else {
include (‘includes/isha.inc’);
}
echo ”

“;
include (‘footer.php’);

// ********************************************** close outer table and HTML **************************************
echo ”

“;
echo “”;
echo “”;

?>[/vc_column][/vc_row][/vc_row]