Add a checkbox to booking page

342 views
Skip to first unread message

Tamás Orosz

unread,
Mar 12, 2021, 3:24:06 AM3/12/21
to Easy!Appointments - Support Group
Hi!

I'd like to add a checkbox in the booking page (when a customer book an appointment, below the address fields) I already added it in HTML but what else should I add? And how can I store it in database?

Thanks

ayman salah

unread,
Mar 12, 2021, 7:23:51 AM3/12/21
to Easy!Appointments - Support Group
First you need to send your new data to backend
 in fronend_booki.js
fiind .
    exports.updateConfirmFrame = function () {

add your new field to 
 data.customer = { 
              customcheck: $('# customcheck ').prop('checked'),
or you can add it to   data.appointment = { depend on type of the data

now you need to add this field in back end
if this related to customer info you need to add it in Customers_model insert function
if its related to appointment you need to add it in appointments_model insert function
remember you need to add the new field also in the database 

Tamás Orosz

unread,
Mar 12, 2021, 7:41:51 AM3/12/21
to Easy!Appointments - Support Group
Yes thats the idea, I want to add it for the Appointment not for the Customer.
And after that I added to the frontend can you help me what should I add the backend? 

Tamás Orosz

unread,
Mar 12, 2021, 7:45:01 AM3/12/21
to Easy!Appointments - Support Group
I assume I should add a new collumn in 'ea_appointments' table, right? How I will fill it, in the backend?

ayman salah

unread,
Mar 12, 2021, 6:14:20 PM3/12/21
to Easy!Appointments - Support Group
That's right 
           you need to have a column in ea_appointments.
      To store your data you don't need to do any thing, but you need some modification if you want to display it some where depends where,
and remember you need send the correct value as example if you want to store a number value send it like this
  customcheck: $('# customcheck ').prop('checked')?1:0,

Tamás Orosz

unread,
Mar 16, 2021, 6:07:15 PM3/16/21
to Easy!Appointments - Support Group
Ok,  I made this modifications I did the first two suggestions but on the backend I stuck.

I created a new column in 'ea_appointments': customcheck(boolean)

I add it to data.customer: 
customcheck: $('#customcheck').prop('checked') in frontend_book.js.

I added this checkbox into book.php
<div class="form-check mb-3">
                        <input type="checkbox" class="required form-check-input" id="customcheck">
                        <label class="form-check-label">
                            TEST CHECKBOX:
                        </label>
                    </div>

My question is where and what should I add in Customers_model to insert the checkbox value into db?

Thank you!

Tamás Orosz

unread,
Mar 16, 2021, 7:00:52 PM3/16/21
to Easy!Appointments - Support Group
Actually I think it's better to add in Appointsment_model. Why it isn't working? Only add NULL in DB.

   protected function insert($appointment)
    {
        $appointment['book_datetime'] = date('Y-m-d H:i:s');
        $appointment['hash'] = $this->generate_hash();
        $appointment['customcheck'] = $this->input->post('customcheck');



Tamás Orosz

unread,
Mar 31, 2021, 8:57:38 AM3/31/21
to Easy!Appointments - Support Group
I'm still waiting some help with this. Main problem is how can I get the checxbox value in the model?
$appointment['customcheck'] = '1'  if I'm using this default value it's working but put 9 in every record. How can I add the checbox value for this? 

Alex Tselegidis

unread,
Apr 6, 2021, 9:38:43 AM4/6/21
to Easy!Appointments - Support Group
Hello! 

The best way to get started with changes in the app is to check the framework documentation: 



  Alex Tselegidis, Easy!Appointments Creator
  Need a customization? Contact me in person!



Tamás Orosz

unread,
Apr 8, 2021, 11:06:03 AM4/8/21
to Easy!Appointments - Support Group
Finally I can make the first part: get values from the customer on booking page and store it in the database. The second part will be show the value in the Calendar.
Could you help me please how can I get the checboxed value in the appointment modal?

Thanks

Moussa El-hallak

unread,
Apr 10, 2021, 11:31:47 AM4/10/21
to Easy!Appointments - Support Group
Hi ,
Can you please post your solution? I am also trying to insert value into database but it is not working.

Best

Reply all
Reply to author
Forward
0 new messages