[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: custom_section.php
<?php include('header.php'); ?> <script src="tinymce/tinymce.min.js"></script> <script>tinymce.init({ selector:'textarea' });</script> <?php $count=1; $sr='custom_banner'; $stmt =$show->readAll($sr); $num = $stmt->rowCount(); if($num>0){ while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){ $img1=$row['custom_image1']==NULL?"noimg.png":$row['custom_image1']; $img2=$row['custom_image2']==NULL?"noimg.png":$row['custom_image2']; $url1=$row['url1']==NULL?'':$row['url1']; $url2=$row['url2']==NULL?'':$row['url2']; $main_title=$row['main_title']==NULL?'':$row['main_title']; $first_title=$row['first_title']==NULL?'':$row['first_title']; $second_title=$row['second_title']==NULL?'':$row['second_title']; } }?> <!-- page-wrapper --> <div id="page-wrapper"> <div class="row"> <div class="col-md-12"> <!-- Form Elements --> <div class="panel panel-default"> <div class="panel-heading"> First Section-> Edit </div> <div class="panel-body"> <div class="row"> <div class="col-lg-12"> <form role="form" method="post" enctype="multipart/form-data"> <div class="form-group"> <label>Main Title</label> <input type="text" name="main_title" value="<?=$main_title?>" placeholder="Main Title" class="form-control"> </div> <div class="form-group"> <label>Image 1</label> <span class="note">Note :For Best fit please try to upload following resolution :width : 900px height : 650px.Max File size:200kb.</span> <input type="file" name="img1" placeholder="banner" id="img1" onchange="return fileValidation('img1','200')"> <img src="<?=$pic_img?>/<?=$img1?>" width="200px" > <input type="hidden" value="<?=$img1?>" name="img_1"> </div> <div class="form-group"> <label>First Title</label> <input type="text" name="first_title" value="<?=$first_title?>" placeholder="First Title" class="form-control"> </div> <div class="form-group"> <label>Image Link 1</label> <span class="note">The link provided with the image when clicked in front end by customers will redirect according to your choice of page ,site ,social media etc</span> <input type="text" value="<?=$url1?>" name="url1" class="form-control" > </div> <div class="form-group"> <label>Second Title</label> <input type="text" name="second_title" value="<?=$second_title?>" placeholder="Second Title" class="form-control"> </div> <div class="form-group"> <label>Image 2</label> <span class="note">Note :For Best fit please try to upload following resolution :width : 900px height : 650px.Max File size:200kb.</span> <input type="file" name="img2" placeholder="banner" id="img2" onchange="return fileValidation('img2','200')" > <img src="<?=$pic_img?>/<?=$img2?>" width="200px" > <input type="hidden" value="<?=$img2?>" name="img_2"> </div> <div class="form-group"> <label>Image Link 2</label> <span class="note">The link provided with the image when clicked in front end by customers will redirect according to your choice of page ,site ,social media etc</span> <input type="text" value="<?=$url2?>" name="url2" class="form-control" > </div> <input type="submit" class="btn btn-primary" name="sub" value="submit"> <button type="reset" class="btn btn-success">Reset Button</button> </form> </div> </div> </div> </div> <!-- End Form Elements --> </div> </div> </div> <?php if(isset($_POST['sub'])){ $s=$show->readAll('custom_banner'); $count_r=$s->rowCount(); if($count_r==0){ if($_FILES['img1']['size'] == 0 && $_FILES['img1']['error'] == 4){ $img1=''; }else{ if(isset($_FILES['img1'])){ $img1=$show->imageEdit($_FILES['img1']['name']); move_uploaded_file($_FILES['img1']['tmp_name'],"../product_img/".$img1); } } if($_FILES['img2']['size'] == 0 && $_FILES['img2']['error'] == 4){ $img2=''; }else{ if(isset($_FILES['img2'])){ $img2=$show->imageEdit($_FILES['img2']['name']); move_uploaded_file($_FILES['img2']['tmp_name'],"../product_img/".$img2); } } $data=array( 'custom_image1'=>$img1, 'custom_image2'=>$img2, 'url1'=>$_POST['url1'], 'url2'=>$_POST['url2'], 'main_title'=>$_POST['main_title'], 'first_title'=>$_POST['first_title'], 'second_title'=>$_POST['second_title'], ); $r1=$show->insert('custom_banner',$data); if($r1){ echo "<script>sweetAlert('OK','Thank you for entering images','success');window.location.href='".$_SERVER['REQUEST_URI']."';</script>"; } }else{ if(file_exists($_FILES['img1']['tmp_name']) || is_uploaded_file($_FILES['img1']['tmp_name'])) { $n_img1=$show->imageEdit($_FILES['img1']['name']); move_uploaded_file($_FILES['img1']['tmp_name'],"../product_img/".$n_img1); }else{ $n_img1=$_POST['img_1']; $n_img2=$_POST['img_2']; } if(file_exists($_FILES['img2']['tmp_name']) || is_uploaded_file($_FILES['img2']['tmp_name'])) { $n_img2=$show->imageEdit($_FILES['img2']['name']); move_uploaded_file($_FILES['img2']['tmp_name'],"../product_img/".$n_img2); }else{ $n_img2=$_POST['img_2']; $n_img1=$_POST['img_1']; } $sq=$con->prepare('update custom_banner set main_title="'.$_POST['main_title'].'",second_title="'.$_POST['second_title'].'",first_title="'.$_POST['first_title'].'",custom_image1="'.$n_img1.'",custom_image2="'.$n_img2.'",url1="'.$_POST['url1'].'",url2="'.$_POST['url2'].'" order by id desc'); $r=$sq->execute(); if($r){ echo "<script>sweetAlert('OK','Thank you for entering images','success');window.location.href='".$_SERVER['REQUEST_URI']."';</script>"; } } } ?> <script src="js/bootstrap-datepicker.js"></script> <script type="text/javascript"> // When the document is ready $(document).ready(function(){ $("#date").datepicker({ format: 'dd-mm-yyyy', }); }); </script> <!--footer--> <?php include('footer.php'); ?>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.58 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619