예제 #1
0
    if ($_REQUEST['suatin']) {
        $rs_id = $_REQUEST['suatin'];
    }
    if ($_REQUEST['chondm']) {
        $rs_chondm = $_REQUEST['chondm'];
    }
    if ($_REQUEST['title']) {
        $rs_title = $_REQUEST['title'];
    }
    if ($_REQUEST['content']) {
        $rs_content = $_REQUEST['content'];
    }
    if ($_REQUEST['createDate']) {
        $rs_createDate = $_REQUEST['createDate'];
    }
    $result = update_new($rs_id, $rs_title, $rs_content, $rs_createDate, $rs_chondm);
    if (!$result) {
        echo "<div class='alert alert-block alert-danger fade in'>Lỗi! Không lưu được.</div>";
    }
}
if (isset($_REQUEST['xoatin'])) {
    $result = delete_new($_REQUEST['xoatin']);
    if ($result) {
        echo "<div class='alert alert-block alert-success fade in'>Xóa thành công.</div>";
    } else {
        echo "<div class='alert alert-block alert-danger fade in'>Lỗi! Không xóa được.</div>";
    }
}
?>

<div class="row">
예제 #2
0
        }
    }
} else {
    $content = 'Ошибка 404 - такой статьи нет!';
}
if (isset($_POST['Delete'])) {
    delete_new($link, $id);
    header('Location: ../index.php');
    exit;
} elseif (isset($_POST['Save'])) {
    $title = trim($_POST['title']);
    $content = trim($_POST['content']);
    if ($content == '') {
        $message = "Незаполнено поле контент, а надо бы :)";
    } elseif (mb_strlen($content) > 1000) {
        $message = "Статья превышает 1000 знаков! Будьте лаконичны ;)";
    } elseif (new_exists($link, $id)) {
        update_new($link, $id, $content, $title);
        header('Location: ../index.php');
        exit;
    } else {
        add_new($link, $title, $content, $id_user);
        header('Location: ../index.php');
        exit;
    }
} else {
    $message = '';
    $title = $title;
    $content = $content;
}
include '../v/v_edit.php';
예제 #3
0
$current_GMT_time = get_GMT(time());
$current_GMT_time_string = date("Y-m-d H:i:s", $current_GMT_time);
$current_YVR_time = getTimeByCity($current_GMT_time, 'YVR');
$current_YVR_time_string = date("Y-m-d H:i:s", $current_YVR_time);
$current_YVR_date = date("Y-m-d", $current_YVR_time);
$insert_size = 0;
//login and receive server response.
$response = $rets->Login();
var_dump($response);
//The following code is to test if the cron job is executed.
$file = "file.txt";
$current = file_get_contents($file);
$current .= "{$current_YVR_time_string} from sysid_test.php\n";
file_put_contents($file, $current);
update_current();
update_new();
update_recent_update();
update_recent_image();
get_open_house();
/*
*Functions
*/
function update_current()
{
    global $rets, $useradmin, $insert_size;
    $sysid_array = $rets->GetDataArray('Property', '11', '(363=|A)', 'sysid', null);
    $truncateSQL = "TRUNCATE TABLE sysid_raw_current";
    $result = mysql_query_or_die($truncateSQL, $useradmin);
    foreach ($sysid_array as $index => $array) {
        insert_sysid($array['sysid']);
    }