Advertisement
Advertisement
| 06.25.2008 at 08:14AM PDT, ID: 23514816 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: |
///// This is the code that runs when that specific form is submitted
///// It deletes the select entry
if (!empty($_POST["del_usher_submit"])) { //Admin deleted Usher Schedule - make SQL statement
mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());
$sql = "DELETE FROM usher_schedule WHERE date = '" . '{$_POST['del_usher_id']}' . "'";
$result = mysql_query($sql) or die(mysql_error());
mysql_close(mysql_connect(DB_HOST, DB_USER, DB_PASS));
}
///// This is the code that runs when the page is loaded natively
/////
<form id="del_usher_schedule" name="del_usher_schedule" method="post" action="main-del.php">
<table width="1236" border="1">
<tr>
<td colspan="7"><div align="center"><strong>Ushers' Schedule</strong></div></td>
</tr>
<tr>
<td><div align="center"><strong>Date</strong></div></td>
<td><div align="center"><strong>Usher 1</strong></div></td>
<td><div align="center"><strong>Usher 2</strong></div></td>
<td><div align="center"><strong>Usher 3</strong></div></td>
<td><div align="center"><strong>Usher 4</strong></div></td>
<td><div align="center"><strong>Usher 5</strong></div></td>
<td><div align="center"><strong>Action</strong></div></td>
</tr>
<?php //Create SQL Query for exiting schedules
mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());
$sql = "SELECT * FROM usher_schedule WHERE YEARweek(date) = YEARweek(CURRENT_DATE) OR date = '" . date("Y-m-d", strtotime("Next Sunday")) . "' ORDER BY date ASC";
$result = mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$usher_date = $row["date"];
$usher_1 = $row["ush1"];
$usher_2 = $row["ush2"];
$usher_3 = $row["ush3"];
$usher_4 = $row["ush4"];
$usher_5 = $row["ush5"];
?>
<tr>
<td><div align="center"><?php echo $usher_date;?></div></td>
<td><div align="center"><?php echo $usher_1;?></div></td>
<td><div align="center"><?php echo $usher_2;?></div></td>
<td><div align="center"><?php echo $usher_3;?></div></td>
<td><div align="center"><?php echo $usher_4;?></div></td>
<td><div align="center"><?php echo $usher_5;?></div></td>
<td><div align="center">
<input name="del_usher_id" type="hidden" value="<?php echo $usher_date;?>" />
<input name="del_usher_submit" type="submit" value="Delete" onclick="javascript:return confirm('Are you sure you want to delete the usher schedule for <?php echo $usher_date;?>?')" />
</div></td>
</tr>
<?php
} //End While Loop
mysql_close(mysql_connect(DB_HOST, DB_USER, DB_PASS));
?>
</table>
</form>
|