JezK
Edit File: foundermsg.php
<?php include('./app/admin_functions.php'); $admin= new admin(); $founderMessage=''; $founderImage=''; if($_SERVER['REQUEST_METHOD'] == "POST") { if($_POST['submit'] == "Save" && isset($_POST['foundermessage'])) { if(trim($_POST['foundermessage']) != '') { $founderMessage=$_POST['foundermessage']; $founderMessage=nl2br($founderMessage); $founderMessage=htmlentities($founderMessage,ENT_QUOTES); if($admin->updateFounderMessage($founderMessage)) { if($_FILES['founderimage'] && $_FILES['founderimage']['size'] != 0 ) { if($admin->updateFounderImage($_FILES['founderimage'])) { $founderdata=$admin->getFounderData(); $founderImage='./uploads/'.$founderdata['founder_image']; echo "<script>alert('Founders Details Updated Successfully.');</script>"; } else { echo "<script>alert('Sorry..! Unable to Upload Founder Image.');</script>"; } } else { $founderdata=$admin->getFounderData(); $founderImage='./uploads/'.$founderdata['founder_image']; echo "<script>alert('Founders Message Updated Successfully.');</script>"; } } else { echo "<script>alert('Sorry..! Failed to Update Founder Message. Please Try Again.');</script>"; } $founderMessage=$_POST['foundermessage']; } } } else { $founderdata=$admin->getFounderData(); $founderMessage=html_entity_decode($founderdata['message'],ENT_QUOTES); $founderImage='./uploads/'.$founderdata['founder_image']; $breaks = array("<br />","<br>","<br/>"); $founderMessage = str_ireplace($breaks, "\r\n", $founderMessage); } $current_page='foundermessage'; $current_heading='Founder Message'; include('header.php'); ?> <script type="text/javascript"> //<![CDATA[ bkLib.onDomLoaded(function() { nicEditors.allTextAreas() }); //]]> </script> <div class='contain'> <!--<h1>Founder Message</h1> <hr>--> <div class="view"> <form name="addgallery_form" class="form col-md-6" method="POST" enctype="multipart/form-data" action="" > <div class=''> <div class="row col-md-6 col-sm-6 col-xs-6 pull-right"> <img class="img-responsive" src='<?php echo $founderImage;?>' alt=''> </div> <br><br> <div class="row col-md-6 col-sm-6 col-xs-6"> <input class="accept-image" name="founderimage" type="file" accept="image/jpeg,image/png,image/jpg"> </div> </div> <br><br> <div class="row form-group col-md-12 col-sm-12 col-xs-12 "> <label for='addimages' class='col-md-6 '>Founder Message</label> <textarea name="foundermessage" id="aboutusmessage" class='profile_pic' style="width: 600px; height: 100px;"><?php echo $founderMessage; ?></textarea> </div> <div class="form-group text-center col-md-12 col-sm-12 col-xs-12"> <input class="btn btn-info" type='submit' name="submit" class='' value='Save'> </div> </form> </div> </div> <hr> <style> </style> <?php include('footer.php'); ?>