ApplicantPrint_DHAS.jsp 151 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    <%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
    <%@page import="com.csc.library.utility.DHMConvert" %>
    <%@page import="java.util.ArrayList" %>
    <%@page import="java.util.Iterator" %>
    <%@page import="java.util.Vector" %>
    <%@page import="java.util.*" %>
    <%@page import="com.csc.library.report.ReportUDF" %>
    <%@page import="javax.servlet.jsp.jstl.sql.Result" %>
    <%@page import="java.io.FileOutputStream" %>
    <%@page import="java.io.OutputStream" %>
    <%@page import="java.io.ByteArrayOutputStream" %>
    <%@page import="java.net.URLDecoder" %>
    <%@page import="java.text.DecimalFormat" %>
    <%@page import="java.net.URLEncoder" %>
    <%@page import="java.util.HashMap" %>
    <%@page import="java.text.SimpleDateFormat" %>
    <%@page import="java.util.Locale" %>
    <%@page import="java.util.Date" %>
    <%@page import="java.util.GregorianCalendar" %>
    <%@page import="com.csc.library.database.DataSet" %>
    <%@page import="com.csc.library.session.InitialInquiry" %>
    <%@page import="com.csc.library.session.InitialRecord" %>
    <%@page import="com.csc.library.session.DbInquiry" %>
    <%@page import="com.csc.library.session.DbRecord" %>
    <%@page import="com.csc.library.entry.HelpEntry" %>
    <%@page import="com.itextpdf.text.*" %>
    <%@page import="com.itextpdf.text.pdf.*" %>
    <%@page import="java.io.ByteArrayOutputStream" %>
    <%@page import="com.csc.library.session.InitialEnvironment" %>
    <%@page import="java.io.File" %>
    <%@page import="org.json.JSONArray" %>
    <%@page import="org.json.JSONObject" %>
    <%@page import="com.csc.library.utilities.*" %>
    <%@ page import="com.csc.library.databean.Simmapplicantwithgson" %>
    <%@ page import="com.csc.library.database.MyHashMap" %>
    <%@ page import="com.csc.library.utilities.gsonmapping.*" %>
37 38

    <jsp:useBean id="ApplicantPrint_DHAS" class="com.csc.library.system.Task" scope="page"/>
39 40 41 42 43 44 45 46
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8"/>
    <title>Report</title>
    </head>
    <body>
    <%
47 48
    ApplicantPrint_DHAS.setChannel(request, response);
    HelpEntry screen = (HelpEntry) ApplicantPrint_DHAS.process("HelpEntry", "MAPPLICANTHELP");
49 50 51 52 53 54 55
    CheckNull chk = new CheckNull();
    String filter = "APPLICANTID = '" + chk.chkNullString(request.getParameter("appid")) + "'";
    //    filter = "1=2";
    screen.setMaxLine(1);
    screen.inq.setFilter(filter);
    screen.process();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();//72
56
        Document document = new Document(PageSize.A4, 20, 20, 20, 20);// Left,Right,Top,Down
57 58
    float[] sizeColumn = new float[]{};

59 60 61 62
    //   PdfWriter.getInstance(document, baos);
    PdfWriter writer = PdfWriter.getInstance(document, baos);
    // add header and footer

63 64 65 66
    document.open();
    document.addTitle("Document Title");

    // Setting Fonts
67 68 69
   BaseFont bfWithFontAWesome = BaseFont.createFont(application.getRealPath("FONTS/FontAwesome.otf"), BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
    BaseFont bf = BaseFont.createFont(application.getRealPath("FONTS/Cordia.ttf"), BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
    BaseFont bfHead = BaseFont.createFont(application.getRealPath("FONTS/Cordia.ttf"), BaseFont.IDENTITY_H, BaseFont.EMBEDDED, true);
70
    Font font = new Font(bf, 11);
71
    Font fontTopic = new Font(bfHead, 20, Font.BOLD);
72
    Font fontHead = new Font(bfHead, 13, Font.BOLD);
73 74 75
    Font fontHeadWhiteColor = new Font(bfHead, 11, Font.BOLD, new BaseColor(255, 255, 255));
    //fontHead.setStyle(Font.BOLD);
    Font fontContent = new Font(bfHead, 11);
76
    Font fontBoldContent = new Font(bfHead, 11, Font.BOLD);
77 78 79 80 81
    Font font20B = new Font(bfHead, 20, Font.BOLD);
    Font font14N = new Font(bf, 14);
    Font font14B = new Font(bf, 14, Font.BOLD);
    Font font12N = new Font(bf, 12);
    Font font12B = new Font(bf, 12, Font.BOLD);
82
    Font fontAwesome = new Font(bfWithFontAWesome, 10);
83

84
    // set vlign middle
85
    Phrase content = new Phrase("Blah blah blah", font);
86 87 88 89 90 91 92 93 94 95 96 97 98
    Float fontSize = content.getFont().getSize();
    Float capHeight = content.getFont().getBaseFont().getFontDescriptor(BaseFont.CAPHEIGHT, fontSize);

    boolean hasData = false;
    if (screen.getInquiry().recCount() > 0) {
      hasData = true;
      screen.nextRec();
      screen.referLangOn();
      DbInquiry dbinq = null;
      int i = 0;
      
      Simmapplicantwithgson simmapplicantwithgson = (Simmapplicantwithgson) screen.inq.getCurrentDbRecord();
      
99
        //----------------------------mprefix------------------------------------
100

101 102
        String prefixTdesc = "";
        String prefixEdesc = "";
103

104 105 106 107 108 109
        DbInquiry inqmprefix = new InitialInquiry(screen.getUProfile()).getDbInquiry("mprefix");
        inqmprefix.setFilter("prefixid = '" + simmapplicantwithgson.mapplicantPersonal.prefixid + "'");
        inqmprefix.refresh();
        while (inqmprefix.next()) {
            prefixTdesc = inqmprefix.getString("tdesc");
            prefixEdesc = inqmprefix.getString("edesc");
110 111
        }

112 113 114 115 116 117 118 119 120 121 122 123
        //----------------------------END mprefix------------------------------------
        DecimalFormat DFO = new DecimalFormat("#,###,###.##");
        //----------------------------SET DATA Family------------------------------------
        MyHashMap familybackground = new MyHashMap();
        String[] masterrelations = {"01", "02", "03" ,"99"};
        String occupationDesc = "";
        String prefixTdesc_family = "";
        String line = "";
        int childtotal = 0;
        int relativetotal = 0;
        for (String relatationkey : masterrelations) {
            familybackground.put("prefix" + relatationkey, "");
124 125 126 127 128 129 130
            familybackground.put("fname" + relatationkey, "");
            familybackground.put("lname" + relatationkey, "");
            familybackground.put("age" + relatationkey, "");
            familybackground.put("occupation" + relatationkey, "");
            familybackground.put("position" + relatationkey, "");
            familybackground.put("status" + relatationkey, "");
            familybackground.put("workplace" + relatationkey, "");
131
            familybackground.put("phone" + relatationkey, "");
132
        }
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149

        familybackground.putToSum("prefixallchild", "");
        familybackground.putToSum("nameallchild", "");
        familybackground.putToSum("ageallchild", "");
        familybackground.putToSum("occupationallchild", "");
        familybackground.putToSum("positionallchild", "");
        familybackground.putToSum("statusallchild", "");
        familybackground.putToSum("workplaceandphoneallchild", "");
        //set blank data in ประวัติทั่วไป พี่น้อง 5 บรรทัด
        for (int num = 0 ; num < 5 ;num++){
          familybackground.put("nameSiblings "+num, "");
          familybackground.put("ageSiblings "+num, "");
          familybackground.put("relationSiblings "+num, "00");  
          familybackground.put("occupationSiblings "+num, "");
          familybackground.put("positionSiblings "+num, "");
          familybackground.put("workplaceSiblings "+num, "");
          familybackground.put("phoneSiblings "+num, "");          
150
        }
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
        //Use For Count older,littel brother and ister
        familybackground.putToSum("relation05" , 0);
        familybackground.putToSum("relation06" , 0);
        familybackground.putToSum("relation07" , 0);
        familybackground.putToSum("relation08" , 0);

        DbInquiry inqoccupation = new InitialInquiry(screen.getUProfile()).getDbInquiry("moccupation");
        DbInquiry inqmprefix_family = new InitialInquiry(screen.getUProfile()).getDbInquiry("mprefix");

        String prefixallchild = "";
        String nameallchild = "";
        String ageallchild = "";
        String occupationallchild = "";
        String positionallchild = "";
        String statusallchild = "";
        String workplaceandphoneallchild = "";

        String nameSiblings  = "";
        String ageSiblings  = "";
        String occupationSiblings  = "";
        String positionSiblings  = "";
        String workplaceSiblings  = "";
        String phoneSiblings  = "";

        for (MapplicantFamily.Family family : simmapplicantwithgson.mapplicantFamily.family) {
            inqoccupation.setFilter("occid = '" + family.occupation+ "'");
            inqoccupation.refresh();
            inqmprefix_family.setFilter("prefixid = '" + family.prefixid + "'");
            inqmprefix_family.refresh();
            while (inqoccupation.next()) {
                occupationDesc = inqoccupation.getString("tdesc");
            }
            while (inqmprefix_family.next()) {
                prefixTdesc_family = inqmprefix_family.getString("tdesc");
            }
            familybackground.put("prefix" + family.relation,prefixTdesc_family);
187 188 189 190
            familybackground.put("fname" + family.relation, family.fname);
            familybackground.put("lname" + family.relation, family.lname);
            familybackground.put("age" + family.relation, family.age);
            familybackground.put("occupation" + family.relation, occupationDesc);
191
            familybackground.put("position" + family.relation, family.position);
192 193 194
            familybackground.put("status" + family.relation, family.status);
            familybackground.put("workplace" + family.relation, family.workplace);
            familybackground.put("phone" + family.relation, family.phone);
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226


            if ("09,10,11,12,".indexOf(family.relation) > -1) {
                if (childtotal > 0) {
                    line = System.lineSeparator();
                }
                prefixallchild += line + prefixTdesc_family;
                nameallchild += line + family.fname + " " + family.lname;
                ageallchild += line + family.age;
                occupationallchild += line + occupationDesc;
                positionallchild += line + family.position;
                statusallchild += line + family.status;
                workplaceandphoneallchild += line + family.workplace + " " + family.phone;
                childtotal++;
            }
            if ("05,06,07,08,".indexOf(family.relation) > -1) {
                if (relativetotal > 0) {
                    line = System.lineSeparator();
                }

                familybackground.putToSum("relation" + family.relation, 1); // Count All Siblings

                familybackground.put("relationSiblings" + relativetotal, family.relation);
                familybackground.put("nameSiblings "+relativetotal, prefixTdesc_family+" "+family.fname + " " + family.lname );
                familybackground.put("ageSiblings "+relativetotal, family.age );
                familybackground.put("relationSiblings "+relativetotal, family.relation);  
                familybackground.put("occupationSiblings "+relativetotal, occupationDesc );
                familybackground.put("positionSiblings "+relativetotal, family.position );
                familybackground.put("workplaceSiblings "+relativetotal, family.workplace );
                familybackground.put("phoneSiblings "+relativetotal, family.phone );
                relativetotal++;
            }
227
        }
228
        familybackground.putToSum("prefixallchild",prefixallchild);
229 230 231
        familybackground.putToSum("nameallchild", nameallchild);
        familybackground.putToSum("ageallchild", ageallchild);
        familybackground.putToSum("occupationallchild", occupationallchild);
232
        familybackground.putToSum("positionallchild", positionallchild);
233 234
        familybackground.putToSum("statusallchild", line + statusallchild);
        familybackground.putToSum("workplaceandphoneallchild", workplaceandphoneallchild);
235 236 237 238 239 240 241 242 243 244 245 246 247
        //----------------------------END Family------------------------------------
        //----------------------------SETDATA REFERENCE ------------------------------------
      MyHashMap personreference = new MyHashMap();
      int roundreference = 0;

      for (int referencekey = 0; referencekey <= 5; referencekey++){
        personreference.put("name" + referencekey, "");
        personreference.put("jobtitle" + referencekey, "");
        personreference.put("companyname" + referencekey, "");
        personreference.put("phone" + referencekey, "");
        personreference.put("relations" + referencekey, "");
        personreference.put("address" + referencekey, "");
        
248 249

      }
250 251 252 253 254 255 256 257
      for (MapplicantFamily.Reference reference : simmapplicantwithgson.mapplicantFamily.reference) {
        personreference.put("name" + roundreference, chk.chkNullString(reference.name," "));
        personreference.put("jobtitle" + roundreference, chk.chkNullString(reference.jobtitle," "));
        personreference.put("companyname" + roundreference, chk.chkNullString(reference.companyname," "));
        personreference.put("phone" + roundreference, chk.chkNullString(reference.phone," "));
        personreference.put("relations" + roundreference, chk.chkNullString(reference.relations," "));
        personreference.put("address" + roundreference, chk.chkNullString(reference.address," "));
        roundreference++;
258
      }
259
      //----------------------------END REFERENCE-----------------------------------------
260
      
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
        //----------------------------SET Children------------------------------------
        String sons = simmapplicantwithgson.mapplicantPersonal.children.sons.equals(null) || simmapplicantwithgson.mapplicantPersonal.children.sons.equals("")?
        "0":simmapplicantwithgson.mapplicantPersonal.children.sons;
        String daughters = simmapplicantwithgson.mapplicantPersonal.children.daughters.equals(null) || simmapplicantwithgson.mapplicantPersonal.children.daughters.equals("")?
        "0":  simmapplicantwithgson.mapplicantPersonal.children.daughters;
        int children = Integer.valueOf(sons)+Integer.valueOf(daughters);
        //----------------------------END Children------------------------------------
        //----------------------------SETDATA OTHER ------------------------------------
        MyHashMap companyReference = new MyHashMap();
        String mprefixdesc = "";
        int roundComReference = 0;
        for (int referencekey = 0; referencekey <= 5; referencekey++){   
         // companyReference.put("prefix" + referencekey, "");
          companyReference.put("fullname" + referencekey, "");
         // companyReference.put("lname" + referencekey, "");
          companyReference.put("position" + referencekey, "");
          //companyReference.put("relation" + referencekey, "");
          //companyReference.put("dept" + referencekey, "");
          //companyReference.put("major" + referencekey, "");
280
        }
281 282


283 284 285 286 287 288
        for (MapplicantOther.Referee_group referee_group : simmapplicantwithgson.mapplicantOther.referee_group) {
          DbInquiry inqmprefixcom = new InitialInquiry(screen.getUProfile()).getDbInquiry("mprefix");
          inqmprefixcom.setFilter("prefixid = '" + referee_group.prefix + "'");
          inqmprefixcom.refresh();
          while (inqmprefixcom.next()) {
            mprefixdesc = inqmprefixcom.getString("tdesc");
289
          }
290 291 292
          companyReference.put("fullname" + roundComReference, mprefixdesc + chk.chkNullString(referee_group.name," ")+"   "+chk.chkNullString(referee_group.lname," "));
          companyReference.put("position" + roundComReference, chk.chkNullString(referee_group.position," "));
          roundComReference++;
293
        }
294 295 296 297
        //----------------------------END OTHER-----------------------------------------
        //----------------------------END OTHER-----------------------------------------
        //----------------------------SETDATA EDUCATION------------------------------------
        MyHashMap educationbackground = new MyHashMap();
298
        String[] masterdegree = {"L004","L005","L006","L007","L008","L009","L010","L011","L012","L013","L014","L015", "L016", "L017"};
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
        String degreeDesc = "";
        String  EduV = ""; //Education Vocabulary
        for (String degreekey : masterdegree) {

            if("L009,L010,L006,L007,L008,L004".indexOf(degreekey) > -1){
               if("L006,L009,L010".indexOf(degreekey) > -1){
                EduV = "M6";
               }else if("L004,L007,L008".indexOf(degreekey) > -1){
                 EduV = "M3";
               }
              educationbackground.put("name" + EduV, "");
              educationbackground.put("from" + EduV, "");
              educationbackground.put("to" + EduV, "");
              educationbackground.put("degree" + EduV, "");
              educationbackground.put("major" + EduV, "");
              educationbackground.put("fac" + EduV, "");
              educationbackground.put("gpa" + EduV, "");
            }else{
              educationbackground.put("name" + degreekey, "");
              educationbackground.put("from" + degreekey, "");
              educationbackground.put("to" + degreekey, "");
              educationbackground.put("degree" + degreekey, "");
              educationbackground.put("major" + degreekey, "");
              educationbackground.put("fac" + degreekey, "");
              educationbackground.put("gpa" + degreekey, "");
            }
            
        }
        DbInquiry inqdegree = new InitialInquiry(screen.getUProfile()).getDbInquiry("mdegree");
        for (MapplicantEducation.Education education : simmapplicantwithgson.mapplicantEducation.education) {    
            inqdegree.setFilter("degreeid = '" + education.degreetype + "'");
            inqdegree.refresh();
            while (inqdegree.next()) {
                degreeDesc = inqdegree.getString("tdesc");
            }
            if("L009,L010,L006,L007,L008,L004".indexOf(education.degreetype) > -1){
               if("L006,L009,L010".indexOf(education.degreetype) > -1){
                  EduV = "M6";
               }else if("L004,L007,L008".indexOf(education.degreetype) > -1){
                  EduV = "M3";
               }
            }else{
              EduV = education.degreetype ;
            }
            if (education.university.universitylist == null) {
                educationbackground.put("name" + EduV, education.university.searchtext);
            } else {
                educationbackground.put("name" + EduV, education.university.universitylist.name.tha);
            }
            educationbackground.put("from" + EduV, education.yearstart);
            educationbackground.put("to" + EduV, education.yearend);
            educationbackground.put("degree" + EduV, degreeDesc);
            if (education.major.majorlist == null) {
                educationbackground.put("major" + EduV, education.major.searchtext);
            } else {
                educationbackground.put("major" + EduV, education.major.majorlist.name.tha);
            }
356 357
            if (education.fac.searchtext != null) {
                educationbackground.put("fac" + EduV, education.fac.searchtext);
358
            } else {
359
                educationbackground.put("fac" + EduV, education.fac.facultylist.facultydesc.tha);
360 361
            }
            educationbackground.put("gpa" + EduV, education.gpa);
362 363
        }

364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449
        //----------------------------SETDATA CONTACT ------------------------------------
        StringBuilder sb = new StringBuilder();
        sb.append(simmapplicantwithgson.mapplicantContact.home.addr);
        if (!simmapplicantwithgson.mapplicantContact.home.moo.equalsIgnoreCase("-")) {
            sb.append(" หมู่ " + simmapplicantwithgson.mapplicantContact.home.moo);
        }
        sb.append("เลขที่ " + simmapplicantwithgson.mapplicantContact.home.addr);
        sb.append(" ต. " + simmapplicantwithgson.mapplicantContact.home.district);
        sb.append(" อ. " + simmapplicantwithgson.mapplicantContact.home.zipcode.disname.tha);
        sb.append(" จ. " + simmapplicantwithgson.mapplicantContact.home.zipcode.proname.tha);
        sb.append("    " + simmapplicantwithgson.mapplicantContact.home.zipcode.zipid);

        StringBuilder sc = new StringBuilder();
        sc.append(simmapplicantwithgson.mapplicantContact.current.addr);
        if (!simmapplicantwithgson.mapplicantContact.current.moo.equalsIgnoreCase("-")) {
            sc.append(" หมู่ " + simmapplicantwithgson.mapplicantContact.current.moo);
        }
        sc.append(" เลขที่ " + simmapplicantwithgson.mapplicantContact.current.addr);
        sc.append(" ถนน " + simmapplicantwithgson.mapplicantContact.current.road);
        sc.append(" ต. " + simmapplicantwithgson.mapplicantContact.current.district);
        sc.append(" อ. " + simmapplicantwithgson.mapplicantContact.current.zipcode.disname.tha);
        sc.append(" จ. " + simmapplicantwithgson.mapplicantContact.current.zipcode.proname.tha);
        sc.append("    " + simmapplicantwithgson.mapplicantContact.current.zipcode.zipid);
        //----------------------------END CONTACT------------------------------------

        //----------------------------SETDATA JOPEXP------------------------------------
        MyHashMap jobexp = new MyHashMap();
        int roundjobexp = 0;

        for (int jobexpkey = 0; jobexpkey <= 10; jobexpkey++){
            jobexp.put("companyname_job" + jobexpkey, "");
            jobexp.put("start" + jobexpkey, "");
            jobexp.put("end" + jobexpkey, "");
            jobexp.put("title" + jobexpkey, "");
            jobexp.put("natureBusiness" + jobexpkey, "");
            jobexp.put("description" + jobexpkey, "");
            jobexp.put("salary" + jobexpkey, "");
            jobexp.put("endingsalary" + jobexpkey, "");
            jobexp.put("reason" + jobexpkey, "");
            jobexp.put("addr" + jobexpkey, "");
            jobexp.put("village" + jobexpkey, "");
            jobexp.put("floor" + jobexpkey, "");
            jobexp.put("soi" + jobexpkey, "");
            jobexp.put("moo" + jobexpkey, "");
            jobexp.put("road" + jobexpkey, "");
            jobexp.put("district" + jobexpkey, "");
            jobexp.put("disname" + jobexpkey, "");
            jobexp.put("proname" + jobexpkey, "");
            jobexp.put("zipid" + jobexpkey, "");
            jobexp.put("phoneJob" + jobexpkey, "");
        }
        for (MapplicantJobexp.Job job : simmapplicantwithgson.mapplicantJobexp.job) {
            jobexp.put("companyname_job" + roundjobexp, job.companyname);
            jobexp.put("start" + roundjobexp,new CscCalendar(job.start.toString().substring(0,10)).getDDMMYYYY());
            jobexp.put("end" + roundjobexp, new CscCalendar(job.end.toString().substring(0,10)).getDDMMYYYY());
            jobexp.put("title" + roundjobexp, job.title);
            jobexp.put("natureBusiness" + roundjobexp, job.natureBusiness);
            jobexp.put("description" + roundjobexp, job.description);
            jobexp.put("salary" + roundjobexp, job.endingsalary.equals("")?"-": DFO.format(Integer.valueOf( job.salary.toString().replaceAll(",",""))));
            jobexp.put("endingsalary" + roundjobexp,job.endingsalary.equals("")?"-": DFO.format(Integer.valueOf( job.endingsalary.toString().replaceAll(",",""))));
            jobexp.put("reason" + roundjobexp, job.reason);
            jobexp.put("addr" + roundjobexp, job.addr);
            jobexp.put("village" + roundjobexp, job.village);
            jobexp.put("floor" + roundjobexp, job.floor);
            jobexp.put("soi" + roundjobexp, job.soi);
            jobexp.put("moo" + roundjobexp, job.moo);
            jobexp.put("road" + roundjobexp, job.road);
            jobexp.put("district" + roundjobexp, job.district);
            jobexp.put("disname_job" + roundjobexp, job.zipcode.disname.tha);
            jobexp.put("proname_job" + roundjobexp, job.zipcode.proname.tha);
            jobexp.put("zipid" + roundjobexp, job.zipcode.zipid);
            jobexp.put("phoneJob" + roundjobexp, job.phone);
            roundjobexp++;
        }
        //----------------------------END JOPEXP------------------------------------
        //----------------------------SETDATA Training------------------------------------
        MyHashMap trainingHM = new MyHashMap();
        int roundtraining = 0;
        String startDay ="";
        String endDay ="";
        for (int round = 0; round < 6; round++){
            trainingHM.put("name" + round, "");
            trainingHM.put("by" + round, "");
            trainingHM.put("year" + round, "");
            trainingHM.put("countday" + round, "");
        }
450

451 452 453 454 455 456 457 458 459 460 461 462
        for (MapplicantJobexp.Training training : simmapplicantwithgson.mapplicantJobexp.training) {
          startDay = new CscCalendar(training.start.toString().substring(0,10)).getYYYYMMDD();
          endDay = new CscCalendar(training.end.toString().substring(0,10)).getYYYYMMDD();
          int Countday = new CscCalendar(startDay).countDay(endDay);
            trainingHM.putToSum("name" + roundtraining, training.name);
            trainingHM.putToSum("by" + roundtraining, training.by);
            trainingHM.putToSum("year" + roundtraining,new CscCalendar(training.start.toString().substring(0,4)).getThaiYYYY());
            trainingHM.putToSum("countday" + roundtraining,String.valueOf(Countday) + " วัน");
            roundtraining++;
        }
        //----------------------------END Training------------------------------------
        //----------------------------nationality------------------------------------
463

464
        String nationalityDesc = "";
465

466 467 468 469 470 471
        DbInquiry inqMnationality = new InitialInquiry(screen.getUProfile()).getDbInquiry("Mnationality");
        inqMnationality.setFilter("nationalityid = '" + simmapplicantwithgson.mapplicantPersonal.nationalityid + "'");
        inqMnationality.refresh();
        while (inqMnationality.next()) {
            nationalityDesc = inqMnationality.getString("tdesc");
        }
472

473 474 475 476 477 478 479 480 481
        //----------------------------END nationality------------------------------------

        //------------------------------------age------------------------------------
        String age_memployee = "";

        CscCalendar startDate = new CscCalendar(simmapplicantwithgson.mapplicantPersonal.birthdate.substring(0,10));
        CscCalendar endDate = new CscCalendar();
        CountAge count = new CountAge(screen.getUProfile().get("lang"));
        age_memployee=count.getCountAges(startDate,endDate,true);
482

483
        //------------------------------------end age------------------------------------
484

485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541
        //----------------------------nationa------------------------------------

        String nationaDesc = "";

        DbInquiry inqmnational = new InitialInquiry(screen.getUProfile()).getDbInquiry("mnational");
        inqmnational.setFilter("nationalid = '" + simmapplicantwithgson.mapplicantPersonal.nationalityid + "'");
        inqmnational.refresh();
        while (inqmnational.next()) {
            nationaDesc = inqmnational.getString("tdesc");
        }

        //----------------------------END nationa------------------------------------

        // ----------------------------religion------------------------------------

        String religionDesc = "";

        DbInquiry inqmreligion = new InitialInquiry(screen.getUProfile()).getDbInquiry("mreligion");
        inqmreligion.setFilter("religionid = '"+simmapplicantwithgson.mapplicantPersonal.religionid+"'");
        inqmreligion.refresh();
        while(inqmreligion.next()){
            religionDesc = inqmreligion.getString("tdesc");
        }

        //----------------------------END religion------------------------------------
        //----------------------------SETDATA Skill ------------------------------------
        MyHashMap hmlangskill = new MyHashMap();
        MyHashMap masterskilllevel = new MyHashMap();
        String[] id = {"EN", "CH", "JP", "TH"};
        String skillnameDesc ="";
        String skilllevelDesc ="";
        int langskillloop = 0;
        for (String initlangskill : id) {
            hmlangskill.put("skillname"+initlangskill,"");
            hmlangskill.put("id"+initlangskill,"XX");
            hmlangskill.put("reading"+initlangskill,"");
            hmlangskill.put("write"+initlangskill,"");
            hmlangskill.put("speak"+initlangskill,"");
            hmlangskill.put("listen"+initlangskill,"");
        }
        for(int initlangskill = 0; initlangskill <= 5; initlangskill++){
            hmlangskill.put("skillname"+initlangskill,"");
            hmlangskill.put("id"+initlangskill,"");
            hmlangskill.put("reading"+initlangskill,"");
            hmlangskill.put("write"+initlangskill,"");
            hmlangskill.put("speak"+initlangskill,"");
            hmlangskill.put("listen"+initlangskill,"");
        }

        DbInquiry inqskilllevel = new InitialInquiry(screen.getUProfile()).getDbInquiry("mskilllevel");
        inqskilllevel.refresh();
        while(inqskilllevel.next()) {
            masterskilllevel.put(inqskilllevel.getString("skilllevelid"),inqskilllevel.getString("skilllevelid"));
        }
        //DbInquiry inqlangskill = new InitialInquiry(screen.getUProfile()).getDbInquiry("mlanguage");
        for (MapplicantSkill.Langskill langskill : simmapplicantwithgson.mapplicantSkill.langskill) {

542 543 544
          if(langskill.searchtext != null){
              hmlangskill.put("skillname"+langskillloop, langskill.searchtext);
           // hmlangskill.put("id"+langskill.langskilllist.id, langskill.langskilllist.id);
545 546 547 548
              hmlangskill.put("reading"+langskillloop,masterskilllevel.get(langskill.skill.reading));
              hmlangskill.put("write"+langskillloop,masterskilllevel.get(langskill.skill.write));
              hmlangskill.put("speak"+langskillloop,masterskilllevel.get(langskill.skill.speak));
              hmlangskill.put("listen"+langskillloop,masterskilllevel.get(langskill.skill.listen));
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568
          }else{
            
              hmlangskill.put("id"+langskill.langskilllist.id, langskill.langskilllist.id);
              hmlangskill.put("reading"+langskill.langskilllist.id,masterskilllevel.get(langskill.skill.reading));
              hmlangskill.put("write"+langskill.langskilllist.id,masterskilllevel.get(langskill.skill.write));
              hmlangskill.put("speak"+langskill.langskilllist.id,masterskilllevel.get(langskill.skill.speak));
              hmlangskill.put("listen"+langskill.langskilllist.id,masterskilllevel.get(langskill.skill.listen));

              if(!(("CH,EN").indexOf(langskill.langskilllist.id) > -1)){
                hmlangskill.put("skillname"+langskillloop, langskill.langskilllist.name.tha);
                hmlangskill.put("id"+langskill.langskilllist.id, langskill.langskilllist.id);
                hmlangskill.put("reading"+langskillloop,masterskilllevel.get(langskill.skill.reading));
                hmlangskill.put("write"+langskillloop,masterskilllevel.get(langskill.skill.write));
                hmlangskill.put("speak"+langskillloop,masterskilllevel.get(langskill.skill.speak));
                hmlangskill.put("listen"+langskillloop,masterskilllevel.get(langskill.skill.listen));
                langskillloop++;
              }
          }

            
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638
        }
        //----------------------------End Skill ----------------------------------------
         //----------------------------SETDATA Activity ------------------------------------
        MyHashMap hmactivity = new MyHashMap();
        int activityloop = 0;
        String degreeDesc2 ="";
        for(int init = 0; init < 1; init++){
            hmactivity.put("name"+init,"");
            hmactivity.put("degreetype"+init,"");
            hmactivity.put("role"+init,"");
            hmactivity.put("roledesc"+init,"");
            hmactivity.put("start"+init,"");
            hmactivity.put("end"+init,"");
        }

        DbInquiry inqdegree2 = new InitialInquiry(screen.getUProfile()).getDbInquiry("mdegree");

        //DbInquiry inqlangskill = new InitialInquiry(screen.getUProfile()).getDbInquiry("mlanguage");
        for (MapplicantSkill.Activity activity : simmapplicantwithgson.mapplicantSkill.activity) {
          inqdegree2.setFilter("degreeid = '" + activity.degreetype + "'");
          inqdegree2.refresh();
          while (inqdegree2.next()) {
            degreeDesc2 = inqdegree2.getString("tdesc");
          }
            hmactivity.put("name"+activityloop,activity.name);
            hmactivity.put("degreetype"+activityloop,degreeDesc2);
            hmactivity.put("role"+activityloop,activity.role);
            hmactivity.put("roledesc"+activityloop,activity.roledesc);
            hmactivity.put("start"+activityloop,activity.start);
            hmactivity.put("end"+activityloop,activity.end);
            activityloop++;
            
        }
      //----------------------------End Activity ----------------------------------------
      //----------------------------Set Hobbies ----------------------------------------
        String hobbies = "";
        String[] array = new String[simmapplicantwithgson.mapplicantSkill.hobbies.size()];
        int index = 0;
        for (Object value : simmapplicantwithgson.mapplicantSkill.hobbies) {
          if(index != 0){
            hobbies += ",";
          }
          hobbies += (String) value;
          index++;
        }
      //----------------------------End Hobbies ----------------------------------------
      //----------------------------Set Sport ----------------------------------------
        String sport = "";
        array = new String[simmapplicantwithgson.mapplicantSkill.sport.size()];
        index = 0;
        for (Object value : simmapplicantwithgson.mapplicantSkill.sport) {
          if(index != 0){
            sport += ",";
          }
          sport += (String) value;
          index++;
        }
      //----------------------------End Sport ----------------------------------------
      //----------------------------Set Expertise ----------------------------------------
        String expertise = "";
        array = new String[simmapplicantwithgson.mapplicantSkill.expertise.size()];
        index = 0;
        for (Object value : simmapplicantwithgson.mapplicantSkill.expertise) {
          if(index != 0){
            expertise += ",";
          }
          expertise += (String) value;
          index++;
        }
       //----------------------------End Expertise ----------------------------------------
639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659
    try {
      CscCalendar calendar = new CscCalendar();
      GregorianCalendar gc = new GregorianCalendar();
      boolean langthai = screen.getUProfile().get("lang").equalsIgnoreCase("THA");
      String reportname = "", printdate = "", printby = "", refer = "RTA2007";
      String reportname_label = "", printdate_label = "", prdate = "", refer_label = "";
      if (langthai) {
      reportname_label = "รายงาน :";
      reportname = "รายงานข้อมูลพนักงาน";
      printdate_label = "วันที่พิมพ์ :";
      prdate = calendar.getDDMMYYYY();
      printdate = "วัน" + calendar.getLongThiDOW() + "ที่ " + calendar.getDate() + " " + calendar.getThaiLongMonth() + " พ.ศ. " + calendar.getThaiYYYY() + " " + calendar.getHHMM() + " น.";
      printby = screen.getUProfile().get("tfullname");
      refer_label = "อ้างอิง #";
      } else {
      reportname_label = "Report Name :";
      reportname = "Personal Report";
      printdate_label = "Print Date :";
      printby = screen.getUProfile().get("efullname");
      refer_label = "Ref #";
    }
660 661
 // --------------- new line -----------------      

662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690
      sizeColumn = new float[]{20.0f,60.0f,20.0f};
      PdfPTable detailHeader = new PdfPTable(3);
      detailHeader.setWidthPercentage(100);
      detailHeader.setWidths(sizeColumn);
      PdfPCell cellDetail;
      Image imglogo = null;
      
      //Image logo= new Image(ImageDataFactory.create(IMG));
      setPaddingTop(1.0f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(4.5f);

      DbInquiry mcom = new InitialInquiry(screen.getUProfile()).getDbInquiry("mcompany");
      try{
        imglogo = Image.getInstance(getImagePath("COMPANY_UPLOAD-dir","LOGO/","DHAS_RECRUIT.PNG","DEFAULTPERSON.jpg"));
        imglogo.scaleToFit(450, 80);
     //   cellDetail = new PdfPCell(img, true);
     //   cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
     //   cellDetail.setVerticalAlignment (Element.ALIGN_MIDDLE);
     //   cellDetail.setFixedHeight(80);
     //   cellDetail.setBorder(Rectangle.NO_BORDER);
      imglogo.setAbsolutePosition(50f, 630f);
     //   detailHeader.addCell(cellDetail);
      }
      catch (Exception e) {
        detailHeader.addCell(getCellData("NO PIC", font12N, "", "CENTER", "MIDDLE", 1, 5));
      } 
      document.add(imglogo);
691 692 693 694 695 696 697 698
      Rectangle rect= new Rectangle(575,780,20,20); // you can resize rectangle     
      rect.enableBorderSide(1);
      rect.enableBorderSide(2);
      rect.enableBorderSide(4);
      rect.enableBorderSide(8);
      rect.setBorderColor(BaseColor.BLACK);
      rect.setBorderWidth(1);  
      document.add(rect);   
699
    // --------------- new line -----------------
700
     // --------------- new line -----------------
701 702
      sizeColumn = new float[]{100.0f};
      PdfPTable detail = new PdfPTable(1);
703 704 705
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      Image img = null;
706 707 708
      setPaddingTop(0.5f);
      setPaddingLeft(0.0f);
      setPaddingRight(0.0f);
709 710


711 712
      detail.addCell(getCellData("FR-710-007 / Revision No. : 01", font12N, "NO", "RIGHT", "TOP", 0, 0));
      detail.addCell(getCellData("Effective Date : 12/05/09", font12N, "NO", "RIGHT", "TOP", 0, 0));
713
      setPaddingTop(10.5f);
714

715 716 717 718 719 720
      detail.addCell(getCellData("ใบสมัครงาน", font20B, "NO", "CENTER", "TOP", 0, 0));
      setPaddingTop(10.5f);
      detail.addCell(getCellData("รหัสใบสมัคร"+".....................", font12N, "NO", "RIGHT", "TOP", 0, 0));
      setPaddingTop(0.5f);
      detail.addCell(getCellData("วันที่รับสมัคร"+".....................", font12N, "NO", "RIGHT", "TOP", 0, 0));
      detail.addCell(getCellData("แหล่งที่ทราบข่าว"+".....................", font12N, "NO", "RIGHT", "TOP", 0, 0));
721 722 723
      setPaddingTop(50.5f);
      setPaddingBottom(4.5f);
      detail.addCell(getCellData(" ", font12N, "NO", "RIGHT", "TOP", 0, 0));
724
      document.add(detail);
725

726 727 728 729 730 731
      // --------------- new line -----------------
      sizeColumn = new float[]{15.0f,15.0f,70.0f};
      detail = new PdfPTable(3);
      detail.setWidthPercentage(90);
      detail.setWidths(sizeColumn);
      setPaddingTop(0.0f);
732
      setPaddingLeft(3.5f);
733 734 735 736
      setPaddingRight(3.5f);
      setPaddingBottom(4.5f);
      detail.addCell(getCellData("ผู้ผลิต และผู้แทนจำหน่าย เครื่องเขียน กระดาษ วัสดุอุปกรณ์สำนักงาน และช่างเขียน", font14B, "NO", "LEFT", "TOP", 3, 0));
      detail.addCell(getCellData("สำนักงานสุรวงศ์", font12N, "NO", "LEFT", "TOP", 0, 0));
peema_phongam committed
737 738
      detail.addCell(getCellData("      เลขที่ 202", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ถ.สุรวงศ์ บางรัก กรุงเทพฯ 10500 โทร. 0-2668-0123", font12N, "NO", "LEFT", "TOP", 0, 0));
739

740
      detail.addCell(getCellData("โรงงานนวนคร", font12N, "NO", "LEFT", "TOP", 0, 0));
peema_phongam committed
741 742
      detail.addCell(getCellData("      เลขที่ 101/27", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("นิคมอุตสาหกรรม นวนคร โครงการ 1 ต.คลองหนึ่ง อ.คลองหลวง จ.ปทุมธานี 12120 โทร. 0-2668-0123", font12N, "NO", "LEFT", "TOP", 0, 0));
743 744

      detail.addCell(getCellData("โรงงานโรจนะ", font12N, "NO", "LEFT", "TOP", 0, 0));
peema_phongam committed
745 746
      detail.addCell(getCellData("      เลขที่ 21/11 ม.9", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("สวนอุตสาหกรรมโรจนะ ต.านหาม อ.อุทัย จ.พระนครศรีอยุธยา 13210 โทร. 0-2668-0123", font12N, "NO", "LEFT", "TOP", 0, 0));
747 748

      detail.addCell(getCellData("DC2(โรงงาน 2 เดิม)", font12N, "NO", "LEFT", "TOP", 0, 0));
peema_phongam committed
749 750
      detail.addCell(getCellData("      เลขที่ 60/67", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("นิคมอุตสาหกรรม นวนคร โครงการ 2 ต.คลองหนึ่ง อ.คลองหลวง จ.ปทุมธานี 12120 โทร. 0-2668-0123", font12N, "NO", "LEFT", "TOP", 0, 0));
751

peema_phongam committed
752
      detail.addCell(getCellData("ศูนย์คลังสินค้าและบริการ  เลขที่ 94 ม.15        ต.บางพลีใหญ่ อ.บางพลี จ.สมุทรปราการ 10540 โทร. 0-2668-0123", font12N, "NO", "LEFT", "TOP", 3, 0));
753 754
      document.add(detail);
      // --------------- new line -----------------
755 756
      sizeColumn = new float[]{10.0f,90.0f};
      detail = new PdfPTable(2);
757 758
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
759
      setPaddingTop(0.0f);
760 761 762
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(0.5f);
763 764 765 766 767
      detail.addCell(getCellData("คำแนะนำ  :", font14N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ขอให้ผู้สมัครอ่านและทำความเข้าใจข้อความแต่ละข้ออย่างละเอียดก่อนที่จะกรอกข้อความใดๆ ลงไปในช่องว่างนั้นๆ หากปรากฏว่าผู้สมัครปกปิดความจริง", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("หรือมีเจตนาแจ้งข้อความเท็จจริง จะส่งผลให้ผู้สมัครหมดสิทธิ์ได้รับพิจารณาเข้าทำงานกับบริษัทฯ หรืออาจถูกเลิกจ้างในภายหลัง โดยไม่จ่ายค่าชดเชยใดๆทั้งสิ้น", font12N, "NO", "LEFT", "TOP", 2, 0));
      detail.addCell(getCellData(" ", font14N, "NO", "LEFT", "TOP", 2, 0));
      setPaddingBottom(0.5f);
768
      document.add(detail);
769

770
      // --------------- new line -----------------
peema_phongam committed
771
      sizeColumn = new float[]{20.0f,25.0f,15.0f,15.0f,12.0f,7.0f,5.0f,26.25f};
772
      detail = new PdfPTable(8);
773 774
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
775 776 777 778
      setPaddingTop(3.5f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(6.5f);
779 780
      detail.addCell(getCellData("ตำแหน่งที่สมัคร", font14B, "", "CENTER", "MIDDLE", 4, 0,false,true));
      detail.addCell(getCellData("เงินเดือนที่ต้องการ", font14B, "", "CENTER", "TOP", 3, 0,false,true));
781 782 783
      //IMAGE
      img = Image.getInstance(getImagePath("RECRUIT_UPLOAD-dir","PICTURE/",simmapplicantwithgson.mapplicantPersonal.imgname,"DEFAULTPERSON.jpg"));
      cellDetail = new PdfPCell(img, false);
peema_phongam committed
784
      img.scaleAbsolute(90f, 90f);
785 786 787
      cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
      cellDetail.setVerticalAlignment (Element.ALIGN_MIDDLE);
      cellDetail.setColspan(1);
peema_phongam committed
788
      cellDetail.setRowspan(4);
789
      detail.addCell(cellDetail);
790
      detail.addCell(getCellData("1."+screen.getString("MJOBCODE", "TDESC"), font14N, "", "LEFT", "TOP", 4, 0));
peema_phongam committed
791
      detail.addCell(getCellData(DFO.format(Integer.valueOf(screen.getString("SALARY_EXPECT").replaceAll(",", ""))).toString()+"  บาท", font14N, "", "RIGHT", "TOP", 3, 0));
792 793
      detail.addCell(getCellData(" ", font14N, "", "LEFT", "TOP", 4, 0));
      detail.addCell(getCellData(" ", font14N, "", "RIGHT", "TOP", 3, 0));
794

peema_phongam committed
795
      detail.addCell(getCellData("ประวัติส่วนตัว", font14B, "", "CENTER", "TOP", 7, 0,false,true));
796

797
      String prefix  = simmapplicantwithgson.mapplicantPersonal.prefixid;
798 799 800 801 802 803
      Chunk Chu4 = new Chunk("ชื่อ-สกุล (",font12N); 
      Chunk Chu0 = new Chunk("/",font12N);
      Chunk Chu1 = new Chunk("นาย",font12N);
      Chunk Chu2 = new Chunk("นาง",font12N);
      Chunk Chu3 = new Chunk("น.ส.)",font12N);
      if(prefix.equalsIgnoreCase("01")){
804
        Chu1.setUnderline(0.1f, -2f);
805
      }else if(prefix.equalsIgnoreCase("02")){
806
        Chu2.setUnderline(0.1f, -2f);
807
      }else if(prefix.equalsIgnoreCase("03")){
808 809 810
        Chu3.setUnderline(0.1f, -2f);
      }
      content = new Phrase();
811
      content.add(Chu4);
812 813 814 815 816 817
      content.add(Chu1);
      content.add(Chu0);
      content.add(Chu2);
      content.add(Chu0);
      content.add(Chu3);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
818
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantPersonal.fname.tha, font14N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
819
      detail.addCell(getCellData("ชื่อกลาง", font14N, "NO", "LEFT", "TOP", 0, 0));
peema_phongam committed
820
      detail.addCell(getCellData("-", font14N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
821
      detail.addCell(getCellData("นามสกุล", font14N, "NO", "LEFT", "TOP", 0, 0));
peema_phongam committed
822 823
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantPersonal.lname.tha, font14N, "R_BOTTOM_DOT", "LEFT", "TOP", 3, 0));
      document.add(detail);
824

peema_phongam committed
825 826 827 828 829 830 831 832
      sizeColumn = new float[]{20.0f,25.0f,15.0f,15.0f,12.0f,7.0f,5.0f,26.25f};
      detail = new PdfPTable(8);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(3.5f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(6.5f);
833 834 835 836 837 838
      Chu4 = new Chunk("Name (",font12N); 
      Chu0 = new Chunk("/",font12N);
      Chu1 = new Chunk("Mr.",font12N);
      Chu2 = new Chunk("Mrs.",font12N);
      Chu3 = new Chunk("Ms.)",font12N);
      if(prefix.equalsIgnoreCase("01")){
839
        Chu1.setUnderline(0.1f, -2f);
840
      } else if(prefix.equalsIgnoreCase("02")){
841
        Chu2.setUnderline(0.1f, -2f);
842
      }else if(prefix.equalsIgnoreCase("03")){
843 844 845
        Chu3.setUnderline(0.1f, -2f);
      }
      content = new Phrase();
846
      content.add(Chu4);
847 848 849 850 851 852
      content.add(Chu1);
      content.add(Chu0);
      content.add(Chu2);
      content.add(Chu0);
      content.add(Chu3);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
853
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantPersonal.fname.eng, font14N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
peema_phongam committed
854 855 856 857
      detail.addCell(getCellData("Middle name", font14N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("-", font14N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("Surname", font14N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantPersonal.lname.eng, font14N, "R_BOTTOM_DOT", "LEFT", "TOP", 3, 0));
858 859 860 861 862
      setPaddingTop(0.0f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(0.0f);
      detail.addCell(getCellData(" ", font14N, "NO", "CENTER", "TOP", 5, 0));
863
      document.add(detail);
864

peema_phongam committed
865 866 867 868 869 870 871 872 873 874 875 876

      // --------------- new line -----------------
      sizeColumn = new float[]{100.0f};
      detail = new PdfPTable(1);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(0.0f);
      setPaddingBottom(0.0f);
      detail.addCell(getCellData(" ", font, "NO", "CENTER", "MIDDLE", 0, 0));
      document.add(detail);


877
      // --------------- new line -----------------
878 879
      sizeColumn = new float[]{20.0f,20.0f,20.0f,20.0f,20.0f};
      detail = new PdfPTable(5);
880 881
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
882
      setPaddingTop(3.5f);
883 884
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
885 886 887 888 889 890 891 892 893 894 895 896 897
      setPaddingBottom(3.5f);
      detail.addCell(getCellData("วัน / เดือน / ปีที่เกิด", font14B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("อายุ", font14B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("สัญชาติ", font14B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("ส่วนสูง", font14B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("น้ำหนัก", font14B, "", "CENTER", "TOP", 0, 0));
 
      detail.addCell(getCellData(new CscCalendar(simmapplicantwithgson.mapplicantPersonal.birthdate.substring(0, 10)).getThaiDDMMYYYY().replaceAll("-","/"), font14N, "", "CENTER", "TOP", 1, 1,true,false));
      detail.addCell(getCellData(age_memployee.substring(0,2), font14N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(nationalityDesc, font14N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantPersonal.height, font14N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantPersonal.weight, font14N, "", "CENTER", "TOP", 0, 0));
      setPaddingBottom(0.5f);
898
      document.add(detail);
899

900
      // --------------- new line -----------------
901 902
      sizeColumn = new float[]{20.0f,10.0f,10.0f,10.0f,10.0f,10.0f};
      detail = new PdfPTable(6);
903 904 905 906 907
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(0.0f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
908 909 910 911 912 913 914 915
      setPaddingBottom(0.5f);
      detail.addCell(getCellData("บัตรประจำตัวประชาชนเลขที่", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantPersonal.identification.iden_number, font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("วันที่ออกบัตร", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(new CscCalendar(simmapplicantwithgson.mapplicantPersonal.identification.pinstart.substring(0, 10)).getDDMMYYYY(), font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("วันที่หมดอายุ", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(new CscCalendar(simmapplicantwithgson.mapplicantPersonal.identification.pinend.substring(0, 10)).getDDMMYYYY(), font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      document.add(detail);
916
      // --------------- new line -----------------
917 918 919
      String military_status = simmapplicantwithgson.mapplicantPersonal.military.status;
      sizeColumn = new float[]{13.0f,5.0f,17.0f,2.0f,10.0f,2.0f,12.0f,2.0f,10.0f};
      detail = new PdfPTable(9);
920 921 922 923 924
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(0.0f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
925 926 927 928 929 930 931 932 933 934
      setPaddingBottom(0.5f);
      detail.addCell(getCellData("เลขประจำตัวผู้เสียภาษี", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(" ", font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("(เฉพาะเพศชาย) สถานภาพทางทหาร", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(military_status.equalsIgnoreCase("1")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ผ่านการเกณฑ์ทหาร", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(military_status.equalsIgnoreCase("2")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ยังไม่ผ่านการเกณฑ์ทหาร", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(military_status.equalsIgnoreCase("3")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ได้รับการยกเว้น / รด.", font12N, "NO", "LEFT", "TOP", 0, 0));
935 936
      document.add(detail);
      // --------------- new line -----------------
937 938 939
      String sso_hospital = simmapplicantwithgson.mapplicantPersonal.sso.hospital;
      sizeColumn = new float[]{15.0f,20.0f,6.0f,7.0f,6.0f,7.0f};
      detail = new PdfPTable(6);
940 941
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
942
      setPaddingTop(0.0f);
943 944
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
945 946 947 948 949 950 951 952 953
      setPaddingBottom(0.5f);
      detail.addCell(getCellData("ชื่อโรงพยาบาลที่ระบุในบัตรรับรองสิทธิ", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(sso_hospital, font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("วันที่ออกบัตร", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(new CscCalendar(simmapplicantwithgson.mapplicantPersonal.sso.pinstart.substring(0, 10)).getThaiDDMMYYYY(), font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("วันที่หมดอายุ", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(new CscCalendar(simmapplicantwithgson.mapplicantPersonal.sso.pinend.substring(0, 10)).getThaiDDMMYYYY(), font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
       detail.addCell(getCellData(" ", font12N, "NO", "LEFT", "TOP", 6, 0));
      setPaddingBottom(0.5f);
954 955
      document.add(detail);
      // --------------- new line -----------------
956 957
      sizeColumn = new float[]{100.0f};
      detail = new PdfPTable(1);
958 959
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
960
      setPaddingTop(3.5f);
961 962
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
963 964
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("การติดต่อกับผู้สมัครงาน", font14B, "", "CENTER", "MIDDLE", 0, 0,false,true));
965 966
      document.add(detail);
      // --------------- new line -----------------
967 968
      sizeColumn = new float[]{15.0f,35.0f,10.0f,40.0f};
      detail = new PdfPTable(4);
969 970 971 972 973
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(0.0f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
974 975 976 977 978 979 980 981 982 983 984 985 986 987
      setPaddingBottom(0.5f);
      detail.addCell(getCellData("ที่อยู่ปัจจุบัน", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
      detail.addCell(getCellData(sb.toString(), font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 3, 0));
      detail.addCell(getCellData("โทรศัพท์บ้าน", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantContact.current.number, font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
      detail.addCell(getCellData("โทรศัพท์มือถือ", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantContact.phone, font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
      detail.addCell(getCellData("ที่อยู่ตามทะเบียนบ้าน", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
      detail.addCell(getCellData(sc.toString(), font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 3, 0));
      detail.addCell(getCellData("โทรศัพท์", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantContact.home.number, font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 3, 0));
      detail.addCell(getCellData(" ", font12N, "NO", "LEFT", "MIDDLE", 4, 0));
      
      setPaddingBottom(0.5f);
988 989
      document.add(detail);
      // --------------- new line -----------------
990 991 992 993 994 995 996 997 998 999 1000 1001 1002
      sizeColumn = new float[]{100.0f};
      detail = new PdfPTable(1);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(3.5f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("บุคคลที่บริษัทฯ สามารถติดต่อ กรณีฉุกเฉิน", font14B, "", "CENTER", "MIDDLE", 0, 0,false,true));
      document.add(detail);
      // --------------- new line -----------------
      String emergencyContact = simmapplicantwithgson.mapplicantContact.emergencyContact.address;
      sizeColumn = new float[]{10.0f,20.0f,10.0f,10.0f,10.0f,10.0f,10.0f,10.0f};
1003 1004 1005 1006 1007 1008
      detail = new PdfPTable(8);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(0.0f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035
      setPaddingBottom(0.5f);
      detail.addCell(getCellData("1.ชื่อ-สกุล", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantContact.emergencyContact.name, font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ความสัมพันธ์", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantContact.emergencyContact.relations, font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("อาชีพ", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("../../..", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("โทรศัพท์", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantContact.emergencyContact.phone, font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ที่อยู่/ติดต่อ", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantContact.emergencyContact.address, font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 7, 0));

      detail.addCell(getCellData("2.ชื่อ-สกุล", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("...", font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ความสัมพันธ์", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("../../..", font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("อาชีพ", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("../../..", font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("โทรศัพท์", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("../../..", font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ที่อยู่/ติดต่อ", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("../../..", font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 7, 0));
      setPaddingBottom(0.5f);
      document.add(detail);

      // PAGE 2
      document.newPage();
1036 1037 1038 1039 1040 1041 1042 1043
      rect= new Rectangle(575,800,20,41); // you can resize rectangle     
      rect.enableBorderSide(1);
      rect.enableBorderSide(2);
      rect.enableBorderSide(4);
      rect.enableBorderSide(8);
      rect.setBorderColor(BaseColor.BLACK);
      rect.setBorderWidth(1);  
      document.add(rect);   
1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126
      // --------------- new line -----------------
      sizeColumn = new float[]{100.0f};
      detail = new PdfPTable(1);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(3.5f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("ประวัติทั่วไป", font14B, "", "CENTER", "MIDDLE", 0, 0,false,true));
      document.add(detail);

      // --------------- new line -----------------
      String birthorder = simmapplicantwithgson.mapplicantPersonal.birthorder;
      sizeColumn = new float[]{8.5f,3.0f,3.0f,6.5f,3.0f,6.0f,3.0f,3.0f,6.0f,3.0f,3.0f,6.0f,3.0f,3.0f,6.0f,3.0f,3.0f};
      detail = new PdfPTable(17);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(3.5f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(0.5f);
      detail.addCell(getCellData("พี่น้องรวมทั้งหมด", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData(String.valueOf(relativetotal+1), font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("คน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("ท่านเป็นคนที่", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData(birthorder, font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("พี่ชาย", font12N, "NO", "RIGHT", "MIDDLE", 0, 0));
      detail.addCell(getCellData(familybackground.get("relation05").toString(), font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("คน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("พี่สาว", font12N, "NO", "RIGHT", "MIDDLE", 0, 0));
      detail.addCell(getCellData(familybackground.get("relation07").toString(), font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("คน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("น้องชาย", font12N, "NO", "RIGHT", "MIDDLE", 0, 0));
      detail.addCell(getCellData(familybackground.get("relation06").toString(), font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("คน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("น้องสาว", font12N, "NO", "RIGHT", "MIDDLE", 0, 0));
      detail.addCell(getCellData(familybackground.get("relation08").toString(), font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("คน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      setPaddingTop(0.5f);
      setPaddingBottom(0.5f);
      detail.addCell(getCellData(" ", font12N, "NO", "LEFT", "MIDDLE", 17, 0));


      document.add(detail);
      // --------------- new line -----------------
      String brosis = "";
      sizeColumn = new float[]{10.0f,20.0f,5.0f,15.0f,15.0f,10.0f};
      detail = new PdfPTable(6);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(3.0f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("ลำดับ", font12B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("ชื่อสกุล", font12B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("อายุ", font12B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("อาชีพ / ตำแหน่ง", font12B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("สถานที่ทำงาน / ติดต่อ", font12B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("โทรศัพท์", font12B, "", "CENTER", "TOP", 0, 0));

      detail.addCell(getCellData("บิดา", font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("prefix01").toString()+" "+familybackground.get("fname01").toString() + "   " + familybackground.get("lname01").toString(), font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("age01").toString(), font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("occupation01").toString(), font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("workplace01").toString(), font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("phone01").toString(), font12N, "", "CENTER", "TOP", 0, 0));

      detail.addCell(getCellData("มารดา", font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("prefix02").toString()+" "+familybackground.get("fname02").toString() + "   " + familybackground.get("lname02").toString(), font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("age02").toString(), font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("occupation02").toString(), font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("workplace02").toString(), font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("phone02").toString(), font12N, "", "CENTER", "TOP", 0, 0));

      for(int num=0;num<5;num++){ 
      //detail.addCell(getCellData("[]พี่ []น้อง", font12N, "", "CENTER", "TOP", 0, 0));
      brosis = familybackground.get("relationSiblings "+num).toString();
      Chu0 = new Chunk("05,07".indexOf(brosis) > -1? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" พี่   ",font12N);
      Chu2 = new Chunk("06,08".indexOf(brosis) > -1? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu3 = new Chunk(" น้อง",font12N);
1127
      content = new Phrase();
1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155
      content.add(Chu0);
      content.add(Chu1);
      content.add(Chu2);
      content.add(Chu3);
      detail.addCell(getCellData2( content, "", "CENTER", "MIDDLE",  1,  1) );
     // detail.addCell(getCellData(brosis, font12N, "NO", "CENTER", "MIDDLE", 1, 0));
      detail.addCell(getCellData(familybackground.get("nameSiblings "+num).toString(), font12N, "", "CENTER", "MIDDLE", 1, 0));
      detail.addCell(getCellData(familybackground.get("ageSiblings "+num).toString(), font12N, "", "CENTER", "MIDDLE", 1, 0));
      detail.addCell(getCellData(familybackground.get("occupationSiblings "+num).toString(), font12N, "", "CENTER", "MIDDLE", 1, 0));
      detail.addCell(getCellData(familybackground.get("workplaceSiblings "+num).toString(), font12N, "", "CENTER", "MIDDLE", 1, 0));
      detail.addCell(getCellData(familybackground.get("phoneSiblings "+num).toString(), font12N, "", "CENTER", "MIDDLE", 1, 0));
      }
      setPaddingBottom(0.5f);
      document.add(detail);
      // --------------- new line -----------------
      String personal_status = simmapplicantwithgson.mapplicantPersonal.status;
      sizeColumn = new float[]{15.0f,10.0f,15.0f,15.0f,10.0f,10.0f};
      detail = new PdfPTable(6);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(3.0f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("สถานภาพสมรส", font14B, "NO", "LEFT", "TOP", 0, 0));

      Chu0 = new Chunk(personal_status.equalsIgnoreCase("S")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" โสด",font12N);
1156
      content = new Phrase();
1157 1158
      content.add(Chu0);
      content.add(Chu1);
1159
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
1160 1161
      Chu0 = new Chunk(personal_status.equalsIgnoreCase("M")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" สมรส(จดทะเบียน)",font12N);
1162
      content = new Phrase();
1163 1164 1165 1166 1167
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );     
      Chu0 = new Chunk(personal_status.equalsIgnoreCase("E")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" สมรส(ไม่จดทะเบียน)",font12N);
1168
      content = new Phrase();
1169 1170 1171 1172 1173
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) ); Chu0 = new Chunk(personal_status.equalsIgnoreCase("M")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu0 = new Chunk(personal_status.equalsIgnoreCase("W")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" หม้าย",font12N);
1174
      content = new Phrase();
1175 1176 1177 1178 1179
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) ); 
      Chu0 = new Chunk(personal_status.equalsIgnoreCase("D")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" หย่า",font12N);
1180
      content = new Phrase();
1181 1182 1183 1184 1185
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) ); 
      document.add(detail);

1186
      // --------------- new line -----------------
1187 1188
      sizeColumn = new float[]{10.0f,20.0f,5.0f,3.0f,5.0f,15.0f};
      detail = new PdfPTable(6);
1189 1190
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1191
      setPaddingTop(0.0f);
1192 1193
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205
      setPaddingBottom(0.5f);
      detail.addCell(getCellData("ชื่อสามี / ภรรยา", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("prefix03").toString()+" "+familybackground.get("fname03").toString() + "   " + familybackground.get("lname03").toString(), font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("อายุ", font12N, "NO", "RIGHT", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("age03").toString(), font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("ปี  อาชีพ", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("occupation03").toString(), font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("สถานที่ทำงาน / ที่ติดต่อ", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("workplace03").toString(), font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 3, 0));
      detail.addCell(getCellData("โทรศัพท์", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(familybackground.get("phone03").toString(), font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0));
      setPaddingBottom(0.5f);
1206 1207
      document.add(detail);
      // --------------- new line -----------------
1208 1209 1210

      sizeColumn = new float[]{6.0f,5.0f,3.0f,5.0f,5.0f,3.0f,5.0f,5.0f,30.0f};
      detail = new PdfPTable(9);
1211 1212 1213 1214 1215
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(0.0f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226
      setPaddingBottom(0.5f);
      detail.addCell(getCellData("จำนวนบุตร", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(String.valueOf(children), font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("คน", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ศึกษา", font12N, "NO", "RIGHT", "TOP", 0, 0));
      detail.addCell(getCellData("...", font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("คน", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ไม่ศึกษา", font12N, "NO", "RIGHT", "TOP", 0, 0));
      detail.addCell(getCellData("...", font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("คน", font12N, "NO", "LEFT", "TOP", 0, 0));
      setPaddingBottom(0.5f);
1227
      document.add(detail);
1228

1229
      // --------------- new line -----------------
1230 1231
      sizeColumn = new float[]{100.0f};
      detail = new PdfPTable(1);
1232 1233
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1234
      setPaddingTop(0.5f);
1235 1236 1237
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(0.5f);
1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248
      detail.addCell(getCellData(" ", font12N, "NO", "LEFT", "TOP", 0, 0));
      setPaddingTop(3.5f);
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("ประวัติการศึกษา", font14B, "", "CENTER", "MIDDLE", 0, 0,false,true));
      document.add(detail);
      // --------------- new line -----------------
      sizeColumn = new float[]{8.0f,15.0f,8.0f,8.0f,15.0f,20.0f,5.0f};
      detail = new PdfPTable(7);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(3.5f);
1249 1250 1251
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(3.5f);
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275
      detail.addCell(getCellData("ระดับวุฒิ", font12B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("สถาบันการศึกษา", font12B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("จากเดือน/ปี", font12B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("ถึงเดือน/ปี", font12B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("คณะ/ภาควิชา", font12B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("สาขา", font12B, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("เกรด", font12B, "", "CENTER", "TOP", 0, 0));

      detail.addCell(getCellData("ปริญญาโท", font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(educationbackground.get("nameL016").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("fromL016").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("toL016").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("facL016").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("majorL016").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("gpaL016").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData("ปริญญาตรี", font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(educationbackground.get("nameL015").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("fromL015").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("toL015").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("facL015").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("majorL015").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("gpaL015").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      // แสดงเฉพาะ จบที่สูงที่สุดก่อน
      detail.addCell(getCellData("ปวช. / ปวส.", font12N, "", "CENTER", "TOP", 0, 0));
peema_phongam committed
1276 1277 1278 1279 1280 1281
      detail.addCell(getCellData("", font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("", font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("", font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("", font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("", font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("", font12N, "", "CENTER", "TOP", 0, 0));
1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304
      detail.addCell(getCellData("ม.6", font12N, "", "CENTER", "TOP", 0, 0));
      
      detail.addCell(getCellData(educationbackground.get("nameM6").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("fromM6").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("toM6").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("facM6").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("majorM6").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("gpaM6").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));

      detail.addCell(getCellData("ม.3", font12N, "", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData(educationbackground.get("nameM3").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("fromM3").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("toM3").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("facM3").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("majorM3").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      detail.addCell(getCellData(educationbackground.get("gpaM3").toString(), font12N, "", "CENTER", "TOP", 0, 0,true,false));
      document.add(detail);
      // --------------- new line -----------------
      sizeColumn = new float[]{10.0f,15.0f,10.0f,10.0f,10.0f,15.0f,10.0f,10.0f,10.0f};
      detail = new PdfPTable(9);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(3.5f);
1305 1306 1307
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(0.5f);
1308 1309
      detail.addCell(getCellData("ปัจจุบัน", font14B, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("กำลังศึกษาระดับวุฒิ", font12N, "NO", "LEFT", "TOP", 0, 0));
peema_phongam committed
1310
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
1311
      detail.addCell(getCellData("สถาบัน", font12N, "NO", "LEFT", "TOP", 0, 0));
peema_phongam committed
1312
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
1313
      detail.addCell(getCellData("สาขา", font12N, "NO", "LEFT", "TOP", 0, 0));
peema_phongam committed
1314
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
1315
      detail.addCell(getCellData("ปีที่เข้า", font12N, "NO", "LEFT", "TOP", 0, 0));
peema_phongam committed
1316
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
1317 1318 1319
      setPaddingTop(0.5f);
      detail.addCell(getCellData(" ", font12N, "R_BOTTOM", "CENTER", "TOP", 9, 0));
      document.add(detail);
1320
      // --------------- new line -----------------
1321 1322
      sizeColumn = new float[]{10.0f,15.0f,10.0f,10.0f,10.0f,15.0f,10.0f};
      detail = new PdfPTable(7);
1323 1324
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1325
      setPaddingTop(3.5f);
1326 1327
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1328 1329 1330 1331 1332 1333 1334 1335
      setPaddingBottom(0.5f);
      detail.addCell(getCellData("ประวัติกิจกรรม", font14B, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("ระดับการศึกษา", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(hmactivity.get("degreetype0").toString(), font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("กิจกรรม", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(hmactivity.get("name0").toString(), font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("ตำแหน่งกิจกรรม", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(hmactivity.get("role0").toString(), font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
1336 1337
      document.add(detail);
      // --------------- new line -----------------
1338 1339 1340

      sizeColumn = new float[]{14.5f,35.0f,14.0f,35.0f};
      detail = new PdfPTable(4);
1341 1342
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1343
      setPaddingTop(3.5f);
1344 1345
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1346 1347 1348 1349 1350 1351 1352 1353 1354
      setPaddingBottom(0.5f);
      detail.addCell(getCellData("หน้าที่/ความรับผิดชอบ", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(hmactivity.get("roledesc0").toString(), font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("ช่วงเวลาที่ทำกิจกรรม", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(hmactivity.get("start0").toString().toString().substring(0,10) + "ถึง" + hmactivity.get("end0").toString().substring(0,10), font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("งานอดิเรก", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(hobbies, font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("กีฬาที่ถนัด", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(sport, font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
1355 1356
      document.add(detail);
      // --------------- new line -----------------
1357 1358
      sizeColumn = new float[]{15.0f,15.0f,10.0f,10.0f,7.0f,15.0f,5.0f,25.0f};
      detail = new PdfPTable(8);
1359 1360
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1361
      setPaddingTop(3.5f);
1362 1363 1364
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(0.5f);
1365 1366 1367 1368 1369 1370 1371 1372 1373 1374
      detail.addCell(getCellData("ความสามารถพิเศษ", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData(expertise, font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("พิมพ์ดีดไทย", font12N, "NO", "RIGHT", "TOP", 0, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantSkill.typing.tha, font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("คำ/นาที", font12N, "NO", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("พิมพ์ดีดอังกฤษ", font12N, "NO", "RIGHT", "TOP", 0, 0));
      detail.addCell(getCellData(simmapplicantwithgson.mapplicantSkill.typing.eng, font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0));
      detail.addCell(getCellData("คำ/นาที", font12N, "NO", "LEFT", "TOP", 0, 0));
      setPaddingTop(0.5f);
      detail.addCell(getCellData(" ", font12N, "R_BOTTOM", "LEFT", "TOP", 8, 0));
1375
      document.add(detail);
1376

1377
      // --------------- new line -----------------
1378 1379
      sizeColumn = new float[]{10.0f,90.0f};
      detail = new PdfPTable(2);
1380 1381
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1382
      setPaddingTop(3.5f);
1383 1384
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1385 1386 1387 1388
      setPaddingBottom(0.5f);
      detail.addCell(getCellData("คอมพิวเตอร์", font14B, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("(ระบุโปรแกรมสำเร็จรูปที่ใช้ได้ / ภาษาคอมพิวเตอร์ที่เขียนได้)", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      document.add(detail);
1389
      // --------------- new line -----------------
1390 1391
      sizeColumn = new float[]{12.5f,12.5f,12.5f,12.5f,15.5f,12.5f,12.5f,12.5f};
      detail = new PdfPTable(8);
1392 1393
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1394
      setPaddingTop(3.5f);
1395 1396
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458
      setPaddingBottom(6.5f);
      Chu0 = new Chunk(AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" Window",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" MS-Word",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" MS-Excel",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" MS-Access",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" MS-Power Point",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" OfficeTie",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" Linux",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" JAVA,HTML",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );

      Chu0 = new Chunk(AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" PhotoShop",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" อื่นๆ (โปรดระบุ)" + "...",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  7,  1) );
1459
      document.add(detail);
1460

1461
      // --------------- new line -----------------
1462 1463 1464 1465 1466 1467 1468
      Boolean car_driving = simmapplicantwithgson.mapplicantSkill.vehicle.car.driving;
      Boolean car_own = simmapplicantwithgson.mapplicantSkill.vehicle.car.own;
      Boolean motorcycle_driving =simmapplicantwithgson.mapplicantSkill.vehicle.motorcycle.driving;
      Boolean motorcycle_own =simmapplicantwithgson.mapplicantSkill.vehicle.motorcycle.own;
    
      sizeColumn = new float[]{20.0f,20.0f,20.0f,20.0f,20.0f};
      detail = new PdfPTable(5);
1469 1470
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1471
      setPaddingTop(3.5f);
1472 1473
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1474 1475 1476 1477
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("รถยนต์", font14B, "R_TOP", "LEFT", "TOP", 0, 0));
      Chu0 = new Chunk(car_driving? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" ขับได้",font12N);
1478
      content = new Phrase();
1479 1480 1481 1482 1483
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "R_TOP", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(!car_driving? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" ขับไม่ได้",font12N);
1484
      content = new Phrase();
1485 1486 1487 1488 1489
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "R_TOP", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(car_own? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" มีรถ",font12N);
1490
      content = new Phrase();
1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "R_TOP", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(!car_own? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" ไม่มีรถ",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "R_TOP", "LEFT", "MIDDLE",  1,  1) );

      detail.addCell(getCellData("รถจักรยานยนต์", font14B, "R_TOP", "LEFT", "TOP", 0, 0));
      Chu0 = new Chunk(motorcycle_driving? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" ขับได้",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "R_TOP", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(!motorcycle_driving? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" ขับไม่ได้",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "R_TOP", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(motorcycle_own? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" มีรถ",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "R_TOP", "LEFT", "MIDDLE",  1,  1) );
      Chu0 = new Chunk(!motorcycle_own? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome);
      Chu1 = new Chunk(" ไม่มีรถ",font12N);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "R_TOP", "LEFT", "MIDDLE",  1,  1) );
      document.add(detail);    

      // --------------- new line -----------------
      String[] level = {" ดีมาก   ", " ดี   ", " ปานกลาง   ", " พอใช้"};
      String[] idlang = {"EN","CH"};
      String[] langSkill = {"ภาษาอังกฤษ","ภาษาจีน"};
      sizeColumn = new float[]{15.0f,30.0f,30.0f,30.0f};
      detail = new PdfPTable(4);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(3.5f);
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("ทักษะทางภาษา", font14B, "", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("พูด", font14B, "", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("อ่าน", font14B, "", "LEFT", "TOP", 0, 0));
      detail.addCell(getCellData("เขียน", font14B, "", "LEFT", "TOP", 0, 0));

        detail.addCell(getCellData(langSkill[0], font14B, "", "LEFT", "TOP", 0, 0));
        content = new Phrase();
        content.add(new Chunk(hmlangskill.get("speak"+idlang[0]).toString().equalsIgnoreCase("1")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[0],font12N));
        content.add(new Chunk(hmlangskill.get("speak"+idlang[0]).toString().equalsIgnoreCase("2")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[1],font12N));
        content.add(new Chunk(hmlangskill.get("speak"+idlang[0]).toString().equalsIgnoreCase("3")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[2],font12N));
        content.add(new Chunk(hmlangskill.get("speak"+idlang[0]).toString().equalsIgnoreCase("4")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[3],font12N));
        detail.addCell(getCellData2( content, "", "LEFT", "MIDDLE",  1,  1) );

        content = new Phrase();
        content.add(new Chunk(hmlangskill.get("reading"+idlang[0]).toString().equalsIgnoreCase("1")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[0],font12N));
        content.add(new Chunk(hmlangskill.get("reading"+idlang[0]).toString().equalsIgnoreCase("2")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[1],font12N));
        content.add(new Chunk(hmlangskill.get("reading"+idlang[0]).toString().equalsIgnoreCase("3")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[2],font12N));
        content.add(new Chunk(hmlangskill.get("reading"+idlang[0]).toString().equalsIgnoreCase("4")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[3],font12N));
        detail.addCell(getCellData2( content, "", "LEFT", "MIDDLE",  1,  1) );

        content = new Phrase();
        content.add(new Chunk(hmlangskill.get("write"+idlang[0]).toString().equalsIgnoreCase("1")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[0],font12N));
        content.add(new Chunk(hmlangskill.get("write"+idlang[0]).toString().equalsIgnoreCase("2")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[1],font12N));
        content.add(new Chunk(hmlangskill.get("write"+idlang[0]).toString().equalsIgnoreCase("3")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[2],font12N));
        content.add(new Chunk(hmlangskill.get("write"+idlang[0]).toString().equalsIgnoreCase("4")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[3],font12N));
        detail.addCell(getCellData2( content, "", "LEFT", "MIDDLE",  1,  1) );

        detail.addCell(getCellData(langSkill[1], font14B, "", "LEFT", "TOP", 0, 0));
        content = new Phrase();
        content.add(new Chunk(hmlangskill.get("speak"+idlang[1]).toString().equalsIgnoreCase("1")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[0],font12N));
        content.add(new Chunk(hmlangskill.get("speak"+idlang[1]).toString().equalsIgnoreCase("2")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[1],font12N));
        content.add(new Chunk(hmlangskill.get("speak"+idlang[1]).toString().equalsIgnoreCase("3")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[2],font12N));
        content.add(new Chunk(hmlangskill.get("speak"+idlang[1]).toString().equalsIgnoreCase("4")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[3],font12N));
        detail.addCell(getCellData2( content, "", "LEFT", "MIDDLE",  1,  1) );

        content = new Phrase();
        content.add(new Chunk(hmlangskill.get("reading"+idlang[1]).toString().equalsIgnoreCase("1")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[0],font12N));
        content.add(new Chunk(hmlangskill.get("reading"+idlang[1]).toString().equalsIgnoreCase("2")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[1],font12N));
        content.add(new Chunk(hmlangskill.get("reading"+idlang[1]).toString().equalsIgnoreCase("3")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[2],font12N));
        content.add(new Chunk(hmlangskill.get("reading"+idlang[1]).toString().equalsIgnoreCase("4")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[3],font12N));
        detail.addCell(getCellData2( content, "", "LEFT", "MIDDLE",  1,  1) );

        content = new Phrase();
        content.add(new Chunk(hmlangskill.get("write"+idlang[1]).toString().equalsIgnoreCase("1")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[0],font12N));
        content.add(new Chunk(hmlangskill.get("write"+idlang[1]).toString().equalsIgnoreCase("2")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[1],font12N));
        content.add(new Chunk(hmlangskill.get("write"+idlang[1]).toString().equalsIgnoreCase("3")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[2],font12N));
        content.add(new Chunk(hmlangskill.get("write"+idlang[1]).toString().equalsIgnoreCase("4")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[3],font12N));
        detail.addCell(getCellData2( content, "", "LEFT", "MIDDLE",  1,  1) );
      for(int num=0;num < 2;num++ ){
        detail.addCell(getCellData(String.valueOf(hmlangskill.get("skillname"+num)), font14B, "", "LEFT", "TOP", 0, 0));

        content = new Phrase();
        content.add(new Chunk(hmlangskill.get("speak"+num).toString().equalsIgnoreCase("1")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[0],font12N));
        content.add(new Chunk(hmlangskill.get("speak"+num).toString().equalsIgnoreCase("2")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[1],font12N));
        content.add(new Chunk(hmlangskill.get("speak"+num).toString().equalsIgnoreCase("3")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[2],font12N));
        content.add(new Chunk(hmlangskill.get("speak"+num).toString().equalsIgnoreCase("4")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[3],font12N));
        detail.addCell(getCellData2( content, "", "LEFT", "MIDDLE",  1,  1) );

        content = new Phrase();
        content.add(new Chunk(hmlangskill.get("reading"+num).toString().equalsIgnoreCase("1")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[0],font12N));
        content.add(new Chunk(hmlangskill.get("reading"+num).toString().equalsIgnoreCase("2")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[1],font12N));
        content.add(new Chunk(hmlangskill.get("reading"+num).toString().equalsIgnoreCase("3")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[2],font12N));
        content.add(new Chunk(hmlangskill.get("reading"+num).toString().equalsIgnoreCase("4")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[3],font12N));
        detail.addCell(getCellData2( content, "", "LEFT", "MIDDLE",  1,  1) );

        content = new Phrase();
        content.add(new Chunk(hmlangskill.get("write"+num).toString().equalsIgnoreCase("1")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[0],font12N));
        content.add(new Chunk(hmlangskill.get("write"+num).toString().equalsIgnoreCase("2")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[1],font12N));
        content.add(new Chunk(hmlangskill.get("write"+num).toString().equalsIgnoreCase("3")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[2],font12N));
        content.add(new Chunk(hmlangskill.get("write"+num).toString().equalsIgnoreCase("4")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
        content.add(new Chunk(level[3],font12N));
        detail.addCell(getCellData2( content, "", "LEFT", "MIDDLE",  1,  1) );
      }
      document.add(detail); 
      // PAGE 3
      document.newPage();
1651 1652 1653 1654 1655 1656 1657 1658
      rect= new Rectangle(575,800,20,41); // you can resize rectangle     
      rect.enableBorderSide(1);
      rect.enableBorderSide(2);
      rect.enableBorderSide(4);
      rect.enableBorderSide(8);
      rect.setBorderColor(BaseColor.BLACK);
      rect.setBorderWidth(1);  
      document.add(rect);   
1659 1660 1661
      // --------------- new line -----------------
      sizeColumn = new float[]{10.0f,12.0f,10.0f,10.0f,10.0f,10.0f,10.0f,10.0f};
      detail = new PdfPTable(8);
1662 1663
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1664
      setPaddingTop(2.5f);
1665 1666
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1667 1668 1669 1670 1671 1672 1673 1674
      setPaddingBottom(5.5f);
      detail.addCell(getCellData("ประวัติการทำงาน (ให้ระบุที่ทำงานแห่งแรกถึงที่ทำงานปัจจุบันตามลำดับ)", font14B, "", "CENTER", "MIDDLE", 8, 0,false,true));
      setPaddingTop(0.5f);
      setPaddingBottom(2.5f);
      for(int num=0;num < 3;num++ ){
        detail.addCell(getCellData("บริษัท", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData(jobexp.get("companyname_job"+num).toString(), font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 2, 0));
        detail.addCell(getCellData("ที่อยู่", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
peema_phongam committed
1675
        detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 4, 0));
1676 1677 1678 1679 1680 1681 1682
        detail.addCell(getCellData("โทรศัพท์", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData(jobexp.get("phoneJob"+num).toString(), font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData("ลักษณะธุรกิจ", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData(jobexp.get("natureBusiness"+num).toString(), font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData("ตำแหน่งเริ่มต้น", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData(jobexp.get("description"+num).toString(), font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData("ตำแหน่งสุดท้าย", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
peema_phongam committed
1683 1684 1685 1686 1687
        detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData("เริ่ม", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData(jobexp.get("start"+num).toString(), font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData("ถึง", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData(jobexp.get("end"+num).toString(), font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
1688
        detail.addCell(getCellData("เงินเดือนเริ่มต้น ", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
peema_phongam committed
1689
        detail.addCell(getCellData(jobexp.get("salary"+num) + "   บาท", font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
1690
        detail.addCell(getCellData("เงินเดือนสุดท้าย ", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
1691 1692 1693 1694 1695 1696
        detail.addCell(getCellData(jobexp.get("endingsalary"+num) + "   บาท", font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 2, 0));

        detail.addCell(getCellData("สาเหตุที่ลาออก", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData(jobexp.get("reason"+num).toString(), font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 7, 0));
      }
      detail.addCell(getCellData(" ", font12N, "NO", "CENTER", "MIDDLE", 8, 0));
1697
      document.add(detail);
1698

1699
      // --------------- new line -----------------
1700 1701
      String local =simmapplicantwithgson.mapplicantOther.distinguished.local;
      String inter =simmapplicantwithgson.mapplicantOther.distinguished.inter;
1702 1703 1704 1705
      sizeColumn = new float[]{100.0f};
      detail = new PdfPTable(1);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1706
      setPaddingTop(3.5f);
1707 1708
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1709 1710 1711 1712
      setPaddingBottom(3.5f);
      detail.addCell(getCellData("อธิบายลักษณะงานที่เคยทำผ่านมา / ลักษณะงานที่ทำได้", font14B, "", "CENTER", "MIDDLE", 0, 0,false,true));
      
      for(int num=0;num < 9;num++ ){
peema_phongam committed
1713
        detail.addCell(getCellData(String.valueOf(num+1) + local, font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 0, 0));
1714
      }
1715
      document.add(detail);
1716

1717
      // --------------- new line -----------------
peema_phongam committed
1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729
      sizeColumn = new float[]{100.0f};
      detail = new PdfPTable(1);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
      setPaddingTop(0.0f);
      setPaddingBottom(0.0f);
      detail.addCell(getCellData(" ", font, "NO", "CENTER", "MIDDLE", 0, 0));
      document.add(detail);

      // --------------- new line -----------------
      sizeColumn = new float[]{39.5f,0.5f,20.0f,20.0f,20.0f};
      detail = new PdfPTable(5);
1730 1731
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1732
      setPaddingTop(3.5f);
1733 1734 1735
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(3.5f);
peema_phongam committed
1736 1737
      detail.addCell(getCellData("ประวัติการฝึกอบรม", font14B, "R_TLB", "CENTER", "MIDDLE", 0, 0,false,true));
      detail.addCell(getCellData("", font14B, "R_TB", "CENTER", "MIDDLE", 0, 0,false,true));
1738 1739 1740 1741
      detail.addCell(getCellData("สถาบันที่จัดฝึกอบรม", font14B, "", "CENTER", "MIDDLE", 0, 0,false,true));
      detail.addCell(getCellData("ปี พ.ศ.", font14B, "", "CENTER", "MIDDLE", 0, 0,false,true));
      detail.addCell(getCellData("ระยะเวลา", font14B, "", "CENTER", "MIDDLE", 0, 0,false,true));
      for(int num=0;num < 5;num++ ){
peema_phongam committed
1742 1743
        detail.addCell(getCellData(String.valueOf(num+1)+". " + trainingHM.get("name"+num).toString(), font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData("", font12N, "R_RIGHT", "LEFT", "MIDDLE", 1, 0));
1744 1745 1746
        detail.addCell(getCellData(trainingHM.get("by"+num).toString(), font12N, "R_RIGHT", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData(trainingHM.get("year"+num).toString(), font12N, "R_RIGHT", "LEFT", "MIDDLE", 1, 0));
        detail.addCell(getCellData(trainingHM.get("countday"+num).toString(), font12N, "NO", "LEFT", "MIDDLE", 1, 0));
1747
      }
1748
      document.add(detail);
peema_phongam committed
1749

1750
      // --------------- new line -----------------
peema_phongam committed
1751 1752
      sizeColumn = new float[]{39.5f,0.5f,20.0f,20.0f,20.0f};
      detail = new PdfPTable(5);
1753 1754
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1755
      setPaddingTop(3.5f);
1756 1757
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1758
      setPaddingBottom(6.5f);
peema_phongam committed
1759 1760 1761
      detail.addCell(getCellData("บุคคลที่อ้างอิง (ให้ระบุบุคคลที่ไม่ใช่ญาติพี่น้อง หรือนายจ้างเดิม ซึ่งสามารถสอบถามและให้คำรับรองได้)", font14B, "", "CENTER", "MIDDLE", 5, 0,false,true));
      detail.addCell(getCellData("ชื่อ-สกุล", font14B, "R_TLB", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("", font14B, "R_TB", "CENTER", "MIDDLE", 0, 0));
1762 1763 1764 1765
      detail.addCell(getCellData("ความสัมพันธ์", font14B, "", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("อาชีพ", font14B, "", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("ที่ติดต่อ / โทรศัพท์", font14B, "", "CENTER", "MIDDLE", 0, 0));
      for(int num=0;num < 4;num++ ){
peema_phongam committed
1766 1767
        detail.addCell(getCellData(String.valueOf(num+1) + " " + personreference.get("name"+num).toString(), font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 0, 0));
        detail.addCell(getCellData("", font12N, "R_RIGHT", "LEFT", "MIDDLE", 1, 0));
1768 1769 1770 1771
        detail.addCell(getCellData(personreference.get("relations"+num).toString(), font12N, "R_RIGHT", "LEFT", "MIDDLE", 0, 0));
        detail.addCell(getCellData(personreference.get("jobtitle"+num).toString(), font12N, "R_RIGHT", "LEFT", "MIDDLE", 0, 0));
        detail.addCell(getCellData(personreference.get("address"+num).toString() + " / " + personreference.get("phone"+num).toString(), font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      }
1772
      document.add(detail);
1773 1774
      
      // --------------- new line -----------------
peema_phongam committed
1775
      String visiononjob = chk.chkNullString(simmapplicantwithgson.mapplicantOther.visiononjob," ");
1776 1777 1778 1779
      sizeColumn = new float[]{100.0f};
      detail = new PdfPTable(1);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1780
      setPaddingTop(0.5f);
1781 1782
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1783 1784 1785 1786
      setPaddingBottom(0.5f);
      content = new Phrase();
      content.add(new Chunk("ข้อมูลเพิ่มเติม ",font14B));
      content.add(new Chunk("ให้ผู้สมัครงานกรอกเพื่อให้บริษัทฯ รู้จักท่านดียิ่งขึ้น รวมถึงการแสดงความสามารถอื่น  ที่จะก่อให้เกิดประโยชน์ต่อการสมัครงานครั้งนี้ อาทิ",font12N));
1787
      detail.addCell(getCellData2( content, "R_TOP", "LEFT", "MIDDLE",  1,  1) );
peema_phongam committed
1788
      detail.addCell(getCellData("ความสำเร็จที่ผ่านมา หรือลักษณะงานหรือลักษณะงาน ความรู้หรือความสามารถพิเศษที่เกี่ยวข้องกับงาน ซึ่งท่านถนัดและสนใจมากที่สุด", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
1789
      for(int num=0;num < 1;num++ ){
peema_phongam committed
1790 1791 1792 1793
        detail.addCell(getCellData(visiononjob, font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
      }
      for(int num=0;num < 3;num++ ){
        detail.addCell(getCellData(" ", font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
1794
      }
1795 1796
      document.add(detail);

1797 1798
      // PAGE 4
      document.newPage();
1799 1800 1801 1802 1803 1804 1805 1806 1807
      document.newPage();
      rect= new Rectangle(575,800,20,120); // you can resize rectangle     
      rect.enableBorderSide(1);
      rect.enableBorderSide(2);
      rect.enableBorderSide(4);
      rect.enableBorderSide(8);
      rect.setBorderColor(BaseColor.BLACK);
      rect.setBorderWidth(1);  
      document.add(rect);   
1808
      // --------------- new line -----------------
1809 1810
      sizeColumn = new float[]{100.0f};
      detail = new PdfPTable(1);
1811 1812
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1813
      setPaddingTop(3.5f);
1814 1815
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1816 1817
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("ประวัติทั่วไป", font14B, "", "CENTER", "MIDDLE", 0, 0,false,true));
1818
      document.add(detail);
1819

1820
      // --------------- new line -----------------
1821 1822 1823 1824 1825 1826 1827 1828
      Boolean applyStatus =  simmapplicantwithgson.mapplicantOther.apply;
      String applyPosition = simmapplicantwithgson.mapplicantOther.applyDesc.position;
      String applyYear = simmapplicantwithgson.mapplicantOther.applyDesc.year;
      Boolean tradeStatus =  simmapplicantwithgson.mapplicantOther.tradeUnion.status;
      String tradeName = simmapplicantwithgson.mapplicantOther.tradeUnion.name;
      String tradeRole = simmapplicantwithgson.mapplicantOther.tradeUnion.role;
      sizeColumn = new float[]{20.0f,5.0f,5.0f,6.0f,12.0f,7.0f,3.0f,9.0f};
      detail = new PdfPTable(8);
1829 1830
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1831
      setPaddingTop(3.5f);
1832 1833
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("การเป็นพนักงานของบริษัทฯนี้ท่าน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(!applyStatus? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่เคย",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(applyStatus? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" เคย",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      detail.addCell(getCellData("ตำแหน่ง", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
1845
      detail.addCell(getCellData(applyStatus?applyPosition:"", font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0,true,false));
1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859
      detail.addCell(getCellData("ระยะเวลา", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData(applyStatus?applyYear:"", font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("  เดือน / ปี", font12N, "NO", "LEFT", "MIDDLE", 0, 0));

      detail.addCell(getCellData("การรู้จักพนักงานของบริษัทฯนี้ท่าน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(!(roundComReference > 0)? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่รู้",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk((roundComReference > 0)? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" รู้",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      detail.addCell(getCellData("ชื่อ-สกุล", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
1860
      detail.addCell(getCellData(companyReference.getString("fullname0"), font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0,true,false));
1861
      detail.addCell(getCellData("ตำแหน่ง", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
1862
      detail.addCell(getCellData(companyReference.getString("position0"), font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 2, 0,true,false));
1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873

      detail.addCell(getCellData("การเป็นสมาชิกของชมรม / สหภาพ / สโมสรท่าน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(!tradeStatus? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่เคย",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(tradeStatus? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" เคย",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      detail.addCell(getCellData("ชื่อสถาบัน", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
1874
      detail.addCell(getCellData(tradeStatus?tradeName:"", font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0,true,false));
1875
      detail.addCell(getCellData("ตำแหน่ง", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
1876
      detail.addCell(getCellData(tradeStatus?tradeRole:"", font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 2, 0,true,false));
1877
      document.add(detail);
1878 1879 1880 1881 1882 1883

      // --------------- new line -----------------shiftwork
      Boolean shiftwork = simmapplicantwithgson.mapplicantOther.shiftwork;
      Boolean overtime_status = simmapplicantwithgson.mapplicantOther.overtime.status;
      String overtime = simmapplicantwithgson.mapplicantOther.overtime.explain;
      Boolean ordination = simmapplicantwithgson.mapplicantOther.ordination;
1884 1885 1886
      if(overtime_status == null){
        overtime_status = false;
      }
1887 1888
      sizeColumn = new float[]{10.0f,5.0f,5.0f,15.0f,5.0f,5.0f,5.0f,10.0f};
      detail = new PdfPTable(8);
1889 1890
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1891
      setPaddingTop(3.5f);
1892 1893
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("การทำงานเป็นกะ ท่าน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(shiftwork? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ทำได้",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(!shiftwork? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ทำไม่ได้",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      detail.addCell(getCellData("การทำงานล่วงเวลาลักษณะงานท่าน", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(overtime_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ทำได้",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(!overtime_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ทำไม่ได้",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      detail.addCell(getCellData("เพราะ", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData(overtime, font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 0, 0));

      detail.addCell(getCellData("การอุปสมบท ท่าน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(!ordination? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ยัง",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(ordination? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" อุปสมบทแล้ว",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  6,  1) );
1925
      document.add(detail);
1926 1927 1928 1929

      // --------------- new line ----------------- 
      sizeColumn = new float[]{17.0f,5.0f,5.0f,4.0f,5.0f,5.0f,10.0f,12.5f};
      detail = new PdfPTable(8);
1930 1931
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1932
      setPaddingTop(3.5f);
1933 1934
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("การไปประกอบพิธีฮัจย์ในต่างประเทศ ท่าน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(personal_status.equalsIgnoreCase("S")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่ไป",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(personal_status.equalsIgnoreCase("S")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไป",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      detail.addCell(getCellData("จำนวน", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
peema_phongam committed
1946
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
1947 1948
      detail.addCell(getCellData("ครั้ง / ปี", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("โดยไปที่ประเทศ", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
peema_phongam committed
1949
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
1950
      document.add(detail);
1951 1952 1953 1954

      // --------------- new line ----------------- 
      sizeColumn = new float[]{35.0f,8.0f,8.0f,15.0f,30.0f};
      detail = new PdfPTable(5);
1955 1956
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1957
      setPaddingTop(3.5f);
1958 1959
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1960 1961
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("การถูกฟ้องร้อง / อยู่ในระหว่างพิจารณาคดีของศาล ท่าน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
1962
      content = new Phrase();
1963 1964 1965 1966 1967 1968 1969 1970
      content.add(new Chunk(personal_status.equalsIgnoreCase("S")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่มี",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(personal_status.equalsIgnoreCase("S")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" มี",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      detail.addCell(getCellData("คดีเพ่ง / อาญา เรื่อง", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
peema_phongam committed
1971
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
1972
      document.add(detail);
1973 1974 1975 1976 1977 1978

      // --------------- new line ----------------- 
      Boolean policecapture_status = simmapplicantwithgson.mapplicantOther.policecapture.status;
      String policecapture = simmapplicantwithgson.mapplicantOther.policecapture.explain;
      sizeColumn = new float[]{15.0f,8.0f,8.0f,20.0f,10.0f,30.0f};
      detail = new PdfPTable(6);
1979 1980
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
1981
      setPaddingTop(3.5f);
1982 1983
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
1984 1985 1986 1987 1988 1989 1990 1991 1992 1993
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("ต้องโทษคดีอาญา ท่าน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(!policecapture_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่เคย",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(policecapture_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" เคย คดี",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
1994
      detail.addCell(getCellData(policecapture, font12N, "R_BOTTOM_DOT", "LEFT", "TOP", 0, 0,true,false));
1995
      detail.addCell(getCellData("โทษที่ได้รับ", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
peema_phongam committed
1996
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "TOP", 0, 0,true,false));
1997 1998
      document.add(detail);

1999 2000 2001 2002 2003
      // --------------- new line ----------------- 
      Boolean drinkalcohol = simmapplicantwithgson.mapplicantOther.drinkalcohol;
      Boolean smoking = simmapplicantwithgson.mapplicantOther.smoking.status;
      sizeColumn = new float[]{15.0f,8.0f,8.0f,20.0f,10.0f,30.0f};
      detail = new PdfPTable(6);
2004 2005
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
2006
      setPaddingTop(3.5f);
2007 2008
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("การดื่มสุรา ท่าน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(!drinkalcohol? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่ดื่ม",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(drinkalcohol? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ดื่ม",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      detail.addCell(getCellData("การสูบบุหรี่ ท่าน", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(!smoking? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่สูบ",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(smoking? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" สูบ",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
2028
      document.add(detail);
2029 2030 2031 2032 2033
      // --------------- new line ----------------- 
      Boolean health_status =simmapplicantwithgson.mapplicantOther.health.status;
      String health =simmapplicantwithgson.mapplicantOther.health.explain;
      sizeColumn = new float[]{15.0f,8.0f,8.0f,20.0f,10.0f,30.0f};
      detail = new PdfPTable(6);
2034 2035
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
2036
      setPaddingTop(3.5f);
2037 2038
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("โรคประจำตัว ท่าน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(!health_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่มี",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(health_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" มี โรค",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      detail.addCell(getCellData(health, font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 3, 0));
2050 2051
      document.add(detail);

2052 2053 2054 2055 2056 2057 2058
      // --------------- new line ----------------- 
      Boolean pregnant_status =simmapplicantwithgson.mapplicantOther.pregnant.status;
      String pregnant =simmapplicantwithgson.mapplicantOther.pregnant.months;
      Boolean surgical_status =simmapplicantwithgson.mapplicantOther.surgical.status;
      String surgical =simmapplicantwithgson.mapplicantOther.surgical.explain;
      sizeColumn = new float[]{20.0f,8.0f,14.0f,14.0f,20.0f,10.0f,10.0f};
      detail = new PdfPTable(7);
2059 2060
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
2061
      setPaddingTop(3.5f);
2062 2063
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("ขณะนี้ท่านตั้งครรภ์อยู่หรือไม่", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(!pregnant_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่ใช่",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(pregnant_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ใช่ อายุครรภ์",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      detail.addCell(getCellData(pregnant_status?pregnant :"", font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
      detail.addCell(getCellData("เดือน", font12N, "NO", "LEFT", "MIDDLE", 3, 0));

      detail.addCell(getCellData("การเจ็บป่วยหนัก / อุบัติเหตุ ท่าน", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(!surgical_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่เคย",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(surgical_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" เคย โรค / อุบัติเหตุ",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      detail.addCell(getCellData(surgical, font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 2, 0));
      detail.addCell(getCellData("เมื่อปี พ.ศ.", font12N, "NO", "LEFT", "MIDDLE", 1, 0));
      detail.addCell(getCellData("...", font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 1, 0));
2089 2090
      document.add(detail);

2091 2092 2093 2094
      // --------------- new line ----------------- 
      Boolean guarantees = simmapplicantwithgson.mapplicantOther.guarantees;
      sizeColumn = new float[]{35.0f,10.0f,60.0f};
      detail = new PdfPTable(3);
2095 2096
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
2097
      setPaddingTop(3.5f);
2098 2099
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
2100 2101 2102 2103 2104 2105 2106 2107 2108 2109
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("การค้ำประกันการทำงาน (บุคคล และ/หรือเงินสด)", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(!guarantees? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ไม่ได้",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(guarantees? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ได้",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );  
2110 2111
      document.add(detail);

2112 2113 2114 2115
      // --------------- new line ----------------- 
      String readytowork =simmapplicantwithgson.mapplicantOther.presentemployer;  
      sizeColumn = new float[]{25.0f,20.0f,15.0f,15.0f,30.0f};
      detail = new PdfPTable(5);
2116 2117
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
2118
      setPaddingTop(3.5f);
2119 2120
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("ท่าตั้งใจจะทำงานกับบริษัทฯที่ ", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      content = new Phrase();
      content.add(new Chunk(personal_status.equalsIgnoreCase("S")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" สำนักงานสุรวงศ์",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(personal_status.equalsIgnoreCase("S")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" โรงงาน 1",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(personal_status.equalsIgnoreCase("S")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" โรงงาน 2",font12N));  
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
      content = new Phrase();
      content.add(new Chunk(personal_status.equalsIgnoreCase("S")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY,fontAwesome));
      content.add(new Chunk(" ศูนย์คลังสินค้าและบริการ",font12N));  
peema_phongam committed
2138
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  1,  1) );
2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151

      detail.addCell(getCellData("กรณีบริษัทฯ ตกลงรับท่านเข้าทำงาน ท่านพร้อมที่จะเริ่มงานได้ภายใน", font12N, "NO", "LEFT", "MIDDLE", 2, 0));
      detail.addCell(getCellData(readytowork, font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      Chu0 = new Chunk("วัน",font12N);
      Chu1 = new Chunk(" / เดือน",font12N);
      Chu0.setUnderline(0.1f, -2f);
      content = new Phrase();
      content.add(Chu0);
      content.add(Chu1);
      detail.addCell(getCellData2( content, "NO", "LEFT", "MIDDLE",  2,  1) );
      setPaddingTop(0.5f);
      setPaddingBottom(0.5f);
      detail.addCell(getCellData(" ", font12N, "NO", "LEFT", "MIDDLE", 5, 0));
2152
      document.add(detail);
2153 2154

      // --------------- new line ----------------- 
2155 2156 2157 2158
      sizeColumn = new float[]{100.0f};
      detail = new PdfPTable(1);
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
2159
      setPaddingTop(0.5f);
2160 2161
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
2162 2163 2164
      setPaddingBottom(0.5f);
      detail.addCell(getCellData(" ", font12N, "R_TOP", "LEFT", "MIDDLE", 0, 0));
      setPaddingTop(3.5f);
2165
      setPaddingBottom(3.5f);
2166 2167 2168 2169 2170
      detail.addCell(getCellData("       ข้าพเจ้าขอรับรองว่าข้อความและรายละเอียดต่าง ๆ  ที่ได้ให้ไว้ข้างต้นนี้เป็นความจริงทุกประการ  และข้าพเจ้าขอยืนยันว่าข้าพเจ้ายินดีให้ทางบริษัทฯ  ตรวจสอบ", font12B, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("ข้อความต่าง ๆ ได้ และถ้าหากตรวจสอบพบว่าข้อความใดเป็นเท็จก็ให้ทางบริษัทฯ ถือเป็นสาเหตุการบอกยกเลิกการว่าจ้างข้าพเจ้าได้ทันทีโดยไม่ต้องจ่ายค่าชดเชย", font12B, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("ใด ๆ ทั้งสิ้น รวมถึงในกรณีที่ข้าพเจ้าได้สร้างสรรค์งานอันมีลิขสิทธ์ประเภทใด ๆ ขึ้นในฐานะลูกจ้างประเภททดลองงานก็ดี และ / หรือในฐานะพนักงานประจำซึ่งได้รับ", font12B, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("การบรรจุแล้วก็ดี ให้ถือว่าลิขสิทธ์ในงานที่ได้สร้างสรรค์ขึ้นทั้งหมดเป็นของบริษัทฯ ซึ่งเป็นนายจ้างทั้งสิ้น ทั้งนี้ไม่ว่าข้าพเจ้าจะพ้นสภาพการเป็นลูกจ้างประเภททดลองงาน", font12B, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("หรือพนักงานประจำของบริษัทฯ ไปแล้วหรือไม่ก็ตาม", font12B, "NO", "LEFT", "MIDDLE", 0, 0));
2171
      document.add(detail);
2172 2173 2174 2175

      // --------------- new line ----------------- 
      sizeColumn = new float[]{5.0f,5.0f,6.0f,15.0f,6.0f,8.0f,12.0f,40.0f,6.0f};
      detail = new PdfPTable(9);
2176 2177
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
2178
      setPaddingTop(8.5f);
2179 2180
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196
      setPaddingBottom(2.5f);
      detail.addCell(getCellData("", font12N, "NO", "CENTER", "MIDDLE", 6, 0));
      detail.addCell(getCellData("ลงชื่อ", font12N, "NO", "RIGHT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("", font12N, "NO", "LEFT", "MIDDLE", 0, 0));

      detail.addCell(getCellData("วันที่", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("เดือน", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("พ.ศ.", font12N, "NO", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("(", font12N, "NO", "RIGHT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("", font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData(")", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData(" ", font12N, "NO", "LEFT", "MIDDLE", 9, 0));
2197
      document.add(detail);
2198 2199 2200 2201

      // --------------- new line ----------------- 
      sizeColumn = new float[]{100.0f};
      detail = new PdfPTable(1);
2202 2203
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
2204
      setPaddingTop(3.5f);
2205 2206
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
2207 2208
      setPaddingBottom(6.5f);
      detail.addCell(getCellData("สำหรับเจ้าหน้าที่เท่านั้น", font14B, "", "CENTER", "MIDDLE", 0, 0,false,true));
2209
      document.add(detail);
2210 2211 2212 2213

      // --------------- new line ----------------- 
      sizeColumn = new float[]{5.0f,6.0f,6.0f,6.0f,75.0f};
      detail = new PdfPTable(5);
2214 2215
      detail.setWidthPercentage(100);
      detail.setWidths(sizeColumn);
2216
      setPaddingTop(3.5f);
2217 2218 2219
      setPaddingLeft(3.5f);
      setPaddingRight(3.5f);
      setPaddingBottom(1.5f);
2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237
      detail.addCell(getCellData(AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("รูปถ่าย", font12N, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData(" ", font12N, "R_BOTTOM_DOT", "CENTER", "MIDDLE", 0, 0));
      detail.addCell(getCellData("ใบ", font12N, "NO", "LEFT", "MIDDLE", 2, 0));

      detail.addCell(getCellData(AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("สำเนาบัตรประชน", font12N, "NO", "LEFT", "MIDDLE", 4, 0));
      detail.addCell(getCellData(AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("สำเนาทะเบียนบ้าน", font12N, "NO", "LEFT", "MIDDLE", 4, 0));
      detail.addCell(getCellData(AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("สำเนาหลักฐานการศึกษา", font12N, "NO", "LEFT", "MIDDLE", 4, 0));
      detail.addCell(getCellData(AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("สำเนาหลักฐานทางราชการทหาร", font12N, "NO", "LEFT", "MIDDLE", 4, 0));
      detail.addCell(getCellData(AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("สำเนาใบผ่านงาน (ถ้ามี)", font12N, "NO", "LEFT", "MIDDLE", 4, 0));
      detail.addCell(getCellData(AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome, "NO", "LEFT", "MIDDLE", 0, 0));
      detail.addCell(getCellData("เอกสารอื่น ๆ ประกอบ (ถ้ามี)", font12N, "NO", "LEFT", "MIDDLE", 3, 0));
      detail.addCell(getCellData(" ", font12N, "R_BOTTOM_DOT", "LEFT", "MIDDLE", 0, 0));
2238
      document.add(detail);
2239

2240 2241 2242 2243 2244 2245 2246
      // -----------------------------------------------------------------------------
      } catch (Exception e) {
        e.printStackTrace();
      } finally {
        document.close();
      }
    }
2247

2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277
    if (hasData) {
      OutputStream os = response.getOutputStream();
    // Create a reader
      PdfReader reader = new PdfReader(baos.toByteArray());
    // Create a stamper
      PdfStamper stamper = new PdfStamper(reader, baos);

    // Close the stamper
      stamper.close();
      reader.close();

      response.setHeader("Expires", "0");
      response.setHeader("Cache-Control", "must-revalidate, post-check=0 , pre-check=0");
      response.setHeader("Pragma", "public");

    // setting the content type
      response.setContentType("application/pdf");
    // the contentlength
      response.setContentLength(baos.size());
    // write ByteArrayOutputStream to the ServletOutputStream

      baos.writeTo(os);

      os.flush();
      os.close(); 
    }
    //PdfWriter.getInstance(document, baos);
    %>

    <%!
2278
       Float padding = 0.0f;
2279 2280 2281 2282
    Float paddingtop = 0.0f;
    Float paddingbottom = 0.0f;
    Float paddingleft = 0.0f;
    Float paddingright = 0.0f;
2283
    BaseColor basecolor = new BaseColor(230, 230, 230);
2284 2285 2286 2287 2288 2289 2290 2291 2292 2293

    private PdfPCell getCellData(String text, Font font, String noborder, String horalign, String veralign, int colspan, int rowspan) {
      return getCellData(text, font, noborder, horalign, veralign, colspan, rowspan, false,false);
    }
   
    //get call data
    private PdfPCell getCellData(String text, Font font, String noborder, String horalign, String veralign, int colspan, int rowspan,boolean setheight, boolean bgcolor) {
      PdfPCell cellDetail = new PdfPCell(new Phrase(text, font));
      cellDetail.setNoWrap(false);
    //  cellDetail.setNoWrap(true);
2294 2295 2296
      LineDash solid = new SolidLine();
      LineDash dotted = new DottedLine();
      LineDash dashed = new DashedLine();
2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337
      if (horalign.equalsIgnoreCase("LEFT")) {
        cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
      } else if (horalign.equalsIgnoreCase("CENTER")) {
        cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
      } else if (horalign.equalsIgnoreCase("RIGHT")) {
        cellDetail.setHorizontalAlignment(Element.ALIGN_RIGHT);
      }

      if (veralign.equalsIgnoreCase("TOP")) {
        cellDetail.setVerticalAlignment(Element.ALIGN_TOP);
      } else if (veralign.equalsIgnoreCase("MIDDLE")) {
        cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
      } else if (veralign.equalsIgnoreCase("BOTTOM")) {
        cellDetail.setVerticalAlignment(Element.ALIGN_BOTTOM);
      }

      if (padding > 0.0f) {
        cellDetail.setPadding(padding);
      }
      if (paddingtop > 0.0f) {
        cellDetail.setPaddingTop(paddingtop);
      }
      if (paddingbottom > 0.0f) {
        cellDetail.setPaddingBottom(paddingbottom);
      }
      if (paddingleft > 0.0f) {
        cellDetail.setPaddingLeft(paddingleft);
      }
      if (paddingright > 0.0f) {
        cellDetail.setPaddingRight(paddingright);
      }
      if (colspan > 0) {
        cellDetail.setColspan(colspan);
      }
      if (rowspan > 0) {
        cellDetail.setRowspan(rowspan);
      }

      if (noborder.equalsIgnoreCase("NO")) {
        cellDetail.setBorder(Rectangle.NO_BORDER);
      }
2338 2339 2340 2341 2342 2343
      else if(noborder.equalsIgnoreCase("R_TOP")){ 
            cellDetail.setBorder(Rectangle.TOP );
      } 
      else if(noborder.equalsIgnoreCase("R_TL")){ 
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
      } 
2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373
      else if(noborder.equalsIgnoreCase("R_TR")){ 
            cellDetail.setBorder(Rectangle.TOP | Rectangle.RIGHT);
      } 
      else if(noborder.equalsIgnoreCase("R_LR")){ 
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
      } 
      else if(noborder.equalsIgnoreCase("R_RB")){ 
            cellDetail.setBorder(Rectangle.RIGHT | Rectangle.BOTTOM);
      } 
      else if(noborder.equalsIgnoreCase("R_TB")){ 
            cellDetail.setBorder(Rectangle.TOP | Rectangle.BOTTOM);
      } 
      else if(noborder.equalsIgnoreCase("R_TLR")){ 
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT | Rectangle.RIGHT);
      } 
      else if(noborder.equalsIgnoreCase("R_LRB")){ 
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
      } 
       else if(noborder.equalsIgnoreCase("R_TLB")){ 
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT | Rectangle.BOTTOM);
      } 
      else if(noborder.equalsIgnoreCase("R_TRB")){ 
            cellDetail.setBorder(Rectangle.TOP | Rectangle.RIGHT | Rectangle.BOTTOM);
      } 
      else if(noborder.equalsIgnoreCase("R_BOTTOM")){ 
            cellDetail.setBorder(Rectangle.BOTTOM);
      }
      else if(noborder.equalsIgnoreCase("R_RIGHT")){ 
            cellDetail.setBorder(Rectangle.RIGHT);
      }
2374 2375 2376 2377 2378 2379 2380
      else if(noborder.equalsIgnoreCase("R_LEFT")){ 
            cellDetail.setBorder(Rectangle.LEFT);
      }
       else if(noborder.equalsIgnoreCase("R_BOTTOM_DOT")){ 
            cellDetail.setBorder(PdfPCell.NO_BORDER);
            cellDetail.setCellEvent(new CustomBorder(null, null, null, dotted));
      }
2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391
      else{

      }
      if (bgcolor) {
        cellDetail.setBackgroundColor(basecolor);
      } 
      if (setheight) {
        cellDetail.setFixedHeight(0.6999512f);
      } 
      return cellDetail;
    }
2392
 //CellDeatail2 Use For Add Chunk(1row 2 Fonts Or Color)
2393
    private PdfPCell getCellData2(Phrase content, String noborder, String horalign, String veralign, int colspan, int rowspan) {
2394
      return getCellData2(content, noborder, horalign, veralign, colspan, rowspan, false, false);
2395 2396
    }
    private PdfPCell getCellData2(Phrase content, String noborder, String horalign, String veralign, int colspan, int rowspan,boolean setheight, boolean bgcolor) {
2397 2398 2399 2400
        PdfPCell cellDetail2 = new PdfPCell(new Phrase(content));
      LineDash solid = new SolidLine();
      LineDash dotted = new DottedLine();
      LineDash dashed = new DashedLine();
2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441
      if (horalign.equalsIgnoreCase("LEFT")) {
        cellDetail2.setHorizontalAlignment(Element.ALIGN_LEFT);
      } else if (horalign.equalsIgnoreCase("CENTER")) {
        cellDetail2.setHorizontalAlignment(Element.ALIGN_CENTER);
      } else if (horalign.equalsIgnoreCase("RIGHT")) {
        cellDetail2.setHorizontalAlignment(Element.ALIGN_RIGHT);
      }

      if (veralign.equalsIgnoreCase("TOP")) {
        cellDetail2.setVerticalAlignment(Element.ALIGN_TOP);
      } else if (veralign.equalsIgnoreCase("MIDDLE")) {
        cellDetail2.setVerticalAlignment(Element.ALIGN_MIDDLE);
      } else if (veralign.equalsIgnoreCase("BOTTOM")) {
        cellDetail2.setVerticalAlignment(Element.ALIGN_BOTTOM);
      }

      if (padding > 0.0f) {
        cellDetail2.setPadding(padding);
      }
      if (paddingtop > 0.0f) {
        cellDetail2.setPaddingTop(paddingtop);
      }
      if (paddingbottom > 0.0f) {
        cellDetail2.setPaddingBottom(paddingbottom);
      }
      if (paddingleft > 0.0f) {
        cellDetail2.setPaddingLeft(paddingleft);
      }
      if (paddingright > 0.0f) {
        cellDetail2.setPaddingRight(paddingright);
      }
      if (colspan > 0) {
        cellDetail2.setColspan(colspan);
      }
      if (rowspan > 0) {
        cellDetail2.setRowspan(rowspan);
      }

      if (noborder.equalsIgnoreCase("NO")) {
        cellDetail2.setBorder(Rectangle.NO_BORDER);
      }
2442 2443 2444
      else if(noborder.equalsIgnoreCase("R_TOP")){ 
            cellDetail2.setBorder(Rectangle.TOP );
      }
2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471
      else if(noborder.equalsIgnoreCase("R_TR")){ 
            cellDetail2.setBorder(Rectangle.TOP | Rectangle.RIGHT);
      } 
      else if(noborder.equalsIgnoreCase("R_LR")){ 
            cellDetail2.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
      } 
       else if(noborder.equalsIgnoreCase("R_RB")){ 
            cellDetail2.setBorder(Rectangle.RIGHT | Rectangle.BOTTOM);
      } 
      else if(noborder.equalsIgnoreCase("R_TB")){ 
            cellDetail2.setBorder(Rectangle.TOP | Rectangle.BOTTOM);
      } 
      else if(noborder.equalsIgnoreCase("R_TLR")){ 
            cellDetail2.setBorder(Rectangle.TOP | Rectangle.LEFT | Rectangle.RIGHT);
      } 
      else if(noborder.equalsIgnoreCase("R_LRB")){ 
            cellDetail2.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
      } 
       else if(noborder.equalsIgnoreCase("R_TLB")){ 
            cellDetail2.setBorder(Rectangle.TOP | Rectangle.LEFT | Rectangle.BOTTOM);
      } 
      else if(noborder.equalsIgnoreCase("R_TRB")){ 
            cellDetail2.setBorder(Rectangle.TOP | Rectangle.RIGHT | Rectangle.BOTTOM);
      } 
      else if(noborder.equalsIgnoreCase("R_BOTTOM")){ 
            cellDetail2.setBorder(Rectangle.BOTTOM);
      }
2472 2473 2474 2475 2476 2477
       else if(noborder.equalsIgnoreCase("R_BOTTOM_DOT")){ 
            cellDetail2.setBorder(PdfPCell.NO_BORDER);
            cellDetail2.setCellEvent(new CustomBorder(null, null, null, dotted));
      }
      
      else{
2478

2479
      }
2480 2481 2482 2483 2484
      if (bgcolor) {
        cellDetail2.setBackgroundColor(basecolor);
      }
      if (setheight) {
        cellDetail2.setFixedHeight(0.6999512f);
2485
      }
2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510
      return cellDetail2;
    }
    private void setPadding(Float padding) {
      this.padding = padding;
    }

    private void setPaddingTop(Float padding) {
      this.paddingtop = padding;
    }

    private void setPaddingBottom(Float padding) {
      this.paddingbottom = padding;
    }

    private void setPaddingLeft(Float padding) {
      this.paddingleft = padding;
    }

    private void setPaddingRight(Float padding) {
      this.paddingright = padding;
    }

    private void setBaseBackgroundColor(int r, int g, int b) {
      this.basecolor = new BaseColor(r, g, b);
    }
2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582
    
     interface LineDash {
        public void applyLineDash(PdfContentByte canvas);
    }
    
    class SolidLine implements LineDash {
        public void applyLineDash(PdfContentByte canvas) { }
    }
    
    class DottedLine implements LineDash {
        public void applyLineDash(PdfContentByte canvas) {
            canvas.setLineCap(PdfContentByte.LINE_CAP_ROUND);
            canvas.setLineDash(0,2,2);
        }
    }
    
    class DashedLine implements LineDash {
        public void applyLineDash(PdfContentByte canvas) {
            canvas.setLineDash(3, 3);
        }
    }
    
    class CustomBorder implements PdfPCellEvent {
        protected LineDash left;
        protected LineDash right;
        protected LineDash top;
        protected LineDash bottom;
        public CustomBorder(LineDash left, LineDash right,
                LineDash top, LineDash bottom) {
            this.left = left;
            this.right = right;
            this.top = top;
            this.bottom = bottom;
        }
        public void cellLayout(PdfPCell cell, Rectangle position,
            PdfContentByte[] canvases) {
            PdfContentByte canvas = canvases[PdfPTable.LINECANVAS];
            if (top != null) {
                canvas.saveState();
                top.applyLineDash(canvas);
                canvas.moveTo(position.getRight(), position.getTop());
                canvas.lineTo(position.getLeft(), position.getTop());
                canvas.stroke();
                canvas.restoreState();
            }
            if (bottom != null) {
                canvas.saveState();
                bottom.applyLineDash(canvas);
                canvas.moveTo(position.getRight(), position.getBottom());
                canvas.lineTo(position.getLeft(), position.getBottom());
                canvas.stroke();
                canvas.restoreState();
            }
            if (right != null) {
                canvas.saveState();
                right.applyLineDash(canvas);
                canvas.moveTo(position.getRight(), position.getTop());
                canvas.lineTo(position.getRight(), position.getBottom());
                canvas.stroke();
                canvas.restoreState();
            }
            if (left != null) {
                canvas.saveState();
                left.applyLineDash(canvas);
                canvas.moveTo(position.getLeft(), position.getTop());
                canvas.lineTo(position.getLeft(), position.getBottom());
                canvas.stroke();
                canvas.restoreState();
            }
        }
    }

2583 2584 2585 2586
   // Add IMAGE IN PART
    private String getImagePath(String type, String subFolder, String imageFileName, String defaultFile) {
      InitialEnvironment inv = new InitialEnvironment("GLOBAL");
      String path = inv.getValue(type)+subFolder;
2587
      if (!new File(path+imageFileName).exists() || imageFileName.equals(" ")){
2588 2589 2590 2591 2592 2593 2594
        imageFileName = defaultFile;
      }
      return path+imageFileName;
    }
    %>
    </body>
    </html>