I have those two parts of code:
\documentclass[double,12pt, twoside]{book}
\usepackage{graphics}
\usepackage[a4paper]{geometry}
%--------------first one-----------------
\titleformat{\chapter}[display]
{\normalfont\Large\raggedleft}
{\MakeUppercase{\chaptertitlename}
\rlap{ \resizebox{!}{1.5cm}{\thechapter} \rule{5cm}{1.5cm}}}
{10pt}{\Huge}
\titlespacing*{\chapter}{0pt}{30pt}{20pt}
%--------------second one-----------------
\titleformat{\chapter}[display]
{\normalfont\Large\raggedright}
{\hspace{0cm}\llap{%
\rule{5cm}{1.5cm}\hspace{0.2cm}\resizebox{!}{1.5cm}{\thechapter}\hspace{0.2cm}}%
\MakeUppercase{\chaptertitlename}}
{10pt}{\Huge}
\titlespacing*{\chapter}{0pt}{30pt}{20pt}
\usepackage{lipsum}
\setcounter{chapter}{2}
\begin{document}
\chapter{Implementation}
\lipsum
\end{document}
I want the first one for the odd pages and the second one for the even ones. I am new with latex, and I couldn't figure out from that thread.
PS. I am sorry for duplicate question, how can i delete one question?

;)– Guilherme Zanotelli Dec 07 '16 at 11:49