public function displayInterviewers($interviewers, $message = '') { // $returnStr = $this->showHeader(Language::messageSMSTitle(), '<link href="bootstrap/css/sticky-footer-navbar.min.css" rel="stylesheet">'); $returnStr = $this->displayHeaderForTable(Language::messageSMSTitle(), $message); $returnStr .= '<div id="wrap">'; $returnStr .= $this->showNavBar(); $returnStr .= '<div class="container"><p>'; $returnStr .= '<br/><br/><br/>'; $returnStr .= '<ol class="breadcrumb">'; $returnStr .= '<li class="active">' . Language::labelSuperVisorInterviewers() . '</li>'; // $returnStr .= '<li>' . Language::labelInterviewers() . '</li>'; $returnStr .= '</ol>'; //CONTENT if (sizeof($interviewers) > 0) { $returnStr .= ' <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example"> <thead> <tr> <th>' . Language::labelSuperVisorInterviewersUrid() . '</th> <th>' . Language::labelSuperVisorInterviewersName() . '</th> <th>' . Language::labelSuperVisorInterviewersUsername() . '</th> <th>' . Language::labelSuperVisorInterviewersContacts() . '</th> <th>' . Language::labelSuperVisorInterviewersCompleted() . '</th> <th>' . Language::labelSuperVisorInterviewersRefused() . '</th> <th>' . Language::labelSuperVisorInterviewersLastUpload() . '</th> </tr> </thead> <tbody>'; $communication = new Communication(); foreach ($interviewers as $interviewer) { $returnStr .= '<tr><td>' . $interviewer->getUrid() . '</td>'; $returnStr .= '<td>' . setSessionParamsHref(array('page' => 'supervisor.interviewer.info', 'interviewer' => $interviewer->getUrid()), $interviewer->getName()) . '</td>'; $returnStr .= '<td>' . $interviewer->getUsername() . '</td>'; $returnStr .= '<td>' . sizeof($interviewer->getContacts()) . '</td>'; $returnStr .= '<td>' . sizeof($interviewer->getCompleted()) . '</td>'; $returnStr .= '<td>' . sizeof($interviewer->getRefusals()) . '</td>'; $returnStr .= '<td>' . $communication->getLastUploaded($interviewer->getUrid()) . '</td>'; $returnStr .= '</tr>'; } $returnStr .= '</tbody></table>'; } else { $returnStr .= $this->displayInfo(Language::labelSupervisorNoInterviewersAssigned()); } //END CONTENT $returnStr .= '</p></div></div> '; // </div>'; //container and wrap $returnStr .= $this->showBottomBar(); $returnStr .= $this->showFooter(false); return $returnStr; }
function StoreFile($_visitor, $_browserId, $_partner, $_fullname, $_chatId) { $filename = IOStruct::GetNamebase($_FILES['form_userfile']['name']); Logging::GeneralLog($filename); if (!IOStruct::IsValidUploadFile($filename)) { return false; } if (empty($_fullname)) { $_fullname = Visitor::GetNoName($_visitor->UserId . Communication::GetIP()); } $fileid = md5($filename . $_visitor->UserId . $_browserId); $fileurid = EX_FILE_UPLOAD_REQUEST . "_" . $fileid; $filemask = $_visitor->UserId . "_" . $fileid; $request = new FileUploadRequest($fileurid, $_partner, $_chatId); $request->Load(); if ($request->Permission == PERMISSION_FULL) { if (move_uploaded_file($_FILES["form_userfile"]["tmp_name"], PATH_UPLOADS . $request->FileMask)) { KnowledgeBase::CreateFolders($_partner, false); KnowledgeBase::Process($_partner, $_visitor->UserId, $_fullname, 0, $_fullname, 0, 5, 3); KnowledgeBase::Process($_partner, $fileid, $filemask, 4, $_FILES["form_userfile"]["name"], 0, $_visitor->UserId, 4, $_FILES["form_userfile"]["size"]); $request->Download = true; $request->Save(); return true; } else { $request->Error = true; $request->Save(); } } return false; }
public function add($order_id) { AuthPlugins::required($this, array('销售经理', '销售顾问')); $order_id = abs(intval($order_id)); $content = trim(nl2br(strip_tags($_POST['content']))); if (!$order_id || !$this->is_post() || !$content) { return false; } parent::load('model', 'Order.Communication'); $c = new Communication(); $c->order_id = $order_id; $c->content = $content; $c->user_id = User::info('id'); $c->save(); echo 'ok'; }
function GroupBuilder($_reqGroup = "", $_reqOperator = "", $allowCom = true) { $reqGroup = UserGroup::ReadParams(); $this->ReqGroup = !empty($reqGroup) ? $reqGroup : $_reqGroup; $this->ReqOperator = !empty($_GET[GET_EXTERN_INTERN_USER_ID]) ? Encoding::Base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]) : $_reqOperator; $this->GroupValues["groups_online"] = array(); $this->GroupValues["groups_offline"] = array(); $this->GroupValues["groups_online_amounts"] = array(); $this->GroupValues["groups_output"] = array(); $this->GroupValues["groups_hidden"] = array(); $this->GroupValues["set_by_get_user"] = null; $this->GroupValues["set_by_get_group"] = null; $this->GroupValues["set_by_cookie"] = null; $this->GroupValues["set_by_standard"] = null; $this->GroupValues["set_by_online"] = null; $this->GroupValues["req_for_user"] = !empty($this->ReqOperator); $this->GroupValues["req_for_group"] = !empty($this->ReqGroup); $this->Parameters = Communication::GetTargetParameters($allowCom); if ($this->Parameters["include_group"] != null || $this->Parameters["include_user"] != null) { foreach (Server::$Groups as $gid => $group) { if (!($this->Parameters["include_group"] != null && in_array($gid, $this->Parameters["include_group"]))) { if (!($this->Parameters["include_user"] != null && in_array($gid, Server::$Operators[Operator::GetSystemId($this->Parameters["include_user"])]->GetGroupList(false)))) { $this->GroupValues["groups_hidden"][] = $gid; } } } } if ($this->Parameters["exclude"] != null) { $this->GroupValues["groups_hidden"] = $this->Parameters["exclude"]; } }
static function SendTestMail($amount = 0) { Logging::SecurityLog("ServerManager::SendTestMail", "", CALLER_SYSTEM_ID); if (OperatorRequest::IsValidated() && OperatorRequest::IsAdministrator(true)) { $account = Mailbox::GetById($_POST["p_mailbox"]); try { if ($account->Type == "IMAP" || $account->Type == "POP") { $reload = false; $amount = $account->Download($reload, false, true); $return = 1; } else { $return = Communication::SendEmail($account, $account->Email, $account->Email, "LiveZilla Test Mail", "", "LiveZilla Test Mail", true); } } catch (Exception $e) { Logging::GeneralLog(serialize($e)); $return = $e->getMessage(); } if (is_array($amount)) { $amount = count($amount); } if ($return == 1) { Server::$Response->SetStandardResponse(1, base64_encode($amount)); } else { Server::$Response->SetStandardResponse(2, base64_encode($return)); } } }
public function request($request, $hash_config = NULL, $useSimpleXml) { $response = Communication::httpRequest($request, $hash_config); if ($useSimpleXml) { $respObj = simplexml_load_string($response); } else { $respObj = XmlParser::domParser($response); } return $respObj; }
function isChat() { define("SESSION", getSessionId()); Server::InitDataBlock(array("FILTERS")); define("IS_FLOOD", Filter::IsFlood(Communication::GetIP(), null, true)); define("IS_FILTERED", DataManager::$Filters->Match(Communication::GetIP(), LocalizationManager::ImplodeLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), SESSION)); $parameters = Communication::GetTargetParameters(); if (operatorsAvailable(0, $parameters["exclude"], $parameters["include_group"], $parameters["include_user"]) > 0) { return true; } return false; }
function showDocumenation() { $returnStr = $this->showResearchHeader(Language::messageSMSTitle()); $returnStr .= '<div id="wrap">'; $returnStr .= $this->showNavBar(); $returnStr .= '<div class="container"><p>'; //CONTENT $returnStr .= '<ol class="breadcrumb">'; $returnStr .= '<li class="active">' . Language::labelOutputDocumentation() . '</li>'; $returnStr .= '</ol>'; $communication = new Communication(); $files = array(); $communication->getScriptFiles($files, 'documentation'); $oldDirStr = ''; if (sizeof($files) > 0) { foreach ($files as $file) { $ext = pathinfo($file, PATHINFO_EXTENSION); if ($ext == 'html' || $ext == 'doc' || $ext == 'docx') { $dirStr = ''; $dir = preg_replace('#/+#', '', dirname($file)); if ($dir != '') { $dirStr = $dir . ': '; } if ($oldDirStr != $dirStr && $oldDirStr != '') { $returnStr .= '<hr>'; } $oldDirStr = $dirStr; $returnStr .= $dirStr . '<a href="documentation' . $file . '" target="_blank">' . basename($file) . '</a><br/>'; } } } else { $returnStr .= $this->displayWarning(Language::labelResearcherNoDocs()); } //ENDCONTENT $returnStr .= '</p></div> </div>'; //container and wrap $returnStr .= $this->showBottomBar(); $returnStr .= $this->showFooter(false); return $returnStr; }
public function actionPrintAgendaMaker($id) { date_default_timezone_set("Asia/Manila"); $activity = new Activity(); $activity->act_desc = 'Printed Agenda ID: ' . $id; $activity->act_datetime = date('Y-m-d G:i:s'); $activity->act_by = User::model()->findByPK(Yii::app()->user->name)->emp_id; $activity->save(); $model = Agenda::model()->findByPK($id); $communication = Communication::model()->findAll(array('condition' => 'date_agenda = :date_agenda', 'params' => array(':date_agenda' => $model->session_date))); $resoMeeting = CommMeetingReso::model()->findAll(array('condition' => 'comm_report = :comm_report', 'params' => array(':comm_report' => $model->session_date))); $ordMeeting = CommMeetingOrdi::model()->findAll(array('condition' => 'comm_report = :comm_report', 'params' => array(':comm_report' => $model->session_date))); $this->renderPartial('printAgendaMaker', array('model' => $model, 'communication' => $communication, 'resoMeeting' => $resoMeeting, 'ordMeeting' => $ordMeeting)); }
static function httpRequest($req, $hash_config = NULL) { $config = Obj2xml::getConfig($hash_config); if ((int) $config['print_xml']) { echo $req; } $ch = curl_init(); curl_setopt($ch, CURLOPT_PROXY, $config['proxy']); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: text/xml')); curl_setopt($ch, CURLOPT_URL, $config['url']); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true); curl_setopt($ch, CURLOPT_TIMEOUT, $config['timeout']); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSLVERSION, 6); Mage::log("vantiv tracking - ch: " . print_r($ch, true), null, "litle_transaction.log"); if (Mage::getStoreConfig('payment/CreditCard/debug_enable')) { $xmlToPrint = Communication::cleanseAccountNumber($req); $xmlToPrint = Communication::cleanseCardValidationNum($xmlToPrint); $xmlToPrint = Communication::cleansePassword($xmlToPrint); Mage::log($xmlToPrint, null, "litle_transaction.log"); } $output = curl_exec($ch); Mage::log("vantiv tracking - output: " . print_r($output, true), null, "litle_transaction.log"); if (Mage::getStoreConfig('payment/CreditCard/debug_enable')) { $xmlToPrint = Communication::cleanseAccountNumber($output); Mage::log($xmlToPrint, null, "litle_transaction.log"); } $responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); if (!$output) { throw new Exception(curl_error($ch)); } else { curl_close($ch); return $output; } }
<div id="header"> <div id="logo"><img src="images/banner.png" style="width: 100vw;"/></div> </div><!-- header --> <div class="container" id="page" > <?php $countNotif = count(ForumQuestion::model()->findAll(array('condition' => 'confirmation=0'))); $notif = $this->widget('bootstrap.widgets.TbBadge', array('type' => $countNotif == 0 ? 'info' : 'important', 'label' => $countNotif), true); $receiving = count(Communication::model()->findAll(array('condition' => 'type_comm = 2 and now() >= date_agenda '))); $notifRC = $this->widget('bootstrap.widgets.TbBadge', array('type' => $receiving == 0 ? 'info' : 'important', 'label' => $receiving), true); $referralCount = count(Communication::model()->findAll(array('condition' => 'archive=0 and comm_stat=0 and type_comm<>2'))); $referralduedateCount = count(Referral::model()->findAll(array('condition' => 'referral_stat = 0 and now() > duedate'))); $meetingResoCount = count(Referral::model()->countCommMeetingReso()); $meetingOrdiCount = count(Referral::model()->countCommMeetingOrdi()); $rfTotal = 0; $rfTotal = $referralCount + $meetingOrdiCount + $meetingResoCount + $referralduedateCount; $notifRFTotal = $this->widget('bootstrap.widgets.TbBadge', array('type' => $rfTotal == 0 ? 'info' : 'important', 'label' => $rfTotal), true); $notifRFrefduedate = $this->widget('bootstrap.widgets.TbBadge', array('type' => $referralduedateCount == 0 ? 'info' : 'important', 'label' => $referralduedateCount), true); $notifRFref = $this->widget('bootstrap.widgets.TbBadge', array('type' => $referralCount == 0 ? 'info' : 'important', 'label' => $referralCount), true); $notifRFreso = $this->widget('bootstrap.widgets.TbBadge', array('type' => $meetingResoCount == 0 ? 'info' : 'important', 'label' => $meetingResoCount), true); $notifRFordi = $this->widget('bootstrap.widgets.TbBadge', array('type' => $meetingOrdiCount == 0 ? 'info' : 'important', 'label' => $meetingOrdiCount), true); $resoCount = count(Status::model()->countResolution()); $ordiCount = count(CommMeetingOrdi::model()->findAll(array('condition' => 'archive=0 and comm_meeting_stat=1 and ord_remark=0 and action_taken=1'))); $tTotal = 0; $tTotal = $resoCount + $ordiCount; $notifTtotal = $this->widget('bootstrap.widgets.TbBadge', array('type' => $tTotal == 0 ? 'info' : 'important', 'label' => $tTotal), true);
$html = str_replace("<!--function_chat-->", To::BoolString(empty($_GET["hfc"])), $html); $html = str_replace("<!--function_knowledgebase-->", To::BoolString(empty($_GET["hfk"]) && !empty(Server::$Configuration->File["gl_knba"])), $html); $html = str_replace("<!--hide_group_select_chat-->", To::BoolString(Communication::GetParameter("hcgs", 0, $nu, FILTER_VALIDATE_INT) == "1" || !empty($_GET[GET_EXTERN_DYNAMIC_GROUP])), $html); $html = str_replace("<!--hide_group_select_ticket-->", To::BoolString(Communication::GetParameter("htgs", 0, $nu, FILTER_VALIDATE_INT) == "1"), $html); $html = str_replace("<!--require_group_selection-->", To::BoolString(Communication::GetParameter("rgs", 0, $nu, FILTER_VALIDATE_INT) == "1"), $html); $html = str_replace("<!--offline_message_pop-->", To::BoolString(!empty(Server::$Configuration->File["gl_om_pop_up"]) || empty(Server::$Configuration->File["gl_om_mode"])), $html); $html = str_replace("<!--dynamic_group-->", !empty(VisitorChat::$DynamicGroup) ? base64_encode(Server::$Groups[VisitorChat::$DynamicGroup]->Descriptions["EN"]) : "", $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame_lgin") { $html = IOStruct::GetFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = isset(Server::$Configuration->File["gl_site_name"]) ? str_replace("<!--config_name-->", Server::$Configuration->File["gl_site_name"], $html) : str_replace("<!--config_name-->", "LiveZilla", $html); $html = getChatLoginInputs($html, MAX_INPUT_LENGTH); $html = str_replace("<!--alert-->", getAlertTemplate(), $html); $html = str_replace("<!--com_chats-->", getChatVoucherTemplate(), $html); $html = str_replace("<!--ssl_secured-->", Communication::GetScheme() == SCHEME_HTTP_SECURE && !empty(Server::$Configuration->File["gl_sssl"]) ? "" : "display:none;", $html); $html = str_replace("<!--bgc-->", $color = Communication::ReadParameter("epc", "#73be28"), $html); $html = str_replace("<!--color-->", Colors::TransformHEX($color, 30), $html); } else { if ($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame_chat") { $html = IOStruct::GetFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl"); $html = str_replace("<!--alert-->", getAlertTemplate(), $html); $tlanguages = ""; if (strlen(Server::$Configuration->File["gl_otrs"]) > 1) { $mylang = LocalizationManager::GetBrowserLocalization(); $tlanguages = getLanguageSelects(LocalizationManager::GetBrowserLocalization()); } $html = str_replace("<!--languages-->", $tlanguages, $html); Server::InitDataBlock(array("GROUPS")); $groupid = $_POST["intgroup"]; if (!empty($groupid) && isset(Server::$Groups[$groupid])) { $html = str_replace("<!--SM_HIDDEN-->", empty(Server::$Groups[$groupid]->ChatFunctions[0]) ? "none" : "", $html);
* All rights reserved. * LiveZilla is a registered trademark. * * Improper changes to this file may cause critical errors. ***************************************************************************************/ define("IN_LIVEZILLA", true); header('Content-Type: text/html; charset=utf-8'); if (!defined("LIVEZILLA_PATH")) { define("LIVEZILLA_PATH", "./"); } require LIVEZILLA_PATH . "_definitions/definitions.inc.php"; require LIVEZILLA_PATH . "_lib/functions.global.inc.php"; require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php"; require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php"; Server::DefineURL("print.php"); @set_error_handler("handleError"); if (Server::InitDataProvider()) { if (!empty($_GET[GET_TRACK_CHATID]) && !empty($_GET[GET_TRACK_BROWSERID]) && !empty($_GET[GET_TRACK_USERID])) { $archive = new Chat(); $archive->ChatId = intval(Communication::GetParameter("c", "")); $archive->Load(); $chat = VisitorChat::GetByChatId($archive->ChatId); if ($chat->BrowserId == Communication::GetParameter(GET_TRACK_BROWSERID, "") && $chat->UserId == Communication::GetParameter(GET_TRACK_USERID, "") && $chat->LastActive > time() - 3600) { $print = IOStruct::GetFile(PATH_TEMPLATES . "print.tpl"); $archive->Generate($archive->ChatId, "", true, true); $print = str_replace("<!--chat_id-->", $archive->ChatId, $print); $print = str_replace("<!--transcript-->", nl2br($archive->PlainText), $print); } exit($print); } }
static function Replace($_toReplace, $jsa = "") { $_toReplace = str_replace("<!--geo_url-->", GeoTracking::GetURL() . "?aid=" . Server::$Configuration->File["wcl_geo_tracking"] . "&sid=" . base64_encode(Server::$Configuration->File["gl_lzid"]) . "&dbp=" . Server::$Configuration->File["gl_gtdb"], $_toReplace); if (!empty(Server::$Configuration->File["gl_use_ngl"])) { if (!Is::Null(trim(Server::$Configuration->File["gl_pr_ngl"]))) { $gkey = Server::$Configuration->File["gl_pr_ngl"]; } if (!empty($gkey)) { $jsc = "var chars = new Array("; $jso = "var order = new Array("; $chars = str_split(sha1($gkey . date("d"), false)); $keys = array_keys($chars); shuffle($keys); foreach ($keys as $key) { $jsc .= "'" . $chars[$key] . "',"; $jso .= $key . ","; } $jsa .= $jsc . "0);\r\n"; $jsa .= $jso . "0);\r\n"; $jsa .= "while(lz_oak.length < (chars.length-1))for(var f in order)if(order[f] == lz_oak.length)lz_oak += chars[f];\r\n"; } } $_toReplace = str_replace("<!--calcoak-->", $jsa, $_toReplace); $_toReplace = str_replace("<!--mip-->", Communication::GetIP(false, true), $_toReplace); return $_toReplace; }
<?php include_once 'message/messageDB.php'; include_once 'message/communication.php'; // if(!empty($_POST['number'])){ // echo "number: ".$_POST['number']; // echo " sms: ".$_POST['send_message']; // } // if(!empty($_POST['received_message']) && $_POST['dbOps'] == "read message"){ // $filterMessage = DBOperations::filterMessageDetails($_POST['received_message']); // DBOperations::sendMessageDetails($filterMessage); // } if (!empty($_POST['number']) && !empty($_POST['send_message'])) { $mobileNumber = Communication::prepareNumber($_POST['number']); Communication::sendMessage($_POST['send_message'], $mobileNumber); } //DBOperations::receiveMessages("hgsr hjk", "94713535362"); //Supplier request message //DBOperations::displayMessageTable(); //DBOperations::receiveTicketMachine("0001 20", "94713535362"); //ticket machine message ?>
define("IN_LIVEZILLA", true); header('Content-Type: text/html; charset=utf-8'); if (!defined("LIVEZILLA_PATH")) { define("LIVEZILLA_PATH", "./"); } require LIVEZILLA_PATH . "_definitions/definitions.inc.php"; require LIVEZILLA_PATH . "_lib/functions.global.inc.php"; require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php"; require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php"; @set_error_handler("handleError"); if (Server::InitDataProvider()) { Server::InitDataBlock(array("DBCONFIG", "INTERNAL")); LocalizationManager::AutoLoad(); $fb_html = IOStruct::GetFile(PATH_TEMPLATES . "feedback.tpl"); $chat = VisitorChat::GetByChatId(intval(Communication::ReadParameter("cid", 0))); $ticket = Ticket::GetById(intval(Communication::ReadParameter("tid", ""))); if ($ticket != null) { $ticket->LoadMessages(); $ticket->LoadStatus(); } if (Feedback::IsFlood()) { $fb_html = str_replace("<!--title-->", "<br><br><br>" . str_replace("<!--count-->", MAX_FEEDBACKS_PER_DAY, LocalizationManager::$TranslationStrings["client_feedback_max"]) . "<script>parent.parent.lz_chat_feedback_result();</script>", $fb_html); $fb_html = str_replace("<!--visible-->", "none", $fb_html); } else { if (!empty($_POST)) { $userid = ""; $feedback = new Feedback(getId(32)); if ($chat != null) { $feedback->ChatId = $chat->ChatId; $feedback->UserId = $userid = $chat->UserId; $feedback->GroupId = $chat->DesiredChatGroup;
static function ReplaceColors($_html, $_operator) { $primary = Communication::ReadParameter("ovlc", "#73be28"); $secondary = Communication::ReadParameter("ovlct", "#ffffff"); $textshadow = Communication::ReadParameter("ovlts", 1); //$textheader = Communication::ReadParameter("ovlch","#ffffff"); $_html = str_replace("<!--bgc-->", $primary, $_html); $_html = str_replace("<!--bgcm-->", Colors::TransformHEX($primary, 30), $_html); $_html = str_replace("<!--bgcd-->", Colors::TransformHEX($primary, 50), $_html); $_html = str_replace("<!--tc-->", $secondary, $_html); $_html = str_replace("<!--tch-->", $secondary, $_html); $_html = str_replace("<!--ts-->", $textshadow == 1 ? "text-shadow:1px 1px 0 #6b6b6b;" : "", $_html); return str_replace("<!--color-->", $_operator ? Colors::TransformHEX($secondary, 20) : "#000000", $_html); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Communication the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Communication::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
function processChatActions() { global $RVISITOR; $count = 0; while (isset($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_va"])) { $type = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vd"]; if ($type == "OperatorSignOff") { $op = Server::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]]; $op->SignOff(); CacheManager::FlushKey(DATA_CACHE_KEY_OPERATORS); } else { if ($type == "SendChatTranscriptTo") { $value = 1; while (!empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_" . $value])) { DBManager::Execute(true, "UPDATE `" . DB_PREFIX . DATABASE_CHAT_ARCHIVE . "` SET `transcript_sent`=0,`transcript_receiver`='" . DBManager::RealEscape($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]) . "' WHERE `transcript_sent`=1 AND `chat_id`='" . DBManager::RealEscape($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_" . $value]) . "' LIMIT 1;"); $value++; } Communication::SendChatTranscripts(true); } else { if ($type == "CreatePublicGroup") { if (isset(SERVER::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]]) && SERVER::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]]->ClientWeb) { continue; } $room = new UserGroup(); $room->IsDynamic = true; $room->Id = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]; $room->Descriptions["EN"] = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"]; $room->Owner = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]; $room->Save(); $room->AddMember($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"], false); CacheManager::FlushKey(DATA_CACHE_KEY_OPERATORS); CacheManager::FlushKey(DATA_CACHE_KEY_GROUPS); } else { if ($type == "DeletePublicGroup") { $room = new UserGroup(); $room->Id = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]; $room->Destroy(); CacheManager::FlushKey(DATA_CACHE_KEY_OPERATORS); } else { if ($type == "JoinPublicGroup") { if (isset(SERVER::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]])) { if (!SERVER::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]]->ClientWeb || SERVER::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]]->Status == USER_STATUS_OFFLINE) { $room = new UserGroup(); $room->Id = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]; $room->AddMember($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"], false); CacheManager::FlushKey(DATA_CACHE_KEY_OPERATORS); } } } else { if ($type == "QuitPublicGroup") { $room = new UserGroup(); $room->Id = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]; $room->RemoveMember($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"]); CacheManager::FlushKey(DATA_CACHE_KEY_OPERATORS); } else { if ($type == "StartOverlayChat") { $chat = new VisitorChat($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_va"], $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vb"]); $chat->RequestInitChat(CALLER_SYSTEM_ID); } else { if ($type == "AddVisitorComment") { $visitor = new Visitor($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]); $visitor->SaveComment(CALLER_SYSTEM_ID, $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"]); } else { if ($type == "DownloadRecentHistory") { $RVISITOR = new Visitor($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]); $RVISITOR->LoadRecentVisits(true, $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"]); } else { if ($type == "SetTranslation") { $chat = new VisitorChat($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_va"], $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vb"]); $chat->ChatId = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]; $chat->SetTranslation($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"]); } else { if ($type == "SetChatTicketParam") { $ticket = new CommercialChatVoucher("", $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]); $ticket->Load(); $ticket->SetVoucherParams(!empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"]), !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]), !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_3"]), !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_4"]), !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_5"]), !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_6"])); } else { if (strlen($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vb"]) > 0 && strlen($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_va"]) > 0) { $chat = new VisitorChat($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_va"], $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vb"]); $chat->ChatId = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vc"]; $chat->Load(); if ($type == "SetCallMeBackStatus") { $chat->SetCallMeBackStatus($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]); } else { if ($type == "JoinChatInvisible") { $chat->JoinChat(CALLER_SYSTEM_ID, true, !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"])); } else { if ($type == "JoinChat") { $chat->JoinChat(CALLER_SYSTEM_ID, false, !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"])); } else { if ($type == "SetPriority") { $chat->SetPriority($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]); } else { if ($type == "SetTargetOperator") { $chat->SetTargetOperator($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]); } else { if ($type == "SetTargetGroup") { $chat->SetTargetGroup($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]); } else { if ($type == "AcceptChat") { $chat->InternalActivate(); } else { if ($type == "CloseChat") { $chat->InternalClose(CALLER_SYSTEM_ID); } else { if ($type == "TakeChat") { $chat->TakeChat(CALLER_SYSTEM_ID, $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]); } else { if ($type == "DeclineChat") { $chat->InternalDecline(CALLER_SYSTEM_ID); } else { if ($type == "LeaveChat") { $chat->LeaveChat(CALLER_SYSTEM_ID); } } } } } } } } } } } } } } } } } } } } } } } $count++; } }
public function getAgendaDate($ctrl) { if ($ctrl) { $criteria = new CDbCriteria(); $ref = CommMeetingOrdi::model()->find($criteria)->ref_id; $ctrl = Referral::model()->findByPK($ref)->ctrl_no; return Communication::model()->findByPK($ctrl)->date_agenda; } else { return 'No Agenda'; } }
//} if ($(\'#region\').val() != 0){ $(\'#regiondiv\').css("display", "block"); $(\'#regionselector button\').click(); } if ($(\'#testmode\').val() == "1"){ $(\'#testmodediv\').css("display", "block"); $(\'#testmodeselector button\').click(); } </script>'; $returnStr .= ' </div> </div>'; $returnStr .= '<button type="submit" class="btn btn-default navbar-btn">' . Language::buttonSave() . '</button>'; $returnStr .= '</form>'; //END CONTENT $returnStr .= '<table width=100%><tr><td align=right>v1.01</td></tr></table></p></div> </div>'; //container and wrap $returnStr .= $this->showBottomBar(); $returnStr .= $this->showFooter(); return $returnStr; } function showOtherSurveys() { $returnStr = $this->showHeader(Language::messageSMSTitle(), '<link href="bootstrap/css/sticky-footer-navbar.min.css" rel="stylesheet">'); $returnStr .= '<div id="wrap">'; $returnStr .= $this->showNavBar(); $returnStr .= '<div class="container"><p>'; /* $returnStr .= '<ol class="breadcrumb">'; $returnStr .= '<li>' . setSessionParamsHref(array('page' => 'interviewer.home'), Language::linkInterviews()) . '</li>'; $returnStr .= '<li class="active">Calendar</li>'; $returnStr .= '</ol>'; */ //CONTENT $returnStr .= $this->displayWarning(Language::labelInterviewerWarningNoOtherSurveys()); //END CONTENT $returnStr .= '</p></div> </div>'; //container and wrap $returnStr .= $this->showBottomBar(); $returnStr .= $this->showFooter(); return $returnStr; } function showBottomBar() { return ' </div> <div id="footer"> <div class="container"> <p class="text-muted credit" style="text-align:right">' . Language::nubisFooter() . '</p> </div>
public function receiveTicketMachine($message, $phone) { $dbOps = new DBOperations(); $con = new mysqli($dbOps->servername, $dbOps->username, $dbOps->password, $dbOps->dbname); //create the db connection $query = ""; if ($con->connect_error) { die("connection failed: " . $con->connect_error); } else { //Get the suitable serial_number for phone_number from ticket_machine table $queryGetEditer = "SELECT * FROM ticket_machine WHERE phone_number = {$phone}"; $result = $con->query($queryGetEditer); $editer = ""; while ($row = mysqli_fetch_array($result)) { $editer = $row['serial_number']; } //set the time zone to Colombo time date_default_timezone_set('Asia/Colombo'); $dt = new DateTime(); //create DateTime object $prepare = explode(" ", $message); // split the ticket machine into array //Example Code: supCode approvedKGs units suppliedKGs if (count($prepare) == 4) { if (is_numeric($prepare[1]) && is_numeric($prepare[2]) && is_numeric($prepare[3])) { //check the approvedKGs units suppliedKGs are integers if (!supplierCodeExists($prepare[0])) { //Example Code: supCode approvedKGs units suppliedKGs if (DBOperations::isSupCodeValid($prepare[0])) { //Check the supplier code valid or invalid $query = "INSERT INTO today_supply(supplier_code, date, approved_kgs, units, supplied_kgs, editer) VALUES ('" . $prepare[0] . "', '" . $dt->format('y-m-d') . "', '" . $prepare[1] . "', '" . $prepare[2] . "', '" . $prepare[3] . "', '" . $editer . "')"; $con->query($query); } else { //If the supplier code invalid then send error message Communication::sendMessage("Supplier code is invalid !", $phone); } } else { //If the supplier code exists then send error message Communication::sendMessage("Supplier code is already exists the system !", $phone); } } else { //reply again to the ticket machine Communication::sendMessage("Sent message is invalid.", $phone); } //Example Code: supCode approvedKGs suppliedKGs //Example Code: supCode approvedKGs units } else { if (count($prepare) == 3) { if (is_numeric($prepare[1]) && is_numeric($prepare[2])) { //check the integers as above if (!supplierCodeExists($prepare[0])) { if ($prepare[1] <= $prepare[2]) { //Example Code: supCode approvedKGs suppliedKGs if (DBOperations::isSupCodeValid($prepare[0])) { //Check the supplier code valid or invalid $query = "INSERT INTO today_supply(supplier_code, date, approved_kgs, supplied_kgs, editer) VALUES ('" . $prepare[0] . "', '" . $dt->format('y-m-d') . "', '" . $prepare[1] . "', '" . $prepare[2] . "', '" . $editer . "')"; $con->query($query); } else { //If the supplier code invalid then send error message Communication::sendMessage("Supplier code is invalid !", $phone); } } else { //Example Code: supCode approvedKGs units if (DBOperations::isSupCodeValid($prepare[0])) { //Check the supplier code valid or invalid $query = "INSERT INTO today_supply(supplier_code, date, approved_kgs, units, editer) VALUES ('" . $prepare[0] . "', '" . $dt->format('y-m-d') . "', '" . $prepare[1] . "', '" . $prepare[2] . "', '" . $editer . "')"; $con->query($query); } else { //If the supplier code invalid then send error message Communication::sendMessage("Supplier code is invalid !", $phone); } } } else { //If the supplier code exists then send error message Communication::sendMessage("Supplier code is already exists the system !", $phone); } } else { //reply again to the ticket machine Communication::sendMessage("Sent message is invalid.", $phone); } //Example Code: supCode approvedKGs } else { if (count($prepare) == 2) { if (is_numeric($prepare[1])) { if (!DBOperations::supplierCodeExists($prepare[0])) { //Example Code: supCode approvedKGs if (DBOperations::isSupCodeValid($prepare[0])) { //Check the supplier code valid or invalid $query = "INSERT INTO today_supply(supplier_code, date, approved_kgs, editer) VALUES ('" . $prepare[0] . "', '" . $dt->format('y-m-d') . "', '" . $prepare[1] . "', '" . $editer . "')"; $con->query($query); } else { //If the supplier code invalid then send error message Communication::sendMessage("Supplier code is invalid !", $phone); } } else { //If the supplier code exists then send error message Communication::sendMessage("Supplier code is already exists the system !", $phone); } } else { //reply again to the ticket machine Communication::sendMessage("Sent message is invalid.", $phone); } //Example Code: without above codes } else { //reply again to the ticket machine Communication::sendMessage("Sent message is invalid.", $phone); } } } } }
$box = $this->beginWidget('bootstrap.widgets.TbBox', array('title' => 'Advanced Search', 'headerIcon' => 'icon-th-list', 'htmlOptions' => array('class' => 'bootstrap-widget-table', 'style' => 'width:853px;'))); ?> <br> <div class="span8"> <div class="wide form"> <?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'get')); CHtml::$afterRequiredLabel = ''; ?> <?php echo $form->textFieldRow($model, 'ref_id'); ?> <?php echo $form->dropDownListRow($model, 'ctrl_no', CHtml::listData(Communication::model()->findAll(array('condition' => 'date_agenda >= ' . date('Y-m-d'))), 'ctrl_no', 'ctrl_no'), array('class' => 'span4', 'prompt' => '------ Select Control Number ------')); ?> <?php echo $form->datepickerRow($model, 'date_referred', array('prepend' => '<i class="icon-calendar"></i>', 'options' => array('format' => 'yyyy-mm-dd'))); ?> <?php echo $form->dropDownListRow($model, 'lead_committee', CHtml::listData(Committee::model()->findAll(), 'comm_id', 'comm_name'), array('class' => 'span4', 'prompt' => '------ Select Lead Committee ------')); ?> <?php echo $form->select2Row($model, 'joint_committee', array('asDropDownList' => true, 'data' => CHtml::listData(Committee::model()->findAll(), 'comm_id', 'comm_name'), 'multiple' => 'multiple', 'options' => array('width' => '50%', 'placeholder' => ' ------------ Choose Joint Committee ------------', 'tokenSeparators' => array(',', ' ')))); ?> <div class="form-actions">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <h4> <i class="icon fa fa-check"></i> Sorry!</h4> supplier allready exists , Please Try another one. </div>'; // $msg = " // <div class='alert alert-error'> // <button class='close' data-dismiss='alert'>×</button> // <strong>Sorry !</strong> email allready exists , Please Try another one // </div> // "; } else { if ($supplier->register($scode, $fname, $lname, $nic, $iCheck, $email, $address_1, $mobile, $estate, $estate_name, $reg_no, $size_of_estate, $estate_address, $bankn, $branch, $account, $bankacc, $editor)) { $message = "Thalapalakanada Tea factory, username: 0001 password: {$nic} http://tsms.x10host.com/page/"; if (!empty($mobile)) { $mobileNumber = Communication::prepareNumber($mobile); Communication::sendMessage($message, $mobileNumber); } echo ' <div class="row"> <div class="col-md-12"> <div class="box"> <div class="box-header"> <h3 class="box-title">Supplier Settings</h3> </div> <div class="box-body"> <p>Supplier Successfuly added to the database. Also You can change Supplier settings.</p> <a class="btn btn-app"> <i href="supplieredit.php" class="fa fa-edit"></i> Edit </a> <a href="suppliers.php" class="btn btn-app"> <i class="fa fa-user-plus"></i> Add Another
public function checkUpdates() { $ids = array(); $product_ids = xtc_db_query("\tSELECT DISTINCT `products_id`\n\t\t\t\t\t\t\t\t\t\tFROM `idealo_realtime_update`"); while ($product = xtc_db_fetch_array($product_ids)) { $ids[] = $product['products_id']; } if (empty($ids)) { if (!$this->send_failed_request) { if ($this->timeGone) { $communication = new Communication($this->login); $communication->setTimeStamp(); } } } else { foreach ($ids as $id) { $product_ids = xtc_db_query("\tSELECT `id`, `event`\n\t\t\t\t\t\t\t\t\t\t\t\tFROM `idealo_realtime_update`\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE `products_id` = " . $id . " ORDER BY `id` ASC"); $update = array(); while ($product = xtc_db_fetch_array($product_ids)) { $update[] = $product['event']; } $count = count($update); $count--; $this->update[] = array('product' => $id, 'event' => $update[$count]); } } }
public function getCommDetails() { return Communication::model()->findByPK($this->ref->ctrlNo->ctrl_no); }
function showAssignSample() { $assignids = loadvar('assignid'); $selurid = loadvar('selurid'); if (sizeof($assignids) > 0 && ($selurid > 0 || $selurid == -1)) { //-1: back to sysadmin foreach ($assignids as $id) { //sysadmin mode: change on server 'only' $household = new Household($id); $household->setUrid($selurid); $household->saveChanges(); $respondents = $household->getRespondents(); foreach ($respondents as $respondent) { $respondent->setUrid($selurid); $respondent->saveChanges(); } $communication = new Communication(); $communication->assignHousehold($household, $selurid); } if (dbConfig::defaultPanel() == PANEL_HOUSEHOLD) { $message = Language::labelSupervisorHouseholdAssigned(); } else { $message = Language::labelSupervisorRespondentAssigned(); } } else { if (dbConfig::defaultPanel() == PANEL_HOUSEHOLD) { $message = Language::labelSupervisorHouseholdsNotAssigned(); } else { $message = Language::labelSupervisorRespondentsNotAssigned(); } } $display = new Display(); return $this->showUnassignedSample($display->displayInfo($message)); }
public function forCommMeetingOrdi() { // @todo Please modify the following code to remove attributes that should not be searched. $cat = Category::model()->findByAttributes(array('cat_name' => 'Provincial Ordinance'))->cat_id; $result = CHtml::listData(Communication::model()->findAll(array('condition' => 'cat_id = ' . $cat . ' and comm_stat=1')), 'ctrl_no', 'ctrl_no'); $criteria = new CDbCriteria(); $criteria->condition = 'archive=0 and referral_stat=0'; $criteria->addInCondition("ctrl_no", $result); $criteria->compare('ref_id', $this->ref_id); $criteria->compare('ctrl_no', $this->ctrl_no, true); $criteria->compare('date_referred', $this->date_referred, true); $criteria->compare('duedate', $this->duedate, true); $criteria->compare('lead_committee', $this->lead_committee); $criteria->compare('joint_committee', $this->joint_committee, true); $criteria->compare('ind_letter', $this->ind_letter, true); $criteria->compare('referral_stat', $this->referral_stat, true); $criteria->compare('input_by', $this->input_by); $criteria->compare('archive', $this->archive, true); return new CActiveDataProvider($this, array('criteria' => $criteria, 'pagination' => array('pageSize' => 10))); }
<?php /* @var $this ResolutionController */ /* @var $dataProvider CActiveDataProvider */ $this->breadcrumbs = array('Resolutions'); $this->menu = array(array('label' => 'Create Resolution', 'url' => array('create')), array('label' => 'Manage Resolution', 'url' => array('admin'))); $this->menu = array(array('label' => 'Monthly Committee Reports', 'url' => array('reportsOthers/commReportMonthly')), array('label' => 'Yearly Committee Reports', 'url' => array('reportsOthers/commReportYearly')), array('label' => 'Monitor Ordinances', 'url' => array('monitorOrd/index')), array('label' => 'Track Communications', 'url' => array('reportsOthers/viewTracking'))); Yii::app()->clientScript->registerScript('search', "\r\n\r\n\$('.search-form form').submit(function(){\r\n\t\$('#track-communication-for-resolution-grid').yiiGridView('update', {\r\n\t\tdata: \$(this).serialize()\r\n\t});\r\n\treturn false;\r\n});\r\n\r\n\$('.search-form form').submit(function(){\r\n\t\$('#track-communication-for-ordinance-grid').yiiGridView('update', {\r\n\t\tdata: \$(this).serialize()\r\n\t});\r\n\treturn false;\r\n});\r\n"); $box = $this->beginWidget('bootstrap.widgets.TbBox', array('title' => 'Track Communications for Resolution', 'headerIcon' => 'icon-th-list', 'htmlOptions' => array('class' => 'bootstrap-widget-table', 'style' => 'width:126%; text-align:center;'))); ?> <?php $this->widget('bootstrap.widgets.TbGridView', array('id' => 'track-communication-for-resolution-grid', 'dataProvider' => $forResolution->forResolution(), 'filter' => Communication::model(), 'htmlOptions' => array('style' => 'padding:15px', 'style' => 'width:100%;'), 'template' => "{items}{pager}", 'columns' => array(array('name' => 'ctrl_no', 'value' => '$data->ctrl_no', 'htmlOptions' => array('style' => 'width:10%;')), array('header' => 'Agenda Date', 'value' => '$data->date_agenda'), array('header' => 'Origin', 'filter' => CHtml::listData(Origin::model()->findAll(), 'orig_id', 'orig_name'), 'value' => '$data->orig->orig_name'), array('name' => 'subject_matter', 'value' => '$data->subject_matter', 'htmlOptions' => array('style' => 'width:20%;')), array('header' => 'Date Referred', 'value' => ' $data->getReferral($data->ctrl_no)'), array('header' => 'Date Meeting/s', 'value' => '$data->getCommMeetings($data->ctrl_no)'), array('header' => 'Action Taken', 'value' => '$data->getActionTaken($data->ctrl_no)'), array('header' => 'Date Reported', 'value' => '$data->getCommReport($data->ctrl_no)'), array('header' => 'Ordinance/Resolution No.', 'value' => '$data->getTitle($data->ctrl_no)')))); ?> <?php $this->endWidget(); ?> <?php $box = $this->beginWidget('bootstrap.widgets.TbBox', array('title' => 'Track Communications for Ordinance', 'headerIcon' => 'icon-th-list', 'htmlOptions' => array('class' => 'bootstrap-widget-table', 'style' => 'width:126%; text-align:center;'))); ?> <?php $this->widget('bootstrap.widgets.TbGridView', array('id' => 'track-communication-for-ordinance-grid', 'dataProvider' => $forOrdinance->forOrdinance(), 'filter' => $forOrdinance, 'htmlOptions' => array('style' => 'padding:15px', 'style' => 'width:100%;'), 'template' => "{items}{pager}", 'columns' => array('ctrl_no', array('header' => 'Agenda Date', 'value' => '$data->date_agenda'), array('header' => 'Origin', 'value' => '$data->orig->orig_name'), array('name' => 'subject_matter', 'value' => '$data->subject_matter'), array('header' => 'Date Referred', 'value' => ' $data->getReferral($data->ctrl_no)'), array('header' => 'Date Meeting/s', 'value' => '$data->getCommMeetings($data->ctrl_no)'), array('header' => 'Action Taken', 'value' => '$data->getActionTaken($data->ctrl_no)'), array('header' => 'Date Reported', 'value' => '$data->getCommReport($data->ctrl_no)'), array('header' => 'Ordinance/Resolution No.', 'value' => '$data->getTitle($data->ctrl_no)')))); ?>
$pdf->SetFont('helvetica', 'B', 20); $timezone = new DateTimeZone('Asia/Manila'); // ----------------------------------------------------------------------------- $tbl = '<table cellspacing="0" cellpadding="7" border="1" width="100%"> <thead> <tr style="font-weight:bold; font-size:13px; background-color:skyblue;"> <td style="text-align:center; width:10%;">Control No.</td> <td style="text-align:center; width:10%;">Date Referred</td> <td style="text-align:center; width:35%;">Subject Matter</td> <td style="text-align:center; width:25%;">Lead Committee</td> <td style="text-align:center; width:10%;">Duedate</td> <td style="text-align:center; width:10%;">Remarks</td> </tr> </thead>'; foreach ($model as $values) { $sbj = Communication::model()->FindByPK($values->ctrl_no)->subject_matter; $comm = Committee::model()->FindByPK($values->lead_committee)->comm_name; $dateref = new DateTime($values->date_referred, $timezone); $dateref1 = new DateTime($values->duedate, $timezone); $pdf->SetFont('helvetica', '', 10); $tbl .= '<tr nobr="true">'; $tbl .= '<td style="text-align:center; width:10%;">' . $values->ctrl_no . '</td>'; $tbl .= '<td style="text-align:center; width:10%;">' . $dateref->format('M j , Y') . '</td>'; $tbl .= '<td style="text-align:center; width:35%;">' . $sbj . '</td>'; $tbl .= '<td style="text-align:center; width:25%;">' . $comm . '</td>'; $tbl .= '<td style="text-align:center; width:10%;">' . $dateref1->format('M j , Y') . '</td>'; $tbl .= '<td style="text-align:center; width:10%;"></td>'; $tbl .= '</tr>'; } $tbl .= '</table>'; $pdf->writeHTML($tbl, true, false, false, false, '');