You are here: Re: Help: Can you make this .php less than 1 month?? « PHP Programming Language « IT news, forums, messages
Re: Help: Can you make this .php less than 1 month??

Posted by Novice Computer User on 12/08/05 16:30

Ok.. Thanks for the info.. I didn't even know I was looking at the
wrong page.. I THINK this is correct page that I need to modify to
reduce the 1 month option to 24 hours. I copied/pasted the .php file
here -- if you can figure out a way to modify the 1 month limit to 24
hours -- or even 1 hour (whichever is easiest is fine with me), PLEASE
let me know.. thanks greatly:

<?
require_once("../conn.php");
require_once("../includes.php");
require_once("access.php");

include_once("LeftStyles.php");

?>

<script>
function CheckNewPrice() {

if(document.f1.PackageName.value=="")
{
window.alert('Enter the new package name, please!');
document.f1.PackageName.focus();
return false;
}

if(document.f1.NewPrice.value=="")
{
window.alert('Enter the new price value, please!');
document.f1.NewPrice.focus();
return false;
}

if(document.f1.nDuration.value=="")
{
window.alert('Select a duration period, please!');
document.f1.nDuration.focus();
return false;
}

if(document.f1.pLevel.value=="")
{
window.alert('Select a priority level, please!');
document.f1.pLevel.focus();
return false;
}

}

function CheckDelete() {

if(confirm('Are you sure you want to delete this price?'))
{
return true;
}
else
{
return false;
}

}

</script>

<form method=post name=f1 onsubmit="return CheckNewPrice()">

<table align=center>
<tr>
<td colspan=2 align=center class=TableHead>Enter a new price</td>
</tr>

<tr>
<td>Package name:</td>
<td><input type=text name=PackageName maxlength=50></td>
</tr>


<tr>
<td>Price:</td>
<td><input type=text name=NewPrice size=6 maxlength=6></td>
</tr>

<tr>
<td>Duration:</td>
<td>
<select name=nDuration>
<option value=""></option>
<?
for($i = '1'; $i <= '12'; $i++)
{
echo "<option value=\"$i\">$i</option>\n";
}
?>
</select> months
</td>
</tr>

<tr>
<td>Priority Level:</td>
<td>
<select name="pLevel">
<option value=""></option>
<?
//create the Priority level select menu
$q1 = "select * from legal_priority order by PriorityLevel asc ";
$r1 = mysql_query($q1) or die(mysql_error());
while($a1 = mysql_fetch_array($r1))
{
echo "<option value=\"$a1[PriorityLevel]\">$a1[PriorityLevel] -
$a1[PriorityName]</option>\n\t";
}
?>
</select>
</td>
</tr>

<tr>
<td>&nbsp;</td>
<td><input type=submit name=s1 value=Save class=sub></td>
</tr>

</table>

</form>

<?

if(isset($_POST[s1]))
{
$q1 = "insert into legal_prices set
PackageName = '$_POST[PackageName]',
PriceValue = '$_POST[NewPrice]',
Duration = '$_POST[nDuration]',
PriorityLevel = '$_POST[pLevel]' ";

mysql_query($q1) or die(mysql_error());
}

//show prices
$q1 = "select * from legal_prices, legal_priority where
legal_prices.PriorityLevel = legal_priority.PriorityLevel order by
legal_prices.PriorityLevel desc";
$r1 = mysql_query($q1) or die(mysql_error());

if(mysql_num_rows($r1) == '0')
{
exit();
}

?>

<table align=center width=650 cellspacing=0 bordercolor=black
frame=below>
<tr>
<td class=TableHead width=200>Package Name</td>
<td class=TableHead>Priority Level</td>
<td class=TableHead align=center>Duration</td>
<td class=TableHead align=right>Price</td>
<td class=TableHead align=center>Action</td>

<?
while($a1 = mysql_fetch_array($r1))
{
if($a1[Duration] > '1')
{
$MyDuration = $a1[Duration]." months";
}
else
{
$MyDuration = $a1[Duration]." month";
}

echo
"<tr>\n\t<td>$a1[PackageName]</td>\n\t<td>$a1[PriorityName]</td>\n\t<td
align=center>$MyDuration</td>\n\t<td align=right>$aset[currency_sign]
$a1[PriceValue]</td>\n\t<td align=center><a class=GreenLink
href=\"PriceEdit.php?PriceID=$a1[PriceID]\">edit</a> | <a class=RedLink
href=\"PriceDelete.php?PriceID=$a1[PriceID]\" onclick=\"return
CheckDelete();\">delete</a></td>\n</tr>\n\n ";
}

echo "</table>\n\n<br><br>";
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация