{"id":23,"date":"2016-10-25T00:14:59","date_gmt":"2016-10-25T00:14:59","guid":{"rendered":"http:\/\/sclrr.org\/wordpress\/?page_id=23"},"modified":"2018-02-22T22:59:56","modified_gmt":"2018-02-23T06:59:56","slug":"add-shelter-dog","status":"publish","type":"page","link":"https:\/\/www.sclrr.org\/rescue\/add-shelter-dog\/","title":{"rendered":"Add Shelter Dog"},"content":{"rendered":"<p><? require_once(ABSPATH . 'wp-content\/custom\/sclrrdbload.php'); ?><\/p>\n<p><?php\n\n\/* THIS IS ACTUAL REAL LIVE CODE!  IF YOU ARE HERE BUT NOT A PROGRAMMER, PLEASE BACK OUT WITHOUT CHANGING OR SAVING ANYTHING!!   THANKS!! *\/\n\n\/* NOTE: this page handles both pre and post submit stages.  If nothing submitted, it prints out the form.  If something is submitted, it processes it and prints out something suitable for the person who just submitted it. Note that the POST is actually submitted to an external script which does the processing, then redirects back here with a simple GET style status... This is due to WordPress restrictions on how WP pages receive input. *\/\n\n\/* note the unformat bracketing.  this is a signal to a post processing plugin to remove the returns out of the text before wordpress gets to it.  WordPress, unlike HTML, treats returns as if they were line breaks, but then that forces runon html code here -- which very quickly becomes unreadable.  trust me and leave them in place.  Take them out to see what happens, if you really want to. *\/\n\n\/\/$who = getenv(\"REMOTE_USER\");\n\n\/* let the preview mode go thru as if no get info on url *\/\nif ($_GET &#038;&#038; !$_GET['preview']) \n{\n\n\/*\n  echo('<code>\\n&#8217;);<br \/>\n  print_r($_GET);<br \/>\n  echo(&#8216;<\/code>\\n&#8217;);<br \/>\n*\/<\/p>\n<p>  switch ($_GET[&#8216;status&#8217;]) {<br \/>\n    case &#8220;incompletedesc&#8221;:<br \/>\n      echo &#8220;Some or all of the description of the dog (color\/sex\/age) is &#8220;;<br \/>\n      echo &#8220;missing.  Please hit your &#8216;back&#8217; button and fill it in and then &#8220;;<br \/>\n      echo &#8220;send the entry form again.&#8221;;<br \/>\n      break;<br \/>\n    case &#8220;noshelter&#8221;:<br \/>\n      echo &#8220;You didn&#8217;t specify which shelter.  Please hit the &#8216;back&#8217; button &#8220;;<br \/>\n      echo &#8220;and select the name of the shelter the dog is at.  If the shelter&#8217;s &#8220;;<br \/>\n      echo &#8220;name isn&#8217;t listed, please choose the OTHER for the given region.&#8221;;<br \/>\n      break;<br \/>\n    case &#8220;good&#8221;:<br \/>\n      echo &#8220;Thank you for notifying SCLRR of this dog!\\n&#8221;;<br \/>\n      echo &#8220;Feel free to add another.\\n&#8221;;<br \/>\n      break;<br \/>\n    default:<br \/>\n      echo &#8220;I&#8217;m not sure what happened!\\n&#8221;;<br \/>\n      break;<br \/>\n  }<br \/>\n}<\/p>\n<p>\/* put out blank form *\/<br \/>\nif (!$_GET || $_GET[&#8216;preview&#8217;] || $_GET[&#8216;status&#8217;]==&#8221;good&#8221;)<br \/>\n{<br \/>\n?><br \/>\n[unformat]<\/p>\n<h2>Add Shelter Dog<\/h2>\n<form method=post action=\"\/available\/add_shelter_dog_forwp.cgi\">\n<p>Please use this form to notify us of a Labrador Retriever you know<br \/>\nis in a shelter in southern California.  We appreciate your help!  If<br \/>\nyou have any questions or comments about this form, you can<br \/>\n<a href=\"mailto:[\/unformat]<? echo \"$sclrr_email\"; ?>[unformat]&#8221;>email us<\/a>.<\/p>\n<table width=95% cellpadding=10 border=0>\n<tr>\n<td valign=\"top\" width=33%>\n<p><em>Physical description of the dog in question.  If<br \/>\nthere are markings, use the general description box in the<br \/>\nlast question.<\/em><\/p>\n<p><b>Color of Lab? <\/b><br \/>\n<select size=\"1\" name=\"dog_color\"><br \/>\n[\/unformat]<br \/>\n<?\nreset($colorlist);\nforeach ($colorlist as $value) {\n  echo \"<option>$value\\n&#8221;;<br \/>\n}<br \/>\n?><br \/>\n[unformat]<br \/>\n<\/select><\/p>\n<p><b>Sex of Lab? <\/b><br \/>\n<select size=\"1\" name=\"dog_sex\"><br \/>\n[\/unformat]<br \/>\n<?\nreset($sexlist);\nforeach ($sexlist as $value) {\n  echo \"<option>$value\\n&#8221;;<br \/>\n}<br \/>\n?><br \/>\n[unformat]<br \/>\n<\/select><\/p>\n<p><b>Age of Lab? <\/b><br \/>\n<input type=\"text\" name=\"dog_age\" size=\"3\" maxlength=\"3\"><br \/>\n<select size=\"1\" name=\"dog_age_type\"><br \/>\n[\/unformat]<br \/>\n<?\nreset($agetypelist);\nforeach ($agetypelist as $value) {\n  print \"<option>$value\\n&#8221;;<br \/>\n}<br \/>\n?><br \/>\n[unformat]<br \/>\n<\/select><\/p>\n<p><b>Is this Lab a mix? <\/b><br \/>\n<select size=\"1\" name=\"dog_is_mix\"><br \/>\n[\/unformat]<br \/>\n<?\nreset($answerlist);\nforeach ($answerlist as $value) {\n  print \"<option>$value\\n&#8221;;<br \/>\n}<br \/>\n?><br \/>\n[unformat]<br \/>\n<\/select><\/p>\n<\/td>\n<td valign=\"top\" width=33%>\n<p><em>Note: different shelters have different ways of identifying dogs.  Most common is the impound number, sometimes called the tag number.  If necessary the cage number can be used, but this is tricky, because dogs are often moved around.  Fill in those that apply.<\/em><\/p>\n<p><b>Impound Number? <\/b><br \/>\n<input type=\"text\" name=\"dog_impound\" size=\"15\" maxlength=\"15\"><\/p>\n<p><b>Tag Number? <\/b><br \/>\n<input type=\"text\" name=\"dog_tag\" size=\"15\" maxlength=\"15\"><\/p>\n<p><b>Cage Number? <\/b><br \/>\n<input type=\"text\" name=\"dog_cage\" size=\"15\" maxlength=\"15\"><\/p>\n<\/td>\n<td valign=\"top\" width=33%>\n<p><em>Find out when the dog is available for adoption if at all possible.<\/em><\/p>\n<p><b>Date Lab is available <br \/>\n(yyyy-mm-dd)? <\/b><br \/>\n<input type=\"text\" name=\"avail_date\" size=\"11\" maxlength=\"11\"><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p>If the shelter is not listed below, select OTHER in the appropriate region, and give the name &#038; phone number of the shelter in the description<br \/>\nfield in the next question.  Shelters are listed alphabetically by region.  <\/p>\n<p>\n&#8220;Inland Empire&#8221; includes any in the 909 area code which includes parts of<br \/>\nLA County, San Bernardino County, Orange County and Riverside County,<br \/>\nwhere all four counties meet.  While we will list dogs from shelters in<br \/>\nRiverside and San Bernardino County, please note that our presence<br \/>\n(and hence our ability to take in dogs) in the Inland Empire is limited<br \/>\nto the &#8220;four corners&#8221; area plus Chino Hills\/Norco\/Corona and no further<br \/>\neast.<\/p>\n<p>\n<b>The Lab is at the following shelter:<\/b><br \/>\n<select size=\"10\" name=\"shelter_id\"><br \/>\n[\/unformat]<br \/>\n<?\n\n$select = \"SELECT shelter_id, shelter_name FROM Shelter_Directory\";\nreset($regionlist);\nforeach ($regionlist as $region) {\n  $db_input = \"$select WHERE shelter_region = \\\"$region\\\" ORDER BY shelter_name\";\n  $result = mysql_query($db_input, $db_link) or die(\"Having error in execution 1 ==\".mysql_error());\n\n  while($row=mysql_fetch_array($result)) {\n    $shelter_id=$row[0];\n    $shelter_name=$row[1];\n    echo \"<option value=\\\"$shelter_id\\\">$region: $shelter_name\\n&#8221;;<br \/>\n  }<br \/>\n}<br \/>\n?><br \/>\n[unformat]<br \/>\n<\/select><\/p>\n<p>\n<b>Short description of the Lab? <\/b><\/p>\n<p><TEXTAREA NAME=\"dog_desc\" ROWS=12 COLS=55><\/TEXTAREA><\/p>\n<p><p align=center>\n<em><input type=\"submit\" name=\"submit\" value=\"Send\" ><\/em><br \/>\n<input type=\"reset\" name=\"reset\" value=\"clear form\" ><\/em>\n<\/p>\n<p>[\/unformat]<br \/>\n<?php\n  echo \"\n\n<p> &#8220;;<br \/>\n  echo &#8220;Thank you for taking the time to let us know about this dog!  It is a big  &#8220;;<br \/>\n  echo &#8220;help to us as it&#8217;s not possible for us to check all the shelters all the  &#8220;;<br \/>\n  echo &#8220;time. &#8220;;<br \/>\n}<br \/>\n?><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-23","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.sclrr.org\/rescue\/wp-json\/wp\/v2\/pages\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sclrr.org\/rescue\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sclrr.org\/rescue\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sclrr.org\/rescue\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sclrr.org\/rescue\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":2,"href":"https:\/\/www.sclrr.org\/rescue\/wp-json\/wp\/v2\/pages\/23\/revisions"}],"predecessor-version":[{"id":228,"href":"https:\/\/www.sclrr.org\/rescue\/wp-json\/wp\/v2\/pages\/23\/revisions\/228"}],"wp:attachment":[{"href":"https:\/\/www.sclrr.org\/rescue\/wp-json\/wp\/v2\/media?parent=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}