
\documentclass{bidipresentation}



\usepackage{tikz}
\usetikzlibrary{shapes,snakes}
\usepackage{xepersian}

\tikzstyle{myghazye} = [draw=blue!30, fill=none, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=20pt]
\tikzstyle{fancytitleghazye} =[fill=yellow!20, text=red]
\newcounter{algcounter}

 \newcommand{\myghazye}[2]{
\begin{tikzpicture}\node [myghazye] (box){\setRTL\begin{minipage}{0.95\textwidth}
{#2}
  \end{minipage}};\node[fancytitleghazye, left=10pt] at (box.north east) {\hboxR{{\Large{قضیه }}\refstepcounter{algcounter}\thealgcounter #1}}; \end{tikzpicture} 
% \AddToShipoutPicture*{\put(-512,0){\includegraphics[height=\paperheight, width=194mm]{side.jpg}}} 
}

\begin{document}
\section{اول}
\myghazye{\label{sam1}}{ متن موجود نیست}

\myghazye{\label{sam2}}{متن موجود نیست}
طبق قضیه~%
\ref{sam2}
\section{دوم}

\myghazye{\label{sam3}}{متن موجود نیست}
طبق قضیه~%
\ref{sam1}
\myghazye{\label{sam4}}{متن موجود نیست}

طبق قضیه~%
\ref{sam4}
\end{document}
