// NAME: login_cookie.php // DESCRIPTION: All common functions needed to manage a partner's login cookie. // Creation: 3/2/2006, © One Bad Ant // Create the login cookie for a partner following authentication // The key to the partner's "PERSON" record is passed in function create_login($partner_rec_key) { $ci2i_login_cookie = "loginkey=".$partner_rec_key.","; setcookie ("ci2ipartner", $ci2i_login_cookie, time() + 3600, "/", false); // expire in one hour } // Ci2i Logout (expire the login cookie) function expire_login() { setcookie ("ci2ipartner", "", time() - 3600, "/", false); // expire (one hour ago) } // This procedure parses a partner's login cookie, verifying that she has logged in. // This procedue will return the record key to the partner record or a "no_cookie" flag. function verify_login() { $ci2i_login_value = ""; // verify that the login cookie exists (= valid log in) if (isset($_REQUEST['ci2ipartner'])) { $ci2i_login_value = $_REQUEST["ci2ipartner"]; $end_of_log_cookie = strlen($ci2i_login_value); // make sure the cookie has been set if ($end_of_log_cookie != 0) { $login_begin = strpos($ci2i_login_value,"=") + 1; $login_end = strpos($ci2i_login_value,","); $login_length = $login_end - $login_begin; // get the key to the logged in partner record $partner_key = substr($ci2i_login_value,$login_begin,$login_length); return $partner_key; } } // if we reach this point then no valid login cookie exists return "no_cookie"; } ?> // NAME: dbconnect.php // DESCRIPTION: This procedure is called as an include by any other scripts that need to access the Ci2i Survey database tables. // Creation: 2/23/2006, © One Bad Ant // connect to the database @ $ci2i_db = mysql_connect("mysql3.brinkster.com","antci2i","ne03731P"); if (!$ci2i_db) {return 0;} else { mysql_select_db("antci2i"); return 1; } ?> // NAME: survey_functions.php // DESCRIPTION: this file contains scripts needed for the Ci2i survey question and answer pages. // Creation: 3/14/2006, © One Bad Ant // Get the person's survey record function get_persons_survey($partner_key) { $survey_key_query = "SELECT survey_key FROM survey WHERE person_fkey = '".$partner_key."'"; $survey_key_result = mysql_query($survey_key_query); $survey_key = mysql_result($survey_key_result,0,"survey_key"); return $survey_key; } // Get the person's survey partnership record function get_persons_survey_partnership($partner_key) { $partnership_query = "SELECT promotion_code FROM survey_partnership WHERE partner1_fkey = '".$partner_key."' OR partner2_fkey = '".$partner_key."'"; $partnership_result = mysql_query($partnership_query); $promotion_code = mysql_result($partnership_result,0,"promotion_code"); return $promotion_code; } // get the answer to the given survey item for the given factor on the given page for the given survey function get_survey_answer($page,$factor,$item,$this_survey_key) { $survey_item_query = "SELECT metric, open_answer FROM survey_item WHERE survey_fkey = '".$this_survey_key."' AND page_appearance = '".$page."' AND factor_key = '".$factor."' AND item_key = '".$item."'"; $survey_item_result = mysql_query($survey_item_query); $survey_item_found = mysql_num_rows($survey_item_result); $survey_answer = ""; if ($survey_item_found > 0) { if ($page != 7) // page 7 has open ended (text) answers, not simple metrics { // question 3 and 8 on page 6 are open ended answers, the rest are metrics if ($page == 6) { if (($item == 3) || ($item == 8)) {$survey_answer = mysql_result($survey_item_result,0,"open_answer");} else { // Page 6: radio button selections $page6_radio_answer = mysql_result($survey_item_result,0,"metric"); switch ($item) { case 1: if ($page6_radio_answer == 1) {$survey_answer = "Be more appreciative and loving myself";} if ($page6_radio_answer == 2) {$survey_answer = "Wonder what is going on";} if ($page6_radio_answer == 3) {$survey_answer = "Tell my partner or myself that I don’t deserve it";} if ($page6_radio_answer == 4) {$survey_answer = "Thank my partner";} if ($page6_radio_answer == 5) {$survey_answer = "Other";} break; case 2: if ($page6_radio_answer == 1) {$survey_answer = "Be more appreciative and loving to me";} if ($page6_radio_answer == 2) {$survey_answer = "Wonder what is going on";} if ($page6_radio_answer == 3) {$survey_answer = "Tells me that he/she doesn’t deserve it";} if ($page6_radio_answer == 4) {$survey_answer = "Thanks me";} if ($page6_radio_answer == 5) {$survey_answer = "Other";} break; case 4: if ($page6_radio_answer == 1) {$survey_answer = "Argue with her/him until I 'win'";} if ($page6_radio_answer == 2) {$survey_answer = "Leave the scene";} if ($page6_radio_answer == 3) {$survey_answer = "Listen and talk together to solve the issue";} if ($page6_radio_answer == 4) {$survey_answer = "Shut down and go quiet";} if ($page6_radio_answer == 5) {$survey_answer = "Give in to whatever he/she wants or says";} if ($page6_radio_answer == 6) {$survey_answer = "Other";} break; case 5: if ($page6_radio_answer == 1) {$survey_answer = "Argue until he/she 'wins'";} if ($page6_radio_answer == 2) {$survey_answer = "Leave the scene";} if ($page6_radio_answer == 3) {$survey_answer = "Listen and talk together to solve the issue";} if ($page6_radio_answer == 4) {$survey_answer = "Shut down and go quiet";} if ($page6_radio_answer == 5) {$survey_answer = "Give in to whatever I want or say";} if ($page6_radio_answer == 6) {$survey_answer = "Other";} break; case 6: if ($page6_radio_answer == 1) {$survey_answer = "He/She doesn’t love me";} if ($page6_radio_answer == 2) {$survey_answer = "He/She doesn’t understand me";} if ($page6_radio_answer == 3) {$survey_answer = "A situation we really need to and can figure out";} if ($page6_radio_answer == 4) {$survey_answer = "He/She is 'just upset again'";} if ($page6_radio_answer == 5) {$survey_answer = "He/She is right to be upset with me";} if ($page6_radio_answer == 6) {$survey_answer = "He/She is the problem";} if ($page6_radio_answer == 7) {$survey_answer = "Other";} break; case 7: if ($page6_radio_answer == 1) {$survey_answer = "Not good enough";} if ($page6_radio_answer == 2) {$survey_answer = "Not loveable enough";} if ($page6_radio_answer == 3) {$survey_answer = "Smart enough to figure this out with him/her";} if ($page6_radio_answer == 4) {$survey_answer = "A hero/heroine because I put up with this";} if ($page6_radio_answer == 5) {$survey_answer = "A target for his/her issues";} if ($page6_radio_answer == 6) {$survey_answer = "Never going to please him/or her anyway";} if ($page6_radio_answer == 7) {$survey_answer = "Other";} break; } // current page (from the report we want text returned, from survey - the metric) if ($_SERVER['PHP_SELF'] == "/survey/page6.php") {$survey_answer = $page6_radio_answer;} } // 3 and 8 } // page 6 else {$survey_answer = mysql_result($survey_item_result,0,"metric");} } else {$survey_answer = mysql_result($survey_item_result,0,"open_answer");} } else {$survey_answer = "";} return $survey_answer; } // Get the number of days remaining in a person's survey period function get_days_remaining($partner_key) { $survey_date_query = "SELECT end_date FROM survey_partnership WHERE partner1_fkey = '".$partner_key."' OR partner2_fkey = '".$partner_key."'"; $survey_date_result = mysql_query($survey_date_query); $survey_end_date = mysql_result($survey_date_result,0,"end_date"); $unix_endtime = strtotime($survey_end_date); // convert survey partnership end date to unix time $unix_todaytime = strtotime(date("Y-m-d")); // convert today to unix time $diff = $unix_endtime - $unix_todaytime; $days_remaining = floor($diff / (24 * 60 * 60)); // convert from seconds to days return $days_remaining; } ?>
Dear Ci2i Participant:
Please read all of the following information to help you understand and get the MOST VALUE from Ci2i.
I. The 24 factors we chose are those we found relevant and important to committed couples. The questions are focused on common sources of contentment or tension within committed love relationships.
II. Ci2i is most useful when used properly, so please take your time filling it out. You can start and stop as often as you like during the 30-day open period. However, once you indicate that you have submitted your final answers, there can be no changes to your answers. You will be able to run your reports as often as you like, and print out, “Factor Facts” and the “Ci2i Tool Box” for the entire 30 days. At the end of the 30 days, you and your partner’s unique passwords will dissolve, never to be used again.
III. You may answer as many or as few of the questions as you wish - more is better, all is best. You should decide together if you will skip any factors or questions before you each complete and submit your final answers so your data are comparable and your reports make sense. Use Factor Facts expansion arrows above each set of 4 questions to give you a brief but good idea about the intent of the factor and go to Factor Facts for a full explanation at anytime.
IV. YOUR INDIVIDUAL ANSWERS CAN ONLY BE SEEN BY YOUR PARTNER WHEN YOU BOTH SELECT THE OPTION TO PERMIT JOINT REPORTS. If you both agree to merge your answers, then either of you can run the reports of your combined answers anytime during the open 30-day period. If you decide not to merge your reports, you can run your own reports separately and use them in any way you find useful.
V. Your password protects you against any privacy invasion. NONE of your answers can be seen by anyone, other than yourself, unless you take action with the Complete Survey button AND the Joint Report box. Other than you and your partner, no one can or will ever see your answers or be able to connect your answers or demographic data to either of you.
VI. REMEMBER: Ci2i is a tool to help you identify and discuss YOUR relationship factors. It is an Indicator, NOT therapy. There are no right or wrong answers. You both feel and believe whatever you do, and it's important to honor and recognize those feelings and beliefs. Candor is important for this to work.
VII. PAY ATTENTION to areas in your reports where you see:
We have confidence your Reports, “Factor Facts,” and the “Ci2i Tools”, can be useful to you in having healthy, non-judgmental, thoughtful conversations about the many things you agree upon and the few areas where you may disagree. IF you find that some results are still difficult to discuss, we suggest you ask an experienced professional to assist you. It may be useful to share your reports with that individual.