OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
creator
/
genai
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
01/21/2025 10:39:45 AM
rwxr-xr-x
📄
genai.php
18.3 KB
01/21/2025 10:39:29 AM
rw-r--r--
📄
genai_article_save.php
1.6 KB
01/21/2025 10:39:29 AM
rw-r--r--
📄
genai_function.php
17.26 KB
01/21/2025 10:39:30 AM
rw-r--r--
📄
genai_save.php
2.13 KB
01/21/2025 10:39:30 AM
rw-r--r--
📄
genai_style.css
4.35 KB
01/21/2025 10:39:31 AM
rw-r--r--
📄
genaicreative.php
18.57 KB
01/21/2025 10:39:28 AM
rw-r--r--
📄
index.php
56.35 KB
01/21/2025 10:39:34 AM
rw-r--r--
📄
process_genai.php
2.02 KB
01/21/2025 10:39:32 AM
rw-r--r--
Editing: genai.php
Close
<!doctype html> <? include '../assets/php/validate.logged.php'; include '../assets/php/function.php'; include '../inc/config.php'; include '../inc/function.php'; $specialIds = [370, 415]; ?> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>GenAI | Knobly Cream: Create • Reach • Measure</title> <!-- jQuery --> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Font Awesome CSS --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.0.0/animate.min.css" /> <link rel="stylesheet" href="inc/fontawesome/css/all.min.css" /> <link rel="stylesheet" href="inc/magnific-popup.css" /> <link rel="stylesheet" href="../assets/css/styles.css" /> <link rel="stylesheet" href="../assets/css/genai_style.css" /> <link rel="icon" type="image/x-icon" href="/img/logo.ico"> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script> <script src="https://cdn.tiny.cloud/1/u5oz235qw5jiqww4udm90ocp9zg2rncblqo2ch0ym3twjgyt/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script> <script src="https://js.zohostatic.com/books/zfwidgets/assets/js/zf-widget.js"></script> <script src="inc/jquery.magnific-popup.min.js"></script> <script src="inc/common.js"></script> <script src="../inc/genai_func.js"></script> <script type="text/javascript"> $(function() { $('#panelContent').load('process/get.section.curated.php', function() { $('#contentLoader').hide() }); }); </script> <style> .newsroll-dropdown { border: none; outline: none; position: relative; display: inline-block; /* display: flex; */ align-items: center; padding-left: 8px; /* border: none; */ padding-bottom: 8px; } .newsroll-dropbtn { border: none; color: rgba(255, 255, 255, 0.5); background-color: #212529; } .newsroll-dropbtn:focus { border: none; outline: none; } .newsroll-dropdown-content { display: none; outline: none; position: relative; background-color: #212529; min-width: 160px; /* box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); */ /* z-index: 1; */ } .newsroll-dropdown-content a { color: white; padding: 12px 16px; text-decoration: none; display: block; } .show { display: block; } .footer { text-align: center; padding: 20px; background-color: black !important; color: #777; position: fixed; bottom: 0; width: 100%; } </style> <style> .reportButton { margin: 2px; /* Adds spacing around each button */ } @media (max-width: 768px) { .button-container { gap: 5px; } .reportButton { margin: 10px 0; } } </style> </head> <body class="sb-nav-fixed"> <?php include '../assets/php/navbar.php' ?> <? include '../assets/php/go_backbar.php' ?> <div id="layoutSidenav"> <main> <div id="panelContent" class="container-fluid col-md-9"> <?php $_SESSION['.generated-text'] = ""; unset($_SESSION['prompt_message']); ?> <script src="inc/genai_func.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <style> .loader { border: 6px solid rgba(0, 0, 0, 0.1); border-left-color: #f58020; border-radius: 50%; width: 35px; height: 35px; animation: spin 1s linear infinite; margin: 0 auto; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> <div id="GenAI-Container"> <div class="container my-4" style="padding-bottom: 4rem;"> <ol class="breadcrumb my-3"> <li class="breadcrumb-item"> <h4 class="m-0">GenAI</h4> </li> </ol> <div class="right"> <!-- Button to redirect to the try creative genai --> <a href="genaicreative.php"> <button class="btn btn-primary gen3">Try Creative</button> </a> </div> <? if ($gUserPlan == 0) { ?> <div class="alert alert-success" role="alert">The <b>GenAI</b> is only available for <b>Pro</b> users! Go to My Account to upgrade.</div> <? } else { ?> <div class="button-bar"> <div class="button-container"> <button id="reportButton1" class="reportButton" value="#reporter" title="Convert the text that follows as a newspaper report"> <i class="fas fa-newspaper dropdown-icon"></i> Report </button> <button id="reportButton2" class="reportButton" value="#tran-ek" title="Convert the text that follows into Kannada language"> <i class="fas fa-exchange-alt dropdown-icon"></i> Tran-ek </button> <button id="reportButton3" class="reportButton" value="#tran-ke" title="Convert the text in Kannada that follows into English language"> <i class="fas fa-exchange-alt dropdown-icon"></i> Tran-ke </button> <button id="reportButton4" class="reportButton" value="#list" title="Respond with HTML entities that can be rendered directly without postprocessing. Add an HTML break entity after each item."> <i class="fas fa-list dropdown-icon"></i> List </button> <button id="reportButton5" class="reportButton" value="#post" title="Convert the text that follows as a social post."> <i class="fas fa-image"></i> Post </button> <button id="reportButton6" class="reportButton" value="#note" title="Convert the text that follows as a note."> <i class="fas fa-sticky-note dropdown-icon"></i> Note </button> <button id="reportButton7" class="reportButton" value="#code" title="Respond with the amazing coding solution."> <i class="fas fa-code dropdown-icon"></i> Code </button> </div> </div> <div class="" style="margin-top: 1rem; margin-bottom: 1rem"> <textarea name="working_headline" placeholder="Enter your working headline..." id="working_headline" class="form-control" rows="2"></textarea> </div> <div class="" style="display: flex; justify-content:space-between"> <div class=""> <button id="submit-btn" class="btn btn-primary">Generate</button> <button id="clear-btn" name="clear" class="btn btn-secondary"><i class="fas fa-eraser"></i> Clear</button> <a id="whatsapp-share-link" href="https://web.whatsapp.com/"> <i class="fab fa-2x fa-whatsapp-square" style="margin-left: 5px;position:relative;top:5px;color:#f58020;"></i> </a> </div> <div class="" style="display: flex; justify-content:end; gap:10px"> <div class="loadingIndicator" style="display: none;"> <div class="loader"></div> </div> <button id="reset-btn" name="reset" class="float-right btn btn-secondary classReset" style="min-width: max-content; max-height:34px"><i class="fas fa-trash-alt"></i> Reset</i></button> </div> </div> <div class="generated-content border bg-[#333] p-3 mt-3" style="display: none;"> <div class="content-show"> <div class="" style="display: flex; justify-content:space-between"> <h5>Generated Content:</h5> </div> <div class="generated-text"> </div> </div> <div class="" style="display: flex; justify-content:right"> <div class="button-content" style="display: flex; justify-content:right"> <button onclick="copyText()" class=" btn btn-warning " style="border: none; background:transparent"> <span> <i class="far fa-copy fa-lg fa-fw"></i> </span> </button> </div> <input class="float-right btn btn-primary" id="saveButton" type="button" value="Save"> </div> </div> <? } ?> </div> </div> <script> // Add click event listeners to all buttons $('.reportButton').click(function() { var value = $(this).val(); var title = $(this).attr('title'); setActiveButton(this.id); }); // Initialize by showing content for the first button var initialValue = $('#reportButton1').val(); var initialTitle = $('#reportButton1').attr('title'); $('#reportButton1').addClass('active-tab'); // Set first button as active initially // Function to generate the content var avatar = ''; $(document).ready(function() { // Check if the div with class 'code-language' is empty if ($.trim($('.code-language').text()) === '') { $('.code-language').hide(); // Hide the div if it's empty } $('#saveButton').click(function() { var generatedText = $('.generated-text').html(); var workingHeadline = $('#working_headline').val(); generatedText = replaceBrWithNewline(generatedText); if (!workingHeadline) { alert("Working Headline cannot be empty.."); return; } // Call genai_save function here genai_save(generatedText, workingHeadline); }); // Function to share through whatsapp $('#whatsapp-share-link').click(function(event) { event.preventDefault(); // Prevent default link behavior // Call the share_whatsapp function when the link is clicked share_whatsapp(); }); $('#submit-btn').click(function() { $('.loadingIndicator').show(); var headline = $('#working_headline').val(); $.ajax({ url: 'process_genai.php', type: 'POST', data: { avatar: avatar, working_headline: headline }, success: function(response) { try { var decodedData = decodeURIComponent(response); } catch { decodedData = response; } decodedData = convert_text(decodedData); $('.generated-text').append(decodedData); $('.generated-text').append('<br><br>'); $(".generated-content").show(); $('.loadingIndicator').hide(); }, error: function() { console.error('AJAX request failed'); alert('Error: Unable to fetch data.'); $('.loadingIndicator').hide(); } }); }); // Click handler for '.reportButton' elements $('.reportButton').click(function() { avatar = $(this).attr('value'); }); // Function for Clear button $('#clear-btn').click(function() { $('#working_headline').val(''); // Clear textarea }); // Function for Reset button $('#reset-btn').click(function() { $.ajax({ url: '/genai/process_genai.php', type: 'POST', data: { action: "reset" }, success: function(response) { if (response == "Ok") { $('#working_headline').val(''); // Clear textarea $('.generated-text').html(''); $('.generated-content').hide(); } }, error: function() { console.error('Error while sending the request'); $('.loadingIndicator').hide(); } }); }); }); </script> </div> </main> </div> <? include '../assets/php/bottom_navbar.php' ?> </body> <script> function newsrollToggleDropdown() { var dropdownContent = document.getElementById("newsrollDropdown"); dropdownContent.classList.toggle("show"); } // Close the dropdown if the user clicks outside of it window.onclick = function(event) { if (!event.target.matches('.newsroll-dropbtn')) { var dropdowns = document.getElementsByClassName("newsroll-dropdown-content"); for (var i = 0; i < dropdowns.length; i++) { var openDropdown = dropdowns[i]; if (openDropdown.classList.contains('show')) { openDropdown.classList.remove('show'); } } } } </script> </html>