function s_fetch($p_statement)
{
    $res = m_query($p_statement);
    while ($row = mysql_fetch_assoc($res)) {
        $rows[] = $row;
    }
    return $rows;
}
function checkrole($url)
{
    $checkadmin = $_SESSION['admininfo'];
    $user_id = $checkadmin['id'];
    $sql = "select * from m_block a,m_role b where b.role_id=a.id and b.user_id='" . $user_id . "' and a.url='" . $url . "' limit 1";
    $result = m_fetch(m_query($sql));
    if ($result['role_id'] != "") {
        return true;
    } else {
        return false;
    }
}
Exemplo n.º 3
0
function getmemberid2name($con, $memberid)
{
    global $useenvironmentpolicy;
    //$username = $_SERVER['PHP_AUTH_USER'];
    if ($useenvironmentpolicy == 1) {
        $query = "\n\t\t\tSELECT memberid ,userclass,name,passwd1\n\t\t\tFROM foltia_envpolicy\n\t\t\tWHERE foltia_envpolicy.memberid  = '{$memberid}'\n\t\t\t";
        $useraccount = m_query($con, $query, "DBクエリに失敗しました");
        $rowdata = $useraccount->fetch();
        if (!$rowdata) {
            return "";
            //エラー
        }
        $name = $rowdata[2];
        $rowdata = $useraccount->fetch();
        if ($rowdata) {
            return "";
        }
        return $name;
    } else {
        return "";
    }
    //end if
}
Exemplo n.º 4
0
     $isaccountexistncount = $isaccountexist->fetchColumn(0);
     if ($isaccountexistncount == 0) {
         //valid
     } else {
         $errflag = 1;
         $errmsg = "そのユーザ名は既に使われています。";
     }
 }
 if ($userpasswd == "") {
     $errflag = 2;
     $errmsg = "パスワードが不適切です。半角英数を指定して下さい。";
 }
 if ($errflag == 0) {
     // next midを探す
     $query = "\nSELECT max(memberid) \nFROM  foltia_envpolicy \n";
     $rs = m_query($con, $query, "DBクエリに失敗しました");
     $maxid = $rs->fetchColumn(0);
     if ($maxid) {
         $nextcno = $maxid + 1;
     } else {
         $nextcno = 1;
     }
     //登録
     //INSERT
     if ($demomode) {
     } else {
         /*
         ユーザクラス
         0:特権管理者
         1:管理者:予約削除、ファイル削除が出来る
         2:利用者:EPG追加、予約追加が出来る
<?php

session_start();
include_once './inc/init.php';
$sql = "select * from item where takeorder_itemname='' order by id desc";
$res = m_query($sql);
$num = mysql_num_rows($res);
$p = new show_page();
$p->pvar = "p";
//$p->setvar(array("id" => $_GET['id']));
$p->set(4, $num);
$sql .= " limit " . $p->limit();
$itemsort_result = m_query($sql);
$sortlist = array();
$i = 0;
while ($row = m_fetch($itemsort_result)) {
    $sortlist[] = $row;
}
$pages = $p->output(1);
$smarty->assign('sortlist', $sortlist);
$smarty->assign('itemselflist', $itemselflist);
$smarty->assign('pages', $pages);
$smarty->display("item.htm");
require 'inc/ajax_order_page.inc.php';
$id = $_GET['id'];
$no = $_GET['no'];
$customize = $_GET['customize'];
$sql = "select sortname from takeorder_item where id='{$id}'";
$res = s_fetch($sql);
$sortname = $res[0]['sortname'];
$sql_itemself = "select * from takeorder_item where sortname='{$sortname}' and itemname!=''";
$query_itemself = m_query($sql_itemself);
$num = mysql_num_rows($query_itemself);
$p = new show_page();
$p->pvar = "p";
$p->setvar(array("id" => $_GET['id'], "no" => $no, "customize" => $customize));
$p->set(3, $num, "", "itemself");
$sql_itemself .= " limit " . $p->limit();
$itemsort_result = m_query($sql_itemself);
while ($row_itemself = m_fetch($itemsort_result)) {
    $itemselflist[] = $row_itemself;
}
//print_rr($itemselflist);
/*
$i =0;
while($row=m_fetch($itemsort_result)){
	$sortlist[]=$row;
	if($i==0){
        $sql_itemself = "select sortname from item where id='$id'";
        $query_itemself = m_query($sql_itemself);
		while($row_itemself=m_fetch($query_itemself)){
			$itemselflist[]=$row_itemself;
		}
	}
<?php

include_once './inc/init.php';
include_once './inc/order_page.inc.php';
//分页程序
$w = " where 1=1";
if ($level1 != "") {
    $w = empty($w) ? "" : $w . " and ";
    $w .= " class1='{$level1}'";
}
$sql = "select * from takeorder_customer order by id desc";
$res = m_query($sql);
$num = mysql_num_rows($res);
$p = new show_page();
$p->pvar = "p";
$p->set(2, $num, false);
$sql .= " limit " . $p->limit();
$customer_result = mysql_query($sql);
$list = array();
while ($row = @mysql_fetch_assoc($customer_result)) {
    $list[] = $row;
}
$pages = $p->output(1);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link type="text/css" rel="stylesheet" rev="stylesheet" href="./css/smain.css" />
<?php

session_start();
//include_once './inc/page.inc.php';
include_once './inc/init.php';
if ($_POST['id'] != '') {
    $sql = "update main set no='{$_POST['no']}',itemname='{$_POST['itemname']}',price='{$_POST['price']}',qty='{$_POST['qty']}',disc='{$_POST['disc']}',lineamt='{$_POST['lineamt']}',tax='{$_POST['tax']}',r='{$_POST['r']}',customize='{$_POST['customize']}',totalqty='{$_POST['totalqty']}',grossamt='{$_POST['grossamt']}',normal='{$_POST['normal']}',discount='{$_POST['discount']}',addin='{$_POST['addin']}',netamount='{$_POST['netamount']}',importer='{$_POST['importer']}',salesman='{$_POST['salesman']}',customer='{$_POST['customer']}',name='{$_POST['name']}',class='{$_POST['class']}',`delete`='{$_POST['delete']}',single='{$_POST['single']}',b='{$_POST['b']}',c='{$_POST['c']}',customeerno='{$_POST['customeerno']}',hold='{$_POST['hold']}',rethold='{$_POST['rethold']}',reprint='{$_POST['reprint']}',remark='{$_POST['remark']}',function='{$_POST['function']}',payment='{$_POST['payment']}',`exit`='{$_POST['exit']}' where id='{$_POST['id']}'";
    m_query($sql);
    echo "successful";
}
$sql = "select * from main";
$result = s_fetch($sql);
$smarty->assign('rows', $result);
$smarty->display("menumain.htm");
?>