D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
.trash
/
admin
/
Filename :
about-us.php
back
Copy
<?php include('include/header.php'); $selectsql1 = mysqli_query($conn, "select * from about where id = '1'"); $datasql1 = mysqli_fetch_array($selectsql1); if(isset($_POST['add'])){ $experience = $_POST['experience']; $seo_content = $_POST['seo_content']; $headline = $_POST['headline']; $headline2 = $_POST['headline2']; $inputProductDescription = $_POST['details']; $desc = $_POST['desc']; $replaceArray0 = array( '"' => """, "'" => "'", ); $modifiedText0 = str_replace(array_keys($replaceArray0), array_values($replaceArray0), $inputProductDescription); $replaceArray1 = array( '"' => """, "'" => "'", ); $modifiedText1 = str_replace(array_keys($replaceArray1), array_values($replaceArray1), $desc); // $image_name = $_POST['imageold']; // $image01 = $_FILES['image']['name']; // if(!empty($image01)){ // $image1 = $image_name; // $stmp_name1 = $_FILES['image']['tmp_name']; // move_uploaded_file($stmp_name1, "images/preloaders/".$image1); // }else{ // $image1=$image_name; // } // $image_name2 = $_POST['image2old']; // $image012 = $_FILES['image2']['name']; // if(!empty($image012)){ // $image12 = $image_name2; // $stmp_name12 = $_FILES['image2']['tmp_name']; // move_uploaded_file($stmp_name12, "images/preloaders/".$image12); // }else{ // $image12=$image_name2; // } $uniqe_image1 = $datasql1['image']; $image01 = $_FILES['image']['name']; if(!empty($image01)){ $unique = uniqid()." ".$image01; $image1 = "images/preloaders/".$unique; $stmp_name1 = $_FILES['image']['tmp_name']; move_uploaded_file($stmp_name1, $image1); }else{ $image1=$uniqe_image1; } $uniqe_image2 = $datasql1['image2']; $image02 = $_FILES['image2']['name']; if(!empty($image02)){ $unique2 = uniqid()." ".$image02; $image2 = "images/preloaders/".$unique2; $stmp_name2 = $_FILES['image2']['tmp_name']; move_uploaded_file($stmp_name2, $image2); }else{ $image2=$uniqe_image2; } $uniqe_image3 = $datasql1['image3']; $image03 = $_FILES['image3']['name']; if(!empty($image03)){ $unique3 = uniqid()." ".$image03; $image3 = "images/preloaders/".$unique3; $stmp_name3 = $_FILES['image3']['tmp_name']; move_uploaded_file($stmp_name3, $image3); }else{ $image3=$uniqe_image3; } $uniqe_image4 = $datasql1['image4']; $image04 = $_FILES['image4']['name']; if(!empty($image04)){ $unique4 = uniqid()." ".$image04; $image4 = "images/preloaders/".$unique4; $stmp_name4 = $_FILES['image4']['tmp_name']; move_uploaded_file($stmp_name4, $image4); }else{ $image4=$uniqe_image4; } $sql = "UPDATE `about` SET `experience`='$experience',`headline`='$headline',`details`='$modifiedText0',`image`='$image1',`image2`='$image2',`headline2`='$headline2',`description`='$modifiedText1',`image3`='$image3',`image4`='$image4',`seo_content`='$seo_content' WHERE id = '1'"; // $sqli = "INSERT INTO `about`(`experience`, `headline`, `details`, `image`, `image2`, `image3`, `image4`, `headline2`, `description`) VALUES ('$experience','$headline','$modifiedText0', '$image1', '$image12', '$image3', '$image4', `$headline2`, `$modifiedText1`)"; $data= mysqli_query($conn, $sql); if($data){ echo "<script> alert('Data Updated');window.location.href='about-us.php'</script>"; } else{ echo "<script> alert('Please try again')</script>"; } } ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <div class="container-full"> <!-- Content Header (Page header) --> <div class="content-header"> <div class="d-flex align-items-center"> <div class="me-auto"> <h4 class="page-title">About Us</h4> </div> </div> </div> <?php $selectsql = mysqli_query($conn, "select * from about where id = '1'"); $datasql = mysqli_fetch_array($selectsql); ?> <!-- Main content --> <section class="content"> <div class="box"> <div class="box-header with-border"> <h4 class="box-title">About Us</h4> </div> <!-- /.box-header --> <div class="box-body"> <form role="form" method="POST" enctype="multipart/form-data"> <!-- text input --> <div class="form-group"> <label class="form-label">years experience</label> <input type="text" class="form-control" placeholder="15 years experience" value="<?= $datasql['experience'];?>" name="experience" required> </div> <div class="form-group"> <label class="form-label">Headline</label> <input type="text" class="form-control" placeholder="Headline" value="<?= $datasql['headline'];?>" name="headline" required> </div> <div class="form-group"> <label class="form-label">Details</label><br> <textarea class="form-control" name="details" required><?= $datasql['details'];?></textarea> </div> <div class="form-group"> <label class="form-label">Big Image</label> <input type="file" class="form-control" accept="image/png, image/jpeg, image/jpg" name="image" onchange="ShowImage(event)" > <img src='<?php echo $datasql['image'];?>' height="100px" id="image" /> </div> <div class="form-group"> <label class="form-label">Image</label> <input type="file" class="form-control" accept="image/png, image/jpeg, image/jpg" name="image2" onchange="ShowImage2(event)" > <img src="<?php echo $datasql['image2'];?>" height="100px" id="image2" /> </div> <div class="form-group"> <label class="form-label">Headline 2</label> <input type="text" class="form-control" placeholder="Headline2" value="<?= $datasql['headline2'];?>" name="headline2" required> </div> <div class="form-group"> <label class="form-label">Details 2</label><br> <textarea class="form-control" name="desc" id="editor"><?= $datasql['description'];?></textarea> </div> <div class="form-group"> <label class="form-label">Left Image</label> <input type="file" class="form-control" accept="image/png, image/jpeg, image/jpg" name="image3" onchange="ShowImage3(event)" > <img src="<?php echo $datasql['image3'];?>" height="100px" id="image3" /> </div> <div class="form-group"> <label class="form-label">Right Image</label> <input type="file" class="form-control" accept="image/png, image/jpeg, image/jpg" name="image4" onchange="ShowImage4(event)" > <img src="<?php echo $datasql['image4'];?>" height="100px" id="image4" /> </div> <div class="form-group"> <label class="form-label">SEO Syntax</label> <textarea rows='6' class="form-control" name="seo_content"><?php echo $datasql['seo_content'] ?? '';?></textarea> </div> <span>*Right & Life image resolution should be 596 × 596 OR Same</span> <div class="box-footer"> <button type="submit" value="add" class="btn btn-success" name="add">Update</button> </div> </form> </div> <!-- /.box-body --> </div> </section> <!-- /.content --> </div> </div> <!-- /.content-wrapper --> <link rel="stylesheet" href="https://cdn.ckeditor.com/ckeditor5/42.0.1/ckeditor5.css"> <script type="importmap"> { "imports": { "ckeditor5": "https://cdn.ckeditor.com/ckeditor5/42.0.1/ckeditor5.js", "ckeditor5/": "https://cdn.ckeditor.com/ckeditor5/42.0.1/" } } </script> <script type="module"> import { ClassicEditor, Essentials, Paragraph, Bold, Italic, Font, Alignment, CodeBlock, Code } from 'ckeditor5'; ClassicEditor .create( document.querySelector( '#editor' ), { plugins: [ Essentials, Paragraph, Bold, Italic, Font, CodeBlock, Code, Alignment ], toolbar: [ 'undo', 'redo', '|', 'bold', 'italic', '|', 'fontSize', 'fontFamily', 'fontColor', 'fontBackgroundColor', '|', 'alignment', '|', 'code', 'codeBlock' ] } ) .then( editor => { window.editor = editor; } ) .catch( error => { console.error( error ); } ); </script> <!--<script src="//cdn.ckeditor.com/4.22.1/standard/ckeditor.js"></script>--> <script> CKEDITOR.replace( 'editor'); </script> <?php include('include/footer.php') ?>