Viewing: data_validate.php
<?php require_once('configuration/configuration.php'); $oComman = new CommonClass(); $oGeneral = new GeneralClass(); $oProduct = new ProductClass(); if($_POST['data_id']!='') { $tableName='`tbl_customer`'; $fldName='`id`'; $id=$_POST['data_id']; $status=$_POST['data_status']; $oProduct->changeStatus($tableName , $id , $fldName , $status); die; } $iPageId = $_SESSION['F_USERID']; // Primery Key for table $oProduct->getUser($iPageId); $aUser = $oProduct->aResults; if($aUser[0]['fld_username']!=$_SESSION['F_USERNAME']) { header('location:login.php?error=2'); } $sMode = $_REQUEST['type']; if($sMode == "") { $sMode = "add"; } if($sMode == 'add') { if(isset($_POST['_hiddenTXT'])) { $sTableName = 'tbl_customer'; $aData = $_POST; $oGeneral->check_duplicate_record($sTableName, 'email', $_POST['email']); $iCount = $oGeneral->icount; if($iCount>0 ) { header('location:add_customer.php?message=1'); } else { $aData['added_by'] = $_SESSION['F_USERID']; $aData['added_date'] = date('Y-m-d h:i:s'); $iPageInsertId = $oGeneral->insert_data($sTableName, $aData); header("Location:add_customer.php?message=2"); } } } else if($sMode=='edit') { $oProduct->getCustomer($_REQUEST['id'],'',$_SESSION['F_USERID']); $aCustomer = $oProduct->aResults; $iCustomer = $oProduct->iResults; if(isset($_POST['_hiddenTXT'])) { $sTableName = 'tbl_customer'; $iPageId=$_REQUEST['id']; $sTblMatchField='id'; $aData = $_POST; $oGeneral->update_data($sTableName, $sTblMatchField, $aData, $iPageId); header("Location: add_customer.php?message=3"); } } if($_REQUEST['type']=='del' && $_REQUEST['did']!='') { $sMatchId = trim($_REQUEST['did']); $sTablName = 'tbl_customer'; $sMatchfield = 'id'; $oGeneral->delete_record($sTablName, $sMatchfield, $sMatchId); header("Location: manage_customer.php?message=4"); } if(isset($_REQUEST['message'])) { header( "refresh:5;url=manage_customer.php" ); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Manage Customer : Performance Application Testing Online</title> <?php include("includes/header.php"); ?> <!-- ##### End Nav Bar ##### --> <div class="container"> <!--For slides--> <img src="img/register-banner.png" style="width:100%" > <!--End of slides--> </div> <div class="container text-center" id="easycont"> <div class="row"> <!-- ##### R Side Bar ##### --> <div class="col-md-12 text-left"> <div class="panel panel-default"> <div class="panel-heading">Add input variable</div> <div class="panel-body"> <p> First Let us try with Two input fields and a Button</p> <form id="gettotal" method="post"> <div class="form-group"> <label for="value1">Enter a</label> <input type="text" class="form-control" placeholder="Enter value" id="sum1"> </div> <div class="form-group"> <label for="value2">Enter b</label> <input type="text" class="form-control" placeholder="Enter value" id="sum2"> </div> <button type="button" onClick="return total()" class="btn btn-default">Get Total</button> </form> <div style="height: 50px; width: 100%;"> <label> Total a + b = </label> <span id='displayvalue'></span> </div> </div> </div> </div> <!-- ##### R Side Bar ##### --> </div> </div> <?php include("includes/footer.php"); ?> <!--<link rel="stylesheet" href="cdnjs.cloudflare.com/ajax/libs/jquery.bootstrapvalidator/0.5.3/css/bootstrapValidator.min.css"/> </script><script src="js/inputform.js"></script> <script type="text/javascript" src="cdnjs.cloudflare.com/ajax/libs/jquery.bootstrapvalidator/0.5.3/js/bootstrapValidator.min.js"></script>--> <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script> function total() { var a = document.forms["gettotal"]["sum1"].value; var b = document.forms["gettotal"]["sum2"].value; //alert(a+b) var display = document.getElementById("displayvalue") display.innerHTML = parseInt(a) + parseInt(b); return false; } </script> </body> </html>
Return