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


PHP astercrm::getAll方法代码示例

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


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

示例1: init

function init()
{
    global $locate;
    $objResponse = new xajaxResponse();
    $peers = array();
    if ($_SESSION['curuser']['usertype'] == 'admin') {
        // set all group first
        $group = astercrm::getAll('astercrm_accountgroup');
        //print_r($group);exit;
        $objResponse->addScript("addOption('groupid',0,'" . $locate->Translate("All") . "');");
        while ($group->fetchInto($row)) {
            $objResponse->addScript("addOption('groupid','" . $row['id'] . "','" . $row['groupname'] . "');");
        }
        $objResponse->addScript("addOption('agent_username','" . "" . "','" . $locate->Translate("All") . "');");
    } else {
        // set one group
        $objResponse->addScript("addOption('groupid','" . $_SESSION['curuser']['groupid'] . "','" . $_SESSION['curuser']['group']['groupname'] . "');");
        // set all agent
        $agent = getAgentRecords($_SESSION['curuser']['groupid']);
        $objResponse->addScript("addOption('agent_username','" . "" . "','" . $locate->Translate("All") . "');");
        while ($agent->fetchInto($row)) {
            $objResponse->addScript("addOption('agent_username','" . $row['username'] . "','" . $row['username'] . "');");
        }
    }
    $objResponse->addAssign("divNav", "innerHTML", common::generateManageNav($skin, $_SESSION['curuser']['country'], $_SESSION['curuser']['language']));
    $objResponse->addAssign("divCopyright", "innerHTML", common::generateCopyright($skin));
    return $objResponse;
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:28,代码来源:user_online.server.php

示例2: setAccount

function setAccount($groupid)
{
    global $locate;
    $objResponse = new xajaxResponse();
    $res = astercrm::getAll("astercrm_account", 'groupid', $groupid);
    //添加option
    $objResponse->addScript("addOption('accountid','" . "0" . "','" . $locate->Translate("All") . "');");
    while ($res->fetchInto($row)) {
        $objResponse->addScript("addOption('accountid','" . $row['id'] . "','" . $row['username'] . "');");
    }
    return $objResponse;
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:12,代码来源:report.server.php

示例3: array

	<?php 
require_once "checkout.common.php";
require_once "db_connect.php";
require_once 'include/asterevent.class.php';
require_once 'include/astercrm.class.php';
require_once 'include/common.class.php';
include 'openflash/php-ofc-library/open-flash-chart.php';
global $locate;
$color = array('#1F8FA1', '#848484', '#ffccff', '#CACFBE', '#DEF799', '#FF33C9', '#FF653F', '#669900', '#ffcc99', '#ffccff', '#99ccff', '#ffcc00');
//reseller array();
$reseller = astercrm::getAll('resellergroup');
while ($reseller->fetchInto($row)) {
    $id = $row['id'];
    $reseller_arr[$id] = $row['resellername'];
}
$group = astercrm::getAll('accountgroup');
while ($group->fetchInto($row)) {
    $id = $row['id'];
    $group_arr[$id] = $row['groupname'];
}
function parseReport($myreport)
{
    global $locate;
    $ary['recordNum'] = $myreport['recordNum'];
    $ary['seconds'] = $myreport['seconds'];
    $ary['credit'] = $myreport['credit'];
    $ary['callshopcredit'] = $myreport['callshopcredit'];
    $ary['resellercredit'] = $myreport['resellercredit'];
    if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
        $ary['markup'] = $myreport['callshopcredit'] - $myreport['resellercredit'];
    } else {
开发者ID:ljhcj,项目名称:IRISCC,代码行数:31,代码来源:checkout.server.piegroup.php

示例4: predictiveDialer

function predictiveDialer($f)
{
    global $config, $db, $locate;
    $objResponse = new xajaxResponse();
    //print_r($f);exit;
    $aDyadicArray[] = array($locate->Translate("src"), $locate->Translate("dst"), $locate->Translate("srcchan"), $locate->Translate("dstchan"), $locate->Translate("starttime"), $locate->Translate("answertime"), $locate->Translate("disposition"));
    $cDyadicArray[] = array($locate->Translate("src"), $locate->Translate("dst"), $locate->Translate("srcchan"), $locate->Translate("dstchan"), $locate->Translate("starttime"), $locate->Translate("first answertime"), $locate->Translate("answertime"), $locate->Translate("disposition"));
    // 检查系统目前的通话情况
    //if($_SESSION['curuser']['usertype'] == 'admin'){
    $sql = "SELECT curcdr.*,dialedlist.id as did,dialedlist.dialednumber,dialedlist.campaignid,dialedlist.dialedby,dialedlist.channel FROM curcdr LEFT JOIN dialedlist ON curcdr.srcchan=dialedlist.channel OR curcdr.dstchan=dialedlist.channel WHERE curcdr.id > 0 AND dialedlist.channel != '' ORDER by curcdr.id desc";
    $curdiledlist = $db->query($sql);
    //$curcdr = astercrm::getAll("curcdr");
    //}elseif($_SESSION['curuser']['usertype'] == 'groupadmin'){
    //	$curcdr = astercrm::getGroupCurcdr();
    //}
    $curdidlist = array();
    while ($curdiledlist->fetchInto($row)) {
        if ($row['did'] > 0) {
            if (in_array($row['did'], $curdidlist)) {
                continue;
            } else {
                $curdidlist[] = $row['did'];
                $campaignCDR[$row['campaignid']][] = array($row["src"], $row["dst"], $row["srcchan"], $row["dstchan"], $row["starttime"], $row["calldate"], $row["answertime"], $row["disposition"]);
            }
        } else {
            $query = "SELECT groupid FROM astercrm_account WHERE extension = '" . $row['dst'] . "' OR extension = '" . $row['dst'] . "'  GROUP BY groupid ORDER BY groupid DESC LIMIT 0,1";
            $groupid = $db->getOne($query);
            if ($groupid > 0) {
                $groupCDR[$groupid][] = array($row["src"], $row["dst"], $row["srcchan"], $row["dstchan"], $row["starttime"], $row["answertime"], $row["disposition"]);
            } elseif ($_SESSION['curuser']['usertype'] == 'admin') {
                //print_r($row);exit;
                $systemCDR[] = array($row["src"], $row["dst"], $row["srcchan"], $row["dstchan"], $row["starttime"], $row["answertime"], $row["disposition"]);
            }
        }
    }
    if ($_SESSION['curuser']['usertype'] == 'admin') {
        $systemChannels = common::generateTabelHtml(array_merge($aDyadicArray, $systemCDR));
    }
    $objResponse->addAssign("idvUnknowChannels", "innerHTML", nl2br(trim($systemChannels)));
    // clear all group
    $groups = astercrm::getAll("astercrm_accountgroup");
    while ($groups->fetchInto($group)) {
        $objResponse->addAssign("unknown" . $group['groupid'], "innerHTML", "");
    }
    // clear all campaign
    $campaigns = astercrm::getAll("campaign");
    while ($campaigns->fetchInto($campaign)) {
        $campaign_queue_name[$campaign['id']] = $campaign['queuename'];
        $objResponse->addAssign("campaign" . $campaign['id'], "innerHTML", "");
    }
    // start assign all CDRs
    foreach ($groupCDR as $key => $value) {
        if (is_array($value)) {
            $groupChannels = common::generateTabelHtml(array_merge($aDyadicArray, $value));
            $objResponse->addAssign("unknown{$key}", "innerHTML", nl2br(trim($groupChannels)));
        } else {
            $objResponse->addAssign("unknown{$key}", "innerHTML", "");
        }
    }
    foreach ($campaignCDR as $key => $value) {
        if (is_array($value)) {
            $campaignChannels = common::generateTabelHtml(array_merge($cDyadicArray, $value));
            $objResponse->addAssign("campaign{$key}", "innerHTML", nl2br(trim($campaignChannels)));
        } else {
            $objResponse->addAssign("campaign{$key}", "innerHTML", "");
        }
    }
    /*
    // 将$f按组别分类
    foreach ($f as $key => $value){
    	list ($campaignid, $field) = split("-",$key);
    	$predial_campaigns[$campaignid][$field] = $value;
    }
    
    foreach ($predial_campaigns as $key => $value){
    	if ($value['ckb'] == "on"){
    		// 查找是否还有待拨号码
    		$diallist_num[$key] = astercrm::getCountByField("campaignid", $key, "diallist");
    		$num = 0;
    		if ($diallist_num[$key]  > 0){
    			if ($value['limittpye'][0] == "channel"){
    				// 根据并发限制
    				// 检查目前该campaign的并发通道
    				$exp = $value['maxchannel'] - count($campaignCDR[$key]);
    				if (  $exp > 0 ){
    					// 可以发起呼叫, 规则为 (差额 +2)/3
    					$num = intval(($exp + 2)/3);
    					$i = 0;
    					while ($i<$num && placeCall($key)) $i++;
    				}else{
    					// skip this campaign
    				}
    			}else{
    				// 根据agent限制
    				// 获取目前agent的数目
    				$query = "SELECT COUNT(*) FROM queue_agent WHERE status = 'In use' AND queuename = '".$campaign_queue_name[$key]."' ";
    				$busy_agent_num = $db->getOne($query);
    
    				$query = "SELECT COUNT(*) FROM queue_agent WHERE status = 'Not in use' AND queuename = '".$campaign_queue_name[$key]."' ";
    				$free_agent_num = $db->getOne($query);
//.........这里部分代码省略.........
开发者ID:ljhcj,项目名称:IRISCC,代码行数:101,代码来源:predictivedialer.server.php

示例5: formEdit

    /**
     *  Imprime la forma para editar un nuevo registro sobre el DIV identificado por "formDiv".
     *
     *	@param $id		(int)		Identificador del registro a ser editado.
     *	@return $html	(string) Devuelve una cadena de caracteres que contiene la forma con los datos 
     *									a extraidos de la base de datos para ser editados 
     */
    function formEdit($id)
    {
        global $locate, $config;
        $rate =& Customer::getRecordByID($id, 'myrate');
        /*
        $group = astercrm::getAll('accountgroup');
        
        if ($_SESSION['curuser']['usertype'] == 'admin'){
        	$groupoptions .= '<select id="groupid" name="groupid">';
        	while	($group->fetchInto($row)){
        		if ($row['id'] == $rate['groupid']){
        			$groupoptions .= "<OPTION value='".$row['id']."' selected>".$row['groupname']."</OPTION>";
        		}else{
        			$groupoptions .= "<OPTION value='".$row['id']."'>".$row['groupname']."</OPTION>";
        		}
        	}
        	$groupoptions .= '</select>';
        }else{
        	while	($group->fetchInto($row)){
        		if ($row['id'] == $_SESSION['curuser']['groupid']){
        			$groupoptions .= $row['groupname'].'<input type="hidden" value="'.$row['id'].'" name="groupid" id="groupid">';
        			break;
        		}
        	}
        }
        */
        $reselleroptions = '';
        $reseller = astercrm::getAll('resellergroup');
        if ($_SESSION['curuser']['usertype'] == 'admin') {
            $reselleroptions .= '<select id="resellerid" name="resellerid" onchange="setGroup();">';
            $reselleroptions .= '<option value="0"></option>';
            while ($reseller->fetchInto($row)) {
                if ($config['synchronize']['display_synchron_server']) {
                    $row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
                }
                if ($row['id'] == $rate['resellerid']) {
                    $reselleroptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['resellername'] . "</OPTION>";
                } else {
                    $reselleroptions .= "<OPTION value='" . $row['id'] . "' >" . $row['resellername'] . "</OPTION>";
                }
            }
            $reselleroptions .= '</select>';
        } else {
            while ($reseller->fetchInto($row)) {
                if ($row['id'] == $rate['resellerid']) {
                    if ($config['synchronize']['display_synchron_server']) {
                        $row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
                    }
                    $reselleroptions .= $row['resellername'] . '<input type="hidden" value="' . $row['id'] . '" name="resellerid" id="resellerid">';
                    break;
                }
            }
        }
        $group = astercrm::getAll('accountgroup', 'resellerid', $rate['resellerid']);
        if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
            $groupoptions .= '<select id="groupid" name="groupid">';
            $groupoptions .= "<OPTION value='0'></OPTION>";
            while ($group->fetchInto($row)) {
                if ($config['synchronize']['display_synchron_server']) {
                    $row['groupname'] = astercrm::getSynchronDisplay($row['id'], $row['groupname']);
                }
                if ($row['id'] == $rate['groupid']) {
                    $groupoptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['groupname'] . "</OPTION>";
                } else {
                    $groupoptions .= "<OPTION value='" . $row['id'] . "' >" . $row['groupname'] . "</OPTION>";
                }
            }
            $groupoptions .= '</select>';
        } else {
            while ($group->fetchInto($row)) {
                if ($row['id'] == $rate['groupid']) {
                    if ($config['synchronize']['display_synchron_server']) {
                        $row['groupname'] = astercrm::getSynchronDisplay($row['id'], $row['groupname']);
                    }
                    $groupoptions .= $row['groupname'] . '<input type="hidden" value="' . $row['id'] . '" name="groupid" id="groupid">';
                    break;
                }
            }
        }
        $html = '
			<!-- No edit the next line -->
			<form method="post" name="f" id="f">
			
			<table border="1" width="100%" class="adminlist">
				<tr>
					<td nowrap align="left">' . $locate->Translate("prefix") . '</td>
					<td align="left"><input type="hidden" id="id" name="id" value="' . $rate['id'] . '"><input type="text" id="dialprefix" name="dialprefix" size="25" maxlength="30" value="' . $rate['dialprefix'] . '" onKeyUp="xajax_showBuyRate(this.value);" onclick="xajax_showBuyRate(this.value);">&nbsp;<span id="spanShowBuyRate" name="spanShowBuyRate"></span></td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("length") . '</td>
					<td align="left"><input type="text" id="numlen" name="numlen" size="10" maxlength="10" value="' . $rate['numlen'] . '"></td>
				</tr>
				<tr>
//.........这里部分代码省略.........
开发者ID:ljhcj,项目名称:IRISCC,代码行数:101,代码来源:rate.grid.inc.php

示例6: formMutiEdit

    function formMutiEdit($searchContent, $searchField, $searchType, $table)
    {
        global $locate;
        $reselleroptions = '';
        $reseller = astercrm::getAll('resellergroup');
        if ($_SESSION['curuser']['usertype'] == 'admin') {
            $reselleroptions .= '<select id="resellerid" name="resellerid"';
            if ($table != "resellerrate") {
                $reselleroptions .= 'onchange="setGroup();"';
            }
            $reselleroptions .= '><option value=""></option>';
            $reselleroptions .= '<option value="0">' . $locate->Translate("All") . '</option>';
            while ($reseller->fetchInto($row)) {
                $reselleroptions .= "<OPTION value='" . $row['id'] . "'>" . $row['resellername'] . "</OPTION>";
            }
            $reselleroptions .= '</select>';
        } else {
            while ($reseller->fetchInto($row)) {
                if ($row['id'] == $_SESSION['curuser']['resellerid']) {
                    $reselleroptions .= $row['resellername'] . '<input type="hidden" value="' . $row['id'] . '" name="resellerid" id="resellerid">';
                    break;
                }
            }
        }
        if ($table != "resellerrate") {
            $group = astercrm::getAll('accountgroup', 'resellerid', $_SESSION['curuser']['resellerid']);
            if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
                $groupoptions .= '<select id="groupid" name="groupid">';
                if ($_SESSION['curuser']['usertype'] == 'reseller') {
                    $groupoptions .= "<OPTION value=''></OPTION>";
                }
                $groupoptions .= "<OPTION value='0'>" . $locate->Translate("All") . "</OPTION>";
                while ($group->fetchInto($row)) {
                    $groupoptions .= "<OPTION value='" . $row['id'] . "'>" . $row['groupname'] . "</OPTION>";
                }
                $groupoptions .= '</select>';
            } else {
                while ($group->fetchInto($row)) {
                    if ($row['id'] == $_SESSION['curuser']['groupid']) {
                        $groupoptions .= $row['groupname'] . '<input type="hidden" value="' . $row['id'] . '" name="groupid" id="groupid">';
                        break;
                    }
                }
            }
        }
        //可修改字段
        $tableField = astercrm::getTableStructure('myrate');
        foreach ($tableField as $row) {
            if ($row['name'] != 'id' && $row['name'] != 'resellerid' && $row['name'] != 'groupid' && $row['name'] != 'addtime') {
                $fieldOption .= '<option value="' . $row['name'] . ',' . $row['type'] . '">' . $row['name'] . '</option>';
            }
        }
        //将条件重置成字符串,通过post传递
        $i = 0;
        foreach ($searchContent as $content) {
            if (trim($content) != '' && trim($searchField[$i]) != '') {
                $searchContentStr .= $content . ",";
                $searchFieldStr .= $searchField[$i] . ",";
                $searchTypeStr .= $searchType[$i] . ",";
            }
            $i++;
        }
        //echo $searchContentStr.$searchFieldStr.$searchTypeStr;exit;
        //print_r($searchField);exit;
        $html = '
			<!-- No edit the next line -->
			<form method="post" name="f" id="f">
			
			<table border="1" width="100%" class="adminlist">
				<tr>
					<td nowrap align="left">' . $locate->Translate("Option") . '</td>
					<td align="left"><input type="radio" name="multioption" id="multioption" value="modify" checked>&nbsp;' . $locate->Translate("Modify") . '&nbsp;&nbsp;<input type="radio" name="multioption" id="multioption" value="duplicate">&nbsp;' . $locate->Translate("Duplicate") . '</td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("Change") . '</td>
					<td align="left"><select id="multieditField" name="multieditField" onchange=\'xajax_setMultieditType(this.value)\'>' . $fieldOption . '</select>&nbsp;&nbsp;
					<select id="multieditType" name="multieditType" >
						<option value="to">' . $locate->Translate("to") . '</option>
					</select>&nbsp;&nbsp;<input type="text" id="multieditcontent" name="multieditcontent" size="15"></td>
				</tr>
				
				<tr>
					<td nowrap align="left">' . $locate->Translate("Reseller") . '</td>
					<td align="left">' . $reselleroptions . '</td>
				</tr>';
        if ($table != "resellerrate") {
            $html .= '<tr><td nowrap align="left">' . $locate->Translate("Group") . '</td><td align="left">' . $groupoptions . '</td></tr>';
        }
        $html .= '<tr>
					<td colspan="2" align="center">
						<button id="submitButton" onClick=\'xajax_multiEditUpdate("' . $searchContentStr . '","' . $searchFieldStr . '","' . $searchTypeStr . '","' . $table . '",xajax.getFormValues("f"));return false;\'>' . $locate->Translate("Continue") . '</button>
					</td>
				</tr>

			 </table>
			';
        $html .= '
			</form>';
        //echo $html;exit;
        return $html;
//.........这里部分代码省略.........
开发者ID:ljhcj,项目名称:IRISCC,代码行数:101,代码来源:astercrm.class.php

示例7: formEdit

    /**
     *  Imprime la forma para editar un nuevo registro sobre el DIV identificado por "formDiv".
     *
     *	@param $id		(int)		Identificador del registro a ser editado.
     *	@return $html	(string) Devuelve una cadena de caracteres que contiene la forma con los datos 
     *									a extraidos de la base de datos para ser editados 
     */
    function formEdit($id)
    {
        global $locate;
        $account =& Customer::getRecordByID($id, 'account');
        /*
        		$group = astercrm::getAll('accountgroup');
        
        		if ($_SESSION['curuser']['usertype'] == 'admin'){
        			$groupoptions .= '<select id="groupid" name="groupid">';
        			while	($group->fetchInto($row)){
        				if ($row['id'] == $account['groupid']){
        					$groupoptions .= "<OPTION value='".$row['id']."' selected>".$row['groupname']."</OPTION>";
        				}else{
        					$groupoptions .= "<OPTION value='".$row['id']."'>".$row['groupname']."</OPTION>";
        				}
        			}
        			if ($account['groupid'] == 0 ){
        				$groupoptions .= "<OPTION value='0' selected></OPTION>";
        			}else{
        				$groupoptions .= "<OPTION value='0'></OPTION>";
        			}
        			$groupoptions .= '</select>';
        		}else{
        			while	($group->fetchInto($row)){
        				if ($row['id'] == $account['groupid']){
        					$groupoptions .= $row['groupname'].'<input type="hidden" value="'.$row['id'].'" name="groupid" id="groupid">';
        					break;
        				}
        			}
        		}
        */
        $reselleroptions = '';
        $reseller = astercrm::getAll('resellergroup');
        if ($_SESSION['curuser']['usertype'] == 'admin') {
            $reselleroptions .= '<select id="resellerid" name="resellerid" onchange="setGroup();">';
            $reselleroptions .= '<option value="0"></option>';
            while ($reseller->fetchInto($row)) {
                if ($row['id'] == $account['resellerid']) {
                    $reselleroptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['resellername'] . "</OPTION>";
                } else {
                    $reselleroptions .= "<OPTION value='" . $row['id'] . "' >" . $row['resellername'] . "</OPTION>";
                }
            }
            $reselleroptions .= '</select>';
        } else {
            while ($reseller->fetchInto($row)) {
                if ($row['id'] == $account['resellerid']) {
                    $reselleroptions .= $row['resellername'] . '<input type="hidden" value="' . $row['id'] . '" name="resellerid" id="resellerid">';
                    break;
                }
            }
        }
        $group = astercrm::getAll('accountgroup', 'resellerid', $account['resellerid']);
        if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
            $groupoptions .= '<select id="groupid" name="groupid">';
            $groupoptions .= "<OPTION value='0'></OPTION>";
            while ($group->fetchInto($row)) {
                if ($row['id'] == $account['groupid']) {
                    $groupoptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['groupname'] . "</OPTION>";
                } else {
                    $groupoptions .= "<OPTION value='" . $row['id'] . "' >" . $row['groupname'] . "</OPTION>";
                }
            }
            $groupoptions .= '</select>';
        } else {
            while ($group->fetchInto($row)) {
                if ($row['id'] == $account['groupid']) {
                    $groupoptions .= $row['groupname'] . '<input type="hidden" value="' . $row['id'] . '" name="groupid" id="groupid">';
                    break;
                }
            }
        }
        $html = '
			<!-- No edit the next line -->
			<form method="post" name="f" id="f">
			
			<table border="1" width="100%" class="adminlist">
				<tr>
					<td nowrap align="left">' . $locate->Translate("username") . '</td>
					<td align="left"><input type="hidden" id="id" name="id" value="' . $account['id'] . '"><input type="text" id="username" name="username" size="25" maxlength="30" value="' . $account['username'] . '"></td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("password") . '</td>
					<td align="left"><input type="text" id="password" name="password" size="25" maxlength="30" value="' . $account['password'] . '"></td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("usertype") . '</td>
					<td align="left">
					<select id="usertype" name="usertype">
						<option value="" ';
        if ($account['usertype'] == '') {
            $html .= ' selected ';
        }
//.........这里部分代码省略.........
开发者ID:ljhcj,项目名称:IRISCC,代码行数:101,代码来源:account_log.grid.inc.php

示例8: setGroup

function setGroup($resellerid)
{
    global $locate, $config;
    $objResponse = new xajaxResponse();
    $res = astercrm::getAll("accountgroup", 'resellerid', $resellerid);
    //添加option
    while ($res->fetchInto($row)) {
        if ($config['synchronize']['display_synchron_server']) {
            $row['groupname'] = astercrm::getSynchronDisplay($row['id'], $row['groupname']);
        }
        $objResponse->addScript("addOption('groupid','" . $row['id'] . "','" . $row['groupname'] . "');");
    }
    return $objResponse;
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:14,代码来源:clid.server.php

示例9: formEdit

    /**
     *  Imprime la forma para editar un nuevo registro sobre el DIV identificado por "formDiv".
     *
     *	@param $id		(int)		Identificador del registro a ser editado.
     *	@return $html	(string) Devuelve una cadena de caracteres que contiene la forma con los datos 
     *									a extraidos de la base de datos para ser editados 
     */
    function formEdit($id)
    {
        global $locate, $config;
        $clid =& Customer::getRecordByID($id, 'clid');
        if ($clid['isshow'] == 'yes') {
            $selecty = "selected";
            $selectn = "";
        } else {
            if ($clid['isshow'] == 'no') {
                $selecty = "";
                $selectn = "selected";
            }
        }
        $reselleroptions = '';
        $reseller = astercrm::getAll('resellergroup');
        if ($_SESSION['curuser']['usertype'] == 'admin') {
            $reselleroptions .= '<select id="resellerid" name="resellerid" onchange="setGroup();">';
            $reselleroptions .= '<option value="0"></option>';
            while ($reseller->fetchInto($row)) {
                if ($config['synchronize']['display_synchron_server']) {
                    $row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
                }
                if ($row['id'] == $clid['resellerid']) {
                    $reselleroptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['resellername'] . "</OPTION>";
                } else {
                    $reselleroptions .= "<OPTION value='" . $row['id'] . "' >" . $row['resellername'] . "</OPTION>";
                }
            }
            $reselleroptions .= '</select>';
        } else {
            while ($reseller->fetchInto($row)) {
                if ($row['id'] == $clid['resellerid']) {
                    if ($config['synchronize']['display_synchron_server']) {
                        $row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
                    }
                    $reselleroptions .= $row['resellername'] . '<input type="hidden" value="' . $row['id'] . '" name="resellerid" id="resellerid">';
                    break;
                }
            }
        }
        $group = astercrm::getAll('accountgroup', 'resellerid', $clid['resellerid']);
        if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
            $groupoptions .= '<select id="groupid" name="groupid">';
            $groupoptions .= "<OPTION value='0'></OPTION>";
            while ($group->fetchInto($row)) {
                if ($config['synchronize']['display_synchron_server']) {
                    $row['groupname'] = astercrm::getSynchronDisplay($row['id'], $row['groupname']);
                }
                if ($row['id'] == $clid['groupid']) {
                    $groupoptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['groupname'] . "</OPTION>";
                } else {
                    $groupoptions .= "<OPTION value='" . $row['id'] . "' >" . $row['groupname'] . "</OPTION>";
                }
            }
            $groupoptions .= '</select>';
        } else {
            while ($group->fetchInto($row)) {
                if ($row['id'] == $clid['groupid']) {
                    if ($config['synchronize']['display_synchron_server']) {
                        $row['groupname'] = astercrm::getSynchronDisplay($row['id'], $row['groupname']);
                    }
                    $groupoptions .= $row['groupname'] . '<input type="hidden" value="' . $row['id'] . '" name="groupid" id="groupid">';
                    break;
                }
            }
        }
        if ($clid['status'] == 1) {
            $statusoptions = '
							<option value="1" selected>' . $locate->Translate("Avaiable") . '</option>
							<option value="-1">' . $locate->Translate("Lock") . '</option>
						';
        } else {
            $statusoptions = '
							<option value="1">' . $locate->Translate("Avaiable") . '</option>
							<option value="-1" selected>' . $locate->Translate("Lock") . '</option>
						';
        }
        $configstatus = common::read_ini_file($config['system']['astercc_path'] . '/astercc.conf', $asterccConfig);
        if ($configstatus == -2) {
            $html = "(fail to read " . $config['system']['astercc_path'] . "/astercc.conf)";
            return $html;
        } else {
            $billingfield = trim($asterccConfig['system']['billingfield']);
        }
        if ($_SESSION['curuser']['usertype'] == 'clid') {
            $readonly = "readonly";
        }
        $html = '
			<!-- No edit the next line -->
			<form method="post" name="f" id="f">
			
			<table border="1" width="100%" class="adminlist">
				<tr>
//.........这里部分代码省略.........
开发者ID:ljhcj,项目名称:IRISCC,代码行数:101,代码来源:clid.grid.inc.php

示例10: setGroup

function setGroup($resellerid)
{
    global $locate, $config;
    $objResponse = new xajaxResponse();
    $res = astercrm::getAll("accountgroup", 'resellerid', $resellerid);
    $objResponse->addScript("addOption('groupid','0','" . $locate->Translate("All") . "');");
    //添加option
    while ($res->fetchInto($row)) {
        if ($config['synchronize']['id_autocrement_byset'] && ($row['id'] < $config['local_host']['minId'] || $row['id'] > $config['local_host']['maxId'])) {
            continue;
        }
        $objResponse->addScript("addOption('groupid','" . $row['id'] . "','" . $row['groupname'] . "');");
    }
    return $objResponse;
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:15,代码来源:import.server.php

示例11: showItem

    function showItem($optionid)
    {
        global $locate, $db;
        $html = '
				<!-- No edit the next line -->
				<form method="post" name="fItem" id="fItem" method="post">
				
				<table border="1" width="100%" class="adminlist" id="tblItem">
				';
        $surveyoption = astercrm::getRecordById($optionid, "surveyoptions");
        $html .= "<tr><td>" . $locate->translate("Option") . "</td><td>" . $surveyoption['surveyoption'] . "(" . $locate->Translate($surveyoption['optiontype']) . ")" . "</td></tr>";
        $items = astercrm::getAll("surveyoptionitems", "optionid", $optionid);
        $i = 0;
        while ($row = $items->fetchRow()) {
            //65
            $html .= "<tr><td>" . chr(65 + $i) . '(<a href="?" onclick="deleteItem(\'' . $row['id'] . '\',\'' . $optionid . '\');return false;"><img src="skin/default/images/trash.png"></a>)</td><td>' . $row['itemcontent'] . "</td></tr>";
            $i++;
        }
        $html .= "<tr><td>" . chr(65 + $i) . "</td><td>\r\n\t\t\t\t\t\t\t\t\t\t<input type=hidden id=optionid name=optionid value=\"{$optionid}\"/>\r\n\t\t\t\t\t\t\t\t\t\t<input type=hidden id=optiontype name=optiontype value=\"" . $surveyoption['optiontype'] . "\"/>\r\n\t\t\t\t\t\t\t\t\t\t<input type=text id=itemcontent name=itemcontent size=40 maxlength=254/>\r\n\t\t\t\t\t\t\t\t\t\t<input type=\"button\" value=\"" . $locate->Translate("Add Item") . "\" onclick=\"addItem();\">\r\n\t\t\t\t\t\t\t\t\t</td></tr>";
        $html .= "</table></form>";
        return $html;
    }
开发者ID:ljhcj,项目名称:IRISCC,代码行数:22,代码来源:survey.grid.inc.php

示例12: showChannelsInfo

/**
*  initialize page elements
*  @return	objResponse		object		xajax response object
*/
function showChannelsInfo()
{
    global $locate, $config, $db;
    $aDyadicArray[] = array($locate->Translate("src"), $locate->Translate("dst"), $locate->Translate("srcchan"), $locate->Translate("dstchan"), $locate->Translate("starttime"), $locate->Translate("answertime"), $locate->Translate("disposition"));
    $objResponse = new xajaxResponse();
    if ($config['system']['eventtype'] == 'curcdr') {
        if ($_SESSION['curuser']['usertype'] == 'admin') {
            $curcdr = astercrm::getAll("curcdr");
        } else {
            //print_r($_SESSION['curuser']['memberExtens']);exit;
            $curcdr = astercrm::getGroupCurcdr();
        }
        while ($curcdr->fetchInto($row)) {
            $systemCDR[] = array($row["src"], $row["dst"], $row["srcchan"], $row["dstchan"], $row["starttime"], $row["answertime"], $row["disposition"]);
        }
        $activeCalls = "&nbsp;&nbsp;" . count($systemCDR) . "&nbsp;" . $locate->Translate("active calls");
        $objResponse->addAssign("divActiveCalls", "innerHTML", $activeCalls);
        $systemChannels = common::generateTabelHtml(array_merge($aDyadicArray, $systemCDR));
        $objResponse->addAssign("channels", "innerHTML", nl2br(trim($systemChannels)));
        return $objResponse;
    }
    $channels = split(chr(13), asterisk::getCommandData('show channels verbose'));
    /*
    	if ($channels == null){
    			$objResponse->addAssign("channels", "innerHTML", "can not connect to AMI, please check config.php");
    			return $objResponse;
    	}
    */
    $channels = split(chr(10), $channels[1]);
    //trim the first two records and the last three records
    //	array_pop($channels);
    array_pop($channels);
    $activeCalls = array_pop($channels);
    $activeChannels = array_pop($channels);
    array_shift($channels);
    $title = array_shift($channels);
    $title = split("_", implode("_", array_filter(split(" ", $title))));
    $myInfo[] = $title;
    foreach ($channels as $channel) {
        if (strstr($channel, " Dial")) {
            $myItem = split("_", implode("_", array_filter(split(" ", $channel))));
            $myInfo[] = $myItem;
        }
    }
    $myChannels = common::generateTabelHtml($myInfo);
    $objResponse->addAssign("divActiveCalls", "innerHTML", $activeCalls);
    $objResponse->addAssign("channels", "innerHTML", nl2br(trim($myChannels)));
    return $objResponse;
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:53,代码来源:systemstatus.server.php

示例13: setGroup

function setGroup($resellerid)
{
    global $locate;
    $objResponse = new xajaxResponse();
    $res = astercrm::getAll("accountgroup", 'resellerid', $resellerid);
    $objResponse->addScript("addOption('groupid','0','');");
    //添加option
    while ($res->fetchInto($row)) {
        $objResponse->addScript("addOption('groupid','" . $row['id'] . "','" . $row['groupname'] . "');");
    }
    return $objResponse;
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:12,代码来源:account_log.server.php

示例14: listCDR

function listCDR($aFormValues)
{
    global $locate, $config;
    $reseller = astercrm::getAll('resellergroup');
    while ($reseller->fetchInto($row)) {
        $id = $row['id'];
        $reseller_arr[$id] = $row['resellername'];
    }
    $group = astercrm::getAll('accountgroup');
    while ($group->fetchInto($row)) {
        $id = $row['id'];
        $group_arr[$id] = $row['groupname'];
    }
    $objResponse = new xajaxResponse();
    $objResponse->addAssign("divMsg", "style.visibility", "hidden");
    if ($aFormValues['sltBooth'] == '' && $aFormValues['hidCurpeer'] != '') {
        $aFormValues['sltBooth'] = $aFormValues['hidCurpeer'];
    }
    list($syear, $smonth, $sday, $stime) = split("[ -]", $aFormValues['sdate']);
    $syear = (int) $syear;
    $smonth = (int) $smonth;
    $sday = (int) $sday;
    list($shours, $smins) = split("[ :]", $stime);
    $shours = (int) $shours;
    if ($shours == 0) {
        $shours = '00';
    }
    $smins = (int) $smins;
    if ($smins == 0) {
        $smins = '00';
    }
    list($eyear, $emonth, $eday, $etime) = split("[ -]", $aFormValues['edate']);
    $eyear = (int) $eyear;
    $emonth = (int) $emonth;
    $eday = (int) $eday;
    list($ehours, $emins) = split("[ :]", $etime);
    $ehours = (int) $ehours;
    if ($ehours == 0) {
        $ehours = '00';
    }
    $emins = (int) $emins;
    if ($emins == 0) {
        $emins = '00';
    }
    $ary = array();
    if ($aFormValues['reporttype'] == "text") {
        $aFormValues['sdate'] = $syear . "-" . $smonth . "-" . $sday . ' ' . $shours . ':' . $smins;
        $aFormValues['edate'] = $eyear . "-" . $emonth . "-" . $eday . ' ' . $ehours . ':' . $emins;
    } else {
        $aFormValues['sdate'] = $syear . "-" . $smonth . "-" . $sday;
        $aFormValues['edate'] = $eyear . "-" . $emonth . "-" . $eday;
    }
    if ($aFormValues['listType'] == "none") {
        $res = astercc::readReport($aFormValues['resellerid'], $aFormValues['groupid'], $aFormValues['sltBooth'], $aFormValues['sdate'], $aFormValues['edate']);
        $answeredNum = astercc::readAnsweredNum($aFormValues['resellerid'], $aFormValues['groupid'], $aFormValues['sltBooth'], $aFormValues['sdate'], $aFormValues['edate']);
        $a2bcost = -1;
        if ($config['a2billing']['enable']) {
            $a2bcost = Customer::readA2Breport($aFormValues['resellerid'], $aFormValues['groupid'], $aFormValues['sltBooth'], $aFormValues['sdate'], $aFormValues['edate']);
        }
        if ($res->fetchInto($myreport)) {
            $result = parseReport($myreport, $answeredNum, $a2bcost);
            $html .= $result['html'];
        }
        $objResponse->addAssign("divUnbilledList", "innerHTML", $html);
        return $objResponse;
    } elseif ($aFormValues['listType'] == "sumyear") {
        if ($aFormValues['reporttype'] == "flash") {
            $objResponse->addScript("actionFlash('" . $aFormValues["resellerid"] . "','" . $aFormValues["groupid"] . "','" . $aFormValues["sltBooth"] . "','" . $aFormValues["sdate"] . "','" . $aFormValues["edate"] . "','" . $aFormValues["listType"] . "','" . $aFormValues["hidCurpeer"] . "');");
            $html = "";
        } else {
            for ($year = $syear; $year <= $eyear; $year++) {
                $res = astercc::readReport($aFormValues['resellerid'], $aFormValues['groupid'], $aFormValues['sltBooth'], "{$year}-1-1 00:00:00", "{$year}-12-31 23:59:59");
                $answeredNum = astercc::readAnsweredNum($aFormValues['resellerid'], $aFormValues['groupid'], $aFormValues['sltBooth'], "{$year}-1-1 00:00:00", "{$year}-12-31 23:59:59");
                $a2bcost = -1;
                if ($config['a2billing']['enable']) {
                    $a2bcost = Customer::readA2Breport($aFormValues['resellerid'], $aFormValues['groupid'], $aFormValues['sltBooth'], "{$year}-1-1 00:00:00", "{$year}-12-31 23:59:59");
                }
                if ($res->fetchInto($myreport)) {
                    $html .= "<div class='box'>";
                    $html .= "{$year} :<br/>";
                    $html .= "<div>";
                    $result = parseReport($myreport, $answeredNum, $a2bcost);
                    $html .= $result['html'];
                    $html .= "</div>";
                    $html .= "</div>";
                    $ary['recordNum'] += $result['data']['recordNum'];
                    $ary['seconds'] += $result['data']['seconds'];
                    $ary['credit'] += $result['data']['credit'];
                    $ary['callshopcredit'] += $result['data']['callshopcredit'];
                    $ary['resellercredit'] += $result['data']['resellercredit'];
                    $ary['billsec_leg_a'] += $myreport['billsec_leg_a'];
                    $answeredNumTotal += $answeredNum;
                    if ($config['a2billing']['enable']) {
                        $a2bcostTotal += $a2bcost;
                    }
                }
            }
            if (!$config['a2billing']['enable']) {
                $a2bcostTotal = -1;
            }
//.........这里部分代码省略.........
开发者ID:ljhcj,项目名称:IRISCC,代码行数:101,代码来源:checkout.server.php

示例15: formEdit

    /**
     *  Imprime la forma para editar un nuevo registro sobre el DIV identificado por "formDiv".
     *
     *	@param $id		(int)		Identificador del registro a ser editado.
     *	@return $html	(string) Devuelve una cadena de caracteres que contiene la forma con los datos 
     *									a extraidos de la base de datos para ser editados 
     */
    function formEdit($id)
    {
        global $locate, $config;
        $group =& Customer::getRecordByID($id, 'accountgroup');
        $reselleroptions = '';
        $reseller = astercrm::getAll('resellergroup');
        if ($_SESSION['curuser']['usertype'] == 'admin') {
            $reselleroptions .= '<select id="resellerid" name="resellerid">';
            $reselleroptions .= '<option value="0"></option>';
            while ($reseller->fetchInto($row)) {
                if ($config['synchronize']['display_synchron_server']) {
                    $row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
                }
                if ($row['id'] == $group['resellerid']) {
                    $reselleroptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['resellername'] . "</OPTION>";
                } else {
                    $reselleroptions .= "<OPTION value='" . $row['id'] . "'>" . $row['resellername'] . "</OPTION>";
                }
            }
            $reselleroptions .= '</select>';
            //the admin has the reset group button
            $resetBtnStr = '<input type="button" onclick="if(confirm(&quot;' . $locate->Translate("Make Sure To Reset The Relate Data By Group") . '?&quot;)) xajax_resetGroup(&quot;' . $group['id'] . '&quot;);return false;" value="' . $locate->Translate("Reset Group") . '">';
        } else {
            while ($reseller->fetchInto($row)) {
                if ($row['id'] == $_SESSION['curuser']['resellerid']) {
                    if ($config['synchronize']['display_synchron_server']) {
                        $row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
                    }
                    $reselleroptions .= $row['resellername'] . '<input type="hidden" value="' . $row['id'] . '" name="resellerid" id="resellerid">';
                    break;
                }
            }
            //except the admin,other don't have the reset group button
            $resetBtnStr = '';
        }
        $html = '
			<!-- No edit the next line -->
			<form method="post" name="f" id="f">
			<input type="hidden" id="groupid" name="groupid" value=' . $group['id'] . '>
			<table border="1" width="100%" class="adminlist">
				<tr>
					<td nowrap align="left">' . $locate->Translate("Reseller") . '*</td>
					<td align="left">' . $reselleroptions . '</td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("Group Name") . '*</td>
					<td align="left"><input type="text" id="groupname" name="groupname" size="25" maxlength="30" value="' . $group['groupname'] . '">&nbsp;' . $resetBtnStr . '</td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("Title") . '</td>
					<td align="left"><input type="text" id="grouptitle" name="grouptitle" size="25" maxlength="50" value="' . $group['grouptitle'] . '"></td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("Tagline") . '</td>
					<td align="left"><input type="text" id="grouptagline" name="grouptagline" size="25" maxlength="80" value="' . $group['grouptagline'] . '"></td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("Account Code") . '</td>
					<td align="left"><input type="text" id="accountcode" name="accountcode" size="25" maxlength="30" value="' . $group['accountcode'] . '">' . "(" . $locate->Translate("might be useful for callback") . ")" . '</td>
				</tr>
				<!--<tr>
					<td nowrap align="left">' . $locate->Translate("Allow Callback") . '</td>
					<td align="left">
					<select id="allowcallback" name="allowcallback">';
        if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['allowcallback'] == 'yes') {
            if ($group['allowcallback'] == "yes") {
                $html .= '<option value="yes" selected>' . $locate->Translate("Yes") . '</option>';
                $html .= '<option value="no">' . $locate->Translate("No") . '</option>';
            } else {
                $html .= '<option value="yes">' . $locate->Translate("Yes") . '</option>';
                $html .= '<option value="no" selected>' . $locate->Translate("No") . '</option>';
            }
        } else {
            $html .= '<option value="no">' . $locate->Translate("No") . '</option>';
        }
        $html .= '
					</select>
					</td>
				</tr>-->
				<tr>
					<td nowrap align="left">' . $locate->Translate("Credit Limit") . '*</td>
					<td align="left"><input type="text" id="creditlimit" name="creditlimit" size="25" maxlength="30" value="' . $group['creditlimit'] . '"></td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("Cur Credit") . '</td>
					<td align="left">
					<input type="text" id="curcreditshow" name="curcreditshow" size="25" maxlength="100" value="' . $group['curcredit'] . '" readonly>
					<input type="hidden" id="curcredit" name="curcredit" value="' . $group['curcredit'] . '">
				</td>
				</tr>
				<tr>
					<td nowrap align="left">' . $locate->Translate("Operate") . '</td>
					<td align="left" id="tdOperate">
//.........这里部分代码省略.........
开发者ID:ljhcj,项目名称:IRISCC,代码行数:101,代码来源:accountgroup.grid.inc.php


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