Example #1
0
    public function displayListHeader($token = NULL)
    {
        echo '
			<fieldset>
				<legend>' . $this->l('Severity levels') . '</legend>
				<p>' . $this->l('Here\'s the meaning of severity levels:') . '</p>
				<ol>
					<li style="color: green;">' . $this->l('Informative only') . '</li>
					<li style="color: orange;">' . $this->l('Warning') . '</li>
					<li style="color: orange;">' . $this->l('Error') . '</li>
					<li style="color: red;">' . $this->l('Major issue (crash)') . '</li>
				</ol>
			</fieldset>';
        parent::displayListHeader();
    }
Example #2
0
 public function displayListHeader($token = NULL)
 {
     global $currentIndex;
     $id_category = intval(Tools::getValue('id_category'));
     if ($id_category) {
         $currentIndex .= '&id_category=' . $id_category . '&token=' . $this->token;
     }
     parent::displayListHeader($token);
 }
    public function displayListHeader($token = NULL)
    {
        global $currentIndex, $cookie;
        $contacts = Db::getInstance()->ExecuteS('
			SELECT cl.*, COUNT(*) as total, (
				SELECT id_customer_thread
				FROM ' . _DB_PREFIX_ . 'customer_thread ct2
				WHERE status = "open" AND ct.id_contact = ct2.id_contact
				ORDER BY date_upd ASC
				LIMIT 1			
			) as id_customer_thread
			FROM ' . _DB_PREFIX_ . 'customer_thread ct
			LEFT JOIN ' . _DB_PREFIX_ . 'contact_lang cl ON (cl.id_contact = ct.id_contact AND cl.id_lang = ' . $cookie->id_lang . ')
			WHERE ct.status = "open"
			GROUP BY ct.id_contact HAVING COUNT(*) > 0');
        $categories = Db::getInstance()->ExecuteS('
			SELECT cl.*
			FROM ' . _DB_PREFIX_ . 'contact ct
			LEFT JOIN ' . _DB_PREFIX_ . 'contact_lang cl ON (cl.id_contact = ct.id_contact AND cl.id_lang = ' . $cookie->id_lang . ')
			WHERE ct.customer_service = 1');
        $dim = count($categories);
        echo '<div style="float:left;border:0;width:640px;">';
        foreach ($categories as $key => $val) {
            $totalThread = 0;
            $id_customer_thread = 0;
            foreach ($contacts as $tmp => $tmp2) {
                if ($val['id_contact'] == $tmp2['id_contact']) {
                    $totalThread = $tmp2['total'];
                    $id_customer_thread = $tmp2['id_customer_thread'];
                    break;
                }
            }
            echo '<div style="background-color:#EFEFEF;float:left;margin:0 10px 10px 0;width:' . ($dim > 6 ? '200' : '300') . 'px;border:1px solid #CFCFCF" >
					<h3 style="overflow:hidden;line-height:25px;color:#812143;height:25px;margin:0;">&nbsp;' . $val['name'] . '</h3>' . ($dim > 6 ? '' : '<p style="overflow:hidden;line-height:15px;height:45px;margin:0;padding:0 5px;">' . $val['description'] . '</p>') . ($totalThread == 0 ? '<h3 style="padding:0 5px;margin:0;height:23px;line-height:23px;background-color:#DEDEDE">' . $this->l('No new message') . '</h3>' : '<a href="' . $currentIndex . '&token=' . Tools::getValue('token') . '&id_customer_thread=' . $id_customer_thread . '&viewcustomer_thread" style="padding:0 5px;display:block;height:23px;line-height:23px;border:0;" class="button">' . $totalThread . ' ' . ($totalThread > 1 ? $this->l('new messages') : $this->l('new message')) . '</a>') . '
				</div>';
        }
        echo '</div>';
        $params = array($this->l('Total threads') => $all = Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'customer_thread'), $this->l('Threads pending') => $pending = Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'customer_thread WHERE status LIKE "%pending%"'), $this->l('Total customer messages') => Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'customer_message WHERE id_employee = 0'), $this->l('Total employee messages') => Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'customer_message WHERE id_employee != 0'), $this->l('Threads unread') => $unread = Db::getInstance()->getValue('SELECT COUNT(*) FROM ' . _DB_PREFIX_ . 'customer_thread WHERE status = "open"'), $this->l('Threads closed') => $all - ($unread + $pending));
        echo '<div style="float:right;padding 0px;border:1px solid #CFCFCF;width:280px;">
				<h3 class="button" style="margin:0;line-height:23px;height:23px;border:0;padding:0 5px;">' . $this->l('Customer service') . ' : ' . $this->l('Statistics') . '</h3>
				<table cellspacing="1" class="table" style="border-collapse:separate;width:280px;border:0">';
        $count = 0;
        foreach ($params as $key => $val) {
            echo '<tr ' . (++$count % 2 == 0 ? 'class="alt_row"' : '') . '><td>' . $key . '</td><td>' . $val . '</td></tr>';
        }
        echo '	</table>
			</div><p class="clear">&nbsp;</p>';
        parent::displayListHeader($token);
    }
 public function displayListHeader($token = NULL)
 {
     echo '<style type="text/css">form.form>table, form.form table.table { width: 100%; }</style>', "\n";
     return parent::displayListHeader($token);
 }