patk570 42 Newbie Poster

here is one with the mailform included.

<?php 
//email
if(isset($_POST['emailus'])) {
$result = "";   
$name = mysql_real_escape_string($_POST['cust_name']); // required
$to_email = mysql_real_escape_string($_POST['opttwo']);// required
$from_email = mysql_real_escape_string($_POST['email']);// required
$message = mysql_real_escape_string($_POST['feedback']);// required

    // EDIT THE 2 LINES BELOW AS REQUIRED
    $email_to = $to_email;
    $email_subject = "Message from website"; //Edit this message if you want to

    $email_message = "Form details below.\n\n";


    $email_message .= "Name: ".$name."\n";
    $email_message .= "Email: ".$from_email."\n";
    $email_message .= "Comments: ".$message."\n";

// create email headers
$headers = 'From: '.$name."\r\n".
'Reply-To: '.$from_email."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);  
}
//send
$result = '<span class="success">Thanks for contacting us, someone will get back to you soon</span>';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
* {
    margin:0;
    padding:0;
    border:0;
    outline:0;
}
body {
    font-family:Verdana, Geneva, sans-serif;
}
input    {
width:375px;
display:block;
border: 1px solid #999;
height: 25px;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
}
form    {
background: -webkit-gradient(linear, bottom, left 175px, from(#CCCCCC), to(#EEEEEE));
background: -moz-linear-gradient(bottom, #CCCCCC, #EEEEEE 175px);
margin:auto;
position:relative;
width:550px;
height:450px;
font-size: 14px;
font-style: italic;
line-height: 24px;
font-weight: bold;
color: #09C;
text-decoration: none;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
padding:10px;
border: 1px solid #999;
border: inset 1px solid #333;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
}
textarea#feedback {
width:375px;
height:150px;
}
textarea.message {
display:block;
}
.subbutton …
patk570 42 Newbie Poster

here ya go! Copy and paste this:

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
* {
    margin:0;
    padding:0;
    border:0;
    outline:0;
}
body {
    font-family:Verdana, Geneva, sans-serif;
}
input    {
width:375px;
display:block;
border: 1px solid #999;
height: 25px;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
}
form    {
background: -webkit-gradient(linear, bottom, left 175px, from(#CCCCCC), to(#EEEEEE));
background: -moz-linear-gradient(bottom, #CCCCCC, #EEEEEE 175px);
margin:auto;
position:relative;
width:550px;
height:450px;
font-size: 14px;
font-style: italic;
line-height: 24px;
font-weight: bold;
color: #09C;
text-decoration: none;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
padding:10px;
border: 1px solid #999;
border: inset 1px solid #333;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
}
textarea#feedback {
width:375px;
height:150px;
}
textarea.message {
display:block;
}
.subbutton {
width:100px;
position:absolute;
right:20px;
bottom:20px;
background:#09C;
color:#fff;
font-family: Tahoma, Geneva, sans-serif;
height:30px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
border: 1p solid #999;
}
.subbutton:hover {
background:#fff;
color:#09C;
}
textarea:focus, input:focus {
border: 1px solid #09C;
}
</style>
<script type="text/javascript">
 function setOptions(chosen) {
var selbox = document.myform.opttwo;

selbox.options.length = 0;
if (chosen == "0") {
  selbox.options[selbox.options.length] = new Option('Please choose above',' ');

}
if (chosen == "1") {
  selbox.options[selbox.options.length] = new
Option('sales@demo.com','sales@demo.com');
  selbox.options[selbox.options.length] = new
Option('sales2@demo.com','sales2@demo.com');
}
if (chosen == "2") {
  selbox.options[selbox.options.length] = new
Option('support@demo.com','support@demo.com');
  selbox.options[selbox.options.length] = new
Option('support2@demo.com','support2@demo.com');
}
if (chosen == "3") {
  selbox.options[selbox.options.length] = new
Option('other@demo.com','other@demo.com');
  selbox.options[selbox.options.length] …
patk570 42 Newbie Poster

just put the email address of your phone ie:

+17775558855@tmobmail.net
see complete list here:
        [Phone email list..](http://www.emailtextmessages.com/)
patk570 42 Newbie Poster

No one is going to write code for you. What have you tried so far?

patk570 42 Newbie Poster

Another option would be to add an arrow that is fixed to the bottom of the div that show that there is more and disappears when they reach the bottom of the text. For that I would use jquery...

patk570 42 Newbie Poster

Bootstrap CSS makes a great framework. I love the responsivness of it. I am building my current website based on it now. They have so many options for usage. Bootstrap Css Webpage

patk570 42 Newbie Poster

try this:

overflow-y: scroll;
overflow: -moz-scrollbars-vertical;
overflow: scroll;
patk570 42 Newbie Poster

Here is a fiddle: Click Here

patk570 42 Newbie Poster

Try this:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
    .site-logo{
    display: block;
    text-align: left;
    color: #9FA32E;
    font-family: "Trebuchet MS",Arial,Helvetica,Sans-Serif;
    font-size: 42px;
    }
    a {
    color: royalblue;
    text-decoration: none;
    }
    a:visited {
    color: purple;
    text-decoration: none;
    }
    a:hover,
    a:focus,
    a:active {
    color: midnightblue;
    text-decoration: none;
    }
</style>
</head>

<body>
     <div class="site-logo">
    <h1 class="site-title">
    <a href="http://10.0.0.201/wp/" title="Document &amp; Draft" rel="home">Document &amp; Draft</a>
    </h1>
    <h2 class="site-description">For power CAD users</h2>
    </div>
</body>
</html>
patk570 42 Newbie Poster
patk570 42 Newbie Poster

Do not hardcode the www.mydomain.com/ just use the /subfolder/index.php Since it all attached to the same site and you are already on SSL, all you need to do/use is /subfolder/htmlfile

patk570 42 Newbie Poster

have you tried something like:

if($timeout =="" || $timein ==""){
echo 'Absent';
}
patk570 42 Newbie Poster

Your welcome.

patk570 42 Newbie Poster

Also just noticed that you have your connect.php in there multiple times, you only need it once in there. Move it to the top of the page where you have <?php require 'includes/verifycred.php'; ?>

patk570 42 Newbie Poster

Thats because its never reaching that point yet. Make sure that all your lines in the update query are closed off properly. You are getting an error in there. copy and paste this into you code.

    $update_query = "UPDATE `articles` SET `articles_date`='$articles_date1', `articles_title`='$articles_title1', `articles_category`='$articles_category1', `articles_image`='$articles_image1', `articles_content`='$articles_content1' WHERE `articles_id`='$update_id'" or die(mysql_error());
patk570 42 Newbie Poster

this line also needs to closed with a ', articles_title='$articles_title1,`

patk570 42 Newbie Poster

Try this:

$update_query = "update `articles` set `articles_date`='$articles_date1', `articles_title`='$articles_title1, `articles_category`='$articles_category1', `articles_image`='$articles_image1', `articles_content`='$articles_content1' WHERE `articles_id`='$update_id'" or die(mysql_error());
patk570 42 Newbie Poster

put at the top of the page error_reporting(E_ALL); and see what errors come from the page.

patk570 42 Newbie Poster

Fixed it:

$count = mysqli_query($mysqli, "SELECT (SELECT COUNT(*) FROM assets WHERE cust_id=$custID AND asset_type='hardware') + (SELECT COUNT(*) FROM assets WHERE cust_id=$custID AND asset_type='software') AS total_count");
echo mysqli_error($mysqli);
$count = mysqli_fetch_object($count);
$count = $count->total_count;
patk570 42 Newbie Poster

I am trying to do a count of all types in there(hardware and software) I thought i had the correct structure...but I guess i am wrong...

$count = mysqli_query($mysqli, "SELECT COUNT(*) AS total_count FROM assets WHERE cust_id=$custID AND (asset_type='hardware' AND asset_type='software') ");
echo mysqli_error($mysqli);
$count = mysqli_fetch_object($count);
$count = $count->total_count;

any help would be great..

patk570 42 Newbie Poster

have you tried something like

if($_SESSION['username']==true){
    echo '<li>Other Members</li>';
    }else{
    echo '';
    }
patk570 42 Newbie Poster

I found this by doing a simple search still using the tablesorter

http://jsfiddle.net/Mottie/Yke6M/

patk570 42 Newbie Poster

Are these values for a specific person or all people in the database?

patk570 42 Newbie Poster

Try this JQuery Tablesorter Code

patk570 42 Newbie Poster

in the head section put:

 <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
patk570 42 Newbie Poster

Also, remove readonly

patk570 42 Newbie Poster

Try this:

 <script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>



<input class="input" name="date" type="text" id="datepicker">
patk570 42 Newbie Poster

Why not trying:

PHP code:

<?php
if(isset($_POST['BTN_NAME']){
        //do fucnction or query here.  
    }
    if(isset($_POST['buttonA']){
        //do stuff here
    }
?>

HTML

<form action="" method="post" name="TestForm">
    <input type="text" name="text1">
    <input type="submit" value="Run Search" name="BTN_NAME">
</form>

<form action="" method="post" name="TestButtonA">
    <input type="submit" value="Button A" name="buttonA"
</form>
patk570 42 Newbie Poster

That is perfect! Thank you very much for this.

patk570 42 Newbie Poster

Hello, I have a function that is working to generate the navigation bar, it grabs the parents and the "childs" and displays them but I have noticed that it is not closing the ul, li tags properly. I will attach a screen shot below.

My code is this:

<?
include 'config.php';
function showMenu($level = 0) {

$result = mysql_query("SELECT * FROM `tbl_structure` WHERE `PARENTID` = ".$level); 
echo "<ul class='nav'>";
    while ($node = mysql_fetch_array($result)) { 
        echo "<li><a href='prodid=".$node['ID']."'>".$node['NAME'];
        $hasChild = mysql_fetch_array(mysql_query("SELECT * FROM `tbl_structure` WHERE `PARENTID` = ".$node['ID'])) != null;
        if ($hasChild) {
            showMenu($node['ID']);
        }
        echo "</a></li>";
    }
echo "</ul>";
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="testcss.css" rel="stylesheet" type="text/css" />
</head>

<body>

<? echo showMenu() ?>

</body>
</html>

Any help would be great!
Thanks

patk570 42 Newbie Poster

Ive looked at that. But I dont want to have to go to a third party app to update the tasklist/appointments. I would like to do it all from the website.

patk570 42 Newbie Poster

Hello,

I am looking for a calendar to use with my website that I can add tasks/appointments into the db and have them show on the calendar. I would like to edit on the fly either by using a page to create the task/appointment or via the calendar using ajax.

Thanks in advance

Patrick.

patk570 42 Newbie Poster

I think i got it now.

<table width="100%" cellpadding="5" cellspacing="5"><tr>
              <?php
$cols=4;              
$folder = "images/ticket_images/".$_REQUEST['ticketid']."/";
$filetype = '*.*';
$files = glob($folder.$filetype);

for ($i=0; $i<count($files); $i++) {
$cols++;
    echo '<td align="center">';
    echo '<a name="'.$files[$i].'" href="'.$files[$i].'"><img width="100" height="100" src="'.$files[$i].'" /></a><br><span style=" font-size:8px; color:#339;"><a href="ticketdetails.php?ticketid='.$_REQUEST['ticketid'].'&amp;removepic=1&filename='.substr($files[$i],strlen($folder),strpos($files[$i], '.')-strlen($folder)).'.'.end(explode('.', $files[$i])).'">Delete</a></span>';
    echo '</td>';
    if ($cols % 4 == 0) {
        echo '</tr><tr>';
}
}
?>
</tr></table>
patk570 42 Newbie Poster

I tried this, but its not working.

    <?php
    $col =0
    $folder = "images/ticket_images/".$_REQUEST['ticketid']."/";
    $filetype = '*.*';
    $files = glob($folder.$filetype);
    echo '<table><tr>';
    for ($i=0; $i<count($files); $i++) {
    $col++
    echo '<td>';
    echo '<a name="'.$files[$i].'" href="'.$files[$i].'"><img width="100" height="100" src="'.$files[$i].'" /></a>';
    echo '</td>';
    if($col % 4) print '</tr><tr>';
    }else{

    echo '</tr></table>';
    }
    ?>
patk570 42 Newbie Poster

Hello everyone,

I have a code to display images in a table for a specific ticket. I am needing the table to be 4 columns wide then repeat until there is no more images to show.

Here is my code:

<?php
$folder = "images/ticket_images/".$_REQUEST['ticketid']."/";
$filetype = '*.*';
$files = glob($folder.$filetype);
echo '<table><tr>';
for ($i=0; $i<count($files); $i++) {
    echo '<td>';
    echo '<a name="'.$files[$i].'" href="'.$files[$i].'"><img width="100" height="100" src="'.$files[$i].'" /></a>';

    echo '</td>';
}
echo '</tr></table>';
?>

Any help would be great.

Thanks,
Patrick

patk570 42 Newbie Poster

What i am trying to acheive here is have the slider move all the elements that is listed in the php code, by using something similar to the one i posted but have the elements on a delay, The picture should go first, the title, quick text and next article should go after that.

patk570 42 Newbie Poster

Hello everyone,

I am looking for a banner/slider for both images and text. I want to be able to display 3 articles that are attached to the blog I am making and have them rotate, Here is an image of where the content will go.

47dd24c076f663f88f6d78c35f640cc9

I would like a slider like this one: Click here but with the query string and while string to show in the right places. Any ideas would be helpful, I already have a php code for this:

  <div>
  <?php
            $sql = 'SELECT * FROM `blog` ORDER BY `id` DESC LIMIT 0,3';
            $result = mysql_query($sql);

            while ($record = mysql_fetch_assoc($result)){
              $url = $record['productname'];
              $text = $record['price'];
              echo'<img src="images/blog/'.$record['img'].'" alt="pic" width="252" height="109" />';
              echo' <h3>'.$record['blogtitle'].',</h3>';
              echo' <p class="midText">';?><?php $position=22;

                $message=$record['article'];
                $post = substr($message, 0, $position);

              echo $post;
              echo '...<font size="-2"><a href="blog.php?blogid='.$record['id'].'">Read More</a></font>'; ?>
              echo'</p>';
              echo'<p class="midText2">Next article will show here.</p>';
            }


    ?>
    </div>

thanks!

patk570 42 Newbie Poster

Hello, I have a form that i would like to convert from JS onClick to AJAX,

Here is my form:

<form action="" method="post" name="filter"><input id="All" onClick="if(document.forms['filter'].elements['All'].checked)window.location.href='?page=1&amp;filter=All&amp;perpage=10'" name="All" type="checkbox" /><label style="background:#008080; font-size:small" for="All">All</label>
<input id="Pending" style="background:#FF6262" onClick="if(document.forms['filter'].elements['Pending'].checked)window.location.href='?page=1&amp;filter=Pending&amp;perpage=10'" name="Pending" type="checkbox" /><label style="background:#FF6262; font-size:small" for="Pending">Pending</label>
<input id="Complete" style="background:#7BCC70" onClick="if(document.forms['filter'].elements['Complete'].checked)window.location.href='?page=1&amp;filter=Complete&amp;perpage=10'" name="Complete" type="checkbox"  /><label style="background:#7BCC70; font-size:small" for="Complete">Complete</label>
<input id="Waiting on parts" style="background:#ffff66" onClick="if(document.forms['filter'].elements['Waiting on parts'].checked)window.location.href='?page=1&amp;filter=Waiting on parts&amp;perpage=10'" name="Waiting on parts" type="checkbox"  /><label style="background:#ffff66; font-size:small" for="Waiting on parts">Waiting on parts</label><br>
<input id="Waiting for customer response" onClick="if(document.forms['filter'].elements['Waiting for customer response'].checked)window.location.href='?page=1&amp;filter=Waiting for customer response&amp;perpage=10'" name="Waiting for customer response" style="background:#e4d2ba" type="checkbox"  /><label style="background:#e4d2ba; font-size:small" for="Waiting for customer response">Waiting for customer response</label>
</form>

I think AJAX loads faster and easier to implement but I am unsure of how to convert it.

Thanks

patk570 42 Newbie Poster

I am currently working on this: http://patrickspcrepair.com/newportal/newtheme/index.php .If you have time to look, It would be greatly appreciated! If you open the menu in the top left and where the login link is, is where i want it to show to the right.

patk570 42 Newbie Poster

Hello everyone,

Have a code that works well but I need it to open to the right on hover. Right now its going below the element and making my page look bad. Here is the code i have:

<style type="text/css">
.hide_img3 {
    display: none;
}
.hide_img3 {
    background: none repeat scroll 0 0 #333;
    border: 1px solid #000000;
    border-radius: 4px 4px 4px 4px;
    color: #78C102;
    height: 85px;
                display: none;
                position: relative;
    margin-left: 12px;
    margin-top: 0px;
    width: 145px;
}
.myClass:hover  .hide_img3
{
    display:block

}
</style>

<div class="myClass">
    <div>
                <a class="show_img3" href="#"><span>Login</span></a><div class="hide_img3">
                <form action="" method="post" name="login">
                <input style="border-radius: 4px 4px 4px 4px;" type="text" placeholder="Username" />
                <br />
                <input style="border-radius: 4px 4px 4px 4px;" type="password" name="password" placeholder="Password" />
                <br />
                <input style="float:right" type="submit" value="Login" name="login" />
                </form>
    </div>
</div

I need for it to open to the right and not under it.
Thanks in advance!

patk570 42 Newbie Poster

Hi Guys, I would like to highlight the current day on this php script, can you help me figure out a simple way to do this?

<?php

$monthNames = Array("January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December");

if (!isset($_GET["m"])) $_GET["m"] = date("n");
if (!isset($_GET["y"])) $_GET["y"] = date("Y");

$currentMonth = $_GET["m"];
$currentYear = $_GET["y"];

$p_year = $currentYear;
$n_year = $currentYear;
$p_month = $currentMonth-1;
$n_month = $currentMonth+1;

if ($p_month == 0 ) {
    $p_month = 12;
    $p_year = $currentYear - 1;
}

if ($n_month == 13 ) {
    $n_month = 1;
    $n_year = $currentYear + 1;
}
$days=array('1'=>"S",'2'=>"M",'3'=>"T",'4'=>"W",'5'=>"T",'6'=>"F",'7'=>"S");

?>

<table width="100%">
<tr align="center">
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="left">  <a href="<?php echo $_SERVER["PHP_SELF"] . "?m=". $p_month . "&y=" . $p_year; ?>" style="color:#FFFFFF">Prev</a></td>
<td width="50%" align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . "?m=". $n_month . "&y=" . $n_year; ?>" style="color:#FFFFFF"> Next</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<table width="100%"  border="0" cellpadding="1" cellspacing="1">
<tr align="center">
<td colspan="7"><B><?php echo $monthNames[$currentMonth-1].' '.$currentYear; ?></B></td>
</tr>
<tr >
<?php for($i=1;$i<=7;$i++){ ?>

<td align="center"><B><?php echo $days[$i]; ?></B></td>

<?php } ?>
</tr>
<?php
$timestamp = mktime(0,0,0,$currentMonth,1,$currentYear);
$maxday = date("t",$timestamp);
$thismonth = getdate ($timestamp);
$startday = $thismonth['wday'];
for ($i=0; $i<($maxday+$startday); $i++) {
    if(($i % 7) == 0 ) echo "<tr>";
    if($i < $startday) echo "<td ></td>";
    else echo "<td align='center' valign='middle' height='20px'>". ($i - $startday + 1) . "</td>";
    if(($i % 7) == 6 ) echo "</tr>";
}
?>
</table>
</td>
</tr>
</table
patk570 42 Newbie Poster
                        <?
                        $start = 0;
$per_page = 10;
if(!isset($_GET['page']))
{

$page = 1;
}else
{
$page = $_GET['page'];
}
if($page<=1)
$start = 0;
else
$start = $page * $per_page - $per_page;

                        $results = mysql_query("SELECT * FROM products ORDER BY id LIMIT $start, $per_page");
                            $n=0;
                            $num_rows = mysql_num_rows($results);
                            $num_pages = $num_rows / $per_page;


                            while($row = mysql_fetch_array($results)){
                            ?>
                        <tr>
                            <td><? echo $n=$n+1 ?></td>
                            <td><? echo $row['itemnumber']?></td>
                            <td><a href="?editproduct=<? echo $row['id'] ?>"><? echo $row['productname'] ?></a></td>
                            <td>$<? echo $row['price'] ?></td>
                            <td><? $taxable = $row['taxable'];
                            if($taxable == 1){
                                $taxable = 'Yes';
                            }else{
                                $taxable = '';
                            }  echo $taxable ?></td>
                            <td><a id="commentDelete" onClick="return delTicket(this.id);" href="?del=<? echo $row['id'] ?>">Delete</a></td>
                       </tr>
                        <? } ?>

                     </tbody>
                     </table>
                     <div>
                     <?php

####### Math OF +1 and -1 for the page ########

$prev = $page - 1;
$next = $page + 1;

echo"<hr>";
if($prev == 0){
    echo'';
}else{
echo "<a href='?page=$prev'>Prevous Page</a> | ";
}
     echo "<a href='?page=$next'>Next Page</a>";
?>
                     </div>

Fixed and solved

patk570 42 Newbie Poster

Hello everyone,

I have a table that i want to limit to 10 results per page and have a simple pagination script to generate the next 10 results. I have tried many different options, but alas it does not work. here is what I have so far.

<tbody>

                        <?
                        //specify how many results to display per page
                        $limit = 10;

                        //get pagination
                        $s = mysql_real_escape_string($_REQUEST['s']);

                        $results = mysql_query("SELECT * FROM products ORDER BY id LIMIT $s,$limit");
                        $row_num_links_main =mysql_num_rows ($results);
                            $n=0;
                            while($row = mysql_fetch_array($results)){

                            ?>
                        <tr>
                            <td><? echo $n=$n+1 ?></td>
                            <td><? echo $row['itemnumber']?></td>
                            <td><a href="?editproduct=<? echo $row['id'] ?>"><? echo $row['productname'] ?></a></td>
                            <td>$<? echo $row['price'] ?></td>
                            <td><? $taxable = $row['taxable'];
                            if($taxable == 1){
                                $taxable = 'Yes';
                            }else{
                                $taxable = '';
                            }  echo $taxable ?></td>
                            <td><a id="commentDelete" onClick="return delTicket(this.id);" href="?del=<? echo $row['id'] ?>">Delete</a></td>
                       </tr>
                        <? } ?>

                     </tbody>
                     <?
                         if($row_num_links_main > $limit){
    // next we need to do the links to other search result pages
        if ($s >=1) { // do not display previous link if 's' is '0'
            $prevs=($s-$limit);
            echo '<div class="search_previous"><a href="'.$PHP_SELF.'?s='.$prevs.'&q='.$var.'">Previous</a>
            </div>';
        }
    // check to see if last page
        $slimit =$s+$limit;
        if (!($slimit >= $row_num_links_main) && $row_num_links_main!=1) {
            // not last page so display next link
            $n=$s+$limit;
            echo '<div  class="search_next"><a href="'.$PHP_SELF.'?s='.$n.'&q='.$var.'">Next</a>
            </div>';
        }
    }
                     ?>

Any ideas on how to get this to work?

patk570 42 Newbie Poster

I have a simple login script that I want to test if the password is in temp status or not, if it is, then I want it to take them to changepass.php instead of index.php as seen below...

but it doesnt take you to changepass.php it take you right to index.php.

I thought I had this correct but I guess I am wrong...

also, I know I am using the old mysql not MYSQLI, I will change it over when later on..

        $sql="SELECT id FROM admin WHERE username='$myusername' and passcode='$shapass' and access_level ='2'";
        $result=mysql_query($sql);
        $row=mysql_fetch_array($result);
        $count=mysql_num_rows($result);
    $temppass = $row['temppass'];

    if($temppass == 0){
            if($count==1){
            session_register("username");
            $_SESSION['login_user']=$myusername;
            header("location: index.php");
            }else{
                header("location: changepass.php");
            }
        }else{
            $errmsg = "Access Denied, Please try this <a href='../login.php'>login instead</a>.";
                    }
                }
            }
    }

Thanks,

Patrick

patk570 42 Newbie Poster

I found this and Iam using it...It works the best..

<script type="text/javascript">
$(document).ready(function() {
    $('#mainfilter').toggle(
        function() {
            $('#filter').show("slow");
        },
        function() {
            $('#filter').hide( "slow" );
        }
    );
});
    </script>
patk570 42 Newbie Poster

Hello, I have 2 functions that I wrote to show a hidden div, I would love to convert this to jquery but unsure how. Also, I want a function that will allow me to change the onclick function to open and close and show an arrow > and arrow down... when I open it...

here are my 2 functions that open and close the div..

    <script type="text/javascript">
    function hideMe()
    {
    document.getElementById('filter').style.display="none" ;
    }
    </script>
    <script type="text/javascript">
    function showMe()
    {
    document.getElementById('filter').style.display="block" ;
    }
    </script>

and my div that i want the onclick function to open and close by clicking on filter and default is close..

           <fieldset>
           <legend style="cursor:pointer;" onClick="return showMe();">Filter</legend>
           <div id="filter" style="display:none">
           <div style="float:right" id="closefilter"><a style="cursor:pointer" onClick="return hideMe();" ><img src="xsmall.png" alt="Close" title="Close Filter List"></a></div>
           <a class="checkall" href="#" > Check All</a> <a class="uncheckall" href="#"> Uncheck All</a><br>
            <label><input name="filter" id="check-box2" type="checkbox" value="Pending"><font size="-1" style="background:#FF6262">Pending</font></label>
            <label><input name="filter" id="check-box3" type="checkbox" value="Complete"><font size="-1" style="background:#7BCC70">Complete</font></label><br>
            <label><input name="filter" id="check-box" type="checkbox" value="Waiting for parts"><font size="-1" style="background:#ffff66">Waiting for parts</font></label>
            <label><input name="filter"  id="check-box4" type="checkbox" value="Waiting for customer response"><font size="-1" style="background:#e4d2ba">Waiting for customer response</font></label>
            </div>
            </fieldset>
patk570 42 Newbie Poster

So I have been working with these codes:
jquery:

jQuery(document).ready(function () {
    $("#rowspan").tablesorter({
        debug: false,
        widgets: ['zebra'],
        sortList: [
            [0, 0]
        ]
    }).tablesorterFilter({
        filterContainer: $("#filter-box"),
        filterClearContainer: $("#filter-clear-button"),
        filterColumns: [0],
        filterCaseSensitive: false,
        callback: function () {
            var rowCount = $("#rowspan tr:visible").length - 1;
            // alert(rowCount);
        }
    });

    $("#check-box, #check-box2, #check-box3, #check-box4").click(function () {
        // alert($(this).is(":checked"));

        // If both the checkboxes are selected or not selected.  
        if ($("#check-box").is(":checked") && $("#check-box2").is(":checked") && $("#check-box3").is(":checked") && $("#check-box4").is(":checked")) || (!$("#check-box").is(":checked") && !$("#check-box2").is(":checked") && $("#check-box3").is(":checked") && $("#check-box4").is(":checked")) {

            showAllRow();

        } else if ($("#check-box").is(":checked")) {
            filterRow($("#check-box").val());
        } else if ($("#check-box2").is(":checked")) {
            filterRow($("#check-box2").val());
        } else if ($("#check-box3").is(":checked")) {
            filterRow($("#check-box3").val());
        } else if ($("#check-box4").is(":checked")) {
            filterRow($("#check-box4").val());
        }


    });



});

function showAllRow() {

    $("#rowspan").find("tr").each(function () {
        $(this).show();
    });

}


function filterRow(chckBoxValue) {

    $("#rowspan").find("tr").each(function () {

        var bool = 0; // Identifies if the rows td has that filter or not.

        $(this).find("td").each(function () {
            if ($(this).text() != chckBoxValue) {
                bool = 1;
            } else {
                bool = 0;
                return false;
            }
        });

        if (bool == 1) {
            $(this).hide();
        } else {
            $(this).show();
        }
    });

}

HTML:

<form>
    <input name="filter" id="filter-box" value="" maxlength="30" size="30" type="text">
    <input id="filter-clear-button" type="submit" value="Clear" />
    <br/>
    <input name="filter" id="check-box" type="checkbox" value="Waiting for parts">Waiting for parts
    <input name="filter" id="check-box2" type="checkbox" value="Pending">Pending
    <input name="filter" id="check-box3" type="checkbox" value="Complete">Complete
    <input name="filter" id="check-box4" type="checkbox" value="Waiting for customer response">Waiting for customer response</form>
<table width="100%" id="rowspan" class="tablesorter" cellpadding="0" cellspacing="1">
    <thead>
        <tr>
            <th>&nbsp;</th>
            <th>Ticket #</th>
            <th>Customer</th>
            <th>Status</th>
            <th>Edit</th>
            <th>Delete</th>
        </tr>
    </thead>
    <tbody>
        <tr bgcolor="#7BCC70">
            <td><b>1</b>
            </td>
            <td align="center" height='35px'><a title="View details of ticket 248341" …
patk570 42 Newbie Poster

Sorry forgot to select a category...SHould be in Jquery/JSP

patk570 42 Newbie Poster

Hello everyone,
I am looking for a jquery code that will filter my table based on 4 different critera that I have set from the database.

The 4 critera is:

  1. Complete
  2. Pending
  3. Waiting for customer response
  4. Waiting for parts

The table is sortable using tablesorter jquery already but I want to add 5 checkboxes above that says:

Filter<form><input type="checkbox" name="All">Show All<input type="checkbox" name="Complete" />Complete<input type="checkbox" name="Pending" />Pending<input type="checkbox" name="Waiting for customer response" />Complete<input type="checkbox" name="Waiting for parts" />Waiting for parts</form>
<table cellpadding="1" cellspacing="1">
        <thead>
            <tr>
                <th>&nbsp;</th>
                <th>Ticket #</th>
                <th>Customer</th>
                <th>Status</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <tr bgcolor="#7BCC70"                    >
                <td><b>1</b></td>
                  <td align="center" height='35px'><a title="View details of ticket 248341" href="ticketdetails.php?ticketid=248341"><b>248341</b></a></td>
                        <td align="center" height='35px'><b>John Smith</b></td>
                        <td align="center"  height='35px'><b>Complete</b></td>
                        <td align="center"  height='35px'><a title="Edit ticket info" href="editticket.php?ticketid=248341"><b>Edit</b></a></td>
                <td align="center" height='35px'><a id="commentDelete" onClick="return delTicket(this.id);" title="Delete ticket" href="?del=248341"><b>Delete</b></a></td></tr>

                            <tr bgcolor="#7BCC70"                    >
                <td><b>2</b></td>
                  <td align="center" height='35px'><a title="View details of ticket 522303" href="ticketdetails.php?ticketid=522303"><b>522303</b></a></td>
                        <td align="center" height='35px'><b>Jane Smith</b></td>
                        <td align="center"  height='35px'><b>Waiting for parts</b></td>
                        <td align="center"  height='35px'><a title="Edit ticket info" href="editticket.php?ticketid=522303"><b>Edit</b></a></td>
                <td align="center" height='35px'><a id="commentDelete" onClick="return delTicket(this.id);" title="Delete ticket" href="?del=522303"><b>Delete</b></a></td></tr>

                            <tr bgcolor="#7BCC70"                    >
                <td><b>3</b></td>
                  <td align="center" height='35px'><a title="View details of ticket 122588" href="ticketdetails.php?ticketid=122588"><b>122588</b></a></td>
                        <td align="center" height='35px'><b>John Q. Test</b></td>
                        <td align="center"  height='35px'><b>Waiting for customer response</b></td>
                        <td align="center"  height='35px'><a title="Edit ticket info" href="editticket.php?ticketid=122588"><b>Edit</b></a></td>
                <td align="center" height='35px'><a id="commentDelete" onClick="return delTicket(this.id);" title="Delete ticket" href="?del=122588"><b>Delete</b></a></td></tr>

                            <tr bgcolor="#7BCC70"                    >
                <td><b>4</b></td>
                  <td align="center" height='35px'><a title="View details of ticket 122589" href="ticketdetails.php?ticketid=122589"><b>122589</b></a></td>
                        <td align="center" height='35px'><b>John Q. Test</b></td>
                        <td align="center"  height='35px'><b>Pending</b></td>
                        <td align="center"  height='35px'><a title="Edit ticket info" href="editticket.php?ticketid=122589"><b>Edit</b></a></td>
                <td align="center" height='35px'><a id="commentDelete" onClick="return delTicket(this.id);" title="Delete ticket" href="?del=122589"><b>Delete</b></a></td></tr>
            </tbody> …
patk570 42 Newbie Poster

I solved it...

<script type="text/javascript">
function  getTaxrate() {
var gettax = document.getElementById('taxrate').value;
    {
    ans = (gettax / 100);
    outp = ans.toFixed(4);
}

  document.getElementById('taxrate').value = outp; 
} 
</script>