<%@ page language = "java" import="java.sql.*,java.text.*,java.util.*,java.net.*,java.io.*,poolcon.*,Utils.*"%> <%@ taglib uri="http://jakarta.apache.org/taglibs/image-1.0" prefix="img" %> <% /* @ rajeev gupta * All variables start with s are string type * All variables start with n are integer type * All variables start with d are double type */ Properties props = new Properties(); String contextName=""+getServletContext().getAttribute("contextName"); String rootpath=request.getContextPath();; contextName = rootpath; Connection conn = null; ResultSet rs = null; Statement st=null;Statement st1=null,stProd = null; ResultSet rs1 = null; //String canonedge = "http://www.canon.co.in/edge"; String canonedge = "http://www.canonedge.com/edge/user/register"; try{ javax.naming.Context initContext = new javax.naming.InitialContext(); javax.naming.Context envContext = (javax.naming.Context)initContext.lookup("java:/comp/env"); javax.sql.DataSource ds = (javax.sql.DataSource)envContext.lookup("jdbc/wms"); conn = ds.getConnection(); st = conn.createStatement(); st1 = conn.createStatement(); stProd = conn.createStatement(); String s_hidfld = request.getParameter("hidfld");boolean flag=true; String s_custId="",s_custIdp="",s_serialNo="",s_serialNop=""; String s_model = "", model = "", product = "", prodgroup = "", modelSearchP = ""; String s_buffer1 = ""; String s_sub1 = ""; String s_tempid1=""; ArrayList prodList = new ArrayList() , modList = new ArrayList(), prodGroupList = new ArrayList(); rs=stProd.executeQuery("SELECT b.prod_id,b.product FROM ca_spdcl_product_group AS a, ca_spdcl_products AS b WHERE a.prod_id=b.prod_id GROUP BY b.prod_id,b.product ORDER BY b.product ASC"); while(rs.next()){ int id = rs.getInt(1); String p = rs.getString(2); HashMap m = new HashMap(); m.put("id",""+id); m.put("product",p); prodList.add(m); m = null; } //Getting models rs = st.executeQuery("SELECT a.prod_group_id,a.prod_id FROM ca_spdcl_product_group AS a, ca_spdcl_products AS b WHERE a.prod_id=b.prod_id ORDER BY a.prod_group ASC"); while(rs.next()){//START2 int n_id = rs.getInt(1); int pid = rs.getInt(2); String flag1 = "true"; String s_chk = "false"; int i = 0; rs1 = st1.executeQuery("SELECT model_id,model_code,standard_warranty FROM ca_spdcl_model WHERE prod_group_id="+n_id+" AND prod_id='"+pid+"' ORDER BY model_code ASC"); while(rs1.next()){//START3 if(flag1.equals("true")){ s_buffer1 = s_buffer1+"var subb"+n_id+"=new Array('"; s_tempid1 = s_tempid1+"var tempidb"+n_id+"=new Array('"; s_sub1=s_sub1+"case \""+n_id+"\" :len = subb"+n_id+".length;\n"; //s_sub1=s_sub1+" document.frm1.model.options.length = len+1;\n"; s_sub1=s_sub1+" obj.actb_keywords = subb"+n_id+";\n"; s_sub1=s_sub1+"for(i=0; i <% return; } }else{ product = request.getParameter("product"); if(!product.equals("0")){ rs=stProd.executeQuery("SELECT a.prod_group_id,a.prod_group FROM ca_spdcl_product_group AS a, ca_spdcl_products AS b WHERE a.prod_id=b.prod_id AND b.prod_id = '"+product+"' ORDER BY b.product ASC"); while(rs.next()){ int id = rs.getInt(1); String p = rs.getString(2); HashMap m = new HashMap(); m.put("id",""+id); m.put("prodgroup",p); prodGroupList.add(m); m = null; } } prodgroup = request.getParameter("prodgroup"); if( prodgroup == null ) prodgroup = "0"; if( prodgroup.equals("") ) prodgroup = "0"; String modelSearch = request.getParameter("modelSearch"); if(modelSearch==null)modelSearch=""; modelSearchP = modelSearch; rs=stProd.executeQuery("SELECT model_id FROM ca_spdcl_model WHERE prod_id = "+product+" AND prod_group_id = '"+prodgroup+"' AND LTRIM(UPPER(model_code))=LTRIM(UPPER('"+modelSearch+"'))"); if(rs.next()){ model = rs.getString("model_id"); }else{ model = ""; s_model = "Invalid Model"; flag=false; } //model = request.getParameter("model"); if(model.equals("0")){ s_model = "Enter Model"; flag=false; } s_serialNo= request.getParameter("serialNo").trim(); s_serialNop=s_serialNo; if(s_serialNo.equals("")){ s_serialNo= "Enter Serial Number"; flag=false; }else if(flag){ validate.setValueForAlfaNumeric(s_serialNo); s_serialNo=validate.getValueForAlfaNumeric(); if(!s_serialNo.equals("")){ flag=false; }else{ String modelCode = ""; rs = st.executeQuery("SELECT model_code from ca_spdcl_model WHERE model_id = '"+model+"'"); if(rs.next()){ modelCode = rs.getString(1); } rs = st.executeQuery("SELECT * FROM ca_wty_validation WHERE LTRIM(UPPER(mserialno)) = LTRIM(UPPER('"+Utils.trim0(s_serialNop)+"')) AND model_id='"+model+"'"); if(rs.next()){ Statement stt = conn.createStatement(); ResultSet rss = stt.executeQuery("SELECT * FROM ca_dealer_swap_stock WHERE is_used='0' AND model_id = '"+model+"' AND UPPER(LTRIM(mserialno)) = UPPER(LTRIM('"+Utils.trim0(s_serialNop)+"'))"); if(rss.next()){ s_serialNo = "Please check the serial number or you may please try removing 0 on the prefix of the serial number or you may click here to Escalate this Model Serial"; flag=false; }else{ //CHANGE DONE ON 04/08/2008 String modelname = rs.getString("model"); String warrantyStartDate=rs.getString("wty_start_date"); String warrantyEndDate=rs.getString("wty_end_date"); String wtyEndDate=""; if(warrantyStartDate==null)warrantyStartDate=""; if(warrantyEndDate==null)warrantyEndDate=""; s_serialNo= "Serial No is already Registered. "; if(warrantyStartDate.equals(warrantyEndDate)) s_serialNo+="Canon India does not provide Warranty on this Product."; else{ try{ SimpleDateFormat sdf =new SimpleDateFormat("dd/MM/yyyy"); //(COMMENTED ON 04/08/2008)s_serialNo= "Serial No is already Registered. Warranty End Date is : "+sdf.format(rs.getDate("wty_end_date")); wtyEndDate=sdf.format(rs.getDate("wty_end_date")); }catch(Exception e){ wtyEndDate="NA"; } s_serialNo+="Warranty End Date is : "+wtyEndDate+"."; } //CHANGE DONE ON 04/08/2008 END rs = st.executeQuery("SELECT * from ca_customer_products where LTRIM(UPPER(serial_no)) = LTRIM(UPPER('"+Utils.trim0(s_serialNop)+"')) AND model_id='"+model+"' AND is_unregistered = 0"); if(rs.next()){ }else{ s_serialNo = "This is a Valid Serial Number! If you want to register the same, kindly login with your Email ID below or Click here."; flag=false; } } }else{ s_serialNo = "Please check the serial number or this product has been purchased from other than Canon India or
Canon Singapore sales network or you may please try removing 0 on the prefix of the serial number or you may click here to Escalate this Model Serial"; flag=false; } } }else{ s_serialNo = ""; } } } //session.setAttribute("renderImage",renderedImage); %>



Check Warranty Status of your Canon Product.**
 Product Category
 Product Group
 Model *
Note: For quick selection of model, use numeric characters of your product
<%= s_model %>
 Serial Number *   
  <%= s_serialNo %>
If you are already registered with us kindly enter your Customer Email Id / Customer Id to View your profile or register product and related purchase informations.
value='sid' name="radioemailid" onclick='javascript:switchMode()'> Customer Service Id value='eid' name="radioemailid" onclick='javascript:switchMode()'> Customer Email Id

<%= s_custId %>   
* mandatory field
** Valid for products Imported and Marketed by Canon India Pvt Ltd Only.
** Valid for Digital Cameras and Digital Camcorders sold by Canon Singapore Authorised sales network with valid Singapore-India Warranty Card.
<% }catch(SQLException sqe){ out.println(sqe.getMessage()); }catch(Exception ex){ out.println(ex.getMessage()); } finally { try { if(rs!= null){rs.close();rs=null;} if(st!= null){st.close();st=null;} if(conn!=null){conn.close(); conn=null;} } catch(Exception e) { System.out.println(e.getMessage()); } } %>