| Server IP : 14.225.204.176 / Your IP : 216.73.216.252 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/wit-crm/application/controllers/ |
Upload File : |
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Contract extends ClientsController
{
public function index($id, $hash)
{
check_contract_restrictions($id, $hash);
$contract = $this->contracts_model->get($id);
if (!$contract) {
show_404();
}
if (!is_client_logged_in()) {
load_client_language($contract->client);
}
if ($this->input->post()) {
$action = $this->input->post('action');
switch ($action) {
case 'contract_pdf':
$pdf = contract_pdf($contract);
$pdf->Output(slug_it($contract->subject . '-' . get_option('companyname')) . '.pdf', 'D');
break;
case 'sign_contract':
process_digital_signature_image($this->input->post('signature', false), CONTRACTS_UPLOADS_FOLDER . $id);
$this->contracts_model->add_signature($id);
set_alert('success', _l('document_signed_successfully'));
redirect(site_url('contract/' . $id. '/' . $hash));
break;
case 'contract_comment':
// comment is blank
if (!$this->input->post('content')) {
redirect($this->uri->uri_string());
}
$data = $this->input->post();
$data['contract_id'] = $id;
$this->contracts_model->add_comment($data, true);
redirect($this->uri->uri_string() . '?tab=discussion');
break;
}
}
$this->disableNavigation();
$this->disableSubMenu();
$data['title'] = $contract->subject;
$data['contract'] = hooks()->apply_filters('contract_html_pdf_data', $contract);
$data['bodyclass'] = 'contract contract-view';
$data['identity_confirmation_enabled'] = true;
$data['bodyclass'] .= ' identity-confirmation';
$this->app_scripts->theme('sticky-js','assets/plugins/sticky/sticky.js');
$data['comments'] = $this->contracts_model->get_comments($id);
//add_views_tracking('proposal', $id);
hooks()->do_action('contract_html_viewed', $id);
$this->app_css->remove('reset-css','customers-area-default');
$data = hooks()->apply_filters('contract_customers_area_view_data', $data);
$this->data($data);
no_index_customers_area();
$this->view('contracthtml');
$this->layout();
}
}