PK

ADDRLIN : /home/questend/public_html/domains/deepanshiarora.com/da-admin/blog/
FLL :
Current File : /home/questend/public_html/domains/deepanshiarora.com/da-admin/blog/edit.php

<?php
   ob_start();
   //error_reporting(E_ALL ^ E_NOTICE);
   @session_start();
   ini_set('allow_url_include',1);    
   date_default_timezone_set("Asia/Kolkata");
   set_time_limit(600);
   ini_set('max_execution_time',600);   
   require_once '../includes/settings/PDODB.php';
   include '../includes/modules/functions.php';
   
   if(empty($_SESSION['plusPackageAdminId'])){
    header("Location: ../index.php");
    exit();
   }

   $function = new FUNCTIONS();
   $categorydata = $function->getCat(NULL,1);
   //$id=$_GET['id'];
   $blogdata = $function->getBlog($id=$_GET['id'],$isactive=1,$orderBy='DESC');

   //print_r($news); exit;
   if(isset($_POST['btnEditBlog']) && !empty($_POST)){
        //print_r($_POST['title']); exit;
        $title = !empty($_POST['title'])?trim($_POST['title']):"";
        $title = htmlentities($title, ENT_QUOTES);
        
        $author_name = !empty($_POST['author_name'])?trim($_POST['author_name']):"";
        
        $first_description = !empty($_POST['first_description'])?trim($_POST['first_description']):"";
        $description1 = htmlentities($first_description, ENT_QUOTES);
        //print_r($description1); exit;

        $full_description = !empty($_POST['full_description'])?trim($_POST['full_description']):"";
        $description2 = htmlentities($full_description, ENT_QUOTES);
        //print_r($description2); exit;
      
        $oldfile = $_POST['oldfile'];
        $id=$_GET['id'];        
        $file = $_FILES['file'];        
              
        if (!empty($file['name'])) {
          $newfilename = uniqid('blog-',false);
          $foldername = "../uploads/blog/";
          $imggg = $function->uploadFile($newfilename, $foldername, 'file');
          //print_r($imggg[2]); //exit();
          //print_r($foldername.$oldfile); //exit;
          if($imggg[2]){
            unlink($foldername.$oldfile); //remove the file
          }
          $oldfile = $imggg[2];
        }
        //print_r($oldfile);
        $pdodb = PDODB::getInstance();
        //echo "cmdm"; exit;
        $sql = "UPDATE tb_blog SET title='".$title."',author_name='".$author_name."',first_description='".$description1."',full_description='".$description2."',file='".$oldfile."' WHERE id = '".$id."'";
        //print_r($sql); exit;
        $result = $pdodb->query($sql);
        //print_r($result); exit;
        PDODB::closeInstance();
        if($result) {
          header("Location: index.php");
        }
    }
?>
<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>INSPINIA | Basic Form</title>
      <?php include_once '../layout/style.php'; ?>
      <link href="../css/plugins/summernote/summernote.css" rel="stylesheet">
      <link href="../css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
   </head>
   <body>
      <div id="wrapper">
         <nav class="navbar-default navbar-static-side" role="navigation">
          <div class="sidebar-collapse">
              <ul class="nav metismenu" id="side-menu">
                  <li class="nav-header">
                      <div class="dropdown profile-element"> <span>
                          <img alt="image" class="img-circle" src="../img/profile_small.jpg" />
                           </span>
                          <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                          <span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">Vinay</strong>
                           </span> <span class="text-muted text-xs block">Art Director <b class="caret"></b></span> </span> </a>
                          <ul class="dropdown-menu animated fadeInRight m-t-xs">
                              <li><a href="#">Profile</a></li>
                              <li class="divider"></li>
                              <li><a href="#">Logout</a></li>
                          </ul>
                      </div>
                      <div class="logo-element">Vinay</div>
                  </li>
                  <li>
                      <a href="#"><i class="fa fa-th-large"></i> <span class="nav-label">Dashboards</span> <span class="fa arrow"></span></a>
                      <ul class="nav nav-second-level">
                          <li><a href="../dashboard/index.php">Dashboard</a></li>
                      </ul>
                  </li>
                  <li class="active">
                      <a href="#"><i class="fa fa-pencil"></i> <span class="nav-label">Blog</span><span class="fa arrow"></span></a>
                      <ul class="nav nav-second-level collapse">
                          <li class="active"><a href="../blog/index.php">Blog List</a></li>
                          <li><a href="../blog/inactive.php">Off Blog List</a></li>
                          <li><a href="../blog/create.php">Add Blog</a></li>
                      </ul>
                  </li>
              </ul>
          </div>
         </nav>
         <div id="page-wrapper" class="gray-bg">
            <?php include_once '../layout/header.php'; ?>
            <div class="row wrapper border-bottom white-bg page-heading">
               <div class="col-lg-10">
                  <h2>Add Latest News Form</h2>
                  <ol class="breadcrumb">
                     <li>
                        <a href="index.html">Home</a>
                     </li>
                     <li>
                        <a>Forms</a>
                     </li>
                     <li class="active">
                        <strong>Add Latest News</strong>
                     </li>
                  </ol>
               </div>
               <div class="col-lg-2">
               </div>
            </div>           
            <div class="row">
               <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title  back-change">
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                          <form method="POST" action="" enctype="multipart/form-data" id="EditBlog">
                            <div class="col-sm-10">
                              <div class="form-group">
                                <label>Title*</label>
                                <input type="text" value="<?=$blogdata[0]['title'];?>" name="title" id="title" class="form-control">
                              </div>                              
                              <div class="form-group">
                                <label>Author Name*</label>
                                <input type="text" value="<?=$blogdata[0]['author_name'];?>" name="author_name" id="author_name" class="form-control">
                              </div>
                              <div class="form-group">
                                <label>First Description*</label>
                                <textarea name="first_description" id="first_description" class="tinymce">
                                  <?=!empty($blogdata[0]['first_description'])?$blogdata[0]['first_description']:'';?>
                                </textarea>
                              </div>
                              <div class="form-group">
                                <label>Full Description*</label>
                                <textarea name="full_description" id="full_description" class="tinymce">
                                  <?=!empty($blogdata[0]['full_description'])?$blogdata[0]['full_description']:'';?>
                                </textarea>
                              </div>                                               
                              <div class="form-group">
                                <h4>Preview image</h4>
                                <div class="img-preview img-preview-sm"><img alt="Image Display Here" id="test" src="../uploads/blog/<?=$blogdata[0]['file'];?>" style="min-width: 0px !important; min-height: 0px !important; max-width: none !important; max-height: none !important; width: 200px;"></div>
                                  <form id="form1" runat="server">
                                    <input type="file" id="file" class="btn btn-primary" onchange="readURL(this);" name="file">
                                    <p>Banner Dimensions 1024 x 300 pixels.</p>
                                    <input type="hidden" name="oldfile" id="oldfile" value="<?=$blogdata[0]['file'];?>">
                                  </form>
                                  <div>
                                    
                                    <button class="btn btn-sm btn-primary pull-right m-t-n-xs" name="btnEditBlog" id="btnEditBlog" type="submit"><strong>SUBMIT</strong></button>
                                  </div>
                                </div>
                            </div>
                          </form>
                        </div>
                    </div>
                </div>
            </div>
            </div>
         </div>         
      </div>
      <?php include_once '../layout/script.php'; ?>
      <script type="text/javascript" src="../js/plugins/tinymce/tinymce.min.js"></script>
      <script type="text/javascript" src="../js/plugins/tinymce/init-tinymce.js"></script>
      
      <script type="text/javascript">     
        $("#addBlog").validate({
          rules: {   
              title: {
                  required: true
              },
              author_name: {
                  required: true
              },
              first_description: {
                  required: true
              },
              full_description: {
                  required: true
              },
              file: {
                  required: true
              }
          },
          messages: {                           
              title: {
                  required: "Please enter Blog Title"
              },
              author_name: {
                  required: "Please enter author name"
              },
              first_description: {
                  required: "Please enter first description"
              },
              full_description: {
                  required: "Please enter full description"
              },
              file: {
                  required: "Please Upload Photo"
              }
          },
          submitHandler: function(form) { 
            form.submit();
          }   
        });
      </script>
      <script type="text/javascript">
         function readURL(input) {
          if (input.files && input.files[0]) {
              var reader = new FileReader();
              reader.onload = function (e) {
              $('#test').attr('src', e.target.result);
             }
              reader.readAsDataURL(input.files[0]);
             }
          };          
      </script>
   </body>
</html>


PK 99
E-SHOP || DASHBOARD
404

Page Not Found

It looks like you found a glitch in the matrix...

← Back to Home