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


PHP ValidArr函数代码示例

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


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

示例1: ExportCsv

function ExportCsv($DataArr, $Separator = ";", $NamesArr = false, $Expanded = false)
{
    $Export = "";
    if (ValidArr($NamesArr)) {
        foreach ($NamesArr as $i => $Row) {
            $NamesArr[$i] = CsvPrepare($NamesArr[$i], $Separator);
        }
        $Export .= implode($Separator, $NamesArr);
        $Export .= "\n";
    }
    foreach ($DataArr as $i => $Row) {
        $TmpArr = array();
        foreach ($NamesArr as $Key => $SubRow) {
            $Str = "";
            $KeyArr = array();
            $KeyArr = explode("|", $Key);
            if (!$Expanded) {
                $KeyArr = array_slice($KeyArr, 0, 1);
            }
            for ($z = 0; $z < count($KeyArr); $z++) {
                if (!ValidVar($KeyArr[$z])) {
                    continue;
                }
                if ($z > 0) {
                    $Str .= " (";
                }
                $Str .= $Row[$KeyArr[$z]];
                if ($z > 0) {
                    $Str .= ")";
                }
            }
            $TmpArr[] = CsvPrepare($Str, $Separator);
        }
        $Export .= implode($Separator, $TmpArr);
        $Export .= "\n";
    }
    return $Export;
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:38,代码来源:export_csv.inc.php

示例2: getURL

<?php

include $nsTemplate->Inc("inc/header");
include $nsTemplate->Inc("inc/submenu");
if (ValidArr($UsersArr) || ValidArr($AgentsArr)) {
    ?>



<table class=ListTable>

<?php 
    if ($nsProduct->LICENSE != 3) {
        ?>

	<?php 
        for ($i = 0; $i < count($AgentsArr); $i++) {
            $Row = $AgentsArr[$i];
            ?>

		<tr>
		<td class=<?php 
            echo $Row->_STYLE;
            ?>
>
		<table width=100% cellpadding=0 cellspacing=0 border=0>
		<tr><td width=100%><p>


		<B><a href="<?php 
            echo getURL("agents", "EditUid=" . $Row->ID);
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.users.php

示例3: foreach

				</select>
				&nbsp;
			<?php 
            } else {
                ?>
				<input type=hidden name=ForClient value=<?php 
                echo $nsUser->COMPANY_ID;
                ?>
>
			<?php 
            }
            ?>

			<span ID="SiteSelect">
			<?php 
            if ($ForClient && ValidArr($ClientsArr[$ForClient]['Sites']) && count($ClientsArr[$ForClient]['Sites']) > 0) {
                ?>
				<select  name=SiteId>
				<option value="all" style="background:#d0d0d0;"><?php 
                echo $Lang['DeleteAll'];
                ?>
</option>
				<?php 
                foreach ($ClientsArr[$ForClient]['Sites'] as $CSite => $Name) {
                    ?>
					<option value=<?php 
                    echo $CSite;
                    ?>
 <?php 
                    echo $CSite == $SiteId ? "selected" : "";
                    ?>
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.base_stat.php

示例4: GetFORM

<?php

include $nsTemplate->Inc("inc/header");
include $nsTemplate->Inc("inc/submenu");
?>

<?php 
if (ValidArr($CompArr) && count($CompArr) > 1) {
    ?>
	<div class=FormDiv>
	<?php 
    GetFORM();
    ?>
	<input type=hidden name=Mode value=<?php 
    echo $Mode;
    ?>
>
	<table width=100%>
	<tr><td class=FormHeader>
	<B style="color:#000000"><?php 
    echo $Lang['SIChooseClient'];
    ?>
</B>&nbsp;<select name=SelectCpId>
	<option></option>
	<?php 
    for ($i = 0; $i < Count($CompArr); $i++) {
        ?>
	<option value=<?php 
        echo $CompArr[$i]->ID;
        ?>
 <?php 
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.for_my_sale_items.php

示例5:

<?php

include $nsTemplate->Inc("inc/header");
include $nsTemplate->Inc("inc/submenu");
if (ValidArr($InCampArr) && count($InCampArr) > 0) {
    include $nsTemplate->Inc("admin.sub_camp_list");
} else {
    include $nsTemplate->Inc("inc/no_records");
}
include $nsTemplate->Inc("inc/footer");
开发者ID:juliogallardo1326,项目名称:proc,代码行数:10,代码来源:admin.incampaign.php

示例6: DeleteFromMy

    if (ValidId($MyDeleteId) && $Mode == "visitor_grps") {
        DeleteFromMy($MyDeleteId, "VISITOR_GRP_ID");
    }
    if (ValidArr($AddToMy) && $Mode == "actions") {
        AddToMy($AddToMy, "ACTION_ID");
    }
    if (ValidId($MyDeleteId) && $Mode == "actions") {
        DeleteFromMy($MyDeleteId, "ACTION_ID");
    }
    if (ValidArr($AddToMy) && $Mode == "action_items") {
        AddToMy($AddToMy, "ACTION_ITEM_ID");
    }
    if (ValidId($MyDeleteId) && $Mode == "action_items") {
        DeleteFromMy($MyDeleteId, "ACTION_ITEM_ID");
    }
    if (ValidArr($AddToMy) && $Mode == "sale_items") {
        AddToMy($AddToMy, "SALE_ITEM_ID");
    }
    if (ValidId($MyDeleteId) && $Mode == "sale_items") {
        DeleteFromMy($MyDeleteId, "SALE_ITEM_ID");
    }
}
/////////////////////////////////////////////
///////// display section here
///////////////////////
if ($Mode == "list") {
    $Query = "\n\t\tSELECT UR.*, C.NAME AS COMP_NAME\n\t\tFROM " . PFX . "_tracker_watch W\n\t\tINNER JOIN  " . PFX . "_tracker_user_report UR\n\t\t\tON UR.ID=W.REPORT_ID\n\t\tINNER JOIN " . PFX . "_tracker_client C\n\t\t\tON C.ID=UR.COMPANY_ID\n\t\tWHERE W.USER_ID=" . $nsUser->UserId() . " \n\t\tORDER BY C.NAME, UR.NAME\n\t";
    $Sql = new Query($Query);
    $Sql->ReadSkinConfig();
    $UserReports = array();
    while ($Row = $Sql->Row()) {
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.my_tracker.php

示例7: GetStat


//.........这里部分代码省略.........
                 $Tmp = $this->GrpFld;
                 $Grp = $Row->{$Tmp};
             } else {
                 $Grp = $Sql->Position;
             }
             if ($this->GrpName) {
                 $Name = $this->GrpName;
                 $StatArr[$Grp]['Name'] = $Row->{$Name};
             }
             $StatArr[$Grp]['CntClick'] = $Row->CNT;
             $StatArr[$Grp]['UniClick'] = $Row->UNI;
             $StatArr[$Grp]['CntAction'] = 0;
             $StatArr[$Grp]['UniAction'] = 0;
             $StatArr[$Grp]['CntSale'] = 0;
             $StatArr[$Grp]['UniSale'] = 0;
             $StatArr[$Grp]['Income'] = 0;
             $StatArr[$Grp]['Obj'] = $Row;
             if (count($this->GroupArr)) {
                 $GrpItems[] = $Grp;
             }
         }
         if (count($GrpItems) > 0 && !ValidId($this->GroupArr[0])) {
             $GrpList = "AND " . $this->GroupArr[0] . " IN (" . implode(",", $GrpItems) . ")";
         }
     }
     ///////////////////////////////////////////
     if ($this->ShowActions) {
         $Query = "\n\t\t\t\tSELECT  {$StraightStr}\n\t\t\t\t\t{$SelectStr}\n\t\t\t\t\tCOUNT(S_LOG.ID) CNT,\n\t\t\t\t\tCOUNT(DISTINCT S_LOG.VISITOR_ID) UNI\n\t\t\t\t\t# выбираем точки входа из лога\n\t\t\t\t\tFROM " . PFX . "_tracker_" . $this->CpId . "_stat_log S_LOG\n\t\t\t\t\t# присоединяем ту ветку, которая произошла от S_LOG.ID\n\t\t\t\t\t# по принципу, что в COOKIE_LOG хранится этот самый ID\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_log NODE\n\t\t\t\t\t\tON NODE.COOKIE_LOG=S_LOG.ID\n\t\t\t\t\t# присоединяем таблицу действий\n\t\t\t\t\t# только к выбранным веткам\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_action S_ACTION\n\t\t\t\t\t\tON S_ACTION.LOG_ID=NODE.ID\n\t\t\t\t\t# точки входа определяются путями по сайту\n\t\t\t\t\t# вероятно, с наличием referer set \n\t\t\t\t\t#JOIN " . PFX . "_tracker_stat_path S_PATH\n\t\t\t\t\t#\tON S_PATH.LOG_ID=S_LOG.ID\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_split S_SPLIT\n\t\t\t\t\t\tON S_SPLIT.LOG_ID=S_LOG.ID\n\t\t\t\t{$JoinStr}\n\t\t\t\t{$WhereStr}\n\t\t\t\t{$GrpList}\n\t\t\t\t{$GroupStr}\n\t\t\t\t{$OrderStr}\n\t\t\t\t{$LimitStr}\n\t\t\t";
         //echo HLSQL($Query);
         $Sql = new Query($Query);
         while ($Row = $Sql->Row()) {
             if ($this->GrpFld) {
                 $Tmp = $this->GrpFld;
                 $Grp = $Row->{$Tmp};
             } else {
                 $Grp = $Sql->Position;
             }
             if (!isset($StatArr[$Grp]) && $this->ShowVisitors) {
                 continue;
             }
             if (!$this->ShowVisitors) {
                 if ($this->GrpName) {
                     $Name = $this->GrpName;
                     $StatArr[$Grp]['Name'] = $Row->{$Name};
                 }
             }
             $StatArr[$Grp]['CntAction'] = $Row->CNT;
             $StatArr[$Grp]['UniAction'] = $Row->UNI;
             $StatArr[$Grp]['Obj'] = $Row;
         }
     }
     ///////////////////////////////////////////
     if ($this->ShowSales) {
         $Query = "\n\t\t\t\tSELECT  {$StraightStr}\n\t\t\t\t\t{$SelectStr}\n\t\t\t\t\tCOUNT(S_LOG.ID) CNT,\n\t\t\t\t\tCOUNT(DISTINCT S_LOG.VISITOR_ID) UNI,\n\t\t\t\t\tSUM(S_SALE.COST) AS SALE_SUM\n\t\t\t\t\tFROM " . PFX . "_tracker_" . $this->CpId . "_stat_log S_LOG\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_log NODE\n\t\t\t\t\t\tON NODE.COOKIE_LOG=S_LOG.ID\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_sale S_SALE\n\t\t\t\t\t\tON S_SALE.LOG_ID=NODE.ID\n\t\t\t\t\t#JOIN " . PFX . "_tracker_stat_path S_PATH\n\t\t\t\t\t#\tON S_PATH.LOG_ID=S_LOG.ID\n\t\t\t\t\tINNER JOIN " . PFX . "_tracker_" . $this->CpId . "_stat_split S_SPLIT\n\t\t\t\t\t\tON S_SPLIT.LOG_ID=S_LOG.ID\n\t\t\t\t{$JoinStr}\n\t\t\t\t{$WhereStr}\n\t\t\t\t{$GrpList}\n\t\t\t\t{$GroupStr}\n\t\t\t\t{$OrderStr}\n\t\t\t\t{$LimitStr}\n\t\t\t";
         //echo HLSQL($Query);
         $Sql = new Query($Query);
         while ($Row = $Sql->Row()) {
             if ($this->GrpFld) {
                 $Tmp = $this->GrpFld;
                 $Grp = $Row->{$Tmp};
             } else {
                 $Grp = $Sql->Position;
             }
             if (!isset($StatArr[$Grp]) && $this->ShowVisitors) {
                 continue;
             }
             if (!$this->ShowVisitors) {
                 if ($this->GrpName) {
                     $Name = $this->GrpName;
                     $StatArr[$Grp]['Name'] = $Row->{$Name};
                 }
             }
             $StatArr[$Grp]['CntSale'] = $Row->CNT;
             $StatArr[$Grp]['UniSale'] = $Row->UNI;
             $StatArr[$Grp]['Income'] = $Row->SALE_SUM;
             $StatArr[$Grp]['Obj'] = $Row;
         }
     }
     foreach ($StatArr as $i => $Row) {
         if ($this->ShowActionConv) {
             $StatArr[$i]['ActionConv'] = $this->GetRatio($StatArr[$i]['UniClick'], $StatArr[$i]['UniAction']);
         }
         if ($this->ShowSaleConv) {
             $StatArr[$i]['SaleConv'] = $this->GetRatio($StatArr[$i]['UniClick'], $StatArr[$i]['UniSale']);
         }
         if (!$StatArr[$i]['Income']) {
             $StatArr[$i]['Income'] = 0;
         }
     }
     if (!ValidArr($StatArr) || count($StatArr) == 0) {
         return false;
     }
     if (count($this->GroupArr) < 1) {
         if (!isset($Grp)) {
             $Grp = 0;
         }
         return $StatArr[$Grp];
     }
     return $StatArr;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:101,代码来源:split_v2.class.php

示例8: AddIp

    $Logs->Err($Lang['InvalidIp']);
    $NewIp = false;
}
/////////////////////////////////////////////
///////// call any process functions
if (!$nsUser->DEMO) {
    if (ValidId($EditId) && $NewIp) {
        AddIp($NewIp, $EditId);
    }
    if (ValidId($EditId) && ValidId($DeleteIp)) {
        RemoveIp($DeleteIp, $EditId);
    }
    if (ValidArr($EditArr) && $EditId == "new") {
        CreateNewGrp($EditArr);
    }
    if (ValidArr($EditArr) && ValidId($EditId)) {
        UpdateGrp($EditId, $EditArr);
    }
}
/////////////////////////////////////////////
///////// display section here
if ($EditId == "new") {
    if (!$EditArr) {
        $EditArr['Name'] = "";
        $EditArr['Descr'] = "";
        $EditArr['Wacth'] = 0;
    }
    if (!ValidVar($EditArr['Watch'])) {
        $EditArr['Watch'] = 0;
    }
    $TableCaption = $Lang['CreateNewGrp'];
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.visitor_grp.php

示例9: GetSkinConfig

 function GetSkinConfig($Skin = false)
 {
     global $nsProduct;
     if (!$Skin) {
         $Skin = $nsProduct->SKIN;
     }
     if (@file_exists(SELF . "/skins/{$Skin}/config/conf.skin.php")) {
         include_once SELF . "/skins/{$Skin}/config/conf.skin.php";
     }
     if (ValidArr($SkinConfig)) {
         return $SkinConfig;
     } else {
         return false;
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:15,代码来源:template.class.php

示例10: fread

$Ref = NS_TRACK_MISC::ValidVar($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false;
if (!$Db->ID) {
    @clearstatcache();
    $f = @fopen(SELF . "/store/split_test.nodb", "r");
    if (!$f) {
        NS_TRACK_MISC::Redir($_SERVER['HTTP_REFERER']);
    }
    $Data = fread($f, filesize(SELF . "/store/split_test.nodb"));
    if (!$Data) {
        NS_TRACK_MISC::Redir($_SERVER['HTTP_REFERER']);
    }
    $DataArr = @unserialize($Data);
    if (!ValidArr($DataArr)) {
        NS_TRACK_MISC::Redir($_SERVER['HTTP_REFERER']);
    }
    if (!ValidArr($DataArr[$SplitId])) {
        NS_TRACK_MISC::Redir($_SERVER['HTTP_REFERER']);
    }
    NS_TRACK_MISC::Redir($DataArr[$SplitId][0]);
    exit;
}
$RememberPage = $Db->ReturnValue("SELECT REMEMBER_PAGE FROM " . PFX . "_tracker_split_test WHERE ID = {$SplitId}");
$PrevPageId = NS_TRACK_MISC::CookieStorageGet("split{$SplitId}" . "_page");
$PrevQueryId = NS_TRACK_MISC::CookieStorageGet("split{$SplitId}" . "_query");
if ($PrevPageId && $RememberPage) {
    $Where = " AND TSP.PAGE_ID='{$PrevPageId}'";
} else {
    $Where = "";
}
if ($PrevPageId && $PrevQueryId && $RememberPage) {
    $Where .= " AND TSP.QUERY_ID = '{$PrevQueryId}'";
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:track.split.php

示例11:

<td valign=top><p></p></td>
<td  width="50%" valign="top" style="border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:#E6E6E6;"><span class=SectionName>

</td></tr>


</table>



<IMG SRC="images/0.gif" WIDTH="1" HEIGHT="20" BORDER="0" ALT="">



<?php 
if (ValidArr($NaturalReport->StatArr)) {
    ?>
<div class=FormDiv2>

<table border="0" cellpadding="0" cellspacing="0" width=100%>
<tr>
<td class="ReportHeaderTd2" style="padding-left:6px;"  width=20%><p class="ReportHeaderName"><?php 
    echo $Lang['Site'];
    ?>
</td>

<?php 
    if ($nsUser->Columns->HITS) {
        ?>
<td class="ReportHeaderTd2" style="padding-left:6px;"  width=10%><p class="ReportHeaderName"><?php 
        echo $Lang['Online'];
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.client_page.php

示例12: getURL

if (ValidId($CpId)) {
    $MenuSection = "settings";
    $ProgPath[0]['Name'] = $Lang['MSettings'];
    $ProgPath[0]['Url'] = getURL("settings", "CpId={$CpId}", "admin");
} else {
    $MenuSection = "admin";
    $ProgPath[0]['Name'] = $Lang['Administr'];
    $ProgPath[0]['Url'] = getURL("admin", "", "admin");
}
$PageTitle .= $Lang['Title'];
$ProgPath[1]['Name'] = $Lang['Title'];
$ProgPath[1]['Url'] = getURL("stat_config", "CpId={$CpId}", "admin");
/////////////////////////////////////////////
///////// call any process functions
if (!$nsUser->DEMO) {
    if (ValidArr($SaveSet)) {
        SaveSettings($SaveSet);
    }
}
/////////////////////////////////////////////
///////// display section here
include $nsTemplate->Inc();
/////////////////////////////////////////////
///////// process functions here
function SaveSettings($SaveSet)
{
    global $Db, $Logs, $Lang, $CpId, $nsProduct;
    $KeepPath = '2';
    $KeepNoRef = '2';
    foreach ($SaveSet as $CP => $Arr) {
        foreach ($Arr as $SiteId => $SubArr) {
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.stat_config.php

示例13: while

    while ($Row = $Sql->Row()) {
        $Row->_STYLE = $Sql->_STYLE;
        $IpArr[] = $Row;
        if (strpos($Row->IP, "*") === false) {
            $GrpIpArr[] = "'" . $Row->IP . "'";
        } else {
            $IpTemplArr[] = $Row->IP;
        }
    }
}
if (!ValidArr($EditArr)) {
    $EditArr['Name'] = htmlspecialchars(stripslashes($Visitor->NAME));
    $EditArr['Descr'] = htmlspecialchars(stripslashes($Visitor->DESCRIPTION));
    $EditArr['Watch'] = $Visitor->WATCH;
}
if (ValidArr($EditArr)) {
    $EditArr['Name'] = htmlspecialchars(stripslashes($EditArr['Name']));
    $EditArr['Descr'] = htmlspecialchars(stripslashes($EditArr['Descr']));
    $EditArr['Watch'] = $Visitor->WATCH;
}
$IdsStr = "";
if (!$nsUser->ADMIN) {
    $SiteIds = array();
    $Query = "SELECT ID FROM " . PFX . "_tracker_site WHERE COMPANY_ID=" . $nsUser->COMPANY_ID;
    $Sql = new Query($Query);
    while ($Row = $Sql->Row()) {
        $SiteIds[] = $Row->ID;
    }
    $IdsStr = implode(",", $SiteIds);
}
$WhereIpIn = "";
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.visitor.php

示例14:

	</a>
	</td>
	
		
	<td class=ListRowLeft>
	<?php 
        $nsButtons->PostName = true;
        $nsButtons->Add("icon_link.gif", $Lang['CodeGen'], $Row->_CODELINK);
        $nsButtons->Add("edit.gif", $Lang['Edit'], $Row->_EDITLINK);
        $nsButtons->Add("delete.gif", $Lang['Delete'], $Row->_DELETELINK, $Lang['YouSure']);
        $nsButtons->Dump();
        ?>
	</td>
	</tr></table>
	
	</td></tr>


<?php 
    }
    ?>
</table>

<?php 
}
?>

<?php 
if (ValidArr($PathArr) && count($PathArr) > 1) {
    include $nsTemplate->Inc("inc/grp_path");
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:admin.sub_camp_list.php

示例15: ValidVar

if (isset($_GP['ShowFilter'])) {
    $ShowFilter = $_GP['ShowFilter'];
}
$SavePrevLevel = false;
$PrevReport = false;
$ShowAll = false;
$NoGroupBy = false;
if ($GroupBy == "General") {
    $NoGroupBy = true;
    $GroupBy = false;
}
$ExportCsv = false;
$ExportSep = ",";
$ExportNoLimit = false;
$ExportExpanded = false;
if (ValidArr($ExportReport)) {
    $ExportCsv = true;
    $ExportSep = ValidVar($ExportReport['Separator']) ? $ExportReport['Separator'] : ",";
    $ExportNoLimit = ValidVar($ExportReport['NoLimit']) == 1 ? true : false;
    $ExportExpanded = ValidVar($ExportReport['Expanded']) == 1 ? true : false;
}
if (ValidId($ConstId)) {
    ImportReport($ConstId);
}
if ($GroupBy && !$OrderBy && !$OrderTo && !$CurrentId && !$Redir) {
    if (isset($WhereArr[count($WhereArr) - 1]['OrderBy'])) {
        $OrderBy = $WhereArr[count($WhereArr) - 1]['OrderBy'];
    }
    if (isset($WhereArr[count($WhereArr) - 1]['OrderTo'])) {
        $OrderTo = $WhereArr[count($WhereArr) - 1]['OrderTo'];
    }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:report.paid_constructor.php


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