
<?php
//this page brings out a static form editing a project



if($_POST['act'] == 'edit_lgas')
{
	  $id_array = $_POST['lga']; // return array
	  $id_count = count($_POST['lga']); // count array



?>


<div class="well">

      <ul class="tabs">
        <li><a href="#view1">LGA Details</a></li>
      </ul>
      <div class="tabcontents">
        <div id="view1">


        <?php

		for($i=0; $i < $id_count; $i++)
		{
		  $id = $id_array[$i];
		  $q = "SELECT * FROM lga WHERE id = '$id'";
		  $r = mysqli_query($dbc, $q);

		  if(!$r) { die(mysqli_error($dbc)); }


			  if(mysqli_num_rows($r) > 0)
			  {//begin if result exist
				  while($row = mysqli_fetch_array($r, MYSQLI_ASSOC))
				  {//begin while
		?>
                    <table id="background-image">
                    <tr><td></td><td><span class="ast">*</span>indicate required fields </td></tr>
                    <tr>
                    <td width="15%">Title</td>
                    <td width="85%"><input type="text" value="<?php echo $row['title']; ?>"
                    name="title" id="" maxlength="" size="60" /> <span class="ast">*</span> </td>
                    </tr>

                    <tr>
                    <td>Choose State</td>
                    <td>
                    <select id="" name="state" class="select_design">
                    <option value="0"></option>
                    <?php select_state($row['state_id']); ?>
                    </select>
                    <span class="ast">*</span></td>

                    </tr>

                    <tr>
                    <td>Description</td>
                    <td><textarea cols="57" rows="4" name="description" class="rte1" action="#"><?php
                    echo $row['description']; ?> </textarea></td>
                    </tr>


                    <input type="hidden" value="update_lgas" name="act" />
                    <input type="hidden" value="TRUE" name="update_lgas" /><!-- pass value for editing -->
                    <input type="hidden" value="<?php echo $row['id']; ?>" name="lga"
                    id='lga' />
                    <!-- pass id value incase he didnt fill well den bring bk for editing -->


					</table>



                   </form>

	<?php
				  }//end of if
				  }//end of while

			  }//end of for loop
	?>


        </div>

      </div>
</div>
<?php

}//end of if post edit associated
?>
