New Query

'; } else { $q = $_POST['criteria']; } if (empty($_POST['critter'])) { $qc = ''; $message .= '

New Query

'; } else { $qc = $_POST['critter']; } if (empty($_POST['displaytype'])) { $displaytype = ''; $message .= '

Invalid Display Type Value

'; } else { $displaytype = $_POST['displaytype']; } if (empty($_POST['displayrows'])) { $displayrows = ''; $message .= '

Invalid Display Rows Value

'; } else { $displayrows = $_POST['displayrows']; } if (empty($_POST['displaycnt'])) { $displaycnt = 0; $message .= '

Invalid Display Cnt Value

'; } else { $displaycnt = $_POST['displaycnt']; } if (!strlen($q) > 0 ) { $q = $qc; } if (!strlen($displayrows) > 0 ) { $displayrows = "10"; } if (!strlen($displaytype) > 0 ) { $displaytype = "verbose"; } $hostile_yn = 'N'; if (strpos(' '.$q,'MIME-Version') > 0 | strpos(' '.$q,'multipart/mixed;') > 0 | strpos(' '.$q,'text/plain;') > 0 | strpos(' '.$q,'charset=') > 0 | strpos(' '.$q,'us-ascii') > 0 ) { $hostile_yn = 'Y'; $q = ''; } //$phpfile = 'facet-rough'; //$phpfileInitUpper = 'Facet Rough'; //$phpInventoryType = 'FACET ROUGH'; //echo " q value is: ".$q." val value is: ".$val." displaycnt: ".$displaycnt.""; //$phproot = '/php/test/'; $phproot = '/php/'; //----------------------------------------- //----------------------------------------- $thisFile = substr($SCRIPT_FILENAME,strrpos($SCRIPT_FILENAME,'/')+1,strlen($SCRIPT_FILENAME)); $thisFile = substr($thisFile,0,strrpos($thisFile,'.php')); $htmlpos = strpos($SCRIPT_FILENAME,'public_html'); /// /home/pretty4/public_html/php/gem-instruments.php $thisFileAddr ='www.PrettyRock.com'.substr($SCRIPT_FILENAME,strpos($SCRIPT_FILENAME,'public_html')+11,strlen($SCRIPT_FILENAME)); $thisQuery = substr($thisFile,strpos($thisFile,'-')+1,strlen($thisFile)); $thisQuery =substr($thisQuery,strpos($thisQuery,'-')+1,strlen($thisQuery)); $cat = substr($thisQuery,0,strpos($thisQuery,'-')); $catval = substr($thisQuery,strpos($thisQuery,'-')+1,strlen($thisQuery)); $catval = ereg_replace('-',' ',$catval); $phpInventoryType = strtoupper(ereg_replace('-',' ',$thisFile)); $phpfile1 = substr($thisFile,0,strpos($thisFile,'-')); $phpfile2 = substr($thisFile,strpos($thisFile,'-')+1,strlen($thisFile)); $phpfile3 = substr($thisFile,strrpos($thisFile,'-')+1,strlen($thisFile)); $phpfile = $phpfile1."-".$phpfile2; $phpfileInitUpper = strtoupper(substr($phpfile1,0,1)) . substr($phpfile1,1)." ".strtoupper(substr($phpfile2,0,1)) . substr($phpfile2,1); //$phpInventoryType = strtoupper($phpfileInitUpper); //----------------------------------------- //----------------------------------------- $self ="www.prettyrock.com".$phproot.$phpfile."-".$q."-".$val.".php"; $page_title = $phpfileInitUpper.' - '.ucwords($q).' - '.ucwords($val); //echo "




"; //echo '
QUERY VALUE: '. $q.' '; //echo '
QUERY CONDITION: ' . $val.' '; //echo '
FILE DIR AND NAME : '.$SCRIPT_FILENAME; //echo '
htmlpos : '.$htmlpos; //echo '
FILENAME : '.$thisFileAddr; //echo '
THISFILE : '.$thisFile; $dbsearch = strtoupper(ereg_replace('-',' ',$phpfile)); //echo "
phpfile1 ".$phpfile1."
"; //echo "phpfile22 ".$phpfile22."
"; //echo "phpfile3 ".$phpfile3."
"; //echo "phpfile2 ".$phpfile2."
"; //echo "phpfile ".$phpfile."
"; //echo "dbsearch ".$dbsearch."
"; //echo $thisFile." ".$thisQuery." ".$cat." ".$catval."
"; //echo $phproot." ".$phpfile." ".$phpfileInitUpper." ".$phpInventoryType."
"; //echo $phpfile." ".$phpInventoryType." ".$phpInventoryType2."
"; //----phpfile1 facet //----phpfile2 rough //----phpfile facet-rough //----facet-rough-all-recent all-recent all recent //----/php/ facet-rough Facet Rough FACET ROUGH //--echo ''. $page_title.' - PrettyRock.com'; //--include_once ('phptop.htm'); $callName = substr($SCRIPT_FILENAME,strrpos($SCRIPT_FILENAME,'/')+1,strlen($SCRIPT_FILENAME)); $callName = substr($callName,0,strrpos($callName,'.php')); $callName = ucwords(ereg_replace('-',' ',$callName)); //include ('phptop.php'); //--html_header($callName); print_header('Facet Rough'); //echo ' FILE NAME ONLY: ' . $thisQuery. ' $cat:'.$cat. ' $catval: '.$catval; //echo ' subval: '.substr($val,0,4).' valnum:'.substr($val,4,10); if (substr($val,0,4)=='less') { $val = '<'.substr($val,4,10); } if (substr($val,0,4)=='more') { $val = '>'.substr($val,4,10); } if ($q=='%') { $q = ''; } echo '
'; echo ''; echo ' 0 && $w_cnt < 5) { //--echo '

$q is:'.$q2.' strpos is: '.strpos($q2," ").''; $w_cnt++; $q1 = substr($q2,0,strpos($q2," ")); $q2 = substr($q2,strpos($q2," ")+1,strlen($q2)); //--remove plurals $chk_plural =substr($q1,strlen($q1)-2,2); //echo '

last char of q1: '.$chk_plural.'

'; if (strtoupper(substr($chk_plural,0,1)) != 'S' & strtoupper(substr($chk_plural,1,1)) == 'S' ) { //echo 'truncating plural'; $q1 = substr($q1,0,strlen($q1)-1); } //--remove suffix "ING" $chk_ING = strtoupper(substr($q1,strlen($q1)-3,3)); //echo '

last 3 chars of q1: '.$chk_ING.' length: '.strlen($q1).'

'; if (strlen($q1) > 6 & $chk_ING == 'ING') { $chk_double1 = strtoupper(substr($q1,strlen($q1)-5,1)); $chk_double2 = strtoupper(substr($q1,strlen($q1)-4,1)); //echo '

double1: '.$chk_double1.' double2: '.$chk_double2.'

'; if ($chk_double1 == $chk_double2) { //echo 'truncating ing & double'; $q1 = substr($q1,0,strlen($q1)-4); } else { //echo 'truncating ing'; $q1 = substr($q1,0,strlen($q1)-3); } } $where = $where . " and concat(concat(concat(concat(item_type,' '),name),' '),IF(related_keywords is null,' ',related_keywords)) like '%".$q1."%'"; } //--end of while strpos //--remove plurals $chk_plural =substr($q2,strlen($q2)-2,2); //echo '

last char of q2: '.$chk_plural.'

'; if (strtoupper(substr($chk_plural,0,1)) != 'S' & strtoupper(substr($chk_plural,1,1)) == 'S' ) { //echo 'truncating plural'; $q2 = substr($q2,0,strlen($q2)-1); } //--remove suffix "ING" $chk_ING = strtoupper(substr($q2,strlen($q2)-3,3)); //echo '

last 3 chars of q2: '.$chk_ING.' length: '.strlen($q2).'

'; if (strlen($q2) > 6 & $chk_ING == 'ING') { $chk_double1 = strtoupper(substr($q2,strlen($q2)-5,1)); $chk_double2 = strtoupper(substr($q2,strlen($q2)-4,1)); //echo '

double1: '.$chk_double1.' double2: '.$chk_double2.'

'; if ($chk_double1 == $chk_double2) { //echo 'truncating ing & double'; $q2 = substr($q2,0,strlen($q2)-4); } else { //echo 'truncating ing'; $q2 = substr($q2,0,strlen($q2)-3); } } $q1 = $q2; $where = $where . " and concat(concat(concat(concat(item_type,' '),name),' '),IF(related_keywords is null,' ',related_keywords)) like '%".$q1."%'"; //echo '



where: '.$where.'

'; } $query_inventory = "SELECT txt ". " FROM quotes i ". " where active_yn = 'Y' ". " ORDER BY create_date asc "; $result = mysql_query ($query_inventory); //echo "query has ".mysql_num_rows($result)." rows

"; #mysql_free_result($result); #echo "r1 has ".$cnt1." rows

"; $query_rows = mysql_num_rows($result); $bottom_rows = intval($displaycnt) + 1; $top_rows = intval($displaycnt) + intval($displayrows); if ($top_rows > $query_rows) { $top_rows = $query_rows; } //--echo '$query_rows: '.$query_rows.' $top_rows: '.$top_rows.' $bottom_rows: '.$bottom_rows.' $displayrows: '.$displayrows.' $displaycnt: '.$displaycnt; if ($top_rows < $query_rows | $displayrows < $query_rows ) { echo '
Thank you for coming to our website and '. 'taking the time to enjoy the bible quotes we have included for you.'. ' My wife Beth and I are Christians and we felt that our online store would be a great way to witness to others. '. 'We do not appreciate heavy handed sales pitches when shopping and we take that to heart '. 'when we sell to you and when we express our faith. We are not trying to convince anyone of anything or convince ourselves '. 'that we are extra righteous with this type of thing. We just really enjoy this verses and we hope you do too. '. 'Please let us know if you have any verses or quotes related '. ' to God and His Holy Word that have really touched you and tell us '. 'how they have touched you. We can not promise to include every verse but we will certainly consider it. '. 'Thank you! Devin & Beth

'; echo '

'; echo ''. ''. ''. ''; echo ''; //'; echo ''; echo '
RowsClick to View
'; echo '
'. ''. '
'; if (intval($displaycnt) > 0) { echo ''; } echo ' << Previous Rows '; if ($displaycnt > 0) { echo ''; } echo '
'. 'Viewing '.$bottom_rows.' - '.$top_rows.' out of '.$query_rows.' results'; echo ''. '
'; if ($query_rows > (intval($displaycnt) + intval($displayrows)) ) { echo ''; } echo ' Next Rows >> '; if ($query_rows > (intval($displaycnt) + intval($displayrows)) ) { echo ''; } echo '
'. '
'; } $cnt = 0; $page_cnt = 0; #echo "

RESULT TYPE: ".$result_type."

"; // 'Christmas ONE DAY ONLY Sale! 50% Off!'. echo '
'; while ($row = mysql_fetch_array ($result)) { $cnt++; if ( $cnt > intval($displaycnt) && $cnt <= (intval($displaycnt) + intval($displayrows))) { $page_cnt++; echo ''; } } // End of while loop. echo '
'.$row['txt'].'
'; echo ''; if ($cnt > 0) { if ($top_rows < $query_rows | $displayrows < $query_rows ) { echo '

'. ''. '
'; if ($displaycnt > 0) { echo ''; } echo ' << Previous Rows '; if ($displaycnt > 0) { echo ''; } echo '
'. 'Viewing '.$bottom_rows.' - '.$top_rows.' out of '.$query_rows.' results'; echo ''. '
'; if ($query_rows > (intval($displaycnt) + intval($displayrows)) ) { echo ''; } echo ' Next Rows >> '; if ($query_rows > (intval($displaycnt) + intval($displayrows)) ) { echo ''; } echo '
'. '
'; } echo ''; echo ''. ''. '
'. 'Click Images for More Information.
'; if ($cnt < 2 && $displaytype == "verbose") { echo '






'; } if ($cnt < 14 && $displaytype == "brief") { echo '















'; } } $page_name = $REQUEST_URI; if (getenv(HTTP_X_FORWARDED_FOR)) { $ip = getenv(HTTP_X_FORWARDED_FOR); } else { $ip = getenv(REMOTE_ADDR); } //--$ip = GetHostByName($REMOTE_ADDR); //--if (strpos($ip,"69.132.187") > 0) { if ($hostile_yn == 'N') { $audit = "insert into audit_search(ip,search,display_type,display_rows,query_rows,top_rows,create_date) values ". "('".$ip."','".$q."','".$displaytype."','".$displayrows."','".$query_rows."','".$top_rows."',NOW())"; $result = mysql_query ($audit); } //--} // If no records were displayed... if ($cnt == 0) { echo ''. '

'. '

'. 'Your search for "'.$q.'" returned no matches.

'. 'We apologize for any inconvenience.

'. 'Please let us know and we will be glad to work on any special request for you.
'. '



















'; } #mysql_close(); // Close the database connection. //include_once ('phpbottom.htm'); print_footer($REQUEST_URI); ?>