Jump to content

loveme

New Members
  • Posts

    4
  • Joined

  • Last visited

loveme's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I would like to generate team by their seniority based on the available members. For example : I have 60 members. I want use all this 60 members as teams. Each team has one leader,one asst leader, and 8 members (1+1+8) . $result = mysqli_query($con, "SELECT * FROM `members` ORDER BY DOJ,DOB"); $perteam =10; $teamstart=1; $teams=15; $required=$perteam*$teams; $data = array(); while( $row = mysqli_fetch_array($result)) { $data[]=$row; } foreach($data as $fetch){ echo $fetch["empname"].'<br>'; } I used the above code to fetch the members in seniority . Now I want to add another coumns Team and Designation as follows; 1.Peter - Team 1-Leader1 2.Robin - Team 2 - Leader2 … Likewise it should go… How do I achieve this. any lead…?
  2. Get the value by row statement $row=mysql_fetch_array($se_sql); $name=$row['S_Name']; Put the value in input box as value='<?php echo $tamil;?>
  3. I designed a php page if current time is greater than end time it show as closed else it show data entry form. In that form I have several input boxes some get value from database.remain input boxes accept value less than their pair input box.else it show error and focus user to change that field how ... I tried with following code but cannot get expected result... Any solution... <?php include("head.php"); ?> <?php $end = ('04:15:00 PM'); $now=date('H:i:s A');?> <?php $newdateformat = date("d_m_y"); $ttaerr=""; mysql_select_db($mysql_database,$bd); $se_sql=mysql_query("select * from $newdateformat where S_No='$login_sess' "); $row=mysql_fetch_array($se_sql); $name=$row['S_Name']; $address=$row['Address']; $tamil= $row['Tamil1']; $english=$row['English1']; $maths= $row['Maths1']; ?> <label> Your Name : <?php echo $login_sess;?> - <?php echo $name;?> - <?php echo $address;?> </label><br /> <?php if($end > $now){ echo "Entry 1 Closed :"; } else { ?> <form id='form1' name='form1' method='post' action='<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>'>' <p> <label for='tamil1'>Tamil 1 : </label> <input name='tamil1' type='text' id='tamil1' value='<?php echo $tamil;?>' readonly="readonly" disabled="disabled"/> </p> <p> <label for='tamil2'>Tamil 2 : </label> <input name='tamil2' type='text' id='tamil2' maxlength="3" required='required' /> <?php echo $ttaerr;?> </p> <p> <label for='tamil1'>English 1 : </label> <input type='text' name='english1' id='english1' value='<?php echo $english;?>' readonly="readonly" disabled="disabled"/> </p> <p> <label for='tamil2'>English 2 : </label> <input type='text' name='english2' id='english2' required='required' maxlength="3" /> </p> <p> <label for='tamil1'>Maths 1 : </label> <input type='text' name='maths1' id='maths1' value='<?php echo $maths;?>' readonly="readonly" disabled="disabled" /> </p> <p> <label for='tamil2'>Maths 2 : </label> <input type='text' name='maths2' id='maths2' required='required' maxlength="3" /> </p> <p> </p> <p> <input type='submit' name='submit' id='submit' value='Submit' /> </p> </form> <?php if($_SERVER['REQUEST_METHOD']=="POST") { if(isset($_POST['tamil1'])&&isset($_POST['tamil2'])&&isset($_POST['english1'])&&isset($_POST['english2'])&&isset($_POST['maths1'])&&($_POST['maths2'])) { $newta1=$_POST['tamil1']; $newta2=$_POST['tamil2']; $newen1=$_POST['english1']; $newen2=$_POST['english2']; $newma1=$_POST['maths1']; $newma2=$_POST['maths2']; if(($newta1 > $newta2)&&($newen1 > $newen2)&&($newma1 > $newma2)) { $sql="UPDATE $newdateformat SET Time='$now',Tamil2='newta2',English2='$newen2',Maths2='$newma2' WHERE S_NO='$login_sess' and S_Name='$name'"; $result=mysql_query($sql); if(!$result) { die ('Error:'.mysql_error().'<br> <a href=""> Back</a>'); } echo 'Your Record added on :'.$now.'<br> <a href=""> Back</a>'; mysql_close($con); } else { echo("Try Eng..."); }} } } ?> </body> </html>
  4. Hi... I planned to create db table daily. When day begin button clicked (text box has date Value) master dB can be copied,with the name of text box value ($date). If already day begin then it show day begin done. How can I do that. Please guide me
×
×
  • 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.