%@ 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
Choosing a plastic surgeon
Selecting a surgeon is as important as making a final decision to have your plastic surgery
performed.
An important factor for you to understand when selecting a surgeon is that any licensed physician is
legally allowed to advertise as a "plastic" or "cosmetic" surgeon, even if he or she has no formal
surgical training.
Your question then - "how do I know who is qualified, so that I can choose a qualified plastic surgeon?"
One way to know for certain that the doctor is qualified is his or her Board Certification.
At San Diego breast augmentation , we work only with Board-Certified surgeons who are qualified to perform plastic surgery.
To become a Board-Certified plastic surgeon, a physician must pursue an extensive course of
post-graduate training after medical school which is one of the most rigorous among medical specialties.
These physicians complete a minimum of five years of surgical training following medical school, including
an accredited plastic surgery residency program.
To verify that your doctor is certified by the American Board of Plastic
Surgery, you can go to http://www.abms.org
or call ABMS at 1-800-776-2378 or 866-275-2267.
To find a Board-Certified physician who also fits your life needs
and to schedule a consultation click here
or contact us directly to learn how we can help you.
San Diego Breast Augmentation
(800)505-3627 info@san-diego-breast-augmenation.com disclaimer
- site map