本文整理汇总了PHP中direct函数的典型用法代码示例。如果您正苦于以下问题:PHP direct函数的具体用法?PHP direct怎么用?PHP direct使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了direct函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add()
{
$this->load->language('card/card');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('card/card');
if ($this->request->server['REQUEST_METHOD'] == 'POST' && $this->validateForm()) {
$this->model_card_card->addCard($this->request->post);
$this->session->data['success'] = $this->language->get('text_success');
$url = '';
if (isset($this->request->get['filter_name'])) {
$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->request->get['filter_price'])) {
$url .= '&filter_price=' . $this->request->get['filter_price'];
}
if (isset($this->request->get['filter_quantity'])) {
$url .= '&filter_quantity=' . $this->request->get['filter_quantity'];
}
if (isset($this->request->get['filter_status'])) {
$url .= '&filter_status=' . $this->request->get['filter_status'];
}
if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}
if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}
if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}
$this->response > re - direct($this->url->link('card/card', 'token=' . $this->session->data['token'] . $url, 'SSL'));
}
$this->getForm();
}
示例2: list_verify
function list_verify()
{
if (logged_in() != TRUE) {
//echo 'You are not logged in';
direct('login.php', 0);
//echo 'hih';
}
}
示例3: detail
function detail($id = '')
{
if ($this->session->userdata('logged_in')) {
$q = $this->divisi_model->get_by_id($id);
$data = array("title" => $q->title, "tag" => $q->tag, "summary" => $q->summary, "body" => $q->body, "status" => $q->status, "created_date" => $q->created_date, "modified_date" => $q->modified_date);
$this->parser->parse('admin/content/divisi/detail_divisi', $data);
} else {
direct('admin/login', 'refresh');
}
}
示例4: aksi
function aksi()
{
if (post('login-alumni')) {
$this->db->join('jurusan', 'jurusan.id_jurusan=siswa.id_jurusan');
$user = explode(".", post('user'));
if (isset($user[1])) {
$row = $this->db->get_where('siswa', array('salt' => $user[0], 'user' => $user[1], 'pass' => sha1(post('pass'))))->row_array();
} else {
$row = false;
}
if ($row) {
if ($row['status'] == 'active') {
$data = array('id_user' => $row['id_siswa'], 'login' => true, 'role' => 'alumni', 'jurusan' => $row['warna_jurusan']);
$this->session->set_userdata($data);
direct("front/profil_alumni");
} else {
$this->all->setMsg('error', 'Username tidak aktif');
}
} else {
$this->all->setMsg('error', 'Username Dan Password Salah');
}
}
if (post('login-perusahaan')) {
$row = $this->db->get_where('perusahaan', array('user' => post('user'), 'pass' => sha1(post('pass'))))->row_array();
if ($row) {
if ($row['status'] == 'active') {
$data = array('id_user' => $row['id_perusahaan'], 'login' => true, 'role' => 'perusahaan');
$this->session->set_userdata($data);
direct("front/detail_perusahaan");
} else {
$this->all->setMsg('error', 'Username tidak aktif');
}
} else {
$this->all->setMsg('error', 'Username Dan Password Salah');
}
}
}
示例5: nicEditor
</div>
</div>
</div>
<script>
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
bkLib.onDomLoaded(function() {
new nicEditor({maxHeight : 200}).panelInstance('pesan');
});
</script>
<?php
if (isset($_POST['tambah']) and $_POST['tambah'] == "pesan") {
$nama = $_POST['nama'];
$email = $_POST['email'];
$isi = $_POST['pesan'];
if (empty($isi)) {
$pesan = "(Tanpa Komentar)";
} else {
$pesan = $isi;
}
$tgl = new datenow();
$waktu = $tgl->hariini . ", " . $tgl->tgl . " " . $tgl->bulanini . " " . $tgl->thn . " | " . $tgl->jam;
$waktu = mysql_real_escape_string($waktu);
$tambah = mysql_query("insert into keluhan values('default','{$nama}','{$email}','{$pesan}','{$waktu}')");
echo "<script>alert('Pesan berhasil dikirim. Terima kasih atas kejujuran Anda!')</script>";
direct("?page=contact");
}
示例6: nicEditor
<input type="hidden" name="tambah" value="jurnal" />
</form>
</div>
</div>
</div>
<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
bkLib.onDomLoaded(function(){
new nicEditor({buttonList : ['link','unlink',]}).panelInstance('uraian');
});
</script>
<?php
if (isset($_POST['tambah']) and $_POST['tambah'] == "jurnal") {
$kegiatan = $_POST['kegiatan'];
$tgl = $_POST['tgl'];
$uraian = $_POST['uraian'];
$tambah = mysql_query("insert into jurnal_harian values('default','{$nis}','{$tgl}','{$kegiatan}','{$uraian}')");
if ($tambah) {
direct("?page=add_jurnal¬if=added");
}
}
} else {
echo "<br /><center>ERROR 404<br />Page Not Found!</center>";
}
} else {
lokasi("login");
}
示例7: isset
<table width="100%" border="0" style="font-size: 12px; margin-top: 3px; margin-bottom: 15px;">
<tr>
<td width="75%" align="left">
<?php
if ($rows > $limit) {
?>
Halaman: <?php
$query->printNav();
?>
<?php
}
?>
</td>
<td width="25%" align="right">Jumlah: <b><?php
echo $rows;
?>
</b> data</td>
</tr>
</table>
</div>
</div>
</div>
<?php
$menu = isset($_GET['menu']) ? $_GET['menu'] : '';
$id = isset($_GET['id']) ? $_GET['id'] : '';
if ($menu == "hapus") {
$hapus = mysql_query("delete from kelas where id_kelas='{$id}'");
echo "<script>alert('Data berhasil dihapus')</script>";
direct("?page=data_kelas");
}
示例8: direct
direct("?page=setting_profil¬if=success");
} else {
if ($table == "du_di") {
$nama_dudi = $_POST['nama_dudi'];
$alamat = $_POST['alamat'];
$email = $_POST['email'];
$tentang = $_POST['tentang'];
$primary = "id_dudi";
$key = $data['id_dudi'];
$ubah = mysql_query("update {$table} set nama_dudi='{$nama_dudi}', alamat='{$alamat}', email='{$email}', tentang='{$tentang}' where {$primary}='{$key}'") or die(mysql_error());
direct("?page=setting_profil¬if=success");
} else {
if ($table == "siswa") {
$nama = $_POST['nama'];
$jenisklm = $_POST['jenisklm'];
$tmp_lahir = $_POST['tmp_lahir'];
$tgl_lahir = $_POST['tgl_lahir'];
$email = $_POST['email'];
$no_telp = $_POST['no_telp'];
$primary = "nis";
$key = $data['nis'];
$ubah = mysql_query("update {$table} set nama='{$nama}', id_jenisklm='{$jenisklm}', tmp_lahir='{$tmp_lahir}', tgl_lahir='{$tgl_lahir}', no_telpon='{$no_telp}', email='{$email}' where {$primary}='{$key}'") or die(mysql_error());
direct("?page=setting_profil¬if=success");
}
}
}
}
}
} else {
lokasi("login");
}
示例9: isset
<tr>
<td width="75%" align="left">
<?php
if ($rows > $limit) {
?>
Halaman: <?php
$query->printNav();
?>
<?php
}
?>
</td>
<td width="25%" align="right">Jumlah: <b><?php
echo $rows;
?>
</b> guru</td>
</tr>
</table>
</div>
</div>
</div>
<?php
$menu = isset($_GET['menu']) ? $_GET['menu'] : '';
$id = isset($_GET['id']) ? $_GET['id'] : '';
if ($menu == "hapus") {
$hapus = mysql_query("delete from guru where id_guru='{$id}'");
echo "<script>alert('Data berhasil dihapus')</script>";
direct("?page=data_guru");
}
示例10: isset
<?php
} else {
?>
Tidak ditemukan data dengan keyword <i><b>"<?php
echo $key;
?>
"</b></i>. Silahkan ulangi pencarian dengan keyword yang lain!
<div style="margin-top: 5px;">
<button class="button-style" type="submit" name="back" onclick="history.back()">Kembali</button>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php
$menu = isset($_GET['menu']) ? $_GET['menu'] : '';
$id = isset($_GET['id']) ? $_GET['id'] : '';
if ($menu == "hapus") {
$hapus = mysql_query("delete from monitoring where id_monitoring='{$id}'");
echo "<script>alert('Data berhasil dihapus')</script>";
direct("?page=data_monitoring");
}
}
}
示例11: send
document.getElementById("docview").innerHTML = xmlhttp.responseText;
}
xmlhttp.open("POST","view_img.php",true);
xmlhttp.send();
}
var page = -1;
function send(inc)
{
<?php
if (logged_in() == FALSE) {
direct('login.php', 0);
}
?>
;
page = inc(page);
var docname = <?php
echo json_encode($_POST['docname']);
?>
;
xmlhttp.open("POST","view_img.php",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("pagenum="+page+"&docname="+docname);
}
load();
示例12: isset
$jumlah = $rows;
} else {
if ($level == 'admin') {
$jumlah = $rows - 1;
}
}
}
?>
</table>
<table width="100%" border="0" style="font-size: 12px; margin-top: 3px; margin-bottom: 15px;">
<tr>
<td width="75%" align="left">
</td>
<td width="25%" align="right">Jumlah: <b><?php
echo $jumlah;
?>
</b> user</td>
</tr>
</table>
</div>
</div>
</div>
<?php
$menu = isset($_GET['menu']) ? $_GET['menu'] : '';
$id = isset($_GET['id']) ? $_GET['id'] : '';
if ($menu == "hapus") {
$hapus = mysql_query("delete from user where username='{$id}'");
echo "<script>alert('Data berhasil dihapus')</script>";
direct("?page=data_user");
}
示例13: href
if (isset($_SESSION['auth'][$instance->segments['actor']])) {
?>
<ul class="nav">
<li><a href="<?php
href('auth/logout');
?>
">logout</a></li>
</ul>
<?php
}
?>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container-fluid">
<?php
template($instance->segments['action'], $vars);
?>
</div> <!-- /container -->
<script src="<?php
direct('twitter/bootstrap/js/bootstrap.min.js');
?>
"></script>
<script src="<?php
direct('crud/crud.js');
?>
"></script>
</body>
</html>
示例14: mysql_query
<input type="hidden" name="edit" value="penempatan" />
</form>
</div>
</div>
</div>
<script type="text/javascript">
var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1");
var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2");
var spryselect3 = new Spry.Widget.ValidationSelect("spryselect3");
var spryselect4 = new Spry.Widget.ValidationSelect("spryselect4");
</script>
<?php
if (isset($_POST['edit']) and $_POST['edit'] == "penempatan") {
$no_id = $data['no_id'];
$nis = $_POST['nis'];
$id_pembimbing = $_POST['id_pembimbing'];
$id_dudi = $_POST['id_dudi'];
$id_periode = $_POST['id_periode'];
$ubah = mysql_query("update penempatan set nis='{$nis}', id_pembimbing='{$id_pembimbing}', id_dudi='{$id_dudi}', id_periode='{$id_periode}' where no_id='{$no_id}'");
if ($ubah) {
direct("?page=edit_penempatan&id={$no_id}¬if=edited");
}
}
} else {
echo "<br /><center>ERROR 404<br />Page Not Found!</center>";
}
} else {
lokasi("login");
}
示例15: isset
</table>
<?php
} else {
?>
Tidak ditemukan data dengan keyword <i><b>"<?php
echo $key;
?>
"</b></i>. Silahkan ulangi pencarian dengan keyword yang lain!
<div style="margin-top: 5px;">
<button class="button-style" type="submit" name="back" onclick="history.back()">Kembali</button>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php
$menu = isset($_GET['menu']) ? $_GET['menu'] : '';
$id = isset($_GET['id']) ? $_GET['id'] : '';
if ($menu == "hapus") {
$hapus = mysql_query("delete from jurusan where id_jurusan='{$id}'");
echo "<script>alert('Data berhasil dihapus')</script>";
direct("?page=data_jurusan");
}