| return ""; | return ""; | ||||
| } | } | ||||
| public function get_tos_full_str($ndis_code) | |||||
| { | |||||
| foreach ($this->tos as $r){ | |||||
| if ($ndis_code == $r->code){ | |||||
| return sprintf("%.2f - %s %s %s", | |||||
| (float) $r->price, | |||||
| $r->name, | |||||
| $this->get_level((int) $r->level), | |||||
| $r->ot); | |||||
| } | |||||
| } | |||||
| return ""; | |||||
| } | |||||
| public function get_tos_price($ndis_code) | public function get_tos_price($ndis_code) | ||||
| { | { | ||||
| foreach ($this->tos as $r){ | foreach ($this->tos as $r){ |
| animation: blinker 0.3s linear infinite; | animation: blinker 0.3s linear infinite; | ||||
| } | } | ||||
| td.invoice_summary{ | |||||
| text-align:center; | |||||
| background-color:lightcyan; | |||||
| font-weight:900; | |||||
| color:green; | |||||
| } | |||||
| td.invoice_summary_header{ | |||||
| background-color: #ededed; | |||||
| } |
| </td> | </td> | ||||
| </tr> | </tr> | ||||
| {{/jobs}} | {{/jobs}} | ||||
| {{#has_summary}} | |||||
| <tr> | |||||
| <td colspan=9 class=invoice_summary> | |||||
| Summary for above client | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td></td> | |||||
| <td class="invoice_summary_header" colspan=1>Name of Service</td> | |||||
| <td class="invoice_summary_header" colspan=2>NDIS code</td> | |||||
| <td class="invoice_summary_header" colspan=1>Total Hours</td> | |||||
| <td class="invoice_summary_header" colspan=3> </td> | |||||
| <td></td> | |||||
| </tr> | |||||
| {{/has_summary}} | |||||
| {{#summary}} | |||||
| <tr> | |||||
| <td></td> | |||||
| <td colspan=1>{{tos}}</td> | |||||
| <td colspan=2>{{ndis}}</td> | |||||
| <td colspan=1>{{Hours}}</td> | |||||
| <td colspan=3> </td> | |||||
| <td></td> | |||||
| </tr> | |||||
| {{/summary}} | |||||
| {{#has_summary}} | |||||
| <tr> | |||||
| <td></td> | |||||
| <td class="invoice_summary_header" colspan=1>Name of Service</td> | |||||
| <td class="invoice_summary_header" colspan=2>NDIS code</td> | |||||
| <td class="invoice_summary_header" colspan=1>Total Hours</td> | |||||
| <td class="invoice_summary_header" colspan=3> </td> | |||||
| <td></td> | |||||
| <tr> | |||||
| <td colspan=9 class=invoice_summary> | |||||
| End of summary | |||||
| </td> | |||||
| </tr> | |||||
| </tr> | |||||
| {{/has_summary}} | |||||
| </tbody> | </tbody> | ||||
| </table> | </table> | ||||
| </td> | </td> |
| Dear Helen, | |||||
| This is your Feedback link for | |||||
| === {{display_name}} ===== | |||||
| SMS content below: | |||||
| ------------- copy from here ----------------- | |||||
| Dear {{display_name}}, | |||||
| please use it confirm our staff has provided service for you | |||||
| http://acaresydney.com.au/feedback_card/{{user_login}} | |||||
| ------------- copy end here-------------------- | |||||
| ************************************************************** | |||||
| Please DO NOT click this link on your office computer, | |||||
| you will become this customer instead of timesheet manager. | |||||
| If you happen to click it by mistake, | |||||
| please contact your IT support to have this error fixed. | |||||
| ************************************************************** | |||||
| Kind Regards | |||||
| Team of | |||||
| AcareSydney WebOffice | |||||
| Hotline 02 8103 5092 |
| $( ".boundary_datepicker" ).datepicker(); | $( ".boundary_datepicker" ).datepicker(); | ||||
| $( ".boundary_datepicker" ).datepicker("option", "dateFormat", "yy-mm-dd"); | $( ".boundary_datepicker" ).datepicker("option", "dateFormat", "yy-mm-dd"); | ||||
| $(document).on('click', 'div.clientlist div[name="title"] a', function(e){ | |||||
| e.preventDefault(); | |||||
| e.stopPropagation(); | |||||
| var id = $(this).closest('label.peopleitem').attr('data-id').substring(1); | |||||
| var str = 'https://acaresydncy.com.au/feedback_card/' + id; | |||||
| var name = $(this).html(); | |||||
| if ( confirm ("Email feedback link of : " + name + "\n\n\n" + str + "\n\n\n to helen@acaresydney.com.au?")){ | |||||
| $.post(bts().ajax_url, { // POST request | |||||
| _ajax_nonce: bts().nonce, // nonce | |||||
| action: "email_feedback_url", // action | |||||
| client : id, | |||||
| }, function(response, status, xhr){ | |||||
| //alert('please check your email on the phone and SMS the link to your client'); | |||||
| }).fail(function(){ | |||||
| alert('network error '); | |||||
| }); | |||||
| } | |||||
| }); | |||||
| init_ts(); | init_ts(); | ||||
| add_action('wp_ajax_list_job', array($this,'list_job' )); | add_action('wp_ajax_list_job', array($this,'list_job' )); | ||||
| add_action('wp_ajax_delete_job', array($this,'delete_job' )); | add_action('wp_ajax_delete_job', array($this,'delete_job' )); | ||||
| add_action('wp_ajax_email_job', array($this,'email_job' )); | add_action('wp_ajax_email_job', array($this,'email_job' )); | ||||
| add_action('wp_ajax_email_feedback_url', array($this,'email_feedback_url' )); | |||||
| add_action('wp_ajax_earnings_rate', array($this,'get_payitem_earnings_rate' )); | add_action('wp_ajax_earnings_rate', array($this,'get_payitem_earnings_rate' )); | ||||
| add_action('wp_ajax_nopriv_earnings_rate', array($this,'get_payitem_earnings_rate' )); | add_action('wp_ajax_nopriv_earnings_rate', array($this,'get_payitem_earnings_rate' )); | ||||
| wp_mail($staff->user_email, $subject, $message, $headers); | wp_mail($staff->user_email, $subject, $message, $headers); | ||||
| } | } | ||||
| private function send_email_feedback_url($client) | |||||
| { | |||||
| $message = file_get_contents(plugin_dir_path(__FILE__) . "/html/email_feedback_url.html"); | |||||
| $message = str_ireplace("{{display_name}}", $client->display_name, $message); | |||||
| $message = str_ireplace("{{user_login}}", $client->user_login, $message); | |||||
| $headers = ['Bcc: helenwang41@hotmail.com, timesheet@acaresydney.com.au']; | |||||
| $subject = $client->display_name . " Feedback Link"; | |||||
| wp_mail( "helen@acaresydney.com.au", $subject, $message, $headers); | |||||
| //wp_mail( "patrick@biukop.com.au", $subject, $message, $headers); | |||||
| } | |||||
| public function bts_staff_item($attr){ | public function bts_staff_item($attr){ | ||||
| return $this->template('staff_item', 'staff.html'); | return $this->template('staff_item', 'staff.html'); | ||||
| } | } | ||||
| wp_send_json($response); | wp_send_json($response); | ||||
| } | } | ||||
| //ajax email feedback url | |||||
| function email_feedback_url() | |||||
| { | |||||
| check_ajax_referer('acaresydney'); | |||||
| $client = $_POST['client']; | |||||
| $response=array( | |||||
| 'status' => 'success', | |||||
| 'error' => '', | |||||
| 'sent' => false, | |||||
| 'emailstatus' =>'not sent', | |||||
| ); | |||||
| $u = get_user_by('login', $client); | |||||
| if ($this->is_client($u)){ | |||||
| $status = $this->send_email_feedback_url($u); | |||||
| $response['emailstatus'] = $status; | |||||
| } | |||||
| wp_send_json($response); | |||||
| } | |||||
| //ajax browse job with different filters | //ajax browse job with different filters | ||||
| function list_job(){ | function list_job(){ | ||||
| check_ajax_referer('acaresydney'); | check_ajax_referer('acaresydney'); | ||||
| $description = $this->get_job_description_for_invoice($price, $r); | $description = $this->get_job_description_for_invoice($price, $r); | ||||
| $data = [ | $data = [ | ||||
| 'tos' => $price->get_tos_str($r->tos), | |||||
| 'tos' => $price->get_tos_full_str($r->tos), | |||||
| 'start' => $r->start, | 'start' => $r->start, | ||||
| 'finish' => $r->finish, | 'finish' => $r->finish, | ||||
| 'hours' => $quantity, | 'hours' => $quantity, | ||||
| { | { | ||||
| $response['summary'][] = array( | $response['summary'][] = array( | ||||
| 'ndis' => $key, | 'ndis' => $key, | ||||
| 'tos' => $price->get_tos_str($key), | |||||
| 'tos' => $price->get_tos_full_str($key), | |||||
| 'Hours'=> $val, | 'Hours'=> $val, | ||||
| ); | ); | ||||
| } | } | ||||
| if (count($summary) > 0){ | |||||
| $response['has_summary'] = true; | |||||
| } | |||||
| wp_send_json($response); | wp_send_json($response); |