pixeltrace
Members-
Posts
577 -
Joined
-
Last visited
Never
Everything posted by pixeltrace
-
guys, is there a php script that wil disable the right-click on mouse or maybe disable the copy and paste feature of the browser? because i have a client, wherein he wants to prevent public viewing his website from copying his website content? hope you could help me wth this. thanks!
-
guys, i need help i have a form that adds new job in my database my problem is if i left a field empty let say i have fields called title contact person phone contact if i left phone empty the value that is being save in my database is javascript:; how do i fix this? this is the code for my form <form action="job/addjob.php" method="post"> <table width="515" border="0" cellspacing="2" cellpadding="3"> <tr> <td colspan="3" valign="top"><img src="images/spacer.gif" width="10" height="1" /></td> </tr> <tr> <td colspan="3" bgcolor="#999999" class="text2">JOB INFORMATION</td> </tr> <tr> <td colspan="3" valign="top"><img src="images/spacer.gif" width="10" height="10" /></td> </tr> <tr> <td width="137" align="right" valign="top" class="text6">Title of the Post : </td> <td> </td> <td class="text7"><input name="jposition" type="text" size="40"></td> </tr> <tr> <td align="right" valign="top" class="text6">Client : </td> <td width="7"> </td> <td width="363"> <select name="cname"> <option value="javascript:;" selected>-- select client here --</option> <? $uSql = "SELECT client_name FROM clients"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[client_name]?>"><?= $uRow[client_name]?></option> <? } } ?> </select></td> </tr> <tr> <td align="right" valign="top" class="text6">Contact Person: </td> <td width="7"> </td> <td><span class="text7"> <input name="cperson" type="text" size="40" /> </span></td> </tr> <tr> <td align="right" valign="top" class="text6">Specialization : </td> <td width="7"> </td> <td width="363"> <select name="specialization"> <option value="javascript:;" selected>-- select specialization here --</option> <? $uSql = "SELECT specialization FROM specialization"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[specialization]?>"><?= $uRow[specialization]?></option> <? } } ?> </select> </td> </tr> <tr> <td align="right" valign="top" class="text6">Level : </td> <td> </td> <td> <select name="level"> <option value="javascript:;" selected>----</option> <? $uSql = "SELECT level FROM level"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[level]?>"><?= $uRow[level]?></option> <? } } ?> </select></td> </tr> <tr> <td align="right" valign="top" class="text6">Industry : </td> <td> </td> <td> <select name="industry"> <option value="javascript:;" selected>-- select industry here--</option> <? $uSql = "SELECT industry FROM industry"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[industry]?>"><?= $uRow[industry]?></option> <? } } ?> </select></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td align="right" valign="top" class="text6">Our Client : </td> <td> </td> <td><textarea name="cdescription" cols="50" rows="5"></textarea></td> </tr> <tr> <td align="right" class="text6"> </td> <td> </td> <td> </td> </tr> <tr> <td align="right" valign="top" class="text6">Requirements : </td> <td> </td> <td><textarea name="jrequirements" cols="50" rows="8"></textarea></td> </tr> <tr> <td align="right" class="text6"> </td> <td> </td> <td> </td> </tr> <tr> <td align="right" valign="top" class="text6">Responsibilities : </td> <td> </td> <td><textarea name="jresponsibilities" cols="50" rows="8"></textarea></td> </tr> <tr> <td align="right" class="text6"> </td> <td> </td> <td> </td> </tr> <tr> <td align="right" valign="top" class="text6">Job Type :</td> <td> </td> <td class="text3"><input type="checkbox" name="jtype1" value="Permanent" > Permanent <input type="checkbox" name="jtype2" value="Contract" /> Contract <input type="checkbox" name="jtype3" value="Part-Time" /> Part-Time </td> </tr> <tr> <td align="right" valign="top" class="text6"> </td> <td> </td> <td> </td> </tr> <tr> <td align="right" valign="top" class="text6">Salary :</td> <td> </td> <td><span class="text7"> <input type="text" name="salary" /> </span></td> </tr> <tr> <td align="right" valign="top" class="text6">Location :</td> <td> </td> <td><span class="text7"> <input name="location" type="text" size="50" /> </span></td> </tr> <tr> <td align="right" valign="top" class="text6">Country :</td> <td> </td> <td><select name="country"> <option value="">Select Location</option> <option value="Singapore">Singapore</option> <option value="Malaysia">Malaysia</option> <option value="Philippines">Philippines</option> <option value="India">India</option> <option value="Hong Kong">Hong Kong</option> <option value="">---------------------</option> <option value="North America">North America</option> <option value="Middle East">Middle East</option> <option value="Europe">Europe</option> </select></td> </tr> <tr> <td align="right" valign="top" class="text6">Opening Date :</td> <td> </td> <td> <select name="dayposted"> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> <option value='4'>4</option> <option value='5'>5</option> <option value='6'>6</option> <option value='7'>7</option> <option value='8'>8</option> <option value='9'>9</option> <option value='10'>10</option> <option value='11'>11</option> <option value='12'>12</option> <option value='13'>13</option> <option value='14'>14</option> <option value='15'>15</option> <option value='16'>16</option> <option value='17'>17</option> <option value='18'>18</option> <option value='19'>19</option> <option value='20'>20</option> <option value='21'>21</option> <option value='22'>22</option> <option value='23'>23</option> <option value='24'>24</option> <option value='25'>25</option> <option value='26'>26</option> <option value='27'>27</option> <option value='28'>28</option> <option value='29'>29</option> <option value='30'>30</option> <option value='31'>31</option> </select> <select name="monthposted"> <option value='1'>Jan</option> <option value='2'>Feb</option> <option value='3'>Mar</option> <option value='4'>Apr</option> <option value='5'>May</option> <option value='6'>Jun</option> <option value='7'>Jul</option> <option value='8'>Aug</option> <option value='9'>Sep</option> <option value='10'>Oct</option> <option value='11'>Nov</option> <option value='12'>Dec</option> </select> <select name="yearposted"> <?php for($i=2001; $i<=date("Y"); $i++){ print '<option value="'.$i.'"'; if($yearText == $i){ print ' selected'; } print '>'.$i.'</option>'; } ?> </select> </td> </tr> <tr> <td align="right" valign="top" class="text6">Closing Date :</td> <td> </td> <td><select name="dayclosed"> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> <option value='4'>4</option> <option value='5'>5</option> <option value='6'>6</option> <option value='7'>7</option> <option value='8'>8</option> <option value='9'>9</option> <option value='10'>10</option> <option value='11'>11</option> <option value='12'>12</option> <option value='13'>13</option> <option value='14'>14</option> <option value='15'>15</option> <option value='16'>16</option> <option value='17'>17</option> <option value='18'>18</option> <option value='19'>19</option> <option value='20'>20</option> <option value='21'>21</option> <option value='22'>22</option> <option value='23'>23</option> <option value='24'>24</option> <option value='25'>25</option> <option value='26'>26</option> <option value='27'>27</option> <option value='28'>28</option> <option value='29'>29</option> <option value='30'>30</option> <option value='31'>31</option> </select> <select name="monthclosed"> <option value='1'>Jan</option> <option value='2'>Feb</option> <option value='3'>Mar</option> <option value='4'>Apr</option> <option value='5'>May</option> <option value='6'>Jun</option> <option value='7'>Jul</option> <option value='8'>Aug</option> <option value='9'>Sep</option> <option value='10'>Oct</option> <option value='11'>Nov</option> <option value='12'>Dec</option> </select> <select name="yearclosed"> <?php for($i=2001; $i<=date("Y"); $i++){ print '<option value="'.$i.'"'; if($yearText == $i){ print ' selected'; } print '>'.$i.'</option>'; } ?> </select> </td> </tr> <tr> <td align="right" valign="top" class="text6">Status :</td> <td> </td> <td><select name="jstatus"> <option value="open" selected="selected">open</option> <option value="closed">closed</option> </select></td> </tr> <tr> <td align="right" valign="top" class="text6">Remark :</td> <td> </td> <td><textarea name="remarks" cols="50" rows="5"></textarea></td> </tr> <tr> <td rowspan="2"> </td> <td rowspan="2"> </td> <td><input type="submit" name="Submit" value="save" /> <input type="hidden" name="username" value="<? echo "$username"; ?>"> <input type=hidden value=http://www. name=redirect> </td> </tr> <tr> <td> </td> </tr> </table> </form> and this is the code for my addjob.php page <? session_start(); if (session_is_registered("username")){ }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='../index.php'>Login</a></font>"; } include '../db_connect.php'; $jposition = $_POST['jposition']; $cname = $_POST['cname']; $cperson = $_POST['cperson']; $specialization = $_POST['specialization']; $level = $_POST['level']; $industry = $_POST['industry']; $cdescription = $_POST['cdescription']; $jrequirements = $_POST['jrequirements']; $jresponsibilities = $_POST['jresponsibilities']; $jtype1 = $_POST['jtype1']; $jtype2 = $_POST['jtype2']; $jtype3 = $_POST['jtype3']; $salary = $_POST['salary']; $location = $_POST['location']; $country = $_POST['country']; $dayposted = $_POST['dayposted']; $monthposted = $_POST['monthposted']; $yearposted = $_POST['yearposted']; $dayclosed = $_POST['dayclosed']; $monthclosed = $_POST['monthclosed']; $yearclosed = $_POST['yearclosed']; $jstatus = $_POST['jstatus']; $remarks = $_POST['remarks']; $username = $_POST['username']; //0000-00-00 $dateposted = $yearposted.'-'.$monthposted.'-'.$dayposted; $dateclosed = $yearclosed.'-'.$monthclosed.'-'.$dayclosed; $jposition = stripslashes($jposition); $cname = stripslashes($cname); $cperson = stripslashes($cperson); $specialization = stripslashes($specialization); $level = stripslashes($level); $industry = stripslashes($industry); $cdescription = stripslashes($cdescription); $jrequirements = stripslashes($jrequirements); $jtype1 = stripslashes($jtype1); $jtype2 = stripslashes($jtype2); $jtype3 = stripslashes($jtype3); $salary = stripslashes($salary); $location = stripslashes($location); $country = stripslashes($country); $dayposted = stripslashes($dayposted); $monthposted = stripslashes($monthposted); $yearposted = stripslashes($yearposted); $dayclosed = stripslashes($dayclosed); $monthclosed = stripslashes($monthclosed); $yearclosed = stripslashes($yearclosed); $jstatus = stripslashes($jstatus); $remarks = stripslashes($remarks); $username = stripslashes($username); // --- for the company logo //if ($clientImage == '$EventImage') {$clientImageLink = '2';} // else {$clientImageLink = '1';} $sql = mysql_query("INSERT INTO job_ads (c_name, cperson, c_description, j_position, j_responsibilities, j_requirements, industry, specialization, level, j_type1, j_type2, j_type3, location ,country, salary, j_status, remarks, date_posted, date_closed, staff_created ) VALUES('$cname', '$cperson', '$jdescription', '$jposition', '$jresponsibilities', '$jrequirements', '$industry', '$specialization', '$level', '$jtype1', '$jtype2', '$jtype3', '$location', '$country', '$salary', '$jstatus', '$remarks', '$dateposted', '$dateclosed', '$username')") or die (mysql_error()); if(!$sql){ echo '<script language=javascript> alert("Error adding client");top.location = "../jobmngr.php?id=1";</script>'; exit(); } else { $jobid = mysql_insert_id(); echo '<script language=javascript> alert("New Job has been added by '.$username.'!");top.location = "../jobmngr.php?id=2&type=1";</script>'; } ?> hope you could help me with this. thanks!
-
guys, do you know how to convert html page into word doc file using php? need help on this please thanks!
-
how should i fix this? need help please thanks!
-
guys, i need help. i have an advance search form that its working if you select at least 2 or 3 fields on that form and the result will display correctly. my problem is if i dont select any fields or items in my advance search button i am getting errors. this is the codes in my advance search form <form id="form1" name="form1" method="post" action="view3.php"> <table width="599" border="0" cellspacing="4" cellpadding="0"> <tr> <td colspan="2" valign="top" class="text7">: ADVANCED SEARCH : </td> <td width="91" align="right" valign="top"> </td> <td width="201" align="left" valign="top"> </td> </tr> <tr> <td colspan="4" align="right" valign="top" bgcolor="#B30110"><img src="../images/main/spacer.gif" width="1" height="1"></td> </tr> <tr> <td width="111" align="right" valign="top"> </td> <td width="176" align="left" valign="top"> </td> <td width="91" align="right" valign="top"> </td> <td width="201" align="left" valign="top"> </td> </tr> <tr> <td align="right" valign="top"><span class="text6">Keywords :</span></td> <td width="176" align="left" valign="top"><input type="text" name="keywords"></td> <td width="91" align="right" valign="top"><span class="text6">Location :</span></td> <td width="201" align="left" valign="top"><select name="country"> <option value="">Select Location</option> <option value="Singapore">Singapore</option> <option value="Malaysia">Malaysia</option> <option value="Philippines">Philippines</option> <option value="India">India</option> <option value="Hong Kong">Hong Kong</option> <option value="">---------------------</option> <option value="North America">North America</option> <option value="Middle East">Middle East</option> <option value="Europe">Europe</option> </select></td> </tr> <tr> <td rowspan="3" align="right" valign="top"><span class="text6">Specialization</span> :</td> <td rowspan="3" align="left" valign="top"> <select name="specialization" size="10" class="textfield1" multiple> <option value=""></option> <?php $uSql = "SELECT specialization FROM specialization ORDER by sid ASC"; $uResult = mysql_query($uSql, $connection); while($uRow = mysql_fetch_row($uResult)){ echo "<option value=\"". $uRow[0] ."\">". $uRow[0] ."\n"; } ?> </select></td> <td align="right" valign="top"><span class="text6">Position Level :</span></td> <td valign="top"><select name="level" multiple> <option value=""></option> <?php $uSql = "SELECT level FROM level"; $uResult = mysql_query($uSql, $connection); while($uRow = mysql_fetch_array($uResult)){ echo "<option value=\"". $uRow['level'] ."\">". $uRow['level'] ."\n"; } ?> </select></td> </tr> <tr> <td align="right" valign="top"><span class="text6">Job Type : </span></td> <td valign="top"> </td> </tr> <tr> <td valign="top"> </td> <td valign="top"><span class="text3"> <input type="checkbox" name="jtype1" value="Permanent" > Permanent<br> <input type="checkbox" name="jtype2" value="Contract" /> Contract<br> <input type="checkbox" name="jtype3" value="Part-Time" /> Part-Time </span></td> </tr> <tr> <td align="right" valign="top"> </td> <td align="left" valign="top"> </td> <td colspan="2" valign="top"> </td> </tr> <tr> <td colspan="4" valign="top" bgcolor="#B30110"><img src="../images/main/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="4" align="center"><input type="submit" name="Submit" value="Submit"></td> </tr> <tr> <td colspan="4"> </td> </tr> </table> </form> and this is the code in my view3.php page <?php include '../admean/db_connect.php'; include("../admean/pagina/my_pagina_class.php"); //establish query array $query_array = array(); //append each input field into a new index //in the query_array if the user selected //it or entered information in the field if(!empty($_POST['keywords'])){ $query_array[] = "j_position LIKE '%". $_POST['keywords'] ."%'"; } if(!empty($_POST['specialization'])){ $query_array[] = "specialization = '". $_POST['specialization'] ."'"; } if(!empty($_POST['level'])){ $query_array[] = "level = '". $_POST['level'] ."'"; } if(!empty($_POST['jtype1'])){ $query_array[] = "j_type1 = '". $_POST['jtype1'] ."'"; } if(!empty($_POST['jtype2'])){ $query_array[] = "j_type2 = '". $_POST['jtype2'] ."'"; } if(!empty($_POST['jtype3'])){ $query_array[] = "j_type3 = '". $_POST['jtype3'] ."'"; } if(!empty($_POST['country'])){ $query_array[] = "country = '". $_POST['country'] ."'"; } //turn array into string $query_string = implode(" AND ", $query_array); //i don't know what's going on right here with the dropdowns... //-for the drop down menu if(isset($_GET['sort1']) && $_GET['sort1'] !=''){ $sort1 = $_GET['sort1']; }else{ $sort1 = "j_position"; } if(isset($_GET['sort2']) && $_GET['sort2']!=''){ $sort2 = $_GET['sort2']; }else{ $sort2 = "ASC"; } $test = new JHpage; //this is where we use the query string... //also, i'd put the conditional order by statement here, not up above. //on top of that, you need a comma (,) between your two sort variables. //i didn't change anything else... let me know how this works out for ya. $test->sql = "SELECT * FROM job_ads WHERE j_status ='open' AND ". $query_string ." ORDER BY ".$sort1 ." ".$sort2.""; // the (basic) sql statement (use the SQL whatever you like) $result = $test->get_page_result(); // result set $num_rows = $test->get_page_num_rows(); // number of records in result set $nav_links = $test->navigation(" | ", "currentStyle"); // the navigation links (define a CSS class selector for the current link) $nav_info = $test->page_info(); // information about the number of records on page ("to" is the text between the number) $simple_nav_links = $test->back_forward_link(true); // the navigation with only the back and forward links, use true to use images $total_recs = $test->get_total_rows(); // the total number of records ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>:: Job HiRings - Jobs ::</title> <style type="text/css"> <!-- body { background-image: url(../images/main/bg.gif); } --> </style> <link href="../css.css" rel="stylesheet" type="text/css"> <script type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> </head> <body> <table width="776" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><table width="776" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top"><img src="../images/main/top.gif" width="776" height="6"></td> </tr> <tr> <td width="6" align="left" valign="top" background="../images/main/left.gif"><img src="../images/main/left.gif" width="6" height="14"></td> <td width="764" bgcolor="#FFFFFF"><table width="764" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="239" colspan="2" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="764" height="346"> <param name="movie" value="../flash/main.swf"> <param name="quality" value="high"> <embed src="../flash/main.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="764" height="346"></embed> </object></td> </tr> <tr> <td height="62" colspan="2" align="left" valign="top" bgcolor="#FFFFFF"><table width="764" border="0" cellspacing="0" cellpadding="0"> <form method="post" action="view.php" name="searchform"><tr> <td width="181" valign="top" background="../images/main/bgbar.gif"> </td> <td width="10" valign="top" background="../images/main/bgbar.gif"><img src="../images/main/spacer.gif" width="10" height="50"></td> <td width="573" align="right" valign="middle" background="../images/main/bgbar.gif"> <span class="text7">Keywords</span> <input name="keywords" type="text" class="field2"> <select name="specialization" class="field3"> <option value="">All</option> <? $uSql = "SELECT specialization FROM specialization"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_row($uResult)){ ?> <option value="<?= $uRow[0]?>"> <?= $uRow[0]?> </option> <? } } ?> </select> <input name="Submit2" type="submit" class="button1" value="Search"> </td> </tr></form> <tr> <td colspan="3" valign="top"> </td> </tr> <tr> <td colspan="3" align="center" valign="top"> <table width="755" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="6"><img src="../admean/images/spacer.gif" width="6" height="10"></td> <td width="743" class="text9"><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#666666"><img src="../admean/job/images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td align="left" bgcolor="#666666" width="1"><img src="../admean/job/images/spacer.gif" width="1" height="1"></td> <td width="214" valign="top"><table width="741" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="5"><form method="get" action="view.php"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="450"><span class="text6"> <?php echo " total record found: " .$total_recs; ?> </span></td> <td width="287" align="right" class="text6"><span class="text7">sort by :</span> <select name="sort1"> <option value="j_position">Position</option> <option value="location">Location</option> <option value="date_posted">Date Posted</option> </select> <select name="sort2"> <option value="ASC">ASC</option> <option value="DESC">DESC</option> </select> <input type="submit" name="Submit" value="Go" /> </td> </tr> </table> </form> </td> </tr> <tr> <td colspan="5"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="../image/spacer.gif" width="1" height="1" /></td> </tr> </table></td> </tr> <tr> <td width="78" bgcolor="950101" class="text9"> Date</td> <td width="300" valign="top" bgcolor="950101" class="text9"> Position </td> <td width="155" bgcolor="950101" class="text9"> Company </td> <td width="198" colspan="2" bgcolor="950101" class="text5"> <span class="text9">Location</span></td> </tr> <?php for ($i = 0; $i < $num_rows; $i++) { $date_posted = mysql_result($result, $i, "date_posted"); $jobid = mysql_result($result, $i, "jobid"); $j_position = mysql_result($result, $i, "j_position"); $c_name = mysql_result($result, $i, "c_name"); $location = mysql_result($result, $i, "location"); ?> <tr> <td bgcolor="#e5e5e5" class="text4"> <? echo "$date_posted"; ?></td> <td bgcolor="#e5e5e5"> <a href="javascript:;" class="link1" onClick="MM_openBrWindow('jobpost.php?jobid=<? echo "$jobid"; ?>','','scrollbars=yes,width=720,height=700')"><? echo "$j_position";?></a></td> <td bgcolor="#e5e5e5" class="text4"> JobHirings </td> <td bgcolor="#e5e5e5" class="text4"> <? echo "$location";?> </td> </tr> <? } ?> <tr> <td colspan="5" bgcolor="#950101"><img src="../admean/images/spacer.gif" width="10" height="2" /></td> </tr> <tr> <td colspan="5"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="../image/spacer.gif" width="1" height="1" /></td> </tr> </table></td> </tr> </form> <tr> <td colspan="5"> </td> </tr> </table></td> <td align="right" bgcolor="#666666" width="1"><img src="../admean/job/images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#666666"><img src="../admean/job/images/spacer.gif" width="1" height="1"></td> </tr> </table></td> <td width="10"><img src="../admean/images/spacer.gif" width="6" height="10"></td> </tr> </table> </td> </tr> <tr> <td colspan="3" valign="top"> </td> </tr> </table></td> </tr> <tr> <td colspan="2" valign="top" style="background:url(../images/main/footer.gif); background-repeat:no-repeat"> <? include '../footer.php'; ?> </td> </tr> </table></td> <td width="6" background="../images/main/right.gif" align="right"><img src="../images/main/right.gif" width="6" height="3"></td> </tr> <tr> <td colspan="3" valign="bottom"><img src="../images/main/bottom.gif" width="776" height="8"></td> </tr> </table></td> </tr> </table> </body> </html> hope you could help me with this. thanks so much!
-
hi, this is the only part where its not working $special = ''; if (isset($_GET['stat'])) { if($_GET['stat'] != ''){ $special = " AND a_status = '". $_GET['stat'] ."'"; } } because if i remove that and the list menu for that <select name="stat"> <option value="">select status</option> <option value="waiting" selected>waiting</option> <option value="notconsidered">not considered</option> <option value="considered">considered</option> <option value="scheduled">scheduled</option> <option value="interviewed">interviewed</option> <option value="blocked">blacklisted</option> </select> my drop down is working. maybe there just some wrong code or something that i missed there. hope you could help me fix it. thanks!
-
how do i echo the final sql statement and where to place it? sorry i havent done those kinds of troubleshooting need help please thanks!
-
guys, i need help, i have a view page that has a drop down menu on the top wherein you can view the result with conditions set on the drop down menus. my problem now, its not working and it always give me a (0) result below is my codes for the view page. hope you could help me fix it. <?php session_start(); if (session_is_registered("username")){ $jobid = $_GET[jobid]; include("pagina/my_pagina_class.php"); $special = ''; if (isset($_GET['astatus'])) { if($_GET['astatus'] != ''){ $special = "AND a_status LIKE '%". $_GET['astatus'] ."%'"; } } if(isset($_GET['sort1']) && $_GET['sort1']!='') $sort1 = $_GET['sort1']; else $sort1 = "appid"; if(isset($_GET['sort2']) && $_GET['sort2']!='') $sort2 = $_GET['sort2']; else $sort2 = "ASC"; $test = new JHpage; $test->sql = "SELECT * FROM applicantjob WHERE jobid = '$jobid' ".$special." ORDER BY ".$sort1 ." ".$sort2.""; // the (basic) sql statement (use the SQL whatever you like) $result = $test->get_page_result(); // result set $num_rows = $test->get_page_num_rows(); // number of records in result set $nav_links = $test->navigation(" | ", "currentStyle"); // the navigation links (define a CSS class selector for the current link) $nav_info = $test->page_info(); // information about the number of records on page ("to" is the text between the number) $simple_nav_links = $test->back_forward_link(true); // the navigation with only the back and forward links, use true to use images $total_recs = $test->get_total_rows(); // the total number of records ?> <script type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10"></td> <td><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> <td width="214" valign="top"> <table width="897" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="6" align="right"><form method="get" action="sjobs.php?id=<? echo "$id"; ?>"> <input name="id" type="hidden" value="3" /> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="407"><span class="text6"> <?php echo " total record found: " .$total_recs; ?> </span></td> <td width="486" align="right" class="text6">sort by : <select name="astatus"> <option value="">select status</option> <option value="waiting" selected>waiting</option> <option value="notconsidered">not considered</option> <option value="considered">considered</option> <option value="scheduled">scheduled</option> <option value="interviewed">interviewed</option> <option value="blocked">blacklisted</option> </select> <select name="sort1"> <option value="">select category</option> <option value="appid" selected>ID</option> <option value="username">username</option> <option value="date_applied">date applied</option> </select> <select name="sort2"> <option value="ASC" selected>ASC</option> <option value="DESC">DESC</option> </select> <input type="submit" name="Submit" value="Go" /> </td> </tr> </table> </form></td> </tr> <tr> <td colspan="6"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> <tr> <td width="68" align="center" bgcolor="#83C2ED" class="text5">ID</td> <td width="320" align="center" valign="top" bgcolor="#83C2ED" class="text5">username</td> <td width="220" align="center" bgcolor="#83C2ED" class="text5">application status </td> <td width="163" align="center" bgcolor="#83C2ED" class="text5">applied position </td> <td width="125" align="center" bgcolor="#83C2ED" class="text5">date applied </td> </tr> <?php for ($i = 0; $i < $num_rows; $i++) { $appid = mysql_result($result, $i, "appid"); $username = mysql_result($result, $i, "username"); $a_status = mysql_result($result, $i, "a_status"); $jobsapplied = mysql_result($result, $i, "jobsapplied"); $date_applied = mysql_result($result, $i, "date_applied"); ?> <tr> <td align="center" bgcolor="#FFFFCC" class="text8"><span class="text5"> </span> A<? echo ($appid <= 9) ? $appid : $appid;?> </td> <td bgcolor="#FFFFCC"> <a href="javascript:;" class="link1" onClick="MM_openBrWindow('../resume/details.php?id=1&appid=<? echo "$appid"; ?>','','scrollbars=yes,width=760')"> <? echo "$username"; ?></a></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$a_status";?> </td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$jobsapplied";?><br></td> <td bgcolor="#FFFFCC" class="text8"><? echo "$date_applied";?></td> <? echo "</td></tr>"; ?> <? } ?> <tr> <td colspan="6" bgcolor="#83C2ED"><img src="../images/spacer.gif" width="10" height="2" /></td> </tr> <tr> <td colspan="6"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> <tr> <td colspan="6"> </td> </tr> </table> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10"></td> </tr> </table> <? }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='../index.php'>Login</a></font>"; } ?> thanks!
-
[SOLVED] help on my view page with searchtool bar
pixeltrace replied to pixeltrace's topic in PHP Coding Help
i was able to make it worked now. thanks for the help though -
[SOLVED] help on my view page with searchtool bar
pixeltrace replied to pixeltrace's topic in PHP Coding Help
that one is working. my problem just started when i added the conditions on my first lines of codes -
[SOLVED] help on my view page with searchtool bar
pixeltrace replied to pixeltrace's topic in PHP Coding Help
this are the errors i am getting. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 90 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 63 Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in c:\hosting\webhost4life\member\diorgrace\admean\pagina\my_pagina_class.php on line 68 normally i encounter this errors before if the variables that you assigned in line 122 to 127 is wrong. but in my case i already tested it and the variables are correct and the page is working if i havent placed any conditions. when i added the conditions i am getting this. i checked my variables several times already and everything is correct. need help please thanks! -
guys, i need help, i have a view page that has a searchtool bar. its working without the conditions on the tool bar but when i added it already i am getting errors already. hope you could check my codes and help. below is the codes for my view page <?php session_start(); if (session_is_registered("username")){ //include 'db_connect.php'; include("pagina/my_pagina_class.php"); //-for the keywords, specialization condition..... $stat = ''; if (isset($_POST['status'])) { if($_POST['status'] != ''){ $stat = "j_status = '". $_POST['status'] ."'"; } } $key = ''; if (isset($_POST['keywords'])) { if($_POST['keywords'] != ''){ $key = " AND j_position LIKE '%". $_POST['keywords'] ."%'"; } } $cond = ''; if (isset($_POST['managed'])) { if($_POST['managed'] != ''){ $cond = " AND managedby = '". $_POST['managed'] ."'"; } } //-for the drop down menu if(isset($_POST['sort1']) && $_POST['sort1']!=''){ $sort1 = $_POST['sort1']; }else{ $sort1 = "ASC"; } $test = new JHpage; //this is where we use the query string... //also, i'd put the conditional order by statement here, not up above. //on top of that, you need a comma (,) between your two sort variables. //i didn't change anything else... let me know how this works out for ya. $test->sql = "SELECT * FROM job_ads WHERE ".$stat."".$key."".$cond." ORDER BY ".$sort1 .""; //$test->sql = "SELECT * FROM job_ads WHERE ".$keywords."".$managedby." ORDER BY ".$sort1 .""; // the (basic) sql statement (use the SQL whatever you like) $result = $test->get_page_result(); // result set $num_rows = $test->get_page_num_rows(); // number of records in result set $nav_links = $test->navigation(" | ", "currentStyle"); // the navigation links (define a CSS class selector for the current link) $nav_info = $test->page_info(); // information about the number of records on page ("to" is the text between the number) $simple_nav_links = $test->back_forward_link(true); // the navigation with only the back and forward links, use true to use images $total_recs = $test->get_total_rows(); // the total number of records ?> <script type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10"></td> <td><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> <td width="214" valign="top"> <table width="862" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="4"><form method="POST" action="sjobs.php?id=1"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="157"><span class="text6"> <?php echo " total record found: " .$total_recs; ?> </span></td> <td width="701" align="right" class="text6">job title: <input type="text" name="keywords" /> status: <select name="status"> <option value="open" selected>open</option> <option value="close">close</option> </select> managed by: <select name="managed"> <option value="">-------------</option> <?php $uSql = "SELECT managedby FROM job_ads ASC"; $uResult = mysql_query($uSql, $connection); while($uRow = mysql_fetch_row($uResult)){ echo "<option value=\"". $uRow[0] ."\">". $uRow[0] ."\n"; } ?> </select> <select name="sort2"> <option value="ASC">ASC</option> <option value="DESC">DESC</option> </select> <input type="submit" name="Submit" value="Go" /> </td> </tr> </table> </form></td> </tr> <tr> <td colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="../../images/main/spacer.gif" width="1" height="1" /></td> </tr> </table></td> </tr> <tr> <td width="66" align="center" bgcolor="#83C2ED" class="text5">ID</td> <td width="309" align="center" valign="top" bgcolor="#83C2ED" class="text5">job title</td> <td width="274" align="center" bgcolor="#83C2ED" class="text5">managed by </td> <td width="203" align="center" bgcolor="#83C2ED" class="text5">status</td> </tr> <?php for ($i = 0; $i < $num_rows; $i++) { $jobid = mysql_result($result, $i, "jobid"); $j_position = mysql_result($result, $i, "j_position"); $managedby = mysql_result($result, $i, "managedby"); $j_status = mysql_result($result, $i, "j_status"); ?> <tr> <td align="center" bgcolor="#FFFFCC" class="text8">J<? echo ($jobid <= 9) ? $jobid : $jobid;?> </td> <td bgcolor="#FFFFCC"> <a href="javascript:;" class="link1" onClick="MM_openBrWindow('../jobsearch/jobpost.php?jobid=<? echo "$jobid"; ?>','','scrollbars=yes,width=720,height=700')"> <? echo "$j_position";?></a></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$managedby";?> </td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$j_status";?></td> </tr> <? } ?> <tr> <td colspan="4" bgcolor="#83C2ED"><img src="../images/spacer.gif" width="10" height="2" /></td> </tr> <tr> <td colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="../../images/main/spacer.gif" width="1" height="1" /></td> </tr> </table></td> </tr> <tr> <td colspan="4"> </td> </tr> </table> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10"></td> </tr> </table> <? }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='../index.php'>Login</a></font>"; } ?> thanks!
-
[SOLVED] how to display total number of rows
pixeltrace replied to pixeltrace's topic in PHP Coding Help
thanks its working now! -
guys, what is the code in displaying the total number of rows? let say in table applicant? $sql = SELECT ..... FROM applicant echo ..... ??? need help please! thanks!
-
help please
-
hi, no, its not working. the last sql query that i have $sql="UPDATE applicantjob SET a_status = '$astatus' WHERE ajid= '$ajid'"; mysql_query($sql) or die("error:".mysql_error()); is working but the rest of the sql queries are not working maybe there just something wong with my if else conditions or maybe with my queries need help please
-
any help for this one please? its still not working. thanks!
-
guys, i need help i have a page that displays the total number of items on each column my problem now, when i do some updates, the result is not being reflected to the form its kinda hard to explain, but below is my process page and i will just tell you want i wanted to happen on this page <?php session_start(); if (session_is_registered("username")){ }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='index.php'>Login</a></font>"; } include '../db_connect.php'; $astatus = $_POST['astatus']; $ajid = $_POST['ajid']; $appid = $_POST['appid']; $jobid = $_POST['jobid']; //foreach($checkbo as $key=>$val){ //print "$key".$val; if ($astatus == 'Not Considered'){ $sql1="UPDATE job_ads SET nconsidered = nconsidered - 1 WHERE jobid= '$jobid'"; mysql_query($sql1) or die("error:".mysql_error()); $sql6="UPDATE job_ads SET nconsidered = nconsidered + 1 WHERE jobid= '$jobid'"; mysql_query($sql6) or die("error:".mysql_error()); } elseif ($astatus = 'Considered'){ $sql2="UPDATE job_ads SET considered = considered - 1 WHERE jobid= '$jobid'"; mysql_query($sql2) or die("error:".mysql_error()); $sql7="UPDATE job_ads SET considered = considered + 1 WHERE jobid= '$jobid'"; mysql_query($sql7) or die("error:".mysql_error()); } elseif ($astatus = 'Scheduled'){ $sql3="UPDATE job_ads SET scheduled = scheduled - 1 WHERE jobid= '$jobid'"; mysql_query($sql3) or die("error:".mysql_error()); $sql8="UPDATE job_ads SET scheduled = scheduled + 1 WHERE jobid= '$jobid'"; mysql_query($sql8) or die("error:".mysql_error()); } elseif ($astatus = 'Interviewed'){ $sql4="UPDATE job_ads SET interviewed = interviewed - 1 WHERE jobid= '$jobid'"; mysql_query($sql4) or die("error:".mysql_error()); $sql9="UPDATE job_ads SET interviewed = interviewed + 1 WHERE jobid= '$jobid'"; mysql_query($sql9) or die("error:".mysql_error()); } elseif ($astatus = 'Blacklisted'){ $sql5="UPDATE job_ads SET blocked = blocked - 1 WHERE jobid= '$jobid'"; mysql_query($sql5) or die("error:".mysql_error()); $sql10="UPDATE job_ads SET blocked = blocked + 1 WHERE jobid= '$jobid'"; mysql_query($sql10) or die("error:".mysql_error()); } $sql="UPDATE applicantjob SET a_status = '$astatus' WHERE ajid= '$ajid'"; mysql_query($sql) or die("error:".mysql_error()); echo '<script language=javascript> alert("job application has been updated!");top.location = "details.php?id=1&appid='.$appid.'&ajid='.$ajid.'";</script>'; ?> normally, i have a "astatus" radio button in my first page with values Not Considered Considered Scheduled Interviewed Blacklisted so on that page when i update let say the current value is "blacklisted" if i update it and change it to "considered" and value of "1" should be added to the field of "considered" field in my job_ads table and it will subtract "1" from "blocked" field in my job_ads table. same goes with the other conditions what is happening now in my current codes is, its not working and the vaules are still the same or hasnt changed at all hope you could help me with this thanks so much!!!!!
-
guys, i need help, i have a page that should get items from 2 different tables specialization and applicant in the specialization, its as to display all items on the table for "specialization" in the applicant, it has to display the total number of counts equivalent to specialization ex. administration (1) agricultural (1) the administration and agricultural will be taken from the specialization table and the (1) will be taken from the applicant table below is my codes for this page <table width="558" border="0" cellspacing="2" cellpadding="3"> <tr> <td colspan="2" valign="top"><img src="images/spacer.gif" width="10" height="1" /></td> </tr> <tr> <td colspan="2" bgcolor="#999999" class="text2">RESUME MANAGER </td> </tr> <tr> <td colspan="2" valign="top"><img src="images/spacer.gif" width="10" height="10" /></td> </tr> <tr> <td colspan="2" valign="top" bgcolor="#83C2ED" class="text2">Specialization </td> </tr> <? $query = mysql_query("SELECT specialization FROM specialization") or die(mysql_error()); $row = mysql_fetch_array( $query ); $specialization = $row["specialization"]; ?> <tr> <td width="4" align="left" valign="top" class="text6"><img src="images/spacer.gif" width="4" height="10" /></td> <td width="536" align="left" valign="top" class="text6">ยป <? echo "$specialization";?> <a href="resumemngr.php?id=3&specialization=<? echo "$specialization"; ?>" class="link2">[ <? $query = mysql_query("SELECT specialization, COUNT(*) AS cnt FROM applicant WHERE specialization LIKE '%". $specialization ."%';") or die(mysql_error()); $row = mysql_num_rows($query); ?> <? echo "$row";?> ]</a></td> </tr> <? } } ?> </table> this codes are not working and i dont know how to fix it, hope you could help me with this. thanks!
-
how do i display this? thanks!
-
guys, i need help. how do i display the total number of rows in a table let say $sql = "SELECT total number of specialization FROM applicant WHERE specialization = 'administration'"; echo = "total number"; what is the correct code for this? thanks!
-
sorry, this is the code for my changestatus.php <?php session_start(); if (session_is_registered("username")){ }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='index.php'>Login</a></font>"; } $checkbox = implode("\n", $_POST['checkbox']); $staff_updated = $_POST['username']; include '../db_connect.php'; $check = $_POST['checkbox']; foreach($check as $key=>$val){ //print "$key".$val; $sql="UPDATE job_ads SET j_status = open WHERE jobid LIKE '%". $val ."%'"; mysql_query($sql) or die("error:".mysql_error()); echo '<script language=javascript> alert("jobs has been updated by '.$staff_updated.'!");top.location = "../jobmngr.php?id=2&type=1";</script>'; } ?>
-
guys, i need help, i have a form with 2 buttons named repost and close my form has a checkbox wherein if you check it, you can click repost to set the status of the checkbox item to open or you can click the close button to set the checkbox item status to close my problem now is, this result is just being submitted to a common page and i dont know what codes do i need to add to make this thing work below is my codes for the form page <?php session_start(); if (session_is_registered("username")){ include("pagina/my_pagina_class.php"); if(isset($_GET['sort1']) && $_GET['sort1']!='') $sort1 = $_GET['sort1']; else $sort1 = "j_position"; if(isset($_GET['sort2']) && $_GET['sort2']!='') $sort2 = $_GET['sort2']; else $sort2 = "ASC"; $test = new JHpage; $test->sql = "SELECT * FROM job_ads ORDER BY ".$sort1 ." ".$sort2.""; // the (basic) sql statement (use the SQL whatever you like) $result = $test->get_page_result(); // result set $num_rows = $test->get_page_num_rows(); // number of records in result set $nav_links = $test->navigation(" | ", "currentStyle"); // the navigation links (define a CSS class selector for the current link) $nav_info = $test->page_info(); // information about the number of records on page ("to" is the text between the number) $simple_nav_links = $test->back_forward_link(true); // the navigation with only the back and forward links, use true to use images $total_recs = $test->get_total_rows(); // the total number of records ?> <script type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10"></td> <td><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> <td width="214" valign="top"> <table width="1049" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="13"><form method="get" action="jobmngr.php?id=2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="799"><span class="text6"> <?php echo " total record found: " .$total_recs; ?> </span></td> <td width="246" align="right" class="text6">sort by : <select name="sort1"> <option value="j_position">name</option> <option value="jobid">ID</option> <option value="date_posted">date</option> </select> <select name="sort2"> <option value="ASC">ASC</option> <option value="DESC">DESC</option> </select> <input type="submit" name="Submit" value="Go" /> </td> </tr> </table> </form></td> </tr> <form action="changestatus.php" method="post"> <tr> <td colspan="13"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> <input type="submit" name="Submit2" value="repost"> <input type="submit" name="Submit3" value="close" /></td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> <tr> <td width="29" align="center" bgcolor="#83C2ED" class="text5"> </td> <td width="51" align="center" bgcolor="#83C2ED" class="text5">ID</td> <td width="230" align="center" valign="top" bgcolor="#83C2ED" class="text5">title</td> <td width="140" align="center" bgcolor="#83C2ED" class="text5">level </td> <td width="254" align="center" bgcolor="#83C2ED" class="text5">client</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">N</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">C</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">S</td> <td width="25" align="center" bgcolor="#83C2ED" class="text5">I</td> <td width="24" align="center" bgcolor="#83C2ED" class="text5">B</td> <td width="28" align="center" bgcolor="#83C2ED" class="text5">CV</td> <td width="60" align="center" bgcolor="#83C2ED" class="text5">status</td> <td width="105" bgcolor="#83C2ED"> </td> </tr> <?php for ($i = 0; $i < $num_rows; $i++) { $jobid = mysql_result($result, $i, "jobid"); $j_position = mysql_result($result, $i, "j_position"); $level = mysql_result($result, $i, "level"); $c_name = mysql_result($result, $i, "c_name"); $cperson = mysql_result($result, $i, "cperson"); $nconsidered = mysql_result($result, $i, "nconsidered"); $considered = mysql_result($result, $i, "considered"); $scheduled = mysql_result($result, $i, "scheduled"); $interviewed = mysql_result($result, $i, "interviewed"); $blocked = mysql_result($result, $i, "blocked"); $cv = mysql_result($result, $i, "cv"); $j_status = mysql_result($result, $i, "j_status"); ?> <tr> <td bgcolor="#FFFFCC" class="text8"><span class="text5"> <input type="checkbox" name="checkbox[]" value="<? echo"jobid"; ?>" /> </span></td> <td bgcolor="#FFFFCC" class="text8">J<? echo ($jobid <= 9) ? $jobid : $jobid;?> </td> <td bgcolor="#FFFFCC"> <a href="javascript:;" class="link1" onClick="MM_openBrWindow('../jobsearch/jobpost.php?jobid=<? echo "$jobid"; ?>','','scrollbars=yes,width=720,height=700')"> <? echo "$j_position";?></a></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$level";?> </td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$c_name";?><br> <i><? echo "$cperson";?></i></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$nconsidered";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$considered";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$scheduled";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$interviewed";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$blocked";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$cv";?></td> <td bgcolor="#FFFFCC" class="text8"> <? echo "$j_status";?></td> <? echo "<td align='center' bgcolor='#FFFFCC'><a href='jobmngr.php?id=3&jobid=$jobid' class='link1'>edit</a> | <a href='jobmngr.php?id=4&jobid=$jobid' class='link1'>applications</a> </td></tr>"; ?> <? } ?> <tr> <td colspan="13" bgcolor="#83C2ED"><img src="../images/spacer.gif" width="10" height="2" /></td> </tr> <tr> <td colspan="13"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" align="left" class="text8"> </td> <td width="39%" align="right"><!-- nav top --> <? echo "<span class='link1'>".$nav_links."</span>"; ?> </td> <td width="1%" align="right"><img src="images/spacer.gif" width="12" height="10" /></td> </tr> </table></td> </tr> </form> <tr> <td colspan="13"> </td> </tr> </table> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10"></td> </tr> </table> <? }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='../index.php'>Login</a></font>"; } ?> my check box is named as checkbox[] since you can select as many items as you like and this is the code in my changestatus.php page <?php session_start(); if (session_is_registered("username")){ $checkbox = implode("\n", $_POST['checkbox']); $staff_updated = $_POST['username']; include '../db_connect.php'; $special = $_POST['specialization']; foreach($special as $key=>$val){ //print "$key".$val; $sql="UPDATE job_ads SET j_status = open WHERE jobid LIKE '%". $val ."%'"; mysql_query($sql) or die("error:".mysql_error()); echo '<script language=javascript> alert("jobs has been updated by '.$staff_updated.'!");top.location = "../jobmngr.php?id=2&type=1";</script>'; }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='index.php'>Login</a></font>"; } ?> i was only able to set condition for the open status but i dont know how to do it for the close status. need help on this. thanks!
-
help please thanks!
-
guys, i need help, i have a form wherein once submitted it 1. update table 1 2. insert in table 2 the form has a "specialization" select box wherein you can select multiple items and those items are updating "hits" row in table 1 adding 1 for every item that is being selected. my codes are working if i only select 1 item from the "specialization" select box but the problem comes if i select more that 1 item on the select box. this is the code for my form <form action="resume/addresume.php" method="post" enctype="multipart/form-data"> <select name="specialization[]" size="8" class="textfield1" multiple> <? include 'db_connect.php'; $uSql = "SELECT specialization FROM specialization ORDER by sid ASC"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; } else{ while($uRow = mysql_fetch_row($uResult)){ ?> <option value="<?= $uRow[0]?>"><?= $uRow[0]?></option> <? } } ?> </select></form> and this is the code in my addresume.php <? session_start(); if (session_is_registered("username")){ }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='../index.php'>Login</a></font>"; } include '../db_connect.php'; $email = $_POST['email']; $fname = $_POST['fname']; $lname = $_POST['lname']; $dayregistered = $_POST['dayregistered']; $monthregistered = $_POST['monthregistered']; $yearregistered = $_POST['yearregistered']; $specialization = implode("\n", $_POST['specialization']); $level = $_POST['level']; $resume = $_POST['resume']; // 0000-00-00 $dateregistered = $yearregistered.'-'.$monthregistered.'-'.$dayregistered; //email verification 2 $sql_username_check = mysql_query("SELECT username FROM applicant WHERE email='$email'"); $username_check = mysql_num_rows($sql_username_check); if($username_check > 0){ echo '<script language=javascript> alert("Email is already used!");history.back() = "../resumemngr.php?id=1";</script>'; unset($username); exit(); } $email = stripslashes($email); $fname = stripslashes($fname); $lname = stripslashes($lname); $dateregistered = stripslashes($dateregistered); $specialization = stripslashes($specialization); $level = stripslashes($level); $resume = mysql_real_escape_string(stripslashes($_POST['resume'])); $hits = $hits+1; $sql="UPDATE specialization SET hits ='$hits' WHERE specialization LIKE '%". $specialization ."%'"; mysql_query($sql) or die("error:".mysql_error()); $sql = mysql_query("INSERT INTO applicant (email, username, fname, lname, dateregistered, specialization, level, resume ) VALUES('$email', '$email', '$fname', '$lname', '$dateregistered', '$specialization', '$level', '$resume')") or die (mysql_error()); if(!$sql){ echo '<script language=javascript> alert("Error adding candidate");history.back() = "../resumemngr.php?id=1";</script>'; exit(); } else { $appid = mysql_insert_id(); echo '<script language=javascript> alert("New candidate has been added!");top.location = "../resumemngr.php?id=1";</script>'; } ?> hope you could help me with this. thanks!