403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/abricos.chatgpt/admin/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/abricos.chatgpt/admin/chatgpt_log.php
<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_after.php");
$APPLICATION->SetAdditionalCSS("/bitrix/css/main/grid/pagenavigation.css");
$APPLICATION->SetAdditionalCSS("/bitrix/components/bitrix/main.ui.grid/templates/.default/style.css");

if (!CModule::IncludeModule("abricos.chatgpt"))
die;
$APPLICATION->SetTitle(GetMessage("CHATGPT_LOG"));

if($_GET['action']=='in_block')
{
	CAbricosChatgpt::inIblock($_GET['id'],$_GET['id_profile']);
}
if($_GET['action']=='update')
{
	CAbricosChatgptLib::updateInblock($_GET['id'],$_GET['id_profile'],0);
} 
if($_GET['action']=='next')
{
	CAbricosChatgptLib::updateInblock($_GET['id'],$_GET['id_profile'],3);
}

if(CModule::IncludeModuleEx('abricos.chatgpt')==3) echo GetMessage('DEMO_OFF');
 if($_GET['id_profile']>0) 
{

	$countSql = "SELECT COUNT(*) FROM abricos_chatgpt_export WHERE id_profile=".$DB->ForSql($_GET['id_profile']);
$countRes = $DB->Query($countSql);
$total = $countRes->Fetch();
$total = $total['COUNT(*)']; 

$resultsPerPage = isset($_GET['results-per-page']) ? intval($_GET['results-per-page']) : 10;
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$offset = ($page - 1) * $resultsPerPage;	
$numPages = ceil($total/$resultsPerPage);	
	$sort='id';
	$by='DESC';
	if($_GET['sort'])
		$sort=$_GET['sort'];
	if($_GET['by'])
		$by=$_GET['by'];
	$strSql ="SELECT * FROM `abricos_chatgpt_export` where `id_profile`=".$DB->ForSql($_GET['id_profile'])." ORDER BY ".$sort." ".$by;
	$strSql .= " LIMIT ".$offset.", ".$resultsPerPage;
	$strSql .= ";";
$resId = $DB->Query($strSql, false, $err_mess.__LINE__);

	?>
	<style>
	.main-grid-panel-limit .main-grid-panel-content-title {
    position: relative;
    top: 2px;
}
.main-grid-panel-content select{
    height: 34px;
    padding: 4px 10px;
    box-shadow: none;
    color: #6b648b;
	font-weight: 400;
}
.main-grid-panel-content .adm-btn{
    margin: 5px;
    height: 34px;
	padding: 0 20px;
}
	.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-dialog {
  margin: 10% auto;
  width: 50%;
  max-width: 700px;
}

.modal-content {
  background-color: #fefefe;
  padding: 20px;
  border: 1px solid #888;
}

.modal-header {

}

.modal-title {
  margin: 0;
}

.close {
font-size: 28px;
    font-weight: bold;
    border: none;
	float: right;
    width: 40px;
    height: 40px;
    margin-right: 20px;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}
	</style>

	<table class="adm-list-table" id="tbl_sale_order">
<tr class="adm-list-table-header">
<td class="adm-list-table-cell" width='50'><div class="adm-list-table-cell-inner">
<a href="?sort=id_element&by=<?=(($sort=='id_element' and $by=='DESC')?'ASC':'DESC')?>&id_profile=<?=$_GET['id_profile']?>"><?=GetMessage("CHATGPT_LOG_ID")?></a></div>
</td>
<td class="adm-list-table-cell" width='350'><div class="adm-list-table-cell-inner">
<?=GetMessage("CHATGPT_LOG_NAME")?></div>
</td>
<td class="adm-list-table-cell"><div class="adm-list-table-cell-inner">
<?=GetMessage("CHATGPT_IN_IBLOCK")?></div>
</td>
<td class="adm-list-table-cell"><div class="adm-list-table-cell-inner">
<?=GetMessage("CHATGPT_ACTION")?></div>
</td>

</tr>
	
	<?
   while ($ar = $resId->Fetch()) {
	   $action="";
	   $status="";
 if((int)$ar['in_iblock']==1){
	$status=GetMessage("CHATGPT_IN_IBLOCK_1");
    $action="<a href='?id=".$ar['id_element']."&action=in_block&id_profile=".$ar['id_profile']."' class='adm-btn adm-btn-save adm-btn-add'>".GetMessage("CHATGPT_IN_IBLOCK_IN")."</a>"."<br>"."<a href='?id=".$ar['id_element']."&action=update&id_profile=".$ar['id_profile']."' class='adm-btn adm-btn-save'>".GetMessage("CHATGPT_IN_IBLOCK_UPDATE")."</a>";  
 }
  elseif((int)$ar['in_iblock']==2){
	$status=GetMessage("CHATGPT_IN_IBLOCK_2");
    $action="<a href='?id=".$ar['id_element']."&action=update&id_profile=".$ar['id_profile']."' class='adm-btn adm-btn-save'>".GetMessage("CHATGPT_IN_IBLOCK_UPDATE")."</a>";  
 }
   elseif((int)$ar['in_iblock']==3){
	$status=GetMessage("CHATGPT_NEXT");
        $action="<a href='?id=".$ar['id_element']."&action=update&id_profile=".$ar['id_profile']."' class='adm-btn adm-btn-save'>".GetMessage("CHATGPT_NEW")."</a>";  
 }
 else 
 {
   $status=GetMessage("CHATGPT_IN_IBLOCK_0");
   $action="<a href='?id=".$ar['id_element']."&action=next&id_profile=".$ar['id_profile']."' class='adm-btn adm-btn-save adm-btn-add'>".GetMessage("NEXT")."</a>";
 }
?>
<tr class="adm-list-table-row">
<td class="adm-list-table-cell">
<?=$ar['id_element']?>
</td>
<td class="adm-list-table-cell">
<?=CAbricosChatgptLib::getName($ar['id_element'],$id_profile)?>

<br>
<a href="#" class="edit-link" data-id="<?=$ar['id_element']?>"><i><?=GetMessage("CHATGPT_OPEN_TEXT");?></i></a>
<div class="modal" id="edit-modal-<?=$ar['id_element']?>">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
        <p><?=$ar['answer'];?></p>
      </div>
    </div>
  </div>
</div>


</td>
<td class="adm-list-table-cell"><?=$status?>
</td>
<td class="adm-list-table-cell"><?=$action?>
</td></tr>
<?
}
				?>
			</table>
			<div class="main-grid-bottom-panels" >
			<div class="main-grid-nav-panel">
			<div class="main-grid-panel-wrap">
<table class="main-grid-panel-table">
<tr>
<td class="main-grid-panel-cell main-grid-panel-cell-pagination main-grid-cell-left"><div class="main-ui-pagination">
	<div class="main-ui-pagination-pages">
		<div class="main-ui-pagination-label"><?=GetMessage('PAGE')?></div>
		<div class="main-ui-pagination-pages-list">
	<?
		for ($i=1; $i<=$numPages; $i++) {
  if ($i == $page) {
    echo '<span class="main-ui-pagination-page main-ui-pagination-active">'.$i."</span>";
  } else {
    echo "<a href='?id_profile=".$_GET['id_profile']."&sort=".$sort."&by=".$by."&page=".$i."' class='main-ui-pagination-page'>".$i."</a>";
  }
}
?>
</div>
</div>
</td>
<td class="main-grid-panel-cell main-grid-panel-limit main-grid-cell-right">
<span class="main-grid-panel-content">

<form action="<?=$_SERVER['PHP_SELF']?>" method="get">
  <label for="results-per-page" class="main-grid-panel-content-title"><?=GetMessage('IN_PAGE')?></label>
  <select id="results-per-page" name="results-per-page" class="main-dropdown main-grid-popup-control main-grid-panel-select-pagesize">
    <option value="10">10</option>
    <option value="20" <?=($resultsPerPage==20?'selected':'')?>>20</option>
    <option value="50" <?=($resultsPerPage==50?'selected':'')?>>50</option>
  </select>
  <input type='hidden' name='id_profile' value='<?=$_GET['id_profile']?>'>
  <input type='hidden' name='sort' value='<?=$sort?>'>
  <input type='hidden' name='by' value='<?=$by?>'>
  <button type="submit" class='adm-btn '><?=GetMessage('SHOW')?></button>
</form>
</td>

</tr>
</table>
</div>
</div>
</div>
			<?
}else
{?>
<table class="adm-list-table" id="tbl_sale_order">
	<thead>
				<tr class="adm-list-table-header">

			<td class="adm-list-table-cell">
				<div class="adm-list-table-cell-inner">ID</div>
			</td>
			<td class="adm-list-table-cell" >
				<div class="adm-list-table-cell-inner"><?=GetMessage('CES_PROFILE')?></div>
			</td>
			 <td class="adm-list-table-cell">
				<div class="adm-list-table-cell-inner"><?=GetMessage('CES_STATUS')?></div>
			</td>
			<td class="adm-list-table-cell">
				<div class="adm-list-table-cell-inner"><?=GetMessage('CES_OTCHET')?></div>
			</td>

				</tr>
	</thead>
	<tbody>
<?
		global $DB;
		$strSql ="SELECT * FROM `abricos_chatgpt_profile`;";
		$res = $DB->Query($strSql, false, $err_mess.__LINE__);
		while ($row = $res->Fetch())
			{
			?>
			<tr class="adm-list-table-row">
			<td class="adm-list-table-cell"><?=$row['id']?></td>
			<td class="adm-list-table-cell"><?=$row['name_prof']?></td>
			<? if($row['action']=='STOP' or empty($row['action']))
				  $actMesStatus=GetMessage('CES_STOP_EXP');
			  if($row['action']=='START')
				  $actMesStatus=GetMessage('CES_START_EXPORT');
			?>
			<td class="adm-list-table-cell"><?=$actMesStatus?></td>
			<td class="adm-list-table-cell"><a href="?id_profile=<?=$row['id']?>"><?=GetMessage('CES_LOOK_PROFILE')?></a></td>
            </tr>
			<?}?>
             </table>

<?}?>
	<script>
var editLinks = document.querySelectorAll('.edit-link');

editLinks.forEach(function(link) {
  link.addEventListener('click', function(event) {
    event.preventDefault();
    var id = this.getAttribute('data-id');
    var modal = document.getElementById('edit-modal-' + id);
    var modalContent = modal.querySelector('.modal-content');
    var closeBtn = modal.querySelector('.close');
    // ��������� ���������� ��������� ���� �� AJAX-�������
    // � ������ ��� � modalContent.innerHTML
    modal.style.display = 'block';

    closeBtn.addEventListener('click', function() {
      modal.style.display = 'none';
    });

    window.addEventListener('click', function(event) {
      if (event.target == modal) {
        modal.style.display = 'none';
      }
    });
  });
});
	</script>
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_admin.php");
?>

Youez - 2016 - github.com/yon3zu
LinuXploit