Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8484025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:16:06+00:00 2026-06-10T20:16:06+00:00

The issue: I have a timesheet application. It has an SQlite database. I am

  • 0

The issue:

I have a timesheet application. It has an SQlite database. I am trying to find a way to present a GUI so that if the user clicks a square(a ) i need to paas the data from the template to the model (paris) so i can save it in theb SQlite database.

There are three tables one for users one for the timesheet and one for the department.

It is a timesheet like application.

The setup:

Slim php
Idiorm/Paris
SQlite3

Does anyone know a good way to make the user click a so that the data is passed on to the model from the view?

Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:16:07+00:00Added an answer on June 10, 2026 at 8:16 pm

    Imagine this is your view

    <html> 
       <head>
       $(document).ready(function() {
                $("#add").on("click", function(e) {
                    var user_id = $('#user_id').val();
                    var time = date();
                    var department = $('#department').val();
                    var data = {uid:user_id, time:time, dept:department};
                    $.ajax({
                        url: "add_into_db.php",
                        type: 'POST',
                        data: data,
                        success: function(msg) {
                           if(msg=="true"){
                                alert("Your dats is inserted successfully");
                                document.location.reload(true);
                            }
                            else{
                                 alert("Your data insertion failed");
                                  return false;
                            }
                        }
                    });
                    e.preventDefault();      
                });
            });
       </head>
    
       <body>
         // Some html here
         // input field for user
         // input field for time
         // input field for department
         // whatever data you want os send on click, include it here
         <input id ='add' type= 'submit' value 'Add'/> //Your submit button to add data via AJAX
       </body>
    

    Yout php function which will add data into database

    function add_into_db(){
      $user id = $_POST['user_id'];
      $time = $_POST['time'];
      $dept = $_POST['department'];
    
      // connect to your db
      // run your insert query
    
      If (insertion is successfull) {
         $msg = 'true';
         echo $msg;
      }
      else{
         $msg = 'false';
        echo $msg
      }
    }
    

    Hope it ill help you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Issue context: Have a piece of code that's trying to add a new document
I have issue with url rewrite. I have a site example.com that has a
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
The issue I have is that I want to parse strings in order, so
Here's the issue: I have 2 data contexts that I would like to do
Here's the issue: I have a list of App names that I want to
In my application I have a datagrid that populates with info from a SQLserver
Ran into an issue today that I have not been able to resolve. I
I have the following issue: I have a MVC application, in some action of
ISSUE: I have an asp.net mvc 3 app. I'm using EF 4.1 and trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.