function _helpsearch($params) { $user = $params['user']; $channel = $params['channel']; $helpsearch = $params['helpsearch']; $server = Option::get('projectsdot', 'server'); $pduser = Option::get('projectsdot', 'user'); $pdpass = Option::get('projectsdot', 'pass'); $database = Option::get('projectsdot', 'database'); $site = Option::get('projectsdot', 'site'); $db = new DB("mysql:host={$server->value};dbname={$database->value}", $pduser->value, $pdpass->value, 'projectsdot'); $helplinks = $db->results("select n.nid, n.title, b.weight from node n, node_revisions r, book b where n.vid = r.vid and b.vid = n.vid and n.type = 'book' and r.body like CONCAT('%', :crit, '%');", array('crit' => $helpsearch)); $title = 'Help Search'; $body = 'The book topics on the left contained the search phrase "' . htmlspecialchars($helpsearch) . '".'; foreach ($helplinks as $link) { $links .= '<li><a href="#' . $link->nid . '" onclick="send(\'/help ::' . $link->nid; if ($helpsearch != '') { $links .= ' ' . htmlspecialchars($helpsearch); } $links .= '\');return false;">' . $link->title . '</a></li>'; } $msg = '<a href="#" class="close" onclick="return closedrawer({$drawer_id});">close this drawer</a><div id="helplinks" style="width:30%;float:left;height:200px;overflow-y:auto;overflow-x:hidden;"><ul>' . $links . '</ul></div> <div id="helpbody" style="width:70%;height:200px;overflow:auto;float:left;"><h3>' . $title . '</h3>' . $body . '</div>'; DB::get()->query("DELETE FROM drawers WHERE indexed = 'help' and user_id = :user_id;", array('user_id' => $user->id)); DB::get()->query("INSERT INTO drawers (user_id, message, indexed, cssclass) VALUES (:user_id, :msg, 'help', 'help');", array('user_id' => $user->id, 'msg' => $msg)); $msg = 'Removed the "' . htmlspecialchars($name) . '" calendar.'; $obj = new StdClass(); $obj->laststatus = 0; $obj->js = "refreshDrawers();"; echo json_encode($obj); die; return true; }
/** * Mengambil semua data record. * * @return array */ public function all() { $this->db->get($this->table); return $this->db->results(); }
<script src="bootstrap/js/jquery.min.js" type="text/javascript"></script> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> <script src="bootstrap/js/bootstrap.min.js"></script> <script src="javascript/get.js" type="text/javascript"></script> </head> <body class="body"> <?php require_once 'core/init.php'; $user = new User(); if (!$user->isLoggedIn()) { Session::flash('home', "danger # Неоторизиран достъп, моля влезте в системата."); Redirect::to('login.php'); } $db = new DB(); $db->get('users', array('section', '=', '1')); $result = $db->results(); ?> <div class="container"> <div class="page-header"> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.php">Deliver IT <span class="glyphicon glyphicon-send"></span></a> </div> <div class="navbar-collapse collapse">
<?php $db = new DB(); $params = array('to_town' => $user->data()->name); $db->query('SELECT `from_town`, `price`,`code`,`current`, `to_date` FROM orders WHERE `to_town` = ? ORDER BY to_date ASC LIMIT 5', $params); if ($db->count()) { echo '<table class="table table-hover table-bordered">'; echo '<thead>'; echo '<tr>'; echo '<th>От</th>'; echo '<th>Текуща локация</th>'; echo '<th>Цена</th>'; echo '<th>Код</th>'; echo '</tr>'; echo '</thead>'; echo '<tbody>'; foreach ($db->results() as $key) { echo '<tr>'; echo '<td>' . $key->from_town . '</td>'; echo '<td>' . $key->current . '</td>'; echo '<td>' . $key->price . ' лв.</td>'; echo '<td>' . $key->code . '</td>'; } echo '</tbody>'; echo '</table>'; } else { echo 'Не се очакват поръчки.'; } ?> </div> </div> </div>
if (!$wcheck) { echo "This {$DB_WORDPRESS} service is UNAVAILABLE"; die; } message('Database Connection successful'); //Empty the current worpdress Tables $wc->query("TRUNCATE TABLE " . $DB_WORDPRESS_PREFIX . "comments"); $wc->query("TRUNCATE TABLE " . $DB_WORDPRESS_PREFIX . "links"); $wc->query("TRUNCATE TABLE " . $DB_WORDPRESS_PREFIX . "postmeta"); $wc->query("TRUNCATE TABLE " . $DB_WORDPRESS_PREFIX . "posts"); $wc->query("TRUNCATE TABLE " . $DB_WORDPRESS_PREFIX . "term_relationships"); $wc->query("TRUNCATE TABLE " . $DB_WORDPRESS_PREFIX . "term_taxonomy"); $wc->query("TRUNCATE TABLE " . $DB_WORDPRESS_PREFIX . "terms"); message('Wordpress Table Truncated'); //Get all drupal Tags and add it into worpdress terms table $drupal_tags = $dc->results("SELECT DISTINCT d.tid, d.name, REPLACE(LOWER(d.name), ' ', '_') AS slug FROM " . $DB_DRUPAL_PREFIX . "taxonomy_term_data d INNER JOIN " . $DB_DRUPAL_PREFIX . "taxonomy_term_hierarchy h ON (d.tid = h.tid) ORDER BY d.tid ASC"); foreach ($drupal_tags as $dt) { $wc->query("REPLACE INTO " . $DB_WORDPRESS_PREFIX . "terms (term_id, name, slug) VALUES ('%s','%s','%s')", $dt['tid'], $dt['name'], $dt['slug']); } //Update worpdress term_taxonomy table $drupal_taxonomy = $dc->results("SELECT DISTINCT d.tid AS term_id, 'post_tag' AS post_tag, d.description AS description, h.parent AS parent FROM " . $DB_DRUPAL_PREFIX . "taxonomy_term_data d INNER JOIN " . $DB_DRUPAL_PREFIX . "taxonomy_term_hierarchy h ON (d.tid = h.tid) ORDER BY 'term_id' ASC"); foreach ($drupal_taxonomy as $dt) { $wc->query("INSERT INTO " . $DB_WORDPRESS_PREFIX . "term_taxonomy (term_id, taxonomy, description, parent) VALUES ('%s','%s','%s','%s')", $dt['term_id'], $dt['post_tag'], $dt['description'], $dt['parent']); } message('Tags Updated'); // Update worpdress category for a new Blog entry (as catgegory) which // is a must for a post to be displayed well // Insert a fake new category named Blog $wc->query("INSERT INTO " . $DB_WORDPRESS_PREFIX . "terms (name, slug) VALUES ('%s','%s')", 'Blog', 'blog'); // Then query to get this entry so we can attach it to content we create $blog_term_id = 0;