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.
  11. I fixed it. Sloppy coding on there part. Alot of misspelled words. Thanks for help
  12. Yes it is set up that way. So I have no errors now when clicking on the completed task button. Now the problem is its not recording it and removing it from pending tasks. If I open the task and complete it with in the task it self it works but if I use the short cut it doesn't remove it from pending tasks. if you visit http://www.isolsoft.com/demo/staff/login.php and use staff/demo and goto my tasks you will understand and you can see the error on there page even that we got rid of. Here is the code for that entire calendar page. <?php $header_title = "Calendar"; $techid = $s_userid; $techuser = $s_username; $query = "SELECT * FROM users WHERE id = '$techid'"; $req_tech = mysql_query($query) or die("<B>Error ".mysql_errno()." :</B> ".mysql_error().""); $row_tech = mysql_fetch_array($req_tech); if (!$action) {$action="list"; $listed='pending';} ?> <table width="750" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <table width="750" border="0" cellspacing="1"> <tr align="center"> <td width="150"> <div class="standard_buttons"><a href="index.php?method=calendar&action=list&listed=pending"><img src="../images/taskpend.gif" align="absmiddle" border="0" alt="Pending Tasks"> Pending Tasks</a></div> </td> <td width="150"> <div class="standard_buttons"><a href="index.php?method=calendar&action=list&listed=overdue"><img src="../images/taskover.gif" align="absmiddle" border="0" alt="Overdue Tasks"> Overdue Tasks</a></div> </td> <td width="150"> <div class="standard_buttons"><a href="index.php?method=calendar&action=list&listed=completed"><img src="../images/taskcompl.gif" align="absmiddle" border="0" alt="Completed Tasks"> Completed Tasks</a></div> </td> <td width="150"> <div class="standard_buttons"><a href="index.php?method=calendar&action=new"><img src="../images/addtask.gif" align="absmiddle" border="0" alt="Add New task"> Add New Task</a></div> </td> <td width="150"> <div class="standard_buttons"><a href="index.php?method=calendar&action=viewcal"><img src="../images/calendar.gif" align="absmiddle" border="0" alt="View Calendar"> View Calendar</a></div> </td> </tr> </table> </td> </tr> </table><br> <?php if ($action=="viewcal") { /* ******************************************************************************** Calendar Navigation variables ******************************************************************************** */ //$myurl=$_SERVER['PHP_SELF']; // the links url is this page in this case $myurl="index.php?method=calendar&action=viewcal"; $yearID=false; // GET variable for the year (set in Active Calendar Class), init false to display current year $monthID=false; // GET variable for the month (set in Active Calendar Class), init false to display current month $dayID=false; // GET variable for the day (set in Active Calendar Class), init false to display current day extract($_GET); /* ******************************************************************************** Create a calendar object ******************************************************************************** */ require_once("calendar_inc.php"); $cal=new activeCalendar($yearID,$monthID,$dayID); /* ******************************************************************************** Gets all dates from your database and set the calendar events html classes (for the layout) ******************************************************************************** */ $tblname="calendar"; // the name of your MySQL Database Table $tblDateName="date"; // the name of your MySQL Table Date Field $tblContent="title"; // the name of your MySQL Table Content Field $tblLink="id"; // the name of your MySQL Table Link Field $sqlID=@mysql_query("SELECT * FROM calendar"); $eventID="event"; // sets the name of the generated HTML class on the event day (css layout) while ($data=@mysql_fetch_array($sqlID, MYSQL_BOTH)){ $mysqlDay=date("j",$data[$tblDateName]); // makes a day out of the database date $mysqlMonth=date("n",$data[$tblDateName]); // makes a month out of the database date $mysqlYear=date("Y",$data[$tblDateName]); // makes a year out of the database date $mysqlContent=$data[$tblContent]; // gets the event content $mysqlLink="index.php?method=calendar&action=view&viewtask=".$data[$tblLink]; // gets the event link $cal->setEvent($mysqlYear,$mysqlMonth,$mysqlDay,$eventID); // set the event, if you want the whole day to be an event $cal->setEventContent($mysqlYear,$mysqlMonth,$mysqlDay,$mysqlContent,$mysqlLink); // set the event content and link } $cal->enableDatePicker(2001,2010); // this enables the month's datepicker (year range 2002 - 2010) $cal->enableMonthNav($myurl); // this enables the month's navigation controls echo $cal->showMonth(); // this displays the month's view }elseif ($action=="list") { if ($listed=='pending'){ $query = "SELECT * FROM calendar WHERE user_id='$techid' AND complete='0' order by id"; $tabletitle = "Pending Tasks"; }elseif ($listed=='overdue'){ $currdate =time(); $query = "SELECT * FROM calendar WHERE user_id='$techid' AND complete='0' AND datedue < '$currdate' order by id"; $tabletitle = "Overdue Tasks"; }elseif ($listed=='completed'){ $query = "SELECT * FROM calendar WHERE user_id='$techid' AND complete='1' order by id"; $tabletitle = "Completed Tasks"; } ?> <table width="600" border="0" cellspacing="0" cellpadding="0" align="center" class="table_border_blue"> <tr> <td> <table width="600" border="0" cellspacing="1"> <tr align="center"> <td class="table_header" colspan="4"> <?php echo $tabletitle; ?> </td> </tr> <tr> <td class="row_caption" align="left"> Title </td> <td class="row_caption"> Date </td> <td class="row_caption"> Due Date </td> <td class="row_caption" width="70"> Actions </td> </tr> <?php //$query = "SELECT * FROM calendar WHERE user_id='$techid' order by id"; $result=mysql_query($query) or die("<B>Error ".mysql_errno()." :</B> ".mysql_error().""); while($row = mysql_fetch_array($result)) { ?> <tr> <td class="row_content" align="left"> <?php if ($row["complete"] == 1) {?> <img src="../images/taskcompl.gif" border="0" alt="Completed"> <?php } else {?> <?php $ctime= time(); if ($row["datedue"] < $ctime) {?> <img src="../images/taskover.gif" border="0" alt="Overdue"> <?php } else { ?> <img src="../images/taskpend.gif" border="0" alt="Pending"> <?php } ?> <?php } ?> <a href="index.php?method=calendar&action=view&viewtask=<?php echo $row["id"]; ?>"> <?php echo "<b>$row[title]</b>"; ?> </a> </td> <td class="row_content"> <?php echo date("m-d-Y",$row["date"]); ?> </td> <td class="row_content"> <?php echo date("m-d-Y",$row["datedue"]); ?> </td> <td class="row_caption" width="70" align="center"> <?php if ($listed != 'completed'){ ?> <a href="index.php?method=calendar&action=confirm&compltask=<?php echo $row["id"]; ?>&edit=yes" onClick="return confirm('Mark task as compete?')"><img src="../images/approve.gif" border="0" title="Mark as completed" alt="Mark as completed"></a> <?php } ?> <a href="index.php?method=calendar&action=new&edit=yes&edittask=<?php echo $row["id"]; ?>"><img src="../images/edit.gif" border="0" title="Edit Task" alt="Edit Task"></a> <a href="index.php?method=calendar&action=delete&deltask=<?php echo $row["id"]; ?>" onClick="return confirm('Are you sure to delete this task?')"><img src="../images/delete.gif" border="0" title="Delete Task" alt="Delete Task"></a> </td> </tr> <?php } ?> </table> </td> </tr> </table> <?php } elseif ($action=="confirm") { /**/ if ($ddate=="") $ddate=$sdate; //echo $sdate; echo $ddate; $stdate = explode("-",$sdate); $stimestamp = mktime(0, 0, 0, (int) $stdate[0], (int) $stdate[1], (int) $stdate[2]); $dtdate = explode("-",$ddate); $dtimestamp = mktime(0, 0, 0, (int) $dtdate[0], (int) $dtdate[1], (int) $dtdate[2]); if ($stimestamp > $dtimestamp){ die("Error: Start date must be minor to due date. Go back."); } if ($ticket_id=="") $ticket_id=0; if ($edit=='no'){ $query = "INSERT INTO calendar (complete, user_id, date, datedue, title, content, ticket_id) VALUES ('$complete', '$user_id', '$stimestamp', '$dtimestamp', '$ttitle', '$content', '$ticket_id')"; $req = mysql_query($query) or die("<B>Error ".mysql_errno()." :</B> ".mysql_error().""); echo "<br>The task was added."; } elseif ($edit=='yes'){ if (isset($compltask)){ $query = "UPDATE calendar SET complete='1' WHERE id = '$copmltask'"; $req = mysql_query($query) or die("<B>Error ".mysql_errno()." :</B> ".mysql_error().""); echo "<br>The task was completed."; }else{ $query = "UPDATE calendar SET complete='$complete', date ='$stimestamp',datedue ='$dtimestamp', title ='$ttitle', content ='$content', ticket_id ='$ticket_id' WHERE id = '$edittask'"; $req = mysql_query($query) or die("<B>Error ".mysql_errno()." :</B> ".mysql_error().""); echo "<br>The task was updated."; } } } elseif ($action=="delete") { $query = "DELETE FROM calendar WHERE id = '$deltask'"; $req = mysql_query($query) or die("<B>Error ".mysql_errno()." :</B> ".mysql_error().""); //Show result print("The task has been deleted<br><br>[<a href=\"index.php?method=calendar\">Back</a>]"); } elseif ($action=="view") { $query = "SELECT * FROM calendar WHERE id = '$viewtask'"; $req = mysql_query($query) or die("<B>Error ".mysql_errno()." :</B> ".mysql_error().""); $row = mysql_fetch_array($req); if ($row["completed"] == 0){ }elseif ($row["completed"] == 1){ } ?> <table width="500" border="0" cellspacing="0" cellpadding="0" align="center" class="table_border_blue"> <tr> <td> <table width="500" border="0" cellspacing="1"> <tr> <td class="table_header" align="center" colspan="2"> View Tasks </td> </tr> <tr> <td class="row_caption" align="right" colspan="2"> <?php if ($row["complete"] == '0'){ ?> <a href="index.php?method=calendar&action=confirm&compltask=<?php echo $row["id"]; ?>&edit=yes" onClick="return confirm('Mark task as compete?')"><img src="../images/approve.gif" border="0" title="Mark as completed" alt="Mark as completed"></a> <?php } ?> <a href="index.php?method=calendar&action=new&edit=yes&edittask=<?php echo $row["id"]; ?>"><img src="../images/edit.gif" border="0" title="Edit Task" alt="Edit Task"></a> <a href="index.php?method=calendar&action=delete&deltask=<?php echo $row["id"]; ?>" onClick="return confirm('Are you sure to delete this task?')"><img src="../images/delete.gif" border="0" title="Delete Task" alt="Delete Task"></a> </td> </tr> <?php if ($row["ticket_id"] !=0){ ?> <tr> <td class="row_caption" valign="top" width="150">Related ticket</td> <td class="row_content"> <?php echo $row["ticket_id"]; ?> <b><a href="index.php?method=viewticket&ticket=<?php echo $row["ticket_id"]; ?>">[View Ticket]</a></b> </td> </tr> <?php } ?> <tr> <td class="row_caption" valign="top" width="150">Start Date</td> <td class="row_content"> <?php echo date("m-d-Y",$row["date"]); ?> </td> </tr> <tr> <td class="row_caption" valign="top" width="150">Due Date</td> <td class="row_content"> <?php echo date("m-d-Y",$row["datedue"]); ?> </td> </tr> <tr> <td class="row_caption" valign="top" width="150">Title</td> <td class="row_content"> <?php echo $row[title]; ?> </td> </tr> <tr> <td class="row_caption" colspan="2">Content</td> </tr> <tr> <td class="row_content" colspan="2"> <?php echo nl2br( htmlspecialchars($row["content"])); ?> </td> </tr> </table> </td> </tr> </table> <?php } elseif ($action=="new") { if ($edit == 'yes'){ $query = "SELECT * FROM calendar WHERE id = '$edittask'"; $req = mysql_query($query) or die("<B>Error ".mysql_errno()." :</B> ".mysql_error().""); $row = mysql_fetch_array($req); $currdate = date("m-d-Y",$row["date"]); $currdatedue = date("m-d-Y",$row["datedue"]); $caption = "Update Task"; $menutitle = "Edit Task"; $ticket_id = $row["ticket_id"]; } else { $edit='no'; $currdate = date("m-d-Y"); $currdatedue = ""; $caption = "Add Task"; $menutitle = "Add New Task"; } ?> <form name="form1" method="POST" action="<?php echo $PHP_SELF; ?>" onSubmit="validateForm('ttitle','','R','Title','content','','R','Content');return document.returnValue"> <table width="500" border="0" cellspacing="0" cellpadding="0" align="center" class="table_border_blue"> <tr> <td> <table width="500" border="0" cellspacing="1"> <tr align="center"> <td colspan="2" class="table_header"> <?php echo $menutitle; ?> </td> </tr> <tr> <td width="100" class="row_caption"> Start Date </td> <td class="row_content"><input type="text" name="sdate" id="f_date_c" readonly="1" size="10" value="<?php echo $currdate; ?>" /> <img src="../images/cal.gif" id="f_trigger_c" style="cursor: pointer; border: 1px solid red;" title="Select Start Date" onmouseover="this.style.background='red';" onmouseout="this.style.background=''" /></td> </tr> <tr> <td width="100" class="row_caption"> Due Date </td> <td class="row_content"><input type="text" name="ddate" id="f_date_c2" readonly="1" size="10" value="<?php echo $currdatedue; ?>" /> <img src="../images/cal.gif" id="f_trigger_c2" style="cursor: pointer; border: 1px solid red;" title="Select Due Date" onmouseover="this.style.background='red';" onmouseout="this.style.background=''" /></td> </tr> <tr> <td width="100" class="row_caption"> Title </td> <td width="400" class="row_content"> <input type="text" name="ttitle" size="50" value="<?php echo $row["title"]; ?>"> </td> </tr> <tr> <td valign="top" class="row_caption" colspan="2"> Content </td> </tr> <tr> <td class="row_content" colspan="2"> <textarea name="content" cols="80" rows="10"><?php echo $row["content"]; ?></textarea> </td> </tr> <tr> <td width="100" class="row_caption"> Related to ticket: </td> <td width="400" class="row_content"> ABCDEF-<input type="text" name="ticket_id" size="10" value="<?php if ($ticket_id) echo $ticket_id; ?>"> (Optional) </td> </tr> <tr> <td class="row_content" colspan="2"> <input type="checkbox" class="binput" name="complete" value="1" <?php if ($row["complete"]==1) echo "checked"; ?>> Task Complete </td> </tr> <tr> <td class="row_caption" align="center" colspan="2"><input type="submit" name="Submit" value="<?php echo $caption; ?>" /> <input type="hidden" name="method" value="calendar"> <input type="hidden" name="user_id" value="<?php echo $s_userid?>"> <input type="hidden" name="action" value="confirm"> <input type="hidden" name="edit" value="<?php echo $edit?>"> <?php if ($edit == 'yes'){ ?> <input type="hidden" name="edittask" value="<?php echo $edittask; ?>"> <?php } ?> </td> </tr> </table> </td> </tr> </table> </form> <script type="text/javascript"> Calendar.setup({ inputField : "f_date_c", // id of the input field ifFormat : "%m-%d-%Y", // format of the input field button : "f_trigger_c", // trigger for the calendar (button ID) align : "Tr", // alignment (defaults to "Bl") singleClick : true }); Calendar.setup({ inputField : "f_date_c2", // id of the input field ifFormat : "%m-%d-%Y", // format of the input field button : "f_trigger_c2", // trigger for the calendar (button ID) align : "Br", // alignment (defaults to "Bl") singleClick : true }); </script> <br> <?php } ?> Edit (Daniel0): We have a tag. Use it. It was mentioned in the ToS/rules that you read before you registered (you did read it, right?), so you can't claim ignorance.[/size]
  13. Hello, I am having a error come up when i try to close a task in my calendar. Warning: mktime() expects parameter 4 to be long, string given in D:\wamp\www\support\inc\calendar.php on line 177 This is the code for the line. <?php } elseif ($action=="confirm") { /**/ if ($ddate=="") $ddate=$sdate; //echo $sdate; echo $ddate; $stdate = explode("-",$sdate); $stimestamp = mktime(0, 0, 0, $stdate[0], $stdate[1], $stdate[2]); $dtdate = explode("-",$ddate); $dtimestamp = mktime(0, 0, 0, $dtdate[0], $dtdate[1], $dtdate[2]); if ($stimestamp > $dtimestamp){ die("Error: Start date must be minor to due date. Go back."); }
  14. Hello I set-up mysql and php on my network server. Everything is working great except one little thing When I try to run the same file from a different computer by just mapping to it it doesnt work. Well it kinda works atleast anything thats no database driven. Its not seeing the database. How do I get another computer on the same network to read the same database? Is this Possible? Thanks
×
×
  • 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.