Ejemplo n.º 1
0
 function showCommunicationTable($message = '')
 {
     $headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.sms'), Language::linkSms()), 'label' => Language::linkSms());
     $headers[] = array('link' => '', 'label' => Language::labelSMSCommunicationTable());
     $returnStr = $this->showSmsHeader($headers);
     //CONTENT
     $returnStr .= $message;
     $urid = loadvar('selurid', 0);
     $returnStr .= $this->displayInterviewerDropDown('sysadmin.sms.communication', $urid);
     $communication = new Communication();
     if ($urid > 0) {
         $list = $communication->getAllUserCommunication($urid);
         //getAllUserQueries($urid);
         $hnidTexts = array();
         if (sizeof($list) > 0) {
             $returnStr .= '<br/><table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered">';
             $returnStr .= '<tr><th>' . Language::labelSMSCommunicationTableHnid() . '</th><th>' . Language::labelSMSCommunicationTableTs() . '</th><th>' . Language::labelSMSCommunicationTableDataType() . '</th><th>' . Language::labelSMSCommunicationTableInsertTs() . '</th><th>' . Language::labelSMSCommunicationTableReceived() . '</th><th>' . Language::labelSMSCommunicationTableReceivedTs() . '</th><th>' . Language::labelSMSCommunicationTableDirection() . '</th><th>' . Language::labelSMSCommunicationTableFileName() . '</th></tr>';
             foreach ($list as $item) {
                 $returnStr .= '<tr><td>';
                 $hnidTexts[$item['hnid']] = cutOffString('SQL:<br/>' . $communication->decryptAndUncompress($item['sqlcode']), 800);
                 $returnStr .= '<a title="' . Language::linkEditTooltip() . '" onclick="$(\'#hnid' . $item['hnid'] . '\').modal(\'show\');"><span class="glyphicon glyphicon-eye-open"></span></a>';
                 $returnStr .= '&nbsp;&nbsp;<a title="' . Language::linkRemoveTooltip() . '" href="' . setSessionParams(array('page' => 'sysadmin.sms.communication.remove', 'hnid' => $item['hnid'])) . '&selurid=' . $urid . '"><span class="glyphicon glyphicon-remove"></span></a>';
                 $returnStr .= '&nbsp;&nbsp;' . $item['hnid'] . '</td>';
                 $returnStr .= '<td>' . $item['ts'] . '</td>';
                 $returnStr .= '<td>' . $item['datatype'] . '</td>';
                 $returnStr .= '<td>' . $item['insertts'] . '</td>';
                 $returnStr .= '<td>' . $item['received'] . '</td>';
                 $returnStr .= '<td>' . $item['receivedts'] . '</td>';
                 $returnStr .= '<td>' . $item['direction'] . '</td>';
                 $returnStr .= '<td>' . $item['filename'] . '</td>';
                 $returnStr .= '</tr>';
             }
             $returnStr .= '</table>';
             //modal forms
             foreach ($hnidTexts as $key => $text) {
                 $returnStr .= $this->showModalForm('hnid' . $key, $text);
             }
         } else {
             $returnStr .= "<br/><br/>" . $this->displayInfo(Language::labelSMSCommunicationTableNoneFound());
         }
     }
     //        $returnStr .= '<input type="submit" class="btn btn-default" value="Update all interviewer laptops"/>';
     //        $returnStr .= '</form>';
     $returnStr .= '</form>';
     //END CONTENT
     $returnStr .= '</p></div>    </div>';
     //container and wrap
     $returnStr .= $this->showBottomBar();
     $returnStr .= $this->showFooter(false);
     return $returnStr;
 }