コード例 #1
0
ファイル: index.php プロジェクト: hderanga/snaptag
session_start();
error_reporting(E_ALL);
ini_set("display_errors", "on");
include "settings.inc.php";
include "lang/en.inc.php";
include "function.php";
include _LIBPATH . "functions.custom.inc.php";
include "dbaccess.class.php";
ini_set('memory_limit', "32M");
logoutUser(_APPNAME);
//Logout user if request to logout
if (!isLoggedIn(_APPNAME)) {
    redirectPage("login.php");
}
//Create DBAccess Instance
$mySqlObj = new dBAccess(_DBHOST, _DBUSERNAME, _DBPASSWORD);
//MySQL Database Instance
$mySqlObj->selectDB(_DBNAME);
//$mySqlObj -> enableDebugMode();
$pageJS = "";
/*initAJAX(_APPNAME, _USEAJAX);
if(getAJAXState(_APPNAME)){
	$pageJS = getAjaxJS();	
}*/
$incRPC = true;
include "rpc.php";
$disPageCont = "<div id=\"content\">" . $_disContentBody . "</div>";
include "nav.php";
showHeaderHTML("Management Console", "appstyle.css", $pageJS);
echo useTemplate("mainlayout", "Management Console", "Welcome " . $mySqlObj->getResourceName(getUserId(_APPNAME)) . "!", $_navLinkList, $disPageCont);
showFooterHTML();
コード例 #2
0
ファイル: categories.php プロジェクト: hderanga/snaptag
<?
include(_LIBPATH."class.easyformproc.inc.php");

//Create Instance
	$mySqlObj = new dBAccess(_DBHOST, _DBUSERNAME, _DBPASSWORD);//MySQL Database Instance
	$mySqlObj -> selectDB(_DBNAME);	

$allFieldsList = array("*");
$res = $mySqlObj -> querySelect("categories",$allFieldsList);

//Create Instance
$formGen = new easyFormProc();

for($r=0;$r<count($res);$r++)
{
//$formGen -> setTextElement("order".$r,$res[$r]["ordering"],5, 5,"txtboxes"); 
$formGen -> setHiddenElement("id".$r,$res[$r]["catid"]); 

}

#Process Form
$disForm = $formGen -> processForm("Update","buttons", "submit", "index.php?action=categories");

#Get HTML of the elements
$disElementHTML = $formGen -> getDisElementHTML();

#Get Error Messages	
$errMsg = $formGen -> getErrorMsg("The following errors occured","style2");

#Get Posted Values
$postedVals = $formGen -> getPostedElementValues();
コード例 #3
0
ファイル: login.php プロジェクト: hderanga/snaptag
//Create Instance
$formGen = new easyFormProc();
$formGen->setTextElement("usName", "", 30, 20, "txtboxes", "valNonEmpty", "Enter Username");
$formGen->setPasswordElement("psWord", "", 20, 20, "txtboxes", false, true, "Enter Password");
#Process Form
$disForm = $formGen->processForm("Login", "buttons");
#Get HTML of the elements
$disElementHTML = $formGen->getDisElementHTML();
#Get Error Messages
$errMsg = $formGen->getErrorMsg("The following errors occured", "style2");
#Get Posted Values
$postedVals = $formGen->getPostedElementValues();
if (count($postedVals)) {
    include "dbaccess.class.php";
    //Create Instance
    $mySqlObj = new dBAccess(_DBHOST, _DBUSERNAME, _DBPASSWORD);
    //MySQL Database Instance
    $mySqlObj->selectDB(_DBNAME);
    $resLogin = $mySqlObj->authenticateLogin($postedVals["usName"], $postedVals["psWord"], true);
    if (count($resLogin)) {
        loginUser(_APPNAME, $resLogin[0]["userId"], $resLogin[0]["lastLogin"]);
        redirectPage("index.php");
    } else {
        $errMsg = $_appLang["errorLogin"];
    }
}
$contVal[0][0] = array("value" => "Username");
$contVal[0][1] = array("value" => $disElementHTML["usName"]);
$contVal[1][0] = array("value" => "Password");
$contVal[1][1] = array("value" => $disElementHTML["psWord"]);
$contVal[2][1] = array("value" => $disForm["submit"]);
コード例 #4
0
ファイル: items.php プロジェクト: hderanga/snaptag
<?
include(_LIBPATH."class.easyformproc.inc.php");
include("paginate.php");
//Create Instance
	$mySqlObj = new dBAccess(_DBHOST, _DBUSERNAME, _DBPASSWORD);//MySQL Database Instance
	$mySqlObj -> selectDB(_DBNAME);	

$allFieldsList = array("*");
$sortby = array("catid","temp_id");
$res = $mySqlObj -> querySelect("template",$allFieldsList,$sortby,"D");
$cont[0][0] = array("value" => "<b>Item ID</b>", "width" => "100");
$cont[0][1] = array("value" => "<b>Item Image</b>", "width" => "200");
$cont[0][2] = array("value" => "<b>Item Name </b>");
$cont[0][3] = array("value" => "<b>Item Category</b>");
$cont[0][4] = array("value" => "&nbsp;");
$qryStr ="&action=".$_REQUEST['action'];


$arr = paginate("select * from template order by temp_id desc",10);
$i=0;
while($res = mysql_fetch_array($arr["result"]))
{ 
	//getting the category name
	$cana = array("catlink");
	$catnacon = "catid='".$res["catid"]."'";
	$catnames = $mySqlObj -> querySelect("categories",$cana,"","",$catnacon);
	$catname = $catnames[0]['catlink'];	
	//getting the category name
	$cont[$i+1][0] = array("value" => $res["temp_id"],"valign" => "top");
	$cont[$i+1][1] = array("value" => '<img src="../item_images/'.$res["temp_img"].'" width="150px" height="120px" />');
	$cont[$i+1][2] =  array("value" => $res["title"],"valign" => "top");
コード例 #5
0
ファイル: rpc.php プロジェクト: hderanga/snaptag
<?php

if (!(isset($incRPC) && $incRPC)) {
    session_start();
    include "settings.inc.php";
    include "lang/" . _LANGUAGE . ".inc.php";
    include _LIBPATH . "functions.custom.inc.php";
    include "dbaccess.class.php";
    if (!isLoggedIn(_APPNAME)) {
        die;
    }
    //Create DBAccess Instance
    $mySqlObj = new dBAccess(_DBHOST, _DBUSERNAME, _DBPASSWORD);
    //MySQL Database Instance
    $mySqlObj->selectDB(_DBNAME);
    //$mySqlObj -> enableDebugMode();
}
$_incRsActivityList = $mySqlObj->getActivityList(_APPID, getUserId(_APPNAME));
$allowCheckList = array();
$disNavList = array();
$disSubNavList = array();
foreach ($_incRsActivityList as $rsActivity) {
    $allowCheckList[] = $rsActivity["actPageId"];
    if ($rsActivity["parentId"] == 0) {
        if (!isset($disNavList[$rsActivity["orderNo"]])) {
            $disNavList[$rsActivity["orderNo"]] = array("actPageId" => $rsActivity["actPageId"], "actLink" => $rsActivity["actLink"], "actId" => $rsActivity["actId"]);
        } else {
            die("Cannot Create Main Menu.. Order Mismatch");
        }
    } else {
        if (!isset($disSubNavList[$rsActivity["parentId"]][$rsActivity["orderNo"]])) {
コード例 #6
0
ファイル: comment.php プロジェクト: hderanga/snaptag
<?
include(_LIBPATH."class.easyformproc.inc.php");
include("paginate.php");
//Create Instance
	$mySqlObj = new dBAccess(_DBHOST, _DBUSERNAME, _DBPASSWORD);//MySQL Database Instance
	$mySqlObj -> selectDB(_DBNAME);	

//$res = $mySqlObj -> querySelect("template",$allFieldsList,$sortby,"D");
$cont[0][0] = array("value" => "<b>comment ID</b>", "width" => "100", "align" => "center");
$cont[0][1] = array("value" => "<b>user name</b>", "width" => "200", "align" => "center");
$cont[0][2] = array("value" => "<b>website</b>", "align" => "center");
$cont[0][3] = array("value" => "<b>status</b>", "align" => "center");
$cont[0][4] = array("value" => "<b>view</b>", "align" => "center");
$cont[0][5] = array("value" => "<b>delete</b>", "align" => "center");
$qryStr ="&action=".$_REQUEST['action'];


$arr = paginate("select * from comments order by com_id desc",10);
$i=0;
while($res = mysql_fetch_array($arr["result"]))
{ 
	//getting the category name
	$cana = array("catlink");
	$catnacon = "catid='".$res["catid"]."'";
	$catnames = $mySqlObj -> querySelect("categories",$cana,"","",$catnacon);
	$catname = $catnames[0]['catlink'];	
	
	//$numOfPpl = mysql_num_rows(mysql_query("select * from ratings where rating_id='".$res["temp_id"]."'"));
	//getting the category name
	$cont[$i+1][0] = array("value" => $res["com_id"],"valign" => "top", "align" => "center");
	$cont[$i+1][1] = array("value" => $res["name"],"valign" => "top", "align" => "center");