function dispPageDropDown($label, $ppage) { $con = new DBconn(); echo '<label>' . $label . '</label>'; echo '<select name="ppage" id="ppage" onchange="return perpage(this.form);">'; $pag_query = "select number,id from paging"; $pag_sel = $con->recordselect($pag_query); while ($pag_row = mysql_fetch_array($pag_sel)) { echo '<option value="' . $pag_row['number'] . '" ' . ($ppage == $pag_row['number'] ? 'selected="selected"' : '') . '>' . $pag_row['number'] . '</option>'; } echo '</select>'; }
content/12/defining-your-project/' title="Defining Your Project">Defining Your Project</a><br/> <a href="<?php echo SITE_URL; ?> help/" title="FAQ">FAQ</a><br/> <a href="<?php echo SITE_URL; ?> /blog/" title="Blog" >Blog</a><br/> </li> --> <li> <?php require_once DIR_FS . 'includes/functions/dbconn.php'; require_once DIR_FS . 'includes/functions/functions.php'; $con = new DBconn(); $con->connect(SITE_DB_HOST, SITE_DB_NAME, SITE_DB_USER, SITE_DB_PASS); if (!isset($links1)) { $links1 = ''; } if (!isset($links2)) { $links2 = ''; } $selectQuery = $con->recordselect("SELECT * from content"); if (mysql_num_rows($selectQuery) > 0) { while ($cms_arr = mysql_fetch_assoc($selectQuery)) { $column = $cms_arr['column']; if ($column == 1) { $href = SITE_URL . 'content/' . $cms_arr['id'] . '/' . Slug($cms_arr['title']) . '/'; $links1 .= "<a title='" . ucfirst($cms_arr['title']) . "' href='" . $href . "'><span class='footerblack'>" . $cms_arr['title'] . "</span></a><br/>"; } elseif ($column == 2) {
<?php global $theme; session_start(); // jwg - give access to site db require_once DIR_FS . 'includes/functions/dbconn.php'; require_once DIR_FS . 'includes/functions/functions.php'; $con = new DBconn(); $con->connect(SITE_DB_HOST, SITE_DB_NAME, SITE_DB_USER, SITE_DB_PASS); /* -- use function in dbconn function recordselect($qy,$st=0) { if($st==1) { print $qy; print '<br/>'; } $rs=mysql_query($qy) or die(mysql_error()."<br>".$qy); return $rs; } */ function stringShorter($str, $len = 0) { $len = (int) $len; $unsanaprotit = unsanitize_string(ucfirst($str)); $protit_len = strlen($unsanaprotit); if ($protit_len >= $len) { echo substr($unsanaprotit, 0, $len) . '...'; } else { echo substr($unsanaprotit, 0, $len); }
public static function findOneByPk($id) { $db = new DBconn(); $db->setClassName(get_called_class()); ///////////////////////// }
} else { if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'redirUrl=') !== false) { if (substr($c_url, -15, 15) == 'loginsignup.php') { // dealing (likely) with posted login form $x = strpos($_SERVER['HTTP_REFERER'], 'redirUrl='); $c_url = urldecode(substr($_SERVER['HTTP_REFERER'], $x + 9)); } } } if (strpos($login_url, '?') > 0) { $login_url .= "&parentUrl=" . $c_url; } else { $login_url .= "?parentUrl=" . $c_url; } //wrtlog("new login url=$login_url"); //wrtlog("-------------------------------------"); } /*echo "<script type='text/javascript'>var application_path='$base_url';</script>";*/ require_once DIR_FUN . 'dbconn.php'; global $con; $con = new DBconn(); $con->connect($db_host, $db_name, $db_user, $db_pass); // Front side panel variable declare $left_panel = true; $right_panel = true; $cont_mid_cl = ''; // If both panel false then '-100' value OR If only one panel false then '-75' value //require_once(DIR_INC.'db_const.php'); require_once DIR_FUN . 'validation.class.php'; require_once DIR_INC . "adminmessage.php"; //require_once(DIR_FUN.'function.php');
$txt = "\n <?php\n /*\n *---------------------------------------------------*\n *- here are set your DB specs -*\n *- this file is generated automatically by the -*\n *- db creation with form submit -*\n *---------------------------------------------------*/\n \n define('DB','{$dbName}');\n define('HOST','{$dbHost}');\n define('USER','{$dbUser}');\n define('PSW','{$dbPassword}');\n define('SALT','{$salt}');\n define('ROOT','{$dirname}');\n ?>\n "; fwrite($file, $txt); fclose($file); //creo DB $conn = new mysqli($dbHost, $dbUser, $dbPassword); $query = "CREATE DATABASE IF NOT EXISTS " . $dbName . " CHARACTER SET utf8 COLLATE utf8_general_ci"; $conn->query($query); echoResponse('yes', 'Setup quasi completato'); } else { echoResponse('no', 'Errore..contatta il supporto'); } } if (isset($_POST['completeSetup'])) { require_once "CLASS_db.php"; require_once "CLASS_user.php"; $db = new DBconn(); $prog = $_POST['progressivoImac']; //creazione tabella utenti (utilizzatori) $query = "CREATE TABLE IF NOT EXISTS utenti\n (username VARCHAR(20),\n password VARCHAR(100) NOT NULL,\n nome VARCHAR(20) NOT NULL,\n cognome VARCHAR(30) NOT NULL,\n admin INT(1) NOT NULL DEFAULT 0,\n PRIMARY KEY(username)) DEFAULT CHARSET=utf8 ENGINE InnoDB"; if (!$db->query($query)) { echo $db->error; } //creazione tabella dipendenti $query = "CREATE TABLE IF NOT EXISTS dipendenti\n (matricola VARCHAR(10),\n nome VARCHAR(30) NOT NULL,\n cognome VARCHAR(40) NOT NULL,\n PRIMARY KEY(matricola),\n INDEX(cognome(30))) DEFAULT CHARSET=utf8 ENGINE InnoDB"; if (!$db->query($query)) { echo $db->error; } //creazione tabella tipo richiesta $query = "CREATE TABLE IF NOT EXISTS tipo_richiesta\n (id INT(3) AUTO_INCREMENT,\n nome VARCHAR(30) NOT NULL,\n PRIMARY KEY(id)) DEFAULT CHARSET=utf8 ENGINE InnoDB"; if (!$db->query($query)) { echo $db->error;