Jump to content

Naveed786

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by Naveed786

  1. Yup you are right let me give it a try also. Thanks for the recommendations.
  2. Thanks @requinix You always encourage me to learn when i was reading some articles i found the better way to achieve this is javascript. I use the java script to achieve the result onmousemove event below is the code. <script type="text/javascript"> function EnableDisable(entt) { var btnsubmit = document.getElementById("btnsubmit"); if (entt.value.trim() != "OUT") { btnsubmit.disabled = false; entt.disabled = false; } else { btnsubmit.disabled = true; entt.disabled = true; } }; Is there any other event instead of mousemove event which i can use to enable or disable the field and button. Cheers.
  3. Thanks for the guidance and help I will give it a try and will update back. Cheers.
  4. I am beginner and on learning stage, your question is right i understand. I know the method i wrote is wrong most probably.
  5. Thanks for the guidance here is the code: <?php if($gst="OUT"){ <input name="noopaxs" id="noopaxs" readonly = "" value="<?php echo $row['noopaxs'];?>"> else{ <input name="noopaxs" id="noopaxs" value="<?php echo $row['noopaxs'];?>"> }} ?> and the error is: Parse error: syntax error, unexpected '<' Thanks for the help.
  6. Yes please i know how to mark the textbox readonly or disabled. <input name="entby" id="entby" rows="9" class="form-control" required="" readonly="" value="<?php echo $entby; ?>"> if i will put disable instead of readonly it will be disabled. I read in in one article if we use readonly the value will be updated in the database if we update a record but if it's disabled the value will not be updated. Cheers.
  7. Hi requinix, Sorry for late reply, I already tried above method, i was thinking might be there is some way to only edit the select record, i am using the method to show more fields to identify the record and update it, can u please help me with below code, i want to disable the update button in case if the record date is in past. Can anyone help me with example, like <?php If($gst='OUT'){ disable textbox1 and textbox2 } >? I saw several examples but not able to understand properly, if conditions true then text boxes will be disabled if conditions is false then both text boxes are enabled. Thanks in Advance. Cheers.
  8. Hi Everyone, Any help will be highly appreciated. Still trying to find solution for this. Thanks in advance. Cheers.
  9. Hi mac_gyver, Thanks for pointing it out, i did some study on this and changed the code now it's retrieving the correct count but now am getting one box for each noofpaxs count but i only want only one perticular count for the record which i need to edit, please see below code and screen shot. <?php $cnfno=$_GET['confno']; $query1=mysqli_query($con,"SELECT SUM(noopaxs) AS gattl FROM tblsupvisitor where date(EnterDate) = CURDATE() AND (gst = 'INH' AND entt = 'IN') || (confno='$cnfno') GROUP BY confno"); while ($row=mysqli_fetch_array($query1)) { ?> Please help me i am stuck on this.
  10. Hi, Still waiting if someone can help me on this please.
  11. It's producing the result in mysql properly no issues once i am using in php it's not bringing any reult but now i modified the query it brings the result but it's not calculating total properly for example with confno there are 3 records and each has i noopaxs it should bring 3 but it's bringing back 2 as a sum and also it's happening for each group of confno, please see below code. <?php $eid=$_GET['editid']; $query2=mysqli_query($con,"SELECT SUM(noopaxs) as gattl FROM tblsupvisitor where date(EnterDate) = CURDATE() || gst = 'INH' || entt = 'IN' || ID='$eid' GROUP BY confno"); $calc_no_paxs_for_today=mysqli_fetch_row($query2); while ($row=mysqli_fetch_array($query2)) { ?> and allias part is: <input name="gattl" id="gattl" rows="9" class="form-control" required="" value="<?php echo $row['gattl'];?>">
  12. Hi kicken, I have tried this but still the text box is blank no value it's empty. Below is code with advised changes. <?php //Calculation for no of paxs. $query2=mysqli_query($con,"SELECT SUM(noopaxs-gattl) AS gattl FROM tblsupvisitor where date(EnterDate) = CURDATE() || gst = 'INH' || gst = 'IN' GROUP BY confno"); $calc_no_paxs_for_today=mysqli_fetch_row($query2); $gattl=$calc_no_paxs_for_today['gattl']; ?>
  13. Dear All, I am trying to fetch the sum of a column for current date and subtract a value from the sum for currently selected record. The query i build works fine in MySql but when the same query i placed in php no result it's blank. Below is the query. <?php //Calculation for no of paxs. $query2=mysqli_query($con,"SELECT SUM(noopaxs-gattl) FROM tblsupvisitor where date(EnterDate) = CURDATE() || gst = 'INH' || gst = 'IN' GROUP BY confno"); $calc_no_paxs_for_today=mysqli_fetch_row($query2); $gattl=$calc_no_paxs_for_today['gattl']; ?> and her is the assignment to the textbox. <div class="row form-group"> <div class="col col-md-3"> <label for="textarea-input" style="color: purple" class=" form-control-label"><strong>Total No. Of Adults</strong></label> </div> <div class="col-12 col-md-9"> <input name="gattl" id="gattl" rows="9" class="form-control" required="" value="<?php echo $gattl;?>"> </div> </div> Any help in this regard will be highly appreciated. Kind Regards, Naveed.
  14. Hi, Anyone can help on above query please.....
  15. Thanks to all for help and guidance, it's working fine now the issue was with Java script @requinix thanks for the guidance it's always fantastic and great. One quick question i want to put some formatting in the file as currently it looks very simple and still first column serial number is getting hidden i can not see the number under it but when i export the data is there. Can any one help on this code is already posted above. Thanks in advance. Naveed.
  16. Hello, Quick update on progress, I found there was some issue with java scripts I have updated with new java scripts from github but now it is working but now it gets exported in csv but I need in pdf, can anyone help me with libs and data table export pdf Java scripts please.
  17. Hi, Just want to post update now all errors are gone, but only one issue once i click on export to pdf it's getting exported in .json instead of .pdf. Can anyone help me on this and first column is not appearing properly i have posted the screen shot. Kind Regards, Naveed.
  18. All errors are gone i copied the required plugins but the only issue now is table export function, please see the attached screen shot.
  19. Hi requinix, I am attaching the screen shot for the first part and for the second part also i am uploading the javascript console error if you can help me to understand these error shall i replace these libs if yes can you please refer me to right libs.
  20. Hello All, I am currently working on export to pdf, below is the code, i am able to see the data is getting retrieved from mysql table. I am having 2 issue: 1. When data is getting retrieved one column is on left corner it's now showing the data as it's Sno it gets hidden from left corner. 2. Second issue when i click on the link it's just adding a # tag on the url nothing else. Please guide me to fix the code. <!DOCTYPE html> <html> <head> <Title> Export Supplier / Visiters Details</Title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"/> <script type="text/javascript" src="tableExport.js"></script> <script type="text/javascript" src="jquery.base64.js"></script> <script type="text/javascript" src="html2canvas.js"></script> <script type="text/javascript" src="jspdf/libs/sprintf.js"></script> <script type="text/javascript" src="jspdf/jspdf.js"></script> <script type="text/javascript" src="jspdf/libs/base64.js"></script> <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </head> <?php $con=mysqli_connect("localhost", "root", "", "cvmsdb"); $qry="SELECT * FROM tblsupvisitor"; $result=mysqli_query($con, $qry); $records = array(); while($row = mysqli_fetch_assoc($result)){ $records[] = $row; } ?> <div class="row" style="height:300px;overflow:scroll;"> <table id="tblsupvisitor" class="table table-striped"> <thead> <tr class="warning"> <th>SNO.</th> <th>Full Name</th> <th>Mobile Number</th> <th>Address</th> </tr> </thead> <tbody> <?php foreach($records as $rec):?> <tr> <td><?php echo $rec['ID']?></td> <td><?php echo $rec['FullName']?></td> <td><?php echo $rec['MobileNumber']?></td> <td><?php echo $rec['Address']?></td> </tr> <?php endforeach; ?> </tbody> </table> </div> <li><a href="#" onclick="$('#tblsupvisitor').tableExport({type:'json',escape:'false'});"> <img src="images/icon/logo.png" width="24px"> Export to Pdf</a></li> <li><a href="#" onclick="$('#tblsupvisitor').tableExport({type:'json',escape:'false'});"><img src="images/icon/logo.png" width="24px">JSON (ignoreColumn)</a></li> </html> Kind Regards, Naveed.
  21. Thanks jodunno, it worked perfectly much appreciated your help and time. Kind Regards, Naveed.
  22. Dear All, Hope all are fine. Need one hep to align the logo in the center of the footer. I tried align = Center but didn't help, please see below code ad advise. <div class="image"> <img src="images/icon/logo.jpg" alt="John Doe"/> </div> Kind Regards, Naveed.
  23. Hello, Just want to post update i have designed a separate form for updating record and it's working fine. Thanks for the guidance and help. Naveed.
  24. Hi Mac, Thanks fir your reply here is the code. Updating Query: <?php session_start(); error_reporting(0); include('includes/dbconnection.php'); if (strlen($_SESSION['cvmsaid']==0)) { header('location:logout.php'); } else{ if(isset($_POST['submit'])) { $eid=$_GET['editid']; $remark=$_POST['remark']; $fullname=$_POST['fullname']; $query=mysqli_query($con,"update tblsupvisitor set remark='$remark',fullname='$fullname' where ID='$eid'"); if ($query) { $msg="Visitors Remark has been Updated."; } else { $msg="Something Went Wrong. Please try again"; } } ?> Here is the query to fetch the record from database: <?php $eid=$_GET['editid']; $ret=mysqli_query($con,"select * from tblsupvisitor where ID='$eid'"); $cnt=1; while ($row=mysqli_fetch_array($ret)) { Actually i don't want to make whole table editable want to edit specific fields and send changes to database. Once again thanks for the time to review my post and provide your valuable feedback. Kind Regards, Naveed.
  25. Above posted code is original code existing code is given below but when i run the form whole table is editable also when i edit full name and remarks only remarks are getting updated full name goes as blank. <?php session_start(); error_reporting(0); include('includes/dbconnection.php'); if (strlen($_SESSION['cvmsaid']==0)) { header('location:logout.php'); } else{ if(isset($_POST['submit'])) { $eid=$_GET['editid']; $remark=$_POST['remark']; $fullname=$_POST['fullname']; $query=mysqli_query($con,"update tblsupvisitor set remark='$remark',fullname='$fullname' where ID='$eid'"); if ($query) { $msg="Visitors Remark has been Updated."; } else { $msg="Something Went Wrong. Please try again"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <!-- Required meta tags--> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="au theme template"> <meta name="author" content="Hau Nguyen"> <meta name="keywords" content="au theme template"> <!-- Title Page--> <title>CVSM Visitors Forms</title> <!-- Fontfaces CSS--> <link href="css/font-face.css" rel="stylesheet" media="all"> <link href="vendor/font-awesome-5/css/fontawesome-all.min.css" rel="stylesheet" media="all"> <link href="vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all"> <link href="vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all"> <!-- Bootstrap CSS--> <link href="vendor/bootstrap-4.1/bootstrap.min.css" rel="stylesheet" media="all"> <!-- Vendor CSS--> <link href="vendor/animsition/animsition.min.css" rel="stylesheet" media="all"> <link href="vendor/bootstrap-progressbar/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet" media="all"> <link href="vendor/wow/animate.css" rel="stylesheet" media="all"> <link href="vendor/css-hamburgers/hamburgers.min.css" rel="stylesheet" media="all"> <link href="vendor/slick/slick.css" rel="stylesheet" media="all"> <link href="vendor/select2/select2.min.css" rel="stylesheet" media="all"> <link href="vendor/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" media="all"> <!-- Main CSS--> <link href="css/theme.css" rel="stylesheet" media="all"> </head> <body class="animsition"> <div class="page-wrapper"> <!-- HEADER MOBILE--> <?php include_once('includes/sidebar-Supp.php');?> <!-- END HEADER MOBILE--> <!-- MENU SIDEBAR--> <!-- END MENU SIDEBAR--> <!-- PAGE CONTAINER--> <div class="page-container"> <!-- HEADER DESKTOP--> <?php include_once('includes/header-supp.php');?> <!-- HEADER DESKTOP--> <!-- MAIN CONTENT--> <div class="main-content"> <div class="section__content section__content--p30"> <div class="container-fluid"> <div class="row"> <div class="col-lg-12"> <div class="card"> <div class="card-header"> <strong>Visitor</strong> Details </div> <div class="card-body card-block"> <p style="font-size:16px; color:red" align="center"> <?php if($msg){ echo $msg; } ?> </p> <?php $eid=$_GET['editid']; $ret=mysqli_query($con,"select * from tblsupvisitor where ID='$eid'"); $cnt=1; while ($row=mysqli_fetch_array($ret)) { ?><table border="1" contenteditable="true" class="table table-bordered mg-b-0"> <tr> <th>Full Name </th> <td><?php echo $row['FullName'];?></td> </tr> <tr> <th>Qatar ID #</th> <td><?php echo $row['IDNO'];?></td> </tr> <tr> <th>Vehicle #</th> <td><?php echo $row['vno'];?></td> </tr> <tr> <th>No of Persons</th> <td><?php echo $row['noopaxs'];?></td> </tr> <tr> <th>Address</th> <td><?php echo $row['Address'];?></td> </tr> <tr> <th>Whom to Meet</th> <td><?php echo $row['WhomtoMeet'];?></td> </tr> <tr> <th>Deptartment</th> <td><?php echo $row['Deptartment'];?></td> </tr> <tr> <th>Reason to Meet</th> <td><?php echo $row['ReasontoMeet'];?></td> </tr> <tr> <th>Vistor Entring Time</th> <td><?php echo $row['EnterDate'];?></td> </tr> <?php if($row['remark']==""){ ?> <form method="post"> <?php if($row['fullname']='$fullname'){ ?> <form method="post"> <tr> <th>Outing Remark :</th> <td> <textarea name="remark" placeholder="" rows="12" cols="14" class="form-control wd-450" required="true"></textarea></td> </tr> <tr align="center"> <td colspan="2"><button type="submit" name="submit" class="btn btn-primary btn-sm">Update</button></td> </tr> </form> <?php }} else { ?> <tr> <th>Outing Remark </th> <td><?php echo $row['remark']; ?></td> <td><?php echo $row['fullname'];?></td> </tr> <tr> <th>Out Time</th> <td><?php echo $row['outtime']; ?> </td> <?php } ?> </tr> </table> </div> </div> </div> </div> <?php include_once('includes/footer.php');?> </div> </div> </div> </div> <!-- Jquery JS--> <script src="vendor/jquery-3.2.1.min.js"></script> <!-- Bootstrap JS--> <script src="vendor/bootstrap-4.1/popper.min.js"></script> <script src="vendor/bootstrap-4.1/bootstrap.min.js"></script> <!-- Vendor JS --> <script src="vendor/slick/slick.min.js"> </script> <script src="vendor/wow/wow.min.js"></script> <script src="vendor/animsition/animsition.min.js"></script> <script src="vendor/bootstrap-progressbar/bootstrap-progressbar.min.js"> </script> <script src="vendor/counter-up/jquery.waypoints.min.js"></script> <script src="vendor/counter-up/jquery.counterup.min.js"> </script> <script src="vendor/circle-progress/circle-progress.min.js"></script> <script src="vendor/perfect-scrollbar/perfect-scrollbar.js"></script> <script src="vendor/chartjs/Chart.bundle.min.js"></script> <script src="vendor/select2/select2.min.js"> </script> <!-- Main JS--> <script src="js/main.js"></script> </body> </html> <!-- end document--> <?php } ?> <?php } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.