2012-12-25 5 views
0

Table a마크 행으로 중요하고 그것이

내가 "여기를 클릭"버튼을 클릭하면이, TableA의입니다로드 할 때마다 저장된 유지, 때마다 특정 테이블이 코드

<tr> 
    <th style="height: 25px">NAME</th> 
    <th style="height: 25px">EMAIL</th> 
    <th style="height: 25px">CELL NO</th> 
    <th style="height: 25px">CITY</th> 
    <th style="height: 25px; width:120px">DATE APPLIED</th> 
    <th style="height: 25px">POST A MESSAGE TO CANDIDATE</th> 
    <th style="height: 25px">DETAILED CV</th> 
    <th>Hide Candidate</th> 
    <th>MARK AS IMPORTANT</th> 
</tr>            
<!-- /headings --> 
<?php 
if(isset($_GET['id'])) { 
    echo "<script>window.location = \"#showcand\";</script>";            
    if($result) { 
     if (mysql_num_rows($result) == 0) { 
      echo "<tr>"; 
      echo "<td colspan=\"4\" ><p align=\"center\" class=\"message\"><blink><span style=\"color:red;\" > NO CANDIDATE APPLIED</span></blink></p></td>";  
      echo "</tr>"; 
     } 

     while($data_set1 = mysql_fetch_array($result)) {            
      echo "<tr>"; 
      echo "<td>{$data_set1['ename']}</td>"; 
      echo "<td>{$data_set1['eemail']}</td>"; 
      echo "<td>{$data_set1['ecell']}</td>"; 
      echo "<td>{$data_set1['ecity']}</td>"; 
      echo "<td>{$data_set1['date_of_jobapply']}</td>"; 
      echo "<td><a href=\"reply.php?tid={$_SESSION['vid']}&id=1&name={$data_set1['ename']}&email={$data_set1['eemail']} \"><input class=\"button\" name=\"submit\" type=\"submit\" value=\"POST\" /></a></td>"; 
      echo "<td><a href=\"detailcv.php?id={$data_set1['eid']}\" target=\"_blank\"><input style=\" cursor:hand;width:40px\" class=\"button\" name=\"cv\" type=\"button\" value=\"C V\" /></a></td>"; 
      echo "<td><input type=\"checkbox\" name=\"hide_cand\" id=\"hide_cand\"onclick=\"return hideRow(this)\"/></td>"; 
      echo "<td><input type=\"checkbox\" name=\"imp_cand\" id=\"hide_cand\"/></td>"; 
      echo "</tr>"; 
     } 
    } ?> 

를 사용하여로드됩니다 지난 칼럼에서 나는 imp로 특정 행을 표시하고 imp를 사용하지 않고 확인란을 사용하고이 테이블을로드 할 때마다 행을 표시된 행을 그대로 표시해야합니다. 어떻게 할 수 있습니까?

+0

은 당신이 뭔가를 시도 얻는 곳

당신은 checked="checked" 에코 할 수 있습니까? AJAX를 한번보세요. 또는 확인란을 클릭하면 제출할 양식을 사용할 수 있습니다. 그냥 쓰기/데이터베이스에 체크하지 않습니다. –

답변

2

해당 필드를 데이터베이스에 저장하고 매번 ajax 쿼리를 실행합니다. 그 값의 필드를 0에서 1로 변경하는 것이 중요하다고 표시합니다. 1은 중요하고 0은 중요하지 않거나 그 종류의 것이 아닙니다.

그리고 쿼리를 실행하여 결과를 가져 오면 플래그도 가져오고 그에 따라 확인란을 설정하십시오. 값이 (isimportant을 말할 수) 1.

+0

'echo "" ;'나는이 행을 상속했고 데이터베이스에 기본값 0을 추가하고 그 값을 가져 와서이 함수를 function markimp (checkbox)에 추가했습니다. { if (이 후보를 선택 하시겠습니까? ')) { mysql_query ("UPDATE applyjob SET marked_impval ='1 'where jobid ='". $ id. " 'AND eid ='". employee.eid. " 'AND marked_impval ='0 '") (mysql_error()); \t } return false; }'하지만 적절한 결과를 제공하지 않습니다. – raj