$this->jsone('success', $json); } public function saveProfile($content) { $password = $content['user_password'] ? md5($content['user_password']) : null; $cansms = $content['user_cansms'] == 'Y' ? 'true' : 'false'; $this->query("UPDATE users SET user_cansms = {$cansms}, user_sms='{$content['user_sms']}' WHERE id='{$this->user->id}'"); if ($password) { $this->query("UPDATE users SET user_password = '******' WHERE id='{$this->user->id}'"); } $json = []; $json['gtitle'] = "Settings Updated"; $json['gbody'] = "Your settings have been saved."; $json['action'] = 'fade'; $this->jsone('success', $json); } } $mod = new index(); if (isset($_POST['createTicket'])) { $mod->createNewTicket($_POST); } else { if (isset($_GET['selfAssign'])) { $mod->selfAssign($_GET); } else { if (isset($_POST['saveProfile'])) { $mod->saveProfile($_POST); } else { $mod->main(); } } }
<?php class index { function __construct() { } function main() { require_once 'shiritori.php'; } } $index = new index(); $index->main();