Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jan 22nd, 2018 49 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <?php
  2. include_once 'init.php';
  3.  
  4. include CLASS_DIR."leaveform.class.php";
  5. $leaveformObj   = new leaveform;
  6. $email              = '';
  7. $password           = '';
  8. $err_msg            = '';
  9. $s_msg              = '';
  10. $verfication_code   = '';
  11. if(isset($_POST['leaveSubmit'])){
  12.         $branch   = $_POST['branch'];
  13.     $date   = $_POST['date'];
  14.     $name   = $_POST['name'];
  15.     $designation    = $_POST['designation'];
  16.     $employeeid         = $_POST['employeeid'];
  17.     $noofdays           = $_POST['noofdays'];
  18.     $from           = $_POST['from'];
  19.     $to         = $_POST['to'];
  20.     $reasonforleave         = $_POST['reasonforleave'];
  21.     $address        = $_POST['address'];
  22.     $contactno          = $_POST['contactno'];
  23.     $approvedby         = $_POST['approvedby'];
  24.     if(empty($branch)){
  25.         $err_msg = "Please select your branch";
  26.     }elseif(empty($date)){
  27.     $err_msg = "Please select The Date";}
  28. else {
  29.  
  30.         $leaveformObj->branch   = $branch;
  31.             $leaveformObj->date     = $date;
  32.         $leaveformObj->name     = $name;
  33.         $leaveformObj->designation          = $designation;
  34.         $leaveformObj->employeeid           = $employeeid;
  35.         $leaveformObj->noofdays         = $noofdays;
  36.         $leaveformObj->from         = $from;
  37.         $leaveformObj->to           = $to;
  38.         $leaveformObj->reasonforleave           = $reasonforleave;
  39.         $leaveformObj->address          = $address;
  40.         $leaveformObj->contactno            = $contactno;
  41.         $leaveformObj->approvedby           = $approvedby;
  42.  
  43.  
  44.         $addleave      = $leaveformObj->addleave(); //Login as Church Admin
  45.         if($addleave){
  46.             $leaveformObj->ticket_no     = "Ticket#".$addleave;
  47.             $leaveformObj->leave_id  = $addleave;
  48.             $Ticket      = $leaveformObj->updateTicket();
  49.             if ($Ticket) {
  50.             $s_msg = "Successfully Submitted<br>";
  51.             $s_msg .= "Your Ticket No : Ticket#".$addleave;
  52.             }
  53.  
  54.         }else{
  55.             $err_msg = "Invalid leaveform details";
  56.         }
  57.     }
  58. }
  59. $smarty->assign('s_msg', $s_msg);
  60. $smarty->assign('err_msg', $err_msg);
  61. $smarty->display('leaveform.tpl');
  62. ?>
  63.    
  64. {include file="inc/main_header.tpl"}
  65. <style type="text/css">
  66. option {
  67.     text-transform: capitalize;
  68. }
  69. .nopadding div{
  70.     padding: 0px !important;
  71. }
  72. form[role="login"] input.inputText{
  73.     padding: 0;
  74.     border: 0;
  75.     background: none;
  76.     border-bottom: 1px dotted;
  77.     box-shadow: none;
  78.     border-radius: initial;
  79.     width: 85%;
  80. }
  81. form[role="login"] .threeCol input.inputText{
  82.     width: 68%;
  83. }
  84. </style>
  85. <div class="wrapper">
  86. <!-- Left side column. contains the logo and sidebar -->
  87.     <div class="container">
  88.     <div class="col-md-12">
  89.                             <!--breadcrumbs start -->
  90.         <!--<ul class="breadcrumb front">
  91.             <li><a href="#"><i class="fa fa-home"></i> Home</a></li>
  92.             <li class="active"><a href="#">Admin Login</a></li>
  93.         </ul>-->
  94.         <!--breadcrumbs end -->
  95.     </div>
  96.         <section class="col-md-12">
  97.  
  98.             <div class="panel panel-default">
  99.  
  100.                 <div class="panel-body">
  101.                     <form method="post" action="" role="login" id="FormValidate">
  102.                     <div class="col-md-3">
  103.                         <img src="images/krishnasweet.png" alt="Krishna Sweet" class="" width='180'>
  104.                     </div>
  105.                     <div class="col-md-6">
  106.                         <h3 style="text-align: center;color: blue;font-style: italic;">Leave Application Form<br></h3>
  107.                     </div>
  108.                  {if $s_msg}
  109.                 <p style="text-align: center; color:green;">{$s_msg}</p>
  110.                 {elseif $err_msg}
  111.                 <p style="text-align: center; color:red;">{$err_msg}</p>
  112.                 {/if}
  113.                 <div class="col-md-12" style="min-height:30px;"></div>
  114.                 <div class="col-md-3">&nbsp;</div>
  115. <div class="col-md-15" >    
  116. <div class="col-md-12 nopadding">  
  117. <div class="col-md-6"><label style="display: inline-block;">Branch :</label><input type="text" class="inputText" name="branch"></div>
  118. <div class="col-md-6"><label style="display: inline-block;">Date :</label><input type="date" class="inputText" name="date"></div>
  119.  
  120. </div>          
  121. <div class="col-md--1">&nbsp;</div>
  122.     </div>
  123. <div class="col-md--1">&nbsp;</div>
  124. <div class="col-md--1" >        
  125. <div class="col-md--1">
  126.     </div>
  127. </div>
  128. <div class="col-md--1">&nbsp;</div>
  129. <div class="col-md-2" >    
  130.  
  131.  
  132. </div>
  133. <div class="col-md-12 nopadding">
  134.     <div class="col-md-8"><label style="display: inline-block;">Name :</label><input type="text" class="inputText" name="name"></div>
  135.     <div class="col-md-8"><label style="display: inline-block;">Designation:</label><input type="text" class="inputText" name="designation"></div>
  136.     </div><div class="col-md-12 nopadding">
  137.     <div class="col-md-7"><label style="display: inline-block;">Employee ID :</label><input type="text" class="inputText" name="employeeid"></div>
  138. </div>
  139. <div class="col-md-12 threeCol nopadding">
  140.     <div class="col-md-4"><label style="display: inline-block;">No.Of.Days:</label><input type="text" class="inputText" name="noofdays"></div>
  141.     </div><div class="col-md-12 threeCol nopadding">
  142.     <div class="col-md-4"><label style="display: inline-block;">From:</label><input type="date" class="inputText" name="from" ></div>
  143.     <div class="col-md-4"><label style="display: inline-block;">To:</label><input type="date" class="inputText" name="to" ></div>
  144.  
  145. </div>
  146. <div class="col-md-12 nopadding">
  147.     <div class="col-md-12"><label style="display: inline-block;">Reason For Leave:</label><input type="text"  class="inputText" name="reasonforleave" "></div>
  148.         <div class="col-md-12"><label style="display: inline-block;">Address:</label><input type="text"  class="inputText" name="address" "></div>
  149.     </div>
  150.     <div class="col-md-9"><label style="display: inline-block;">Contact No:</label><input type="text" class="inputText" name="contactno"></div>
  151.     <div class="col-md-9"><label style="display: inline-block;">Approved By:</label><input type="text" class="inputText" name="approvedby"></div>
  152. </div>
  153.                         <button type="submit" name="leaveSubmit" class="btn btn-block btn-info">Submit</button>
  154.                     </form>
  155.                 </div>
  156.             </div>
  157.         </section>
  158.     </div>
  159. </div>
  160.  
  161. {include file="inc/main_footer.tpl"}
  162. <script>
  163.     $(document).ready(function(){
  164.         $(document).on("change","#categorySection",function(event) {
  165.             var _val = $(this).val();          
  166.             if(_val != ""){
  167.                 $("#subCategorySection option").hide();
  168.                 $("#subCategorySection option[data-cat="+_val+"]").show();
  169.                 $("#subCategorySection").removeAttr("disabled");
  170.             }
  171.         });    
  172.     });
  173. </script>
  174.    
  175. <?php
  176. class leaveform
  177. {
  178.      var $leave_id;
  179.      var $branch;
  180.      var $date;
  181.      var $name;
  182.      var $designation;
  183.      var $employeeid;
  184.      var $noofdays;
  185.      var $from;
  186.      var $to;
  187.      var $reasonforleave;
  188.      var $address;
  189.      var $contactno;
  190.      var $approvedby;
  191.  
  192.     function complaints($leave_id = '')
  193.     {
  194.         global $db,$smarty;
  195.         if ( $leave_id )
  196.         {
  197.             $this->leave_id = $leave_id;
  198.             $sql = "SELECT * FROM leaveform WHERE leave_id=$this->leave_id";
  199.             $leaveform = $db->getRow($sql);
  200.             if($leaveform != null)
  201.             {
  202.                 $this->leave_id = trim(stripslashes($leaveform['leave_id']));
  203.                 $this->branch = trim(stripslashes($complaints['branch']));
  204.                 $this->date = trim(stripslashes($complaints['date']));
  205.                 $this->name = trim(stripslashes($complaints['name']));
  206.                 $this->designation = trim(stripslashes($complaints['designation']));
  207.                 $this->employeeid = trim(stripslashes($complaints['employeeid']));
  208.                 $this->noofdays = trim(stripslashes($complaints['noofdays']));
  209.                 $this->from = trim(stripslashes($complaints['from']));
  210.                 $this->to = trim(stripslashes($complaints['to']));
  211.                 $this->reasonforleave = trim(stripslashes($complaints['reasonforleave']));
  212.                 $this->address = trim(stripslashes($complaints['address']));
  213.                 $this->contactno = trim(stripslashes($complaints['contactno']));
  214.                 $this->approvedby = trim(stripslashes($complaints['approvedby']));
  215.             }
  216.         }else {
  217.  
  218.             $this->leave_id = "";
  219.             $this->branch = "";
  220.             $this->date = "";
  221.             $this->name = "";
  222.             $this->designation = "";
  223.             $this->employeeid = "";
  224.             $this->noofdays = "";
  225.             $this->from = "";
  226.             $this->to   = "";
  227.             $this->reasonforleave   = "";
  228.             $this->address  = "";
  229.             $this->contactno    = "";
  230.             $this->approvedby   = "";
  231.         }
  232.     }
  233.     /***
  234.     Add Church Admin
  235.     Used Php Files : Index.php
  236.     ***/
  237.     function addleave()
  238.     {
  239.         global $db, $smarty;
  240.         $sql = "INSERT INTO leaveform(branch,date,name,designation,employeeid,noofdays,from,to,reasonforleave,address,contactno,approvedby) VALUES
  241.         ('$this->branch','$this->date', '$this->name','$this->designation','$this->employeeid','$this->noofdays','$this->from','$this->to','$this->reasonforleave','$this->address',
  242.         '$this->contactno','$this->approvedby')";
  243.         $result    = $db->Execute($sql);
  244.         $leave_id = $db->insert_ID();
  245.         if($result)
  246.         {
  247.             return $leave_id;
  248.         }else{
  249.             return 0;
  250.         }  
  251.     }
  252.         function updateTicket()
  253.     {
  254.         global $db, $smarty;
  255.         $sql = " UPDATE leaveform SET ticket_no = '$this->ticket_no' WHERE leave_id = '$this->leave_id' ";
  256.         $leave_id = $db->Execute($sql);
  257.         if($leave_id){
  258.             return true;
  259.         }else{
  260.             return false;
  261.         }
  262.     }
  263.  
  264.  
  265.  }
  266. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top