function form(&$err)
{
    if (isset($_POST)) {
        global $_POST;
    } else {
        return;
    }
    global $db;
    if (sending()) {
        $_SESSION = array();
        if (isset($_POST['flash'])) {
            $flash = ' -flash';
        } else {
            $flash = '';
        }
        if ($list = getlist($_POST['number'])) {
            foreach ($list->numbers as $no) {
                $err->out = Gammu::infiniteSend($_POST['message'], $no, $flash);
                if ($err->out != 0) {
                    $err->numberInError[] = getNameOf($no);
                }
            }
        } else {
            $users = $db->table('directory')->find();
            foreach ($users as $user) {
                if (isset($user->name) and $user->name == $_POST['number']) {
                    $_POST['number'] = $user->number;
                }
            }
            $_POST['number'] = str_replace(' ', '', $_POST['number']);
            $err->out = Gammu::send($_POST['message'], $_POST['number'], $flash);
            if ($err->out != 0) {
                formSetSessionValues();
            }
        }
    } else {
        if (saveContact()) {
            $_POST['number'] = str_replace(' ', '', $_POST['number']);
            $err->in = $db->table('directory')->insert($_POST);
        } else {
            if (saveList()) {
                $list = array("list" => $_POST['list']);
                $i = 1;
                while (isset($_POST['number' . $i])) {
                    if (!empty($_POST['number' . $i])) {
                        if ($number = getNumberOfName($_POST['number' . $i])) {
                            $list['numbers'][] = $number;
                        } else {
                            $list['numbers'][] = $_POST['number' . $i];
                        }
                    }
                    $i++;
                }
                $err->listin = $db->table('lists')->insert($list);
            } else {
                $err->errorMessages();
            }
        }
    }
}
Example #2
0
function popup()
{
    $LIST = getlist();
    $add = Paragraphe("host-file-64-add.png", "{add_new_entry}", "{add_new_entry_text}", "javascript:etc_hosts_add_form()", "{add_new_entry_text}");
    $html = "<p style='font-size:12px'>{etc_hosts_explain}</p>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'><div style='width:100%;height:330px;overflow:auto' id='idhosts'>{$LIST}</div></td>\n\t\t<td valign='top'>{$add}</td>\n\t</tr>\n\t</table>\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body("{$html}");
}
Example #3
0
function popup(){
	$page=CurrentPageName();
	$LIST=getlist();
	$sock=new sockets();
	
	$html="<div class=explain>{etc_hosts_explain}</div>
	
	<div style='text-align:right'>
	<table>
	<tr>
		<td class=legend>{DisableEtcHosts}:</td>
		<td>". Field_checkbox("DisableEtcHosts",1,$sock->GET_INFO("DisableEtcHosts"),"DisableEtcHostsSave()")."</td>
	</tr>
	</table>
	</div>
	
	<table style='width:100%'>
	<tr>
		<td valign='top'><div style='width:100%;height:330px;overflow:auto' id='idhosts'>$LIST</div></td>
		<td valign='top'><div id='add-etc-hosts-p'></div></td>
	</tr>
	</table>
	<script>
	function ParEtcHosts(){
		LoadAjax('add-etc-hosts-p','$page?add-etc-hosts-p=yes');
	}
	
	function idhostsList(){
		LoadAjax('idhosts','$page?refresh=yes');
	
	}
	
	var x_DisableEtcHostsSave=function (obj) {
			tempvalue=obj.responseText;
			if(tempvalue.length>0){alert(tempvalue);}
			ParEtcHosts();
			idhostsList();
	    }
	
	
		function DisableEtcHostsSave(){
		var XHR = new XHRConnection();
		if(document.getElementById('DisableEtcHosts').checked){
			XHR.appendData('DisableEtcHosts','1');}else{
			XHR.appendData('DisableEtcHosts','0');}
			document.getElementById('add-etc-hosts-p').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>';			
			XHR.sendAndLoad('$page', 'GET',x_DisableEtcHostsSave);		
		}
	
	ParEtcHosts();
	</script>
	
	";
	$tpl=new templates();
	echo $tpl->_ENGINE_parse_body("$html");	
	
	
}
Example #4
0
function check_oauth($auth, $id)
{
    include 'sql.php';
    $SQL = "SELECT * FROM oauth WHERE profile_id = {$id}";
    $result = $conn->query($SQL);
    if ($result->num_rows > 0) {
        $row = $result->fetch_assoc();
        if ($row['oauth_key'] == $auth) {
            getlist();
            $conn->close();
        } else {
            $apiResponse = array('status' => 'error', 'statusCode' => 404, 'message' => 'User not found');
            print_r(json_encode($apiResponse));
        }
    }
}
Example #5
0
        return $list;
    }
    //处理分页不同量
    $shownum = 10;
    $webnum = 42;
    $startnum = $page * $shownum - $shownum;
    $endnum = $page * $shownum;
    $qp = ceil($startnum / $webnum);
    $qp = $qp ? $qp : 1;
    $qpcount = $qp * $webnum;
    $list = getlist($type, $qp);
    if ($endnum > $qpcount) {
        $y = $endnum % $webnum;
        $m = $shownum - $y;
        $list = array_values(array_slice($list, $m * -1, $m));
        $t = array_slice(getlist($type, $qp + 1), 0, $y);
        foreach ($t as $value) {
            $list[] = $value;
        }
    } else {
        $y = $endnum % $webnum;
        $list = array_slice($list, $y - $shownum, $shownum);
    }
} else {
    //搜索
    $key = urlencode($_GET['key']);
    $url = "http://searchapi.pptv.com/query/nt?cb=recSearchData&q={$key}";
    $content = get_url_contents($url, 'http://www.pptv.com/');
    $content = substr($content, strpos($content, '(') + 1, -1);
    $json = json_decode($content, true);
    $list = array();
Example #6
0
if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
loadModuleLib('api', 'api');
$page = $_REQUEST['page'];
$pageArr = explode("/", $page);
if (isset($pageArr[2]) && strlen($pageArr[2]) <= 0) {
    unset($pageArr[2]);
}
if (count($pageArr) > 1) {
    $title = end($pageArr);
    $title = explode("-", $title);
    $title = implode(" ", $title);
    //$titleArr=explode("-",$title);
    //$category=end($titleArr);
    $apiCategoryList = getlist($title);
}
?>
<div class="apiContent container-fluid">
	<div class="row">
		<div class="col-lg-12">
			<h1 class="page-header">
					<small><?php 
echo toTitle($category);
?>
 APIs</small>
				</h1>
			<div class="navigation">
				<ul class="list-group linkList">
					<?php 
if (count($apiCategoryList) > 0) {
$extendedPath = $_GET['path'];
$action = $_GET['action'];
$boxDetailsSQL = sprintf("SELECT box.boxid, box.ip, box.login, box.password, box.sshport, srv.path\n\t\t\t\t\t\t\tFROM %sbox box\n\t\t\t\t\t\t\tJOIN %sserver srv ON box.boxid = srv.boxid\n\t\t\t\t\t\t\tJOIN %sgroupMember grpm ON (grpm.groupids LIKE CONCAT(srv.groupid, ';%%')\n\t\t\t\t\t\t\t\t\t\t\t\t\t  OR grpm.groupids LIKE CONCAT('%%;', srv.groupid, ';%%'))\n\n\t\t\t\t\t\t\tWHERE srv.serverid = %d\n\t\t\t\t\t\t\tAND grpm.clientid = %d;", DBPREFIX, DBPREFIX, DBPREFIX, $serverid, $clientid);
$boxDetails = mysql_query($boxDetailsSQL);
$rowsBoxes = mysql_fetch_assoc($boxDetails);
$aes = new Crypt_AES();
$aes->setKeyLength(256);
$aes->setKey(CRYPT_KEY);
$sftp = new Net_SFTP($rowsBoxes['ip'], $rowsBoxes['sshport']);
if (!$sftp->login($rowsBoxes['login'], $aes->decrypt($rowsBoxes['password']))) {
    echo 'Failed to connect';
    die;
}
//ACTION SELECTOR
if ($action == 'list') {
    getlist($rowsBoxes, $extendedPath, $sftp);
}
if ($action == 'fileUpload') {
    fileUpload($rowsBoxes, $extendedPath, $sftp);
}
if ($action == 'delete') {
    delete($rowsBoxes, $extendedPath, $sftp);
}
//ACTION FUNCTIONS
function delete($rowsBoxes, $extendedPath, $sftp)
{
    $remoteFile = dirname($rowsBoxes['path']) . '/' . trim($extendedPath . '/');
    return $sftp->delete($remoteFile, true);
}
function fileUpload($rowsBoxes, $extendedPath, $sftp)
{
Example #8
0
<?php

if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
loadModuleLib('api', 'api');
$page = $_REQUEST['page'];
$pageArr = explode("/", $page);
if (isset($pageArr[2]) && strlen($pageArr[2]) <= 0) {
    unset($pageArr[2]);
}
if (count($pageArr) > 1) {
    $title = end($pageArr);
    $titleArr = explode("-", $title);
    $category = end($titleArr);
    $apiCategoryList = getlist($category);
}
?>
<div class="apiContent container-fluid">
	<div class="row">
		<div class="col-lg-12">
			<h1 class="page-header">
					<small><?php 
echo toTitle($category);
?>
 APIs</small>
				</h1>
			<div class="navigation">
				<ul class="list-group linkList">
					<?php 
if (count($apiCategoryList) > 0) {
Example #9
0
<?php

if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
loadModuleLib('guides', 'api');
if (isset($_REQUEST["action"])) {
    switch ($_REQUEST["action"]) {
        case "fetch-list":
            if (isset($_REQUEST['category'])) {
                $guides_list = getlist($_REQUEST['category']);
                printServiceMsg($guides_list);
            } else {
                printServiceMsg(array());
            }
            break;
        case "fetch-category":
            $guides_cat = getCategory();
            printServiceMsg($guides_cat);
            break;
        case "search-list":
            if (isset($_REQUEST['q'])) {
                $api_list = searchList($_REQUEST['q']);
                printServiceMsg($api_list);
            } else {
                printServiceMsg(array());
            }
            break;
        case "create-guide":
            checkServiceSession();
            $status = saveGuide();
Example #10
0
if (posix_getuid() == 0) {
    die;
}
$user = new usersMenus();
if ($user->AsPostfixAdministrator == false) {
    $tpl = new templates();
    echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . "');";
    die;
    exit;
}
if (isset($_GET["popup"])) {
    popup();
    exit;
}
if (isset($_GET["popup-list"])) {
    getlist();
    exit;
}
if (isset($_GET["delete"])) {
    DELETE();
    exit;
}
js();
function js()
{
    $tpl = new templates();
    $title = $tpl->_ENGINE_parse_body("{POSTFIX_MULTI_INSTANCE_INFOS}");
    $ask_perform_operation_delete_item = $tpl->_ENGINE_parse_body("{ask_perform_operation_delete_item}");
    $page = CurrentPageName();
    $start = "POSTFIX_MULTI_INSTANCE_INFOS_START()";
    $html = "\n\tfunction POSTFIX_MULTI_INSTANCE_INFOS_START(){\n\t\tYahooWin('550','{$page}?popup=yes','{$title}');\n\t}\n\t\n\tfunction POSTFIX_MULTI_INSTANCE_INFOS_LIST(){\n\t\tLoadAjax('multiples-instances-list','{$page}?popup-list=yes');\n\t}\n\t\n\tvar X_POSTFIX_MULTI_INSTANCE_INFOS_DEL= function (obj) {\n\t var results=obj.responseText;\n\t if(results.length>1){alert(results);}\n\t POSTFIX_MULTI_INSTANCE_INFOS_LIST();\n\t}\t\n\t\n\tfunction POSTFIX_MULTI_INSTANCE_INFOS_DEL(ou,ip){\n\t\tif(confirm('{$ask_perform_operation_delete_item}\\n'+ou+'('+ip+')')){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tXHR.appendData('delete','yes');\n\t\t\t\tXHR.appendData('ou',ou);\n\t\t\t\tXHR.appendData('ip',ip);\n\t\t\t\tdocument.getElementById('multiples-instances-list').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\t\t\t\tXHR.sendAndLoad('{$page}', 'GET',X_POSTFIX_MULTI_INSTANCE_INFOS_DEL);\t\n\t\t}\n\t\n\t}\n\t\n\t{$start};\n\t";
Example #11
0
<?php

checkLogin();
$res = getlist('category', 0, 100, '*', 'pid=0');
if (!empty($_POST)) {
    $res = insert('category', $_POST);
    if (!empty($res)) {
        header('Location:' . ROOT . 'index.php?c=category&a=index&admin=1');
    } else {
        die('修改失败');
    }
}
view(array('res' => $res));
function print_scripts($id, $container, $language, $style, $views, $buttons, $edition, $sample, $otherparamsvalue, $palette, $viewdefault, $numberOfMonths, $start_weekday, $notPlugin, $matches)
{
    global $JC_JQUERY_SPECIAL;
    $mainframe = JFactory::getApplication();
    $msg = "";
    if ($id == -1) {
        $user =& JFactory::getUser();
        $db =& JFactory::getDBO();
        $db->setQuery('SELECT * FROM #__dc_mv_calendars where owner=' . $user->id);
        $rows1 = $db->loadObjectList();
        if (count($rows1) > 0) {
            $id = $rows1[0]->id;
        } else {
            $id = "none";
            $msg = "No calendar found for this user";
        }
    }
    if (!is_numeric($id) && $msg == "") {
        $msg = "No calendar found";
    }
    if ($msg == "") {
        $document =& JFactory::getDocument();
        if (JC_JQUERY_MV) {
            $document->addScript("components/com_multicalendar/DC_MultiViewCal/js/jquery-1.7.2.min.js");
        }
        if (JC_JQUERY_UI_MV) {
            $document->addScript("components/com_multicalendar/DC_MultiViewCal/js/jquery-ui-1.8.20.custom.min.js");
        }
        if (count($JC_JQUERY_SPECIAL) > 0) {
            for ($i = 0; $i < count($JC_JQUERY_SPECIAL); $i++) {
                if (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off") {
                    $JC_JQUERY_SPECIAL[$i] = str_replace("http://", "https://", $JC_JQUERY_SPECIAL[$i]);
                }
                $document->addScript($JC_JQUERY_SPECIAL[$i]);
            }
        }
        $document->addScript("components/com_multicalendar/DC_MultiViewCal/src/Plugins/underscore.js");
        $document->addScript("components/com_multicalendar/DC_MultiViewCal/src/Plugins/rrule.js");
        $document->addScript("components/com_multicalendar/DC_MultiViewCal/src/Plugins/Common.js");
        if (file_exists("components/com_multicalendar/DC_MultiViewCal/language/multiview_lang_" . $language . ".js")) {
            $document->addScript("components/com_multicalendar/DC_MultiViewCal/language/multiview_lang_" . $language . ".js");
        } else {
            $document->addScript("components/com_multicalendar/DC_MultiViewCal/language/multiview_lang_en-GB.js");
        }
        $document->addScript("components/com_multicalendar/DC_MultiViewCal/src/Plugins/jquery.calendar.js");
        $document->addScript("components/com_multicalendar/DC_MultiViewCal/src/Plugins/jquery.alert.js");
        $document->addScript("components/com_multicalendar/DC_MultiViewCal/src/Plugins/multiview.js");
        if (file_exists("components/com_multicalendar/DC_MultiViewCal/css/" . $style . "/calendar.css")) {
            $document->addStyleSheet("components/com_multicalendar/DC_MultiViewCal/css/" . $style . "/calendar.css");
        } else {
            $document->addStyleSheet("components/com_multicalendar/DC_MultiViewCal/css/cupertino/calendar.css");
        }
        $document->addStyleSheet("components/com_multicalendar/DC_MultiViewCal/css/main.css");
        if (!$notPlugin) {
            if (!function_exists('getvalues')) {
                function getvalues($param, $ar)
                {
                    if (!is_array($param)) {
                        $param = array();
                    }
                    for ($i = 0; $i < count($ar); $i++) {
                        if (count($param) <= $i || $param[$i] != $ar[$i]) {
                            array_splice($param, $i, 0, "false");
                        } else {
                            $param[$i] = "true";
                        }
                    }
                    return $param;
                }
            }
            $view = getvalues($views, array("viewDay", "viewWeek", "viewMonth", "viewNMonth", "viewList"));
            $buttons = getvalues($buttons, array("btoday", "bnavigation", "brefresh"));
            $edition = $edition == "1" ? "true" : "false";
            $nmonths = $sample;
            if ($nmonths[0] != '1') {
                array_splice($nmonths, 0, 0, "false");
            } else {
                $nmonths[0] = "true";
            }
            if ($nmonths[1] != 'mouseover') {
                $nmonths[1] = 1;
            } else {
                $nmonths[1] = 0;
            }
            if ($nmonths[2] != '1') {
                array_splice($nmonths, 2, 0, "false");
            } else {
                $nmonths[2] = "true";
            }
            if ($nmonths[1] == 1) {
                $nmonths[2] = "false";
            }
            if ($nmonths[4] != 'new_window') {
                $nmonths[4] = 1;
            } else {
                $nmonths[4] = 0;
            }
        } else {
            $view = array();
            $view[] = (int) $matches[2][0] == 1 ? "true" : "false";
            $view[] = (int) $matches[2][1] == 1 ? "true" : "false";
            $view[] = (int) $matches[2][2] == 1 ? "true" : "false";
            $view[] = (int) $matches[2][3] == 1 ? "true" : "false";
            $view[] = (int) $matches[2][4] == 1 ? "true" : "false";
            $buttons = array();
            $buttons[] = (int) $matches[7][0] == 1 ? "true" : "false";
            $buttons[] = (int) $matches[7][1] == 1 ? "true" : "false";
            $buttons[] = (int) $matches[7][2] == 1 ? "true" : "false";
            $edition = $edition == "1" ? "true" : "false";
            $nmonths = array();
            $nmonths[] = (int) $matches[9] == 1 ? "true" : "false";
            $nmonths[] = (string) $matches[10] != "mouseover" ? "1" : "0";
            $nmonths[] = (int) $matches[11] == 1 ? "true" : "false";
            $nmonths[] = $matches[13];
            $nmonths[] = (string) $matches[12] != "new_window" ? "1" : "0";
        }
        $otherparams = trim($otherparamsvalue);
        $otherparams = str_replace("\n", "", $otherparams);
        $otherparams = str_replace("\r", "", $otherparams);
        $newp = "";
        if ($otherparams != "") {
            $p = explode(",", $otherparams);
            for ($i = 0; $i < count($p); $i++) {
                if (trim($p[$i]) != "") {
                    $newp .= ", " . $p[$i];
                }
            }
        }
        $user =& JFactory::getUser();
        $db =& JFactory::getDBO();
        $db->setQuery('SELECT * FROM #__dc_mv_calendars where id=' . $id);
        $rows = $db->loadObjectList();
        if (count($rows) > 0) {
            $p = explode(";", $rows[0]->permissions);
            if (isValid($p[0], $p[1], $user->getAuthorisedGroups(), $user->id)) {
                $newp .= ", userAdd:true";
            } else {
                $newp .= ", userAdd:false";
            }
            if (isValid($p[2], $p[3], $user->getAuthorisedGroups(), $user->id)) {
                $newp .= ", userEdit:true";
            } else {
                $newp .= ", userEdit:false";
            }
            if (isValid($p[4], $p[5], $user->getAuthorisedGroups(), $user->id)) {
                $newp .= ", userDel:true";
            } else {
                $newp .= ", userDel:false";
            }
            if (isValidOwner($p[2])) {
                $newp .= ", userEditOwner:true";
            } else {
                $newp .= ", userEditOwner:false";
            }
            if (isValidOwner($p[4])) {
                $newp .= ", userDelOwner:true";
            } else {
                $newp .= ", userDelOwner:false";
            }
            $newp .= ", userOwner:" . $user->id . "";
        }
        $db->setQuery("select * from #__dc_mv_configuration where id=1");
        $configuration = $db->loadObjectList();
        $administration = unserialize($configuration[0]->administration);
        $palettes = unserialize($configuration[0]->palettes);
        if (count($palettes) > $palette) {
            $newp .= ", palette:" . $palette . "";
            $newp .= ", paletteDefault:\"" . $palettes[$palette]["default"] . "\"";
        }
        $document->addScriptDeclaration(getlist("dc_subjects", $rows[0]->subjectlist, $administration["subjectlist"]) . getlist("dc_locations", $rows[0]->locationlist, $administration["locationlist"]));
        $p = parse_url(JURI::root());
        if (strlen($p["path"]) > 0 && $p["path"][strlen($p["path"]) - 1] == "/") {
            $p["path"] = substr($p["path"], 0, strlen($p["path"]) - 1);
        }
        $path = $p["path"];
        $showtooltipdwm_mouseover = "false";
        $showtooltipdwm = "false";
        if ($nmonths[0] == 'true') {
            if ($nmonths[1] != 1) {
                $showtooltipdwm_mouseover = 'true';
            } else {
                $showtooltipdwm = 'true';
            }
        }
        $document->addScriptDeclaration("initMultiViewCal(\"" . $container . "\"," . $id . ",{viewDay:" . $view[0] . ",viewWeek:" . $view[1] . ",viewMonth:" . $view[2] . ",viewNMonth:" . $view[3] . ",viewList:" . $view[4] . ",viewdefault:\"" . $viewdefault . "\",numberOfMonths:" . $numberOfMonths . ",showtooltip:" . $nmonths[0] . ",tooltipon:" . $nmonths[1] . ",shownavigate:" . $nmonths[2] . ",url:\"" . $nmonths[3] . "\",target:" . $nmonths[4] . ",showtooltipdwm_mouseover:" . $showtooltipdwm_mouseover . ",showtooltipdwm:" . $showtooltipdwm . ",start_weekday:" . $start_weekday . ",language:\"" . $language . "\",cssStyle:\"" . $style . "\",edition:" . $edition . ",btoday:" . $buttons[0] . ",bnavigation:" . $buttons[1] . ",brefresh:" . $buttons[2] . ",bnew:" . $edition . ",path:\"" . $path . "/\"" . $newp . "});");
    }
    return $msg;
}
Example #13
0
function listing_page($message = null)
{
    global $self, $directory, $sort, $reverse;
    html_header();
    $list = getlist($directory);
    if (array_key_exists('sort', $_GET)) {
        $sort = $_GET['sort'];
    } else {
        $sort = 'filename';
    }
    if (array_key_exists('reverse', $_GET) && $_GET['reverse'] == 'true') {
        $reverse = true;
    } else {
        $reverse = false;
    }
    $list = sortlist($list, $sort, $reverse);
    echo '<h1 style="margin-bottom: 0">Web File Browser (webadmin.php)</h1>

<form enctype="multipart/form-data" action="' . $self . '" method="post">

<table id="main">
';
    directory_choice();
    if (!empty($message)) {
        spacer();
        echo $message;
    }
    if (@is_writable($directory)) {
        upload_box();
        create_box();
    } else {
        spacer();
    }
    if ($list) {
        listing($list);
    } else {
        echo error('not_readable', $directory);
    }
    echo '</table>

</form>

';
    html_footer();
}
Example #14
0
</div>

<div class="container-fluid bg-3 text-center">
   <head>
        <meta charset="utf-8">
        <title>jQuery UI Autocomplete - Default functionality</title>
        <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
        <!-- <script src="//code.jquery.com/jquery-1.10.2.js"></script> -->
        <script src="//code.jquery.com/jquery-1.9.1.js"></script>
       <!--  // <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> -->
        <script src="//code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
        <script>
            $(function() {
                //console.log("hey");
                var obj = '<?php 
echo json_encode(getlist());
?>
';
                var items = JSON.parse(obj);
                var availableTags = items;
                $( "#tags" ).autocomplete({
                    source: availableTags
                });
            });
            $(document).ready(function () {
            $('#tags').on('change', function () {
                $('#tagsname').html('You selected: ' + this.value);
            }).change();
            $('#tags').on('autocompleteselect', function (e, ui) {
                $('#tagsname').html('You selected: ' + ui.item.value);
                var songname = ui.item.value;
Example #15
0
<?php

checkLogin();
$pid = $_GET['pid'] >= 0 ? $_GET['pid'] : die('非法id');
$res = getlist('category', 0, 100, '*', 'pid=' . $pid);
echo json_encode($res);
return false;
Example #16
0
<?php

if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
loadModuleLib('api', 'api');
if (isset($_REQUEST["action"])) {
    switch ($_REQUEST["action"]) {
        case "fetch-list":
            if (isset($_REQUEST['category'])) {
                $api_list = getlist($_REQUEST['category']);
                printServiceMsg($api_list);
            } else {
                printServiceMsg(array());
            }
            break;
        case "fetch-category":
            $api_cat = getCategory();
            printServiceMsg($api_cat);
            break;
        case "search-list":
            if (isset($_REQUEST['q'])) {
                $api_list = searchList($_REQUEST['q']);
                printServiceMsg($api_list);
            } else {
                printServiceMsg(array());
            }
            break;
        case "create-api":
            checkServiceSession();
            $status = saveApi();
?>
Admin',-1);
		}
		if (pressbutton=='listMulti') {
			YAHOO.DC.MultiCalendar.showEventlist('<?php 
echo $id;
?>
','cal<?php 
echo $id;
?>
Admin',1);
		}
		return false;
	}
	<?php 
echo getlist("dc_subjects", $rows[0]->subjectlist, isset($admin["subjectlist"]) ? $admin["subjectlist"] : "") . getlist("dc_locations", $rows[0]->locationlist, isset($admin["locationlist"]) ? $admin["locationlist"] : "");
?>
	
</script>
<?php 
if (JC_JQUERY_MV) {
    ?>
<script language='JavaScript' type='text/javascript' src='../components/com_multicalendar/DC_MultiViewCal/js/jquery-1.7.2.min.js'></script>
<script language='JavaScript' type='text/javascript' src='../components/com_multicalendar/DC_MultiViewCal/js/jquery-ui-1.8.20.custom.min.js'></script>
<?php 
} else {
    for ($i = 0; $i < count($JC_JQUERY_SPECIAL); $i++) {
        if (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off") {
            $JC_JQUERY_SPECIAL[$i] = str_replace("http://", "https://", $JC_JQUERY_SPECIAL[$i]);
        }
        echo "<script language='JavaScript' type='text/javascript' src='" . $JC_JQUERY_SPECIAL[$i] . "'></script>";
    if (!empty($DATE)) {
        if ($datefile = fopen("transmission-rss-" . $hash . ".date", "w")) {
            fwrite($datefile, $DATE);
            fclose($datefile);
        }
    }
} elseif (preg_match("/^\\-\\-torrent=([0-9]+)/", $args[1], $reg) && ($task = $reg[1]) && !empty($args[2]) && preg_match("/^\\-\\-((no\\-)?get|priority\\-(high|low|normal))\\-all\$/", $args[2], $reg) && ($command = $reg[1])) {
    if ($tasks = getlist()) {
        if ($out = command($args[1] . " --files")) {
            if (preg_match("/\\(([0-9]+) files\\):\$/", $out[0], $reg)) {
                command($args[1] . " --" . $command . "=" . implode(",", range(0, $reg[1] - 1)), !empty($tasks[$task]) ? $tasks[$task]["Name"] : "");
            }
        }
    }
} elseif (preg_match("/^\\-\\-list\\-format=(.+)\$/", $args[1], $reg)) {
    if ($tasks = getlist()) {
        foreach ($tasks as $id => $task) {
            echo preg_replace("/\\{(.+)\\}/eU", '(isset ($task["$1"]) ? $task["$1"] : null)', preg_replace("/\\\\t/", "\t", $reg[1])) . "\n";
        }
    }
} else {
    unset($_SERVER["argv"][0]);
    array_walk($_SERVER["argv"], create_function('&$arg, $dummy', 'if (preg_match ("/[^a-z0-9=\\-]/", $arg)) $arg = escapeshellarg ($arg);'));
    echo implode("\n", command(implode(" ", $_SERVER["argv"]), in_array($args[1], array("--help", "--list")) ? false : "")) . "\n";
    if ($args[1] == "--help") {
        echo "\n";
        echo str_pad("  --add-rss", 50) . "+  Watch RSS feed by url, auto add new entries\n";
        echo str_pad("  --get-all", 50) . "+  Mark ALL files for download\n";
        echo str_pad("  --no-get-all", 50) . "+  Mark ALL files for not downloading\n";
        foreach (array("high", "normal", "low") as $val) {
            echo str_pad("  --priority-" . $val . "-all", 50) . "+  Set ALL files' priorities as " . $val . "\n";
Example #19
0
<?php

if (!defined('ROOT')) {
    exit('No direct script access allowed');
}
loadModuleLib('guides', 'api');
$page = $_REQUEST['page'];
$pageArr = explode("/", $page);
if (isset($pageArr[2]) && strlen($pageArr[2]) <= 0) {
    unset($pageArr[2]);
}
if (count($pageArr) > 1) {
    $title = end($pageArr);
    $titleArr = explode("-", $title);
    $type = end($titleArr);
    $guideCategoryList = getlist($type);
}
?>
<div class="apiContent container-fluid">
	<div class="row">
		<div class="col-lg-12">
			<h1 class="page-header">
					<small><?php 
echo toTitle($title);
?>
 Guides</small>
				</h1>
			<div class="navigation linkList">
				<ul class="list-group">
					<?php 
if (count($guideCategoryList) > 0) {
            Display::display_normal_message(api_utf8_encode(get_lang('DocDeleteError')));
        }
    }
    if (isset($_POST['action'])) {
        switch ($_POST['action']) {
            case 'delete':
                foreach ($_POST['path'] as $index => $path) {
                    DocumentManager::delete_document($_course, $path, $base_work_dir);
                }
                Display::display_normal_message(api_utf8_encode(get_lang('DocDeleted')));
                break;
        }
    }
}
/*	GET ALL DOCUMENT DATA FOR CURDIRPATH */
$docs_and_folders = getlist($base_work_dir . '/');
if ($docs_and_folders) {
    //create a sortable table with our data
    $sortable_data = array();
    while (list($key, $id) = each($docs_and_folders)) {
        // Skip directories.
        if ($id['filetype'] != 'file') {
            continue;
        }
        $row = array();
        //if the item is invisible, wrap it in a span with class invisible
        $invisibility_span_open = $id['visibility'] == 0 ? '<span class="invisible">' : '';
        $invisibility_span_close = $id['visibility'] == 0 ? '</span>' : '';
        //size (or total size of a directory)
        $size = $id['filetype'] == 'folder' ? get_total_folder_size($id['path'], $is_allowed_to_edit) : $id[size];
        //get the title or the basename depending on what we're using
Example #21
0
File: getPp.php Project: xtzlyp/Api
<?php

/*
*获取品牌字符串
*http://www.nz86.com/brands/p286/(p1-p286)
*by xtz
*287
*/
require_once 'function.php';
$start = 90;
for ($i = $start; $i < $start + 20; $i++) {
    $url = 'http://www.nz86.com/brands/p' . $i . '/';
    getlist($url);
}
function getlist($url)
{
    $content = httpGet($url);
    $p = '/<span class=\\"tit\\">(.*?)<\\/span>/is';
    preg_match_all($p, $content, $arr);
    if ($arr[1]) {
        foreach ($arr[1] as $k => $v) {
            $pre = trim($v);
            $st = explode('title="', $pre);
            $st = explode('">', $st[1]);
            echo trim($st[0]) . '
';
        }
    }
}
Example #22
0
        $size = fread4($f);
        $offset = fread4($f);
        $name_data = fread($f, 0x200);
        list($name) = explode("", mb_convert_encoding($name_data, 'utf-8', 'UTF-16LE'), 2);
        $list[] = $name;
    }
    return $list;
}
if (!file_exists('data_t.jp.pac')) {
    copy('data_t.pac', 'data_t.jp.pac');
}
$count = 0;
$list = array();
$pos = 0;
//foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator('data')) as $filename => $cur) {
foreach (getlist() as $filename) {
    if (preg_match('/(keyRec|sound)/', $filename)) {
        continue;
    }
    $filename = str_replace('\\', '/', $filename);
    $size = filesize($filename);
    $list[] = array($filename, $pos, $size);
    $pos += $size;
    $count++;
    //echo "$filename\n";
}
$data_size = $pos;
$f = fopen('data_t.pac', 'wb');
$header_size = 4 + 4 + (4 + 4 + 0x200) * $count;
fwrite($f, pack('VV', $count, $header_size + $data_size));
foreach ($list as $n => $file) {
Example #23
0
        return $list;
    }
    //处理分页不同量
    $shownum = 10;
    $webnum = 30;
    $startnum = $page * $shownum - $shownum;
    $endnum = $page * $shownum;
    $qp = ceil($startnum / $webnum);
    $qp = $qp ? $qp : 1;
    $qpcount = $qp * $webnum;
    $list = getlist($videoid, $type, $qp);
    if ($endnum > $qpcount) {
        $y = $endnum % $webnum;
        $m = $shownum - $y;
        $list = array_values(array_slice($list, $m * -1, $m));
        $t = array_slice(getlist($videoid, $type, $qp + 1), 0, $y);
        foreach ($t as $value) {
            $list[] = $value;
        }
    } else {
        $y = $endnum % $webnum;
        $list = array_slice($list, $y - $shownum, $shownum);
    }
} else {
    //搜索
    $key = urlencode($_GET['key']);
    $url = "http://suggest.video.iqiyi.com/?key={$key}";
    $content = get_url_contents($url, 'http://www.iqiyi.com/');
    //$content = substr($content, strpos($content, '(') + 1, - 1);
    $json = json_decode($content, true);
    $list = array();
Example #24
0
function listing_page ($message = null) {
	global $self, $directory, $sort, $reverse;
	html_header();
	$list = getlist($directory);
	if (array_key_exists('sort', $_GET)) $sort = $_GET['sort']; else $sort = 'filename';
	if (array_key_exists('reverse', $_GET) && $_GET['reverse'] == 'true') $reverse = true; else $reverse = false;
	sortlist($list, $sort, $reverse);
	echo '
<form enctype="multipart/form-data" action="' . $self . '?tool=Files" method="post">
<table id="main">
';
	directory_choice();
	if (!empty($message)) {
		spacer();
		echo $message;
	}
	if (@is_writable($directory)) {
		upload_box();
		create_box();
	} else {
		spacer();
	}
	if ($list) {
		listing($list);
	} else {
		echo error('not_readable', $directory);
	}
	echo '</table>
</form>
';
	html_footer();
}
Example #25
0
    }
    $links[0]['text'] = '查看发送记录';
    $links[0]['href'] = 'data_sms.php?act=list';
    sys_msg('发送成功', '', $links);
} elseif ($act == 'list') {
    $list = getlist();
    $smarty->assign('list', $list['list']);
    $smarty->assign('page_count', $list['page_count']);
    $smarty->assign('record_count', $list['record_count']);
    $smarty->assign('filter', $list['filter']);
    $smarty->assign('full_page', 1);
    $smarty->assign('ur_here', '短信发送记录');
    $smarty->assign('action_link', array('href' => '?act=addSms', 'text' => '发送短信'));
    $smarty->display('data_sms_list.html');
} elseif ($act == 'query') {
    $list = getlist();
    $smarty->assign('record_count', $list['record_count']);
    $smarty->assign('page_count', $list['page_count']);
    $smarty->assign('filter', $list['filter']);
    $smarty->assign('list', $list['list']);
    make_json_result($smarty->fetch('data_sms_list.html'), '', array('filter' => $list['filter'], 'page_count' => $list['page_count']));
} elseif ($act == 'acceptSms') {
} elseif ($act == 'delete') {
    $id = $_REQUEST['id'];
    $sql = "delete from send_sms where id={$id} limit 1";
    $db_write->query($sql);
    $url = 'data_sms.php?act=query&' . str_replace('act=delete', '', $_SERVER['QUERY_STRING']);
    los_header("Location:{$url}\n");
}
/**
 * 发送短信