예제 #1
0
function update_gateway_fee2($vars)
{
    $paymentmethod = $vars['paymentmethod'];
    delete_query("tblinvoiceitems", "invoiceid='" . $vars[invoiceid] . "' and notes='gateway_fees'");
    $result = select_query("tbladdonmodules", "setting,value", "setting='fee_2_" . $vars['paymentmethod'] . "' or setting='fee_1_" . $vars[paymentmethod] . "'");
    while ($data = mysql_fetch_array($result)) {
        $params[$data[0]] = $data[1];
    }
    $fee1 = $params['fee_1_' . $paymentmethod];
    $fee2 = $params['fee_2_' . $paymentmethod];
    $total = InvoiceTotal($vars['invoiceid']);
    if ($total > 0) {
        $amountdue = $fee1 + $total * $fee2 / 100;
        if ($fee1 > 0 & $fee2 > 0) {
            $d = $fee1 . '+' . $fee2 . "%";
        } elseif ($fee2 > 0) {
            $d = $fee2 . "%";
        } elseif ($fee1 > 0) {
            $d = $fee1;
        }
    }
    if ($d) {
        insert_query("tblinvoiceitems", array("userid" => $_SESSION['uid'], "invoiceid" => $vars[invoiceid], "type" => "Fee", "notes" => "gateway_fees", "description" => getGatewayName2($vars['paymentmethod']) . " Fees ({$d})", "amount" => $amountdue, "taxed" => "0", "duedate" => "now()", "paymentmethod" => $vars[paymentmethod]));
    }
    updateInvoiceTotal($vars[invoiceid]);
}
예제 #2
0
function update_gateway_fee2($vars)
{
    $invoice = mysql_fetch_row(mysql_query("SELECT `userid` FROM `tblinvoices` WHERE `id`='" . $vars[invoiceid] . "'"));
    $user = mysql_fetch_row(mysql_query("SELECT `currency` FROM `tblclients` WHERE `id`='" . $invoice[0] . "'"));
    $currency = mysql_fetch_row(mysql_query("SELECT `code` FROM `tblcurrencies` WHERE `id`='" . $user[0] . "'"));
    $paymentmethod = $vars['paymentmethod'];
    delete_query("tblinvoiceitems", "invoiceid='" . $vars[invoiceid] . "' and notes='gateway_fees'");
    $result = select_query("tbladdonmodules", "setting,value", "setting='fee_2_" . $vars['paymentmethod'] . '_' . $currency[0] . "' or setting='fee_1_" . $vars[paymentmethod] . '_' . $currency[0] . "'");
    while ($data = mysql_fetch_array($result)) {
        $params[$data['setting']] = $data['value'];
    }
    $fee1 = $params['fee_1_' . $paymentmethod . '_' . $currency[0]];
    $fee2 = $params['fee_2_' . $paymentmethod . '_' . $currency[0]];
    $total = InvoiceTotal($vars['invoiceid']);
    if ($total > 0) {
        $amountdue = $fee1 + $total * $fee2 / 100;
        if ($fee1 > 0 & $fee2 > 0) {
            $d = $fee1 . '+' . $fee2 . "%";
        } elseif ($fee2 > 0) {
            $d = $fee2 . "%";
        } elseif ($fee1 > 0) {
            $d = $fee1;
        }
    }
    if ($d) {
        insert_query("tblinvoiceitems", array("userid" => $_SESSION['uid'], "invoiceid" => $vars[invoiceid], "type" => "Fee", "notes" => "gateway_fees", "description" => getGatewayName2($vars['paymentmethod']) . " комиссия ({$d}) в " . $currency[0], "amount" => $amountdue, "taxed" => "0", "duedate" => "now()", "paymentmethod" => $vars[paymentmethod]));
    }
    updateInvoiceTotal($vars[invoiceid]);
}
function deletePreDefCat($catid)
{
    $result = select_query("tblticketpredefinedcats", "", array("parentid" => $catid));
    while ($data = mysql_fetch_array($result)) {
        $id = $data['id'];
        delete_query("tblticketpredefinedreplies", array("catid" => $id));
        delete_query("tblticketpredefinedcats", array("id" => $id));
        deletePreDefCat($id);
    }
}
예제 #4
0
function request_delete($index, $id)
{
    $sql = delete_query($index, $id);
    $conn = connect_db();
    try {
        $stmt = $conn->prepare($sql);
        $stmt->execute();
        return $stmt;
    } catch (PDOException $e) {
        echo $sql . "<br>" . $e->getMessage();
    }
    // end catch
}
예제 #5
0
파일: payza.php 프로젝트: billyprice1/whmcs
/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 * */
function payza_config()
{
    $configarray = array("FriendlyName" => array("Type" => "System", "Value" => "Payza (Formerly Alertpay)"), "email" => array("FriendlyName" => "Login ID", "Type" => "text", "Size" => "20"), "securitycode" => array("FriendlyName" => "Security Code", "Type" => "text", "Size" => "40"), "apipassword" => array("FriendlyName" => "API Password", "Type" => "text", "Size" => "20", "Description" => "Only required for automated refunds"), "testmode" => array("FriendlyName" => "Test Mode", "Type" => "yesno", "Description" => "Tick this to test"));
    update_query("tblaccounts", array("gateway" => "payza"), array("gateway" => "alertpay"));
    update_query("tblclients", array("defaultgateway" => "payza"), array("defaultgateway" => "alertpay"));
    update_query("tbldomains", array("paymentmethod" => "payza"), array("paymentmethod" => "alertpay"));
    update_query("tblhosting", array("paymentmethod" => "payza"), array("paymentmethod" => "alertpay"));
    update_query("tblhostingaddons", array("paymentmethod" => "payza"), array("paymentmethod" => "alertpay"));
    update_query("tblinvoiceitems", array("paymentmethod" => "payza"), array("paymentmethod" => "alertpay"));
    update_query("tblinvoices", array("paymentmethod" => "payza"), array("paymentmethod" => "alertpay"));
    update_query("tblorders", array("paymentmethod" => "payza"), array("paymentmethod" => "alertpay"));
    full_query("UPDATE tblproductgroups SET disabledgateways = REPLACE(disabledgateways, 'alertpay', 'payza')");
    update_query("tblpaymentgateways", array("gateway" => "payza"), array("gateway" => "alertpay", "setting" => "email"));
    update_query("tblpaymentgateways", array("gateway" => "payza"), array("gateway" => "alertpay", "setting" => "securitycode"));
    update_query("tblpaymentgateways", array("gateway" => "payza"), array("gateway" => "alertpay", "setting" => "apipassword"));
    update_query("tblpaymentgateways", array("gateway" => "payza"), array("gateway" => "alertpay", "setting" => "testmode"));
    delete_query("tblpaymentgateways", array("gateway" => "alertpay"));
    return $configarray;
}
예제 #6
0
function twilio_output($vars)
{
    $modulelink = $vars['modulelink'];
    global $attachments_dir;
    if (isset($_POST)) {
        switch ($_POST['_a']) {
            case "modconfig":
                $POST = $_POST;
                unset($POST['token']);
                unset($POST['_a']);
                foreach ($POST as $keyname => $value) {
                    $currentval = get_query_val('mod_twilio_config', 'val', 'setting="' . $keyname . '"');
                    if ($currentval != $value) {
                        update_query('mod_twilio_config', array('val' => $value), array('setting' => $keyname));
                    }
                }
                $msg = 'The configuration settings have been successfully saved.';
                break;
            case "modnumbers":
                foreach ($_POST['numberid'] as $nid) {
                    $number = $_POST['number'][$nid];
                    $order = $_POST['order'][$nid];
                    $timeout = $_POST['timeout'][$nid];
                    $delete = $_POST['delete'][$nid];
                    if ($nid != 'NEW') {
                        if ($delete == '1') {
                            delete_query('mod_twilio_numbers', array('id' => $nid));
                        } else {
                            update_query('mod_twilio_numbers', array('number' => $number, 'timeout' => $timeout, 'order' => $order), array('id' => $nid));
                        }
                    } else {
                        if ($number != '') {
                            insert_query('mod_twilio_numbers', array('number' => $number, 'timeout' => $timeout, 'order' => $order));
                        }
                    }
                }
                $msg = 'Your numbers have been successfully modified.';
                break;
            case "uploadaudio":
                if (isset($_FILES)) {
                    $destdir = $attachments_dir . '/twilio';
                    if (!file_exists($destdir)) {
                        mkdir($destdir);
                    }
                    foreach ($_FILES as $keyname => $val) {
                        if ($val['name'] != '') {
                            $curerr = 0;
                            // Check file size
                            if ((int) $val['size'] > 2048000) {
                                $error .= '<br />' . $val['name'] . ' is too large.';
                                $curerr = 1;
                                // Check file type
                            } elseif ($val['type'] != 'audio/mp3' && $val['type'] != 'audio/mpeg') {
                                $error .= '<br />' . $val['name'] . ' is not a valid MP3 file.';
                                $curerr = 1;
                            } else {
                                // File is good
                                $file = $destdir . '/' . $keyname . '.mp3';
                                if (file_exists($file)) {
                                    unlink($file);
                                }
                                if (move_uploaded_file($val['tmp_name'], $file)) {
                                    update_query('mod_twilio_config', array('val' => $file), array('setting' => $keyname));
                                } else {
                                    $error .= '<br />There was an error uploading ' . $val['name'] . '. Please check your error logs.';
                                    $curerr = 1;
                                }
                            }
                            if (!$curerr) {
                                $msg .= '<br />' . $val['name'] . ' has been successfully uploaded.';
                            }
                        }
                    }
                }
                break;
        }
    }
    // Get configured numbers
    $numbers = array();
    $d = select_query('mod_twilio_numbers', '*', array(), 'order', 'ASC');
    while ($res = mysql_fetch_assoc($d)) {
        $numbers[] = array('id' => $res['id'], 'number' => $res['number'], 'timeout' => $res['timeout'], 'order' => $res['order']);
    }
    // Get config values
    $config = array();
    $d = select_query('mod_twilio_config', '*', array());
    while ($res = mysql_fetch_assoc($d)) {
        $setting = $res['setting'];
        $value = $res['val'];
        $config[$setting] = $value;
    }
    // Return to last page
    if (isset($_REQUEST['last'])) {
        $last = $_REQUEST['last'];
    } else {
        $last = '0';
    }
    // Get server.js daemon status
    $timeout = '5.00';
    if ($fp = fsockopen($_SERVER['HTTP_HOST'], $config['client_port'], $errno, $errstr, (double) $timeout)) {
        $client_status = '<em>Current Status:</em> <span style="color: green; font-weight: bold;">Online</span>';
    } else {
        $client_status = '<em>Current Status:</em> <span style="color: red; font-weight: bold;">Unreachable</span>';
    }
    if ($fp = fsockopen('localhost', $config['server_port'], $errno, $errstr, (double) $timeout)) {
        $server_status = '<em>Current Status:</em> <span style="color: green; font-weight: bold;">Online</span>';
    } else {
        $server_status = '<em>Current Status:</em> <span style="color: red; font-weight: bold;">Online</span>';
    }
    print '<script>
			$(document).ready(function(){
				$(".tabbox").css("display","none");
				var selectedTab;
				$(".tab").click(function(){
					var elid = $(this).attr("id");
					$(".tab").removeClass("tabselected");
					$("#"+elid).addClass("tabselected");
					if (elid != selectedTab) {
						$(".tabbox").slideUp();
						$("#"+elid+"box").slideDown();
						selectedTab = elid;
					}
					$("#tab").val(elid.substr(3));
				});

				selectedTab = "tab' . $last . '";
				$("#tab' . $last . '").addClass("tabselected");
				$("#tab' . $last . 'box").css("display", "");
			});
			</script>
			<div id="content_padded">';
    if ($msg) {
        print '<div class="infobox">' . $msg . '</div>';
    }
    if ($error) {
        print '<div class="errorbox">' . $error . '</div>';
    }
    print '<div id="tabs">
				<ul>
					<li id="tab0" class="tab"><a href="javascript:;">Configurations</a></li>
					<li id="tab1" class="tab"><a href="javascript:;">Phone Numbers</a></li>
					<li id="tab2" class="tab"><a href="javascript:;">Upload Audio Files</a></li>
				</ul>
			</div>
			
			<div id="tab0box" class="tabbox">
				<div id="tab_content">
					<h3>Module Configurations</h3>
					<p align="left">
						<strong>Instructions:</strong> Please configure ALL of the options below. Leaving options unset will likely cause unexpected errors to occur.<br /><br />
						<strong>Audio Mode:</strong> This option chooses whether or not you\'d like to use the built in text to speech engine, or record your own message. If you select Audio File, please ensure you have uploaded the coresponding audio file in the "Upload Audio Files" tab.<br />
						<strong>Text:</strong> If you selected Text to Speech in the previous option, this will be what is read to your callers.<br />
						<strong>Invalid Input Audio Mode:</strong> Much like the Audio Mode above, this option lets you select how you wish to let the caller know their input was not recognized.<br />
						<strong>Invalid Input Text:</strong> This will be what is read to the caller if you selected the Text to Speech option above.
					</p>
					<br />
					<br />
					<form method="POST" action="' . $modulelink . '&last=0">
						<input type="hidden" name="_a" value="modconfig" />
						<table class="form" border="0" cellpadding="3" cellspacing="1" width="75%" align="center">
						<!-- " -->
							<tr>
								<td colspan="2" align="center">
									<h4>Global Configurations</h4>
									These are the global configurations for the module.
								</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Client Port</strong></td>
								<td class="fieldarea">
									<input type="text" size="10" name="client_port" value="' . $config['client_port'] . '" /> Client Port configured in server.js
									<div style="float: right; padding-right: 10px;">' . $client_status . '</div>
								</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Server Port</strong></td>
								<td class="fieldarea">
									<input type="text" size="10" name="server_port" value="' . $config['server_port'] . '" /> Server Port configured in server.js
									<div style="float: right; padding-right: 10px;">' . $server_status . '</div>
								</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Gather Timeout</strong></td>
								<td class="fieldarea"><input type="text" size="10" name="gather_timeout" value="' . $config['gather_timeout'] . '" /> Amount of time to wait for caller input</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Voicemail Email Address</strong></td>
								<td class="fieldarea"><input type="text" size="30" name="voicemail_email" value="' . $config['voicemail_email'] . '" /> Email Address to send voicemails to</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Voicemail Audio Mode</strong></td>
								<td class="fieldarea">';
    echo twilio_modeselect('voicemail_mode', $config);
    print '						</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Voicemail Text</strong></td>
								<td class="fieldarea"><textarea name="voicemail_text" rows="10" cols="80">' . $config['voicemail_text'] . '</textarea></td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Invalid Input Audio Mode</strong></td>
								<td class="fieldarea">';
    echo twilio_modeselect('invalid_request_mode', $config);
    print '						</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Invalid Input Text</strong></td>
								<td class="fieldarea"><textarea name="invalid_request_text" rows="10" cols="80">' . $config['invalid_request_text'] . '</textarea></td>
							</tr>
						</table>
						<table class="form" border="0" cellpadding="3" cellspacing="1" width="75%" align="center">
						<!-- " -->
							<tr>
								<td colspan="2" align="center">
									<h4>Introduction</h4>
									These settings are relevent to when the caller first calls into the phone system. It should say something along the lines of: <br /><em>"Thank you for calling Widgets Incorporated. Please press 1 if this call is regarding an existing support ticket, please press 2 for all other inqueries."</em>
								</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Audio Mode</strong></td>
								<td class="fieldarea">';
    echo twilio_modeselect('intro_mode', $config);
    print '						</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Text</strong></td>
								<td class="fieldarea"><textarea name="intro_text" rows="10" cols="80">' . $config['intro_text'] . '</textarea></td>
							</tr>
						</table>
						<table class="form" border="0" cellpadding="3" cellspacing="1" width="75%" align="center">
						<!-- " -->
							<tr>
								<td colspan="2" align="center">
									<h4>Step 1 (Ticket)</h4>
									These settings are relevent to when the caller selects option 1 from the introduction. It should say something along the lines of: <br /><em>"Please enter your ticket ID number, followed by the pound sign."</em>
								</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Audio Mode</strong></td>
								<td class="fieldarea">';
    echo twilio_modeselect('step1_ticket_mode', $config);
    print '						</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Text</strong></td>
								<td class="fieldarea"><textarea name="step1_ticket_text" rows="10" cols="80">' . $config['step1_ticket_text'] . '</textarea></td>
							</tr>
						</table>
						<table class="form" border="0" cellpadding="3" cellspacing="1" width="75%" align="center">
						<!-- " -->
							<tr>
								<td colspan="2" align="center">
									<h4>Step 1 (Client)</h4>
									These settings are relevent to when the caller selects option 2 from the introduction. It should say something along the lines of: <br /><em>"Please enter your client ID number, followed by the pound sign."</em>
								</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Audio Mode</strong></td>
								<td class="fieldarea">';
    echo twilio_modeselect('step1_client_mode', $config);
    print '						</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Text</strong></td>
								<td class="fieldarea"><textarea name="step1_client_text" rows="10" cols="80">' . $config['step1_client_text'] . '</textarea></td>
							</tr>
						</table>
						<table class="form" border="0" cellpadding="3" cellspacing="1" width="75%" align="center">
						<!-- " -->
							<tr>
								<td colspan="2" align="center">
									<h4>Step 2 (Ticket)</h4>
									These settings are relevent to when the caller enters his or her ticket ID number.<br />You can use custom variables here to insert client details into your message. Please see the <a href="#variables">table</a> at the bottom of this page.
								</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Audio Mode</strong></td>
								<td class="fieldarea">';
    echo twilio_modeselect('step2_ticket_mode', $config);
    print '						</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Text</strong></td>
								<td class="fieldarea"><textarea name="step2_ticket_text" rows="10" cols="80">' . $config['step2_ticket_text'] . '</textarea></td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Invalid Input Audio Mode</strong></td>
								<td class="fieldarea">';
    echo twilio_modeselect('step2_ticket_sorry_mode', $config);
    print '					</tr>
							<tr>
								<td class="fieldlabel"><strong>Invalid Input Text</strong></td>
								<td class="fieldarea"><textarea name="step2_ticket_sorry_text" rows="10" cols="80">' . $config['step2_ticket_sorry_text'] . '</textarea></td>
							</tr>
						</table>
						<table class="form" border="0" cellpadding="3" cellspacing="1" width="75%" align="center">
						<!-- " -->
							<tr>
								<td colspan="2" align="center">
									<h4>Step 2 (Client)</h4>
									These settings are relevent to when the caller enters his or her client ID number.<br />You can use custom variables here to insert client details into your message. Please see the <a href="#variables">table</a> at the bottom of this page.
								</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Audio Mode</strong></td>
								<td class="fieldarea">';
    echo twilio_modeselect('step2_client_mode', $config);
    print '						</td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Text</strong></td>
								<td class="fieldarea"><textarea name="step2_client_text" rows="10" cols="80">' . $config['step2_client_text'] . '</textarea></td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Invalid Input Audio Mode</strong></td>
								<td class="fieldarea">';
    echo twilio_modeselect('step2_client_sorry_mode', $config);
    print '					</tr>
							<tr>
								<td class="fieldlabel"><strong>Invalid Input Text</strong></td>
								<td class="fieldarea"><textarea name="step2_client_sorry_text" rows="10" cols="80">' . $config['step2_client_sorry_text'] . '</textarea></td>
							</tr>
						</table>
						<p align="center"><input type="submit" value="Save Changes" /></p>
					</form>
					<br />
					<a name="variables"></a><h3>Step 2 Variables</h3>
					<div class="tablebg" align="center">
						<table class="datatable" cellspacing="1" cellpadding="1" width="50%">
							<tr><th>Variable</th><th>Provides</th></tr>
							
							<tr><td align="center">%FIRSTNAME%</td><td align="center">Clients Firstname</td></tr>
							<tr><td align="center">%LASTNAME%</td><td align="center">Clients Lastname</td></tr>
							<tr><td align="center">%COMPANY%</td><td align="center">Clients Company Name</td></tr>
							<tr><td align="center">%EMAIL%</td><td align="center">Clients Email</td></tr>
							<tr><td align="center">%ADDRESS1%</td><td align="center">Clients Address Line 1</td></tr>
							<tr><td align="center">%ADDRESS2%</td><td align="center">Clients Address Line 2</td></tr>
							<tr><td align="center">%CITY%</td><td align="center">Clients City</td></tr>
							<tr><td align="center">%STATE%</td><td align="center">Clients State</td></tr>
							<tr><td align="center">%POSTCODE%</td><td align="center">Clients Postcode</td></tr>
							<tr><td align="center">%PHONE%</td><td align="center">Clients Phone Number</td></tr>
							<tr><td align="center">%STATUS%</td><td align="center">Clients Account Status</td></tr>
							<tr><td align="center">%TICKET_TITLE%</td><td align="center">Tickets Title Text (only applicable for ticket mode)</td></tr>
							<tr><td align="center">%TICKET_URGENCY%</td><td align="center">Tickets Urgency (only applicable for ticket mode)</td></tr>
							<tr><td align="center">%TICKET_STATUS%</td><td align="center">Tickets Status (only applicable for ticket mode)</td></tr>
						</table>
					</div>
				</div>
			</div>
			<div id="tab1box" class="tabbox">
				<div id="tab_content">
					<h3>Phone Numbers</h3>
					<p align="left">
						<strong>Instructions:</strong> Enter the phone numbers below you wish to dial after the user has called the Twilio number. These will typically be support operators phone numbers.<br /><br />
					</p>
					<p align="left">
						<strong>Phone Number:</strong> Format: +12223334444. This is the number the user will be redirected to after following the phone prompts.<br />
						<strong>Timeout:</strong> This is the amount of time (in seconds) to wait before moving on to the next number. If the number has voicemail, its important that this number is lower than the amount of time before the user is redirected to VM.<br />
						<strong>Order:</strong> This is the order in which the numbers are dialed. Lower numbers are dialed first. Leaving this blank will default to "0" and therefore be called first.<br />
						<strong>Delete:</strong> Check this box to delete an existing number.<br />
					</p>
					<br />
					<form method="POST" action="' . $modulelink . '&last=1">
						<input type="hidden" name="_a" value="modnumbers" />
						<div class="tablebg" align="center">
							<table class="datatable" cellspacing="1" cellpadding="1" width="400">
								<tr>
									<th>Phone Number</th>
									<th>Timeout</th>
									<th>Order</th>
									<th>Delete</th>
								</tr>';
    foreach ($numbers as $key => $val) {
        $nid = $val['id'];
        print '					<tr>
									<td align="center"><input type="text" size="40" name="number[' . $nid . ']" value="' . $val['number'] . '" /></td>
									<td align="center"><input type="text" size="10" name="timeout[' . $nid . ']" value="' . $val['timeout'] . '" /></td>
									<td align="center"><input type="text" size="10" name="order[' . $nid . ']" value="' . $val['order'] . '" /></td>
									<td align="center">
										<input type="checkbox" name="delete[' . $nid . ']" value="1" />
										<input type="hidden" name="numberid[' . $nid . ']" value="' . $nid . '" />
									</td>
								</tr>';
    }
    print '						<tr>
									<td align="center"><input type="text" size="40" name="number[\'NEW\']" value="" /></td>
									<td align="center"><input type="text" size="10" name="timeout[\'NEW\']" value="" /></td>
									<td align="center"><input type="text" size="10" name="order[\'NEW\']" value="" /></td>
									<td><input type="hidden" name="numberid[\'NEW\']" value="NEW" /></td>
								</tr>
							</table>
						</div>
						<input type="submit" value="Save Changes" name="save" />
					</form>
				</div>
			</div>
			<div id="tab2box" class="tabbox">
				<div id="tab_content">
					<h3>Upload Audio Files</h3>
					<p align="left">
						<strong>Instructions:</strong> These files are used in place of the default Twilio text-to-speech engine. You can record your own voice, or hire a professional to record them for you.
					</p>
					<p align="left">
						<strong>Notes:</strong>
						<ul align="left">
							<li>- These files will ONLY be used if you have selected "Audio File" from the selection on the Configuration page.</li>
							<li>- Keep in mind that these files will have to be downloaded from your server, to Twilio, then streamed to the caller. Large files will likely cause delay in the system.</li>
							<li>- The max file size is set to 2MB, however, it is recommended that you keep the file sizes as small as possible. 72Kbps mono recordings will likely yield the best results.</li>
							<li>- ONLY MP3 files are supported. If you have your audio in another format, you\'ll need to convert it to MP3 before uploading.</li>
						</ul>
					</p>
					<br />
					<form method="POST" action="' . $modulelink . '&last=2" enctype="multipart/form-data">
						<input type="hidden" name="_a" value="uploadaudio" />
						<table class="form" width="50%" border="0" cellspacing="2" cellpadding="3" align="center">
							<tr>
								<td class="fieldlabel"><strong>Introduction</strong></td>
								<td class="fieldarea"><input type="file" name="intro_file" /></td>
								<td class="fieldarea" align="center"><a href="../modules/addons/twilio/calls/get_audio.php?f=intro_file" target="_blank"><img src="../modules/addons/twilio/images/play.png" /></a></td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Step 1 (Client)</strong></td>
								<td class="fieldarea"><input type="file" name="step1_client_file" /></td>
								<td class="fieldarea" align="center"><a href="../modules/addons/twilio/calls/get_audio.php?f=step1_client_file" target="_blank"><img src="../modules/addons/twilio/images/play.png" /></a></td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Step 1 (Ticket)</strong></td>
								<td class="fieldarea"><input type="file" name="step1_ticket_file" /></td>
								<td class="fieldarea" align="center"><a href="../modules/addons/twilio/calls/get_audio.php?f=step1_ticket_file" target="_blank"><img src="../modules/addons/twilio/images/play.png" /></a></td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Step 2 (Client)</strong></td>
								<td class="fieldarea"><input type="file" name="step2_client_file" /></td>
								<td class="fieldarea" align="center"><a href="../modules/addons/twilio/calls/get_audio.php?f=step2_client_file" target="_blank"><img src="../modules/addons/twilio/images/play.png" /></a></td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Step 2 (Client) - Invalid Input</strong></td>
								<td class="fieldarea"><input type="file" name="step2_client_sorry_file" /></td>
								<td class="fieldarea" align="center"><a href="../modules/addons/twilio/calls/get_audio.php?f=step2_client_sorry_file" target="_blank"><img src="../modules/addons/twilio/images/play.png" /></a></td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Step 2 (Ticket)</strong></td>
								<td class="fieldarea"><input type="file" name="step2_ticket_file" /></td>
								<td class="fieldarea" align="center"><a href="../modules/addons/twilio/calls/get_audio.php?f=step2_ticket_file" target="_blank"><img src="../modules/addons/twilio/images/play.png" /></a></td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Step 2 (Ticket) - Invalid Input</strong></td>
								<td class="fieldarea"><input type="file" name="step2_ticket_sorry_file" /></td>
								<td class="fieldarea" align="center"><a href="../modules/addons/twilio/calls/get_audio.php?f=step2_ticket_sorry_file" target="_blank"><img src="../modules/addons/twilio/images/play.png" /></a></td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>General Invalid Input</strong></td>
								<td class="fieldarea"><input type="file" name="invalid_request_file" /></td>
								<td class="fieldarea" align="center"><a href="../modules/addons/twilio/calls/get_audio.php?f=invalid_request_file" target="_blank"><img src="../modules/addons/twilio/images/play.png" /></a></td>
							</tr>
							<tr>
								<td class="fieldlabel"><strong>Voicemail</strong></td>
								<td class="fieldarea"><input type="file" name="voicemail_file" /></td>
								<td class="fieldarea" align="center"><a href="../modules/addons/twilio/calls/get_audio.php?f=voicemail_file" target="_blank"><img src="../modules/addons/twilio/images/play.png" /></a></td>
							</tr>
						</table>
						<p align="center">
							<input type="submit" value="Upload Files" />
						</p>
					</form>
					
				</div>
			</div>
		</div>';
}
예제 #7
0
function mediacp_TerminateAccount($params)
{
    global $debug;
    $PortBaseArray = explode(":", $params['domain']);
    $PortBase = $PortBaseArray['1'];
    $api['args']['auth'] = $params['configoption1'];
    $api['path'] = $params['configoption2'];
    $api['rpc'] = "admin.service_remove";
    $api['args']['unique_id'] = trim($PortBase);
    $return = mediacp_api($api);
    if ($return['status'] != "success" && $return['error'] != "Could not locate service") {
        return $return['error'];
    }
    delete_query("tblcustomfieldsvalues", array("relid" => (int) $params['serviceid']));
    update_query("tblhosting", array("domain" => $params['domain'] . ":terminated"), array("id" => (int) $params['serviceid']));
    return "success";
}
예제 #8
0
        $validationerror = true;
    } else {
        if ($countrytype == "any") {
            $country = "";
        }
        if ($statetype == "any") {
            $state = "";
        }
        insert_query("tbltax", array("level" => $level, "name" => $name, "state" => $state, "country" => $country, "taxrate" => $taxrate));
        redir();
        exit;
    }
}
if ($action == "delete") {
    check_token("WHMCS.admin.default");
    delete_query("tbltax", array("id" => $id));
    redir();
    exit;
}
$result = select_query("tblconfiguration", "", "");
while ($data = mysql_fetch_array($result)) {
    $setting = $data['setting'];
    $value = $data['value'];
    $CONFIG["" . $setting] = "" . $value;
}
if ($saved) {
    infoBox($aInt->lang("global", "changesuccess"), $aInt->lang("global", "changesuccessdesc"));
}
echo $infobox;
$aInt->deleteJSConfirm("doDelete", "taxconfig", "delsuretaxrule", "?action=delete&id=");
echo "\n";
예제 #9
0
if (!defined("WHMCS")) {
    exit("This file cannot be accessed directly");
}
if (!function_exists("pdfInvoice")) {
    require ROOTDIR . "/includes/invoicefunctions.php";
}
if ($_POST['custommessage']) {
    delete_query("tblemailtemplates", array("name" => "Mass Mail Template"));
    insert_query("tblemailtemplates", array("type" => $_POST['customtype'], "name" => "Mass Mail Template", "subject" => html_entity_decode($_POST['customsubject']), "message" => html_entity_decode($_POST['custommessage'])));
    $messagename = "Mass Mail Template";
} else {
    $messagename = $_POST['messagename'];
}
$result = select_query("tblemailtemplates", "COUNT(*)", array("name" => $messagename));
$data = mysql_fetch_array($result);
if (!$data[0]) {
    $apiresults = array("result" => "error", "message" => "Email Template not found");
    return null;
}
if (isset($customvars)) {
    if (!is_array($customvars)) {
        $customvars = unserialize(base64_decode($customvars));
    }
} else {
    $customvars = array();
}
sendMessage($messagename, $_POST['id'], $customvars);
if ($_POST['customtext']) {
    delete_query("tblemailtemplates", array("name" => "Mass Mail Template"));
}
$apiresults = array("result" => "success");
예제 #10
0
function nominet_ReleaseDomain($params)
{
    $nominet = WHMCS_Nominet::init($params);
    if ($nominet->connectAndLogin()) {
        $transfertag = $params['transfertag'];
        $xml = "  <command>\n\t        <update>\n\t\t<r:release\n\t\txmlns:r=\"http://www.nominet.org.uk/epp/xml/std-release-1.0\"\n\t\txsi:schemaLocation=\"http://www.nominet.org.uk/epp/xml/std-release-1.0\n\t\tstd-release-1.0.xsd\">\n\t\t<r:domainName>" . $nominet->getDomain() . ("</r:domainName>\n\t\t<r:registrarTag>" . $transfertag . "</r:registrarTag>\n\t\t</r:release>\n\t\t</update>\n               <clTRID>ABC-12345</clTRID>\n              </command>\n            </epp>");
        $success = $nominet->call($xml);
        if ($success) {
            if ($nominet->isErrorCode()) {
                return array("error" => $nominet->getErrorDesc());
            }
            if ($params['DeleteOnTransfer']) {
                delete_query("tbldomains", array("id" => $params['domainid']));
                return null;
            }
            update_query("tbldomains", array("status" => "Cancelled"), array("id" => $params['domainid']));
            return null;
        }
        return array("error" => $nominet->getLastError());
    }
    return array("error" => $nominet->getLastError());
}
예제 #11
0
        update_query("tblclients", array("credit" => "+=" . $amountin), array("id" => (int) $userid));
    }
    redir("userid=" . $userid);
    exit;
}
if ($sub == "save") {
    check_token("WHMCS.admin.default");
    update_query("tblaccounts", array("gateway" => $paymentmethod, "date" => toMySQLDate($date), "description" => $description, "amountin" => $amountin, "fees" => $fees, "amountout" => $amountout, "transid" => $transid, "invoiceid" => $invoiceid), array("id" => $id));
    logActivity("Modified Transaction (User ID: " . $userid . " - Transaction ID: " . $id . ")");
    redir("userid=" . $userid);
    exit;
}
if ($sub == "delete") {
    check_token("WHMCS.admin.default");
    checkPermission("Delete Transaction");
    delete_query("tblaccounts", array("id" => $ide));
    logActivity("Deleted Transaction (ID: " . $ide . " - User ID: " . $userid . ")");
    redir("userid=" . $userid);
    exit;
}
ob_start();
if ($action == "") {
    $aInt->deleteJSConfirm("doDelete", "transactions", "deletesure", "clientstransactions.php?userid=" . $userid . "&sub=delete&ide=");
    $currency = getCurrency($userid);
    if ($error == "invalidinvid") {
        infoBox("Check Invoice ID", "The Invoice ID you entered could not be found", "error");
    } else {
        if ($error == "wronguser") {
            infoBox("Check Invoice ID", "The Invoice ID you entered to assign this payment to belongs to a different client", "error");
        }
    }
예제 #12
0
function disableAutoRenew($domainid)
{
    update_query("tbldomains", array("donotrenew" => "on"), array("id" => $domainid));
    $domainname = get_query_val("tbldomains", "domain", array("id" => $domainid));
    if ($_SESSION['adminid']) {
        logActivity("Admin Disabled Domain Auto Renew - Domain ID: " . $domainid . " - Domain: " . $domainname);
    } else {
        logActivity("Client Disabled Domain Auto Renew - Domain ID: " . $domainid . " - Domain: " . $domainname);
    }
    $result = select_query("tblinvoiceitems", "tblinvoiceitems.id,tblinvoiceitems.invoiceid", array("type" => "Domain", "relid" => $domainid, "status" => "Unpaid", "tblinvoices.userid" => $_SESSION['uid']), "", "", "", "tblinvoices ON tblinvoices.id=tblinvoiceitems.invoiceid");
    while ($data = mysql_fetch_array($result)) {
        $itemid = $data['id'];
        $invoiceid = $data['invoiceid'];
        $result2 = select_query("tblinvoiceitems", "COUNT(*)", array("invoiceid" => $invoiceid));
        $data = mysql_fetch_array($result2);
        $itemcount = $data[0];
        $otheritemcount = 0;
        if (1 < $itemcount) {
            $otheritemcount = get_query_val("tblinvoiceitems", "COUNT(*)", "invoiceid=" . (int) $invoiceid . (" AND id!=" . $itemid . " AND type NOT IN ('PromoHosting','PromoDomain','GroupDiscount')"));
        }
        if ($itemcount == 1 || $otheritemcount == 0) {
            update_query("tblinvoices", array("status" => "Cancelled"), array("id" => $invoiceid));
            logActivity("Cancelled Previous Domain Renewal Invoice - Invoice ID: " . $invoiceid . " - Domain: " . $domainname);
            run_hook("InvoiceCancelled", array("invoiceid" => $invoiceid));
        }
        delete_query("tblinvoiceitems", array("id" => $itemid));
        updateInvoiceTotal($invoiceid);
        logActivity("Removed Previous Domain Renewal Line Item - Invoice ID: " . $invoiceid . " - Domain: " . $domainname);
    }
}
예제 #13
0
$result = select_query("tblgatewaylog", "data", array("gateway" => "WPIECHODATA" . $invoiceid));
$data = mysql_fetch_array($result);
$echoData = $data['data'];
$result = select_query("tblgatewaylog", "data", array("gateway" => "WPICPDATA" . $invoiceid));
$data = mysql_fetch_array($result);
$cvv = $data['data'];
if (!$echoData) {
    logTransaction("WorldPay Invisible XML Callback", $_REQUEST, "echoData Not Found");
    echo "An Error Occurred. Please Contact Support.";
    exit;
} else {
    logTransaction("WorldPay Invisible XML Callback", $_REQUEST, "Received");
}
delete_query("tblgatewaylog", array("gateway" => "WPIECHODATA" . $invoiceid));
delete_query("tblgatewaylog", array("gateway" => "WPIORDERCODE" . $invoiceid));
delete_query("tblgatewaylog", array("gateway" => "WPICPDATA" . $invoiceid));
getCCVariables($invoiceid);
if ($params['cardtype'] == "American Express") {
    $merchantCode = $params['merchantcodeamex'];
} else {
    $merchantCode = $params['merchantcode1'];
}
$password = $params['merchantpw'];
$instId = $params['instid'];
$cookiestore = $params['cookiestore'];
$orderDescription = "Invoice #" . $params['invoiceid'];
$orderAmount = $params['amount'] * 100;
$raworderAmount = $params['amount'];
$invoiceID = $params['invoiceid'];
$orderShopperEmail = $params['clientdetails']['email'];
$orderShopperID = $params['clientdetails']['userid'];
예제 #14
0
    echo ">" . $user . "</option>";
}
echo "</select></td></tr>\n<tr><td class=\"fieldlabel\">";
echo $aInt->lang("fields", "description");
echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"description\" value=\"";
echo $description;
echo "\" size=\"80\"></td><td class=\"fieldlabel\">";
echo $aInt->lang("fields", "ipaddress");
echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"ipaddress\" value=\"";
echo $ipaddress;
echo "\" size=\"20\"></td></tr>\n</table>\n\n<img src=\"images/spacer.gif\" height=\"10\" width=\"1\"><br>\n<div align=\"center\"><input type=\"submit\" value=\"";
echo $aInt->lang("system", "filterlog");
echo "\" class=\"button\"></div>\n\n</form>\n\n  </div>\n</div>\n\n<br />\n\n";
$result = select_query("tblactivitylog", "", "userid=0", "id", "DESC", $CONFIG['ActivityLimit'] . ",9999");
while ($data = mysql_fetch_array($result)) {
    delete_query("tblactivitylog", array("id" => $data['id']));
}
$aInt->sortableTableInit("date");
$where = "";
if ($date) {
    $where .= " AND date>'" . toMySQLDate($date) . "' AND date<='" . toMySQLDate($date) . "235959'";
}
if ($username) {
    $where .= " AND user='******'";
}
if ($description) {
    $where .= " AND description LIKE '%" . db_escape_string($description) . "%'";
}
if ($ipaddress) {
    $where .= " AND ipaddr='" . db_escape_string($ipaddress) . "'";
}
예제 #15
0
        }
        $table = "tblcontacts";
        $array = array("firstname" => $firstname, "lastname" => $lastname, "companyname" => $companyname, "email" => $email, "address1" => $address1, "address2" => $address2, "city" => $city, "state" => $state, "postcode" => $postcode, "country" => $country, "phonenumber" => $phonenumber, "subaccount" => $subaccount, "permissions" => $permissions, "domainemails" => $domainemails, "generalemails" => $generalemails, "invoiceemails" => $invoiceemails, "productemails" => $productemails, "supportemails" => $supportemails, "affiliateemails" => $affiliateemails);
        if ($password && $password != $aInt->lang("fields", "entertochange")) {
            $array['password'] = generateClientPW($password);
        }
        $where = array("id" => $contactid);
        update_query($table, $array, $where);
        run_hook("ContactEdit", array_merge(array("userid" => $userid, "contactid" => $contactid, "olddata" => $oldcontactdata), $array));
    }
    redir("userid=" . $userid . "&contactid=" . $contactid);
    exit;
}
if ($action == "delete") {
    check_token("WHMCS.admin.default");
    delete_query("tblcontacts", array("id" => $contactid, "userid" => $userid));
    update_query("tblclients", array("billingcid" => ""), array("id" => $userid, "billingcid" => $contactid));
    run_hook("ContactDelete", array("userid" => $userid, "contactid" => $contactid));
    redir("userid=" . $userid);
    exit;
}
ob_start();
if ($error) {
    infoBox($aInt->lang("global", "validationerror"), $error);
    echo $infobox;
}
echo "\n<form action=\"";
echo $_SERVER['PHP_SELF'];
echo "\" method=\"get\">\n<input type=\"hidden\" name=\"userid\" value=\"";
echo $userid;
echo "\">\n";
예제 #16
0
        redir("savesuccess=true");
    } else {
        $result = select_query("tblservers", "id", array("type" => $type, "active" => "1"));
        $data = mysql_fetch_array($result);
        $active = $data['id'] ? "" : "1";
        $newid = insert_query("tblservers", array("name" => $name, "type" => $type, "ipaddress" => trim($ipaddress), "assignedips" => trim($assignedips), "hostname" => trim($hostname), "monthlycost" => trim($monthlycost), "noc" => $noc, "statusaddress" => trim($statusaddress), "nameserver1" => trim($nameserver1), "nameserver1ip" => trim($nameserver1ip), "nameserver2" => trim($nameserver2), "nameserver2ip" => trim($nameserver2ip), "nameserver3" => trim($nameserver3), "nameserver3ip" => trim($nameserver3ip), "nameserver4" => trim($nameserver4), "nameserver4ip" => trim($nameserver4ip), "nameserver5" => trim($nameserver5), "nameserver5ip" => trim($nameserver5ip), "maxaccounts" => trim($maxaccounts), "username" => trim($username), "password" => encrypt(trim($password)), "accesshash" => trim($accesshash), "secure" => $secure, "active" => $active, "disabled" => $disabled));
        run_hook("ServerAdd", array("serverid" => $newid));
        redir("createsuccess=true");
    }
    exit;
}
if ($action == "savegroup") {
    check_token("WHMCS.admin.default");
    if ($id) {
        update_query("tblservergroups", array("name" => $name, "filltype" => $filltype), array("id" => $id));
        delete_query("tblservergroupsrel", array("groupid" => $id));
    } else {
        $id = insert_query("tblservergroups", array("name" => $name, "filltype" => $filltype));
    }
    if ($selectedservers) {
        foreach ($selectedservers as $serverid) {
            insert_query("tblservergroupsrel", array("groupid" => $id, "serverid" => $serverid));
        }
    }
    redir();
    exit;
}
ob_start();
if ($action == "") {
    if ($sub == "enable") {
        check_token("WHMCS.admin.default");
예제 #17
0
 public function sendCustomEmail($subject, $msg)
 {
     delete_query("tblemailtemplates", array("name" => "Client Custom Email Msg"));
     insert_query("tblemailtemplates", array("type" => "general", "name" => "Client Custom Email Msg", "subject" => html_entity_decode($subject), "message" => html_entity_decode($message)));
     sendMessage("Client Custom Email Msg", $this->userid);
     delete_query("tblemailtemplates", array("name" => "Client Custom Email Msg"));
     return true;
 }
예제 #18
0
if (!$id) {
    $aInt->gracefulExit($aInt->lang("domains", "nodomainsinfo") . " <a href=\"ordersadd.php?userid=" . $userid . "\">" . $aInt->lang("global", "clickhere") . "</a> " . $aInt->lang("orders", "toplacenew"));
}
$domains = new WHMCS_Domains();
$domain_data = $domains->getDomainsDatabyID($id);
$id = $did = $domainid = $domain_data['id'];
$userid = $domain_data['userid'];
$aInt->valUserID($userid);
if (!$id) {
    $aInt->gracefulExit("Domain ID Not Found");
}
if ($action == "delete") {
    check_token("WHMCS.admin.default");
    checkPermission("Delete Clients Domains");
    run_hook("DomainDelete", array("userid" => $userid, "domainid" => $id));
    delete_query("tbldomains", array("id" => $id));
    logActivity("Deleted Domain - User ID: " . $userid . " - Domain ID: " . $id);
    redir("userid=" . $userid);
    exit;
}
include ROOTDIR . "/includes/additionaldomainfields.php";
if ($action == "savedomain" && $domain) {
    check_token("WHMCS.admin.default");
    checkPermission("Edit Clients Domains");
    $conf = "success";
    $currency = getCurrency($userid);
    $result = select_query("tblpricing", "msetupfee,qsetupfee,ssetupfee", array("type" => "domainaddons", "currency" => $currency['id'], "relid" => 0));
    $data = mysql_fetch_array($result);
    $domaindnsmanagementprice = $data['msetupfee'] * $regperiod;
    $domainemailforwardingprice = $data['qsetupfee'] * $regperiod;
    $domainidprotectionprice = $data['ssetupfee'] * $regperiod;
예제 #19
0
    check_token("WHMCS.admin.default");
    delete_query("tblbillableitems", array("id" => $id));
    redir();
}
ob_start();
if (!$action) {
    if ($invoice && is_array($bitem)) {
        foreach ($bitem as $id => $v) {
            update_query("tblbillableitems", array("invoiceaction" => "1"), array("id" => $id));
        }
        infoBox($aInt->lang("billableitems", "invoiceitems"), $aInt->lang("billableitems", "itemswillinvoice"));
        echo $infobox;
    }
    if ($delete && is_array($bitem)) {
        foreach ($bitem as $id => $v) {
            delete_query("tblbillableitems", array("id" => $id));
        }
        infoBox($aInt->lang("billableitems", "itemsdeleted"), $aInt->lang("billableitems", "itemsdeleteddesc"));
        echo $infobox;
    }
    $aInt->deleteJSConfirm("doDelete", "billableitems", "itemsdeletequestion", "billableitems.php?userid=" . $userid . "&action=delete&id=");
    echo $aInt->Tabs(array($aInt->lang("global", "searchfilter")), true);
    echo "\n<div id=\"tab0box\" class=\"tabbox\">\n  <div id=\"tab_content\">\n\n<form action=\"";
    echo $_SERVER['PHP_SELF'];
    echo "\" method=\"get\">\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n<tr><td width=\"15%\" class=\"fieldlabel\">";
    echo $aInt->lang("fields", "client");
    echo "</td><td class=\"fieldarea\">";
    echo $aInt->clientsDropDown($userid, "", "userid", true);
    echo "</td><td width=\"15%\" class=\"fieldlabel\">";
    echo $aInt->lang("fields", "amount");
    echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"amount\" size=\"15\" value=\"";
예제 #20
0
        insert_query("tblpaymentgateways", array("gateway" => $gateway, "setting" => "remotestorage", "value" => "1"));
    }
    insert_query("tblpaymentgateways", array("gateway" => $gateway, "setting" => "type", "value" => $type));
    insert_query("tblpaymentgateways", array("gateway" => $gateway, "setting" => "visible", "value" => "on"));
    redir("activated=true");
}
if ($action == "deactivate" && in_array($gateway, $includedmodules)) {
    check_token("WHMCS.admin.default");
    if ($gateway != $newgateway) {
        update_query("tblhosting", array("paymentmethod" => $newgateway), array("paymentmethod" => $gateway));
        update_query("tblhostingaddons", array("paymentmethod" => $newgateway), array("paymentmethod" => $gateway));
        update_query("tbldomains", array("paymentmethod" => $newgateway), array("paymentmethod" => $gateway));
        update_query("tblinvoices", array("paymentmethod" => $newgateway), array("paymentmethod" => $gateway));
        update_query("tblorders", array("paymentmethod" => $newgateway), array("paymentmethod" => $gateway));
        update_query("tblaccounts", array("gateway" => $newgateway), array("gateway" => $gateway));
        delete_query("tblpaymentgateways", array("gateway" => $gateway));
        redir("deactivated=true");
    } else {
        redir();
    }
    exit;
}
if ($action == "save" && in_array($module, $includedmodules)) {
    check_token("WHMCS.admin.default");
    $GatewayConfig[$module]['visible'] = array("Type" => "yesno");
    $GatewayConfig[$module]['name'] = array("Type" => "text");
    $GatewayConfig[$module]['convertto'] = array("Type" => "text");
    foreach ($GatewayConfig[$module] as $confname => $values) {
        if ($values['Type'] != "System") {
            $result = select_query("tblpaymentgateways", "COUNT(*)", array("gateway" => $module, "setting" => $confname));
            $data = mysql_fetch_array($result);
             $lic_id = $_REQUEST['lic_id'];
             $ch = curl_init();
             $data = wr_dologin($ch, $myemail, $mypass);
             if (!$data) {
                 wr_reissue_lic($ch, $lic_id);
                 update_query("whmcsresellerlicenses", array("status" => "Reissued", "domains" => "", "ips" => "", "path" => ""), array("license_id" => $lic_id));
                 $msg = 'License ID: ' . $lic_id . ' has been reissued.';
             } else {
                 $msg = 'Error logging in to WHMCS.COM client area';
                 break;
             }
             curl_close($ch);
             break;
         case "del":
             $lic_id = $_REQUEST['lic_id'];
             delete_query("whmcsresellerlicenses", "license_id='{$lic_id}'");
             $msg = 'License ID: ' . $lic_id . ' has been deleted.';
             break;
     }
 }
 $licenses = array();
 $lic_data = select_query("whmcsresellerlicenses", "*", array());
 while ($r = mysql_fetch_array($lic_data)) {
     $licenses[$r['id']]['user_id'] = $r['user_id'];
     $licenses[$r['id']]['prod_id'] = $r['prod_id'];
     $licenses[$r['id']]['license_id'] = $r['license_id'];
     $licenses[$r['id']]['license'] = $r['license'];
     $licenses[$r['id']]['status'] = $r['status'];
     $licenses[$r['id']]['domains'] = $r['domains'];
     $licenses[$r['id']]['ips'] = $r['ips'];
     $licenses[$r['id']]['path'] = $r['path'];
예제 #22
0
        echo "\" class=\"button\" />\n\n";
    } else {
        echo "\n<p align=\"center\"> <input type=\"button\" value=\"";
        echo $aInt->lang("addons", "closewindow");
        echo "\" onclick=\"window.close();\" class=\"button\" /></p>\n\n";
    }
    echo "</form>\n\n";
    $content = ob_get_contents();
    ob_end_clean();
    $aInt->content = $content;
    $aInt->displayPopUp();
    exit;
}
if ($action == "delete") {
    check_token("WHMCS.admin.default");
    delete_query("tbldomainpricing", array("id" => $id));
    redir("deleted=true");
}
if ($action == "save") {
    check_token("WHMCS.admin.default");
    foreach ($tld as $id => $extension) {
        update_query("tbldomainpricing", array("extension" => trim(strtolower($extension)), "dnsmanagement" => $dns[$id], "emailforwarding" => $email[$id], "idprotection" => $idprot[$id], "eppcode" => $eppcode[$id], "autoreg" => $autoreg[$id]), array("id" => $id));
    }
    $newtld = trim($newtld);
    if ($newtld) {
        if (substr($newtld, 0, 1) != ".") {
            $newtld = "." . $newtld;
        }
        $result = select_query("tbldomainpricing", "", array("extension" => $newtld));
        $num_rows = mysql_num_rows($result);
        if (0 < $num_rows) {
예제 #23
0
function deleteTicket($ticketid, $replyid = "")
{
    global $attachments_dir;
    $where = array("tid" => $ticketid);
    if ($replyid) {
        $where = array("id" => $replyid);
    }
    $result = select_query("tblticketreplies", "", $where);
    while ($data = mysql_fetch_array($result)) {
        $attachment = $data['attachment'];
        if ($attachment) {
            $attachment = explode("|", $attachment);
            foreach ($attachment as $file) {
                deleteFile($attachments_dir, $file);
            }
        }
    }
    if (!$replyid) {
        $result = select_query("tbltickets", "", array("id" => $ticketid));
        $data = mysql_fetch_array($result);
        $attachment = $data['attachment'];
        if ($attachment) {
            $attachment = explode("|", $attachment);
            foreach ($attachment as $file) {
                deleteFile($attachments_dir, $file);
            }
        }
        delete_query("tblticketreplies", array("tid" => $ticketid));
        delete_query("tbltickets", array("id" => $ticketid));
        logActivity("Deleted Ticket - Ticket ID: " . $ticketid);
        return null;
    }
    delete_query("tblticketreplies", array("id" => $replyid));
    addTicketLog($ticketid, "Deleted Ticket Reply (ID: " . $replyid . ")");
    logActivity("Deleted Ticket Reply - ID: " . $replyid);
}
예제 #24
0
    update_query("tblnetworkissues", array("status" => "Resolved", "enddate" => "now()"), array("id" => $id));
    run_hook("NetworkIssueClose", array("id" => $id));
    redir("view=resolved");
    exit;
}
if ($action == "reopen") {
    check_token("WHMCS.admin.default");
    update_query("tblnetworkissues", array("status" => "In Progress", "enddate" => "NULL"), array("id" => $id));
    run_hook("NetworkIssueReopen", array("id" => $id));
    redir();
    exit;
}
if ($action == "delete") {
    check_token("WHMCS.admin.default");
    run_hook("NetworkIssueDelete", array("id" => $id));
    delete_query("tblnetworkissues", array("id" => $id));
    redir();
    exit;
}
$t_query = "SHOW COLUMNS FROM tblnetworkissues LIKE 'type'";
$t_result = full_query($t_query);
if (0 < mysql_num_rows($t_result)) {
    $t_row = mysql_fetch_row($t_result);
    $type_options = explode('\',\'', preg_replace('/(enum|set)\\(\'(.+?)\'\\)/', '$1', $t_row[1]));
}
$p_query = "SHOW COLUMNS FROM tblnetworkissues LIKE 'priority'";
$p_result = full_query($p_query);
if (0 < mysql_num_rows($p_result)) {
    $p_row = mysql_fetch_row($p_result);
    $priority_options = explode('\',\'', preg_replace('/(enum|set)\\(\'(.+?)\'\\)/', '$1', $p_row[1]));
}
예제 #25
0
 * @copyright  Copyright (c) Myles McNamara 2013-2014
 * @license    GPL v3+
 * @version    2.1a
 * @link       https://github.com/tripflex/whmcs-affcoupons
 * @Date:   2014-03-19 21:42:52
 * @Last Modified by:   Myles McNamara
 * @Last Modified time: 2014-03-23 01:43:07
 */
if (!defined("WHMCS")) {
    die("This file cannot be accessed directly");
}
if (isset($_REQUEST['cmd'])) {
    switch ($_REQUEST['cmd']) {
        case "del":
            $id = $_REQUEST['id'];
            delete_query("tblaffcouponsconf", "id='{$id}'");
            break;
        case "add":
            $label = $_POST['label'];
            $type = $_POST['type'];
            $recurring = $_POST['recurring'];
            $value = $_POST['value'];
            $cyclestmp = $_POST['cycles'];
            foreach ($cyclestmp as $v) {
                if ($acycles) {
                    $acycles = $acycles . ",{$v}";
                } else {
                    $acycles = $v;
                }
            }
            $appliestotmp = $_POST['appliesto'];
예제 #26
0
if ($action == "delete") {
    check_token("WHMCS.admin.default");
    checkPermission("Delete Clients Products/Services");
    run_hook("ServiceDelete", array("userid" => $userid, "serviceid" => $id));
    delete_query("tblhosting", array("id" => $id));
    delete_query("tblhostingaddons", array("hostingid" => $id));
    delete_query("tblhostingconfigoptions", array("relid" => $id));
    full_query("DELETE FROM tblcustomfieldsvalues WHERE relid='" . db_escape_string($id) . "' AND fieldid IN (SELECT id FROM tblcustomfields WHERE type='product')");
    logActivity("Deleted Product/Service - User ID: " . $userid . " - Service ID: " . $id, $userid);
    redir("userid=" . $userid);
}
if ($action == "deladdon") {
    check_token("WHMCS.admin.default");
    checkPermission("Delete Clients Products/Services");
    run_hook("AddonDeleted", array("id" => $aid));
    delete_query("tblhostingaddons", array("id" => $aid));
    logActivity("Deleted Addon - User ID: " . $userid . " - Service ID: " . $id . " - Addon ID: " . $aid, $userid);
    redir("userid=" . $userid . "&id=" . $id);
}
ob_start();
$adminbuttonarray = "";
if ($module) {
    if (!isValidforPath($module)) {
        exit("Invalid Server Module Name");
    }
    $modulepath = ROOTDIR . "/modules/servers/" . $module . "/" . $module . ".php";
    if (file_exists($modulepath)) {
        require_once $modulepath;
    }
    if (function_exists($module . "_AdminCustomButtonArray")) {
        $adminbuttonarray = call_user_func($module . "_AdminCustomButtonArray");
예제 #27
0
파일: hooks.php 프로젝트: OnApp/WHMCS-vCD
/**
 * @param $vars
 */
function InvoicePaidHook_OnAppvCD($vars)
{
    $moduleName = OnAppvCDModule::MODULE_NAME;
    $invoiceID = $vars['invoiceid'];
    $qry = 'SELECT
				OnAppUsersNG.`WHMCSUserID`,
				OnAppUsersNG.`serverID`,
				OnAppUsersNG.`OnAppUserID`,
				tblhosting.`id` AS service_id,
				tblinvoices.`subtotal` AS subtotal,
				tblinvoices.`total` AS total,
				tblproducts.`configoption1` AS settings,
				tblhosting.`domainstatus` AS status
			FROM
				tblinvoices
			LEFT JOIN OnAppUsersNG ON
				tblinvoices.`userid` = OnAppUsersNG.`WHMCSUserID`
			LEFT JOIN tblhosting ON
				tblhosting.`userid` = OnAppUsersNG.`WHMCSUserID`
				AND tblhosting.`server` = OnAppUsersNG.`serverID`
			RIGHT JOIN tblinvoiceitems ON
				tblinvoiceitems.`invoiceid` = tblinvoices.`id`
				AND tblinvoiceitems.`relid` = tblhosting.`id`
			LEFT JOIN tblproducts ON
				tblproducts.`id` = tblhosting.`packageid`
			WHERE
				tblinvoices.`id` = @invoiceID
				AND tblinvoices.`status` = "Paid"
				AND tblproducts.`servertype` = "@moduleName"
				AND tblinvoiceitems.`type` = "@moduleName"
			GROUP BY
				tblinvoices.`id`';
    $qry = str_replace('@invoiceID', $invoiceID, $qry);
    $qry = str_replace('@moduleName', $moduleName, $qry);
    $result = full_query($qry);
    if (mysql_num_rows($result) == 0) {
        return;
    }
    $data = mysql_fetch_assoc($result);
    if ($data['status'] == 'Suspended') {
        # check for other unpaid invoices for this service
        $qry = 'SELECT
					tblinvoices.`id`
				FROM
					tblinvoices
				RIGHT JOIN tblinvoiceitems ON
					tblinvoiceitems.`invoiceid` = tblinvoices.`id`
					AND tblinvoiceitems.`relid` = @serviceID
				WHERE
					tblinvoices.`status` = "Unpaid"
				GROUP BY
					tblinvoices.`id`';
        $qry = str_replace('@serviceID', $data['service_id'], $qry);
        $result = full_query($qry);
        if (mysql_num_rows($result) == 0) {
            if (!function_exists('serverunsuspendaccount')) {
                $path = dirname(dirname(dirname(__DIR__))) . '/includes/';
                require_once $path . 'modulefunctions.php';
            }
            serverunsuspendaccount($data['service_id']);
        }
    }
    $qry = 'SELECT
				`secure`,
				`username`,
				`hostname`,
				`password`,
				`ipaddress`
			FROM
				tblservers
			WHERE
				`type` = "@moduleName"
				AND `id` = @serverID';
    $qry = str_replace('@serverID', $data['server_id'], $qry);
    $qry = str_replace('@moduleName', $moduleName, $qry);
    $result = full_query($qry);
    $server = mysql_fetch_assoc($result);
    $server['password'] = decrypt($server['password']);
    if ($server['secure']) {
        $server['address'] = 'https://';
    } else {
        $server['address'] = 'http://';
    }
    if (empty($server['ipaddress'])) {
        $server['address'] .= $server['hostname'];
    } else {
        $server['address'] .= $server['ipaddress'];
    }
    unset($server['ipaddress'], $server['hostname'], $server['secure']);
    # get OnApp amount
    $result = select_query($moduleName . '_Cache', 'data', ['itemID' => 123, 'type' => 'invoiceData']);
    $amount = mysql_fetch_object($result)->data;
    if ($amount) {
        $payment = new OnApp_Payment();
        $payment->auth($server['address'], $server['username'], $server['password']);
        $payment->_user_id = $data['OnAppUserID'];
        $payment->_amount = $amount;
        $payment->_invoice_number = $invoiceID;
        $payment->save();
        $error = $payment->getErrorsAsString();
        if (empty($error)) {
            $msg = $moduleName . ' payment was sent. Service ID #' . $data['service_id'] . ', amount: ' . $amount;
            # delete invoice data
            $where = ['itemID' => $invoiceID, 'type' => 'invoiceData'];
            delete_query($moduleName . '_Cache', $where);
        } else {
            $msg = 'ERROR with ' . $moduleName . ' payment for service ID #' . $data['service_id'] . ': ' . $error;
        }
    } else {
        $msg = 'ERROR with ' . $moduleName . ' payment for service ID #' . $data['service_id'] . ': Cannot find ' . $moduleName . '  amount';
    }
    logactivity($msg);
}
예제 #28
0
function worldpayinvisiblexml_3dsecure($params)
{
    if ($params['cardtype'] == "American Express") {
        $merchantCode = $params['merchantcodeamex'];
    } else {
        $merchantCode = $params['merchantcode1'];
    }
    $password = $params['merchantpw'];
    $instId = $params['instid'];
    $cookiestore = $params['cookiestore'];
    if ($params['cardtype'] == "American Express") {
        $orderCode = "A-" . date("YmdHis") . "-" . $params['invoiceid'];
    } else {
        $orderCode = "E-" . date("YmdHis") . "-" . $params['invoiceid'];
    }
    $orderDescription = "Invoice #" . $params['invoiceid'];
    $orderAmount = $params['amount'] * 100;
    $raworderAmount = $params['amount'];
    $invoiceID = $params['invoiceid'];
    $orderShopperEmail = $params['clientdetails']['email'];
    $orderShopperID = $params['clientdetails']['userid'];
    $orderShopperFirstName = $params['clientdetails']['firstname'];
    $orderShopperSurname = $params['clientdetails']['lastname'];
    $orderShopperStreet = $params['clientdetails']['address1'];
    $orderShopperPostcode = $params['clientdetails']['postcode'];
    $orderShopperCity = $params['clientdetails']['city'];
    $orderShopperCountryCode = $params['clientdetails']['country'];
    $orderShopperTel = $params['clientdetails']['phonenumber'];
    $cvv = $params['cccvv'];
    $acceptHeader = $_SERVER['HTTP_ACCEPT'];
    $userAgentHeader = $_SERVER['HTTP_USER_AGENT'];
    $shopperIPAddress = is_null($_SERVER['REMOTE_ADDR']) ? "127.0.0.1" : $_SERVER['REMOTE_ADDR'];
    if ($params['cardtype'] == "American Express") {
        $cardType = "AMEX-SSL";
    } else {
        if ($params['cardtype'] == "Diners Club") {
            $cardType = "DINERS-SSL";
        } else {
            if ($params['cardtype'] == "JCB") {
                $cardType = "JCB-SSL";
            } else {
                if ($params['cardtype'] == "MasterCard") {
                    $cardType = "ECMC-SSL";
                } else {
                    if ($params['cardtype'] == "Solo") {
                        $cardType = "SOLO_GB-SSL";
                    } else {
                        if ($params['cardtype'] == "Maestro") {
                            $cardType = "MAESTRO-SSL";
                        } else {
                            $cardType = "VISA-SSL";
                        }
                    }
                }
            }
        }
    }
    $id = time();
    $xml = "<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE paymentService PUBLIC '-//WorldPay/DTD WorldPay PaymentService v1//EN' 'http://dtd.worldpay.com/paymentService_v1.dtd'>";
    $xml .= "<paymentService version='1.4' merchantCode='" . $merchantCode . "'>";
    $xml .= "<submit>";
    $xml .= "<order orderCode='" . $orderCode . "' installationId='" . $instId . "'>";
    $xml .= "<description>" . $orderDescription . "</description>";
    $xml .= "<amount value='" . $orderAmount . "' currencyCode='" . $params['currency'] . "' exponent='2'/>";
    $xml .= "<orderContent><![CDATA[]]></orderContent>";
    $xml .= "<paymentDetails>";
    $xml .= "<" . $cardType . ">";
    $xml .= "<cardNumber>" . $params['cardnum'] . "</cardNumber>";
    $xml .= "<expiryDate><date month='" . substr($params['cardexp'], 0, 2) . "' year='20" . substr($params['cardexp'], 2, 2) . "'/></expiryDate>";
    $xml .= "<cardHolderName>" . $orderShopperFirstName . " " . $orderShopperSurname . "</cardHolderName>";
    if ($params['cardtype'] == "Maestro" || $params['cardtype'] == "Solo") {
        if ($params['cardstart']) {
            $xml .= "<startDate><date month='" . substr($params['cardstart'], 0, 2) . "' year='20" . substr($params['cardstart'], 2, 2) . "'/></startDate>";
        }
        if ($params['cardissuenum']) {
            $xml .= "<issueNumber>" . $params['cardissuenum'] . "</issueNumber>";
        }
    }
    $xml .= "<cvc>" . $cvv . "</cvc>";
    $xml .= "<cardAddress>";
    $xml .= "<address>";
    $xml .= "<firstName>" . $orderShopperFirstName . "</firstName>";
    $xml .= "<lastName>" . $orderShopperSurname . "</lastName>";
    $xml .= "<street>" . $orderShopperStreet . "</street>";
    $xml .= "<postalCode>" . $orderShopperPostcode . "</postalCode>";
    $xml .= "<city>" . $orderShopperCity . "</city>";
    $xml .= "<countryCode>" . $orderShopperCountryCode . "</countryCode>";
    $xml .= "<telephoneNumber>" . $orderShopperTel . "</telephoneNumber>";
    $xml .= "</address>";
    $xml .= "</cardAddress>";
    $xml .= "</" . $cardType . ">";
    $xml .= "<session shopperIPAddress='" . $shopperIPAddress . "' id='" . $invoiceID . "'/>";
    $xml .= "</paymentDetails>";
    $xml .= "<shopper>";
    $xml .= "<shopperEmailAddress>" . $orderShopperEmail . "</shopperEmailAddress>";
    $xml .= "<browser>";
    $xml .= "<acceptHeader>" . $acceptHeader . "</acceptHeader>";
    $xml .= "<userAgentHeader>" . $userAgentHeader . "</userAgentHeader>";
    $xml .= "</browser>";
    $xml .= "</shopper>";
    $xml .= "</order></submit></paymentService>";
    if ($params['testmode']) {
        $url = "https://secure-test.wp3.rbsworldpay.com/jsp/merchant/xml/paymentService.jsp";
    } else {
        $url = "https://secure.worldpay.com/jsp/merchant/xml/paymentService.jsp";
    }
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
    curl_setopt($ch, CURLOPT_USERPWD, $merchantCode . ":" . $password);
    curl_setopt($ch, CURLOPT_COOKIEJAR, "" . $cookiestore . $invoiceID . ".cookie");
    curl_setopt($ch, CURLOPT_TIMEOUT, 240);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    $result_tmp = curl_exec($ch);
    if (curl_error($ch)) {
        $result_tmp = "Curl Error: " . curl_errno($ch) . " - " . curl_error($ch);
    }
    curl_close($ch);
    logTransaction("WorldPay Invisible XML", $result_tmp, "Received");
    $result_arr = XMLtoArray($result_tmp);
    $PostUrl = $result_arr['PAYMENTSERVICE']['REPLY']['ORDERSTATUS']['REQUESTINFO']['REQUEST3DSECURE']['ISSUERURL'];
    $PaReq = $result_arr['PAYMENTSERVICE']['REPLY']['ORDERSTATUS']['REQUESTINFO']['REQUEST3DSECURE']['PAREQUEST'];
    $echoData = $result_arr['PAYMENTSERVICE']['REPLY']['ORDERSTATUS']['ECHODATA'];
    $lastevent = $result_arr['PAYMENTSERVICE']['REPLY']['ORDERSTATUS']['PAYMENT']['LASTEVENT'];
    if (!$PaReq) {
        if ($lastevent == "AUTHORISED") {
            addInvoicePayment($invoiceID, $orderCode, $raworderAmount, "", "worldpayinvisiblexml", "on");
            logTransaction("WorldPay Invisible XML Callback", $result_tmp, "Successful");
            sendMessage("Credit Card Payment Confirmation", $params['invoiceid']);
            $result = "success";
        } else {
            logTransaction("WorldPay Invisible XML Callback", $result_tmp, "Declined");
            sendMessage("Credit Card Payment Failed", $params['invoiceid']);
            $result = "declined";
        }
        return $result;
    }
    delete_query("tblgatewaylog", array("gateway" => "WorldPay Invisible XML Callback", "result" => "echoData Not Found"));
    delete_query("tblgatewaylog", "gateway LIKE '%WPI%' AND date<='" . date("Y-m-d H:i:s", strtotime("-10 minutes") . "'"));
    delete_query("tblgatewaylog", array("gateway" => "WPIORDERCODE" . $params['invoiceid']));
    delete_query("tblgatewaylog", array("gateway" => "WPIECHODATA" . $params['invoiceid']));
    delete_query("tblgatewaylog", array("gateway" => "WPICPDATA" . $params['invoiceid']));
    insert_query("tblgatewaylog", array("date" => "now()", "gateway" => "WPIORDERCODE" . $params['invoiceid'], "data" => $orderCode));
    insert_query("tblgatewaylog", array("date" => "now()", "gateway" => "WPIECHODATA" . $params['invoiceid'], "data" => $echoData));
    if ($params['cvvpass']) {
        insert_query("tblgatewaylog", array("date" => "now()", "gateway" => "WPICPDATA" . $params['invoiceid'], "data" => $cvv));
    }
    $code = "<form action=\"" . $PostUrl . "\" method=\"post\">\n<input type=\"hidden\" name=\"PaReq\" value=\"" . $PaReq . "\" />\n<input type=\"hidden\" name=\"TermUrl\" value=\"" . $params['systemurl'] . "/modules/gateways/callback/worldpayinvisiblexml.php\" />\n<input type=\"hidden\" name=\"MD\" value=\"" . $params['invoiceid'] . "\" />\n<!-- <input type=\"submit\" name=\"Click to Authenticate Card\"> -->\n</form>";
    return $code;
}
예제 #29
0
}
if ($action == "activate") {
    check_token("WHMCS.admin.default");
    $module = $_GET['module'];
    if ($module) {
        delete_query("tblregistrars", array("registrar" => $module));
        insert_query("tblregistrars", array("registrar" => $module, "setting" => "Username", "value" => ""));
    }
    redir("activated=true#" . $module);
    exit;
}
if ($action == "deactivate") {
    check_token("WHMCS.admin.default");
    $module = $_GET['module'];
    if ($module) {
        delete_query("tblregistrars", array("registrar" => $module));
    }
    redir("deactivated=true");
    exit;
}
ob_start();
if ($saved) {
    infoBox($aInt->lang("domainregistrars", "changesuccess"), $aInt->lang("domainregistrars", "changesuccessinfo"));
}
if ($activated) {
    infoBox($aInt->lang("domainregistrars", "moduleactivated"), $aInt->lang("domainregistrars", "moduleactivatedinfo"), "success");
}
if ($deactivated) {
    infoBox($aInt->lang("domainregistrars", "moduledeactivated"), $aInt->lang("domainregistrars", "moduledeactivatedinfo"), "success");
}
echo $infobox;
예제 #30
0
    }
    redir();
}
if ($sub == "deletegroup") {
    check_token("WHMCS.admin.default");
    checkPermission("Manage Product Groups");
    delete_query("tblproductgroups", array("id" => $id));
    redir();
}
if ($sub == "delete") {
    check_token("WHMCS.admin.default");
    checkPermission("Delete Products/Services");
    run_hook("ProductDelete", array("pid" => $id));
    delete_query("tblproducts", array("id" => $id));
    delete_query("tblproductconfiglinks", array("pid" => $id));
    delete_query("tblcustomfields", array("type" => "product", "relid" => $id));
    full_query("DELETE FROM tblcustomfieldsvalues WHERE fieldid NOT IN (SELECT id FROM tblcustomfields)");
    redir();
}
if ($sub == "moveup") {
    check_token("WHMCS.admin.default");
    checkPermission("Manage Product Groups");
    $result = select_query("tblproductgroups", "", array("`order`" => $order));
    $data = mysql_fetch_array($result);
    $premid = $data['id'];
    $order1 = $order - 1;
    update_query("tblproductgroups", array("order" => $order), array("`order`" => $order1));
    update_query("tblproductgroups", array("order" => $order1), array("id" => $premid));
    redir();
}
if ($sub == "movedown") {