Spade

Mini Shell

Directory:~$ /proc/self/root/home/lmsyaran/public_html/css/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ //proc/self/root/home/lmsyaran/public_html/css/messages.zip

PKAc�[�#o,,
index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PKAc�[�ݗ�>�>tmpl/default.phpnu�[���<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');


?>
<?php echo $this->toolbar->render(); ?>

<!--[JCBGUI.site_view.default.26.$$$$]-->
<?php
$clip='<svg xmlns="http://www.w3.org/2000/svg"
version="1.0" width="25px" height="25px"
viewBox="0 0 400.000000 448.000000"
preserveAspectRatio="xMidYMid meet" style="&#10;   
fill: #a5a5a5"><g transform="translate(0.000000,448.000000)
scale(0.100000,-0.100000)" fill="inherit"
stroke="none"><path d="M2620 4465 c-179 -30 -330 -90
-477 -188 -87 -58 -206 -174 -1037 -1006 l-940 -940 -3 -58 c-5 -68 16 -111
69 -143 37 -22 107 -27 141 -9 12 6 434 422 937 924 556 554 941 930 981 958
164 115 328 169 514 169 147 -1 241 -22 370 -86 332 -163 529 -488 512 -841
-8 -164 -52 -291 -155 -450 -64 -100 -2284 -2324 -2390 -2395 -220 -148 -495
-113 -683 87 -174 187 -195 439 -53 653 30 45 385 407 1171 1192 1193 1192
1146 1148 1234 1148 45 0 122 -46 152 -92 29 -46 37 -121 16 -175 -5 -16 -410
-428 -919 -938 -992 -993 -944 -940 -919 -1030 14 -51 65 -102 112 -110 94
-18 34 -71 1010 903 494 493 919 926 944 961 150 207 128 458 -57 641 -164
163 -375 195 -585 87 -51 -26 -224 -195 -1217 -1186 -1209 -1208 -1208 -1207
-1274 -1358 -92 -207 -89 -487 5 -690 43 -91 100 -170 177 -244 117 -111 236
-179 389 -220 118 -32 319 -32 430 -1 94 27 198 78 275 134 80 59 2347 2330
2409 2413 75 101 166 290 196 409 110 436 -16 869 -342 1176 -263 248 -643
365 -993 305z"/></g></svg>';
$send='<svg xmlns="http://www.w3.org/2000/svg"
version="1.0" width="25px" height="25px"
viewBox="0 0 448.000000 396.000000"
preserveAspectRatio="xMidYMid meet" style=" fill: #238ff3;
"> <g transform="translate(0.000000,396.000000)
scale(0.100000,-0.100000)" fill="inherit"
stroke="none"> <path d="M285 3946 c-110 -27 -202 -105
-252 -211 l-28 -60 0 -585 0 -585 27 -57 c47 -101 137 -178 243 -207 22 -6
436 -63 920 -126 484 -64 893 -119 909 -123 19 -5 -251 -43 -815 -116 -464
-59 -886 -114 -937 -122 -157 -23 -261 -95 -320 -222 l-27 -57 0 -595 0 -595
27 -57 c73 -156 239 -247 399 -218 43 8 567 229 1708 722 905 390 1756 758
1891 815 135 58 265 120 290 138 100 70 155 180 154 305 -2 109 -31 179 -108
256 l-61 60 -1900 814 c-1045 447 -1925 819 -1955 826 -66 16 -99 16 -165
0z"></path> </g> </svg>';
$recorder='<svg xmlns="http://www.w3.org/2000/svg"
version="1.0" width="25px" height="25px"
viewBox="0 0 352.000000 512.000000"
preserveAspectRatio="xMidYMid meet" style="&#10;   
fill: #a5a5a5;&#10;"> <g
transform="translate(0.000000,512.000000)
scale(0.100000,-0.100000)" fill="inherit"
stroke="none"> <path d="M1580 5105 c-293 -47 -576 -227
-747 -476 -83 -121 -153 -299 -178 -454 -22 -131 -22 -1565 0 -1705 45 -302
223 -583 476 -757 124 -85 303 -155 459 -178 612 -93 1183 326 1275 935 22
139 22 1561 0 1700 -43 285 -199 549 -427 721 -246 185 -554 262 -858 214z
m370 -328 c209 -57 368 -171 480 -344 50 -76 79 -142 108 -248 15 -54 17 -144
17 -865 0 -721 -2 -811 -17 -865 -29 -106 -58 -172 -108 -248 -238 -366 -718
-474 -1087 -247 -180 111 -294 265 -361 490 -15 49 -17 145 -20 825 -2 557 0
791 8 845 53 337 300 594 640 666 80 17 262 12 340 -9z"/> <path
d="M95 3666 c-41 -18 -83 -69 -90 -109 -4 -18 -5 -278 -3 -577 4 -512 6
-552 26 -658 71 -361 231 -661 492 -922 278 -279 611 -447 987 -501 l92 -13 3
-392 c3 -379 4 -394 24 -420 39 -53 71 -69 134 -69 63 0 95 16 134 69 20 26
21 41 24 420 l3 393 62 7 c34 4 101 16 148 26 353 78 645 242 895 503 278 289
443 646 484 1047 7 65 10 296 8 607 -3 488 -4 502 -24 529 -39 53 -71 69 -134
69 -63 0 -95 -16 -134 -69 -20 -27 -21 -42 -27 -594 -6 -528 -7 -573 -27 -659
-68 -297 -191 -523 -397 -728 -207 -208 -437 -332 -733 -397 -140 -31 -424
-31 -564 0 -295 65 -527 190 -733 397 -205 204 -331 435 -398 730 -19 83 -21
135 -26 657 -6 552 -7 567 -27 594 -11 15 -32 37 -46 47 -33 25 -113 32 -153
13z"/> </g> </svg>';
?>
<link rel="stylesheet" type="text/css"
href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css">
<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/toastify-js"></script>

<div id="context-menu" style="width: 150px; position:
absolute; display: none">
  <div class="css-1obmwoi ezvb10p0"></div>
  <div origin="right top" class="css-m4s3q2
ezvb10p1">
    <ul class="css-1wjqtxb ehfgrij0">
      <li class="Menu_MenuItemWrapper__NyeOc"
id="editctxbtn" data-cmd="edit" style="display:
none" >
        <img class="Menu_MenuIcon__tFRZQ css-v6ppy3 e13l1lra1"
src="/components/com_reservation/assets/images/edit_icon.svg"
alt="ویرایش">
        <p
class="Menu_Title__jDLFR">ویرایش</p>
      </li>
      <li class="Menu_MenuItemWrapper__NyeOc"
data-cmd="reply">
        <img class="Menu_MenuIcon__tFRZQ css-v6ppy3 e13l1lra1"
src="/components/com_reservation/assets/images/reply_icon.svg"
alt="پاسخ">
        <p class="Menu_Title__jDLFR">پاسخ</p>
      </li>
      <li class="Menu_MenuItemWrapper__NyeOc"
data-cmd="copy">
        <img class="Menu_MenuIcon__tFRZQ css-v6ppy3 e13l1lra1"
src="/components/com_reservation/assets/images/copy_icon.svg"
alt="رونوشت">
        <p
class="Menu_Title__jDLFR">رونوشت</p>
      </li>
      <li class="Menu_MenuItemWrapper__NyeOc"
id="delctxbtn" data-cmd="del"
data-toggle="modal" data-target="#confirm-delete">
        <img class="Menu_MenuIcon__tFRZQ css-v6ppy3 e13l1lra1"
src="/components/com_reservation/assets/images/delete_icon.svg"
alt="حذف">
        <p class="Menu_Title__jDLFR">حذف</p>
      </li>
      
    </ul>
  </div>
</div>
<!-- <p id='copy-toast'>رونوشت پیام انجام
شد.<img 
src="/components/com_reservation/assets/images/copy_icon.svg"
alt="رونوشت"></p> -->
<div class="modal fade" id="confirm-delete"
tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true"
style="height: auto;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                حذف پیام
            </div>
            <div class="modal-body">
                آیا برای حذف این پیام مطمئن
هستید؟
            </div>

            <div class="modal-footer">
                <button type="button" class="btn
btn-default" data-dismiss="modal">لغو</button>
                <a id="submit-delete"
data-dismiss="modal" class="btn btn-success
success">تایید</a>
            </div>
        </div>
    </div>
</div>

<div class="chat">
  <div class="row justify-content-center">
    <div class="col-md-8">
      <div class="card card-cahtt">
        <div class="card-header header-chats">
          <?php
            if ( ( ! file_exists( JPATH_SITE .
'/libraries/CBLib/CBLib/Core/CBLib.php' ) ) || ( ! file_exists(
JPATH_ADMINISTRATOR .
'/components/com_comprofiler/plugin.foundation.php' ) ) ) {
              // echo 'CB not installed';
              $imgurl = '';
            }
            else
            {
              include_once( JPATH_ADMINISTRATOR .
'/components/com_comprofiler/plugin.foundation.php' );
              
              cbimport( 'cb.html' );
              $joomlaid = $id;
              global $_CB_framework, $_PLUGINS, $ueConfig;

              $cbUser =& CBuser::getInstance( (int)
JFactory::getApplication()->input->get('uid') );
              $user = $cbUser->getUserData();
              $imgurl = '/images/comprofiler/' .
$user->avatar;
              // dump($user, 'user');
            }
          ?>
          <a id="profile-user" class="img"
href="#">
            <img src="<?php echo $imgurl;?>"
alt="">
          </a>
          <p id="user-name"><?php echo
$this->item->users_name; ?></p>
          <div id="chat-status">
          <?php if($this->item->session->finish==0):?>
            <p id="notice">گفتگو در حال
انجام است</p>
          <?php else:?>
            <p id="notice">گفتگو خاتمه
یافت</p>
          <?php endif; ?>
          <?php if(empty($this->item->msn)):?>
            <?php if($this->item->session->finish==0):?>
              <button id="conversation" class="btn btn-sm
btn-danger">پایان گفتگو
                <div id="loading" class="spinner-grow
text-warning" role="status">
                  <span
class="sr-only">Loading...</span>
                </div>
              </button>
            <?php else:?>
              <button id="conversation" class="btn btn-sm
btn-success">ادامه گفتگو
                <div id="loading" class="spinner-grow
text-warning" role="status">
                  <span
class="sr-only">Loading...</span>
                </div>
              </button>
            <?php endif; ?>
            <button id="video_session" class="btn btn-sm
btn-info">شروع جلسه آنلاین
              <div id="loading" class="spinner-grow
text-warning" role="status">
                <span
class="sr-only">Loading...</span>
              </div>
            </button>
          <?php endif;?>
          </div>
        </div>
        <div class="card-body" id="chat-body">
        <?php //dump($this, 'this');?>
        
        <?php foreach($this->item->messages as $message):?>
          <?php
            // dump($message, 'message');
            $tsmsg = trim(strip_tags($message->message));
            $reply = "";
            if($message->reply)
            {
              $reply_pm = $this->item->messages[$message->reply];
              $reply = $reply_pm->message;
              // dump($reply_pm, 'reply_pm');
              if($reply_pm->from == $this->item->users_id)
                $reply_user = $this->item->users_name;
              else
                $reply_user = $this->user->name;
                
              $reply = '<div
id="rep-'.$message->reply.'" class="text
reply"><div class="Preview_preview__7RTlb"
data-prevent-context-menu-mobile="true" style="border-right:
3px solid rgb(19, 194, 194);"><div
class="Preview_details__kki9K"><span
class="Preview_sender__RUCFl" style="color: rgb(19, 194,
194);">'.$reply_user.'</span><div
class="Text_text__0QjN9
TextPreview_text_preview__7vRSt"><span>'.$reply.'</span></div></div></div></div>';
            }
            // $date = new DateTime($message->created, new
DateTimeZone('UTC'));
            // $date->setTimezone(new
DateTimeZone('Asia/tehran'));
          ?>
          <?php if($tsmsg || substr($message->message, 0, 4) ==
'<img'): ?>
            <div class="pm <?= ($message->from !=
$this->item->users_id)? 'me': '';?>"
id="pm-<?php echo $message->id?>">
              <?php if($reply && $message->from !=
$this->item->users_id):?>
                <?php echo $reply; ?>
              <?php endif;?>
              <div class="text">
                <span class="massage">
                  <?= $message->message;?>
                </span>
                <div class="info-message">
                  <span class='readtick <?php echo
$message->read ? 'read' : 'unread';?>'
style="<?= ($message->from==$this->item->users_id)?
'display:none;': '';?>">  </span>
                  <!--<span class="time"><?php //echo
$date->format('Y/m/d H:i'); ?></span> -->
                  <!--<span class="time"><?php //echo
JHtml::_('date', $message->created, 'l, d M Y G:i');
?></span>-->
                  <span class="time"><?php echo
JHtml::_('date', $message->created, 'Y/m/d G:i');
?></span>
                </div>
              </div>
              <?php if($reply && $message->from ==
$this->item->users_id):?>
                <?php echo $reply; ?>
              <?php endif;?>
            </div>
          <?php endif;?>
        <?php endforeach;?>
        </div>
        <div class="">
          <form id='sending-form' action="#"
method="post" class="form-inline"
enctype="multipart/form-data">
          
            <div id="reply-header" class="css-go2n58
e27v5ni5" style="display: none;">
              <div class="css-1ber1nl e27v5ni2">
                <div class="Preview_preview__7RTlb css-5a4ol0"
data-prevent-context-menu-mobile="true" style="border-right:
3px solid rgb(19, 194, 194);">
                  <div class="Preview_details__kki9K">
                    <span id="reply-user"
class="Preview_sender__RUCFl" style="color: rgb(19, 194,
194);">ArMaN</span>
                    <div class="Text_text__0QjN9
TextPreview_text_preview__7vRSt">
                      <span
id="reply-text">replytext</span>
                      <input type="hidden" value="0"
name="replyid" id="reply-id">
                    </div>
                  </div>
                </div>
              </div>
              <div id="reply-close" class="e27v5ni1
css-1fgag0w eryqwb30">
                <svg xmlns="http://www.w3.org/2000/svg"
width="16" height="16" viewBox="0 0 24
24"><g transform="translate(-1024 -240)"><g
transform="translate(1024 240)"><rect fill="none"
width="16" height="16"></rect><path
fill="#5e6c84"
d="M14.857,9.143H9.143v5.714a1.143,1.143,0,1,1-2.286,0V9.143H1.143a1.143,1.143,0,1,1,0-2.286H6.857V1.143a1.143,1.143,0,1,1,2.286,0V6.857h5.714a1.143,1.143,0,1,1,0,2.286Z"
transform="translate(12 0.686)
rotate(45)"></path></g></g></svg>
              </div>
            </div>
            <div style="position: relative;">
              <button type="submit"
name="chatSendBtn" id="chatSendBtn" class="btn
btn-primary"
                style="cursor:<?=
$this->item->session->finish==1?'no-drop':'pointer';?>"
                <?=
$this->item->session->finish==1?'disabled':'';?>
>
                <?php echo $send; ?>
                <div id="loading" class="spinner-grow
text-warning" role="status">
                  <span
class="sr-only">Loading...</span>
                </div>
              </button>
              <!-- <input title="در این قسمت
میتوانید پیام خود را وارد کنید"
type="text" style="flex-grow: 2"
class="form-control mr-1" name="chatMessage"
id="chatMessage" required placeholder="پیام خود را
وارد کنید ..."> -->
              <textarea title="در این قسمت
میتوانید پیام خود را وارد کنید"
id="chatMessage" style="height: 51px;"
name="chatMessage" cols="100%" required
placeholder="پیام خود را وارد کنید
..."></textarea>
              <label id="upload_file"
for="atachedfile">
                <?php echo $clip; ?>
              </label>
              <label id="upload_voise"
for="atachedfile">
                <?php echo $recorder; ?>
              </label>
            </div>
            <input name="atachedfile"
id='atachedfile' type="file" />
            <progress style="display:
none;"></progress>
            <input type="hidden" name="pmid"
id="pmid" value="0">
          </form>

        </div>
      </div>
    </div>
  </div>
  <div id="myModal" class="modalimg">
    <span class="closeimg">&times;</span>
    <img class="modalimg-content" id="img01">
    <div id="caption"></div>
  </div>
	<script>
	</script>
  <input type="hidden" name="<?=
JSession::getFormToken();?>" id="token">
	
</div><!--[/JCBGUI$$$$]-->

PKAc�[�ʝ��7�7tmpl/default.php.baknu�[���<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			11th February, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');


?>
<?php echo $this->toolbar->render(); ?>

<!--[JCBGUI.site_view.default.26.$$$$]-->
<!--<link
href="http://hayageek.github.io/jQuery-Upload-File/4.0.11/uploadfile.css"
rel="stylesheet">
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script
src="http://hayageek.github.io/jQuery-Upload-File/4.0.11/jquery.uploadfile.min.js"></script>
-->
<div class="chat">
    <div class="row justify-content-center">
        <div class="col-md-8">

            <div class="card">
                <div class="card-header">
                  <div style="position: absolute; right:
1%;">

                      <?php
if($this->item->session->finish==0):?>
                          <p id="notice" class="alert
alert-info">گفتگو در حال انجام است</p>
                      <?php else:?>
                         <p id="notice" class="alert
alert-info">گفتگو خاتمه یافت</p>
                      <?php endif; ?>


                      <?php if(empty($this->item->msn)):?>

                          <?php
if($this->item->session->finish==0):?>
                              <button id="conversation"
class="btn btn-sm btn-danger">پایان گفتگو
                                  <div id="loading"
class="spinner-grow text-warning" role="status">
                                      <span
class="sr-only">Loading...</span>
                                  </div>
                              </button>
                          <?php else:?>
                              <button id="conversation"
class="btn btn-sm btn-success " style="position: absolute;
right: 1%;">ادامه گفتگو
                                  <div id="loading"
class="spinner-grow text-warning" role="status">
                                      <span
class="sr-only">Loading...</span>
                                  </div>
                              </button>
                          <?php endif; ?>

                      <?php endif;?>
                  </div>
                    <p><?php echo $this->item->users_name;
?></p>
                    <a class="img" href="#">
                        <img
src="/joomla/templates/mytemp/assets/images/farzad.jpg"
alt="">
                    </a>
                </div>
                <div class="card-body">
                    <?php //dump($this->item->messages,
'messages');?>
                    <?php foreach($this->item->messages as
$message):?>

                        <div class="pm <?=
($message->from!=$this->item->users_id)? 'me':
'';?>">
                                    <span class="text">
                                      <?= $message->message;?>
                                    </span><span> <?php echo
$message->seen ? '✓✓' : '✓';?>
</span>
                            <br/>
                            
                            <span class="time"><?php
echo strftime('%I:%M:%S %p', strtotime($message->created));
?></span>
                        </div>

                    <?php endforeach;?>
<!--                    <div class="pm me">-->
<!--                                <span
class="text">-->
<!--                                  سلام-->
<!--                                </span>-->
<!--                        <br/>-->
<!--                        <span
class="time">22:35</span>-->
<!--                    </div>-->
<!--                    <div class="pm">-->
<!--                                 <span
class="text">-->
<!--                                  علیک سلام-->
<!--                                </span>-->
<!--                        <br/>-->
<!--                        <span
class="time">22:36</span>-->
<!--                    </div>-->
                </div>
                <div class="card-footer">

                    <form id='sending-form'
style="padding: 15px;" action="#"
method="post" class="form-inline"
enctype="multipart/form-data">
                        <button type="submit"
name="chatSendBtn" id="chatSendBtn" class="btn
btn-primary"
                           
style="position:relative;;background-color:#007bff;margin-top:
0;cursor:<?=
$this->item->session->finish==1?'no-drop':'pointer';?>"
                            <?=
$this->item->session->finish==1?'disabled':'';?>
>
                            ارسال
                            <div id="loading"
class="spinner-grow text-warning" role="status">
                                <span
class="sr-only">Loading...</span>
                            </div>
                        </button>
                        <input type="text"
style="flex-grow: 2" class="form-control mr-1"
name="chatMessage" id="chatMessage" required
placeholder="پیام خود را وارد کنید ...">
						<input name="atachedfile" id='atachedfile'
type="file" />
						<progress style="display: none;"></progress>
                    </form>

                </div>
            </div>

        </div>
    </div>
	<script>
    var filename = '';
    var delayInMilliseconds = 1500; //1 second
	jQuery(':file').on('change', function () {
        var file = this.files[0];
        filename = file.name;
        // if (file.size > 10240) {
        //   alert('max upload size is 10k');
        // }

        // Also see .name, .type
        console.log(file);
        console.log('filetype', file.type);
	});
    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }
	jQuery('#chatSendBtn').on('click', function () {
        var _this= jQuery(this);
        var formdata = new FormData(jQuery('#sending-form')[0]);
        // formdata.append('atachedfile',
document.getElementById('atachedfile').files[0]);
        console.log(formdata);
        jQuery.ajax({
            // Your server script to process the upload
            url:
'/components/com_reservation/controllers/fileupload.php',
            type: 'POST',

            // Form data
            data: formdata,

            // Tell jQuery not to process data or worry about content-type
            // You *must* include these options!
            cache: false,
            contentType: false,
            processData: false,



            // dataType: "JSON",
            beforeSend: function () {
                //Your functions before send AJAX Request
            },
            success: function (feedback) {
                //Your functions after AJAX Request Success
            },
            error: function (error) {
                console.log(error);
            },
		
		

            // Custom XMLHttpRequest
            xhr: function () {
                console.log('--------test-------');
                var myXhr = jQuery.ajaxSettings.xhr();
                if (myXhr.upload) {
                    // For handling the progress of the upload

                    myXhr.upload.addEventListener('progress',
function (e) {
                        
                        // console.log(e.loaded, e.total);
                        if (e.lengthComputable) {
                            jQuery('progress').show();
                            jQuery('progress').attr({
                                value: e.loaded,
                                max: e.total,
                            });
                           
jQuery('#chatSendBtn').css('cursor','no-drop');
                           
jQuery('#chatSendBtn').prop('disabled', true);
                            if(e.loaded == e.total) {
                               
jQuery('#chatSendBtn').css('cursor','pointer');
                               
jQuery('#chatSendBtn').prop('disabled', false);
                                jQuery('progress').hide();
                                //
jQuery('#atachedfile').clearFields();
                                if(filename) {
                                    url =
'/components/com_reservation/files/' + filename;
                                    
                                    
                                    
                                    
                                    sleep(delayInMilliseconds).then(()
=> {
                                        ext =
filename.split('.').pop().toLowerCase();
                                        image_ext = ['jpg',
'jpeg', 'png', 'gif', 'bmp',
'jfif', 'pjpeg', 'webp', 'tif',
'tiff'];
                                        var msg = '';
                                        if(image_ext.includes(ext)) {
                                            msg = '<img
src="'+url+'">';
                                        }
                                        else {
                                            msg = '<a
href="'+url+'">' + filename +
'</a>';
                                        }
                                        var currentdate = new Date(); 
                                        tt =
currentdate.toLocaleString().split(' ');
                                        
                                       
jQuery('.chat').find('.card-body').append('<div
class="pm me">\n' +
                                        '                             
      <span class="text">\n' +
                                                                           
    msg + '\n' +
                                        '                             
      </span>\n' +
                                        '                             
      <br/>\n' +
                                        '    <span
class="time">' + tt[1] + ' ' + tt[2] +
'</span>\n' +
                                        '                             
    </div>');
                                        
                                        jQuery.ajax({
                                            url: chatAjaxRoute,
                                            method: 'post',
                                            data:{[token] : '1' ,
task: 'ajax.saveChat', format: 'json'  , raw:
'true', message:msg,from:from,to:to,seid:seid, pid: pid},
                                            success: function (msg) {
                                               
console.log('heeeeeereeeee');
                                                console.log(msg);
                                                //
$('.chat').find('.card-body').append(' <div
class="pm me">\n' +
                                                    // '              
                 <span class="text">\n' +
                                                    // '              
                  '+message+'\n' +
                                                    // '              
                 </span>\n' +
                                                    // '              
         <br/>\n' +
                                                    // '              
         <span class="time">22:35</span>\n' +
                                                    // '              
     </div>');


                                               
_this.next('#chatMessage').val('');
                                                var chatBoxBody =
jQuery('.chat .card-body')[0];
                                                //
scrollToEnd(chatBoxBody);
                                                // hideLoading(_this);
                                              //
$('#chatSendBtn').prop('disabled', false);
                                            },
                                            error: function (err) {
                                                console.log(err);
                                            }

                                        });
                                       
jQuery('#atachedfile').val('');
                                        filename = '';
                                    });
                                
                                }
                                
                            }
                        }
                    }, false);
                }
                return myXhr;
            }
	  });
      
        var token = jQuery("#token").attr("name");
        var chatAjaxRoute= Joomla.getOptions('chatAjaxRoute');
        var from= Joomla.getOptions('userId');
        var to= Joomla.getOptions('to');
        var seid= Joomla.getOptions('seid');
        var pid= Joomla.getOptions('pid');
        var channel_token= Joomla.getOptions('channel_token');
        var url = '/components/com_reservation/files/' +
filename;

        ext = filename.split('.').pop();
        image_ext = ['jpg', 'jpeg', 'png',
'gif', 'bmp', 'jfif', 'pjpeg',
'webp', 'tif', 'tiff'];
        var msg = '';
        if(image_ext.includes(ext)) {
            msg = '<img
src="'+url+'">';
        }
        else {
            msg = '<a href="'+url+'">'
+ filename + '</a>';
        }
    // sleep(delayInMilliseconds).then(() => {
        // console.log('heeeloooooooo');
    // }
        
      
	});
	</script>
    <input type="hidden" name="<?=
JSession::getFormToken();?>" id="token">
	
</div><!--[/JCBGUI$$$$]-->

PKAc�[�;��99tmpl/default.php.bak2nu�[���<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			11th February, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');


?>
<?php echo $this->toolbar->render(); ?>

<!--[JCBGUI.site_view.default.26.$$$$]-->
<!--<link
href="http://hayageek.github.io/jQuery-Upload-File/4.0.11/uploadfile.css"
rel="stylesheet">
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script
src="http://hayageek.github.io/jQuery-Upload-File/4.0.11/jquery.uploadfile.min.js"></script>
-->
<div class="chat">
    <div class="row justify-content-center">
        <div class="col-md-8">

            <div class="card">
                <div class="card-header">
                  <div style="position: absolute; right:
1%;">

                      <?php
if($this->item->session->finish==0):?>
                          <p id="notice" class="alert
alert-info">گفتگو در حال انجام است</p>
                      <?php else:?>
                         <p id="notice" class="alert
alert-info">گفتگو خاتمه یافت</p>
                      <?php endif; ?>


                      <?php if(empty($this->item->msn)):?>

                          <?php
if($this->item->session->finish==0):?>
                              <button id="conversation"
class="btn btn-sm btn-danger">پایان گفتگو
                                  <div id="loading"
class="spinner-grow text-warning" role="status">
                                      <span
class="sr-only">Loading...</span>
                                  </div>
                              </button>
                          <?php else:?>
                              <button id="conversation"
class="btn btn-sm btn-success " style="position: absolute;
right: 1%;">ادامه گفتگو
                                  <div id="loading"
class="spinner-grow text-warning" role="status">
                                      <span
class="sr-only">Loading...</span>
                                  </div>
                              </button>
                          <?php endif; ?>

                      <?php endif;?>
                  </div>
                    <p><?php echo $this->item->users_name;
?></p>
                    <a class="img" href="#">
                        <img
src="/joomla/templates/mytemp/assets/images/farzad.jpg"
alt="">
                    </a>
                </div>
                <div class="card-body">
                    <?php //dump($this->item->messages,
'messages');?>
                    <?php foreach($this->item->messages as
$message):?>

                        <div class="pm <?=
($message->from!=$this->item->users_id)? 'me':
'';?> pm-<?php echo $message->id?>">
                                    <span class="text">
                                      <?= $message->message;?>
                                    </span><span
id='readtick'> <?php echo $message->read ?
'✓✓' : '✓';?> </span>
                            <br/>
                            
                            <span class="time"><?php
echo strftime('%I:%M:%S %p', strtotime($message->created));
?></span>
                        </div>

                    <?php endforeach;?>
<!--                    <div class="pm me">-->
<!--                                <span
class="text">-->
<!--                                  سلام-->
<!--                                </span>-->
<!--                        <br/>-->
<!--                        <span
class="time">22:35</span>-->
<!--                    </div>-->
<!--                    <div class="pm">-->
<!--                                 <span
class="text">-->
<!--                                  علیک سلام-->
<!--                                </span>-->
<!--                        <br/>-->
<!--                        <span
class="time">22:36</span>-->
<!--                    </div>-->
                </div>
                <div class="card-footer">

                    <form id='sending-form'
style="padding: 15px;" action="#"
method="post" class="form-inline"
enctype="multipart/form-data">
                        <button type="submit"
name="chatSendBtn" id="chatSendBtn" class="btn
btn-primary"
                           
style="position:relative;;background-color:#007bff;margin-top:
0;cursor:<?=
$this->item->session->finish==1?'no-drop':'pointer';?>"
                            <?=
$this->item->session->finish==1?'disabled':'';?>
>
                            ارسال
                            <div id="loading"
class="spinner-grow text-warning" role="status">
                                <span
class="sr-only">Loading...</span>
                            </div>
                        </button>
                        <input type="text"
style="flex-grow: 2" class="form-control mr-1"
name="chatMessage" id="chatMessage" required
placeholder="پیام خود را وارد کنید ...">
						<input name="atachedfile" id='atachedfile'
type="file" />
						<progress style="display: none;"></progress>
                    </form>

                </div>
            </div>

        </div>
    </div>
	<script>
    var filename = '';
    var delayInMilliseconds = 1500; //1 second
	jQuery(':file').on('change', function () {
        var file = this.files[0];
        filename = file.name;
        // if (file.size > 10240) {
        //   alert('max upload size is 10k');
        // }

        // Also see .name, .type
        console.log(file);
        console.log('filetype', file.type);
	});
    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }
	jQuery('#chatSendBtn').on('click', function () {
        var _this= jQuery(this);
        var formdata = new FormData(jQuery('#sending-form')[0]);
        // formdata.append('atachedfile',
document.getElementById('atachedfile').files[0]);
        console.log(formdata);
        jQuery.ajax({
            // Your server script to process the upload
            url:
'/components/com_reservation/controllers/fileupload.php',
            type: 'POST',

            // Form data
            data: formdata,

            // Tell jQuery not to process data or worry about content-type
            // You *must* include these options!
            cache: false,
            contentType: false,
            processData: false,



            // dataType: "JSON",
            beforeSend: function () {
                //Your functions before send AJAX Request
            },
            success: function (feedback) {
                //Your functions after AJAX Request Success
            },
            error: function (error) {
                console.log(error);
            },
		
		

            // Custom XMLHttpRequest
            xhr: function () {
                console.log('--------test-------');
                var myXhr = jQuery.ajaxSettings.xhr();
                if (myXhr.upload) {
                    // For handling the progress of the upload

                    myXhr.upload.addEventListener('progress',
function (e) {
                        
                        // console.log(e.loaded, e.total);
                        if (e.lengthComputable) {
                            jQuery('progress').show();
                            jQuery('progress').attr({
                                value: e.loaded,
                                max: e.total,
                            });
                           
jQuery('#chatSendBtn').css('cursor','no-drop');
                           
jQuery('#chatSendBtn').prop('disabled', true);
                            if(e.loaded == e.total) {
                               
jQuery('#chatSendBtn').css('cursor','pointer');
                               
jQuery('#chatSendBtn').prop('disabled', false);
                                jQuery('progress').hide();
                                //
jQuery('#atachedfile').clearFields();
                                if(filename) {
                                    url =
'/components/com_reservation/files/' + filename;
                                    
                                    
                                    
                                    
                                    sleep(delayInMilliseconds).then(()
=> {
                                        
                                        
                                        ext =
filename.split('.').pop().toLowerCase();
                                        image_ext = ['jpg',
'jpeg', 'png', 'gif', 'bmp',
'jfif', 'pjpeg', 'webp', 'tif',
'tiff'];
                                        var msg = '';
                                        if(image_ext.includes(ext)) {
                                            msg = '<img
src="'+url+'">';
                                        }
                                        else {
                                            msg = '<a
href="'+url+'">' + filename +
'</a>';
                                        }
                                        jQuery.ajax({
                                            url: chatAjaxRoute,
                                            method: 'post',
                                            data:{[token] : '1' ,
task: 'ajax.saveChat', format: 'json'  , raw:
'true', message:msg,from:from,to:to,seid:seid, pid: pid},
                                            success: function (msge) {
                                               
console.log('heeeeeereeeee');
                                                console.log(msge);
                                                console.log(msge.id);
                                                //
$('.chat').find('.card-body').append(' <div
class="pm me">\n' +
                                                    // '              
                 <span class="text">\n' +
                                                    // '              
                  '+message+'\n' +
                                                    // '              
                 </span>\n' +
                                                    // '              
         <br/>\n' +
                                                    // '              
         <span class="time">22:35</span>\n' +
                                                    // '              
     </div>');
                                                
                                                var currentdate = new
Date(); 
                                                tt =
currentdate.toLocaleString().split(' ');
                                                
                                               
jQuery('.chat').find('.card-body').append('<div
class="pm me pm-' + msge.id + '">\n' +
                                                '             
<span class="text">\n' +
                                                                  msg +
'\n' +
                                                '             
</span>\n' +
                                                '             
<span id="readtick">✓</span>\n' +
                                                '             
<br/>\n' +
                                                '    <span
class="time">' + tt[1] + ' ' + tt[2] +
'</span>\n' +
                                                '                     
            </div>');
                                                       
_this.next('#chatMessage').val('');
                                                var chatBoxBody =
jQuery('.chat .card-body')[0];
                                                //
scrollToEnd(chatBoxBody);
                                                // hideLoading(_this);
                                              //
$('#chatSendBtn').prop('disabled', false);
                                            },
                                            error: function (err) {
                                                console.log(err);
                                            }

                                        });
                                       
jQuery('#atachedfile').val('');
                                        filename = '';
                                    });
                                
                                }
                                
                            }
                        }
                    }, false);
                }
                return myXhr;
            }
	  });
      
        var token = jQuery("#token").attr("name");
        var chatAjaxRoute= Joomla.getOptions('chatAjaxRoute');
        var from= Joomla.getOptions('userId');
        var to= Joomla.getOptions('to');
        var seid= Joomla.getOptions('seid');
        var pid= Joomla.getOptions('pid');
        var channel_token= Joomla.getOptions('channel_token');
        var url = '/components/com_reservation/files/' +
filename;

        ext = filename.split('.').pop();
        image_ext = ['jpg', 'jpeg', 'png',
'gif', 'bmp', 'jfif', 'pjpeg',
'webp', 'tif', 'tiff'];
        var msg = '';
        if(image_ext.includes(ext)) {
            msg = '<img
src="'+url+'">';
        }
        else {
            msg = '<a href="'+url+'">'
+ filename + '</a>';
        }
    // sleep(delayInMilliseconds).then(() => {
        // console.log('heeeloooooooo');
    // }
        
      
	});
	</script>
    <input type="hidden" name="<?=
JSession::getFormToken();?>" id="token">
	
</div><!--[/JCBGUI$$$$]-->

PKAc�[b�/@/@tmpl/default.php.bak3nu�[���<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			11th February, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

$clip='<svg xmlns="http://www.w3.org/2000/svg"
version="1.0" width="25px" height="25px"
viewBox="0 0 400.000000 448.000000"
preserveAspectRatio="xMidYMid meet" style="&#10;   
fill: #a5a5a5"><g transform="translate(0.000000,448.000000)
scale(0.100000,-0.100000)" fill="inherit"
stroke="none"><path d="M2620 4465 c-179 -30 -330 -90
-477 -188 -87 -58 -206 -174 -1037 -1006 l-940 -940 -3 -58 c-5 -68 16 -111
69 -143 37 -22 107 -27 141 -9 12 6 434 422 937 924 556 554 941 930 981 958
164 115 328 169 514 169 147 -1 241 -22 370 -86 332 -163 529 -488 512 -841
-8 -164 -52 -291 -155 -450 -64 -100 -2284 -2324 -2390 -2395 -220 -148 -495
-113 -683 87 -174 187 -195 439 -53 653 30 45 385 407 1171 1192 1193 1192
1146 1148 1234 1148 45 0 122 -46 152 -92 29 -46 37 -121 16 -175 -5 -16 -410
-428 -919 -938 -992 -993 -944 -940 -919 -1030 14 -51 65 -102 112 -110 94
-18 34 -71 1010 903 494 493 919 926 944 961 150 207 128 458 -57 641 -164
163 -375 195 -585 87 -51 -26 -224 -195 -1217 -1186 -1209 -1208 -1208 -1207
-1274 -1358 -92 -207 -89 -487 5 -690 43 -91 100 -170 177 -244 117 -111 236
-179 389 -220 118 -32 319 -32 430 -1 94 27 198 78 275 134 80 59 2347 2330
2409 2413 75 101 166 290 196 409 110 436 -16 869 -342 1176 -263 248 -643
365 -993 305z"/></g></svg>';
$send='<svg xmlns="http://www.w3.org/2000/svg"
version="1.0" width="25px" height="25px"
viewBox="0 0 448.000000 396.000000"
preserveAspectRatio="xMidYMid meet" style=" fill: #238ff3;
"> <g transform="translate(0.000000,396.000000)
scale(0.100000,-0.100000)" fill="inherit"
stroke="none"> <path d="M285 3946 c-110 -27 -202 -105
-252 -211 l-28 -60 0 -585 0 -585 27 -57 c47 -101 137 -178 243 -207 22 -6
436 -63 920 -126 484 -64 893 -119 909 -123 19 -5 -251 -43 -815 -116 -464
-59 -886 -114 -937 -122 -157 -23 -261 -95 -320 -222 l-27 -57 0 -595 0 -595
27 -57 c73 -156 239 -247 399 -218 43 8 567 229 1708 722 905 390 1756 758
1891 815 135 58 265 120 290 138 100 70 155 180 154 305 -2 109 -31 179 -108
256 l-61 60 -1900 814 c-1045 447 -1925 819 -1955 826 -66 16 -99 16 -165
0z"></path> </g> </svg>';
?>
<?php echo $this->toolbar->render(); ?>

<!--[JCBGUI.site_view.default.26.$$$$]-->
<!--<link
href="http://hayageek.github.io/jQuery-Upload-File/4.0.11/uploadfile.css"
rel="stylesheet">
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script
src="http://hayageek.github.io/jQuery-Upload-File/4.0.11/jquery.uploadfile.min.js"></script>
-->
<div class="chat">
    <div class="row justify-content-center">
        <div class="col-md-8">

            <div class="card">
                <div class="card-header">
                  <div style="position: absolute; right:
1%;">

                      <?php
if($this->item->session->finish==0):?>
                          <p id="notice" class="alert
alert-info">گفتگو در حال انجام است</p>
                      <?php else:?>
                         <p id="notice" class="alert
alert-info">گفتگو خاتمه یافت</p>
                      <?php endif; ?>


                      <?php if(empty($this->item->msn)):?>

                          <?php
if($this->item->session->finish==0):?>
                              <button id="conversation"
class="btn btn-sm btn-danger">پایان گفتگو
                                  <div id="loading"
class="spinner-grow text-warning" role="status">
                                      <span
class="sr-only">Loading...</span>
                                  </div>
                              </button>
                          <?php else:?>
                              <button id="conversation"
class="btn btn-sm btn-success " style="position: absolute;
right: 1%;">ادامه گفتگو
                                  <div id="loading"
class="spinner-grow text-warning" role="status">
                                      <span
class="sr-only">Loading...</span>
                                  </div>
                              </button>
                          <?php endif; ?>

                      <?php endif;?>
                  </div>
                    <p><?php echo $this->item->users_name;
?></p>
                    <a class="img" href="#">
                        <img
src="/joomla/templates/mytemp/assets/images/farzad.jpg"
alt="">
                    </a>
                </div>
                <div class="card-body"
id="chat-body">
                    <?php //dump($this->item->messages,
'messages');?>
                    <?php foreach($this->item->messages as
$message):?>

                        <div class="pm <?=
($message->from!=$this->item->users_id)? 'me':
'';?>" id="pm-<?php echo
$message->id?>">
                            <div class="text">
                                <span>
                                    <?= $message->message;?>
                                </span>
                                <div class="info-message">
                                    <span class='readtick <?php
echo $message->read ? 'read' :
'unread';?>'>  </span>
                                    <span
class="time"><?php echo strftime('%I:%M:%S %p',
strtotime($message->created)); ?></span>
                                </div>
                            </div>
                        </div>

                    <?php endforeach;?>
<!--                    <div class="pm me">-->
<!--                                <span
class="text">-->
<!--                                  سلام-->
<!--                                </span>-->
<!--                        <br/>-->
<!--                        <span
class="time">22:35</span>-->
<!--                    </div>-->
<!--                    <div class="pm">-->
<!--                                 <span
class="text">-->
<!--                                  علیک سلام-->
<!--                                </span>-->
<!--                        <br/>-->
<!--                        <span
class="time">22:36</span>-->
<!--                    </div>-->
                </div>
                <div class="">

                    <form id='sending-form'
action="#" method="post" class="form-inline"
enctype="multipart/form-data">
                        <button type="submit"
name="chatSendBtn" id="chatSendBtn" class="btn
btn-primary"
                            style="cursor:<?=
$this->item->session->finish==1?'no-drop':'pointer';?>"
                            <?=
$this->item->session->finish==1?'disabled':'';?>
>
                                <?php echo $send; ?>
                            <div id="loading"
class="spinner-grow text-warning" role="status">
                                <span
class="sr-only">Loading...</span>
                            </div>
                        </button>
                        <input title="در این قسمت
میتوانید پیام خود را وارد کنید"
type="text" style="flex-grow: 2"
class="form-control mr-1" name="chatMessage"
id="chatMessage" required placeholder="پیام خود را
وارد کنید ...">
                        <label id="upload_file"
for="atachedfile">
                            <?php echo $clip; ?>
                        </label>
						<input name="atachedfile" id='atachedfile'
type="file" />
						<progress style="display: none;"></progress>
                    </form>

                </div>
            </div>

        </div>
    </div>
	<script>
    var filename = '';
    var delayInMilliseconds = 1500; //1 second
	jQuery(':file').on('change', function () {
        var file = this.files[0];
        filename = file.name;
        // if (file.size > 10240) {
        //   alert('max upload size is 10k');
        // }

        // Also see .name, .type
        console.log(file);
        console.log('filetype', file.type);
	});
    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }
	jQuery('#chatSendBtn').on('click', function () {
        var _this= jQuery(this);
        var formdata = new FormData(jQuery('#sending-form')[0]);
        // formdata.append('atachedfile',
document.getElementById('atachedfile').files[0]);
        console.log(formdata);
        jQuery.ajax({
            // Your server script to process the upload
            url:
'/components/com_reservation/controllers/fileupload.php',
            type: 'POST',

            // Form data
            data: formdata,

            // Tell jQuery not to process data or worry about content-type
            // You *must* include these options!
            cache: false,
            contentType: false,
            processData: false,



            // dataType: "JSON",
            beforeSend: function () {
                //Your functions before send AJAX Request
            },
            success: function (feedback) {
                //Your functions after AJAX Request Success
            },
            error: function (error) {
                console.log(error);
            },
		
		

            // Custom XMLHttpRequest
            xhr: function () {
                console.log('--------test-------');
                var myXhr = jQuery.ajaxSettings.xhr();
                if (myXhr.upload) {
                    // For handling the progress of the upload

                    myXhr.upload.addEventListener('progress',
function (e) {
                        
                        // console.log(e.loaded, e.total);
                        if (e.lengthComputable) {
                            jQuery('progress').show();
                            jQuery('progress').attr({
                                value: e.loaded,
                                max: e.total,
                            });
                           
jQuery('#chatSendBtn').css('cursor','no-drop');
                           
jQuery('#chatSendBtn').prop('disabled', true);
                            if(e.loaded == e.total) {
                               
jQuery('#chatSendBtn').css('cursor','pointer');
                               
jQuery('#chatSendBtn').prop('disabled', false);
                                jQuery('progress').hide();
                                //
jQuery('#atachedfile').clearFields();
                                if(filename) {
                                    url =
'/components/com_reservation/files/' + filename;
                                    
                                    
                                    
                                    
                                    sleep(delayInMilliseconds).then(()
=> {
                                        
                                        
                                        ext =
filename.split('.').pop().toLowerCase();
                                        image_ext = ['jpg',
'jpeg', 'png', 'gif', 'bmp',
'jfif', 'pjpeg', 'webp', 'tif',
'tiff'];
                                        var msg = '';
                                        if(image_ext.includes(ext)) {
                                            msg = '<img
src="'+url+'">';
                                        }
                                        else {
                                            msg = '<a
href="'+url+'">' + filename +
'</a>';
                                        }
                                        jQuery.ajax({
                                            url: chatAjaxRoute,
                                            method: 'post',
                                            data:{[token] : '1' ,
task: 'ajax.saveChat', format: 'json'  , raw:
'true', message:msg,from:from,to:to,seid:seid, pid: pid},
                                            success: function (msge) {
                                               
console.log('heeeeeereeeee');
                                                console.log(msge);
                                                console.log(msge.id);
                                                //
$('.chat').find('.card-body').append(' <div
class="pm me">\n' +
                                                    // '              
                 <span class="text">\n' +
                                                    // '              
                  '+message+'\n' +
                                                    // '              
                 </span>\n' +
                                                    // '              
         <br/>\n' +
                                                    // '              
         <span class="time">22:35</span>\n' +
                                                    // '              
     </div>');
                                                
                                                var currentdate = new
Date(); 
                                                tt =
currentdate.toLocaleString().split(' ');
                                                
                                               
jQuery('.chat').find('.card-body').append('<div
class="pm me" id="pm-' + msge.id +
'"><span class="text">' + msg  +
'</span><span class="readtick
unread"></span><br/><span
class="time">' + tt[1] + ' ' + tt[2] +
'</span></div>');
                                                       
_this.next('#chatMessage').val('');
                                                var chatBoxBody =
jQuery('.chat .card-body')[0];
                                                //
scrollToEnd(chatBoxBody);
                                                // hideLoading(_this);
                                              //
$('#chatSendBtn').prop('disabled', false);
                                            },
                                            error: function (err) {
                                                console.log(err);
                                            }

                                        });
                                       
jQuery('#atachedfile').val('');
                                        filename = '';
                                    });
                                
                                }
                                
                            }
                        }
                    }, false);
                }
                return myXhr;
            }
	  });
      
        var token = jQuery("#token").attr("name");
        var chatAjaxRoute= Joomla.getOptions('chatAjaxRoute');
        var from= Joomla.getOptions('userId');
        var to= Joomla.getOptions('to');
        var seid= Joomla.getOptions('seid');
        var pid= Joomla.getOptions('pid');
        var channel_token= Joomla.getOptions('channel_token');
        var url = '/components/com_reservation/files/' +
filename;

        ext = filename.split('.').pop();
        image_ext = ['jpg', 'jpeg', 'png',
'gif', 'bmp', 'jfif', 'pjpeg',
'webp', 'tif', 'tiff'];
        var msg = '';
        if(image_ext.includes(ext)) {
            msg = '<img
src="'+url+'">';
        }
        else {
            msg = '<a href="'+url+'">'
+ filename + '</a>';
        }
    // sleep(delayInMilliseconds).then(() => {
        // console.log('heeeloooooooo');
    // }
        
      
	});
	</script>
    <input type="hidden" name="<?=
JSession::getFormToken();?>" id="token">
	
</div><!--[/JCBGUI$$$$]-->


<style>



</style>
PKAc�[r�˭+�+tmpl/default.php.bak4nu�[���<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.36
	@build			23rd February, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		default.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');


?>
<?php echo $this->toolbar->render(); ?>

<!--[JCBGUI.site_view.default.26.$$$$]-->
<!--<link
href="http://hayageek.github.io/jQuery-Upload-File/4.0.11/uploadfile.css"
rel="stylesheet">
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script
src="http://hayageek.github.io/jQuery-Upload-File/4.0.11/jquery.uploadfile.min.js"></script>
-->
<div class="chat">
    <div class="row justify-content-center">
        <div class="col-md-8">

            <div class="card">
                <div class="card-header">
                  <div style="position: absolute; right:
1%;">

                      <?php
if($this->item->session->finish==0):?>
                          <p id="notice" class="alert
alert-info">گفتگو در حال انجام است</p>
                      <?php else:?>
                         <p id="notice" class="alert
alert-info">گفتگو خاتمه یافت</p>
                      <?php endif; ?>


                      <?php if(empty($this->item->msn)):?>

                          <?php
if($this->item->session->finish==0):?>
                              <button id="conversation"
class="btn btn-sm btn-danger">پایان گفتگو
                                  <div id="loading"
class="spinner-grow text-warning" role="status">
                                      <span
class="sr-only">Loading...</span>
                                  </div>
                              </button>
                          <?php else:?>
                              <button id="conversation"
class="btn btn-sm btn-success " style="position: absolute;
right: 1%;">ادامه گفتگو
                                  <div id="loading"
class="spinner-grow text-warning" role="status">
                                      <span
class="sr-only">Loading...</span>
                                  </div>
                              </button>
                          <?php endif; ?>

                      <?php endif;?>
                  </div>
                    <p><?php echo $this->item->users_name;
?></p>
                    <a class="img" href="#">
                        <img
src="/joomla/templates/mytemp/assets/images/farzad.jpg"
alt="">
                    </a>
                </div>
                <div class="card-body">
                    
                    <?php foreach($this->item->messages as
$message):?>

                        <div class="pm <?=
($message->from!=$this->item->users_id)? 'me':
'';?>">
                                    <span class="text">
                                      <?= $message->message;?>
                                    </span>
                            <br/>
                            <span
class="time">22:35</span>
                        </div>

                    <?php endforeach;?>
<!--                    <div class="pm me">-->
<!--                                <span
class="text">-->
<!--                                  سلام-->
<!--                                </span>-->
<!--                        <br/>-->
<!--                        <span
class="time">22:35</span>-->
<!--                    </div>-->
<!--                    <div class="pm">-->
<!--                                 <span
class="text">-->
<!--                                  علیک سلام-->
<!--                                </span>-->
<!--                        <br/>-->
<!--                        <span
class="time">22:36</span>-->
<!--                    </div>-->
                </div>
                <div class="card-footer">

                    <form id='sending-form'
style="padding: 15px;" action="#"
method="post" class="form-inline"
enctype="multipart/form-data">
                        <button type="submit"
name="chatSendBtn" id="chatSendBtn" class="btn
btn-primary"
                           
style="position:relative;;background-color:#007bff;margin-top:
0;cursor:<?=
$this->item->session->finish==1?'no-drop':'pointer';?>"
                            <?=
$this->item->session->finish==1?'disabled':'';?>
>
                            ارسال
                            <div id="loading"
class="spinner-grow text-warning" role="status">
                                <span
class="sr-only">Loading...</span>
                            </div>
                        </button>
                        <input type="text"
style="flex-grow: 2" class="form-control mr-1"
name="chatMessage" id="chatMessage" required
placeholder="پیام خود را وارد کنید ...">
						<input name="atachedfile" id='atachedfile'
type="file" />
						<progress style="display: none;"></progress>
                    </form>

                </div>
            </div>

        </div>
    </div>
	<script>
    var filename = '';
	jQuery(':file').on('change', function () {
        var file = this.files[0];
        filename = file.name;
        // if (file.size > 10240) {
        //   alert('max upload size is 10k');
        // }

        // Also see .name, .type
	});
	jQuery('#chatSendBtn').on('click', function () {
        var formdata = new FormData(jQuery('#sending-form')[0]);
        formdata.append('atachedfile',
document.getElementById('atachedfile').files[0]);
        console.log(formdata);
        jQuery.ajax({
            // Your server script to process the upload
            url:
'/components/com_reservation/controllers/fileupload.php',
            type: 'POST',

            // Form data
            data: formdata,

            // Tell jQuery not to process data or worry about content-type
            // You *must* include these options!
            cache: false,
            contentType: false,
            processData: false,



            // dataType: "JSON",
            beforeSend: function () {
                //Your functions before send AJAX Request
            },
            success: function (feedback) {
                //Your functions after AJAX Request Success
            },
            error: function (error) {
                console.log(error);
            },
		
		

            // Custom XMLHttpRequest
            xhr: function () {
                console.log('--------test-------');
                var myXhr = jQuery.ajaxSettings.xhr();
                if (myXhr.upload) {
                    // For handling the progress of the upload

                    myXhr.upload.addEventListener('progress',
function (e) {
                        
                        // console.log(e.loaded, e.total);
                        if (e.lengthComputable) {
                            jQuery('progress').show();
                            jQuery('progress').attr({
                                value: e.loaded,
                                max: e.total,
                            });
                            if(e.loaded == e.total) {
                                jQuery('progress').hide();
                                //
jQuery('#atachedfile').clearFields();
                               
jQuery('#atachedfile').val('');
                                
                                url =
'/components/com_reservation/files/' + filename;
                               
jQuery('.chat').find('.card-body').append('<div
class="pm me">\n' +
                                    '                                 
  <span class="text">\n' +
                                    '                                 
    <a href="'+url+'">' + filename +
'</a>\n' +
                                    '                                 
  </span>\n' +
                                    '                                 
  <br/>\n' +
                                    '                                 
  <span class="time">22:35</span>\n' +
                                    '                                 
</div>');
                                
                            }
                        }
                    }, false);
                }
                return myXhr;
            }
	  });
      
      var token = $("#token").attr("name");
      var chatAjaxRoute= Joomla.getOptions('chatAjaxRoute');
      var from= Joomla.getOptions('userId');
      var to= Joomla.getOptions('to');
      var seid= Joomla.getOptions('seid');
      var pid= Joomla.getOptions('pid');
      var channel_token= Joomla.getOptions('channel_token');
      var url = '/components/com_reservation/files/' + filename;
      var msg = '<a href="'+url+'">' +
filename + '</a>';
      jQuery.ajax({
        url: chatAjaxRoute,
            method: 'post',
            data:{[token] : '1' , task:
'ajax.saveChat', format: 'json'  , raw:
'true', message:msg,from:from,to:to,seid:seid, pid: pid},
            success: function (msg) {
                console.log('heeeeeereeeee');
                console.log(msg);
                //
$('.chat').find('.card-body').append(' <div
class="pm me">\n' +
                    // '                                <span
class="text">\n' +
                    // '                                
'+message+'\n' +
                    // '                               
</span>\n' +
                    // '                        <br/>\n' +
                    // '                        <span
class="time">22:35</span>\n' +
                    // '                    </div>');


                _this.next('#chatMessage').val('');
                var chatBoxBody = $('.chat .card-body')[0];
                scrollToEnd(chatBoxBody);
                hideLoading(_this);
              $('#chatSendBtn').prop('disabled',
false);
            },
            error: function (err) {
                console.log(err);
            }

        });
      
	});
	</script>
    <input type="hidden" name="<?=
JSession::getFormToken();?>" id="token">
	
</div><!--[/JCBGUI$$$$]-->

PKAc�[>�!:��tmpl/default.xmlnu�[���<?xml
version="1.0" encoding="utf-8" ?>
<metadata>
	<layout title="COM_RESERVATION_MENU_MESSAGES_TITLE"
option="COM_RESERVATION_MENU_MESSAGES_OPTION">
		<message>
			<![CDATA[COM_RESERVATION_MENU_MESSAGES_DESC]]>
		</message>
	</layout>
</metadata>PKAc�[�#o,,tmpl/index.htmlnu�[���<html><body
bgcolor="#FFFFFF"></body></html>PKAc�[�I@
view.html.phpnu�[���<?php
/*----------------------------------------------------------------------------------|
 www.vdm.io  |----/
				fdsh 
/-------------------------------------------------------------------------------------------------------/

	@version		1.0.39
	@build			4th April, 2023
	@created		17th December, 2020
	@package		Reservation
	@subpackage		view.html.php
	@author			farhad shahbazi <http://farhad.com>	
	@copyright		Copyright (C) 2015. All Rights Reserved
	@license		GNU/GPL Version 2 or later -
http://www.gnu.org/licenses/gpl-2.0.html
  ____  _____  _____  __  __  __      __       ___  _____  __  __  ____ 
_____  _  _  ____  _  _  ____ 
 (_  _)(  _  )(  _  )(  \/  )(  )    /__\     / __)(  _  )(  \/  )(  _ \( 
_  )( \( )( ___)( \( )(_  _)
.-_)(   )(_)(  )(_)(  )    (  )(__  /(__)\   ( (__  )(_)(  )    (  )___/
)(_)(  )  (  )__)  )  (   )(  
\____) (_____)(_____)(_/\/\_)(____)(__)(__)   \___)(_____)(_/\/\_)(__) 
(_____)(_)\_)(____)(_)\_) (__) 

/------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * Reservation View class for the Messages
 */
class ReservationViewMessages extends JViewLegacy
{
	// Overwriting JView display method
	function display($tpl = null)
	{		
		// get combined params of both component and menu
		$this->app = JFactory::getApplication();
		$this->params = $this->app->getParams();
		$this->menu = $this->app->getMenu()->getActive();
		// get the user object
		$this->user = JFactory::getUser();
		// Initialise variables.
		$this->item = $this->get('Item');

		// Set the toolbar
		$this->addToolBar();

		// set the document
		$this->_prepareDocument();

		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			throw new Exception(implode(PHP_EOL, $errors), 500);
		}

		parent::display($tpl);
	}

	/**
	 * Prepares the document
	 */
	protected function _prepareDocument()
	{

		// always make sure jquery is loaded.
		JHtml::_('jquery.framework');
		// Load the header checker class.
		require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php'
);
		// Initialize the header checker.
		$HeaderCheck = new reservationHeaderCheck;

		// always load these files.
		$this->document->addScript(JURI::root(true) .
"/media/com_reservation/pusher/js/pusher.min.js",
(ReservationHelper::jVersion()->isCompatible("3.8.0")) ?
array("version" => "auto") :
"text/javascript");

		// Add View JavaScript File
		$this->document->addScript(JURI::root(true) .
"/components/com_reservation/assets/js/messages.js",
(ReservationHelper::jVersion()->isCompatible("3.8.0")) ?
array("version" => "auto") :
"text/javascript");
		
		/***[JCBGUI.site_view.php_document.26.$$$$]***/
				$user= JFactory::getUser()->get('id');
		        $to= $this->item->users_id;
		        $chatAjaxRoute=
JRoute::_('index.php?option=com_reservation&view=messages');
		
				$seid= JFactory::getApplication()->input->get('seid');
		        $pid=
JFactory::getApplication()->input->get('pid');
		        $uid=
JFactory::getApplication()->input->get('uid');
				$channel_Token= $this->get('PrivateChannelToken');
		                
				$this->document->addScriptOptions('seid',$seid);
				$this->document->addScriptOptions('channel_token',$channel_Token);
		
		       
$this->document->addScriptOptions('userId',$user);
				$this->document->addScriptOptions('pid',$pid);
		       
$this->document->addScriptOptions('chatAjaxRoute',$chatAjaxRoute);
				$this->document->addScriptOptions('uid',$uid);
		       
$this->document->addScriptOptions('to',$to);/***[/JCBGUI$$$$]***/
		 
		// add the document default css file
		$this->document->addStyleSheet(JURI::root(true)
.'/components/com_reservation/assets/css/messages.css',
(ReservationHelper::jVersion()->isCompatible('3.8.0')) ?
array('version' => 'auto') : 'text/css');
	}

	/**
	 * Setting the toolbar
	 */
	protected function addToolBar()
	{

		// set help url for this view if found
		$help_url = ReservationHelper::getHelpUrl('messages');
		if (ReservationHelper::checkString($help_url))
		{
			JToolbarHelper::help('COM_RESERVATION_HELP_MANAGER', false,
$help_url);
		}
		// now initiate the toolbar
		$this->toolbar = JToolbar::getInstance();
	}

	/**
	 * Escapes a value for output in a view script.
	 *
	 * @param   mixed  $var  The output to escape.
	 *
	 * @return  mixed  The escaped value.
	 */
	public function escape($var, $sorten = false, $length = 40)
	{
		// use the helper htmlEscape method instead.
		return ReservationHelper::htmlEscape($var, $this->_charset, $sorten,
$length);
	}
}
PKAc�[�#o,,
index.htmlnu�[���PKAc�[�ݗ�>�>ftmpl/default.phpnu�[���PKAc�[�ʝ��7�7�?tmpl/default.php.baknu�[���PKAc�[�;��99�wtmpl/default.php.bak2nu�[���PKAc�[b�/@/@��tmpl/default.php.bak3nu�[���PKAc�[r�˭+�+o�tmpl/default.php.bak4nu�[���PKAc�[>�!:��atmpl/default.xmlnu�[���PKAc�[�#o,,�tmpl/index.htmlnu�[���PKAc�[�I@
view.html.phpnu�[���PK		�R1