Ejemplo n.º 1
0
            $i_headingID = 0;
        }
        if (isset($_POST['displayOrder'])) {
            $i_displayOrder = intval($_POST["displayOrder"]);
        } else {
            $i_displayOrder = 0;
        }
        if (isset($_POST['contentTitle'])) {
            $s_contentTitle = trim($_POST["contentTitle"]);
        } else {
            $s_contentTitle = "";
        }
        if (isset($_POST['textContent'])) {
            $s_textContent = trim($_POST["textContent"]);
        } else {
            $s_textContent = "";
        }
        $s_sql = "insert into cms.dyn_howto_content (howtoID, chapterID, headingID, displayOrder, howtoContent, contentTitle)\r\n\tselect {$i_howtoID}, {$i_chapterID}, {$i_headingID}, {$i_displayOrder}, '{$s_textContent}', '{$s_contentTitle}';";
        $q_data = mysql_query($s_sql);
        $s_error = "";
        if (!$q_data) {
            $s_error = mysql_error();
        }
        include "howto_c.php";
        $objhowTo = new howTo();
        $s_html = $objhowTo->outputHowTo();
        break;
    case "getdetail":
        break;
}
echo $s_html;
Ejemplo n.º 2
0
<?php

include "..\\common\\ajax_include.php";
$s_html = "";
$s_task = set_var("task", "");
include "howto_c.php";
$objhowTo = new howTo();
switch ($s_task) {
    case "getHeading":
        $s_server = "65.175.107.2:3306";
        $s_userName = "******";
        $s_password = "******";
        $s_db = "cms";
        $o_conn = mysql_connect($server = $s_server, $username = $s_userName, $password = $s_password);
        if (!$o_conn) {
            die_well(mysql_error());
        }
        $o_sel = mysql_select_db($s_db);
        if (!$o_sel) {
            die_well(mysql_error());
        }
        if (isset($_POST['chapterID'])) {
            $i_chapterID = intval($_POST['chapterID']);
        } else {
            $i_chapterID = 0;
        }
        $s_sql = "select \t\r\n\t    headingID, displayOrder, headingName\r\n\tfrom \r\n\t    cms.cfg_howto_headings\r\n\tWHERE \r\n\t    chapterID = {$i_chapterID} \r\n\torder by \r\n    \tdisplayOrder, headingName";
        $q_data = mysql_query($s_sql);
        if (!$q_data) {
            die_well(mysql_error());
        }
Ejemplo n.º 3
0
$q_data = mysql_query($s_sql);
if (!$q_data) {
    die_well(mysql_error());
}
$s_headingText = '';
if (mysql_num_rows($q_data)) {
    $s_headingText = '<select id="headingID" name="headingID">' . "\n";
    while ($rowData = mysql_fetch_row($q_data)) {
        $s_headingText .= '<option value="' . $rowData[0] . '">' . $rowData[1] . '. ' . $rowData[2] . '</option>' . "\n";
    }
    $s_headingText .= '</select>' . "\n";
} else {
    $s_headingText .= '<input type="hidden" id="headingID" name="headingID" value="0">' . "\n";
}
include "howto_c.php";
$objhowTo = new howTo();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html>
<head>
<link rel="stylesheet" href="eve2.css">
<script type="text/javascript" src="ajax.js"></script>
<script type="text/javascript" language="JavaScript1.2">
	function js_getHeading(chapterID) {
		var s_ajax = "task=getHeading";
		s_ajax += "&chapterID=" + chapterID;
		var s_return = http_post_request("how_to_ajax.php", s_ajax);
		document.getElementById("span_heading").innerHTML = s_return; 
	}
	function js_save() {
		var s_ajax = "task=saveContent";