PK

ADDRLIN : /home/questend/public_html/domains/rwa40.com/admin/member/
FLL :
Current File : /home/questend/public_html/domains/rwa40.com/admin/member/add-servant.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';
   
   $function = new FUNCTIONS();
   
   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();
   }

   if(!empty($_GET['id'])){
        $id = $_GET['id'];
    }else{ ?>
        <script type="text/javascript">location.replace("index.php");</script>
    <?php }

   $member_id = $_GET['id'];
   $ipaddress = $function->getRealIpAddr();
   //print_r($member_id);
   //print_r($_POST); //exit;
   if(isset($_POST['btnAddfServant'])){
      //print_r($_POST); exit;
      //echo "csdcsd"; exit;
      $members =$_POST;
      if(!empty($members['name'])){
        for ($i=0; $i < sizeof($members['name']); $i++) { 
          $name= $members['name'][$i];
          $father_name= $members['father_name'][$i];
          $address= $members['address'][$i];          
          $phone_no= $members['phone_no'][$i];
          $age= $members['age'][$i];
          $aadharcard= $members['aadharcard'][$i];
          $voterid= $members['voterid'][$i];
          $join_on= $members['join_on'][$i];
          $left_on= $members['left_on'][$i];
          $comment= $members['comment'][$i];


          $pdodb = PDODB::getInstance();
          $sql = "INSERT INTO `tb_servant` SET 
            member_id='$member_id',
            name='$name',
            father_name='$father_name',
            address='$address',
            phone_no='$phone_no',
            age='$age',
            aadharcard='$aadharcard',
            voterid='$voterid',
            join_on='$join_on',
            left_on='$left_on',
            comment='$comment',
            ipaddress='$ipaddress'";

          $result = $pdodb->query($sql);
          //echo $result; exit;        
          PDODB::closeInstance();
    
          if (!empty($result)) {
             echo "<script>window.location.href='edit-member-details.php?id=$member_id';</script>";
          }
        }
      }
    }

  $pdodb = PDODB::getInstance();
  $sql = "SELECT e.house_no, e.occupation_self, u.owner_name, u.mobile,u.tel_no,u.id FROM `user_details` AS e INNER JOIN `users` AS u ON e.id = u.id WHERE u.isactive=1 AND e.isactive=1 AND u.id=$member_id AND e.id=$member_id"; //exit;
  $result = $pdodb->query($sql);
?>
<!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 = 'servant-index'; 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><?=$result[0]['owner_name']." - ".$result[0]['house_no'];?></h2>
                  <h2>Add Servant Form</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="row">
                        <div class="col-lg-12" style="padding : 0px;">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title">                  
                                </div>
                                <div class="ibox-content">                                  
                                  <form method="POST" action="" id="addfmember">
                                    <div class="table-responsive">
                                      <table class="table table-striped table-bordered table-hover dataTables-example" id="myTable">
                                        <thead>
                                          <tr>
                                            <th>Name</th>
                                            <th>Father's name</th>
                                            <th>Phone No.</th>
                                            <th>Address</th>
                                            <th>Age</th>
                                            <th>Aadhar No</th>
                                            <th>Voter ID No</th>
                                            <th>Join On</th>
                                            <th>Left On</th>
                                            <th>Comment</th>
                                            <th>ADD</th>
                                            <th>Delete</th>                                            
                                          </tr>
                                        </thead>
                                        <tbody>
                                          <tr>
                                              <input type="hidden" name="member_id" value="<?php echo $member_id; ?>">
                                              <td><input type="text" id="name" name="name[]" required=""></td>
                                              <td><input type="text" id="father_name" name="father_name[]"></td>
                                              <td><input type="text" id="phone_no" name="phone_no[]"></td>
                                              <td><textarea id="address" name="address[]"></textarea></td>
                                              <td><input type="text" id="age" name="age[]"></td>
                                              <td><input type="text" id="aadharcard" name="aadharcard[]"></td>
                                              <td><input type="text" id="voterid" name="voterid[]"></td>                      
                                              <td><input type="date" id="join_on" name="join_on[]"></td>
                                              <td><input type="date" id="left_on" name="left_on[]"></td>
                                              <td><textarea id="comment" name="comment[]"></textarea></td>                       
                                              <td><input type="button" class="btn btn-success" value="Add Row" onclick="addField();"></td>
                                              <td><input type="button" class="btn btn-danger" id="delPOIbutton" value="Delete Row" onclick="deleteRow(this)" /></td> 
                                          </tr>
                                        </tbody>
                                      </table>
                                    </div>
                                    <div class="form-group" style="margin-top : 10px;">
                                      <div class="col-sm-12">
                                          <a class="btn btn-danger pull-right" href="edit-member-details.php?id=<?=$member_id;?>">Cancel</a>                                           
                                         <button class="btn btn-primary pull-right" name="btnAddfServant" id="btnAddfServant" type="submit">Add Servant</button>
                                      </div>
                                   </div>
                                  </form>                                  
                                </div>
                            </div>
                        </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>
        function addField (argument) {
          var myTable = document.getElementById("myTable");
          var currentIndex = myTable.rows.length;
          var currentRow = myTable.insertRow(-1);

          var nameBox = document.createElement("input");
          nameBox.setAttribute("name", "name[]" + currentIndex);
          nameBox.setAttribute("required", "false[]" + currentIndex);
          

          var fatherNameBox = document.createElement("input");
          fatherNameBox.setAttribute("name", "father_name[]" + currentIndex);
          //fatherNameBox.setAttribute("required", "false[]" + currentIndex);        

          var phoneNoBox = document.createElement("input");
          phoneNoBox.setAttribute("name", "phone_no[]" + currentIndex);
          //phoneNoBox.setAttribute("required", "false[]" + currentIndex);

          var addressBox = document.createElement("textarea");
          addressBox.setAttribute("name", "address[]" + currentIndex);
          //addressBox.setAttribute("required", "false[]" + currentIndex);

          var ageBox = document.createElement("input");
          ageBox.setAttribute("name", "age[]" + currentIndex);
          //sinceBox.setAttribute("required", "false[]" + currentIndex);

          var aadharcardBox = document.createElement("input");
          aadharcardBox.setAttribute("name", "aadharcard[]" + currentIndex);
          //sinceBox.setAttribute("required", "false[]" + currentIndex);

          var voteridBox = document.createElement("input");
          voteridBox.setAttribute("name", "voterid[]" + currentIndex);
          //sinceBox.setAttribute("required", "false[]" + currentIndex);

          var join_onBox = document.createElement("input");
          join_onBox.setAttribute("name", "join_on[]" + currentIndex);
          join_onBox.setAttribute("type", "date");

          var left_on = document.createElement("input");
          left_on.setAttribute("name", "join_on[]" + currentIndex);
          left_on.setAttribute("type", "date");

          var commentBox = document.createElement("textarea");
          commentBox.setAttribute("name", "comment[]" + currentIndex);
          //addressBox.setAttribute("required", "false[]" + currentIndex);
          

          var addRowBox = document.createElement("input");
          addRowBox.setAttribute("type", "button");
          addRowBox.setAttribute("value", "Add Row");
          addRowBox.setAttribute("onclick", "addField();");
          addRowBox.setAttribute("class", "btn btn-success");

          var deleteRowBox = document.createElement("input");
          deleteRowBox.setAttribute("type", "button");
          deleteRowBox.setAttribute("value", "Delete Row");
          deleteRowBox.setAttribute("onclick", "deleteRow(this);");
          deleteRowBox.setAttribute("class", "btn btn-danger");

          var currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(nameBox);

              currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(fatherNameBox);

              currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(phoneNoBox);

              currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(addressBox);

              currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(ageBox);

              currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(aadharcardBox);

              currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(voteridBox);

              currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(join_onBox);

              currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(left_on);

              currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(commentBox);

              currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(addRowBox);

              currentCell = currentRow.insertCell(-1);
              currentCell.appendChild(deleteRowBox);
        }
        //delete row
        function deleteRow(row){
            var i=row.parentNode.parentNode.rowIndex;
            document.getElementById('myTable').deleteRow(i);
        }
      </script>
      <!-- <script type="text/javascript">     
        $("#addfmember").validate({
          rules: {
              name: {
                  required: true
              },                         
              age: {
                  required: true,
                  //minlength: 10,
                  //maxlength: 10,
                  //number: true
                  //digits: true
              },  
              relation: {
                  required: true,
                  //email: true,
                  //emailValidate: true
              },
              phoneNo: {
                  required: true,              
              }
          },
          messages: {
              name: {
                  required: "Please Enter full name"
              },                          
              age: {
                  required: "Please Enter Age"
              },           
              relation: {
                  required: "Please Enter Relation with Owner"
                  
              },
              blood_gp:{
                required: "Please Enter Blood Group Name"
              }          
          },
          submitHandler: function(form) {           
             
              form.submit();
             
          }   
        });
      </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