\documentclass[12pt,twoside,titlepage,a4paper,openany]{book}
\usepackage{graphicx,epsfig,fancyhdr,amsmath,amssymb}
\usepackage[round, authoryear, comma, sort&compress]{natbib}
\usepackage[doublespacing]{setspace}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{titlesec,epigraph}

% To customise the epigraph package so that quotation can appear in the part-page
\renewcommand{\epigraphflush}{center}
\renewcommand{\sourceflush}{flushright}
\setlength\epigraphwidth{10cm}
\titleformat{\part}[display]
  {\normalfont\huge\filcenter\bfseries\thispagestyle{epigraph}}{Part\ \thepart}{20pt}{\Huge}
\titlespacing*{\part}{0pt}{0.7in}{0pt} %attributes to left margin, above-skip, below-skip, respectively
\makeatletter
  \let\@epipart\@endpart
  \renewcommand{\@endpart}{\thispagestyle{epigraph}\@epipart}
\makeatother  

% Commands for the cover page of the thesis
\newcommand*{\authors}[1]{\def\authornames{#1}}
\newcommand*{\thesist}[1]{\def\thesistitle{#1}}
\newcommand*{\university}[1]{\def\univname{#1}}
\newcommand*{\faculty}[1]{\def\facname{#1}}

% Get the correct margin for a two-sided thesis
\addtolength{\oddsidemargin}{0.5in}
\addtolength{\evensidemargin}{-0.5in}
\addtolength{\headheight}{2.5pt}

% Define the page headers using the Fancyhdr package
\fancyhead{}				% Clears all page headers
\fancyfoot{}				% Clears all page footers

% Header
\fancyhead[RE,LO]{\textbf{\nouppercase{\rightmark}}}	% Insert section number and title on the right header of Even Page and left header of Odd Page
\fancyhead[RO,LE]{\thepage}														% Insert page number on the right header of Odd Page and left header of Even Page

\authors     {<Name of author>}
\thesist		 {<Title of thesis>}
\university  {<University of ZZZ>}
\faculty     {<Dept Name>}

\begin{document}

% Set the front pages differently (page numbers are in Roman)
\pagestyle{empty}
\frontmatter

% The following commands are for title page
\begin{titlepage}
 \begin{singlespacing}
 \bigskip
 \bigskip
 \begin{center}
  \setlength{\parskip}{0pt}
  \huge \textbf{\thesistitle}\par
  \vspace{3.5cm}
  \huge \textbf{by} \par
  \vspace{3cm}
  \huge \textbf{\authornames} \par
  \vspace{3.5cm}
	\large A thesis submitted in partial fulfilment of the requirements for the degree of \par
	\large Doctor of Philosophy in <XXX> \par
	\vspace{3.5cm}
  \large \univname, \facname \par
  \large December 2011 \par
 \end{center}
 \end{singlespacing}
\end{titlepage}

% The following commands are for the various lists
\newpage
\begin{singlespacing}
\makeatletter \renewcommand{\@dotsep}{10000} \makeatother %This is to get rid of the dots on the Table of Contents
\tableofcontents
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}
\listoffigures 
\addcontentsline{toc}{chapter}{List of Figures}
\end{singlespacing}

\begin{onehalfspacing}
\begin{flushleft}
\label{Acknowledgements}
\input{Acknowledgements}
\end{flushleft}
\newpage
\label{Declaration}
\input{Declaration}
\newpage
\label{Abstract}
\input{Abstract}
\end{onehalfspacing}


% The following commands are the main body of the thesis and page numbers are in Arabic
\pagestyle{fancy} 
\mainmatter
\epigraphhead[400]{\epigraph{\hspace{1em}There are neither beginnings nor endings to the turning of the Wheel of Time. But it was \emph{a} beginning.}{Robert Jordan \\ \textit{The Wheel of Time}}}
\part{}
\input{Chapter1}
\input{Chapter2}
\input{Chapter3}
\newpage
\epigraphhead[400]{\epigraph{\hspace{1em}`There are few people, however, who, if you told them a result, would be able to evolve from their own inner consciousness what the steps were which led up to that result. This power is what I mean when I talk of reasoning backward, or analytically.'}{Arthur Conan Doyle \\ \textit{A Study in Scarlet}}}
\part{}
\input{Chapter4}
\input{Chapter5}


% The following commands are for Appendix
\appendix
\input{Appendix1}


% The following commands are the back matter of the thesis
\backmatter

%	Reference
\label{Bibliography}
\fancyhead[LO,RE]{\textbf{Bibliography}}			% Left head of Odd page and right head of Even page: "Bibliography"	
\addcontentsline{toc}{chapter}{Bibliography}
\begin{singlespacing}

\bibliographystyle{apa}
\bibliography{./Bibliography/Books,./Bibliography/Articles}

\end{singlespacing}

\end{document}