當前位置: 首頁>>代碼示例>>PHP>>正文


PHP astercrm::getSql方法代碼示例

本文整理匯總了PHP中astercrm::getSql方法的典型用法代碼示例。如果您正苦於以下問題:PHP astercrm::getSql方法的具體用法?PHP astercrm::getSql怎麽用?PHP astercrm::getSql使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在astercrm的用法示例。


在下文中一共展示了astercrm::getSql方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: searchFormSubmit

function searchFormSubmit($searchFormValue, $numRows = null, $limit = null, $id = null, $type = null)
{
    global $locate, $db;
    $objResponse = new xajaxResponse();
    $searchField = array();
    $searchContent = array();
    $optionFlag = $searchFormValue['optionFlag'];
    $searchContent = $searchFormValue['searchContent'];
    //搜索內容 數組
    $searchField = $searchFormValue['searchField'];
    //搜索條件 數組
    $searchType = $searchFormValue['searchType'];
    $ordering = $searchFormValue['ordering'];
    $order = $searchFormValue['order'];
    $divName = "grid";
    if ($optionFlag == "export") {
        $sql = astercrm::getSql($searchContent, $searchField, $searchType, 'astercrm_account');
        //得到要導出的sql語句
        $_SESSION['export_sql'] = $sql;
        $objResponse->addAssign("hidSql", "value", $sql);
        //賦值隱含域
        $objResponse->addScript("document.getElementById('exportForm').submit();");
    } elseif ($optionFlag == "delete") {
        astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'astercrm_account');
        $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', $order, $divName, $ordering, '');
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    } elseif ($type == "delete") {
        $arreglo =& Customer::getAllRecords($start, $limit, $order, $_SESSION['curuser']['groupid']);
        $content = '';
        foreach ($arreglo as $agents) {
            if ($agents['agent'] == $id) {
                continue;
            } else {
                $addstr = "\nagent => " . trim($agents['agent']) . ',' . trim($agents['password']) . ',' . trim($agents['name']);
            }
            $content .= $addstr;
        }
        $agentsfile = '/etc/asterisk/agents_astercc.conf';
        if ($fhandle = fopen($agentsfile, 'w')) {
            fwrite($fhandle, $content);
            $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $order, $divName, $ordering, $searchType);
            $objResponse = new xajaxResponse();
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("delete_rec"));
            $objResponse->addAssign($divName, "innerHTML", $html);
        } else {
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_delete"));
        }
    } else {
        $html = createGrid($numRows, $limit, $searchField, $searchContent, $order, $divName, $ordering, $searchType);
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    }
    return $objResponse->getXML();
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:55,代碼來源:agent.server.php

示例2: searchFormSubmit

function searchFormSubmit($searchFormValue, $numRows, $limit, $id, $type)
{
    global $locate, $db, $config;
    $objResponse = new xajaxResponse();
    $searchField = array();
    $searchContent = array();
    $optionFlag = $searchFormValue['optionFlag'];
    $searchContent = $searchFormValue['searchContent'];
    //搜索內容 數組
    $searchField = $searchFormValue['searchField'];
    //搜索條件 數組
    $searchType = $searchFormValue['searchType'];
    //搜索方式 數組
    $divName = "grid";
    if ($optionFlag == "export") {
        $sql = astercrm::getSql($searchContent, $searchField, $searchType, 'accountgroup');
        //得到要導出的sql語句
        $_SESSION['export_sql'] = $sql;
        $objResponse->addAssign("hidSql", "value", $sql);
        //賦值隱含域
        $objResponse->addScript("document.getElementById('exportForm').submit();");
    } elseif ($type == "delete") {
        if ($config['synchronize']['delete_by_use_history']) {
            $res = Customer::deleteRecordToHistory('groupid', $id, 'clid');
            $res = Customer::deleteRecordToHistory('groupid', $id, 'myrate');
            $res = Customer::deleteRecordToHistory('groupid', $id, 'callshoprate');
            $res = Customer::deleteRecordToHistory('groupid', $id, 'account');
            $res = Customer::deleteRecordToHistory('id', $id, 'accountgroup');
        } else {
            $res = Customer::deleteRecords('groupid', $id, 'clid');
            $res = Customer::deleteRecords('groupid', $id, 'myrate');
            $res = Customer::deleteRecords('groupid', $id, 'callshoprate');
            $res = Customer::deleteRecords('groupid', $id, 'account');
            $res = Customer::deleteRecord($id, 'accountgroup');
        }
        if ($res) {
            $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $searchField, $divName, "", $searchType);
            $objResponse = new xajaxResponse();
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("delete_rec"));
            $objResponse->addClear("msgZone", "innerHTML");
            $objResponse->addAssign($divName, "innerHTML", $html);
        } else {
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_delete"));
        }
    } else {
        $html = createGrid($numRows, $limit, $searchField, $searchContent, $searchField, $divName, "", $searchType);
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    }
    return $objResponse->getXML();
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:51,代碼來源:accountgroup.server.php

示例3: searchFormSubmit

function searchFormSubmit($searchFormValue, $numRows = null, $limit = null, $id = null, $type = null)
{
    global $locate, $db;
    $objResponse = new xajaxResponse();
    $searchField = array();
    $searchContent = array();
    $optionFlag = $searchFormValue['optionFlag'];
    $searchContent = $searchFormValue['searchContent'];
    //搜索內容 數組
    $searchField = $searchFormValue['searchField'];
    //搜索條件 數組
    $searchType = $searchFormValue['searchType'];
    $ordering = $searchFormValue['ordering'];
    $order = $searchFormValue['order'];
    $divName = "grid";
    if ($optionFlag == "export") {
        $sql = astercrm::getSql($searchContent, $searchField, $searchType, 'worktimes');
        //得到要導出的sql語句
        $_SESSION['export_sql'] = $sql;
        $objResponse->addAssign("hidSql", "value", $sql);
        //賦值隱含域
        $objResponse->addScript("document.getElementById('exportForm').submit();");
    } elseif ($type == "delete") {
        $row = Customer::getRecordByField('worktime_id', $id, 'worktimepackage_worktimes');
        if ($row['id'] != '') {
            $objResponse->addAlert($locate->Translate("this worktime in one or more package, can not delete"));
            return $objResponse->getXML();
        }
        $res = Customer::deleteRecord($id, 'worktimes');
        if ($res) {
            $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $order, $divName, $ordering, $searchType);
            $objResponse = new xajaxResponse();
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("delete_rec"));
            $objResponse->addAssign($divName, "innerHTML", $html);
        } else {
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_delete"));
        }
    } else {
        $html = createGrid($numRows, $limit, $searchField, $searchContent, $order, $divName, $ordering, $searchType);
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    }
    return $objResponse->getXML();
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:44,代碼來源:worktime.server.php

示例4: searchFormSubmit

function searchFormSubmit($searchFormValue, $numRows = null, $limit = null, $id = null, $type = null)
{
    global $locate, $db;
    $objResponse = new xajaxResponse();
    $searchField = array();
    $searchContent = array();
    $optionFlag = $searchFormValue['optionFlag'];
    $searchContent = $searchFormValue['searchContent'];
    //搜索內容 數組
    $searchField = $searchFormValue['searchField'];
    //搜索條件 數組
    $searchType = $searchFormValue['searchType'];
    $ordering = $searchFormValue['ordering'];
    $order = $searchFormValue['order'];
    $divName = "grid";
    if ($optionFlag == "export" || $optionFlag == "exportcsv") {
        $sql = astercrm::getSql($searchContent, $searchField, $searchType, 'sms_sents');
        //得到要導出的sql語句
        $_SESSION['export_sql'] = $sql;
        $objResponse->addAssign("hidSql", "value", $sql);
        //賦值隱含域
        $objResponse->addAssign("maintable", "value", 'sms_sents');
        //賦值隱含域
        $objResponse->addAssign("exporttype", "value", $optionFlag);
        $objResponse->addScript("document.getElementById('exportForm').submit();");
    } elseif ($optionFlag == "delete") {
        astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'sms_sents');
        $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', $order, $divName, $ordering, '');
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    } elseif ($type == "delete") {
        $res = Customer::deleteRecord($id, 'sms_templates');
        if ($res) {
            $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $order, $divName, $ordering, $searchType);
            $objResponse = new xajaxResponse();
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("delete_rec"));
            $objResponse->addAssign($divName, "innerHTML", $html);
        } else {
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_delete"));
        }
    } else {
        $html = createGrid($numRows, $limit, $searchField, $searchContent, $order, $divName, $ordering, $searchType);
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    }
    return $objResponse->getXML();
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:47,代碼來源:sms_sents.server.php

示例5: searchFormSubmit

function searchFormSubmit($searchFormValue, $numRows = null, $limit = null, $id = null, $type = null)
{
    global $locate, $db;
    $objResponse = new xajaxResponse();
    $searchField = array();
    $searchContent = array();
    $optionFlag = $searchFormValue['optionFlag'];
    $exportFlag = $searchFormValue['exportFlag'];
    $searchContent = $searchFormValue['searchContent'];
    //搜索內容 數組
    $searchField = $searchFormValue['searchField'];
    //搜索條件 數組
    $searchType = $searchFormValue['searchType'];
    $ordering = $searchFormValue['ordering'];
    $order = $searchFormValue['order'];
    $divName = "grid";
    if ($optionFlag == "export" || $optionFlag == "exportcsv") {
        $sql = astercrm::getSql($searchContent, $searchField, $searchType, 'diallist');
        //得到要導出的sql語句
        $joinstr = astercrm::createSqlWithStype($searchField, $searchContent, $searchType, 'diallist');
        $joinstr = ltrim($joinstr, 'AND');
        $sql = "SELECT diallist.dialnumber, customer.customer,diallist.customername,diallist.dialtime, diallist.assign,diallist.status,groupname,campaignname,diallist.cretime,diallist.creby,diallist.memo FROM diallist LEFT JOIN astercrm_accountgroup ON astercrm_accountgroup.groupid = diallist.groupid LEFT JOIN campaign ON campaign.id = diallist.campaignid  LEFT JOIN customer ON customer.id = diallist.customerid";
        if ($joinstr != '') {
            $sql .= " WHERE " . $joinstr;
        }
        $_SESSION['export_sql'] = $sql;
        $objResponse->addAssign("hidSql", "value", $sql);
        //賦值隱含域
        $objResponse->addAssign("maintable", "value", 'diallist');
        //賦值隱含域
        $objResponse->addAssign("exporttype", "value", $optionFlag);
        $objResponse->addScript("document.getElementById('exportForm').submit();");
    } elseif ($optionFlag == "delete") {
        astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'diallist');
        $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', $order, $divName, $ordering, '');
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    } else {
        if ($type == "delete") {
            $res = Customer::deleteRecord($id, 'diallist');
            if ($res) {
                $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $order, $divName, $ordering, $searchType);
                $objResponse = new xajaxResponse();
                $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("delete_rec"));
            } else {
                $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_delete"));
            }
        } else {
            $html = createGrid($numRows, $limit, $searchField, $searchContent, $order, $divName, $ordering, $searchType);
        }
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    }
    return $objResponse->getXML();
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:55,代碼來源:diallist.server.php

示例6: searchFormSubmit

function searchFormSubmit($searchFormValue, $numRows, $limit, $id, $type)
{
    global $locate, $db;
    $objResponse = new xajaxResponse();
    $searchField = array();
    $searchContent = array();
    $optionFlag = $searchFormValue['optionFlag'];
    $deleteFlag = $searchFormValue['deleteFlag'];
    $exportFlag = $searchFormValue['exportFlag'];
    $searchContent = $searchFormValue['searchContent'];
    //搜索內容 數組
    $searchField = $searchFormValue['searchField'];
    //搜索條件 數組
    $searchType = $searchFormValue['searchType'];
    //搜索方式 數組
    $divName = "grid";
    if ($exportFlag == "1" || $optionFlag == "export") {
        $sql = astercrm::getSql($searchContent, $searchField, $searchType, 'curcdr');
        //得到要導出的sql語句
        $_SESSION['export_sql'] = $sql;
        $objResponse->addAssign("hidSql", "value", $sql);
        //賦值隱含域
        $objResponse->addScript("document.getElementById('exportForm').submit();");
    } elseif ($deleteFlag == "1" || $optionFlag == "delete") {
        Customer::deleteFromSearch($searchContent, $searchField, $searchType, 'curcdr');
        $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', '', $divName, "", 1, $searchType);
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    } else {
        if ($type == "delete") {
            $res = Customer::deleteRecord($id, 'curcdr');
            if ($res) {
                $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $searchField, $divName, "", 1, $searchType);
                $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("record deleted"));
            } else {
                $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("record cannot be deleted"));
            }
        } else {
            $html = createGrid($numRows, $limit, $searchField, $searchContent, $searchField, $divName, "", 1, $searchType);
        }
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    }
    return $objResponse->getXML();
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:45,代碼來源:curcdr.server.php

示例7: searchFormSubmit

function searchFormSubmit($searchFormValue, $numRows, $limit, $id, $type)
{
    global $locate, $db, $config;
    $objResponse = new xajaxResponse();
    $searchField = array();
    $searchContent = array();
    $searchType = array();
    $optionFlag = $searchFormValue['optionFlag'];
    $exportFlag = $searchFormValue['exportFlag'];
    $searchContent = $searchFormValue['searchContent'];
    //搜索內容 數組
    $searchField = $searchFormValue['searchField'];
    //搜索條件 數組
    $searchType = $searchFormValue['searchType'];
    //搜索方式 數組
    $divName = "grid";
    $allOrAnswer = $searchFormValue['allOrAnswer'];
    #選中的radio值
    if ($exportFlag == "1" || $optionFlag == "export") {
        if ($config['system']['useHistoryCdr'] == 1) {
            $table = 'historycdr';
        } else {
            $table = 'mycdr';
        }
        if ($searchFormValue['allOrAnswer'] == 'answered') {
            $searchContent[] = '0';
            $searchField[] = 'billsec';
            $searchType[] = 'more';
        }
        if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
            $fieldArray = array('id', 'calldate', 'src', 'dst', 'srcname', 'channel', 'dstchannel', 'didnumber', 'duration', 'billsec', 'billsec_leg_a', 'disposition', 'accountcode', 'userfield', 'srcuid', 'dstuid', 'queue', 'calltype', 'credit', 'callshopcredit', 'resellercredit', 'groupid', 'resellerid', 'userid', 'accountid', 'destination', 'monitored', 'memo', 'dialstring', 'dialstatus', 'children', 'ischild', 'processed', 'customerid', 'crm_customerid', 'contactid', 'discount', 'payment', 'note', 'setfreecall', 'astercrm_groupid', 'hangupcause', 'hangupcausetxt');
        } else {
            if ($_SESSION['curuser']['usertype'] == 'groupadmin') {
                $fieldArray = array('id', 'calldate', 'src', 'dst', 'srcname', 'channel', 'dstchannel', 'didnumber', 'duration', 'billsec', 'billsec_leg_a', 'disposition', 'accountcode', 'userfield', 'srcuid', 'dstuid', 'queue', 'calltype', 'credit', 'callshopcredit', 'groupid', 'resellerid', 'userid', 'accountid', 'destination', 'monitored', 'memo', 'dialstring', 'dialstatus', 'children', 'ischild', 'processed', 'customerid', 'crm_customerid', 'contactid', 'discount', 'payment', 'note', 'setfreecall', 'astercrm_groupid', 'hangupcause', 'hangupcausetxt');
            } else {
                if ($_SESSION['curuser']['usertype'] == 'operator' && $_SESSION['curuser']['usertype'] == 'clid') {
                    $fieldArray = array('id', 'calldate', 'src', 'dst', 'srcname', 'channel', 'dstchannel', 'didnumber', 'duration', 'billsec', 'billsec_leg_a', 'disposition', 'accountcode', 'userfield', 'srcuid', 'dstuid', 'queue', 'calltype', 'credit', 'groupid', 'resellerid', 'userid', 'accountid', 'destination', 'monitored', 'memo', 'dialstring', 'dialstatus', 'children', 'ischild', 'processed', 'customerid', 'crm_customerid', 'contactid', 'discount', 'payment', 'note', 'setfreecall', 'astercrm_groupid', 'hangupcause', 'hangupcausetxt');
                }
            }
        }
        $sql = astercrm::getSql($searchContent, $searchField, $searchType, $table, implode(',', $fieldArray));
        //得到要導出的sql語句
        $_SESSION['export_sql'] = $sql;
        $objResponse->addAssign("hidSql", "value", $sql);
        //賦值隱含域
        $objResponse->addScript("document.getElementById('exportForm').submit();");
        return $objResponse->getXML();
    } elseif ($optionFlag == "delete") {
        if ($config['system']['useHistoryCdr'] == 1) {
            $table = 'historycdr';
        } else {
            $table = 'mycdr';
        }
        if ($searchFormValue['allOrAnswer'] == 'answered') {
            $searchContent[] = '0';
            $searchField[] = 'billsec';
            $searchType[] = 'more';
        }
        astercrm::deletefromsearch($searchContent, $searchField, $searchType, $table);
        $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', '', $divName, "", $searchType, '', $allOrAnswer);
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    } elseif ($type == "delete") {
        $res = '';
        if ($res) {
            $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $searchField, $divName, "", $searchType, '', $allOrAnswer);
            $objResponse = new xajaxResponse();
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("delete_rec"));
        } else {
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_delete"));
        }
    } else {
        $html = createGrid($numRows, $limit, $searchField, $searchContent, $searchField[count($searchField) - 1], $divName, "", $searchType, '', $allOrAnswer);
    }
    $objResponse->addClear("msgZone", "innerHTML");
    $objResponse->addAssign($divName, "innerHTML", $html);
    return $objResponse->getXML();
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:78,代碼來源:cdr.server.php

示例8: searchFormSubmit

function searchFormSubmit($searchFormValue, $numRows, $limit, $id, $type)
{
    global $locate, $db, $config;
    $objResponse = new xajaxResponse();
    $searchField = array();
    $searchContent = array();
    $optionFlag = $searchFormValue['optionFlag'];
    $searchContent = $searchFormValue['searchContent'];
    //搜索內容 數組
    $searchField = $searchFormValue['searchField'];
    //搜索條件 數組
    $searchType = $searchFormValue['searchType'];
    //搜索方式 數組
    $divName = "grid";
    if ($optionFlag == "export") {
        $sql = astercrm::getSql($searchContent, $searchField, $searchType, 'clid');
        //得到要導出的sql語句
        $_SESSION['export_sql'] = $sql;
        $objResponse->addAssign("hidSql", "value", $sql);
        //賦值隱含域
        $objResponse->addScript("document.getElementById('exportForm').submit();");
    } elseif ($optionFlag == "delete") {
        if (empty($_SESSION['curuser']['usertype'])) {
            $objResponse->addAlert($locate->Translate("Session time out,please try again"));
            return $objResponse->getXML();
        }
        if ($_SESSION['curuser']['usertype'] == 'groupadmin') {
            $searchContent[] = $_SESSION['curuser']['groupid'];
            $searchField[] = 'groupid';
            $searchType[] = 'equal';
        } elseif ($_SESSION['curuser']['usertype'] == 'reseller') {
            $searchContent[] = $_SESSION['curuser']['resellerid'];
            $searchField[] = 'resellerid';
            $searchType[] = 'equal';
        }
        if ($config['synchronize']['delete_by_use_history']) {
            astercrm::deleteToHistoryFromSearch($searchContent, $searchField, $searchType, 'clid');
        } else {
            astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'clid');
        }
        $html = createGrid($numRows, $limit, '', '', '', $divName, "", $searchType);
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    } elseif ($type == "delete") {
        if (empty($_SESSION['curuser']['usertype'])) {
            $objResponse->addAlert($locate->Translate("Session time out,please try again"));
            return $objResponse->getXML();
        }
        if ($config['synchronize']['delete_by_use_history']) {
            $res = Customer::deleteRecordToHistory('id', $id, 'clid');
        } else {
            $res = Customer::deleteRecord($id, 'clid');
        }
        if ($res) {
            $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $searchField, $divName, "", $searchType);
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("record deleted"));
            $objResponse->addAssign($divName, "innerHTML", $html);
        } else {
            $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("record cannot be deleted"));
        }
    } else {
        $html = createGrid($numRows, $limit, $searchField, $searchContent, $searchField, $divName, "", $searchType);
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    }
    return $objResponse->getXML();
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:67,代碼來源:clid.server.php

示例9: searchFormSubmit

function searchFormSubmit($searchFormValue, $numRows, $limit, $id, $type)
{
    global $locate, $db, $config;
    $objResponse = new xajaxResponse();
    $searchField = array();
    $searchContent = array();
    $optionFlag = $searchFormValue['optionFlag'];
    $deleteFlag = $searchFormValue['deleteFlag'];
    $exportFlag = $searchFormValue['exportFlag'];
    $searchContent = $searchFormValue['searchContent'];
    //搜索內容 數組
    $searchField = $searchFormValue['searchField'];
    //搜索條件 數組
    $searchType = $searchFormValue['searchType'];
    //搜索方式 數組
    $divName = "grid";
    if ($exportFlag == "1" || $optionFlag == "export") {
        $sql = astercrm::getSql($searchContent, $searchField, $searchType, 'resellerrate');
        //得到要導出的sql語句
        $_SESSION['export_sql'] = $sql;
        $objResponse->addAssign("hidSql", "value", $sql);
        //賦值隱含域
        $objResponse->addScript("document.getElementById('exportForm').submit();");
    } elseif ($deleteFlag == "1" || $optionFlag == "delete") {
        if (empty($_SESSION['curuser']['usertype'])) {
            $objResponse->addAlert($locate->Translate("Session time out,please try again"));
            return $objResponse->getXML();
        }
        if ($config['synchronize']['delete_by_use_history']) {
            astercrm::deleteToHistoryFromSearch($searchContent, $searchField, $searchType, 'resellerrate');
        } else {
            astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'resellerrate');
        }
        $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', '', $divName, "", 1, $searchType);
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    } elseif ($optionFlag == "multiEdit") {
        $html = createGrid($numRows, $limit, $searchField, $searchContent, $searchField, $divName, "", 1, 1, $searchType);
        $showMutiEdit = Table::Top($locate->Translate("Multi Edit"), "formDiv");
        $showMutiEdit .= astercrm::formMutiEdit($searchContent, $searchField, $searchType, 'resellerrate');
        $showMutiEdit .= Table::Footer();
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
        $objResponse->addAssign('formDiv', "innerHTML", $showMutiEdit);
        $objResponse->addAssign('formDiv', "style.visibility", 'visible');
    } else {
        if ($type == "delete") {
            if (empty($_SESSION['curuser']['usertype'])) {
                $objResponse->addAlert($locate->Translate("Session time out,please try again"));
                return $objResponse->getXML();
            }
            if ($config['synchronize']['delete_by_use_history']) {
                $res = Customer::deleteRecordToHistory('id', $id, 'resellerrate');
            } else {
                $res = Customer::deleteRecord($id, 'resellerrate');
            }
            if ($res) {
                $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $searchField, $divName, "", 1, $searchType);
                $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("record deleted"));
            } else {
                $objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("record cannot be deleted"));
            }
        } else {
            $html = createGrid($numRows, $limit, $searchField, $searchContent, $searchField, $divName, "", 1, $searchType);
        }
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    }
    return $objResponse->getXML();
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:70,代碼來源:resellerrate.server.php


注:本文中的astercrm::getSql方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。