Thursday, January 23, 2014

Java practice for self ( Parameter pass , static and non static , local , global )

java class file name ( printName.java): Run: on page R.B click - run on server

import java.util.Date;


public class printName {

   
   
   
   
    public void NameMore(String name,String nameNext){
          // This constructor has one parameter, name.
          System.out.println("Passed(value) Name is :" + name +" Passed(value) nameNext is : " + nameNext );
         
       }
   
   
   
    public void NameMoreRefPas(String name,String nameNext,String text,int number){
          // This constructor has one parameter, name.
          System.out.println("Passed(call by reference) Name k is :" + name +" Passed(call by reference ) nameNext  f is : " + nameNext  +" Passed ( direct vallue call) text  is :" + text  +" Call by Reference Numbers : " +number);
         
       }
   
   
   
    //************************************************************* 
   
    public void Name(String name){
          // This constructor has one parameter, name.
        System.out.println("Passed(value) Name is  op is double cotation kaniz:" + name );
       }

      public void Puppy(String name){
          // This constructor has one parameter, name.
         // System.out.println("Passed(value) Name is :" + name );
          System.out.println("Passed(call by reference) Name is :" + name );
       }
     
     private static  Date date = null;
       public static void main(String []args){

           String callByReference = null;
           String kaniz;
           kaniz = callByReference;
          
          // Following statement would create an object myPuppy
           printName myPuppy = new printName( );
           myPuppy.Puppy(kaniz);
          
           myPuppy.Name("kaniz. I am string value.it is direct value pass");
          
          
          
          
          
        //*********************************************************************  
        //String fatema = null;
        myPuppy.NameMore("kanizZZ","fatema");
       
       
    String referenceKaniz="ghrg";
        //String referenceKaniz = null;
            //String k = null;
           // String f = null;
         String k = referenceKaniz;
        String f = "fatema mmm";
        int i = 100;
        myPuppy.NameMoreRefPas(k,f,"kkkkk",i);
        date = new Date();   // This line is non static; But this non static can not call in static method. So I would this line static method.That means : above line  private static  Date date = null;
        System.out.println(date);
       
       }



    public Date getDate() {
        return date;
    }



    public void setDate(Date date) {
        this.date = date;
    }
   




   
   
   
   
}



Also follow it

import java.util.Date;


public class printName {

   
   
   
   
    public void NameMore(String name,String nameNext){
          // This constructor has one parameter, name.
          System.out.println("Passed(value) Name is :" + name +" Passed(value) nameNext is : " + nameNext );
         
       }
   
   
   
    public void NameMoreRefPas(String name,String nameNext,String text,int number){
          // This constructor has one parameter, name.
          System.out.println("Passed(call by reference) Name k is :" + name +" Passed(call by reference ) nameNext  f is : " + nameNext  +" Passed ( direct vallue call) text  is :" + text  +" Call by Reference Numbers : " +number);
          Name("rokon");
       }
   
   
   
    //************************************************************* 
   
    public void Name(String name){
          // This constructor has one parameter, name.
        System.out.println("Passed(value) Name is  op is double cotation kaniz:" + name );
       }

      public static  void Puppy(String name){
          // This constructor has one parameter, name.
         // System.out.println("Passed(value) Name is :" + name );
          System.out.println("Passed(call by reference) Name is :" + name );
       }
   
//     private static  Date date = null;
       public static void main(String []args){

           String callByReference = null;
           String kaniz;
           kaniz = callByReference;
           printName myPuppy = new printName( );
          // Following statement would create an object myPuppy
         
           Puppy(kaniz);
           myPuppy. Name("rokon");
         //  myPuppy.Name("kaniz. I am string value.it is direct value pass");
          
          
          
          
          
        //*********************************************************************  
        //String fatema = null;
        myPuppy.NameMore("kanizZZ","fatema");
       
       
    String referenceKaniz="ghrg";
        //String referenceKaniz = null;
            //String k = null;
           // String f = null;
         String k = referenceKaniz;
        String f = "fatema mmm";
        int i = 100;
        myPuppy.NameMoreRefPas(k,f,"kkkkk",i);
    Date date = new Date();   // This line is non static; But this non static can not call in static method. So I would this line static method.That means : above line  private static  Date date = null;
        System.out.println(date);
       
       }

private static Date date = new Date();

    public Date getDate() {
        return date;
    }



    public void setDate(Date date) {
        this.date = date;
    }
   




   
   
   
   
}



newTestList.java

public class newTestList {

   
public int sum(int a,int b){
    int s = 0;
    s = a+b;
      System.out.println(s);
     
      printName.Puppy("owares");
      printName bas = new printName();
      bas.Name("iftekhar");
      return s;
}
   

public int sum(int a,int b,int c){
    int s= 0;
    s = a+b+c;
      System.out.println(s);
      return s;
}




   public static void main(String[] args) {
   
       
        newTestList p = new newTestList();
        p.sum  (10,20);
        p.sum  (10,20,50);
   
    }
   
   
   
   
   
   
}

3rd Step static and non static
printName.java
import java.util.Date;


public class printName {

   
   
   
   
    public void NameMore(String name,String nameNext){
          // This constructor has one parameter, name.
          System.out.println("Passed(value) Name is :" + name +" Passed(value) nameNext is : " + nameNext );
         
       }
   
   
   
    public void NameMoreRefPas(String name,String nameNext,String text,int number){
          // This constructor has one parameter, name.
          System.out.println("Passed(call by reference) Name k is :" + name +" Passed(call by reference ) nameNext  f is : " + nameNext  +" Passed ( direct vallue call) text  is :" + text  +" Call by Reference Numbers : " +number);
          Name("rokon");
          Puppy("");
       }
   
   
   
    //************************************************************* 
   
    public void Name(String name){
          // This constructor has one parameter, name.
        System.out.println("Passed(value) Name is  op is double cotation kaniz:" + name );
       }
   

      public static  String Puppy(String name){
          // This constructor has one parameter, name.
         // System.out.println("Passed(value) Name is :" + name );
          System.out.println("Passed(call by reference) Name is :" + name );
          return "";
       }
 static void strat() {
   
 }
   
//     private static  Date date = null;
       public static void main(String []args){

           String callByReference = null;
           String kaniz;
           kaniz = callByReference;
           printName myPuppy = new printName( );
           strat();
          // Following statement would create an object myPuppy
          System.out.println(printName.Puppy("pop"));
          System.out.println(Puppy("popppp"));
        //  printName.
        //   Puppy(kaniz);
        //   myPuppy. Name("rokon");
         //  myPuppy.Name("kaniz. I am string value.it is direct value pass");
          
          
          
          
          
        //*********************************************************************  
        //String fatema = null;
        myPuppy.NameMore("kanizZZ","fatema");
       
       
    String referenceKaniz="ghrg";
        //String referenceKaniz = null;
            //String k = null;
           // String f = null;
         String k = referenceKaniz;
        String f = "fatema mmm";
        int i = 100;
        myPuppy.NameMoreRefPas(k,f,"kkkkk",i);
    Date date = new Date();   // This line is non static; But this non static can not call in static method. So I would this line static method.That means : above line  private static  Date date = null;
        //System.out.println(date);
       
       }

private static Date date = new Date();

    public Date getDate() {
        return date;
    }



    public void setDate(Date date) {
        this.date = date;
    }
   




   
   
   
   
}


newTestList.java




public class newTestList {

   
public int sum(int a,int b){
    int s = 0;
    s = a+b;
      System.out.println(s);
   
      printName.Puppy("owares");
      printName bas = new printName();
      bas.Name("iftekhar");
      bas.Puppy("");
      bas.getDate();
      return s;
}
   

public int sum(int a,int b,int c){
    int s= 0;
    s = a+b+c;
      System.out.println(s);
      return s;
}




   public static void main(String[] args) {
   
       
        newTestList p = new newTestList();
        p.sum  (10,20);
        p.sum  (10,20,50);
   
    }
   
   
   
   
   
   
}




** java action class run and see output(printName.java)

public class printName {

   
   
   
   
    public void NameMore(String name,String nameNext){
          // This constructor has one parameter, name.
          System.out.println("Passed(value) Name is :" + name +" Passed(value) nameNext is : " + nameNext );
         
       }
   
   
   
    public void NameMoreRefPas(String name,String nameNext,String text,int number){
          // This constructor has one parameter, name.
          System.out.println("Passed(call by reference) Name k is :" + name +" Passed(call by reference ) nameNext  f is : " + nameNext  +" Passed ( direct vallue call) text  is :" + text  +" Call by Reference Numbers : " +number);
         
       }
   
   
   
    //************************************************************* 
   
    public void Name(String name){
          // This constructor has one parameter, name.
        System.out.println("Passed(value) Name is  op is double cotation kaniz:" + name );
       }

      public void Puppy(String name){
          // This constructor has one parameter, name.
         // System.out.println("Passed(value) Name is :" + name );
          System.out.println("Passed(call by reference) Name is :" + name );
       }
       public static void main(String []args){

           String callByReference = null;
           String kaniz;
           kaniz = callByReference;
          
          // Following statement would create an object myPuppy
           printName myPuppy = new printName( );
           myPuppy.Puppy(kaniz);
          
           myPuppy.Name("kaniz. I am string value.it is direct value pass");
          
          
          
          
          
        //*********************************************************************  
        //String fatema = null;
        myPuppy.NameMore("kanizZZ","fatema");
       
       
    String referenceKaniz="ghrg";
        //String referenceKaniz = null;
            //String k = null;
           // String f = null;
         String k = referenceKaniz;
        String f = "fatema mmm";
        int i = 100;
        myPuppy.NameMoreRefPas(k,f,"kkkkk",i);
       
       
       }
   




   
   
   
   
}



output
Passed(call by reference) Name is :null
Passed(value) Name is  op is double cotation kaniz:kaniz. I am string value.it is direct value pass
Passed(value) Name is :kanizZZ Passed(value) nameNext is : fatema
Passed(call by reference) Name k is :ghrg Passed(call by reference ) nameNext  f is : fatema mmm Passed ( direct vallue call) text  is :kkkkk Call by Reference Numbers : 100



**************************************************************************

Write a method to print out a string “Name” multiple times
==========================================================
System.out.println("name" + " " + "name" + " "...).


1/  "name"

2/  + " "

3/  + "name"

4/  + " "



update printName.java
import java.util.Date;


public class printName {

   
   
   
   
    public void NameMore(String name,String nameNext){
          // This constructor has one parameter, name.
          System.out.println("Passed(value) Name is :" + name +" Passed(value) nameNext is : " + nameNext );
         
       }
   
   
   
    public void NameMoreRefPas(String name,String nameNext,String text,int number){
          // This constructor has one parameter, name.
          System.out.println("Passed(call by reference) Name k is :" + name +" Passed(call by reference ) nameNext  f is : " + nameNext  +" Passed ( direct vallue call) text  is :" + text  +" Call by Reference Numbers : " +number);
         
       }
   
   
   
    //************************************************************* 
   
    public void Name(String name){
          // This constructor has one parameter, name.
        System.out.println("Passed(value) Name is  op is double cotation kaniz:" + name );
       }

      public void Puppy(String name){
          // This constructor has one parameter, name.
         // System.out.println("Passed(value) Name is :" + name );
          System.out.println("Passed(call by reference) Name is :" + name );
       }
     
     private static  Date date = null;
       public static void main(String []args){

           String callByReference = null;
           String kaniz;
           kaniz = callByReference;
          
          // Following statement would create an object myPuppy
           printName myPuppy = new printName( );
           myPuppy.Puppy(kaniz);
          
           myPuppy.Name("kaniz. I am string value.it is direct value pass");
          
          
          
          
          
        //*********************************************************************  
        //String fatema = null;
        myPuppy.NameMore("kanizZZ","fatema");
       
       
    String referenceKaniz="ghrg";
        //String referenceKaniz = null;
            //String k = null;
           // String f = null;
         String k = referenceKaniz;
        String f = "fatema mmm";
        int i = 100;
        myPuppy.NameMoreRefPas(k,f,"kkkkk",i);
        date = new Date();   // This line is non static; But this non static can not call in static method. So I would this line static method.That means : above line  private static  Date date = null;
        System.out.println(date);
       
       }



    public Date getDate() {
        return date;
    }



    public void setDate(Date date) {
        this.date = date;
    }
   




   
   
   
   
}

Model View Controller ( MVC )























************************************************************************
************************************************************************


# Struts 2 is an action-based presentation framework, the version 2 of the above (created from a merge of WebWork with Struts).
# Hibernate is an object-relational mapping tool, a persistence framework.

Oracle Query Date Calculation

1.



---SELECT---
DATE RANGE    DR
TODAY         TD
NEXT DAY      ND
7 DAYS        7D
15 DAYS       15D
30 DAYS       30D
THIS MONTH    TM
NEXT MOTH     NM


IF :CTRL_ROSTER.SCH_FR='DR' THEN
   :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
   :CTRL_ROSTER.TO_DATE:=NULL;
ELSIF :CTRL_ROSTER.SCH_FR='TD' THEN--TODAY
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE);
ELSIF :CTRL_ROSTER.SCH_FR='ND' THEN ----NEXT DAY
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE+1);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+1);
ELSIF :CTRL_ROSTER.SCH_FR='7D' THEN--7 DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+7);
ELSIF
  :CTRL_ROSTER.SCH_FR='15D' THEN--15DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+15);
ELSIF
  :CTRL_ROSTER.SCH_FR='30D' THEN --30DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+30);
ELSIF
  :CTRL_ROSTER.SCH_FR='TM' THEN--THIS MONTH
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=LAST_DAY(SYSDATE);
ELSIF :CTRL_ROSTER.SCH_FR='NM' THEN -- NEXT MONTH
    :CTRL_ROSTER.FROM_DT:=LAST_DAY(SYSDATE)+1;
    :CTRL_ROSTER.TO_DATE:=LAST_DAY(LAST_DAY(SYSDATE)+1);

END IF;
next_item;






2.



1st script
-------------
CREATE OR REPLACE Procedure PRC_DATECAL (pNoOfDays in Number,pThisMonth in varchar2,pNextMonth Varchar,pFrDate out date,pEnDate out Date)
     IS
     vDate Date;
     BEGIN
     if pNoOfDays is not null AND pThisMonth IS NULL and pNextMonth IS NULL then
     SELECT trunc(SYSDATE)
     INTO pFrDate
     FROM DUAL;
     SELECT trunc(SYSDATE+pNoOfDays)
     INTO pEnDate
     FROM DUAL;
     elsif  pNoOfDays is null AND pNextMonth IS NULL AND pThisMonth IS NOT NULL then
     SELECT trunc(SYSDATE)
     INTO pFrDate
     FROM DUAL;
     SELECT TRUNC(Last_Day(SYSDATE))
     INTO pEnDate
     FROM DUAL;
     elsif pNoOfDays is null AND pThisMonth IS NULL AND pNextMonth IS NOT NULL then
     SELECT TRUNC(Last_Day(SYSDATE)+1)
     INTO pFrDate
     FROM DUAL;
     SELECT TRUNC(LAST_DAY(Last_Day(SYSDATE)+1))
     INTO pEnDate
     FROM DUAL;
     end if;
   
exception when others then
null;
END;

PRC_DATECAL(










2nd Script
----------------------------
CREATE OR REPLACE FUNCTION FNC_DATECAL (pNoOfDays Number,p)
     RETURN date  IS
     vDate Date;
     BEGIN
     SELECT trunc(SYSDATE+pNoOfDays)
     INTO vDate
     FROM DUAL;
  return vDate;
END;
/





*********************************************************
Form plsql
............



---SELECT---
DATE RANGE    DR
TODAY         TD
NEXT DAY      ND
7 DAYS        7D
15 DAYS       15D
30 DAYS       30D
THIS MONTH    TM
NEXT MOTH     NM


IF :CTRL_ROSTER.SCH_FR='DR' THEN
   :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
   :CTRL_ROSTER.TO_DATE:=NULL;
ELSIF :CTRL_ROSTER.SCH_FR='TD' THEN--TODAY
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE);
ELSIF :CTRL_ROSTER.SCH_FR='ND' THEN ----NEXT DAY
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE+1);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+1);
ELSIF :CTRL_ROSTER.SCH_FR='7D' THEN--7 DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+7);
ELSIF
  :CTRL_ROSTER.SCH_FR='15D' THEN--15DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+15);
ELSIF
  :CTRL_ROSTER.SCH_FR='30D' THEN --30DAYS
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=TRUNC(SYSDATE+30);
ELSIF
  :CTRL_ROSTER.SCH_FR='TM' THEN--THIS MONTH
  :CTRL_ROSTER.FROM_DT:=TRUNC(SYSDATE);
  :CTRL_ROSTER.TO_DATE:=LAST_DAY(SYSDATE);
ELSIF :CTRL_ROSTER.SCH_FR='NM' THEN -- NEXT MONTH
    :CTRL_ROSTER.FROM_DT:=LAST_DAY(SYSDATE)+1;
    :CTRL_ROSTER.TO_DATE:=LAST_DAY(LAST_DAY(SYSDATE)+1);

END IF;
next_item;




////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////

CREATE OR REPLACE FUNCTION FNC_DATECAL (pNoOfDays Number,pLastDay varchar2)
     RETURN date  IS
     vDate Date;
     BEGIN
     if pNoOfDays is not null and pLastDay is null then
     SELECT trunc(SYSDATE+pNoOfDays)
     INTO vDate
     FROM DUAL;
     elsif pNoOfDays is null and pLastDay is not null then
     select trunc(last_day(sysdate))
     into vDate
     from dual;
     end if;
     /*
     Select trunc((sysdate)+pNoofMonth) into vDate
     from dual;
     */
  return vDate;
END;
/


select name,JOB_DESC
from hrv_empjobdetails
where emp_no=:global.g_emp_no
and nvl(ACTIVE_STATUS,'N')='Y'

hrv_empdetails


select FNC_DATECAL ('','htgt') from dual;

Tuesday, January 21, 2014

Blank Page - 3(java code writing way)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>
<div style="float:left; width:150px;" class="banglaText">
          <s:if test='%{summaryInfo.teacApearUse == "1"}'>
         <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" checked>এইচ.এস.সি (বি.এম)
          <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
           <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
         </s:if>
         <s:elseif test='%{summaryInfo.teacApearUse == "2"}'>
         <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
          <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" checked>এইচ.এস.সি (বি.এম)
           <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
         </s:elseif>
         <s:else>
         <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
          <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" >এইচ.এস.সি (বি.এম)
           <input name="technicalBranchType" id="technicalBranchType" type="checkbox" value="51" checked>এইচ.এস.সি (বি.এম)
         </s:else>       
        </div>

        
    <div style="float:left; width:100px;">
         <select name="mpoStatus" id="mpoStatus" style="width:100px;" class="banglaText">
         <s:if test='%{summaryInfo.teacApearUse == "1"}'>
          <option value="1" selected="selected">হ্যাঁ</option>
          <option value="2">না</option>
          <option value="3">প্রযোজ্য নয়</option>
         </s:if>
         <s:elseif test='%{summaryInfo.teacApearUse == "2"}'>
         <option value="2" selected="selected">না</option>
         <option value="1">হ্যাঁ</option>
         <option value="3">প্রযোজ্য নয়</option>
         </s:elseif>
         <s:else>
          <option value="3" selected="selected">প্রযোজ্য নয়</option>
          <option value="1">হ্যাঁ</option>
         <option value="2">না</option>
         </s:else>
  
      </select>

    </div>
  
  
  
    <div>
       <td colspan="2" class="banglaTextDob" style="text-align:right;">লিঙ্গ :
      <s:if test='%{hrvPoliceInfo.gender !=null && hrvPoliceInfo.gender=="M"}'>
        <input type="radio" value="M" id="gender1DepNRP" name="genderDepNRP" checked="checked">  
            </s:if>
      <s:else>
        <input type="radio" value="M" id="gender1DepNRP" name="genderDepNRP" />
        </s:else>
  পুরুষ
  <s:if test='%{hrvPoliceInfo.gender !=null && hrvPoliceInfo.gender=="F"}'>
    <input type="radio" value="F" id="gender2DepNRP" name="genderDepNRP" checked="checked">  
  </s:if>
    <s:else>
      <input type="radio" value="F" id="gender2DepNRP" name="genderDepNRP" />
      </s:else>
    মহিলা
    <s:if test='%{hrvPoliceInfo.gender !=null && hrvPoliceInfo.gender=="O"}'>
      <input type="radio" value="O" id="gender3DepNRP" name="genderDepNRP" checked="checked">  
      </s:if>
    <s:else>
      <input type="radio" value="O" id="gender3DepNRP" name="genderDepNRP" />
      </s:else>
    অন্যান্য    </td>
    </div>
  
</body>
</html>

Odd even apply on iterator table using status in java tag

Using  status odd even apply that means odd row show present and even row show past and also color apply From qregPolice

<%@taglib prefix="s" uri="/struts-tags" %>
<style type="text/css">
.odd{
background-color:#CCC;
}

.even{
background-color:#EEE;
}

</style>

<table border="0" cellpadding="0" cellspacing="0" style="width:214px;">

<tr>
    <td width="36%" style="font-family:Arial; font-size:12px; font-weight:bold; color:blue; text-decoration:underline;">Status</td>
    <td width="48%" style="font-family:Arial; font-size:12px; font-weight:bold; color:blue; text-decoration:underline;">Patient Name</td>
    <td width="16%" style="font-family:Arial; font-size:12px; font-weight:bold; color:blue; text-decoration:underline;">SL</td>
</tr>

<s:iterator value="patientSeqList" status="status">
<s:if test="#status.odd==true">
<tr style="font-family:Arial; font-size:12px; font-weight:normal; color:#000;" class="odd">

<td >Present</td>
  <td><s:property value="PAT_NAME"/></td>
  <td><s:property value="PAT_SL"/></td>
</tr>
 </s:if>
<s:else>
<tr style="font-family:Arial; font-size:12px; font-weight:normal; color:#000;" class="even">
<td >Past</td>
  <td><s:property value="PAT_NAME"/></td>
  <td><s:property value="PAT_SL"/></td>
</tr>
</s:else>

</s:iterator>
</table>












From ACO odd even apply using status



<%@taglib prefix="s" uri="/struts-tags"%>
<div  id="pageNavPosition" style="padding-bottom: 2px;" align="left">
    </div>
    <div id="displayDataDiv"  style="float:left;width:584px;height:auto;overflow:auto;overflow-x:scroll;">   
   
<table id="tablepaging" class="yui" align="center">
        <tr bordercolor="#FFFFFF" >
        
          <th>Search</th>         
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>
          <th><input name="filter" size="8" onkeyup="Table.filter(this,this)"></th>         
       </tr>
       <tr>       
          <th  scope="col">HTN Rank</th>
          <th  scope="col">Confirmation</th>
          <th  scope="col">Not Qualified Reason</th>
          <th  scope="col">Not Qualified Date</th>
          <th  scope="col">Recent BP</th>
          <th  scope="col">BP Date</th>
          <th  scope="col">Systolic</th>
          <th  scope="col">Diastolic</th>
          <th  scope="col">Comments</th>
       </tr>
      
      <s:iterator value="hypertensionList" status="acd">
     
     <s:if test="#acd.odd==true">
         <tr class="odd" >
         
          <td align="center"><s:property value="htn_rank"/></td>
          <td align="center"><s:property value="htn_confirmed"/></td>
          <td align="center"><s:property value="htn_not_qualified_reason"/></td>
          <td align="center"><s:property value="htn_not_qualified_date"/></td>
          <td align="center"><s:property value="htn_recent_bp"/></td>
          <td align="center"><s:property value="htn_bp_date"/></td>
          <td align="center"><s:property value="htn_bp_systolic"/></td>
          <td align="center"><s:property value="htn_bp_diastolic"/></td>
          <td align="center"><s:property value="htn_comments"/></td>
          </tr>
          </s:if>
          <s:else>
           <tr class="even" >
         
          <td align="center"><s:property value="htn_rank"/></td>
          <td align="center"><s:property value="htn_confirmed"/></td>
          <td align="center"><s:property value="htn_not_qualified_reason"/></td>
          <td align="center"><s:property value="htn_not_qualified_date"/></td>
          <td align="center"><s:property value="htn_recent_bp"/></td>
          <td align="center"><s:property value="htn_bp_date"/></td>
          <td align="center"><s:property value="htn_bp_systolic"/></td>
          <td align="center"><s:property value="htn_bp_diastolic"/></td>
          <td align="center"><s:property value="htn_comments"/></td>
          </tr>
          </s:else>
        </s:iterator>
      
      </table>
       
   
    </div>
   



   

Tab Hexa Value_html (Script)

tab create and select color by background color

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>BANBEIS</title>

<!--start  Topmenu form page -->
<script type="text/javascript">

function colorToHex(color) {
    if (color.substr(0, 1) === '#') {
        return color;
    }
    var digits = /(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(color);
   
    var red = parseInt(digits[2]);
    var green = parseInt(digits[3]);
    var blue = parseInt(digits[4]);
   
    var rgb = blue | (green << 8) | (red << 16);
   
    hexvlue=digits[1] + '#' + rgb.toString(16);
    //alert(hexvlue);
    return hexvlue;
   
};
var firstColor;
function ChangeColorMouseOver(elementid)
{
 
    var tryId = document.getElementById(elementid).style.backgroundColor;
    firstColor=colorToHex(tryId);
     
      document.getElementById(elementid).style.background = "#D9E9DA";

 

}
function ChangebackMouseOut(elementid)
{
  document.getElementById(elementid).style.background = firstColor;



}
</script>

<!--End  Topmenu form page -->
</head>
<body>







 <!-- Start tab-->
 <div id="tab_create" style="width:812px;height:30px; background:none;">


 <div onMouseOver="ChangeColorMouseOver(this.id)" onMouseOut="ChangebackMouseOut(this.id)" id="general_page" style="width:88px !important; width:88px;height:30px; float:left; background-color:#A2BE82;border-right: solid 1px #EDF0F5;">
        <div style="margin-top: 4px;text-align:center; ">
        <a  href="generalInfoEntryFormSchool.do?eiin=<s:property value='institutesInfo.eiin'/>&&year=<s:property value='#session.year'/>" id="" style="text-decoration:none;font-family:Arial; font-weight:bold; font-size:13px; color:#000;">1st page</a>
        </div>
 </div>

 <div onMouseOver="ChangeColorMouseOver(this.id)" onMouseOut="ChangebackMouseOut(this.id)" id="vouto_one" style="width:88px !important; width:88px;height:30px; float:left; background-color:#A2BE82;border-right: solid 1px #EDF0F5;">
        <div style="margin-top: 4px;text-align:center;"><a href="voutoFacilitiesInfoEntryForm1School.do?eiin=<s:property value='institutesInfo.eiin'/>&&year=<s:property value='#session.year'/>" id="" style="text-decoration:none;font-family:Arial; font-weight:bold; font-size:13px;color:#000;">2nd page</a></div>
 </div>

 <div onMouseOver="ChangeColorMouseOver(this.id)" onMouseOut="ChangebackMouseOut(this.id)" id="vouto_two" style="width:88px !important; width:88px;height:30px; float:left; background-color:#A2BE82;border-right: solid 1px #EDF0F5;">
        <div style="margin-top: 4px;text-align:center;"><a href="voutoFacilitiesInfoEntryForm2School.do?eiin=<s:property value='institutesInfo.eiin'/>&&year=<s:property value='#session.year'/>" id="" style="text-decoration:none;font-family:Arial; font-weight:bold; font-size:13px;color:#000;">3rd page</a></div>
 </div>

 <div onMouseOver="ChangeColorMouseOver(this.id)" onMouseOut="ChangebackMouseOut(this.id)" id="student_one" style="width:88px !important; width:88px;height:30px; float:left; background-color:#A2BE82;border-right: solid 1px #EDF0F5;">
        <div style="margin-top: 4px;text-align:center;"><a href="studentInfoEntryForm1SchSec.do?eiin=<s:property value='institutesInfo.eiin'/>&&year=<s:property value='#session.year'/>" id="" style="text-decoration:none;font-family:Arial; font-weight:bold; font-size:13px;color:#000;">4th page</a></div>
 </div>

 <div onMouseOver="ChangeColorMouseOver(this.id)" onMouseOut="ChangebackMouseOut(this.id)" id="student_two" style="width:88px !important; width:88px;height:30px; float:left; background-color:#A2BE82;border-right: solid 1px #EDF0F5;">
        <div style="margin-top: 4px;text-align:center;"><a href="studentInfoEntryForm2SchThird.do?eiin=<s:property value='institutesInfo.eiin'/>&&year=<s:property value='#session.year'/>" id="" style="text-decoration:none;font-family:Arial; font-weight:bold; font-size:13px;color:#000;">5th page</a></div>
 </div>

 <div onMouseOver="ChangeColorMouseOver(this.id)" onMouseOut="ChangebackMouseOut(this.id)" id="student_three" style="width:88px !important; width:88px;height:30px; float:left; background-color:#A2BE82;border-right: solid 1px #EDF0F5;">
        <div style="margin-top: 4px;text-align:center;"><a href="studentInfoEntryForm3SchFourth.do?eiin=<s:property value='institutesInfo.eiin'/>&&year=<s:property value='#session.year'/>" id="" style="text-decoration:none;font-family:Arial; font-weight:bold; font-size:13px;color:#000;">6th page</a></div>
 </div>

 <div onMouseOver="ChangeColorMouseOver(this.id)" onMouseOut="ChangebackMouseOut(this.id)" id="teacher_one" style="width:88px !important; width:88px;height:30px; float:left; background-color:#A2BE82;border-right: solid 1px #EDF0F5;">
        <div style="margin-top: 4px;text-align:center;"><a href="teacherEmployeeInfoEntryForm1SchFifth.do?eiin=<s:property value='institutesInfo.eiin'/>&&year=<s:property value='#session.year'/>" id="" style="text-decoration:none;font-family:Arial; font-weight:bold; font-size:13px;color:#000;">7th page</a></div>
 </div>


 <div onMouseOver="ChangeColorMouseOver(this.id)" onMouseOut="ChangebackMouseOut(this.id)" id="teacher_two" style="width:88px !important; width:88px;height:30px; float:left; background-color:#A2BE82;border-right: solid 1px #EDF0F5;">
        <div style="margin-top: 4px;text-align:center;"><a href="teacherEmployeeInfoEntryForm2SchSixth.do?eiin=<s:property value='institutesInfo.eiin'/>&&year=<s:property value='#session.year'/>" id="" style="text-decoration:none;font-family:Arial; font-weight:bold; font-size:13px;color:#000;">8th page</a></div>
 </div>


 <div onMouseOver="ChangeColorMouseOver(this.id)" onMouseOut="ChangebackMouseOut(this.id)" id="teacher_three" style="width:88px !important; width:88px;height:30px; float:left; background-color:#A2BE82;border-right: solid 1px #EDF0F5;">
        <div style="margin-top: 4px;text-align:center;"><a href="teacherEmployeeInfoEntryForm3SchSixth.do?eiin=<s:property value='institutesInfo.eiin'/>&&year=<s:property value='#session.year'/>" id="" style="text-decoration:none;font-family:Arial; font-weight:bold; font-size:13px;color:#000;">9th page</a></div>
 </div>


</div>
<!-- End tab-->





</body>


<script>
document.getElementById("general_page").style.backgroundColor='#FF3E3E';
//document.getElementById("general_page").style.backgroundColor='red';       
</script>

<!--N.B : This script color must be color code not declare red -->




curve image

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>

<style type="text/css">
*{
    margin:0 auto;
    padding:0;
    text-align:center;
}
div{
    width:400px;
    height:200px;
    background:#000;
    border:red solid 1px;
    margin-bottom:20px;
    color:#fff;
    text-align:center;
}
.curved {
-moz-border-radius:10px;
-webkit-border-radius:10px;
behavior:url(border-radius.htc);
}
div.img{
    border:1px solid #fff;
    background:url(karzzz.jpg) no-repeat;
    color:red;
    text-align:right;
}
</style>
</head>

<body>

<div class="img">Image</div>
<div class="curved">Curvd div</div>
<div class="img curved">Image got cured</div>

</body>
</html>




couple_Setcombo_inputField.html

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<script language="javascript">
function getCoupleDetails(div_id){
alert("l");
        var coupleType = (div_id.options[div_id.selectedIndex].value);
       
        //alert("Id :"+districtId);
        if(coupleType == '0'){
            //alert("Please select a Dose Type!");
                document.getElementById('details_select').value = 'none';
        }
       
        if(coupleType == '1'){
            //alert("Please select a Dose Type!");
                document.getElementById('details_select').value = 'wife';
        }
       
        if(coupleType == '2'){
            //alert("Please select a Dose Type!");
                document.getElementById('details_select').value = 'husband';
               
        }
    }
       
       
</script>

<body>
    <div>one :
      <select id="kSelect" name="kSelect" onChange="getCoupleDetails(this);">
        <option value="0">Select one</option>
        <option value="1">Husband</option>
        <option value="2">Wife</option>
      </select>
</div>
   
    <div style="margin-top:10px;">two :
      <input type="text" id="details_select" name="details_select" value="" style="width:132px;"/>
    </div>
</body>
</html>



2 combo couple.html

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<script language="javascript">
function getCoupleDetails(div_id){
alert("l");
        var coupleType = (div_id.options[div_id.selectedIndex].value);
       
        //alert("Id :"+districtId);
        if(coupleType == '0'){
            //alert("Please select a Dose Type!");
                 document.getElementById('RSelect').getElementsByTagName('option')[0].selected = 'selected';
        }
       
        if(coupleType == '1'){
            //alert("Please select a Dose Type!");
                 document.getElementById('RSelect').getElementsByTagName('option')[2].selected = 'selected';
               
        }
       
        if(coupleType == '2'){
            //alert("Please select a Dose Type!");
                document.getElementById('RSelect').getElementsByTagName('option')[1].selected = 'selected';
               
        }
    }
       
       
</script>

<body>
    <div>one :
      <select id="kSelect" name="kSelect" onChange="getCoupleDetails(this);">
        <option value="0">Select one</option>
        <option value="1">Husband</option>
        <option value="2">Wife</option>
      </select>
</div>
   
    <div style="margin-top:10px;">two :
      <select id="RSelect" name="RSelect" onChange="getCoupleDetailsHH(this);">
        <option value="0">Select one</option>
        <option value="1">Husband</option>
        <option value="2">Wife</option>
      </select>
    </div>
</body>
</html>

Monday, January 20, 2014

Oracle query run practice for self - 1



SELECT TO_CHAR(START_TIME,'HH:MI AM')START_TIME,TO_CHAR(END_TIME,'HH:MI AM')END_TIME
FROM hr_empshiftdetail
where EMP_NO='E011302000087'
and sh_dt=trunc(sysdate)
order by 1


select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail where emp_no='E011302000087' and sh_dt=trunc(sysdate) order by 1



hpms_doctor
slot multi query no dependent others

SELECT TO_CHAR(START_TIME,'HH:MI AM')START_TIME,TO_CHAR(END_TIME,'HH:MI AM')END_TIME
FROM OP_APPOINTMST
WHERE EMP_NO='E011302000083'
AND APPOINT_DATE='19-sep-2013'


hr_empshiftdetail


-----------------------------------------------------------------------------------
  public List<AppointmentPatientInfo>  getslotTimeSubSectionList(String empNo, String slotDate) {
query = "select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail  " +
                            "where emp_no='"+empNo+"' and sh_dt=to_date('08/07/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS') order by 1";
---------------------------------------------------------------------------------


or above particular date and under sysdate
Different sh_dt=trunc(sysdate)
EQUAL 
sh_dt=to_date('08/07/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS')

--------------------------------------------------------------------------------
  public List<AppointmentPatientInfo>  getslotTimeSubSectionList(String empNo, String slotDate) {
query = "select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail  " +
                            "where emp_no='"+empNo+"' and sh_dt=trunc(sysdate) order by 1";







--------------------------------------------------------------------------------








*************************************************************************************************************************
This is problem portion
-----------------------------------------------------------------------------------
  public List<AppointmentPatientInfo>  getslotTimeSubSectionList(String empNo, Date slotDate) {

    query = "select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail  " +
                            "where emp_no='"+empNo+"' and sh_dt="+slotDate+" order by 1";
---------------------------------------------------------------------------------------


Error query from console against above query


select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail  where emp_no='E011204000067' and sh_dt=Sun Aug 18 00:00:00 BDT 2013 order by 1




2//Start (string date pass through form)
Correct query
query = "select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail  " +
                            "where emp_no='"+empNo+"' and sh_dt=to_date('"+slotDate+"','dd/mm/yyyy') order by 1";




select to_char(start_time,'HH:MI AM')start_time,to_char(end_time,'HH:MI AM')end_time
from hr_empshiftdetail
where emp_no='E011204000067'
and sh_dt = to_date('18/08/2013', 'DD/MM/YYYY')
order by 1


2//End




3//Start truncate date
select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail
                            where emp_no='"+empNo+"' and sh_dt=trunc(sysdate) order by 1;
                           
                           
                           

select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail
                            where emp_no='E011204000067' and  sh_dt=to_date('08/18/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS');                          
                          


3//End truncate date




*********************************************************************************************************************************


















Rakib
E011204000067



7/8/2013 9:00:00 AM





***********************************************************************************
For sql : public List<AppointmentPatientInfo>  getslotTimeSubSectionList(String empNo, Date dob) {


For Load Action :slotTimeSubSection

 DateFormating  dateFormating = new DateFormating();
 Date dob = dateFormating.dateFormatDB(dobActionsent);


 slotTimeSubSectionListdb=asdf.getslotTimeSubSectionList(slotDrTimeActionsent,dob);

************************************************************************************




select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail  where emp_no='E011204000067' and sh_dt=Sun Aug 18 00:00:00 BDT 2013 order by 1









=============================
hpms_doctor

SELECT TO_CHAR(START_TIME,'HH:MI AM')START_TIME,TO_CHAR(END_TIME,'HH:MI AM')END_TIME
FROM OP_APPOINTMST
WHERE EMP_NO='E011302000083'
AND APPOINT_DATE='19-sep-2013'


select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail 
                            where emp_no='E011302000087' and sh_dt=to_date('08/07/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS') order by 1
                           
                           
select to_char(start_time,'HH:MI AM')start_time,to_char(end_time,'HH:MI AM')end_time
from hr_empshiftdetail
where emp_no='E011302000087'
and sh_dt = to_date('08/07/2013 00:00:00', 'MM/DD/YYYY HH24:MI:SS')
order by 1





select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail 
where emp_no='E011204000067' and sh_dt=to_date('18/08/2013','dd/mm/yyyy') order by 1



=======================================================================
=========================================================================
==========================================================================
=============================================================================
Rokon and Rahman slot query
===============================================================================
=================================================================================
slot multi query no dependent others

SELECT TO_CHAR(START_TIME,'HH:MI AM')START_TIME,TO_CHAR(END_TIME,'HH:MI AM')END_TIME
FROM OP_APPOINTMST
WHERE EMP_NO='E011302000083'
AND APPOINT_DATE='19-sep-2013'
and START_TIME between TO_CHAR(START_TIME,'01:45 PM')
 and TO_CHAR(START_TIME,'02:30 PM')

select TO_CHAR('2:00:20 PM', 'HH24:MI:SS') from dual

E011204000067



SELECT TO_CHAR(START_TIME,'HH:MI AM')START_TIME,TO_CHAR(END_TIME,'HH:MI AM')END_TIME
FROM OP_APPOINTMST
WHERE EMP_NO='E011302000083'
AND APPOINT_DATE='19-sep-2013'
--and SHIFT_NO = 'GEN'
and SHIFT_NO = 'GEN2'

select SH_DT,to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time,SHIFT_NO from hr_empshiftdetail 
                            where emp_no='E011001000426' and sh_dt=to_date('05/09/2013','dd/mm/yyyy')
                          -- and SHIFT_NO = 'GEN' order by 1
                          
                           OP_APPOINTMST
                           hrv_empjobdetails
                          
                          
                          
                          
select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time from hr_empshiftdetail 
where emp_no='E011204000067' and sh_dt=to_date('18/08/2013','dd/mm/yyyy') order by 1
                          
                          

insert into OP_APPOINTMST()






=============================================================================================================
=============================================================================================================

shift_no (Multi slot call according to sub section slot)
=============================================================================================================
=============================================================================================================


select shift_no ,to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time,SHIFT_NO from hr_empshiftdetail 
                            where emp_no='E011001000426' and sh_dt=to_date('05/09/2013','dd/mm/yyyy')
                          -- and SHIFT_NO = 'GEN' order by 1
                          
                           OP_APPOINTMST
                           hrv_empjobdetails
                          
                          
                           select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time,SHIFT_NO from op_appointmst 
                            where emp_no='E011001000426' and APPOINT_DATE=to_date('05/09/2013','dd/mm/yyyy')
                            and SHIFT_NO = 'EV1' order by 1
                          


...............................................................
update query for date update then run above query
...............................................................

 update op_appointmst set APPOINT_DATE=to_date('05/10/2013','dd/mm/yyyy') where emp_no='E011001000426' and APPOINT_DATE=to_date('05/09/2013','dd/mm/yyyy')



Then Run Query
--------------
  select to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time,SHIFT_NO from op_appointmst 
                            where emp_no='E011001000426' and APPOINT_DATE=to_date('05/10/2013','dd/mm/yyyy')
                            and SHIFT_NO = 'EV1' order by 1
=============================================================================================================
=============================================================================================================





======================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++
=======================================================
select SH_DT,to_char(start_time,'HH:MI AM') start_time,to_char(end_time,'HH:MI AM') end_time,SHIFT_NO from hr_empshiftdetail 
                            where emp_no='E011001000426' and sh_dt=to_date('05/09/2013','dd/mm/yyyy')





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1/ Instruction 1 : Catch data From 2 table  (1.op_registration  2.op_pataddr) N.B use alliase name system Learn
select r.salutation_id,r.full_name,r.dob,r.gender,pa.ADD1 from op_registration r, op_pataddr pa  where r.reg_no = 'R011003000673';







..............................FOR WORK .........................................................

select  r.national_id,r.salutation_id,r.full_name,r.dob,r.gender,pa.add1
from op_registration r, op_pataddr pa 
where r.reg_no = pa.reg_no
and r.reg_no = 'R011003000673';


select * from op_registration where reg_no = 'R011106000281';

select * from op_pataddr where reg_no = 'R011106000281' and ADDR_TYPE = 'PS';

select * from op_pataddr where reg_no = 'R011106000281' and ADDR_TYPE = 'PR';


N.B:ps means 

..............................For salutation search .............................................
 select * from op_registration where reg_no = 'R011001000315'


  select REG_NO,SALUTATION_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME,  (select salutation_name from hr_salutation where SALUTATION_ID =op_registration.SALUTATION_ID) salutation_name from op_registration  where reg_no = 'R011001000310'


select salutation_name from hr_salutation where SALUTATION_ID ='12'






////////////////////////////////////////////////
select SEQ_OPDAPP_NO.nextval from dual;

/////////////////////////////////////////////////
***************************************************
Report Generate Query
......................
......................
......................
Select a.appoint_no, a.APPOINT_DATE, a.sc_no, s.sc_date, b.APP_BY,b.APP_BY_REL_W_PAT, b.REG_NO,
       (CASE WHEN b.reg_no IS NULL THEN INITCAP((SELECT SALUTATION_NAME FROM HR_SALUTATION WHERE SALUTATION_ID=b.SALUTATION_ID)||' '||b.FIRST_NAME||' '||b.MIDDLE_NAME||' '||b.LAST_NAME)
                ELSE (SELECT SALUTATION_NAME FROM HR_SALUTATION WHERE SALUTATION_ID=r.SALUTATION_ID)||' '||r.FIRST_NAME||' '||r.MIDDLE_NAME||' '||r.LAST_NAME                     
          END) patient_name,
       CASE
          WHEN r.GENDER = 'M'
             THEN 'Male'
          WHEN r.GENDER = 'F'
             THEN 'Female'
          WHEN r.GENDER='O' THEN 'Other'
       END gender,      
       CASE WHEN b.reg_no IS NOT NULL THEN fnc_patientage(r.reg_no,'D')
            ELSE NVL(to_char(b.age_yy)||' Y '||to_char(b.age_mm)||' M '||to_char(b.age_dd)||' D',FNC_TOAGE(b.dob)) END age,
       a.SL#,b.pat_sl#,
       a.SCHEDULE_TYPE,
       d.doctor_name,
       a.start_time,a.end_time,
       (SELECT TYPE_DES FROM OP_APPTYPE WHERE TYPE_CODE=b.APP_TYPE) appoint_type,      
       d.specialization_name,
       d.QUALIFICATION,
       d.ROOM_NO,
       d.ROOM_NAME
        From op_appointmst a,
             op_appointment b,
             hpms_resourceschedule s,
             HPMSV_DOCCHEMBER D,
             op_registration r
        Where  a.sc_no = s.sc_no(+)
        AND    a.APPOINT_NO = b.APPOINT_NO
        AND    s.RESOURCE_NO = d.DOCTOR_NO(+)
        AND    b.reg_no = r.reg_no(+)
        AND a.appoint_no = nvl(:p_appoint_no, a.appoint_no)
        AND b.pat_SL# = NVL(:P_SL, B.pat_SL#)

*****************************************************************************************************************************************************************************************************************
P011307333179
1
P011001000426

***************************************************
Jasper height and width
w = 20.990

H = 29.704
***************************************************