示例#1
0
function showContact($id = null, $type = "contact")
{
    global $locate;
    $objResponse = new xajaxResponse();
    if ($id != null) {
        $html = Table::Top($locate->Translate("contact_detail"), "formContactInfo");
        $contactHTML .= Customer::showContactRecord($id, $type);
        if ($contactHTML == '') {
            return $objResponse->getXML();
        } else {
            $html .= $contactHTML;
        }
        $html .= Table::Footer();
        $objResponse->addAssign("formContactInfo", "style.visibility", "visible");
        $objResponse->addAssign("formContactInfo", "innerHTML", $html);
        return $objResponse->getXML();
    }
}
示例#2
0
function viewSubordinateTicket($pid)
{
    global $locate;
    $html = Table::Top($locate->Translate("view_subordinate_ticketdetails"), "formSubordinateTicketDiv");
    $html .= Customer::subordinateTicket($pid);
    $html .= Table::Footer();
    // End edit zone
    $objResponse = new xajaxResponse();
    $objResponse->addAssign("formSubordinateTicketDiv", "style.visibility", "visible");
    $objResponse->addAssign("formSubordinateTicketDiv", "innerHTML", $html);
    return $objResponse->getXML();
}
示例#3
0
function checkDuplicates($f)
{
    global $db, $locate;
    $html = Table::Top($locate->Translate("Duplicate Recorder"), "formDuplicate");
    $html .= Customer::createDupGrid($f);
    $html .= Table::Footer();
    //$html .= '<input id="curdupdate" type="hidden" value="">';
    $objResponse = new xajaxResponse();
    $objResponse->addScript("var curf = xajax.getFormValues('searchForm');xajax.\$('curdupdate').value=curf;");
    $objResponse->addAssign("formDuplicate", "style.visibility", "visible");
    $objResponse->addAssign("formDuplicate", "innerHTML", $html);
    return $objResponse->getXML();
    //DELETE diallist as a FROM diallist as a ,( SELECT * FROM diallist GROUP BY dialnumber HAVING COUNT(dialnumber) > 1 ) as b WHERE a.dialnumber = b.dialnumber and a.id <=  b.id ;
}
示例#4
0
function playmonitor($path, $l, $t)
{
    global $config, $locate;
    $objResponse = new xajaxResponse();
    $html = Table::Top($locate->Translate("playmonitor"), "formplaymonitor");
    if (is_file($path) && !empty($path)) {
        $filebasename = basename($path);
        $file_extension = strtolower(substr(strrchr($filebasename, "."), 1));
        if ($file_extension == 'mp3') {
            $html .= '<object type="application/x-shockwave-flash" data="skin/default/player_mp3_maxi.swf" width="200" height="20"><param name="movie" value="skin/default/player_mp3_maxi.swf" /><param name="bgcolor" value="#ffffff" /><param name="FlashVars" value="mp3=records.php?file=' . $path . '&amp;loop=0&amp;autoplay=1&amp;autoload=1&amp;volume=75&amp;showstop=1&amp;showinfo=1&amp;showvolume=1&amp;showloading=always" /></object><br><a href="###" onclick="window.location.href=\'records.php?file=' . $path . '\'">' . $locate->Translate("download") . '</a>';
        } else {
            $html .= '<embed src="records.php?file=' . $path . '" autostart="true" width="300" height="40" name="sound" id="sound" enablejavascript="true"><br><a href="###" onclick="window.location.href=\'records.php?file=' . $path . '\'">' . $locate->Translate("download") . '</a>';
        }
    } else {
        $html .= '<b>404 File not found!</b>';
    }
    $html .= Table::Footer();
    $objResponse->addAssign("formplaymonitor", "style.left", $l - 500 . "px");
    $objResponse->addAssign("formplaymonitor", "style.top", $t - 120 . "px");
    $objResponse->addAssign("formplaymonitor", "style.visibility", "visible");
    $objResponse->addAssign("formplaymonitor", "innerHTML", $html);
    return $objResponse->getXML();
}
示例#5
0
function showNoteLeads($id = '')
{
    global $locate;
    if ($id != '') {
        $html = Table::Top($locate->Translate("note_detail"), "formNoteInfo");
        $html .= Customer::showNoteLeads($id);
        $html .= Table::Footer();
        $objResponse = new xajaxResponse();
        $objResponse->addAssign("formNoteInfo", "style.visibility", "visible");
        $objResponse->addAssign("formNoteInfo", "innerHTML", $html);
        return $objResponse->getXML();
    }
}
示例#6
0
function add($surveyid = 0)
{
    global $locate;
    $objResponse = new xajaxResponse();
    $html = Table::Top($locate->Translate("add_survey"), "formDiv");
    $html .= Customer::formAdd($surveyid);
    $html .= Table::Footer();
    $objResponse->addAssign("formDiv", "style.visibility", "visible");
    $objResponse->addAssign("formDiv", "innerHTML", $html);
    if ($surveyid == 0) {
        $objResponse->addScript("xajax.\$('surveyname').focus();");
    } else {
        $objResponse->addScript("xajax.\$('surveyoption').focus();");
    }
    return $objResponse->getXML();
}
示例#7
0
/**
*  show contact record detail
*  @param	contactid	int			contact id
*  @return	objResponse	object		xajax response object
*/
function showDetail($contactid)
{
    global $locate;
    $objResponse = new xajaxResponse();
    if ($contactid != null) {
        $html = Table::Top($locate->Translate("contact_detail"), "formContactInfo");
        $html .= Customer::showContactRecord($contactid);
        $html .= Table::Footer();
        $objResponse->addAssign("formContactInfo", "style.visibility", "visible");
        $objResponse->addAssign("formContactInfo", "innerHTML", $html);
    }
    return $objResponse->getXML();
}
示例#8
0
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, 'callshoprate');
        //,$searchFormValue['displaymode'] //得到要导出的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 ($_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, 'callshoprate', $searchFormValue['displaymode']);
        } else {
            astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'callshoprate', $searchFormValue['displaymode']);
        }
        $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', '', $divName, "", 1, $searchType, $searchFormValue['displaymode']);
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    } elseif ($optionFlag == "multiEdit") {
        $html = createGrid($numRows, $limit, $searchField, $searchContent, $searchField, $divName, "", 1, 1, $searchType, $searchFormValue['displaymode']);
        $showMutiEdit = Table::Top($locate->Translate("Multi Edit"), "formDiv");
        $showMutiEdit .= astercrm::formMutiEdit($searchContent, $searchField, $searchType, 'callshoprate');
        $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, 'callshoprate');
            } else {
                $res = Customer::deleteRecord($id, 'callshoprate');
            }
            if ($res) {
                $html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $searchField, $divName, "", 1, $searchType, $searchFormValue['displaymode']);
                $objResponse = new xajaxResponse();
                $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, $searchFormValue['displaymode']);
        }
        $objResponse->addClear("msgZone", "innerHTML");
        $objResponse->addAssign($divName, "innerHTML", $html);
    }
    return $objResponse->getXML();
}
示例#9
0
function showWorkoff()
{
    global $locate;
    $html = Table::Top($locate->Translate("Work Off"), "formWorkoff");
    $html .= '
			<!-- No edit the next line -->
			<form method="post" name="workoff" id="workoff">			
			<table border="1" width="100%" class="adminlist">
			<tr>
				<td nowrap align="right">' . $locate->Translate("User Name") . '&nbsp;&nbsp;</td>
				<td nowrap align="left"><input type="text" id="adminname" name="adminname" size="25" maxlength="25"> </td>
			</tr>
			<tr>
				<td nowrap align="right">' . $locate->Translate("Password") . '&nbsp;&nbsp;</td>
				<td nowrap align="left"><input type="password" id="Workoffpwd" name="Workoffpwd" size="25" maxlength="25"> </td>
			</tr>			
			<tr><td colspan="2" align="center"><input type="button" id="btnAddDiallist" name="btnAddDiallist" value="' . $locate->Translate("continue") . '" onclick="xajax_workoffcheck(xajax.getFormValues(\'workoff\'));return false;"></td></tr>
			</table></form>';
    $html .= Table::Footer();
    $objResponse = new xajaxResponse();
    $objResponse->addAssign("formWorkoff", "style.visibility", "visible");
    $objResponse->addAssign("formWorkoff", "innerHTML", $html);
    return $objResponse->getXML();
}
示例#10
0
/**
*  show account edit form
*  @param	id			int			account id
*  @return	objResponse	object		xajax response object
*/
function edit($id)
{
    global $locate;
    $html = Table::Top($locate->Translate("edit_user_type"), "formDiv");
    $html .= Customer::formEdit($id);
    $html .= Table::Footer();
    // End edit zone
    $objResponse = new xajaxResponse();
    $objResponse->addAssign("formDiv", "style.visibility", "visible");
    $objResponse->addAssign("formDiv", "innerHTML", $html);
    $result = Customer::getCurUserTypePrivileges($id);
    foreach ($result as $tmp) {
        $objResponse->addAssign($tmp['page'] . '_' . $tmp['action'], "checked", true);
    }
    $objResponse->addScript("editPageCheckbox()");
    return $objResponse->getXML();
}
示例#11
0
function resellerPaymentInfoEdit()
{
    global $db, $config, $locate;
    $objResponse = new xajaxResponse();
    if ($_SESSION['curuser']['usertype'] == 'reseller') {
        $reseller_row = astercrm::getRecordByID($_SESSION['curuser']['resellerid'], 'resellergroup');
        $html = Table::Top($locate->Translate("Edit Payment Receiving Infomation"), "formDiv");
        if ($reseller_row['epayment_status'] == 'enable') {
            $enable = 'checked';
        } else {
            $diable = 'checked';
        }
        if ($reseller_row['callshop_pay_fee'] == 'yes') {
            $yesVal = 'checked';
        } else {
            $noVal = 'checked';
        }
        $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("Paypal payment url") . '</td>
						<td align="left">' . $config['epayment']['paypal_payment_url'] . '</td>
					</tr>
					<tr>
						<td nowrap align="left">' . $locate->Translate("Paypal verify url") . '</td>
						<td align="left">' . $config['epayment']['paypal_verify_url'] . '</td>
					</tr>
					<tr>
						<td nowrap align="left">' . $locate->Translate("Online payment") . '</td>
						<td align="left"><input type="radio" id="epayment_status" name="epayment_status" value="enable" ' . $enable . '>' . $locate->Translate("Enable") . '<input type="radio" id="epayment_status" name="epayment_status"  value="disable" ' . $diable . '>' . $locate->Translate("Disable") . '</td>
					</tr>
					<tr>
						<td nowrap align="left">' . $locate->Translate("Paypal account") . '</td>
						<td align="left"><input type="text" id="epayment_account" name="epayment_account" size="35"  value="' . $reseller_row['epayment_account'] . '"></td>
					</tr>					
					<tr>
						<td nowrap align="left">' . $locate->Translate("Paypal identity token") . '</td>
						<td align="left"><input type="text" id="epayment_identity_token" name="epayment_identity_token" size="35" value="' . $reseller_row['epayment_identity_token'] . '"></td>
					</tr>
					<tr>
						<td nowrap align="left">' . $locate->Translate("Item name") . '</td>
						<td align="left"><input type="text" id="epayment_item_name" name="epayment_item_name" size="35" value="' . $reseller_row['epayment_item_name'] . '"></td>
					</tr>
					<tr>
						<td nowrap align="left">' . $locate->Translate("Available amount") . '</td>
						<td align="left"><input type="text" id="epayment_amount_package" name="epayment_amount_package" size="35"  maxlength="30" value="' . $reseller_row['epayment_amount_package'] . '"></td>
					</tr>
					<tr>
						<td nowrap align="left">' . $locate->Translate("Notify email") . '</td>
						<td align="left"><input type="text" id="epayment_notify_mail" name="epayment_notify_mail" size="35" value="' . $reseller_row['epayment_notify_mail'] . '"></td>
					</tr>
					<tr>
						<td nowrap align="left">' . $locate->Translate("Callshop pay fee") . '</td>
						<td align="left"><input type="radio" id="callshop_pay_fee" name="callshop_pay_fee" value="yes" ' . $yesVal . '>' . $locate->Translate("Yes") . '<input type="radio" id="callshop_pay_fee" name="callshop_pay_fee"  value="no" ' . $noVal . '>' . $locate->Translate("No") . '</td>
					</tr>
					<tr>
						<td colspan="2" align="center"><button id="submitButton" onClick=\'xajax_resellerPaymentInfoUpdate(xajax.getFormValues("f"));return false;\'>' . $locate->Translate("Continue") . '</button></td>
					</tr>
				 </table></form>';
        $html .= Table::Footer();
        $objResponse->addAssign("formDiv", "style.visibility", "visible");
        $objResponse->addAssign("formDiv", "innerHTML", $html);
    }
    return $objResponse->getXML();
}
示例#12
0
function AllTicketOfMy($cid = '', $Ctype, $start = 0, $limit = 5, $filter = null, $content = null, $order = null, $divName = "formMyTickets", $ordering = "", $stype = null)
{
    global $locate;
    $objResponse = new xajaxResponse();
    $ticketHtml = Table::Top($locate->Translate("Customer Tickets"), "formMyTickets");
    $ticketHtml .= astercrm::createTikcetGrid($cid, $Ctype, $start, $limit, $filter, $content, $order, $divName, $ordering, $stype);
    $ticketHtml .= Table::Footer();
    $objResponse->addAssign("formMyTickets", "style.visibility", "visible");
    $objResponse->addAssign("formMyTickets", "innerHTML", $ticketHtml);
    return $objResponse->getXML();
}
示例#13
0
    function formDiallist($dialedlistid)
    {
        global $locate, $db;
        $sql = "SELECT dialednumber, customername,memo,campaignid FROM dialedlist WHERE id = {$dialedlistid}";
        Customer::events($sql);
        $row =& $db->getRow($sql);
        $html = '';
        if ($row) {
            $html = Table::Top($locate->Translate("Customer from Diallist"), "formDiallistPopup");
            // <-- Set the title for your form.
            $html .= '<table border="1" width="100%" class="adminlist" id="d" name="d">
						<tr><td width="45%">&nbsp;' . $locate->Translate("Customer Name") . ':&nbsp;</td><td>' . $row['customername'] . '</td></tr>
						<tr><td>&nbsp;' . $locate->Translate("Pone Number") . ':&nbsp;</td><td>' . $row['dialednumber'] . '</td></tr>
						<tr><td>&nbsp;' . $locate->Translate("Memo") . ':&nbsp;</td><td>' . $row['memo'] . '</td></tr>';
            if ($row['campaignid'] != 0 && $row['campaignid'] != '') {
                //获取拨号计划的备注
                $CampaignNote = Customer::getCampaignNote($row['campaignid']);
                $html .= '<tr><td>&nbsp;' . $locate->Translate("Campaign Memo") . ':&nbsp;</td><td>' . $CampaignNote . '</td></tr>';
            }
            $html .= '
					</table>';
            // <-- Change by your method
            $html .= Table::Footer();
        }
        return $html;
    }
示例#14
0
/**
*  show group edit form
*  @param	id			int			group id
*  @return	objResponse	object		xajax response object
*/
function edit($id)
{
    global $locate;
    $html = Table::Top($locate->Translate("Edit Worktime"), "formDiv");
    $html .= Customer::formEdit($id);
    $html .= Table::Footer();
    // End edit zone
    $objResponse = new xajaxResponse();
    $objResponse->addAssign("formDiv", "style.visibility", "visible");
    $objResponse->addAssign("formDiv", "innerHTML", $html);
    return $objResponse->getXML();
}
示例#15
0
function setFreeCallPage($id)
{
    global $locate;
    $objResponse = new xajaxResponse();
    $html = Table::Top($locate->Translate("Set Free Call"), "formDiv");
    // <-- Set the title for your form.
    $html .= '<table border="1" width="100%" class="adminlist">
				<tr><td ><b>' . $locate->Translate("Are you sure to set this call free") . '?</b></td><tr>
				<tr><td >' . $locate->Translate("note") . ':&nbsp;&nbsp;<textarea id="note"></textarea></td><tr>
				<tr><td >' . $locate->Translate("hidden record") . ':&nbsp;<input type="checkbox" id="hiddenrecord" value="1"></td><tr>
				<tr><td align="center"><input type="button" value="' . $locate->Translate("confirm") . '" onclick="xajax_setFreeCall(\'' . $id . '\',document.getElementById(\'hiddenrecord\').checked,document.getElementById(\'note\').value,document.getElementById(\'total_price_ori\').value,document.getElementById(\'discount\').value);">&nbsp;&nbsp;<input type="button" value="' . $locate->Translate("cancel") . '"  onclick="document.getElementById(\'formDiv\').style.visibility=\'hidden\';document.getElementById(\'formDiv\').innerHTML = \'\';return false;"></td><tr>
			 </table>';
    // End edit zone
    $html .= Table::Footer();
    $objResponse->addAssign("formDiv", "style.visibility", "visible");
    $objResponse->addAssign("formDiv", "innerHTML", $html);
    return $objResponse;
}
示例#16
0
/**
*  show account record detail
*  @param	accountid	int			account id
*  @return	objResponse	object		xajax response object
*/
function showDetail($accountid)
{
    $objResponse = new xajaxResponse();
    global $locate;
    $html = Table::Top($locate->Translate("account_detail"), "formDiv");
    $html .= Customer::showAccountDetail($accountid);
    $html .= Table::Footer();
    $objResponse->addAssign("formDiv", "style.visibility", "visible");
    $objResponse->addAssign("formDiv", "innerHTML", $html);
    return $objResponse;
}
示例#17
0
function playmonitor($id)
{
    global $config, $locate;
    $objResponse = new xajaxResponse();
    $res = Customer::getRecordByID($id, 'monitorrecord');
    $path = $res['filename'] . "." . $res['fileformat'];
    $html = Table::Top($locate->Translate("playmonitor"), "formplaymonitor");
    if (is_file($path)) {
        if ($res['fileformat'] == 'mp3') {
            $html .= '<object type="application/x-shockwave-flash" data="skin/default/player_mp3_maxi.swf" width="200" height="20"><param name="movie" value="skin/default/player_mp3_maxi.swf" /><param name="bgcolor" value="#ffffff" /><param name="FlashVars" value="mp3=records.php?file=' . $id . '&amp;loop=0&amp;autoplay=1&amp;autoload=1&amp;volume=75&amp;showstop=1&amp;showinfo=1&amp;showvolume=1&amp;showloading=always" /></object><br><a href="###" onclick="window.location.href=\'records.php?file=' . $id . '\'">' . $locate->Translate("download") . '</a>';
        } else {
            $html .= '<embed src="records.php?file=' . $id . '" autostart="true" width="300" height="40" name="sound" id="sound" enablejavascript="true"><br><a href="###" onclick="window.location.href=\'records.php?file=' . $id . '\'">' . $locate->Translate("download") . '</a>';
        }
    } else {
        $html .= '<b>404 File not found!</b>';
    }
    $html .= Table::Footer();
    $objResponse->addAssign("formplaymonitor", "style.visibility", "visible");
    $objResponse->addAssign("formplaymonitor", "innerHTML", $html);
    return $objResponse->getXML();
}