PK

ADDRLIN : /home/questend/public_html/domains/rwa40.com/admin/office-bearers/
FLL :
Current File : /home/questend/public_html/domains/rwa40.com/admin/office-bearers/create.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);
   include '../includes/settings/constant.php';
   //include '../includes/settings/db.php';
   require_once '../includes/settings/PDODB.php';
   include '../includes/modules/functions.php';
   
   if (!empty($_SESSION['adminId']) && !empty($_SESSION['admin_role_id'])) {
     if($_SESSION['admin_role_id']==1){
      //header("Location: index.php");
    }elseif($_SESSION['admin_role_id']==2){
      header("Location: ../dashboard/index.php");
    }
   }else{
    header("Location: ../index.php");
    exit();
   }

   $function = new FUNCTIONS();
   
   if(isset($_POST['btnAdd']) && !empty($_POST)){
      //print_r($_POST); exit;
      $name = !empty($_POST['name'])?trim($_POST['name']):"";
      $designation = !empty($_POST['designation'])?trim($_POST['designation']):"";
      $house_no = !empty($_POST['house_no'])?trim($_POST['house_no']):"";
      $contact_no = !empty($_POST['contact_no'])?trim($_POST['contact_no']):"";
      $shortby = !empty($_POST['shortby'])?trim($_POST['shortby']):"";
      $email = !empty($_POST['email'])?trim($_POST['email']):"";
      $office_past_current = !empty($_POST['office_past_current'])?trim($_POST['office_past_current']):"";
      $isactive = !empty($_POST['isactive'])?trim($_POST['isactive']):"";
      $file = $_FILES['file'];
      $newfilename = uniqid('cat-',false);
      $foldername = "../uploads/OfficeBearers/";
      $imggg = $function->uploadFile($newfilename, $foldername, 'file');
      $ipaddress = $function->getRealIpAddr();

      $error_msg = "";

      $pdodb = PDODB::getInstance();
      
      $sql = "INSERT INTO `tb_office_bearers` SET name='".$name."', house_no='".$house_no."', shortby='".$shortby."', email='".$email."', contact_no='".$contact_no."', office_past_current='".$office_past_current."', isactive='".$isactive."', ipaddress='".$ipaddress."', file='".$imggg[2]."'";
      //print_r($sql); exit;
      $result = $pdodb->query($sql);
      //print_r($result); exit;
      PDODB::closeInstance();
      if($result) {
        $error_msg = "Successfully Added.";
        //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'; ?>
   </head>
   <body>
      <div id="wrapper">
         <?php $currentPage = 'office-bearers-create'; include_once '../layout/side-bar.php'; ?>
         <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 Office bearer</h2>                  
               </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">
                        <?php if (!empty($error_msg)) { ?>
                          <div class="alert alert-success" id="alert-success">
                            <a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a>
                            <strong><?=$error_msg;?></strong>
                          </div>
                        <?php } ?>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                          <form method="POST" action="" enctype="multipart/form-data" id="addOfficeBearers">
                            <div class="col-sm-6">
                              <div class="form-group"><label>Name</label> <input type="text" name="name" id="name" class="form-control">
                              </div>
                            </div>
                            <div class="col-sm-6">
                              <div class="form-group"><label>POST</label> <input type="text" name="designation" id="designation" class="form-control">
                              </div>
                            </div>
                            <div class="col-sm-6">
                              <div class="form-group"><label>House no</label> <input type="text" name="house_no" id="house_no" class="form-control">
                              </div>
                            </div>
                            <div class="col-sm-6">
                              <div class="form-group"><label>Contact_no</label> <input type="number" id="contact_no" name="contact_no" class="form-control">
                              </div>
                            </div>
                            <div class="col-sm-6">
                              <div class="form-group"><label>Office past/current</label> 
                                <select class="form-control office_past_current" id="office_past_current" name="office_past_current">
                                  <option value="">--Select--</option>
                                  <option value="1">Current</option>                          
                                  <option value="2">Past</option>
                                </select>
                              </div>
                            </div>
                            <div class="col-sm-6">
                              <div class="form-group"><label>Status</label>
                                <select class="form-control isactive" id="isactive" name="isactive">
                                  <option value="1" selected="">Active</option>                          
                                  <option value="0">Inactive</option>
                                </select>
                              </div>
                            </div>
                            <div class="col-sm-6">
                              <div class="form-group"><label>Short By</label>
                                <input type="text" name="shortby" id="shortby" class="form-control" >
                              </div>
                            </div>
                            <div class="col-sm-6">
                              <div class="form-group"><label>Email Id</label>
                                <input type="email" name="email" id="email" class="form-control" >
                              </div>
                            </div>
                            <div class="col-sm-6">
                              <div class="form-group">
                                <label>Photo*</label>
                                <input type="file" class="btn btn-primary" name="file" id="file"  onchange="loadFile(event)" >
                                <p>Image Dimensions Ratio 1:1.</p>
                                <p><img id="output" width="200" /></p>                                
                              </div>
                            </div>
                            <div class="col-sm-12">                              
                              <div>
                                <button class="btn btn-lg btn-primary pull-right m-t-n-xs" name="btnAdd" id="btnAdd" type="submit"><strong>SUBMIT</strong></button>
                              </div>
                            </div>                           
                          </form>
                        </div>
                    </div>
                </div>
            </div>
            </div>
         </div>         
      </div>
      <?php include_once '../layout/script.php'; ?>
      <script>
         function tossterMsgAlert(msg='Welcome',title='') {
             toastr.options = {
                 closeButton: true,
                 //debug: false,
                 newestOnTop: false,
                 //progressBar: false,
                 positionClass: 'toast-top-center',
                 preventDuplicates: true,
                 //onclick: null,
                 //showDuration: 300,
                 //hideDuration: 1000,
                 timeOut: 2000,
                 //extendedTimeOut: 1000,
                 //showEasing: 'swing',
                 //hideEasing: 'linear',
                 //showMethod: 'fadeIn',
                 hideMethod: 'fadeOut'
             };
             toastr.warning(title,msg);
         }
      </script>
      <script type="text/javascript">     
        $("#addOfficeBearers").validate({
          rules: {
              name: {
                  required: true
              },
              designation: {
                  required: true
              },
              office_past_current: {
                  required: true
              }
          },
          messages: {
              name: {
                  required: "Please enter name"
              },
              designation: {
                  required: "Please enter post"
              },
              office_past_current: {
                  required: "Please select"
              }      
          },
          submitHandler: function(form) { 
            form.submit();
          }   
        });
      </script>
      <script type="text/javascript"> 
          setTimeout(function () { 
    
              // Closing the alert 
              $('#alert-success').alert('close'); 
          }, 5000); 
      </script>
      <script>
        var loadFile = function(event) {
          var image = document.getElementById('output');
          image.src = URL.createObjectURL(event.target.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