Файловый менеджер - Редактировать - /home/lmsyaran/public_html/components/com_reservation/views/messages/tmpl/default.php.bak3
Назад
<?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=" 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>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.02 |
proxy
|
phpinfo
|
Настройка