Jump to content

dsp77

Members
  • Posts

    143
  • Joined

  • Last visited

Everything posted by dsp77

  1. i have stored in the db some images and when i try to call them for download i get corrupt file here is the code for display and download <?php // Connect to the database $dbLink = new mysqli('127.0.0.1', 'root', 'qazwsx123', 'diaspora_v2'); if(mysqli_connect_errno()) { die("MySQL connection failed: ". mysqli_connect_error()); } // Query for a list of all existing files $sql = 'SELECT `id`, `nume`, `prenume`, `name`, `mime`, `size`, `created` FROM `inregistrari`'; $result = $dbLink->query($sql); // Check if it was successfull if($result) { // Make sure there are some files in there if($result->num_rows == 0) { echo '<p>There are no files in the database</p>'; } else { // Print the top of a table echo '<table width="100%"> <tr> <td><b>Nume</b></td> <td><b>Prenume</b></td> <td><b>Name</b></td> <td><b>Mime</b></td> <td><b>Size (bytes)</b></td> <td><b>Created</b></td> <td><b> </b></td> </tr>'; // Print each file while($row = $result->fetch_assoc()) { echo " <tr> <td>{$row['nume']}</td> <td>{$row['prenume']}</td> <td>{$row['name']}</td> <td>{$row['mime']}</td> <td>{$row['size']}</td> <td>{$row['created']}</td> <td><a href='download.php?id={$row['id']}'>Download</a></td> </tr>"; } // Close table echo '</table>'; } // Free the result $result->free(); } else { echo 'Error! SQL query failed:'; echo "<pre>{$dbLink->error}</pre>"; } // Close the mysql connection $dbLink->close(); ?> <?php // Make sure an ID was passed if(isset($_GET['id'])) { // Get the ID $id = intval($_GET['id']); // Make sure the ID is in fact a valid ID if($id <= 0) { die('The ID is invalid!'); } else { // Connect to the database $dbLink = new mysqli('127.0.0.1', 'root', 'qazwsx123', 'diaspora_v2'); if(mysqli_connect_errno()) { die("MySQL connection failed: ". mysqli_connect_error()); } // Fetch the file information $query = " SELECT `mime`, `name`, `size`, `data` FROM `inregistrari` WHERE `id` = {$id}"; $result = $dbLink->query($query); if($result) { // Make sure the result is valid if($result->num_rows == 1) { // Get the row $row = mysqli_fetch_assoc($result); // Print headers header("Content-Type: ". $row['mime']); header("Content-Length: ". $row['size']); header("Content-Disposition: attachment; filename=". $row['name']); // Print data echo $row['data']; } else { echo 'Error! No image exists with that ID.'; } // Free the mysqli resources @mysqli_free_result($result); } else { echo "Error! Query failed: <pre>{$dbLink->error}</pre>"; } @mysqli_close($dbLink); } } else { echo 'Error! No ID was passed.'; } ?> i dont know why the headers are not correctly sent all files are JPG, or how can i display them not download.
  2. i have only tables like this <table id="tabela1" cellspacing="0" cellpadding="0"> <tr> <td align="center"><strong>Date</strong></td> <td align="center"><strong>Anul universitar 2004/2005</strong></td> <td align="center"><strong>Anul universitar 2008/2009</strong></td> </tr> <tr> <td>a. nume şi prenume</td> <td align="center"><input name="3_an0405_a" type="checkbox" id="3_an0405_a" value="1" /></td> <td align="center"><input name="3_an0809_a" type="checkbox" id="3_an0809_a" value="1" /></td> </tr> <tr> <td>b. sex </p></td> <td align="center"><input name="3_an0405_b" type="checkbox" id="3_an0405_b" value="1" /></td> <td align="center"><input name="3_an0809_b" type="checkbox" id="3_an0809_b" value="1" /></td> </tr> <tr> <td>c. naţionalitate</td> <td align="center"><input name="3_an0405_c" type="checkbox" id="3_an0405_c" value="1" /></td> <td align="center"><input name="3_an0809_c" type="checkbox" id="3_an0809_c" value="1" /></td> </tr> <tr> <td>d. domiciliu stabil</td> <td align="center"><input name="3_an0405_d" type="checkbox" id="3_an0405_d" value="1" /></td> <td align="center"><input name="3_an0809_d" type="checkbox" id="3_an0809_d" value="1" /></td> </tr> <tr> <td>e. număr telefon fix</td> <td align="center"><input name="3_an0405_e" type="checkbox" id="3_an0405_e" value="1" /></td> <td align="center"><input name="3_an0809_e" type="checkbox" id="3_an0809_e" value="1" /></td> </tr> <tr> <td>f. număr telefon mobil</td> <td align="center"><input name="3_an0405_f" type="checkbox" id="3_an0405_f" value="1" /></td> <td align="center"><input name="3_an0809_f" type="checkbox" id="3_an0809_f" value="1" /></td> </tr> <tr> <td>g. adresă e-mail</td> <td align="center"><input name="3_an0405_g" type="checkbox" id="3_an0405_g" value="1" /></td> <td align="center"><input name="3_an0809_g" type="checkbox" id="3_an0809_g" value="1" /></td> </tr> <tr> <td>h. facultatea absolvită</td> <td align="center"><input name="3_an0405_h" type="checkbox" id="3_an0405_h" value="1" /></td> <td align="center"><input name="3_an0809_h" type="checkbox" id="3_an0809_h" value="1" /></td> </tr> <tr> <td>i. domeniul de studiu</td> <td align="center"><input name="3_an0405_i" type="checkbox" id="3_an0405_i" value="1" /></td> <td align="center"><input name="3_an0809_i" type="checkbox" id="3_an0809_i" value="1" /></td> </tr> <tr> <td>j. media de absolvire</td> <td align="center"><input name="3_an0405_j" type="checkbox" id="3_an0405_j" value="1" /></td> <td align="center"><input name="3_an0809_j" type="checkbox" id="3_an0809_j" value="1" /></td> </tr> <tr> <td>k. alte date care nu sunt înscrise în baza de date, dar sunt trecute în alte documente</td> <td><textarea style="width:220px;" name="3_an0405_k" id="3_an0405_k"></textarea></td> <td><textarea style="width:220px;" name="3_an0809_k" id="3_an0809_k"></textarea></td> </tr> </table> $3_an0405_a=$_POST['3_an0405_a']; $3_an0405_b=$_POST['3_an0405_b']; $3_an0405_c=$_POST['3_an0405_c']; $3_an0405_d=$_POST['3_an0405_d']; $3_an0405_e=$_POST['3_an0405_e']; $3_an0405_f=$_POST['3_an0405_f']; $3_an0405_g=$_POST['3_an0405_g']; $3_an0405_h=$_POST['3_an0405_h']; $3_an0405_i=$_POST['3_an0405_i']; $3_an0405_j=$_POST['3_an0405_j']; $3_an0405_k=$_POST['3_an0405_k']; $3_an0809_a=$_POST['3_an0809_a']; $3_an0809_b=$_POST['3_an0809_b']; $3_an0809_c=$_POST['3_an0809_c']; $3_an0809_d=$_POST['3_an0809_d']; $3_an0809_e=$_POST['3_an0809_e']; $3_an0809_f=$_POST['3_an0809_f']; $3_an0809_g=$_POST['3_an0809_g']; $3_an0809_h=$_POST['3_an0809_h']; $3_an0809_i=$_POST['3_an0809_i']; $3_an0809_j=$_POST['3_an0809_j']; $3_an0809_k=$_POST['3_an0809_k']; $query="INSERT INTO tabela1 ( 3_an0405_a, 3_an0405_b, 3_an0405_c, 3_an0405_d, 3_an0405_e, 3_an0405_f, 3_an0405_g, 3_an0405_h, 3_an0405_i, 3_an0405_j, 3_an0405_k, 3_an0809_a, 3_an0809_b, 3_an0809_c, 3_an0809_d, 3_an0809_e, 3_an0809_f, 3_an0809_g, 3_an0809_h, 3_an0809_i, 3_an0809_j, 3_an0809_k) VALUES (' '$3_an0405_a', '$3_an0405_b', '$3_an0405_c', '$3_an0405_d', '$3_an0405_e', '$3_an0405_f', '$3_an0405_g', '$3_an0405_h', '$3_an0405_i', '$3_an0405_j', '$3_an0405_k', '$3_an0808_a', '$3_an0808_b', '$3_an0808_c', '$3_an0808_d', '$3_an0808_e', '$3_an0808_f', '$3_an0808_g', '$3_an0808_h', '$3_an0808_i', '$3_an0808_j', '$3_an0808_k',)"; the questions are static and the answer can be check box or input text. as u can see a part from the quiz its kinda long.
  3. Hello, I have a quiz to make with approximate 500 input boxes that i need to record in the data base, i am able to make them i use $question1=$_POST['question1']; $query="INSERT INTO quiz question1 VALUES $question1; etc. but there are to many i'm sure that is a better way not to write so many lines. Please guide me finding a better practice.
  4. i solved by doin like this: $hasRevista = false; // daca are revista $query2 = "SELECT * FROM performancecriteria WHERE project_id = $project AND year = 2010 AND type = 1;"; $query3 = "SELECT * FROM performancecriteria WHERE project_id = $project AND year = 2010 AND type = 2;"; $result2 = mysql_query($query2) or die("can not make query ". mysql_error()); $result3 = mysql_query($query3) or die("can not make query ". mysql_error()); $row = @mysql_fetch_row($result2); $row3 = @mysql_fetch_row($result3); if( $row[1] != 0 ) if( $row3[1] != 0 ) { $hasRevista = true; } i'm sure there is a better way...
  5. i have this code $hasRevista = false; // daca are revista $query2 = "SELECT * FROM performancecriteria WHERE project_id = $project AND year = 2010 AND type = 1;"; $result2 = mysql_query($query2) or die("can not make query ". mysql_error()); $row = @mysql_fetch_row($result2); if( $row[1] != 0 ) { $hasRevista = true; } then i output if( $hasRevista == true ) echo '<input type="button" style="height:1.8em; width:16em;" value="Anexa IIb" onClick="printAnexa2b();"; ></input>'; else echo '<input type="button" style="height:1.8em; width:16em;" value="Anexa IIb" onclick="alert(\'message\')">'; the thing is that i have type = 2 in the db and i want to verify if both or one is zero = false and if both are different from 0 = true. Untill now i just managed to do with type 1
  6. i have this code: <?php $query1="select * from performancecriteria where project_id = '$project' and type = 1 order by year"; $result1=mysql_query($query1) or die("can not make query1 ". mysql_error()); $row = @mysql_fetch_row($result1); while( $row ) { echo'<tr>'; echo'<td style="border: 1px dotted #000;" align="center">'; echo'&nbsp '.$row[2].''; echo'</td>'; echo'<td style="border: 1px dotted #000; padding:5px;" align="left">'; echo'Nr. <input style="width:20px;margin-left:46px;margin-bottom:5px;text-align:center;" type="text" name="totalValue'.$row[0].'" id="totalValue'.$row[0].'" value="'.$row[1].'" maxlength="2"></input><br />'; echo'Reviste* : <input style="width:380px;" type="text" name="totalISI'.$row[0].'" id="totalISI'.$row[0].'" value="'.$row[3].'"></input>'; echo'</td>'; echo'</tr>'; $row = @mysql_fetch_row($result1); } ?> it echoes a table with years 2009 2010 2011 echo'&nbsp '.$row[2].''; and i want to add 2 asteriks just to the year 2010 if i do echo'&nbsp '.$row[2].'**'; it will appear to all 3 years. please help.
  7. Hello, i created custom google search and the problem is that the results are shown on the same page overlapping other elements...how can i create a php or custom thing to redirect search queries to other pages like this one http://www.chryslerbrooklyn.com/
  8. i want to add a row to my end of the table but the name from the input forms needs to be different and i dont know how to increment the clone with 1 at every row added, i have this javascript code: $(document).ready(function() { $("#addrow").click(function() { $('#ORDERLINES tbody>tr:last').clone(true).insertAfter('#ORDERLINES tbody>tr:last'); return false; }); }); and the html <table id="ORDERLINES" cellspacing="1" class="tablesorter"> <thead> <tr> <th class="center">Nr. crt</th> <th class="center">Denumire</th> <th class="center">Document justificativ Denumire/ nr./ data</th> <th class="center">UM</th> <th class="center">Cant</th> <th class="center">Valoare totala (lei)</th> <th class="center">Valoare decontata din bugetul proiectului (lei)</th> </tr> </thead> <tr> <td class="center">1</td> <td><input name="item_no1" type="text" id="item_no1" value="" /></td> <td><input name="item-desc1" type="text" id="item-desc1" value="" /></td> <td><input name="item-desc1" type="text" id="item-desc1" value="" /></td> <td><input name="item-desc1" type="text" id="item-desc1" value="" /></td> <td><input name="item-desc1" type="text" id="item-desc1" value="" /></td> <td><input name="item-desc1" type="text" id="item-desc1" value="" /></td> </tr> <tr> <td class="center">2</td> <td><input name="item_no2" type="text" id="item_no2" value="" /></td> <td><input name="item-desc2" type="text" id="item-desc2" value="" /></td> <td><input name="item-desc2" type="text" id="item-desc2" value="" /></td> <td><input name="item-desc2" type="text" id="item-desc2" value="" /></td> <td><input name="item-desc2" type="text" id="item-desc2" value="" /></td> <td><input name="item-desc2" type="text" id="item-desc2" value="" /></td> </tr> </table> <table cellspacing="1" class="tablesorter"> <tr> <td colspan="5"><strong>TOTAL MATERIALE CONSUMABILE, PIESE DE SCHIMB:</strong></td> <td width="97"> </td> <td width="165"> </td> </tr> </table> <br /> <p class="tright"><a id="addrow" href="#"><strong>Adauga Linie</strong></a></p>
  9. I have a dilemma i have a input text field where the user inserts an hour and minutes like 12:00 and i want to save it in the data base like 11:59 and then display the correct hour like 12:00
  10. hello, i receive the error :Parse error: syntax error, unexpected $end in C:\xampp\xampp\htdocs\helpdesk\users.php on line 372 i looked allover the code but i can't find the curly bracket missing or what is generating the error <?php define('_VALID_','1'); $timestart = microtime(1); require 'inc/database.class.php'; require 'inc/users.class.php'; require 'inc/functions.inc.php'; $db = new database(); $link = $db->get_link_id(); $user = new userAccess($link); $page = 'View Users'; $id = $user->get_property('ID'); $user_details = $db->query_first("SELECT fname, lname, email, type, receive, created FROM ".DB_TABLE."users WHERE ID={$id}"); if ( $_GET['logout'] == 1 ) $user->logout('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); if ( !$user->is_loaded() ) { //Login stuff: if ( isset($_POST['login']) && isset($_POST['pwd'])){ if ( !$user->login($_POST['login'],$_POST['pwd'],$_POST['remember'] )){ $error = true; }else{ //user is now loaded header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); } } load_login($error); } elseif (!check_credentails($page,$user_details['type'])) { echo 'You have insufficient privileges.'; } else { if ($user_details['type'] == 3) { $deps = $db->fetch_all_array("SELECT DEPARTMENT_ID as dep FROM ".DB_TABLE."user_department WHERE USER_ID='{$id}'");; if ($deps) { $num = count($deps); $i = 0; $addon = " AND ("; foreach ($deps as $dep) { $addon .= " DEPARTMENT_ID='{$dep['dep']}'".($num != ++$i ? ' OR': ''); } $addon .= ")"; } else { // Has been assigned no departments, so they can't see any tickets $addon = " AND (DEPARTMENT_ID='-1')"; } } $tickets = $db->query_first("SELECT COUNT(*) as num FROM ".DB_TABLE."tickets WHERE `parent`='0' AND `status` != 'Resolved'".($user_details['type'] == 0 ? " AND `by`='{$id}'": '').$addon.";"); if (isset($_GET['id'])) { $user_id = (int) $_GET['id']; if (isset($_POST['submit'])) { $name = explode(" ",$_POST['name'],2); $data = Array ( 'fname' => $name['0'], 'lname' => $name['1'], 'email' => $_POST['email'], 'receive' => $_POST['receive'] ); if (isset($_POST['type'])) $data['type'] = $_POST['type']; if (trim($_POST['pass'] != '')) $data['pass'] = md5($_POST['pass']); $update = $db->query_update("users",$data,"ID='{$user_id}'"); $db->query("DELETE FROM ".DB_TABLE."user_department WHERE USER_ID='{$user_id}';"); if ($_POST['type'] == 3 && !empty($_POST['department'])) { foreach ($_POST['department'] as $department) $db->query_first("INSERT INTO ".DB_TABLE."user_department (`USER_ID`,`DEPARTMENT_ID`) VALUES ('$user_id','$department')"); } } $row = $db->query_first("SELECT fname, lname, email, type, receive, created FROM ".DB_TABLE."users WHERE ID={$user_id}"); $deps = $db->fetch_all_array("SELECT ".DB_TABLE."departments.ID FROM ".DB_TABLE."departments, ".DB_TABLE."user_department WHERE ".DB_TABLE."departments.ID=".DB_TABLE."user_department.DEPARTMENT_ID AND ".DB_TABLE."user_department.USER_ID='{$user_id}'"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Users</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="css/styles.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" language="javascript"></script> <script type="text/javascript" src="js/jquery.tablesorter.min.js"></script> <script type="text/javascript" src="js/jquery.tablesorter.pager.js"></script> <script src="js/jquery.livesearch.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript" charset="utf-8"> $(document).ready(function () { $('table#client_list tbody tr').quicksearch({ attached: "table#client_list", position: "before", labelText: null, inputText: 'Search users' }); $('.qs_input').ready }); </script> <script type="text/javascript"> $(document).ready(function(){ $('#close_message').click(function(){ $('#message').slideUp(); }); $('#mover').hide(); $('#type').change(function() { if($('#type').val() === "0" || $('#type').val() === "1" || $('#type').val() === "2" ) $('#mover').slideUp('normal'); else $('#mover').slideDown('normal'); }); <?php if ($row['type'] == 3) echo "$('#mover').slideDown('normal');"; ?> $("#nav li ul").hide(); $("#nav li a.active").parent().find("ul").slideToggle("normal"); $("#nav li a.top-item").click( function () { $(this).parent().siblings().find("ul").slideUp("normal"); $(this).next().slideToggle("normal"); return false; } ); $("#nav li a.no-sub").click( function () { window.location.href=(this.href); return false; } ); $("#nav li .top-item").hover( function () { $(this).stop().animate({ paddingRight: "25px" }, 200); }, function () { $(this).stop().animate({ paddingRight: "16px" }); } ); }); </script> </head> <body> <div id="wrapper"> <div id="sidebar"> <div id="header"> <h1 id="logo">QuickTick<small><?php echo VERSION ?></small></h1> <div id="greeting">Welcome, <?php echo $user_details['fname'].' '.$user_details['lname'] ?> | <a href="<?php echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?logout=1'; ?>">Logout?</a></div> </div> <?php load_menu($user_details['type'], $page, $tickets['num']); ?> </div> <div id="content"> <?php if (isset($user_id)) { if (isset($_POST['submit']) && $update) echo '<div id="message" class="success"><p><img id="close_message" style="float:right;cursor:pointer" src="img/cancel.png" /><big>Success!</big><br />User has been successfully updated!</p></div>'; elseif (isset($_POST['submit'])) echo '<div id="message" class="error"><p><img id="close_message" style="float:right;cursor:pointer" src="img/cancel.png" /><big>Error!</big><br />User has not been successfully updated! We apologize for the inconvenience. Try again, and if the problem persists, please send us an email at <a href="mailto:'.ADMIN_EMAIL.'">'.ADMIN_EMAIL.'</a> or contact Tommy (The Developer) at <a href="mailto:quicktick@sirestudios.com">quicktick@sirestudios.com</a>.</p></div>'; if ($row) { echo ' <div style="float:left;width:90px;height:90px;"> '.get_gravatar($message['email'],'http://'.$_SERVER['HTTP_HOST'].WEBSITE_PATH.'/img/gravatar.jpg',80).' </div> <div style="float:left;"><h1 style="margin: 20px 0 0 0;">'.$row['fname'].' '.$row['lname'].'</big></h1> <span style="color:#999;">Created '.relative_date($row['created']).'</span> </div> <br class="clr" /><br />'; ?> <div class="col"> <form action="" method="post" class="form"> <input type="hidden" name="created" value="<?php echo date("Y-m-d H:i:s") ?>" /> <label>First and Last Name</label> <?php if ($user_details['type'] <= 2) echo '<input type="text" name="name" class="text" value="'.$row['fname'].' '.$row['lname'].'" />'; else echo '<big>'.$row['fname'].' '.$row['lname'].'</big>'; ?> <label>Email</label> <?php if ($user_details['type'] <= 2) echo '<input type="text" name="email" class="text" value="'.$row['email'].'" />'; else echo '<big><a href="mailto:'.$row['email'].'">'.$row['email'].'</a></big>'; ?> <?php if ($user_details['type'] <= 2) echo '<label>Password <span>Enter a new password for user</span></label><input type="password" name="pass" class="text" />'; ?> <label>Account Type</label> <?php if ($user_details['type'] <= 2) { if ($row['type'] != 1) { echo '<select name="type" class="dropdown" id="type">'; if ($user_details['type'] == 1) echo '<option value="1"'.($row['type']==1 ? ' selected="selected"' : '').'>Administrator</option>'; if ($user_details['type'] < 2) echo '<option value="2"'.($row['type']==2 ? ' selected="selected"' : '').'>Manager</option>'; if ($user_details['type'] < 3) echo '<option value="3"'.($row['type']==3 ? ' selected="selected"' : '').'>Staff</option>'; echo '<option value="0"'.($row['type']==0 ? ' selected="selected"' : '').'>User</option>'; } elseif ($user_details['type'] == 1 && $row['type'] == 1) { echo '<select name="type" class="dropdown" id="type">'; echo '<option value="1"'.($row['type']==1 ? ' selected="selected"' : '').'>Administrator</option>'; echo '<option value="2">Manager</option>'; echo '<option value="3">Staff</option>'; echo '<option value="0">User</option>'; } else echo '<big>'.get_type($row['type']).'</big>'; } elseif ($user_details) echo '<big>'.get_type($row['type']).'</big>'; if ($user_details['type'] <= 2) echo '</select>'; ?> </select> <div id="mover"> <?php $array = $db->fetch_all_array("SELECT name, value FROM ".DB_TABLE."settings;"); foreach($array as $val){ $settings[$val['name']] = $val['value']; } $rows = $db->fetch_all_array("SELECT ID, name FROM ".DB_TABLE."departments"); foreach ($deps as $dep) { $user_deps[] = $dep['ID']; } if ($user_details['type'] <= 2) { echo '<label>Department <span>Hold SHIFT to select multiple departments</span></label> <select name="department[]" class="dropdown" multiple="multiple" size="'.$db->affected_rows().'">'; foreach ($rows as $each) { echo '<option value="'.$each['ID'].'"'.(in_array($each['ID'],$user_deps) ? ' selected="selected"': '').($user_details['type']==3 ? ' disabled="disabled"': '').'>'.$each['name'].'</option>'; } echo '</select>'; } elseif ($row['type'] == 3) { echo '<label>Assigned Departments</label> <ul class="big_list">'; foreach ($deps as $dep) { $res = $db->query_first("SELECT name FROM ".DB_TABLE."departments WHERE ID='{$dep['ID']}'"); echo '<li>'.$res['name'].'</li>'; } echo '</ul>'; } ?> </div> <label>Receive Notifications</label> <?php if ($user_details['type'] <= 2) { ?> <select name="receive" class="dropdown"> <option value="1"<?php if($row['receive']=='1')echo ' selected="selected"'; ?>>Yes</option> <option value="0"<?php if($row['receive']=='0')echo ' selected="selected"'; ?>>No</option> </select> <?php } else { if ($row['receive']=='1') echo '<big>Yes</big>'; else echo '<big>No</big>'; } ?> <label> </label> <input type="submit" value="Update User" name="submit" class="submit" /> </form> </div> <? } } else { $rows = $db->fetch_all_array("SELECT `ID`, `fname`, `lname`, `email`, `created`, `type` FROM ".DB_TABLE."users ORDER BY `type` = 0;"); if ($rows) { echo ' <h2>View Users</h2> <table id="client_list" class="tablesorter"> <thead> <tr> <th>ID</th> <th>Name</th> <th>Email</th> <th>Created</th> <th>User Type</th> </tr> </thead> <tbody> '; foreach ($rows as $row) { echo '<tr> <td style="text-align:center;"><a href="users.php?id='.$row['ID'].'">'.$row['ID'].'</a></td> <td><a href="users.php?id='.$row['ID'].'">'.$row['fname'].' '.$row['lname'].'</a></td> <td><a href="mailto:'.$row['email'].'">'.$row['email'].'</a></td> <td>'.relative_date($row['created']).'</td> <td>'.get_type($row['type']).'</td> </tr> '; } echo '</tbody></table>'; } else { echo 'No clients yet!'; } echo ' <div id="pager_client" class="pager"> <form> <span class="first">First</span> <span class="prev">Prev</span> <input type="text" class="pagedisplay" disabled="disabled" /> <span class="next">Next</span> <span class="last">Last</span> <select class="pagesize"> <option value="25">25 per page</option> <option value="50">50 per page</option> <option value="100">100 per page</option> <option value="999999">View All</option> </select> </form> </div>'; } ?> <script defer="defer"> $(document).ready(function() { $("#client_list") .tablesorter({widthFixed: false, widgets: ['zebra']}) .tablesorterPager({container: $("#pager_client")}); } ); </script> </div> </div> <br class="clr" /> </body> </html> <?php } $db->close(); $elapsed_time = microtime(1)-$timestart; printf("<!--// Generated %s database queries in %f seconds //-->",$db->get_num_queries(),$elapsed_time); ?>
  11. ill make the changes it in this weekend cuz i'm to lazy to do my stuff
  12. i could use the main header from my other website http://www.dsp-studio.ro about the header picture you are right it looks a bit to simple i was thinking of making a slide show with a few pictures.
  13. thank you for spotting that mistake i noticed that i forgot to add the png fix to:)
  14. no, its not a template in the way are you thinking it gives the feel of a template because we psd to xhtml, about the noise you are right if the user has a low resolution.
  15. Thank you all for the comments ill take them in consideration.
  16. i have a calendar in wordpress, everything works great except that i can make 2 meetings at the same date, time and room without receiving any error i don't know where to start to compare the days hours with location (the 2 different tables are confusing me). To explain better i have like this: Table1 with: Start Date, End Date, Start Hour, End Hour and other things not important for validation Table2 with: Room1, Room2, Room3 etc What MYSQL syntax to use or what code i'm brain dead now i don't know from where to start, at least someone can tell me the logic from where to start.
  17. feel free to post anything good or bad thanks http://www.xhtmlwebdesign.com/
  18. i have a calendar in wordpress, everything works great except that i can make 2 meetings at the same date, time and room without receiving any error i don't know where to start to compare the days hours with location (the 2 different tables are confusing me) i'm willing to donate/pay if i can make this work. To explain better i have like this: Table1 with: Start Date, End Date, Start Hour, End Hour and other things not important for validation Table2 with: Room1, Room2, Room3 etc i attached the source code [attachment deleted by admin]
  19. thank you so much it worked, i saw that missing $ to a bit late:P
  20. well this is my code: <?php require_once('config.php'); $result=mysql_query("select * from table order by id asc"); ?> <?php while($row=mysql_fetch_assoc($result)){ ?> <table class="table_i" cellpadding="1" cellspacing="1" id="resultTable"> <thead> <tr> <th bgcolor="orange"><strong>ID</strong></th> <th bgcolor="orange"><strong>Name</strong></th> <th bgcolor="orange"><strong>Value</strong></th> </tr> </thead> </table> <?php while($row=mysql_fetch_assoc($result)){ ?> <tr> <td><?php echo $row['id']; ?></td> <td><?php echo $row['name']; ?></td> <td><?php echo $row['value']; ?></td> </tr> <?php } ?> if i use $x = (row['somerow'] == 0) ? "No": "Yes"; echo $x; i get Parse error: syntax error, unexpected '[' and if i use the query i get a boolean error Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in
  21. Hello, I have this in the table: "value" type int 0 to represent false and 1 to represent true. everything works great in display to the user end it sees 0 or 1 i want to replace the 0 to display No and 1 to display Yes or a picture. please advise me how can i make this work.
  22. thank you but now i have a new problem, i want to show to the user only the valid = 1 rows but not as 1 as yes.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.