| Server IP : 103.161.17.216 / Your IP : 216.73.216.1 Web Server : nginx/1.18.0 System : Linux tipsysaigoncharming 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/app.houseland.info/application/services/proposals/ |
Upload File : |
<?php
namespace app\services\proposals;
use app\services\AbstractKanban;
class ProposalsPipeline extends AbstractKanban
{
protected function table(): string
{
return 'proposals';
}
public function defaultSortDirection()
{
return get_option('default_proposals_pipeline_sort_type');
}
public function defaultSortColumn()
{
return get_option('default_proposals_pipeline_sort');
}
public function limit()
{
return get_option('proposals_pipeline_limit');
}
protected function applySearchQuery($q): self
{
if (!startsWith($q, '#')) {
$q = $this->ci->db->escape_like_str($q);
$this->ci->db->where('(
phone LIKE "%' . $q . '%" ESCAPE \'!\'
OR
zip LIKE "%' . $q . '%" ESCAPE \'!\'
OR
content LIKE "%' . $q . '%" ESCAPE \'!\'
OR
state LIKE "%' . $q . '%" ESCAPE \'!\'
OR
city LIKE "%' . $q . '%" ESCAPE \'!\'
OR
email LIKE "%' . $q . '%" ESCAPE \'!\'
OR
address LIKE "%' . $q . '%" ESCAPE \'!\'
OR
proposal_to LIKE "%' . $q . '%" ESCAPE \'!\'
OR
total LIKE "%' . $q . '%" ESCAPE \'!\'
OR
subject LIKE "%' . $q . '%" ESCAPE \'!\')');
} else {
$this->ci->db->where(db_prefix() . 'proposals.id IN
(SELECT rel_id FROM ' . db_prefix() . 'taggables WHERE tag_id IN
(SELECT id FROM ' . db_prefix() . 'tags WHERE name="' . $this->ci->db->escape_str(strafter($q, '#')) . '")
AND ' . db_prefix() . 'taggables.rel_type=\'proposal\' GROUP BY rel_id HAVING COUNT(tag_id) = 1)
');
}
return $this;
}
protected function initiateQuery(): self
{
$has_permission_view = staff_can('view', 'proposals');
$noPermissionQuery = get_proposals_sql_where_staff(get_staff_user_id());
$this->ci->db->select('id,invoice_id,estimate_id,subject,rel_type,rel_id,total,date,open_till,currency,proposal_to,status');
$this->ci->db->from('proposals');
$this->ci->db->where('status', $this->status);
if (!$has_permission_view) {
$this->ci->db->where($noPermissionQuery);
}
return $this;
}
}