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


PHP get_query_val函数代码示例

本文整理汇总了PHP中get_query_val函数的典型用法代码示例。如果您正苦于以下问题:PHP get_query_val函数的具体用法?PHP get_query_val怎么用?PHP get_query_val使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: widget_staffboard_overview

/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 * */
function widget_staffboard_overview($vars)
{
    global $_ADMINLANG;
    $title = "Staff Noticeboard";
    $lastviews = get_query_val("tbladdonmodules", "value", array("module" => "staffboard", "setting" => "lastviewed"));
    if ($lastviews) {
        $lastviews = unserialize($lastviews);
        $new = false;
    } else {
        $lastviews = array();
        $new = true;
    }
    $lastviewed = $lastviews[$_SESSION['adminid']];
    $lastviews[$_SESSION['adminid']] = time();
    if ($new) {
        insert_query("tbladdonmodules", array("module" => "staffboard", "setting" => "lastviewed", "value" => serialize($lastviews)));
    } else {
        update_query("tbladdonmodules", array("value" => serialize($lastviews)), array("module" => "staffboard", "setting" => "lastviewed"));
    }
    $numchanged = get_query_val("mod_staffboard", "COUNT(id)", "date>='" . date("Y-m-d H:i:s", $lastviewed) . "'");
    $content = "\n<style>\n.staffboardchanges {\n    margin: 0 0 5px 0;\n    padding: 8px 25px;\n    font-size: 1.2em;\n    text-align: center;\n}\n.staffboardnotices {\n    max-height: 130px;\n    overflow: auto;\n    border-top: 1px solid #ccc;\n    border-bottom: 1px solid #ccc;\n}\n.staffboardnotices div {\n    padding: 5px 15px;\n    border-bottom: 2px solid #fff;\n}\n.staffboardnotices div.pink {\n    background-color: #F3CBF3;\n}\n.staffboardnotices div.yellow {\n    background-color: #FFFFC1;\n}\n.staffboardnotices div.purple {\n    background-color: #DCD7FE;\n}\n.staffboardnotices div.white {\n    background-color: #FAFAFA;\n}\n.staffboardnotices div.pink {\n    background-color: #F3CBF3;\n}\n.staffboardnotices div.blue {\n    background-color: #A6E3FC;\n}\n.staffboardnotices div.green {\n    background-color: #A5F88B;\n}\n</style>\n<div class=\"staffboardchanges\">There are <strong>" . $numchanged . "</strong> New or Updated Staff Notices Since your Last Visit - <a href=\"addonmodules.php?module=staffboard\">Visit Noticeboard &raquo;</a></div><div class=\"staffboardnotices\">";
    $result = select_query("mod_staffboard", "", "", "date", "DESC");
    while ($data = mysql_fetch_array($result)) {
        $content .= "<div class=\"" . $data['color'] . "\">" . fromMySQLDate($data['date'], 1) . " - " . (100 < strlen($data['note']) ? substr($data['note'], 0, 100) . "..." : $data['note']) . "</div>";
    }
    $content .= "</div>";
    return array("title" => $title, "content" => $content, "jquerycode" => $jquerycode);
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:38,代码来源:hooks.php

示例2: oath_hook_admin_client_profile_tab_fields

function oath_hook_admin_client_profile_tab_fields($vars)
{
    $secret = get_query_val('mod_oath_client', 'secret', "userid = '{$vars['userid']}'");
    if ($secret) {
        return array('OATH Addon' => '<label><input type="checkbox" name="disable_twofactor" value="1" /> Tick and save to disable two-factor authentication for this client</label>');
    } else {
        return array();
    }
}
开发者ID:cengjing,项目名称:whmcs-oath-addon,代码行数:9,代码来源:hooks.php

示例3: hook_licensing_addon_log_prune

/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 * */
function hook_licensing_addon_log_prune($vars)
{
    $logprune = get_query_val("tbladdonmodules", "value", array("module" => "licensing", "setting" => "logprune"));
    if (is_numeric($logprune)) {
        full_query("DELETE FROM mod_licensinglog WHERE datetime<='" . date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - $logprune, date("Y"))) . "'");
    }
    full_query("DELETE FROM mod_licensing WHERE serviceid NOT IN (SELECT id FROM tblhosting)");
    full_query("OPTIMIZE TABLE mod_licensinglog");
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:19,代码来源:hooks.php

示例4: vultr_CreateAccount

function vultr_CreateAccount($params)
{
    $apikey = $params["serverpassword"];
    $ch = curl_init();
    $serviceid = $params["serviceid"];
    $DCID = $params['configoptions']['Datacenter'];
    $VPSPLANID = $params['configoptions']['Resource Plan'];
    $OS = $params['configoptions']['OS'];
    $SNAPSHOTID = $params['configoptions']['Snapshot'];
    curl_setopt($ch, CURLOPT_URL, "https://api.vultr.com/v1/server/create?api_key=" . $apikey);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "DCID={$DCID}&VPSPLANID={$VPSPLANID}&OSID={$OS}&SNAPSHOTID={$SNAPSHOTID}&label={$serviceid}&enable_ipv6=yes");
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $response = json_decode(curl_exec($ch), 1);
    $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($http_status == "200") {
        $successful = true;
        $server_id = $response[SUBID];
    } else {
        $errorinfo = "API error. " . $http_status;
    }
    curl_close($ch);
    if ($successful) {
        sleep(60);
        //wait 60 secondes let vultr to install and then get server details
        $var1 = (int) get_query_val("tblcustomfields", "id", array("fieldname" => 'server_id', "relid" => $params['packageid']));
        update_query("tblcustomfieldsvalues", array("value" => $server_id), array("fieldid" => $var1, "relid" => $params['serviceid']));
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "https://api.vultr.com/v1/server/list?api_key=" . $apikey);
        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $response2 = json_decode(curl_exec($ch), 1);
        $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        if ($http_status == "200") {
            $server_ip = $response2[$server_id]['main_ip'];
            $server_passwd = $response2[$server_id]['default_password'];
            $command = "encryptpassword";
            $adminuser = $params["serverusername"];
            $values["password2"] = $server_passwd;
            $server_passwd_entd_arry = localAPI($command, $values, $adminuser);
            $server_passwd_entd = $server_passwd_entd_arry[password];
        }
        curl_close($ch);
        if (empty($server_ip)) {
            $result = "success";
            $server_ip = "See client area";
            $server_password = "See client area";
        } else {
            $result = "success";
        }
        update_query("tblhosting", array("dedicatedip" => $server_ip, "username" => "root/administrator", "password" => "{$server_passwd_entd}"), array("id" => $params['serviceid']));
    } else {
        $result = "Something has gone wrong. Please manually check and/or create the droplet. Info: " . $errorinfo;
    }
    return $result;
}
开发者ID:carriercomm,项目名称:whmcs-3,代码行数:57,代码来源:vultr.php

示例5: widget_network_status_gettable

function widget_network_status_gettable()
{
    global $_ADMINLANG;
    $content = '<div class="fixed-height-container">
<table class="table table-condensed">
<tr style="background-color:#efefef;font-weight:bold;text-align:center"><td>' . $_ADMINLANG['mergefields']['servername'] . '</td><td>HTTP</td><td>' . $_ADMINLANG['home']['load'] . '</td><td>' . $_ADMINLANG['home']['uptime'] . '</td><td>' . $_ADMINLANG['home']['percentuse'] . '</td></tr>
';
    $id = '';
    $result = select_query("tblservers", "", array("disabled" => "0"), "name", "ASC");
    while ($data = mysql_fetch_array($result)) {
        $id = $data["id"];
        $name = $data['name'];
        $ipaddress = $data['ipaddress'];
        $maxaccounts = $data['maxaccounts'];
        $statusaddress = $data['statusaddress'];
        $active = $data['active'];
        $active = $active ? '*' : '';
        $numaccounts = get_query_val("tblhosting", "COUNT(*)", "server='{$id}' AND (domainstatus='Active' OR domainstatus='Suspended')");
        $percentuse = @round($numaccounts / $maxaccounts * 100, 0);
        $http = $serverload = $uptime = "-";
        if (isset($_POST['checknetwork'])) {
            $http = @fsockopen($ipaddress, 80, $errno, $errstr, 5);
            $http = $http ? "Online" : "Offline";
            if ($statusaddress) {
                $q = $statusaddress . "index.php";
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, $q);
                curl_setopt($ch, CURLOPT_HEADER, 0);
                curl_setopt($ch, CURLOPT_TIMEOUT, 5);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
                $filecontents = curl_exec($ch);
                curl_close($ch);
                preg_match('/\\<load\\>(.*?)\\<\\/load\\>/', $filecontents, $serverload);
                preg_match('/\\<uptime\\>(.*?)\\<\\/uptime\\>/', $filecontents, $uptime);
                $serverload = $serverload[1];
                $uptime = $uptime[1];
                if (!$serverload) {
                    $serverload = "-";
                }
                if (!$uptime) {
                    $uptime = "-";
                }
            }
        }
        $content .= '<tr bgcolor="#ffffff"><td align="center">' . $name . '</td><td align="center">' . $http . '</td><td align="center">' . $serverload . '</td><td align="center">' . $uptime . '</td><td align="center">' . $percentuse . '%</td></tr>';
    }
    if (!$id) {
        $content .= '<tr bgcolor="#ffffff"><td colspan="5" align="center">' . $_ADMINLANG['global']['norecordsfound'] . '</td></tr>';
    }
    $content .= '</table>
</div>';
    return $content;
}
开发者ID:MarcelaGotta,项目名称:Webty,代码行数:55,代码来源:network_status.php

示例6: chartdata_orders

function chartdata_orders()
{
    $chartdata = array();
    $chartdata['cols'][] = array('label' => 'Year', 'type' => 'string');
    $chartdata['cols'][] = array('label' => 'Completed Orders', 'type' => 'number');
    $chartdata['cols'][] = array('label' => 'Total Orders', 'type' => 'number');
    for ($i = 14; $i >= 0; $i--) {
        $date = mktime(0, 0, 0, date("m"), date("d") - $i, date("Y"));
        $number = get_query_val("tblorders", "COUNT(*)", "date LIKE '" . date("Y-m-d", $date) . "%' AND status='Active'");
        $number2 = get_query_val("tblorders", "COUNT(*)", "date LIKE '" . date("Y-m-d", $date) . "%'");
        $chartdata['rows'][] = array('c' => array(array('v' => date("dS", $date)), array('v' => (int) $number), array('v' => (int) $number2)));
    }
    return $chartdata;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:14,代码来源:orders_overview.php

示例7: twilio_adminheader_hook

/**
 * Twilio Call-Redirect WHMCS module
 *
 * @author Frank Laszlo <frank@franksworld.org>
 * @version 1.0
 * @package twilio-whmcs
 */
function twilio_adminheader_hook($vars)
{
    // 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;
    }
    // Get module access
    $access = get_query_val('tbladdonmodules', 'value', 'module="twilio" AND setting="access"');
    $access = explode(',', $access);
    // Get admin role
    $adminid = $_SESSION['adminid'];
    $adminrole = get_query_val('tbladmins', 'roleid', 'id=' . $adminid);
    if (in_array($adminrole, $access, true)) {
        // First we need to check if the port is even open, otherwise the admin page will take forever to load.
        $timeout = '5.00';
        if ($fp = fsockopen($_SERVER['HTTP_HOST'], $config['client_port'], $errno, $errstr, (double) $timeout)) {
            $socketio = $_SERVER['HTTP_HOST'] . ':' . $config['client_port'];
            $code = '
<script src="https://' . $socketio . '/socket.io/socket.io.js"></script>
<script>
	var socket = io.connect("' . $socketio . '", {secure: true});
	socket.on("data", function (data) {
		var d = JSON.parse(data);
		switch (d.type) {
			case "client":
				var ok = confirm("You have an incoming call for Client ID: "+d.clientid+". Would you like to navigate to this clients page?");
				var url = "clientssummary.php?userid="+d.clientid;
				break;
			case "ticket":
				var ok = confirm("You have an incoming call regarding Ticket ID: "+d.ticketid+". Would you like to navigate to this ticket?");
				var url = "supporttickets.php?action=viewticket&id="+d.ticketid;
				break;
		}
		if (ok) {
			document.location = url;
		}
	});
</script>';
            return $code;
        } else {
            return '<!-- Cannot connect to node.js server -->';
        }
    } else {
        return '<!-- No access to twilio call-redirect -->';
    }
}
开发者ID:shalintripathi,项目名称:WHMCS-Modules,代码行数:57,代码来源:hooks.php

示例8: paywall_api_key

function paywall_api_key($vars)
{
    if ($vars["clientareaaction"] == "creditcard" || $vars["filename"] == "creditcard") {
        $error_message = $_SESSION['paymentwall_errors'];
        $pending_review = $_SESSION['paywall_pending_review'];
        unset($_SESSION['paymentwall_errors']);
        unset($_SESSION['paywall_pending_review']);
        if (get_query_val("tblpaymentgateways", "value", array("gateway" => "paymentwallbrick", "setting" => "test_mode")) == "on") {
            return array("paymentwall_pendingreview" => $pending_review, "paymentwall_errors" => $error_message, "brick_public_key" => get_query_val("tblpaymentgateways", "value", array("gateway" => "paymentwallbrick", "setting" => "test_public_key")));
        } else {
            return array("paymentwall_pendingreview" => $pending_review, "paymentwall_errors" => $error_message, "brick_public_key" => get_query_val("tblpaymentgateways", "value", array("gateway" => "paymentwallbrick", "setting" => "public_key")));
        }
    }
}
开发者ID:VPNht,项目名称:brick-whmcs,代码行数:14,代码来源:paymentwallbrick.php

示例9: hook_project_management_adminticketinfo

function hook_project_management_adminticketinfo($vars)
{
    global $aInt;
    global $jscode;
    global $jquerycode;
    $ticketid = $vars['ticketid'];
    $ticketdata = get_query_vals("tbltickets", "userid,title,tid", array("id" => $ticketid));
    $tid = $ticketdata['tid'];
    require ROOTDIR . "/modules/addons/project_management/project_management.php";
    $projectrows = "";
    $result = select_query("mod_project", "mod_project.*,(SELECT CONCAT(firstname,' ',lastname) FROM tbladmins WHERE id=mod_project.adminid) AS adminname", "ticketids LIKE '%" . mysql_real_escape_string($tid) . "%'");
    while ($data = mysql_fetch_array($result)) {
        $timerid = get_query_val("mod_projecttimes", "id", array("projectid" => $data['id'], "end" => "", "adminid" => $_SESSION['adminid']), "start", "DESC");
        $timetrackinglink = $timerid ? "<a href=\"#\" onclick=\"projectendtimer('" . $data['id'] . "');return false\"><img src=\"../modules/addons/project_management/images/notimes.png\" align=\"absmiddle\" border=\"0\" /> Stop Tracking Time</a>" : "<a href=\"#\" onclick=\"projectstarttimer('" . $data['id'] . "');return false\"><img src=\"../modules/addons/project_management/images/starttimer.png\" align=\"absmiddle\" border=\"0\" /> Start Tracking Time</a>";
        $projectrows .= "<tr><td><a href=\"addonmodules.php?module=project_management&m=view&projectid=" . $data['id'] . "\">" . $data['id'] . "</a></td><td><a href=\"addonmodules.php?module=project_management&m=view&projectid=" . $data['id'] . "\">" . $data['title'] . "</a> <span id=\"projecttimercontrol" . $data['id'] . "\" class=\"tickettimer\">" . $timetrackinglink . "</span></td><td>" . $data['adminname'] . "</td><td>" . fromMySQLDate($data['created']) . "</td><td>" . fromMySQLDate($data['duedate']) . "</td><td>" . fromMySQLDate($data['lastmodified']) . "</td><td>" . $data['status'] . "</td></tr>";
    }
    $code = "<link href=\"../modules/addons/project_management/css/style.css\" rel=\"stylesheet\" type=\"text/css\" />\n\n<div id=\"projectscont\" style=\"margin:0 0 10px 0;padding:5px;border:2px dashed #e0e0e0;background-color:#fff;-moz-border-radius: 6px;-webkit-border-radius: 6px;-o-border-radius: 6px;border-radius: 6px;" . ($projectrows ? "" : "display:none;") . "\">\n\n<h2 style=\"margin:0 0 5px 0;text-align:center;background-color:#f2f2f2;-moz-border-radius: 6px;-webkit-border-radius: 6px;-o-border-radius: 6px;border-radius: 6px;\">Projects</h2>\n\n<div class=\"tablebg\" style=\"padding:0 20px;\">\n<table class=\"datatable\" width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\" id=\"ticketprojectstbl\">\n<tr><th>Project ID</th><th>Title</th><th>Assigned To</th><th>Created</th><th>Due Date</th><th>Last Updated</th><th>Status</th></tr>\n" . $projectrows . "\n</table>\n</div>\n\n</div>\n\n";
    if (project_management_checkperm("Create New Projects")) {
        $code .= "<span style=\"float:right;padding:0 50px 15px 0;\"><a href=\"#\" onclick=\"createnewproject();return false\" class=\"create\"><img src=\"images/icons/add.png\" align=\"top\" border=\"0\" /> <b>Create New Project</b></a></span>";
    }
    $code .= "\n<script>\n\$(document).on(\"keyup\",\"#cpclientname\",function () {\n\tvar ticketuseridsearchlength = \$(\"#cpclientname\").val().length;\n\tif (ticketuseridsearchlength>2) {\n\t\$.post(\"search.php\", { ticketclientsearch: 1, value: \$(\"#cpclientname\").val() },\n\t    function(data){\n            if (data) {\n                \$(\"#cpticketclientsearchresults\").html(data.replace(\"searchselectclient(\",\"projectsearchselectclient(\"));\n                \$(\"#cpticketclientsearchresults\").slideDown(\"slow\");\n                \$(\"#cpclientsearchcancel\").fadeIn();\n            }\n        });\n\t}\n});\nfunction projectsearchselectclient(userid,name,email) {\n    \$(\"#cpclientname\").val(name);\n    \$(\"#cpuserid\").val(userid);\n    \$(\"#cpclientsearchcancel\").fadeOut();\n\t\$(\"#cpticketclientsearchresults\").slideUp(\"slow\");\n}\n\nfunction createnewproject() {\n\t\$(\"#popupcreatenew\").show();\n\t\$(\"#popupstarttimer\").hide();\n\t\$(\"#popupendtimer\").hide();\n\t\$(\"#createnewcont\").slideDown();\n}\nfunction createproject() {\n\tinputs = \$(\"#ajaxcreateprojectform\").serializeArray();\n\t\$.post(\"addonmodules.php?module=project_management&createproj=1&ajax=1\", { input : inputs },\n\t\tfunction (data) {\n\t\t\tif(data == \"0\"){\n\t\t\t\talert(\"You do not have permission to create project\");\n\t\t\t} else {\n\t\t\t\t\$(\"#createnewcont\").slideUp();\n                \$(\"#ticketprojectstbl\").append(data);\n\t\t\t\t\$(\"#projectscont\").slideDown();\n\t\t\t}\n\t\t});\n}\n\nfunction projectstarttimer(projectid) {\n    \$(\"#ajaxstarttimerformprojectid\").val(projectid);\n\t\$(\"#popupcreatenew\").hide();\n\t\$(\"#popupstarttimer\").show();\n\t\$(\"#popupendtimer\").hide();\n\t\$(\"#createnewcont\").slideDown();\n}\n\nfunction projectendtimer(projectid) {\n\t\$(\"#popupcreatenew\").hide();\n\t\$(\"#popupstarttimer\").hide();\n\t\$(\"#popupendtimer\").show();\n\t\$(\"#createnewcont\").slideDown();\n}\n\nfunction projectstarttimersubmit() {\n\t\$.post(\"addonmodules.php?module=project_management&m=view\", \"a=hookstarttimer&\"+\$(\"#ajaxstarttimerform\").serialize(),\n\t\tfunction (data) {\n\t\t\tif(data == \"0\"){\n\t\t\t\talert(\"Could not start timer.\");\n\t\t\t} else {\n\t\t\t\t\$(\"#createnewcont\").slideUp();\n                var projid = \$(\"#ajaxstarttimerformprojectid\").val();\n\t\t\t\t\$(\"#projecttimercontrol\"+projid).html(\"<a href=\"//\" onclick=\"projectendtimer('\"+projid+\"');return false\"><img src=\"../modules/addons/project_management/images/notimes.png\" align=\"absmiddle\" border=\"0\" /> Stop Tracking Time</a>\");\n\t\$(\"#activetimers\").html(data);\n\t\t\t}\n\t\t});\n}\nfunction projectendtimersubmit(projectid,timerid) {\n\t\$.post(\"addonmodules.php?module=project_management&m=view\", \"a=hookendtimer&timerid=\"+timerid+\"&ticketnum=" . $tid . "\",\n\t\tfunction (data) {\n\t\t\tif (data == \"0\") {\n\t\t\t\talert(\"Could not stop timer.\");\n\t\t\t} else {\n\t\t\t\t\$(\"#createnewcont\").slideUp();\n\t\t\t\t\$(\"#projecttimercontrol\"+projectid).html(\"<a href=\"//\" onclick=\"projectstarttimer('\"+projectid+\"');return false\"><img src=\"../modules/addons/project_management/images/starttimer.png\" align=\"absmiddle\" border=\"0\" /> Start Tracking Time</a>\");\n\t\t\$(\"#activetimers\").html(data);\n\t\t\t}\n\t\t});\n}\n\nfunction projectpopupcancel() {\n\t\$(\"#createnewcont\").slideUp();\n}\n\n</script>\n\n<div class=\"projectmanagement\">\n\n<div id=\"createnewcont\" style=\"display:none;\">\n\n<div class=\"createnewcont2\">\n\n<div class=\"createnewproject\" id=\"popupcreatenew\" style=\"display:none\">\n<div class=\"title\">Create New Project</div>\n<form id=\"ajaxcreateprojectform\">\n<div class=\"label\">Title</div>\n<input type=\"text\" name=\"title\" class=\"title\" />\n<div class=\"float\">\n<div class=\"label\">Created</div>\n<input type=\"text\" name=\"created\" class=\"datepick\" value=\"" . getTodaysDate() . "\" />\n</div>\n<div class=\"float\">\n<div class=\"label\">Due Date</div>\n<input type=\"text\" name=\"duedate\" class=\"datepick\" value=\"" . getTodaysDate() . "\" />\n</div>\n<div class=\"float\">\n<div class=\"label\">Assigned To</div>\n<select class=\"title\" name=\"adminid\">";
    $code .= "<option value=\"0\">None</option>";
    $result = select_query("tbladmins", "id,firstname,lastname", "", "firstname` ASC,`lastname", "ASC");
    while ($data = mysql_fetch_array($result)) {
        $aid = $data['id'];
        $adminfirstname = $data['firstname'];
        $adminlastname = $data['lastname'];
        $code .= "<option value=\"" . $aid . "\"";
        if ($aid == $adminid) {
            $code .= " selected";
        }
        $code .= ">" . $adminfirstname . " " . $adminlastname . "</option>";
    }
    $code .= "</select>\n</div>\n<div class=\"float\">\n<div class=\"label\">Ticket #</div>\n<input type=\"text\" name=\"ticketnum\" class=\"ticketnum\" value=\"" . $tid . "\" />\n</div>\n<div class=\"clear\"></div>\n<div class=\"float\">\n<div class=\"label\">Associated Client</div>\n<input type=\"hidden\" name=\"userid\" id=\"cpuserid\" /><input type=\"text\" id=\"cpclientname\" value=\"" . $clientname . "\" class=\"title\" onfocus=\"if(this.value=='" . addslashes($clientname) . "')this.value=''\" /> <img src=\"images/icons/delete.png\" alt=\"" . $vars['_lang']['cancel'] . "\" align=\"right\" id=\"clientsearchcancel\" height=\"16\" width=\"16\"><div id=\"cpticketclientsearchresults\" style=\"z-index:2000;\"></div>\n</div>\n<br /><br />\n<div align=\"center\"><input type=\"button\" value=\"Create\" onclick=\"createproject()\" class=\"create\" /> <input type=\"button\" value=\"Cancel\" class=\"create\" onclick=\"projectpopupcancel();return false\" /></div>\n</form>\n</div>\n\n<div class=\"createnewproject\" id=\"popupstarttimer\" style=\"display:none\">\n<div class=\"title\">Start Time Tracking</div>\n<form id=\"ajaxstarttimerform\">\n<input type=\"hidden\" id=\"ajaxstarttimerformprojectid\" name=\"projectid\">\n<input type=\"hidden\" name=\"ticketnum\" value=\"" . $tid . "\" />\n<div class=\"label\">Select Existing Task</div>\n<select class=\"title\" style=\"min-width:450px\" name=\"taskid\">";
    $code .= "<option value=\"\">Choose one...</option>";
    $result = select_query("mod_projecttasks", "mod_project.title, mod_projecttasks.id, mod_projecttasks.projectid, mod_projecttasks.task", array("mod_project.ticketids" => array("sqltype" => "LIKE", "value" => (int) $tid)), "", "", "", "mod_project ON mod_projecttasks.projectid=mod_project.id", "", "", "", "mod_project ON mod_projecttasks.projectid=mod_project.id");
    while ($data = mysql_fetch_array($result)) {
        $code .= "<option value=\"" . $data['id'] . "\"";
        $code .= ">" . $data['projectid'] . " - " . $data['title'] . " - " . $data['task'] . "</option>";
    }
    $code .= "</select><br />\n<div class=\"label\">Or Create New Task</div>\n<input type=\"text\" name=\"title\" class=\"title\" />\n<br />\n<div align=\"center\"><input type=\"button\" value=\"Start\" onclick=\"projectstarttimersubmit();return false\" class=\"create\" /> <input type=\"button\" value=\"Cancel\" class=\"create\" onclick=\"projectpopupcancel();return false\" /></div>\n</form>\n</div>\n</div>\n\n<div class=\"createnewproject\" id=\"popupendtimer\" style=\"display:none\">\n<div class=\"title\">Stop Time Tracking</div>\n<form id=\"ajaxendtimerform\">\n<input type=\"hidden\" id=\"ajaxendtimerformprojectid\" name=\"projectid\">\n<br />\n<b>Active Timers</b>:<br /><br />\n<div id=\"activetimers\">\n";
    $result = select_query("mod_projecttimes", "mod_projecttimes.id, mod_projecttimes.projectid, mod_project.title, mod_projecttimes.taskid, mod_projecttasks.task, mod_projecttimes.start", array("mod_projecttimes.adminid" => $_SESSION['adminid'], "mod_projecttimes.end" => "", "mod_project.ticketids" => array("sqltype" => "LIKE", "value" => (int) $tid)), "", "", "", "mod_projecttasks ON mod_projecttimes.taskid=mod_projecttasks.id INNER JOIN mod_project ON mod_projecttimes.projectid=mod_project.id");
    while ($data = mysql_fetch_array($result)) {
        $code .= "<div class=\"stoptimer" . $data['id'] . "\" style=\"padding-bottom:10px;\"><em>" . $data['title'] . " - Project ID " . $data['projectid'] . "</em><br />&nbsp;&raquo; " . $data['task'] . "<br />Started at " . fromMySQLDate(date("Y-m-d H:i:s", $data['start']), 1) . ":" . date("s", $data['start']) . " - <a href=\"#\" onclick=\"projectendtimersubmit('" . $data['projectid'] . "','" . $data['id'] . "');return false\"><strong>Stop Timer</strong></a></div>";
    }
    $code .= "\n</div>\n<br />\n<div align=\"center\"><input type=\"button\" value=\"Cancel\" class=\"create\" onclick=\"projectpopupcancel();return false\" /></div>\n</form>\n</div>\n\n</div>\n\n</div>\n\n";
    return $code;
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:48,代码来源:hooks.php

示例10: widget_my_notes

function widget_my_notes($vars)
{
    $title = "My Notes";
    $mynotes = get_query_val("tbladmins", "notes", array("id" => $vars['adminid']));
    $content = '
<script>
function widgetnotessave() {
    $.post("index.php", { action: "savenotes", notes: $("#widgetnotesbox").val(), token: "' . generate_token('plain') . '" });
    $("#widgetnotesconfirm").slideDown().delay(2000).slideUp();
}
</script>
<div align="center">
<div id="widgetnotesconfirm" style="display:none;margin:0 0 5px 0;padding:5px 20px;background-color:#DBF3BA;font-weight:bold;color:#6A942C;">Notes Saved Successfully!</div>
<textarea id="widgetnotesbox" style="width:95%;height:100px;">' . $mynotes . '</textarea>
<input type="button" value="Save Notes" onclick="widgetnotessave()" />
</div>
    ';
    return array('title' => $title, 'content' => $content);
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:19,代码来源:my_notes.php

示例11: widget_paypal_addon

/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 * */
function widget_paypal_addon($vars)
{
    $title = "PayPal Overview";
    $params = array();
    $result = select_query("tbladdonmodules", "setting,value", array("module" => "paypal_addon"));
    while ($data = mysql_fetch_array($result)) {
        $params[$data[0]] = $data[1];
    }
    $content = "";
    $adminroleid = get_query_val("tbladmins", "roleid", array("id" => $_SESSION['adminid']));
    if ($params["showbalance" . $adminroleid]) {
        $url = "https://api-3t.paypal.com/nvp";
        $postfields = $resultsarray = array();
        $postfields['USER'] = $params['username'];
        $postfields['PWD'] = $params['password'];
        $postfields['SIGNATURE'] = $params['signature'];
        $postfields['METHOD'] = "GetBalance";
        $postfields['RETURNALLCURRENCIES'] = "1";
        $postfields['VERSION'] = "56.0";
        $result = curlCall($url, $postfields);
        $resultsarray2 = explode("&", $result);
        foreach ($resultsarray2 as $line) {
            $line = explode("=", $line);
            $resultsarray[$line[0]] = urldecode($line[1]);
        }
        $paypalbal = array();
        if (strtolower($resultsarray['ACK']) != "success") {
            $paypalbal[] = "Error: " . $resultsarray['L_LONGMESSAGE0'];
        } else {
            $i = 0;
            while ($i <= 20) {
                if (isset($resultsarray["L_AMT" . $i])) {
                    $paypalbal[] = number_format($resultsarray["L_AMT" . $i], 2, ".", ",") . " " . $resultsarray["L_CURRENCYCODE" . $i];
                }
                ++$i;
            }
        }
        $content .= "<div style=\"margin:10px;padding:10px;background-color:#EFFAE4;text-align:center;font-size:16px;color:#000;\">PayPal Balance: <b>" . implode(" ~ ", $paypalbal) . "</b></div>";
    }
    $content .= "<form method=\"post\" action=\"addonmodules.php?module=paypal_addon\">\n<div align=\"center\" style=\"margin:10px;font-size:16px;\">Lookup PayPal Transaction ID: <input type=\"text\" name=\"transid\" size=\"30\" value=\"" . $_POST['transid'] . "\" style=\"font-size:16px;\" /> <input type=\"submit\" name=\"search\" value=\"Go\" /></div>\n<div align=\"right\"><a href=\"addonmodules.php?module=paypal_addon\">Advanced Search &raquo;</a></div>\n</form>";
    return array("title" => $title, "content" => $content);
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:52,代码来源:hooks.php

示例12: widget_my_notes

function widget_my_notes($vars)
{
    global $_ADMINLANG;
    $title = "My Notes";
    $mynotes = get_query_val("tbladmins", "notes", array("id" => $vars['adminid']));
    $content = '
<script>
function widgetnotessave() {
    $.post("index.php", { action: "savenotes", notes: $("#widgetnotesbox").val(), token: "' . generate_token('plain') . '" });
    $("#widgetnotesconfirm").slideDown().delay(2000).slideUp();
}
</script>
<div id="widgetnotesconfirm" style="display:none;margin:0 0 5px 0;padding:5px 20px;background-color:#DBF3BA;font-weight:bold;color:#6A942C;">Notes Saved Successfully!</div>
<form>
    <textarea id="widgetnotesbox" style="height:100px;" class="form-control">' . $mynotes . '</textarea>
    <div class="widget-footer">
        <input type="reset" value="' . $_ADMINLANG['global']['cancel'] . '" class="btn btn-default btn-sm" /> <input type="button" value="Save Notes" onclick="widgetnotessave()" class="btn btn-info btn-sm" />
    </div>
</form>
    ';
    return array('title' => $title, 'content' => $content);
}
开发者ID:MarcelaGotta,项目名称:Webty,代码行数:22,代码来源:my_notes.php

示例13: paypalexpress_orderformcheckout

function paypalexpress_orderformcheckout($params)
{
    $orderid = get_query_val("tblorders", "id", array("invoiceid" => $params['invoiceid']));
    update_query("tblhosting", array("paymentmethod" => "paypal"), array("orderid" => $orderid, "paymentmethod" => "paypalexpress"));
    update_query("tblhostingaddons", array("paymentmethod" => "paypal"), array("orderid" => $orderid, "paymentmethod" => "paypalexpress"));
    update_query("tbldomains", array("paymentmethod" => "paypal"), array("orderid" => $orderid, "paymentmethod" => "paypalexpress"));
    $finalPaymentAmount = $_SESSION['Payment_Amount'];
    $postfields = array();
    $postfields['TOKEN'] = $_SESSION['paypalexpress']['token'];
    $postfields['PAYERID'] = $_SESSION['paypalexpress']['payerid'];
    $postfields['PAYMENTREQUEST_0_PAYMENTACTION'] = "SALE";
    $postfields['PAYMENTREQUEST_0_AMT'] = $params['amount'];
    $postfields['PAYMENTREQUEST_0_CURRENCYCODE'] = $params['currency'];
    $postfields['IPADDRESS'] = $_SERVER['SERVER_NAME'];
    $results = paypalexpress_api_call($params, "DoExpressCheckoutPayment", $postfields);
    $ack = strtoupper($results['ACK']);
    if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
        $transactionId = $results['PAYMENTINFO_0_TRANSACTIONID'];
        $transactionType = $results['PAYMENTINFO_0_TRANSACTIONTYPE'];
        $paymentType = $results['PAYMENTINFO_0_PAYMENTTYPE'];
        $orderTime = $results['PAYMENTINFO_0_ORDERTIME'];
        $amt = $results['PAYMENTINFO_0_AMT'];
        $currencyCode = $results['PAYMENTINFO_0_CURRENCYCODE'];
        $feeAmt = $results['PAYMENTINFO_0_FEEAMT'];
        $settleAmt = $results['PAYMENTINFO_0_SETTLEAMT'];
        $taxAmt = $results['PAYMENTINFO_0_TAXAMT'];
        $exchangeRate = $results['PAYMENTINFO_0_EXCHANGERATE'];
        $paymentStatus = $results['PAYMENTINFO_0_PAYMENTSTATUS'];
        if ($paymentStatus == "Completed") {
            return array("status" => "success", "transid" => $transactionId, "fee" => $feeAmt, "rawdata" => $results);
        }
        if ($paymentStatus == "Pending") {
            return array("status" => "payment pending", "rawdata" => $results);
        }
        return array("status" => "invalid status", "rawdata" => $results);
    }
    return array("status" => "error", "rawdata" => $results);
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:38,代码来源:paypalexpress.php

示例14: format_as_currency

     $userid = $data['userid'];
     $description = $data['description'];
     $hours = $data['hours'];
     $amount = $data['amount'];
     if ($hours != 0) {
         $amount = format_as_currency($amount / $hours);
     }
     $recur = $data['recur'];
     $recurcycle = $data['recurcycle'];
     $recurfor = $data['recurfor'];
     $invoiceaction = $data['invoiceaction'];
     $invoicecount = $data['invoicecount'];
     $duedate = fromMySQLDate($data['duedate']);
 } else {
     $pagetitle = $aInt->lang("billableitems", "additem");
     $clientcheck = get_query_val("tblclients", "id", "");
     if (!$clientcheck) {
         $aInt->gracefulExit($aInt->lang("billableitems", "noclientsmsg"));
     }
     $invoiceaction = 0;
     $recur = 0;
     $duedate = getTodaysDate();
     $hours = "0.0";
     $amount = "0.00";
     $invoicecount = 0;
     $options = "";
     $result = select_query("tblproducts", "tblproducts.id,tblproducts.gid,tblproducts.name,tblproductgroups.name AS groupname", "", "tblproductgroups`.`order` ASC,`tblproducts`.`order` ASC,`name", "ASC", "", "tblproductgroups ON tblproducts.gid=tblproductgroups.id");
     while ($data = mysql_fetch_array($result)) {
         $pid = $data['id'];
         $pname = $data['name'];
         $ptype = $data['groupname'];
开发者ID:billyprice1,项目名称:whmcs,代码行数:31,代码来源:billableitems.php

示例15: explode

}
$amount = $_REQUEST['amt'];
$callbackvars2 = explode("&amp;", $callbackvars);
foreach ($callbackvars2 as $value) {
    $values[] = explode("=", $value);
}
if ($code == "5") {
    logTransaction("Pay Offline", $orgipn, "Pending");
    exit;
}
if ($transid) {
    checkCbTransID($transid);
}
if ($code == "0") {
    $invoiceid = $values[0][1];
    if ($invoiceid) {
        checkCbInvoiceID($invoiceid, "PayOffline");
        addInvoicePayment($invoiceid, $transid, $amount, "", "payoffline");
        logTransaction("Pay Offline", $_REQUEST, "Successful");
        return 1;
    }
    $userid = $values[2][1];
    $userid = get_query_val("tblclients", "id", array("id" => $userid));
    if (!$userid) {
        logTransaction("Pay Offline", $_REQUEST, "Invoice Not Found");
        return 1;
    }
    insert_query("tblcredit", array("clientid" => $userid, "date" => "now()", "description" => "Pay Offline Transaction ID " . $transid, "amount" => $amount));
    update_query("tblclients", array("credit" => "+=" . $amount), array("id" => $userid));
    logTransaction("Pay Offline", $_REQUEST, "Credit Added");
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:31,代码来源:payoffline.php


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