当前位置: 首页>>代码示例>>PHP>>正文


PHP DataGrid::getFromRequest方法代码示例

本文整理汇总了PHP中DataGrid::getFromRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP DataGrid::getFromRequest方法的具体用法?PHP DataGrid::getFromRequest怎么用?PHP DataGrid::getFromRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataGrid的用法示例。


在下文中一共展示了DataGrid::getFromRequest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: emailContacts

    public function emailContacts()
    {
        Logger::getLogger("AuieoATS")->info("emailContacts:start");
        if ($this->_accessLevel == ACCESS_LEVEL_DEMO)
        {
            CommonErrors::fatal(COMMONERROR_PERMISSION, $this, 'Sorry, but demo accounts are not allowed to send e-mails.');
        }
        
        if(isset($_REQUEST["idlist"]))
        {
            $db = DatabaseConnection::getInstance();
            $idlist=trim($_REQUEST["idlist"]);
            $rs = $db->getAllAssoc(sprintf(
                'SELECT contact_id, email1, email2 '
                    . 'FROM contact '
                    . 'WHERE contact_id IN (%s)',
                $idlist
            ));
            $emailTemplates = new EmailTemplates($this->_siteID);
            $emailTemplatesRS = $emailTemplates->getAll();
            $this->_template->assign('emailTemplatesRS', $emailTemplatesRS);
            $this->_template->assign('active', $this);
            $this->_template->assign('success', false);
            $this->_template->assign('recipients', $rs);
            $this->_template->display('./modules/contacts/emailContacts.php');
        }
        else
        {
            $dataGrid = DataGrid::getFromRequest();

            $contactIDs = $dataGrid->getExportIDs();

            /* Validate each ID */
            foreach ($contactIDs as $index => $contactID)
            {
                if (!$this->isRequiredIDValid($index, $contactIDs))
                {
                    Logger::getLogger("AuieoATS")->error("Invalid contact ID.");
                    CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid contact ID.');
                    return;
                }
            }

            $db_str = implode(", ", $contactIDs);

            $db = DatabaseConnection::getInstance();

            $rs = $db->getAllAssoc(sprintf(
                'SELECT contact_id, email1, email2 '
                    . 'FROM contact '
                    . 'WHERE contact_id IN (%s)',
                $db_str
            ));

            //$this->_template->assign('privledgedUser', $privledgedUser);
            $emailTemplates = new EmailTemplates($this->_siteID);
            $emailTemplatesRS = $emailTemplates->getAll();
            $this->_template->assign('emailTemplatesRS', $emailTemplatesRS);
            $this->_template->assign('active', $this);
            $this->_template->assign('success', false);
            $this->_template->assign('recipients', $rs);
            $this->_template->display('./modules/contacts/emailContacts.php');
        }
        Logger::getLogger("AuieoATS")->info("emailContacts:end");
    }
开发者ID:Hassanj343,项目名称:candidats,代码行数:65,代码来源:ContactsUI.php

示例2: onExportByDataGrid

    /**
     * Gets a datagrid and calls its drawCSV member function to output a CSV file.
     *
     * @return void
     */

    public function onExportByDataGrid()
    {
        $dataGrid = DataGrid::getFromRequest();

        $dataGrid->drawCSV();
    }
开发者ID:Hassanj343,项目名称:candidats,代码行数:12,代码来源:ExportUI.php

示例3: onEmailCandidates

 private function onEmailCandidates()
 {
     if ($this->_accessLevel == ACCESS_LEVEL_DEMO) {
         CommonErrors::fatal(COMMONERROR_PERMISSION, $this, 'Sorry, but demo accounts are not allowed to send e-mails.');
     }
     if (isset($_POST['postback'])) {
         $emailTo = $_POST['emailTo'];
         $emailSubject = $_POST['emailSubject'];
         $emailBody = $_POST['emailBody'];
         $tmpDestination = explode(', ', $emailTo);
         $destination = array();
         foreach ($tmpDestination as $emailDest) {
             $destination[] = array($emailDest, $emailDest);
         }
         $mailer = new Mailer(CATS_ADMIN_SITE);
         // FIXME: Use sendToOne()?
         $mailerStatus = $mailer->send(array($_SESSION['CATS']->getEmail(), $_SESSION['CATS']->getEmail()), $destination, $emailSubject, $emailBody, true, true);
         $this->_template->assign('active', $this);
         $this->_template->assign('success', true);
         $this->_template->assign('success_to', $emailTo);
         $this->_template->display('./modules/candidates/SendEmail.tpl');
     } else {
         $dataGrid = DataGrid::getFromRequest();
         $candidateIDs = $dataGrid->getExportIDs();
         /* Validate each ID */
         foreach ($candidateIDs as $index => $candidateID) {
             if (!$this->isRequiredIDValid($index, $candidateIDs)) {
                 CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid candidate ID.');
                 return;
             }
         }
         $db_str = implode(", ", $candidateIDs);
         $db = DatabaseConnection::getInstance();
         $rs = $db->getAllAssoc(sprintf('SELECT candidate_id, email1, email2 ' . 'FROM candidate ' . 'WHERE candidate_id IN (%s)', $db_str));
         //$this->_template->assign('privledgedUser', $privledgedUser);
         $this->_template->assign('active', $this);
         $this->_template->assign('success', false);
         $this->_template->assign('recipients', $rs);
         $this->_template->display('./modules/candidates/SendEmail.tpl');
     }
 }
开发者ID:PublicityPort,项目名称:OpenCATS,代码行数:41,代码来源:CandidatesUI.php

示例4: removeFromListDatagrid

    public function removeFromListDatagrid()
    {
        /* Bail out if we don't have a valid type. */
        if (!$this->isRequiredIDValid('dataItemType', $_GET))
        {
            CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this);
            return;
        }

        $dataGrid = DataGrid::getFromRequest();

        $dataItemIDArray = $dataGrid->getExportIDs();

        /* Validate each ID */
        foreach ($dataItemIDArray as $index => $dataItemID)
        {
            if (!$this->isRequiredIDValid($index, $dataItemIDArray))
            {
                CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid data item ID.');
                return;
            }
        }

        $dataItemType = $_GET['dataItemType'];

        $dataItemDesc = TemplateUtility::getDataItemTypeDescription($dataItemType);

        if (!$this->isRequiredIDValid('savedListID', $_GET))
        {
            CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid saved list ID.');
            return;
        }

        $savedListID = $_GET['savedListID'];

        /* Remove the items */
        $savedLists = new SavedLists($this->_siteID);

        $dataItemIDArrayTemp = array();
        foreach ($dataItemIDArray as $dataItemID)
        {
            $dataItemIDArrayTemp[] = $dataItemID;
            /* Because its too slow adding 1 item at a time, we do it in spurts of 200 items. */
            if (count($dataItemIDArrayTemp) > 200)
            {
                $savedLists->removeEntryMany($savedListID, $dataItemIDArrayTemp);
                $dataItemIDArrayTemp = array();
            }
        }
        if (count($dataItemIDArrayTemp) > 0)
        {
            $savedLists->removeEntryMany($savedListID, $dataItemIDArrayTemp);
        }

        /* Redirect to the saved list page we were on. */
        /* FIXME: What if we are on the last page? */
        CATSUtility::transferRelativeURI('m=lists&a=showList&savedListID='.$savedListID);
    }
开发者ID:Hassanj343,项目名称:candidats,代码行数:58,代码来源:ListsUI.php

示例5: onEmailCandidates

    public function onEmailCandidates()
    {
        if ($this->_accessLevel == ACCESS_LEVEL_DEMO)
        {
            CommonErrors::fatal(COMMONERROR_PERMISSION, $this, 'Sorry, but demo accounts are not allowed to send e-mails.');
        }
        Logger::getLogger("AuieoATS")->info("inside onEmailCandidates");
        if (isset($_POST['postback']))
        {
            $templateid = $_POST['titleSelect'];
            
            $emailTo = $_POST['emailTo'];
            $emailSubject = $_POST['emailSubject'];
            
            $idlist=$_POST["idlist"];
            $obj=json_decode(urldecode($idlist),true);
            foreach($obj as $candid=>$details)
            {
                $emailBody = $_POST['emailBody'];
                $emailData=array();
                $emailData["id"]=$candid;
                $emailData["email"]=array();
                foreach($details["email"] as $emailind=>$data)
                {
                    //$objTemplate=new EmailTemplates($this->_siteID); 
                    //$rowTemplate=$objTemplate->get($templateid);
                    $emailBody=$this->renderTemplateVars($emailBody, $candid);

                    $tmpDestination = $data["email"];
                    $emailData["email"][]=array("email"=>$tmpDestination,"name"=>$tmpDestination);
                    $mailer = new Mailer($this->_siteID);
                    // FIXME: Use sendToOne()?
                    $mailerStatus = $mailer->send(
                        array($_SESSION['CATS']->getEmail(), $_SESSION['CATS']->getEmail()),
                        $emailData,
                        $emailSubject,
                        $emailBody,
                        true,
                        true
                    );
                }
            }

            $this->_template->assign('active', $this);
            $this->_template->assign('success_to', $emailTo);
            if($mailer->getError())
            {
                $this->_template->assign('error', $mailer->getError());
                $this->_template->display('./modules/candidates/emailFail.php');
            }
            else
            {
                $this->_template->assign('success', true);
                $this->_template->display('./modules/candidates/emailSuccess.php');
            }
            return;
        }
        else
        {
            if(isset($_REQUEST["idlist"]))
            {
                $db = DatabaseConnection::getInstance();
                $idlist=trim($_REQUEST["idlist"]);
                $rs = $db->getAllAssoc(sprintf(
                    'SELECT candidate_id, email1, email2, last_name, first_name '
                    . 'FROM candidate '
                    . 'WHERE candidate_id IN (%s)',
                    $idlist
                ));
				
                $emailTemplates = new EmailTemplates($this->_siteID);
                $emailTemplatesRS = $emailTemplates->getAll();
                $this->_template->assign('emailTemplatesRS', $emailTemplatesRS);
                $this->_template->assign('active', $this);
                $this->_template->assign('success', true);
                $this->_template->assign('recipients', $rs);
                $this->_template->display('./modules/candidates/emailCandidates.php');
                return;
            }
            else
            {
                $dataGrid = DataGrid::getFromRequest();

                $candidateIDs = $dataGrid->getExportIDs();

                /* Validate each ID */
                foreach ($candidateIDs as $index => $candidateID)
                {
                    if (!$this->isRequiredIDValid($index, $candidateIDs))
                    {
                        CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid candidate ID.');
                        return;
                    }
                }

                $db_str = implode(", ", $candidateIDs);

                $db = DatabaseConnection::getInstance();

                $rs = $db->getAllAssoc(sprintf(
//.........这里部分代码省略.........
开发者ID:Hassanj343,项目名称:candidats,代码行数:101,代码来源:CandidatesUI.php


注:本文中的DataGrid::getFromRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。