Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 26th, 2005, 3:14 PM   #1
nameless
Newbie
 
nameless's Avatar
 
Join Date: Apr 2005
Location: California
Posts: 3
Rep Power: 0 nameless is on a distinguished road
I wonder if anyone can help me with this????

This is the code that i am working on...
its really realy hard...
to be honest i dont expect anyone to help me
with this.......Just thought i'd try
i do hope someone can help though

*problem*
i need to send this first page to the 2nd page without the ok button...

**if i ever get the onchange event to work i would then combine into one page....

------THIS IS THE FIRST PAGE------------

-----NEED TO USE ONCHANGE TO SEND TO 2ND PAGE-----------------------------
<?php
include_once ("../../classes/QueryClassReporting.php");

$db = new QueryClass;

//edonkey availability

session_start();
?>
<html>
<head>
<title>Live Decoying System</title>
<script language="Javascript">
<?php
//check if user is supposed to be here
if($grant_access!=1)
{?>
location="../login_error.php"; //exit user
<?php } ?>
</script>
<style type="text/css">
td {
height: 20px;
font: 200 12px arial;
text-align: center;
}
</style>
</head>
<body bgcolor="#D3D3D3">
<div align="center">
<form name="territory_form" method="POST" action="./edonkey_decoys_form.php">
<h4>Please choose a territory/label:</h4>

<?php
//if universal main is logging in load ALL labels within it
if(strcmp($report_to,"UNIVERSAL MUSIC")==0){
outputAllLabels();
}
//else if universal europe is logging in load all the territories
else{
outputAllLabels(); //outputUMITerritories();
}
?>
<input type="submit" value="Next ->">
</form>
</div>
</body>
</html>

<?php
function outputUMITerritories(){
$umi_territories = array("AUSTRALIA","AUSTRIA","UMI BRAZIL","DENMARK","FINLAND","FRANCE","GERMANY",
"INTERNATIONAL","ITALY","JAPAN","LATIN AMERICA","NETHERLANDS","PORTUGAL","SPAIN","SWEDEN",
"TAIWAN","UK","U CANADA");

echo "<select name=\"territory\">";
for($i=0;$i<count($umi_territories);$i++){
echo "<option value=\"$umi_territories[$i]\">$umi_territories[$i]";
}
echo "</select>";
}

function outputAllLabels(){
$umi_all_labels = array("GEFFEN","INTERSCOPE/GEFFEN/A&M","ISLAND DEF JAM","MERCURY NASHVILLE","ROAD RUNNER",
"SURCO","UBER CATALOG","UNIVERSAL CLASSICS","UNIVERSAL RECORDS","AUSTRALIA","AUSTRIA","UMI BRAZIL","DENMARK","FINLAND","FRANCE","GERMANY",
"INTERNATIONAL","ITALY","JAPAN","LATIN AMERICA","NETHERLANDS","PORTUGAL","SPAIN","SWEDEN",
"TAIWAN","UK","U CANADA");

echo "<select name=\"territory\">";
for($i=0;$i<count($umi_all_labels);$i++){
echo "<option value=\"$umi_all_labels[$i]\">$umi_all_labels[$i]";
}
echo "</select>";
}
?>

----------THIS IS THE 2ND PAGE-------------
--------NEEDS TO BE SENT TO THIS----------

<?php
//define
$PROJECT_NAME_FIELD = 0;
$PROJECT_END_FIELD = 1;
//edonkey availability

session_start();

include_once ("../../classes/QueryClassReporting.php");

$db = new QueryClass;

$territory = $_POST['territory'];
?>
<html>
<head>
<title>Live Decoying System</title>
<script language="Javascript">
<?php
//check if user is supposed to be here
if($grant_access!=1 || strlen($report_to)==0)
{?>
location="../login_error.php"; //exit user
<?php }
else if((strcmp($report_to,"UNIVERSAL EUROPE")==0 || strcmp($report_to,"UNIVERSAL MUSIC")==0) && strlen($territory)==0)
{
?>
location = "./edonkey_decoys_main.php";
<?php
}
?>

</script>
<style type="text/css">
td {
height: 20px;
font: 200 12px arial;
text-align: center;
}
</style>
</head>
<body bgcolor="#D3D3D3">
<?php

$referer = $_SERVER["HTTP_REFERER"] ;
$todays_date = strtotime("now"); //todays date as timestamp
$real_date = date("Y-m-d",$todays_date);

if(strstr($referer,"edonkey_decoys_main.php"))
{
echo "<a href=\"$referer\">Back</a>";
//add special case with interscope/geffen
if(strcmp($report_to,"GEFFEN")==0 || strcmp($territory,"GEFFEN")==0){
$db->GraphQuery("select project,project_rename,end_date_option from projects where owner = \"universal music.geffen\" and visible=1 and (end_date_option<=$real_date or end_date_option is null) order by project");
}
else{
$db->GraphQuery("select project,project_rename,end_date_option from projects where owner like '%universal%$territory%' and visible=1 and (end_date_option<=$real_date or end_date_option is null) order by project");
}
}
else
{
if(strcmp($report_to,"GEFFEN")==0 || strcmp($territory,"GEFFEN")==0){
$db->GraphQuery("select project,project_rename,end_date_option from projects where owner = \"universal music.geffen\" and visible=1 and (end_date_option<=$real_date or end_date_option is null) order by project");
}
else{
$db->GraphQuery("select project,project_rename,end_date_option from projects where owner like '%universal%$report_to%' and visible=1 and (end_date_option<=$real_date or end_date_option is null) order by project");
}
}
//get fields
$projects_avail = $db->GetXAxisValues();
$field = $db->GetYAxisValues();
$decoy_project_rename = $field[0];
$decoy_end_date = $field[1];
echo "<p align=\"center\">";
echo "<form action=\"edonkey_decoys_submit.php\" method=\"POST\">";
printSelectList($projects_avail,$decoy_project_ren ame,$decoy_end_date);
echo "</form></p>";
for($i=0;$i<count($decoy_project);$i++)
echo "$decoy_project[$i]<BR>";
?>
</body>
</html>

<?php
//create a submit button
function makeSubmitButton()
{
echo "<BR><input type=\"submit\" value=\"Submit\" >";
}

function validProject($arr)
{
$todays_date = strtotime("now()"); //todays date as timestamp
//check if there is at least one active project
for($i=0;$i<count($arr);$i++)
{
if($todays_date<=strtotime($end_arr[$i]) || $end_arr[$i]==null){
echo "$end_arr[$i]<BR>";
return true;
}
echo "No projects currently active";
return false; //return from function
}

}
//create a select list
function printSelectList($arr,$rename_arr,$end_arr)
{
if(count($arr)==0){
echo "No projects currently active";
return;
}

echo "Choose a project to add decoys: <BR>";
//convert today's date into timestamp
echo "<select name=\"project_chosen\">";
for($i=0;$i<count($arr);$i++)
{
if($todays_date<=strtotime($end_arr[$i]) || $end_arr[$i]==null)
{

if($rename_arr[$i])
echo "<option value=\"$arr[$i]\">$rename_arr[$i]";
else
echo "<option value=\"$arr[$i]\">$arr[$i]";
}
}
echo "</select>";
makeSubmitButton(); //include submit button
}
?>

Last edited by nameless; Apr 26th, 2005 at 5:13 PM.
nameless is offline   Reply With Quote
Old Apr 26th, 2005, 5:32 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I'd swear I just answered this question. Check the PHP forum.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 26th, 2005, 10:45 PM   #3
peace_of_mind
Professional Programmer
 
peace_of_mind's Avatar
 
Join Date: Sep 2004
Location: Hell if I know most of the time
Posts: 439
Rep Power: 5 peace_of_mind is on a distinguished road
Send a message via MSN to peace_of_mind Send a message via Yahoo to peace_of_mind
1. Use code tags
2. Post in the proper forum

Welcome to the forums
__________________
Amateurs built the ark
Professionals built the Titanic

peace_of_mind is offline   Reply With Quote
Old Apr 27th, 2005, 3:16 PM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
yeah, that is a bit hard to read without the code tags.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:12 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC