コード例 #1
0
ファイル: post_index.php プロジェクト: anfleene/N342
function all_posts()
{
    include "includes/db_con.inc";
    $conn = conDB();
    $query = "SELECT * FROM posts";
    $posts = q($query);
    return $posts;
}
コード例 #2
0
ファイル: post_show.php プロジェクト: anfleene/N342
function find_post($id)
{
    include "includes/db_con.inc";
    $conn = conDB();
    $query = "SELECT * FROM posts where posts.id = '" . $id . "'";
    $result = q($query);
    $post = mysql_fetch_array($result);
    return $post;
}
コード例 #3
0
ファイル: post_create.php プロジェクト: anfleene/N342
function create_post($title, $content)
{
    //establish a database connection
    include "includes/db_con.inc";
    $conn = conDB();
    //build an insert query
    $query = sprintf("INSERT INTO posts (title, body, created, modified) VALUES('%s', '%s', '%s', '%s') ", mysql_real_escape_string($title), mysql_real_escape_string($content), date("Y-m-d H:i:s"), date("Y-m-d H:i:s"));
    q($query);
    //select the most recently created post
    $result = q("SELECT id FROM posts ORDER BY posts.id DESC LIMIT 1");
    $post = mysql_fetch_array($result);
    //return the id of the last post
    return $post['id'];
}
コード例 #4
0
<?php

session_start();
include "phpconf.php";
include "func.php";
conDB();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<title>- - ÃкºÍÔ¹·ÃÒà¹çµ | <?php 
echo "&nbsp;" . $Hospname . "&nbsp;";
?>
 | - - ÀÒÇÐâÀª¹Ò¡Òà ºÑ­ªÕ 3áÅÐ4 - - |</title>
<style type="text/css">
<!--
body {  margin: 0px  0px; padding: 0px  0px}
body{font-family:MS Sans Serif;font-size:10pt}
table,td{font-family:MS Sans Serif;font-size:10pt}
form{font-family:MS Sans Serif;font-size:10pt}
-->
</style>
<?php 
//set theme
print "<link href='css/{$Theme}.css' rel='stylesheet' type='text/css'>";
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
コード例 #5
0
ファイル: Functions.php プロジェクト: CoolHeatCRM/island
function getLocationName($LID)
{
    $conn = conDB();
    $sql = "SELECT Name FROM locations WHERE IDKey='{$LID}'";
    $result = mysqli_query($conn, $sql);
    $row = $result->fetch_assoc();
    $name = $row["Name"];
    return $name;
}
コード例 #6
0
ファイル: login.php プロジェクト: CoolHeatCRM/CRM2
<?php

//Initial Setup
session_start();
$_SESSION["servername"] = "localhost";
$_SESSION["Dusername"] = "******";
$_SESSION["Dpassword"] = "";
$_SESSION["dbname"] = "crm2";
$_SESSION["username"] = $_POST["user"];
$_SESSION["password"] = $_POST["pass"];
$_SESSION["idnum"] = 0;
$_SESSION["MINI"] = "0";
$_SESSION["DISPLAY"] = "1";
//Grant access to Core
include_once 'Core.php';
//Print out the header
NoSessionHeadprint();
$conn = conDB();
$user = $_SESSION["username"];
$pass = $_SESSION["password"];
$_SESSION["idnum"] = login($user, $pass);
$AID = $_SESSION["idnum"];
printUI($AID, "0", "0", FALSE);
//Print out the Tail section, possibly to be discontinued soon
TailPrint();
コード例 #7
0
ファイル: Core.php プロジェクト: CoolHeatCRM/CRM2
function getIndexPermissions($IndexID)
{
    $conn = conDB();
    $sql = "SELECT PermIDV,PermIDE FROM cusindex WHERE IDKey='{$IndexID}'";
    $result = mysqli_query($conn, $sql);
    $row = $result->fetch_assoc();
    $returns = array();
    $returns[0] = $row["PermIDV"];
    $returns[1] = $row["PermIDE"];
    return $returns;
}