%@ page language="java" import="java.sql.*" %>
<%!
// ------------------------------------------------------------
// PAGE CONSTANTS
// ------------------------------------------------------------
// Production
String sDatabaseDriver = "org.gjt.mm.mysql.Driver";
String sDatabaseURL = "jdbc:mysql://tig02.com/tig_db";
String sDatabaseUser = "tigadmin";
String sDatabasePassword = "swoosh23";
String sCookieDomain = ".san-diego-breast-augmentation.com"; // It's important that the domain begin with "."
int nCookieAge = 2592000; // 60sec * 60min * 24hrs * 30day = 2592000sec
// ------------------------------------------------------------
// PAGE METHODS
// ------------------------------------------------------------
// METHOD: isValidCID()
// --------------------
boolean isValidCID(String cid) {
boolean bReturnVal = false;
if (cid != null && !cid.equals("")) {
try {
Integer i = Integer.valueOf(cid);
bReturnVal = true;
} catch (Exception e) {
// Do Nothing
}
} else {
// Do Nothing
}
return bReturnVal;
}
// METHOD: writeCookie()
// ---------------------
void writeCookie(HttpServletResponse resp, String name, String value, String domain, int age) {
if (name != null && !name.equals("")) {
Cookie c = new Cookie(name, value);
if (domain != null) {
c.setDomain(domain);
}
c.setMaxAge(age);
resp.addCookie(c);
}
}
// METHOD: insertTrackingInfo()
// ----------------------------
String insertTrackingInfo(HttpServletRequest req, HttpServletResponse resp, String cid) {
String sFailure = "";
String sReturnVal = sFailure;
try {
int nCampaignId, nResult;
nCampaignId = Integer.parseInt(cid);
Class.forName(sDatabaseDriver);
Connection conn = DriverManager.getConnection(sDatabaseURL, sDatabaseUser, sDatabasePassword);
String sSQL = "insert into tracking " +
"(campaign_id, tracking_date, request_url, referrer_url, remote_addr, remote_host, browser, query_string) " +
"values (?, now(), ?, ?, ?, ?, ?, ?)";
PreparedStatement pstmt = conn.prepareStatement(sSQL);
pstmt.setInt(1, nCampaignId);
pstmt.setString(2, req.getServerName() + req.getRequestURI());
pstmt.setString(3, req.getHeader("REFERER"));
pstmt.setString(4, req.getRemoteAddr());
pstmt.setString(5, req.getRemoteHost());
pstmt.setString(6, req.getHeader("USER-AGENT"));
pstmt.setString(7, req.getQueryString());
nResult = pstmt.executeUpdate();
if (nResult > 0) {
sSQL = "select tracking_id from tracking where tracking_id = LAST_INSERT_ID()";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sSQL);
rs.next();
nResult = rs.getInt(1);
rs.close();
stmt.close();
conn.close();
sReturnVal = String.valueOf(nResult);
} else {
pstmt.close();
conn.close();
//sReturnVal = sFailure;
}
} catch (Exception e) {
//sReturnVal = sFailure;
}
return sReturnVal;
}
//name is the name of the parameter we are searching the query for
//only works for a parameter with one value
String getPar(String name, String query)
{
String value="";
name = name.toLowerCase();
query = query.toLowerCase();
query = query.trim();
//find the first char after the equal sign
//should be the first letter of the query plus the lenght of name plus the equal sign
if ((query.indexOf(name))==-1)
value="";
else
{
int findBeg = (name.length() + query.indexOf(name) + 1);
value = query.substring(findBeg);//parse down the string
int findEnd = (value.indexOf("&")); //where to end to pull
if (findEnd == -1)//there is not another parameter aka &
findEnd = value.length(); //
value=value.substring(0,findEnd);
}
return value;
}
boolean getCookie(Cookie[] c)
{
boolean value=false;
for (int x=0; x < c.length; x++)
{
if (c[x].getName().equals("cid"))
{
//test += c[x].getName();
value=true;
}
}
return value;
}
%>
<%
// No matter what, we cannot let this page fail
try {
String cid="";
if (request.getQueryString() == null)
cid="86";
else
cid = getPar("cid",request.getQueryString());
if (isValidCID(cid)) {
if (getCookie(request.getCookies()) == false)//if cookies are not found.
{
writeCookie(response, "cid", cid, sCookieDomain, nCookieAge);
String tid = insertTrackingInfo(request, response, cid);
if (tid != null && !tid.equals("")) {
writeCookie(response, "tid", tid, sCookieDomain, nCookieAge);
}
}
}//isValid
} catch (Exception e) {
// Do nothing
}
%>
San Diego Breast Augmentation
San Diego Breast Augmentation
Deciding to have a plastic surgery
procedure is an important choice. Whether you are searching
for breast augmentation, breast lift, breast reduction or any
related procedures, our doctors provide consultations to help
answer your questions. If you are thinking about one of these
procedures and are not sure which one is right for you, we can
help.
At San Diego Breast Augmentation, our network
of board-certified physicians is dedicated to helping you
find the information about your desired procedure. The more
you know about the procedure and the options available, the
better equipped you will be to make an informed decision.
If you're considering a procedure, the San Diego
Breast Augmentation website will give you a basic
understanding of the procedure--when it can help, how it's
performed, and what results you can expect. It can't answer
all of your questions, since much depends on your individual
circumstances. The information presented on this site is intended
to be used for informational use only, it is not intended
to be a substitute for professional advice.
Should you wish to schedule a consultation at any time, click
here or call 1-800-505-3627 to talk to our patient coordinators.
San Diego Breast Augmentation
(800)505-3627 info@san-diego-breast-augmenation.com disclaimer
- site map