$val = substr($value, 10); $twoinone = preg_split("/[\\s|]+/", $quest_id); $rr = mysql_fetch_array(mysql_query(" SELECT id\r\n FROM `scenario_destination`\r\n WHERE scenario_detail_id = {$twoinone['1']} AND answer_id = {$twoinone['2']}")); if ($rr[0] == '') { mysql_query("INSERT INTO `scenario_destination`\r\n (`scenario_detail_id`, `destination`, `answer_id`)\r\n VALUES\r\n ( '{$twoinone['1']}', '{$val}', '{$twoinone['2']}');"); } else { mysql_query(" UPDATE `scenario_destination`\r\n SET `destination`={$val}\r\n WHERE `id`={$rr['0']}"); } } } break; case 'save_answer': if ($_REQUEST['quest_detail_id'] == '') { save_answer($user_id, $quest_id1, $add_id); } else { update_answer($quest_detail_id, $quest_id1, $quest_id); } break; case 'disable': if ($quest_detail_id != '') { disable_det($quest_detail_id); } else { disable($quest_id); } break; case 'get_scen_cat': $data['cat'] = GetLeCat($_REQUEST['cat_id'], ''); break; default: $error = 'Action is Null'; }
} $data['aaData'][] = $row; } break; case 'save_quest': if ($quest_id == '') { save($user_id, $name, $note); } else { update($quest_id, $name, $note); } break; case 'save_answer': if ($quest_detail_id == '') { save_answer($user_id, $answer, $quest_type_id, $add_id, $hidden_product_id); } else { update_answer($quest_detail_id, $answer, $quest_type_id, $quest_id, $hidden_product_id); } break; case 'disable': if ($quest_detail_id != '') { disable_det($quest_detail_id); } else { disable($quest_id); } break; case 'get_product_info': $name = $_REQUEST[name]; $res = GetProductInfo($name); if (!$res) { $error = 'პროდუქტი ვერ მოიძებნა!'; } else {
<?php session_start(); include "setting.php"; if (!isset($_SESSION['id']) || !isset($_SESSION['ipaddress'])) { gotoindex(); } check_login(); if (!isset($_GET['id']) || !isset($_GET['ans'])) { exit(0); } include "header.php"; $q_id = $_GET['id']; $ans = $_GET['ans']; $m_id = $_SESSION['id']; if (update_answer($m_id, $q_id, $ans) != false) { $answer = get_answer($ans); $q = pg_fetch_assoc($answer, 0); $ans = getAnswer($q['answer']); update_log($m_id, $q['answer']); print "結果は{$ans}です。"; } include "footer.php"; function get_answer($id) { $db = new mydb(); $query = "select * from choices where id = \$1"; $result = $db->query($query, array($id), "getans"); return $result; } function update_answer($m_id, $q_id, $answer)
$val = substr($value, 10); $twoinone = preg_split("/[\\s|]+/", $quest_id); $rr = mysql_fetch_array(mysql_query(" SELECT id\r\n FROM `scenario_destination`\r\n WHERE scenario_detail_id = {$twoinone['1']} AND answer_id = {$twoinone['2']}")); if ($rr[0] == '') { mysql_query("INSERT INTO `scenario_destination`\r\n (`scenario_detail_id`, `destination`, `answer_id`)\r\n VALUES\r\n ( '{$twoinone['1']}', '{$val}', '{$twoinone['2']}');"); } else { mysql_query(" UPDATE `scenario_destination`\r\n SET `destination`={$val}\r\n WHERE `id`={$rr['0']}"); } } //} break; case 'save_answer': if ($_REQUEST['quest_detail_id'] == '') { save_answer($user_id, $quest_id1, $add_id); } else { update_answer($quest_detail_id, $quest_id1, $_REQUEST['quest_id']); } break; case 'disable': disable($quest_id); break; case 'disable_cd': disable_det($quest_id); break; case 'get_scen_cat': $data['cat'] = GetLeCat($_REQUEST['cat_id'], ''); break; default: $error = 'Action is Null'; } $data['error'] = $error;