Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About michelle1404

  • Rank
  1. I am adding line items in my invoice script, while adding i validate the data. if validation fails, it will display error message with entered data filled in the form. If it clears the validation, data gets submitted to database and displays the same . Here i can add many line items, so this process should keep repeating. Everything is working fine. But when the form submits it should display error in one place and display the submitted data in other place. Here is my form <form action="" method="post"> <div class="form-row"
  2. Thanks for the detailed code. For 1st week, data is not displayig properly ... from 2nd week, it works perfectly
  3. This is what i did, <?php ob_start(); include('inc/sessions.php'); include('inc/config.php'); include('inc/top.php'); $msql = "SELECT WEEK(dtime) AS week, DAYNAME(dtime) AS dow, no_one, no_two, no_three FROM mytable ORDER BY dtime ASC"; $mquery = mysqli_query($con, $msql); ?> <!-- Page content --> <div id="page-content" class="block"> <table class="table"> <tr><td>Days</td> <?php while($row = mysqli_fetch_array($mquery)) { echo "<tr><td>".$row['dow']."</td>"; echo "<td>".$row['no_one']."</td>"; echo "<td>"
  4. I have data stored in datetime format, like this I want to display it Week-wise like this in php Week1 Week2 Monday | 1 | 5 | 8 Tuesday | 3 | 0 | 6 Wednesday | 2 | 3 | 5 Thursday | 7 | 0 | 9 Friday | 0 | 3 | 1 Saturday | 3 | 6 | 8 Now , in my query i am getting like this Can somebody suggest me how can i display it in php
  5. After logging, session will start. So i have to manage sessions.php in all my other files to manage session . Here is my login file <?php if(isset($_POST['submit'])) { include("connect.php"); $user=mysqli_real_escape_string($con, $_POST['email']); $pass=mysqli_real_escape_string($con, $_POST['password']); $sql="SELECT * FROM users WHERE email='".$user."' AND password='".$pass."' "; $query=mysqli_query($con, $sql) or die(mysqli_error($con)); $count=mysqli_num_rows($query); if($count==1) { $row=mysqli_fe
  6. @requinix Thanks. In this i get the result, but i want each months data to be added and show it as expense in that month... Now am getting like this But i want to display like this
  7. i tried doing it like this, but not getting it, income is only from 1 table but expense should fetch add sum 2 tables data. $sqlm = "(SELECT r.paid_amount, MONTHNAME(r.paid_date) AS 'Month', YEAR(r.paid_date) AS Yr, 'Income' AS 'Income' FROM receipt r INNER JOIN leads l ON r.customer=l.id GROUP BY MONTH(r.paid_date)) UNION ALL (SELECT SUM(pamt) AS paid_amount, 'Income' AS 'Expense' FROM ( Select sum(paid_amount) as pamt FROM expense_pay WHERE MONTHNAME(paid_date) AS 'Month', YEAR(paid_date) AS Yr UNION ALL Select sum(paid_amount) as pamt FROM payments WHERE MONTHNAME(paid_date
  8. Hi, I am trying to get the income-expense report on month basis. Actually for income, i am getting data from 'receipt' table structure is like this But for expense, i have to get the data from 2 tables, 'payments' and 'expense' , like this My display should be like this Actually for only 2 tables i got the result in the same format. Here is the working query $sqlm = "SELECT r.invoice_id, r.customer, r.paid_amount, r.mode, r.ref_no, MONTHNAME(r.paid_date) AS 'Month', YEAR(r.paid_date) AS Yr, r.comments, l.company, 'Income' AS 'Income' FROM receipt r INNER JOI
  9. <script type="text/javascript"> $('#addnameform').on('submit', function(e){ e.preventDefault(); var data = new FormData(); var selects = e.target.querySelectorAll(".form-control"); var values = []; for (var i = 0; i < selects.length; i++) { if (selects[i].value != 0) { values.push([selects[i].name, selects[i].value]) }; }; if (values.length) { values.forEach(function(val) { data.append(val[0], val[1], val[2], val[3], val[4], val[6]) alert(val[0]); }) var request = new
  10. Getting this error ReferenceError: $ is not defined $('#addnameform').on('submit', function(e){
  11. Instead of form, u want me to go by form name???? <form method="post" action="" id="addnameform"> $("#addnameform").submit(function(e) { e.preventDefault(); like this?
  12. I have a form with 6 <select> options. All <select> filed will have same values but with different names. Like this: <form action="" method="post"> <select name="var1" class="form-control"> <option value="0">0</option> <option value="10">10</option> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> </select> <select name="var2" class="form-control"> <option value="0">0</option> <option value="10">10</option> <option value="20
  • 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.