-
✘✘✘ WIBUHAX0R1337 ✘✘✘
-
✘
PATCH :
/
home
/
indianstaffing
/
.trash
/
configFQK
/
Jump
/
0-indianstaffing
/
admin
/
Upload File:
files >> /home/indianstaffing/.trash/configFQK/Jump/0-indianstaffing/admin/add-upcoming-events.php
<?php include '../config.php'; include 'include/header.php'; include 'include/sidebar.php'; error_reporting(0); if (empty($_GET['id'])) { if (isset($_POST['submit'])) { $type = array('png', 'jpg', 'jpeg', 'webp', 'svg'); $pdftype = array('pdf', 'ppt'); if (!empty($_FILES['report']['name'])) { $report_file = ImageUpload('report', $pdftype, 'uploads/'); } if (!empty($_FILES['image']['name'])) { $image = ImageUpload('image', $type, 'uploads/'); } $heading = mysqli_real_escape_string($con, $_POST['heading']); $description = mysqli_real_escape_string($con, $_POST['description']); $image = $image; $addedon = mysqli_real_escape_string($con, $_POST['addedon']); $start_time = mysqli_real_escape_string($con, $_POST['start_time']); $end_time = mysqli_real_escape_string($con, $_POST['end_time']); $speakers_profile = serialize(UploadMultipleImage($_FILES['speakers_profile'], 'uploads')); $speakers_name = serialize($_POST['speakers_name']); $speakers_desig = serialize($_POST['speakers_desig']); $linkdin_profile = serialize($_POST['linkdin_profile']); $program = mysqli_real_escape_string($con, $_POST['program']); $sponsors = serialize(UploadMultipleImage($_FILES['sponsors'], 'uploads/events')); $videos = mysqli_real_escape_string($con, $_POST['videos']); $registration_link = mysqli_real_escape_string($con, $_POST['registration_link']); $report = $report_file; $data = array( 'heading' => $heading, 'description' => $description, 'image' => $image, 'added_on' => $addedon, 'start_time' => $start_time, 'end_time' => $end_time, 'speaker_profile' => $speakers_profile, 'speaker_name' => $speakers_name, 'speaker_desig' => $speakers_desig, 'linkdin_profile' => $linkdin_profile, 'program' => $program, 'sponsors_img' => $sponsors, 'videos' => $videos, 'registration_link' => $registration_link, 'event_report' => $report, ); $insert = InsertData('events', $data); // print_r($insert);die; if ($insert) { echo "<script>alert('event data added');window.location.href = 'upcoming-events.php';</script>"; } else { echo "<script>alert('something went wrong please try again');window.location.href = 'upcoming-events.php';</script>"; } } } else { $id = $_GET['id']; $event_data = GetDataByID('events', $id); if (isset($_POST['submit'])) { $exist_speakers = $_POST['speaker_img']; $array2 = UploadMultipleImage($_FILES['speakers_profile'], 'uploads'); $newarray = array(); $array1 = unserialize($event_data->speaker_profile); // $array2 = $_FILES['speakers_profile']['name']; for ($i = 0; $i < count($array2); $i++) { if ($array2[$i] == '') { array_push($newarray, $exist_speakers[$i]); } else { array_push($newarray, $array2[$i]); } } // print_r($newarray);die; $type = array('png', 'jpg', 'jpeg', 'webp', 'svg'); $pdftype = array('pdf', 'ppt'); if (!empty($_FILES['report']['name'])) { $report_file = ImageUpload('report', $pdftype, 'uploads/'); } else { $report_file = $event_data->event_report; } if (!empty($_FILES['image']['name'])) { $image = ImageUpload('image', $type, 'uploads/'); } else { $image = $event_data->image; } if (!empty($_FILES['sponsors']['name'][0])) { $allimgupload = UploadMultipleImage($_FILES['sponsors'],'uploads/events'); $sponsors_img = serialize($allimgupload); // $sponsors_img = ImageUpload('sponsors', $type, 'uploads/'); } else { $sponsors_img = $event_data->sponsors_img; } $heading = mysqli_real_escape_string($con, $_POST['heading']); $description = mysqli_real_escape_string($con, $_POST['description']); $image = $image; $addedon = mysqli_real_escape_string($con, $_POST['addedon']); $start_time = mysqli_real_escape_string($con, $_POST['start_time']); $end_time = mysqli_real_escape_string($con, $_POST['end_time']); $speakers_profile = serialize($newarray); $speakers_name = serialize($_POST['speakers_name']); $speakers_desig = serialize($_POST['speakers_desig']); $linkdin_profile = serialize($_POST['linkdin_profile']); $program = mysqli_real_escape_string($con, $_POST['program']); $sponsors = $sponsors_img; $videos = mysqli_real_escape_string($con, $_POST['videos']); $registration_link = mysqli_real_escape_string($con, $_POST['registration_link']); $report = $report_file; $data = array( 'heading' => $heading, 'description' => $description, 'image' => $image, 'added_on' => $addedon, 'start_time' => $start_time, 'end_time' => $end_time, 'speaker_profile' => $speakers_profile, 'speaker_name' => $speakers_name, 'speaker_desig' => $speakers_desig, 'linkdin_profile' => $linkdin_profile, 'program' => $program, 'sponsors_img' => $sponsors, 'videos' => $videos, 'registration_link' => $registration_link, 'event_report' => $report, ); // print_r($data);die; $insert = UpdateData('events', $data, $id); // print_r($insert);die; if ($insert) { echo "<script>alert('event data updated');window.location.href = 'upcoming-events.php';</script>"; } else { echo "<script>alert('something went wrong please try again');window.location.href = 'upcoming-events.php';</script>"; } } } ?> <style> .form-group { position: relative; } .add_button { position: absolute; top: 0; right: 0; } </style> <!-- 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 Upcoming Events</h1>"; } else { echo "<h1 class='m-0'>Add Upcoming Events</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 Upcoming Events</li>"; } else { echo "<li class='breadcrumb-item active'>Add Upcoming Events</li>"; } ?> </ol> </div><!-- /.col --> </div><!-- /.row --> </div><!-- /.container-fluid --> </div> <!-- /.content-header --> <div class="row"> <div class="col-12 mx-auto"> <form action="" method="POST" enctype="multipart/form-data"> <div class="card-body"> <!-- <?php echo $msg; ?> --> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="sldrhdname">Heading*</label> <input type="text" name="heading" class="form-control" id="sldrhdname" placeholder="Heading" value="<?= $event_data->heading ?>" required> <small><strong>Note: </strong>Max 80 character is allowed</small> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="description">Short Description About Event</label> <textarea type="text" name="description" class="form-control" id="description" placeholder="Description"><?= $event_data->description ?></textarea> <small><strong>Note: </strong>Max 100 character is allowed</small> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="image">Event Cover Image*</label><br> <input type="file" name="image" id="image" class="form-control" value="<?= $event_data->image ?>" <?php if (empty($_GET['id'])) { echo "required"; } ?>><br> <small><strong>Note: </strong>Image Dimension (280px X 280px)</small><br> <?php if (!empty($id)) { ?> <img style="width:150px;" src="<?= $weburl ?>/uploads/<?= $event_data->image ?>" style="width:100px;"> <?php } ?> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="addedon">Event Date*</label> <input type="date" name="addedon" class="form-control" id="addedon" value="<?= $event_data->added_on ?>" required> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="from">Event Start Time*</label> <input type="time" name="start_time" class="form-control" id="from" value="<?= $event_data->start_time ?>" required> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="to">Event End Time*</label> <input type="time" name="end_time" class="form-control" id="to" value="<?= $event_data->end_time ?>" required> </div> </div> </div> <div class="row"> <div class="col-md-12"> <h2 class="text-center"> Key Speakers Details </h2> </div> <div class="col-md-12 speakers_section"> <?php if (!empty($id)) { $count = count(unserialize($event_data->speaker_name)); $speaker_name = unserialize($event_data->speaker_name); $speaker_desig = unserialize($event_data->speaker_desig); $speaker_profile = unserialize($event_data->speaker_profile); $linkdin_profile = unserialize($event_data->linkdin_profile); $delete_speakers = 'speakersid' . $ids; for ($i = 0; $i < $count; $i++) { $delete_speakers = 'speakersid' . $i; ?> <div class="row speakers" id="<?= $delete_speakers ?>"> <div class="col-md-2"> <div class="form-group"> <label for="to"> Profile</label> <input type="file" name="speakers_profile[]" class="form-control" id="" value="<?= $speaker_profile[$i] ?>"> <input type="hidden" value="<?= $speaker_profile[$i] ?>" name="speaker_img[]"> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="to"> Name</label> <input type="text" name="speakers_name[]" class="form-control" id="" value="<?= $speaker_name[$i] ?>"> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="to"> Designation & Company</label> <input type="text" name="speakers_desig[]" class="form-control" id="" value="<?= $speaker_desig[$i] ?>"> </div> </div> <div class="col-md-2"> <div class="form-group"> <label for="to"> Linkdin Profile</label> <input type="text" name="linkdin_profile[]" class="form-control" id="" value="<?= $linkdin_profile[$i] ?>"> </div> </div> <div class="col-md-2"> <button class="btn btn-primary" type="button" onclick="add_speakers()" style="margin-top: 30px;"> <i class="fa fa-plus" aria-hidden="true"></i> </button> <button class="btn btn-danger" type="button" onclick="delete_speakers(<?= $delete_speakers ?>)" style="margin-top: 30px;"> <i class="fa fa-trash" aria-hidden="true"></i> </button> </div> </div> <?php } } else { ?> <div class="row speakers" id="speakersid1"> <div class="col-md-2"> <div class="form-group"> <label for="to"> Profile</label> <input type="file" name="speakers_profile[]" class="form-control" id=""> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="to"> Name</label> <input type="text" name="speakers_name[]" class="form-control" id=""> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="to"> Designation & Company</label> <input type="text" name="speakers_desig[]" class="form-control" id=""> </div> </div> <div class="col-md-2"> <div class="form-group"> <label for="to"> Linkdin Profile</label> <input type="text" name="linkdin_profile[]" class="form-control" id=""> </div> </div> <div class="col-md-2"> <button class="btn btn-primary" type="button" onclick="add_speakers()" style="margin-top: 30px;"> <i class="fa fa-plus" aria-hidden="true"></i> </button> <button class="btn btn-danger" type="button" onclick="delete_speakers()" style="margin-top: 30px;"> <i class="fa fa-trash" aria-hidden="true"></i> </button> </div> </div> <?php } ?> </div> </div> <div class="form-group"> <label for="Program">Progam (Description)</label> <textarea id="summernote" rows="5" name="program" class="form-control"><?= $event_data->program ?></textarea> </div> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label for="sponsors">Sponsors</label> <input type="file" name="sponsors[]" class="form-control" id="sponsors" value="<?= $event_data->sponsors_img ?>" multiple="multiple"> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="sponsors">Videos</label> <input type="text" name="videos" class="form-control" id="sponsors" value="<?= $event_data->videos ?>"> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="sponsors">Event Report</label> <input type="file" name="report" class="form-control" id="sponsors" value="<?= $event_data->event_report ?>"> </div> </div> </div> <div class="form-group"> <label for="sponsors">Registration Link</label> <input type="text" name="registration_link" class="form-control" id="sponsors" value="<?= $event_data->registration_link ?>"> </div> <div> <input type="submit" name="submit" class="btn btn-primary" value="Submit"> </div> </div> </div> <!-- /.card-body --> </form> </div> </div> </div> <script type="text/javascript"> var id = 2; function add_speakers() { var ids = id++; var delete_speakers = 'speakersid' + ids; var div = '<div class="row speakers" id="speakersid' + ids + '">' + '<div class="col-md-2">' + '<div class="form-group">' + '<label for="to"> Profile</label>' + '<input type="file" name="speakers_profile[]" class="form-control" id="">' + '</div>' + '</div>' + '<div class="col-md-3">' + '<div class="form-group">' + '<label for="to"> Name</label>' + '<input type="text" name="speakers_name[]" class="form-control" id="">' + '</div>' + '</div>' + '<div class="col-md-3">' + '<div class="form-group">' + ' <label for="to"> Designation & Company</label>' + ' <input type="text" name="speakers_desig[]" class="form-control" id="">' + '</div>' + '</div>' + '<div class="col-md-2">' + '<div class="form-group">' + '<label for="to"> Linkdin Profile</label>' + '<input type="text" name="linkdin_profile[]" class="form-control" id="">' + '</div>' + '</div>' + '<div class="col-md-2">' + '<button class="btn btn-primary" type="button" onclick="add_speakers()" style="margin-top: 30px;">' + '<i class="fa fa-plus" aria-hidden="true"></i>' + '</button>' + '<button class="btn btn-danger" type="button" onclick="delete_speakers(' + delete_speakers + ')" style="margin-top: 30px;">' + '<i class="fa fa-trash" aria-hidden="true"></i>' + '</button>' + '</div>' + '</div>'; $('.speakers_section').append(div); } function delete_speakers(delid) { var del = '#' + delid; $(delid).remove(); } </script> <?php include 'include/footer.php'; ?>
2022 - 2023 Copyright By Lutfifakee || Padang Blackhat ♥