Jump to content

mikeoffy69

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mikeoffy69's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am looking for some help or direction or maybe someone can point me to a tutorial some where. I am looking at adding a program to my website but it requires the user to also be logged in to use it. I would like to know how I can set it up so my users only have to log into my website once and it will automatically log them into this program using the same log in credentials. I am sure this is common and simple but I am a newbie programmer. Thank You for any advice.
  2. So I have this program I purchased and it allows me to create custom form fields. I have been trying to create a date select box but have been struggling because I am just learning php. I was wondering if someone could lend a hand. I will try and give as much info as i can. First I will show a picture of the custom field box and then i will give the description of both boxes that the company gave me. Next i will give you the php code i have been trying to work with. Please if my code is not the best then i will take any advice. I found the code for the date selector online. Parsed Default Value - You may specify a variable or a function as the default value; for example $_SERVER[HTTP_USER_AGENT] or mktime() Parsed PHP Code - You can specify actual PHP code that will be used to return a variable. // You should assign the value you wish to use to the variable $str. <?PHP FUNCTION buildDate($name, $m, $d, $y) { $date = DATE("m-d-Y",STRTOTIME("now")); $date_array = EXPLODE("-",$date); $now_m = ""; $now_d = ""; $now_y = ""; $month = '<select class="small" name="'.$name.'_month">'; $month .= '<option value="" selected disabled>mm</option>'; FOR ($i=1;$i<=12;$i++) { IF ( $m != "" ) { IF ( $m == $i ) { $now_m = "selected"; } }ELSEIF ( $m == "0" ) { $now_m = ""; }ELSE{ IF ( $date_array[0] == $i ) { $now_m = "selected"; } } $month .= '<option value="'.$i.'" '.$now_m.'>'.$i.'</option>'; $now_m = ""; }//END month for loop $month .= '</select>'; $day = '<select class="small" name="'.$name.'_day">'; $day .= '<option value="" selected disabled>dd</option>'; FOR ($i=1;$i<=31;$i++) { IF ( $d != "" ) { IF ( $d == $i ) { $now_d = "selected"; } }ELSEIF ( $d == "0" ) { $now_d = ""; }ELSEIF ( $d == $i ) { $now_d = "selected"; }ELSE{ IF ( $date_array[1] == $i ) { $now_d = "selected"; } } $day .= '<option value="'.$i.'" '.$now_d.'>'.$i.'</option>'; $now_d = ""; }//END day for loop $day .= '</select>'; $year = '<select class="small" name="'.$name.'_year">'; $year .= '<option value="" selected disabled>yyyy</option>'; FOR ($i=GMDATE("Y"); $i <=SUBSTR(get330Date(),0,4); $i++) { IF ( $y != "" ) { IF ( $y == $i ) { $now_y = "selected"; } }ELSEIF ( $y == "0" ) { $now_y = ""; }ELSEIF ( $y == $i ) { $now_y = "selected"; }ELSE{ IF ( $date_array[2] == $i ) { $now_y = "selected"; } } $year .= '<option value="'.$i.'" '.$now_y.'>'.$i.'</option>'; $now_y = ""; }//END year for loop $year .= '</select>'; //------------------------------------------- ECHO $month." ".$day." ".$year; }//END buildDate function // ------------------------------------ FUNCTION get330Date() { RETURN DATE("Y-m-d", MKTIME(0, 0, 0, SUBSTR(GMDATE("Y m d"),5,2), SUBSTR(GMDATE("Y m d"),8,2) + 330, SUBSTR(GMDATE("Y m d"),0,4)))."<br />"; } ?> I might just be totaly wacked here with what i am trying to do but i am sure someone will tell me one way or the other. lol
  3. I am assuming I didn't give enough info or I didn't make much sense. Normally this forum is very helpful.
  4. I am having an issue with a support ticket program. I have added a feature to this program that allows my staff members to add multiple users to a ticket. The problem I am having because I am new to PHP is how do I email the users when they have been added to the ticket. Below is the code I am using for add user. If someone could look at it and help me figure out how to get this to email the user when they are added to the support ticket that would be great. I have been struggling with this for alot of nights and just cant figure it out. <?php require "../conf/conn.php"; require "../conf/conf.php"; require "session.php"; ?> <html> <head> <title><?php echo "$c_title - Add User"; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <STYLE type="text/css"> <?php include('../style.php'); ?> </STYLE> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function dele(assigned_user,username,ticket_id,id) { var assigned = document.getElementById('assigned_user').value; if(assigned_user==assigned) { alert("You Can't Delete the user '"+username+"'\nUsername assigned for the ticket '"+ticket_id+"'"); } else { if(confirm('Are you sure to delete?')) window.location.href = "adduser.php?action=delete&user_id="+assigned_user+"&ticket_id="+ticket_id+"&ticid="+id; } } // End --> </script> </head> <body> <?php $ticket_id = $_GET['ticket_id']; if(isset($_GET['action'])) { if($_GET['action']=='delete'){ if(isset($_GET['ticid'])) { $tid = $_GET['ticid']; $query_user ="DELETE FROM support_users WHERE id='$tid'"; $result=mysql_query($query_user); echo $_SESSION['successMsg'] = "<b>User Deleted From the ticket '$ticket_id'</b>"; } } } if(!empty($_POST)) { $date = date('Y-m-d H:i:s'); $puid = $_POST['username']; if($puid!='') { mysql_query("INSERT INTO support_users (id,user_id,ticket_id,assign_date) VALUES ('','$puid','$ticket_id','$date')") or die("<B>Error ".mysql_errno()." :</B> ".mysql_error().""); $_SESSION['successMsg'] = "User Added !"; } } $query_user ="SELECT SU.id,SU.user_id,SU.ticket_id,SU.assign_date,U.user,U.name,U.email FROM support_users AS SU LEFT JOIN users AS U ON SU.user_id=U.id WHERE ticket_id='$ticket_id';"; $result1=mysql_query($query_user); $user_arr = array(); while($userrow1 = mysql_fetch_array($result1)) { $user_arr[] = $userrow1['user_id']; } $result=mysql_query($query_user); $query_user ="SELECT * FROM support WHERE Ticket='$ticket_id';"; $support_result=mysql_query($query_user); $support = mysql_fetch_array($support_result); /* $query_user ="SELECT * FROM users WHERE Ticket='$ticket_id';"; $support_result=mysql_query($query_user); $support = mysql_fetch_array($support_result);*/ if(isset($_SESSION['successMsg'])) { if($_SESSION['successMsg']=="") { echo $_SESSION['successMsg']; $_SESSION['successMsg'] = ""; } } ?> <form method="post" action=""> <table width="400" border="0" align="center" cellspacing="1"> <tr> <td colspan="4" class="submenu"> Ticket ID <?=$ticket_id?> </td> </tr> <tr align="center"> <td colspan="4" class="submenu"> Add Users </td> </tr> <tr align="center"> <td class=""> Select User </td> <td> <select name="username"> <option value="">[--Select User--]</option> <?php $query_user1 ="SELECT * FROM users WHERE level = '3' AND active <> '0' AND validated ='1' order by name"; $result1=mysql_query($query_user1); while($userrow1 = mysql_fetch_array($result1)) { if(!in_array($userrow1["id"],$user_arr)) { $tempuser=$userrow1["user"]; ?> <option value="<?php echo $userrow1["id"];?>"<?php if($row_user[user]==$tempuser){echo " selected ";}?>><?php echo "$userrow1[user] ($userrow1[name] )"; ?></option> <?php } } ?> </select> <input type='submit' value='Add'> </td> </tr> </table> </form> <table width="400" border="0" cellspacing="0" cellpadding="0" align="center" class="border"> <tr> <td> <table width="400" border="0" align="center" cellspacing="1"> <tr align="center"> <td colspan="4" class="submenu"> Assigned Users <input type='hidden' id='assigned_user' name='assigned_user' value="<?=$support['user_id']?>"> </td> </tr> <tr> <td class="descrip">User</td> <td class="descrip">Name</td> <td class="descrip">Email</td> <td class="descrip">Actions</td> </tr> <?php while($row = mysql_fetch_array($result)) { ?> <tr> <td class="dat"><a href="#" onClick="sendValue(<?php echo "'".$row[user]."'"; ?>);"><?php echo $row[user]; ?></a><?php if ($row["active"] == 2) echo "<font size=1 color=#FF0000> (Suspended)</font>"; ?></td> <td class="dat"><?php echo $row["name"]; ?></td> <td class="dat"><?php echo $row["email"]; ?></td> <td class="dat"><img src="../images/delete3.gif" /> <a href="javascript:dele('<?=$row["user_id"]?>','<?=$row["user"]?>','<?=$row["ticket_id"]?>','<?=$row["id"]?>');">Delete </a></td> </tr> <?php } ?> <tr align="center"> <td colspan="4" class="submenu"> <?php if ($numpage>1) { pagenav(); } else { echo " "; } ?> </td> </tr> </table> </td> </tr> </table> <br><table align="center"><tr><td><a href="javascript:window.close();">Close Window</a></td></tr></table> </body> </html> Thanks in advance for any help...
  5. Anyone able to lend a helpful hand?
  6. Sorry for that. Both are stored in different tables. Both are on the same server.
  7. Hello everyone. I have two programs in which people need to login to with different user accounts. It would be awesome if I could merge them both into one. This way I can give them one username and when they login it logs them into both accounts. Problem is I have never done anything like this but I am willing to try. If someone might have a site that explains how to do this or if anyone is willing to explain that would be great. Cheers Mike
  8. I am trying to get pspell or aspell working with internet explore. I am using wamp and spell check is working great with Firefox but not working on any recent version of Internet Explorer. I am looking for some help or tips to get this up and running.
  9. Awesome thanks for the help. Found what I needed.
  10. So i have been pulling my hair out trying to get a 4th column added to my knowledge base. I am using inter-spire knowledge base software and have the developers version but i have it installed internal and not live on the web. So i will do my best to explain. If you look at the picture you will see what I want. I would like to add a 4th column to the main categories section. I am pretty sure I am editing the correct code. This is called the CategoriesPanel.php. Here is the code if anyone can see where i would need to change to add a 4th column. I have messed with the $count over and over and can see the amount of categories change but its usual's not what i want. <?php CLASS AKB_CATEGORIES_PANEL extends AKB_PANEL { /** * SetPanelSettings * This function is a chance to set any last minute global variables for * the template to use * * @return void */ function SetPanelSettings() { $GLOBALS['Categories'] = $this->GetCategoryTable(); if ($GLOBALS['cleanUrls'] === true) { $arrURI = explode('/', $_SERVER['REQUEST_URI']); $todo = $arrURI[sizeof($arrURI)-1]; } else if (isset($_GET['todo'])) { $todo = $_GET['todo']; } else { $todo = ''; } switch ($todo) { case '__addarticle': $GLOBALS['AddArticle'] = '1'; break; } } /** * GetCategoryTable * Get an html table of categories for displaying to the user * * @return string the html to display */ function GetCategoryTable() { if (isset($GLOBALS['CategoryId'])) { $catid = (int) $GLOBALS['CategoryId']; } else { $catid = 0; } $output = ''; $count = 0; $GLOBALS['AKB_CLASS_HELPER']->getCatsInfo(); if (isset($GLOBALS['categoryRestrictOption']) && $GLOBALS['categoryRestrictOption'] == "1") { $accessible_cats = $GLOBALS['AKB_CLASS_HELPER']->GetPermittedCats(); } else { $accessible_cats = false; } if (isset($GLOBALS['AKB_CLASS_HELPER']->tree->nodesByPid[$catid]) && is_array($GLOBALS['AKB_CLASS_HELPER']->tree->nodesByPid[$catid]) && !empty($GLOBALS['AKB_CLASS_HELPER']->tree->nodesByPid[$catid])) { // Return a 3xn table of categories ordered by name $output = $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet('CategoryGridHeader'); foreach ($GLOBALS['AKB_CLASS_HELPER']->tree->nodesByPid[$catid] as $rowid) { $row = $GLOBALS['AKB_CLASS_HELPER']->catsById[$rowid]; if (($accessible_cats !== false) && (!in_array($row['categoryid'],$accessible_cats)) && ($row['security'] == "private")) { continue; } $children = $GLOBALS['AKB_CLASS_HELPER']->GetNumQuestionsInCategory($row['categoryid']); // Every 3rd category print start a new row if ($count % CATEGORIES_PER_ROW == 0) { $output .= $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet('CategoryRowHeader'); } $GLOBALS['Icon'] = $GLOBALS['AKB_CLASS_TEMPLATE']->DisablePlaceholders($row['icon']); $GLOBALS['Description'] = strip_tags($row['description'],"<a>"); $GLOBALS['Link'] = GetUrl('category', $row['categoryid']); $GLOBALS['Text'] = htmlspecialchars($GLOBALS['AKB_CLASS_TEMPLATE']->DisablePlaceholders($row['name']),ENT_QUOTES,$GLOBALS['charset']); $GLOBALS['QuestionCount'] = $children; $output .= $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet('CategoryRowCell'); // Every 3rd category end a row if ($count % CATEGORIES_PER_ROW == CATEGORIES_PER_ROW - 1) { $output .= $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet('CategoryRowFooter'); } $count++; } if ($count % CATEGORIES_PER_ROW != CATEGORIES_PER_ROW) { $output .= $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet('CategoryRowFooter'); } $output .= $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet('CategoryGridFooter'); } else { if ($catid == 0) { $output .= $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet('CategoryRowHeader'); $output .= $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet('CategoryRowCellNoCategories'); $output .= $GLOBALS['AKB_CLASS_TEMPLATE']->GetSnippet('CategoryRowFooter'); $GLOBALS['HideSubList'] = ''; } else { if (isInlineHelp()) { $GLOBALS['HideSubList'] = 'none'; } else { $output .= GetLang('catNoSubCategories'); } } } return $output; } } ?> I appreciate anyone's help on this matter.
×
×
  • 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.