function build($match_value) { global $conn_id; $query = "select " . $this->select; $query .= " from " . $this->from; if ($this->where) { $query .= " where " . $this->where; } if ($this->group_by) { $query .= " group by " . $this->group_by; } if ($this->having) { $query .= " having " . $this->having; } if ($this->order_by) { $query .= " order by " . $this->order_by; } if ($this->show_query) { echo $query, "<br>"; } $result = fn_query($conn_id, $query); while ($rows = fn_fetch_row($result)) { if (!$this->first_value) { $this->first_value = $rows[0]; } $temp .= "<option value=\"" . $rows[0] . "\""; if ($this->select_all) { $temp .= " selected"; } elseif ($this->as_template) { $temp .= " \$selected_" . $rows[0]; } elseif (!is_array($match_value) and $rows[0] == $match_value) { $temp .= " selected"; } elseif (is_array($match_value) and in_array($rows[0], $match_value)) { $temp .= " selected"; } $temp .= ">" . $rows[1] . "</option>\r\n"; } fn_free_result($result); return $temp; }
} if (!$error_message) { if (md5($HTTP_POST_VARS['data']) == $HTTP_POST_VARS['md5']) { session_register("sesi_gambar"); } else { $error_message = "Error: Sorry, Image Verification Code Invalid ! "; } } if (!$error_message) { // print_r($HTTP_POST_VARS); $conn_id = connect(); //--- check apakah ada nama user tersebut //master user $query = "\r\n\t\tSELECT \r\n\t\t\tcount(*) as user_exist \r\n\t\tFROM \r\n\t\t\tmaster_user \r\n\t\tWHERE \r\n\t\t\tupper(user_id) = upper('{$send_user}')\r\n\t\t"; $result = fn_query($conn_id, $query); $mRet = fn_fetch_row($result); if ($mRet[0] > 0) { //proses while ($rows = fn_fetch_array($result)) { extract($rows, EXTR_OVERWRITE); } $password = md5($password); $query = "\r\n\t\t\tSELECT \r\n\t\t\t\t#user_id as temp_value, user_level as temp_level\r\n\t\t\t\tuser_id as temp_value, user_level as temp_level, \r\n\t\t\t\tmaster_user_id as temp_rowid\r\n\t\t\tFROM \r\n\t\t\t\tmaster_user \r\n\t\t\tWHERE \r\n\t\t\t\tupper(user_id) = upper('{$send_user}') and \r\n\t\t\t\tuser_password = '******'\r\n\t\t\t"; $result = fn_query($conn_id, $query); while ($rows = fn_fetch_array($result)) { extract($rows, EXTR_OVERWRITE); } if (!$temp_value) { $error_message = "Invalid password"; } else { session_start();