Ejemplo n.º 1
0
<?php

$open = myUri(2);
$data = array('title' => 'Welcome', 'content' => 'article/tutor', 'uri' => $open);
showView('article/tutor_view', $data);
Ejemplo n.º 2
0
<?php

$open = intval(myUri(2));
$data = array('title' => 'Welcome', 'content' => 'project/' . sprintf("%04s", $open));
showView('base_view', $data);
Ejemplo n.º 3
0
<?php

$id = myUri(3);
$sql = "select * from `" . prefix() . "%nama%` where %prefnama%_id='{$id}'";
$q = query($sql);
$data = fetch($q);
foreach ($data as $n => $v) {
    $nm = str_replace("%prefnama%_", "", $n);
    ${$nm} = $v;
}
?>
	%listMain%<!--
	try fix this detail
-->
	%listDetail%
Ejemplo n.º 4
0
<?php

//table/show/1-bootstrap
$act = myUri(2);
$id = intval(myUri(3));
if ($act == 'showTutorial') {
    $sql = "select t.tutor_name tutor,t2.* from nasgor_tutorial t, nasgor_tutoriallist t2\n\twhere tlist_tutor={$id} \n\tand tutor_id=tlist_tutor\n\torder by tlist_pos asc";
    $q = query($sql);
    $i = 1;
    $dataTable = array();
    while ($row = fetch($q)) {
        $i++;
        $link = "<input type='button' onclick='editTutorList(\"{$row['tlist_id']}\")' value='edit' >";
        $dataTable[] = array($row['tutor'], $row['tlist_name'], $row['tlist_pos'], $link);
    }
    if ($i == 1) {
        $dataTable[] = array('-', '-', '-', '-');
    }
    $a = array('aaData' => $dataTable);
    echo json_encode($a);
}
if ($act == 'showTutorial2') {
    $sql = "select * from nasgor_tutoriallist where tlist_tutor={$id} order by tlist_pos asc";
    $q = query($sql);
    $i = 1;
    $dataTable = array();
    while ($row = fetch($q)) {
        $link = "<input type='button' onclick='editTutorList(\"{$row['tlist_id']}\")' value='edit' >";
        $dataTable[] = array($i++, $row['tlist_name'], $row['tlist_pos'], $link);
    }
    if ($i == 1) {
Ejemplo n.º 5
0
<?php

ob_start();
echo '<pre>';
$f = '';
if (myUri(2) == 'edit') {
    $f = 'edit_view';
}
if (myUri(2) == 'baru') {
    $f = 'new_view';
}
if (myUri(2) == 'view') {
    $f = 'detail_view';
}
$data = array('id' => myUri(3));
showView('%nama%/' . $f, $data);
$post = ob_get_contents();
ob_end_clean();
echo $post;
Ejemplo n.º 6
0
<?php

$act = myUri(2);
$id = isset($_POST['id']) ? intval($_POST['id']) : 0;
ob_start();
if ($act == 'save') {
    //print_r($_POST);
    foreach ($_POST as $nm => $val) {
        ${$nm} = $val;
    }
    $sql = "select count(tlist_id) c from nasgor_tutoriallist where tlist_id={$tutorid}";
    $row = queryFetch($sql);
    if ($row['c'] == 0) {
        //insert
        $uriname = createUri($tutorname, "nasgor_tutoriallist", "tlist_uri");
        $data = array("tlist_id" => $tutorid, "tlist_name" => $tutorname, "tlist_tutor" => $tutorhead, "tlist_pos" => $tutorposisi, "tlist_prev" => $tutorpreview, "tlist_uri" => $uriname);
        dbInsert("nasgor_tutoriallist", $data);
        $data = array('ttext_list' => $tutorid, 'ttext_detail' => $tutordetail, 'ttext_code' => $tutorcode);
        dbInsert("nasgor_tutorialtext", $data);
    } else {
        //update
        $uriname = createUri($tutorname, "nasgor_tutoriallist", "tlist_uri");
        $data = array("tlist_name" => $tutorname, "tlist_tutor" => $tutorhead, "tlist_pos" => $tutorposisi, "tlist_prev" => $tutorpreview, "tlist_uri" => $uriname);
        $where = "tlist_id='{$tutorid}'";
        dbUpdate("nasgor_tutoriallist", $data, $where);
        $data = array('ttext_detail' => $tutordetail, 'ttext_code' => $tutorcode);
        $where = "ttext_list='{$tutorid}'";
        dbUpdate("nasgor_tutorialtext", $data, $where);
    }
    $url = my_url() . "form/005bootstrap";
}