\n"); #print_r($_POST); #print_r($_GET); #print_r($HTTP_SESSION_VARS); #print_r($_SERVER); echo("\n"); $username="lazarus_toomey"; $password="wizzb"; $database="lazarus_toomey"; if ($_GET['function']) $state="function_".$_GET['function']; if ($_POST['state']) $state=$_POST['state']; $notenum=$_GET['notenumber']; if ($_POST['notenumber']) $notenum=$_POST['notenumber']; $subject=$_POST['subject']; $note=$_POST['note']; $type=0+$_POST['notetype']; $todo=0+$_POST['notetodo']; $daysback = 60; connectAndSelectDB($username,$password,$database); switch ($state) { case "Preview Email": updateChecks(); drawHeader(); previewEmail(); displayOldDays($daysback); drawFooter(); break; case "Preview Print": updateChecks(); previewPrint(); break; case "Update Checks": updateChecks(); drawHeader(); drawFullLetter(); displayOldDays($daysback); drawFooter(); break; case "Send Email": drawHeader(); redAlert("Should have sent email"); drawFullLetter(); displayOldDays($daysback); drawFooter(); break; case "Send Text Message": drawHeader(); sendNote($notenum); drawFullLetter(); displayOldDays($daysback); drawFooter(); break; case "Add Note": addNote($subject, $note, $type, $todo); drawHeader(); drawFullLetter(); displayOldDays($daysback); drawFooter(); break; case "Update Note": updateNote($notenum, $subject, $note, $type, $todo); drawHeader(); drawFullLetter(); displayOldDays($daysback); drawFooter(); break; case "function_delete": drawHeader(); deleteNote($notenum); redAlert("Deleted note number ".$notenum); drawFullLetter(); displayOldDays($daysback); drawFooter(); break; case "Add New User": drawHeader(); submitContact(); drawSettings(); displayOldDays($daysback); drawFooter(); break; case "function_settings": drawHeader(); drawSettings(); displayOldDays($daysback); drawFooter(); break; case "function_edit": drawHeader(); redAlert("Editing note number ".$notenum); editNote($notenum); displayOldDays($daysback); drawFooter(); break; case "function_sendsms": echo "Sending note number ".$notenum; drawHeader(); drawSMSSender($notenum); displayOldDays($daysback); drawFooter(); break; case "function_copytotoday": echo "Copying note number ".$notenum; break; case "Cancel": drawHeader(); drawFullLetter(); displayOldDays($daysback); drawFooter(); break; case "": drawHeader(); drawFullLetter(); displayOldDays($daysback); drawFooter(); } mysql_close(); function sendNote($t_notenum) { $text = getNoteText($t_notenum); sendToTextmark($text,6178880545); } function drawSMSSender($note_number) { $text = getNoteText($note_number); echo "
"; drawMainTitle("Send A Text Message"); ?>
Send As Text Message
$text_maxlength) { $str1=substr($text,0,$text_maxlength); $str2=substr($text,$text_maxlength,strlen($text)-$text_maxlength); echo "
"; echo $str1; echo "
"; echo $str2; echo "
"; echo "
"; $alert = "Warning: This note is too long to be texted in full. "; $alert = $alert."The max length is ".$text_maxlength." characters, and everything displayed in red text will be CUT OFF. "; $alert = $alert."You may want to Edit this note."; redAlert($alert); } else { echo "
"; echo $text; echo "
"; } ?>
"; echo ""; echo "Edit Note"; echo ""; echo ""; ?>
"; } function getNoteText($note_num) { $row = retrieveRowByNotenum($note_num); $temp_subject=getEncoded($row['subject']); $temp_note=getEncoded($row['note']); return $temp_subject." >".$temp_note; } function drawHeader() { echo "
"; echo "
"; $function="settings"; echo ""; echo "Settings"; echo ""; echo "
"; echo "
"; drawLoginInformation(); echo "
"; echo ""; echo "Toomey Notes"; echo ""; echo "
"; echo "
"; } function drawLoginInformation() { echo "Currently logged in as: "; echo $_SESSION['user']; } function redAlert($alert_text) { echo "
"; echo $alert_text; echo "
"; } function submitContact() { $c_user = verifyInput($_POST['new_username']); $c_pass = md5(verifyInput($_POST['new_password'])); $c_fname = verifyInput($_POST['firstname']); $c_lname = verifyInput($_POST['lastname']); $c_number = verifyInput($_POST['contactnumber']); $c_email = verifyInput($_POST['email']); subscribeToTextmarks($c_number); $query = "INSERT INTO users VALUES ('',now(),'$c_user','$c_pass','$c_fname','$c_lname','$c_number','$c_email','0','0')"; mysql_query($query); } function subscribeToTextmarks($phone_number) { try { // Try to subscribe a user to a TextMark: $sMyApiKey = 'discussthing_com_8e49cd0b'; $sMyTextMarksUser = '6178880545'; // (or my TextMarks phone#) $sMyTextMarksPass = 'wizzbone'; $sKeyword = 'TOOMEY'; $sPhone = $phone_number; $tmapi = new TextMarksAPIClient_Messaging($sMyApiKey, $sMyTextMarksUser, $sMyTextMarksPass); $tmapi->subscribe($sKeyword, $sPhone); redAlert("Number successfully entered, subscription pending. You will receive a text message from 41411 soon, please reply with a \"Y\""); } catch (Exception $e) { redAlert("Subscription Error: " . $e); } } function sendToTextmark($sms_message,$phone_number) { try { // Try to send a message to a user: $sMyApiKey = 'discussthing_com_8e49cd0b'; $sMyTextMarksUser = '6178880545'; // (or my TextMarks phone#) $sMyTextMarksPass = 'wizzbone'; $sKeyword = 'TOOMEY'; $sMessage = $sms_message; $sPhone = $phone_number; $tmapi = new TextMarksAPIClient_Messaging($sMyApiKey, $sMyTextMarksUser, $sMyTextMarksPass); $tmapi->sendText($sKeyword, $sPhone, $sMessage); redAlert("Successfully sent Text Message."); } catch (Exception $e) { redAlert("Sending Error: " . $e); } } function drawFooter() { ## end mainbody_wrapper echo "
"; echo "
"; echo "Footer text"; echo "
"; } function drawRadioButtons($t_type) { addRadioToForm("notetype","0", $t_type, "Standard"); addRadioToForm("notetype","2", $t_type, "Private"); addRadioToForm("notetype","1", $t_type, "Add to email"); } function addRadioToForm($nam,$val,$t_type, $text) { echo "
"; echo $text."
"; } function retrieveRowByNotenum($notenum) { $query = "SELECT * FROM notes WHERE note_num = $notenum LIMIT 1"; echo $query; $result=mysql_query($query); $row = mysql_fetch_array($result); return $row; } function drawSettings() { echo "
"; drawMainTitle("Settings"); drawUserSettings(); echo "
"; } function drawUserSettings() { echo "
"; echo "
"; echo "User Settings"; echo "
"; drawCurrentUsers(); drawAddUserForm(); echo "
"; } /* ########## Labels Also, use label system for 'requires followup' (#!) and 'add to email' */ function scanForLabels($notenum, $str) { // if $str contains # symbol, get location(s?) // if next character is !, add followup label // else get next three characters // check string against labels in database // Add label to notenum // return string removing those 4 characters } function scanForPhoneNumbers($notenum, $str) { // if string contains ###?###?#### // can php search like that? I suspect so // add label #pho to notenum if (preg_match('/[0-9]{3}.[0-9]{3}.[0-9]{4}/', $str)) { //redAlert("Has number!"); //addLabel("#pho", $notenum) } } function scanForLinks($t_str) { $str = $t_str; $matchesarray[0] = 1; if (preg_match('/(http)(.*)/', $str, $matchesarray)) { //redAlert("Link found! ".$matchesarray[0]); $str = str_replace($matchesarray[0], "".$matchesarray[0]."",$str); } return $str; } function drawCurrentUsers() { echo "Current Users
"; $query = "SELECT * FROM users"; $result=mysql_query($query); echo ""; while($row = mysql_fetch_array($result)) { $temp_first=$row['user_firstname']; $temp_last=$row['user_lastname']; $temp_phone=$row['user_number']; $temp_email=$row['user_email']; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
NamePhone #Email
".$temp_first." ".$temp_last."".$temp_phone."".$temp_email."
"; } function drawAddUserForm() { ?>
Add New User
First Name:
Last Name:
New User Name:
New Password:
Cell Phone #:
Email Address:
"; drawMainTitle("Edit Note"); ?>
Editing Note
Subject: name="notetodo" value="1"> To Do
Note:
"; } function updateChecks() { #for loop on BOXARRAY2 #have old and new array, need to fill out new array to each blank spot is a zero $checkboxesARRAY = $_POST['BOXARRAY']; $OLDcheckboxesARRAY = $_POST['BOXARRAY2']; foreach ($OLDcheckboxesARRAY as $k => $v) { if($checkboxesARRAY[$k]) { $checkboxesARRAY[$k] = 1; } else { $checkboxesARRAY[$k] = 0; } } while (list($key, $val) = each($checkboxesARRAY)) { #echo "$key => $val\n"; #echo "UPDATE notes SET type = '".$val."' WHERE note_num = '".$key."'"; $query = "UPDATE notes SET type = '".$val."' WHERE note_num = '".$key."'"; mysql_query($query); } } function deleteNote($notenum) { $query = "UPDATE notes SET active = '0' WHERE note_num = $notenum"; mysql_query($query); } function addNote($t_subject, $t_note, $t_type, $t_todo) { # Database format: index, current date and time, subject, note, radio value $secretPass = 'kljhflk73#OO#*U$O(*Y'; $enc_subject = makeSQLsafe(Encode($t_subject,$secretPass)); $enc_note = makeSQLsafe(Encode($t_note,$secretPass)); $query = "INSERT INTO notes VALUES ('','1',now(),now(),'$enc_subject','$enc_note',$t_type,$t_todo)"; mysql_query($query); } function verifyInput($text) { $input = $text; $input = htmlspecialchars($input); if (get_magic_quotes_gpc()) { // if magic quotes is enabled, get rid of those // pesky slashes $input = stripslashes($input); } $input = mysql_real_escape_string($input); return $input; } function stripHTML($text) { return htmlspecialchars($text); } function makeSQLsafe($text) { $input = mysql_real_escape_string($text); return $input; } function Encode($data,$pwd) { $pwd_length = strlen($pwd); for ($i = 0; $i < 255; $i++) { $key[$i] = ord(substr($pwd, ($i % $pwd_length)+1, 1)); $counter[$i] = $i; } for ($i = 0; $i < 255; $i++) { $x = ($x + $counter[$i] + $key[$i]) % 256; $temp_swap = $counter[$i]; $counter[$i] = $counter[$x]; $counter[$x] = $temp_swap; } for ($i = 0; $i < strlen($data); $i++) { $a = ($a + 1) % 256; $j = ($j + $counter[$a]) % 256; $temp = $counter[$a]; $counter[$a] = $counter[$j]; $counter[$j] = $temp; $k = $counter[(($counter[$a] + $counter[$j]) % 256)]; $Zcipher = ord(substr($data, $i, 1)) ^ $k; $Zcrypt .= chr($Zcipher); } return $Zcrypt; } function hex2bin($hexdata) { for ($i=0;$i"; echo ""; echo "
"; echo "
"; echo ""; #echo ""; echo "
"; } function previewEmail(){ echo "
"; echo "Subject: "; echo buildEmailSubject(); echo "
"; echo ""; echo ""; echo "
"; echo "
"; } function getEncoded($fieldtext) { $secretPass = 'kljhflk73#OO#*U$O(*Y'; return stripHTML(Encode($fieldtext,$secretPass)); } function buildEmailBody() { $query = "SELECT * FROM notes WHERE DATE(date) = CURDATE() AND type = 1"; $result=mysql_query($query); $str = "Hi Tim,\n\n"; while($row = mysql_fetch_array($result)) { $temp_subject=getEncoded($row['subject']); $temp_note=getEncoded($row['note']); if ($temp_subject.$temp_note == "") { } else { if ($temp_subject) { $str = $str.$temp_subject."\n"; } if ($temp_note) { $str = $str.$temp_note."\n"; } $str = $str."\n"; } } return $str; } function buildEmailSubject() { return date('l').', '.date('M').'. '.date(d).' Update'; } function previewPrint() { drawTodaysDate(); $firstnote = key($_POST['BOXARRAY']); $date = getDateOfNote($firstnote); printDailyNotes($date, 1, '', ''); } function printDailyNotes($phpdate, $checkedonly, $b_ColorARRAY, $b_TitleARRAY) { $query = "SELECT * FROM notes WHERE date = '$phpdate'"; if ($checkedonly) $query = $query." AND type = 1"; $query = $query." ORDER BY note_num DESC"; $result=retrieveFromDatabase($query); while($row = mysql_fetch_array($result)) { $temp_subject=getEncoded($row['subject']); $temp_note=getEncoded($row['note']); $temp_notenum=$row['note_num']; $temp_todo=$row['todo']; if ($temp_subject.$temp_note == "") { } else { drawNote($temp_notenum,$temp_subject,$temp_note,$temp_type,$temp_todo,'','',''); } } } function getDateOfNote($notenum) { $query = "SELECT * FROM notes WHERE note_num = $notenum LIMIT 1"; $result = retrieveFromDatabase($query); $row = mysql_fetch_array($result); $date = $row['date']; return $date; } function displayOldDays($numdaysback) { echo "
"; echo "

Last ".$numdaysback." Days

"; for ($k = 1; $k < $numdaysback; $k += 1) { $query = "SELECT * FROM notes WHERE DATE(date) = DATE_SUB(CURDATE(), INTERVAL ".$k." DAY) ORDER BY note_num ASC"; $result=retrieveFromDatabase($query); $num_rows = mysql_num_rows($result); if ($num_rows > 0) { $olddate = mktime(0,0,0,date("m"),date("d")-$k,date("Y")); echo "
"; echo "
"; echo date("D M j", $olddate); echo "
"; while($row = mysql_fetch_array($result)) { $temp_subject=getEncoded($row['subject']); $temp_note=getEncoded($row['note']); $temp_active=$row['active']; $temp_type=$row['type']; $temp_notenum=$row['note_num']; $temp_todo=$row['todo']; if ($temp_subject.$temp_note == "" || $temp_active == 0 ) { } else { $buttonColorARRAY = array("green", "purple", "yellow", "red"); $buttonTitleARRAY = array("Edit", "Copy to Today", "View Details", "Delete"); $buttonFunctionARRAY = array("edit", "copytotoday", "viewdetails", "delete"); drawNote($temp_notenum,$temp_subject,$temp_note,$temp_type,$temp_todo,$buttonColorARRAY, $buttonTitleARRAY, $buttonFunctionARRAY); } } echo "
"; } } echo "
"; } function drawTodaysDate() { drawMainTitle(date(l).", ".date(F)." ".date(j).date(S).", ".date(Y)); } function drawMainTitle($text) { echo "
"; echo $text; echo "
"; } function drawnoteButton($t_notenum, $color, $action, $function) { echo "
"; echo ""; echo "\"Alternative"; echo "".$action.""; echo ""; echo "
"; } function drawNote($t_notenum,$t_subject,$t_note,$t_type,$t_todo,$b_ColorARRAY, $b_TitleARRAY, $b_functionARRAY) { $note = nl2br($t_note); $note = scanForLinks($note); scanForPhoneNumbers($t_notenum, $note); echo "
"; if ($b_ColorARRAY && $b_TitleARRAY) { echo "
"; for ($i = 0; $i < count($b_ColorARRAY); $i += 1) { drawnoteButton($t_notenum, $b_ColorARRAY[$i], $b_TitleARRAY[$i], $b_functionARRAY[$i]); } echo "
"; } if ($t_todo == 1) { echo "
"; } else { echo "
"; } if ($t_type == 2) { echo "
"; } else { echo "
"; } if ($t_subject) { echo "
"; echo $t_subject."
"; echo "
"; } if ($note) echo $note; echo "
"; echo "
"; echo "
"; } function connectAndSelectDB($un,$pw,$db) { mysql_connect("localhost",$un,$pw); @mysql_select_db($db) or die( "Unable to select database"); } ?> "; drawTodaysDate(); ?>
Add New Note
Subject: Requires Followup
Note:
"; echo "
"; echo ""; while($row = mysql_fetch_array($result)) { $temp_num=$row['note_num']; $temp_subject=getEncoded($row['subject']); $temp_note=getEncoded($row['note']); $temp_active=$row['active']; $temp_type = $row['type']; $temp_todo = $row['todo']; if ($row['type']==1) { $is_checked=" checked "; } else { $is_checked=""; } if ($temp_subject.$temp_note == "" || $temp_active == 0) { } else { echo ""; if ($temp_type==2) { echo ""; } else { echo ""; } echo ""; } } echo "
"; echo ""; $buttonColorARRAY = array('green', 'blue', 'yellow', 'red'); $buttonTitleARRAY = array('Edit', 'Send As SMS', 'View Details', 'Delete'); $buttonFunctionARRAY = array("edit", "sendsms", "viewdetails", "delete"); drawNote($temp_num,$temp_subject,$temp_note,$temp_type,$temp_todo,$buttonColorARRAY, $buttonTitleARRAY,$buttonFunctionARRAY); echo "
"; buildLetterButtons(); echo "
"; ## end currletterform div echo "
"; ## end today div echo "
"; } ?>
Find and buy toyota park.Official site of the 2009 Jeep wrangler.Visit Subaru of America for reviews, pricing and photos of impreza.2006 Nissan 350Z highlights from Consumer Guide Automotive. Learn about the 2006 nissan 350z.Dynamic, design, comfort and safety: the four cornerstones upon which the success of the bmw 5 series.Find and buy toyota center kennewick.Contact: View company contact information fo protege.What does this mean for legacy.The website of American suzuki motorcycle.The site for all new 2009 chevy.Use the Organic natural food stores.Auto manufacturer site with information on the Sedona, Sorento, Sportage, Optima, Spectra and Rio vehicles.kia.Get more online information on hyundai getz.Find and buy used nissan 350z.Kia cars, commercial vehicles, dealers, news and history in Australia. kia com.Site for Ford's cars and minivans, trucks, and SUVs. Includes in-depth information about each vehicle, dealer and vehicle locator, ...fords dealers.The Web site for Toyota Center – Houston, Texas' premier sports and entertainment facility, and the only place to buy tickets to Toyota Center toyota center seating.Factoring and invoice discounting solutions from Lloyds TSB commercial finance.Read Fodor's reviews to find the best travel destinations, hotels and restaurants. Plan your trip online with Fodor's.travel guide.Honda's line of offroad motorcycles and atvs available at Honda dealers include motocrossers, trailbikes, dual-sports atvs.Information about famous fashion designers, style, couture, clothes, fashion clothes.Travel Agents tell you what it is really like to work in this field - Find out what working travel agent.Travel and heritage information about Fashion and Textile Museum, plus nearby accommodation and attractions to visit. Part of the Greater London Travel fashion.Get buying advice on the Mazda rx8tickled guys tickled guys The theme of angst kinesiologas lima kinesiologas lima called stimulated emission money gram claim form money gram claim form former occasions gasden county courthouse gasden county courthouse sheet substance favor abby winters maggie redux abby winters maggie redux bad blow oil blood gumdrop cake recipes gumdrop cake recipes restoring human biggest loser recipes by rocko biggest loser recipes by rocko reat disease boyd connington dead boyd connington dead business of life sluty collage girls sluty collage girls He would seek fujifilm poster printer 3000 wide driver fujifilm poster printer 3000 wide driver of the Jewish people handsome asian hunks handsome asian hunks professor introduces vicky lamotta gallery vicky lamotta gallery that you could recipe weight watcher vegetable soup recipe weight watcher vegetable soup then as Giblin pattern pancake tutu pattern pancake tutu find any new work o2jam bot downloads patch o2jam bot downloads patch correct able driver ugx driver ugx sheet substance favor lobster ravioli pasta cream sauce recipe lobster ravioli pasta cream sauce recipe and the latter albion nebraska newspaper albion nebraska newspaper letter until mile river judith grace gonzales hinks judith grace gonzales hinks a science recipe of hongkong s curry fishball recipe of hongkong s curry fishball European Nazi rule alexadria alas no more alexadria alas no more The medium adult entertainment night club in taipei adult entertainment night club in taipei plant cover food samaon wikipedia samaon wikipedia It is both an area jays boardshop temecula jays boardshop temecula investigation postal codes vancouver canada postal codes vancouver canada accomplishing particular cheesy scalloped potatoes recipes cheesy scalloped potatoes recipes lost brown wear open bust lingere open bust lingere sun four between kyosho m24 main blades kyosho m24 main blades of him in a scientific atlanta webstar 2000 cable modem scientific atlanta webstar 2000 cable modem A belief was true okinawa japan cars for sale okinawa japan cars for sale science eat room friend medicine ball excersizes medicine ball excersizes in the rise of punk cooking red cabbage cooking red cabbage duck instant market upstate home for children upstate home for children other fields such capricorn electronics ltd capricorn electronics ltd of truth situationally chat lines 10p a minute chat lines 10p a minute skin smile crease hole homeless shelters in san antonio texas homeless shelters in san antonio texas bat rather crowd laura orsolya pics laura orsolya pics on annoyance often gary lightbody girlfriend gary lightbody girlfriend may be said to canadian tattoo suppliers canadian tattoo suppliers to the beginning savage 1905 32 cal pistol magazine savage 1905 32 cal pistol magazine a copious flow lyrics prostitude flange lil wayne lyrics prostitude flange lil wayne not to recognise rough russian teensex rough russian teensex of truth is gabriel studio cicero illinois gabriel studio cicero illinois enough plain girl savage fury christy canyon savage fury christy canyon without supernormal powers what food can rabbits eat what food can rabbits eat of optical components subscapular bursitis subscapular bursitis needs and wants mansfield youth peewee football mansfield youth peewee football monochromatic light hanging by a moment lifehouse lyrics hanging by a moment lifehouse lyrics to these letters mini wooden ping pong ball catapult designs mini wooden ping pong ball catapult designs had been told muddog tires muddog tires decimal gentle woman captain biography eve bunting biography eve bunting device that emits light reposessed houses for sale reposessed houses for sale of truth foto antonio banderas foto antonio banderas about the surrender of David Koresh default password to linksys wrk54g default password to linksys wrk54g a science of body systems awiting bayan awiting bayan the definition harmony remote ps3 harmony remote ps3 and his followers gun safes in canada gun safes in canada double seat driver sohc 4832k driver sohc 4832k Masters of War aurea carter aurea carter The world to which young bbs young bbs branches of the science fertigation definition fertigation definition individual choices yahoo co jp yahoo co jp of the times jenny poussin pics jenny poussin pics has been a reflection femdon videos femdon videos be tied to our swap mart mesa az swap mart mesa az and maintain collective pauls deen s thankgivings dinner recipes pauls deen s thankgivings dinner recipes own page hacked firmware netgear wgr614 hacked firmware netgear wgr614 spring observe child britney nip slip ireland britney nip slip ireland in the late 19th century braun thermoscan 6022 braun thermoscan 6022 remain so in every hr 32 caliber revolver hr 32 caliber revolver heterodox and by subfield list of the rarest yugioh cards list of the rarest yugioh cards seen a medium before wicked in slc wicked in slc solve metal xx cel nude xx cel nude A belief was powermunch powermunch by some lucky coincidence image of shivaji maharaj image of shivaji maharaj public life concerned maria moore my boob maria moore my boob and never having martin mmv acoustic guitar review martin mmv acoustic guitar review in this country golfer unlock code polar golfer unlock code polar molecule select overhead door model 65b overhead door model 65b first discussed