Jump to content

pbalsamo

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pbalsamo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Does anyone have an example I must admit I am clueless
  2. I cant get the List/menu to remember the list choice when i reload the form <script type="text/javascript"> function reload(form) { var val=form.SelectDate.options[form.SelectDate.options.selectedIndex].value ; self.location='Snapshot.php?SelectDate=' + val ; <?php $SelectDate=$_GET['SelectDate']; switch($SelectDate) { case "1" : $Datefrom = date('Y-01-01'); $Dateto = date('Y-12-31'); $aa ="selected"; break; case "2" : $Datefrom = date('Y-01-01'); $Dateto = date('Y-m-d'); $bb ="selected"; break; case "3" : $Datefrom = date("Y-m-d",strtotime("-1 days")); $Dateto = date("Y-m-d",strtotime("-1 days")); break; case "4" : $Datefrom = date('Y-m-d',strtotime(date('Y')."W".date('W')."0")); $Dateto = date('Y-m-d',strtotime(date('Y')."W".date('W')."7")); break; case "5" : $Datefrom = date('Y-m-d',strtotime(date('Y')."W".date('W')."0")); $Dateto = date('Y-m-d'); break; case "6" : $Datefrom = date("Y-m-01",strtotime("-1 month")); $Dateto = date("Y-m-t",strtotime("-1 month")); break; case "7" : $Datefrom = date("Y-m-01",strtotime("-1 month")); $Dateto = date("Y-m-d",strtotime("-1 month")); break; case "8" : $Datefrom = date("Y-01-01",strtotime("-1 year")); $Dateto = date("Y-12-31",strtotime("-1 year")); $aa ="selected"; break; case "9" : $Datefrom = date("Y-01-01",strtotime("-1 year")); $Dateto = date("Y-m-d",strtotime("-1 year")); break; case "10" : $Datefrom = date('Y-m-d'); $Dateto = date('Y-m-d'); break; case "11" : $Datefrom = date("Y-m-01"); $Dateto = date("Y-m-t"); break; case "12" : break; case "13" : break; case "14" : $Datefrom = date('1980-01-01'); $Dateto = date('Y-12-31'); break; } ?> <form action="Snapshot.php" method="get" name="form3" id="form3"> <select name='SelctDate' id="SelectDate" onchange="reload(this.form)"> <!--submit();--> <option value='1'>Current Year</option> <option value='2'>Current Year-to-date</option> <option value='3'>Yesterday</option> <option value='4'>Last Week</option> <option value="5">Last Week-to-date</option> <option value="6">Last Month</option> <option value="7">Last Month-to-date</option> <option value="8">Last Year</option> <option value="9">Last Year-to-date</option> <option value="10">Today</option> <option value="11">Current Month</option> <option value="12">Current Quarter</option> <option value="13">Current Quarter-to-date</option> <option value="14">All Dates</option> </select> from <input name="Datefrom" type="text" id="Datefrom" value="<?php echo $Datefrom ?>" size="10" /> to <input name="Dateto" type="text" id="Dateto" value="<?php echo $Dateto ?>" size="10" /> <input type="submit" name="button2" id="button2" value="New date" /> </form>
  3. pbalsamo

    sql help

    Table layout the num column is used so I can sort table NUM | Amount | Month a 8453 Jan
  4. I need to know if there is a better way of getting Customer by month and years in different rows jan-dec 2008 jan-dec 2007 thanks SELECT 'a' as Num, Count(Leads.City) as Amount, 'Jan' as SeqMonth FROM Leads WHERE EXTRACT(Month FROM Leads.Date) = 1 AND EXTRACT(Year FROM Leads.Date) = %s UNION SELECT 'b' as Num, Count(Leads.City) as Amount, 'Feb' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 2 AND EXTRACT(Year from Leads.Date) = %s UNION SELECT 'c' as Num, Count(Leads.City) as Amount, 'Mar' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 3 AND EXTRACT(Year from Leads.Date) = %s UNION SELECT 'd' as Num, Count(Leads.City) as Amount, 'Apr' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 4 AND EXTRACT(Year from Leads.Date) = %s UNION SELECT 'e' as Num, Count(Leads.City) as Amount, 'May' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 5 AND EXTRACT(Year from Leads.Date) = %s UNION SELECT 'f' as Num, Count(Leads.City) as Amount, 'Jun' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 6 AND EXTRACT(Year from Leads.Date) = %s UNION SELECT 'g' as Num, Count(Leads.City) as Amount, 'Jul' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 7 AND EXTRACT(Year from Leads.Date) = %s
  5. pbalsamo

    sql help

    I need to know if there is a better way of getting Customer by month and years in different rows jan-dec 2008 jan-dec 2007 thanks SELECT 'a' as Num, Count(Leads.City) as Amount, 'Jan' as SeqMonth FROM Leads WHERE EXTRACT(Month FROM Leads.Date) = 1 AND EXTRACT(Year FROM Leads.Date) = %s UNION SELECT 'b' as Num, Count(Leads.City) as Amount, 'Feb' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 2 AND EXTRACT(Year from Leads.Date) = %s UNION SELECT 'c' as Num, Count(Leads.City) as Amount, 'Mar' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 3 AND EXTRACT(Year from Leads.Date) = %s UNION SELECT 'd' as Num, Count(Leads.City) as Amount, 'Apr' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 4 AND EXTRACT(Year from Leads.Date) = %s UNION SELECT 'e' as Num, Count(Leads.City) as Amount, 'May' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 5 AND EXTRACT(Year from Leads.Date) = %s UNION SELECT 'f' as Num, Count(Leads.City) as Amount, 'Jun' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 6 AND EXTRACT(Year from Leads.Date) = %s UNION SELECT 'g' as Num, Count(Leads.City) as Amount, 'Jul' as SeqMonth FROM Leads WHERE EXTRACT(Month From Leads.Date) = 7 AND EXTRACT(Year from Leads.Date) = %s
  6. Please help I am stuck on how to click checkbox and put area code in text field <?php $array1 = array("(516)","(631)","(718)"); ?> <td><input name="Phone" type="text" value="<?php echo $array1; ?>" size="15" /> <input name="RadioGroup1" type="radio" id="RadioGroup1_0" onclick="<?php echo $array[0]; ?>" value="" checked="checked" /> <label>(516)</label> <input name="RadioGroup1" type="radio" id="RadioGroup1_1" onclick="<?php echo $array[1]; ?>" value="" /> <label>(631)</label> <input name="RadioGroup1" type="radio" id="RadioGroup1_2" onclick="<?php echo $array[2]; ?>" value="" /> <label>(718)</label><br /> <label>(###)###-####</label> </td>
  7. Can this be done with php, it seem no one wants to touch this
  8. Hi I need help on how to go about a table Lookup. I have a City field with a Combo box and when I click to lookup a City I also want to have the State field and The zip field update. see code below. How do I go about this thanks <select name="LookupCity" id="LookupCity"> <option value="" <?php if (!(strcmp("", $row_fmLeads['City']))) {echo "selected=\"selected\"";} ?>>Select from menu</option> <?php do { ?><option value="<?php echo $row_fmCity['City']?>"<?php if (!(strcmp($row_fmCity['City'], $row_fmLeads['City']))) {echo "selected=\"selected\"";} ?>><?php echo $row_fmCity['City']?></option> <?php } while ($row_fmCity = mysql_fetch_assoc($fmCity)); $rows = mysql_num_rows($fmCity); if($rows > 0) { mysql_data_seek($fmCity, 0); $row_fmCity = mysql_fetch_assoc($fmCity); } ?> </select>
  9. I want to click list/menu that has certain dates in it. And have those date put into (2) textedit fields, the problem is I dont know how to code the case statement to populate the text fields thanks
  10. I wanted to have the textedit fields change to the date field through the list/menu I need to know how to do this thanks
  11. Cant someone help with code below on how I can put 2 dates in two textfields with code below. the fields are named Datefrom and Dateto thanks <?php $country=$_REQUEST['SelectDate']; switch($country) { case "1" : Datefrom textfield = Datefrom; Dateto; textfield = Dateto; break; case "2" : Datefrom textfield = Datefrom; Dateto; textfield = Dateto; break; } ?> <form action="" name="form3" id="form3"> <select name="SelectDate" id="SelectDate" onchange=""> <option value="1">Current Year</option> <option value="2">Current Year-to-date</option> <option value="3">Yesterday</option> <option value="4">Last Week</option> <option value="5">Last Week-to-date</option> <option value="6">Last Month</option> <option value="7">Last Month-to-date</option> <option value="8">Last Year</option> <option value="9">Last Year-to-date</option> <option value="10">Today</option> <option value="11">Current Month</option> <option value="12">Current Quarter</option> <option value="13">Current Quarter-to-date</option> <option value="14">All Dates</option> </select> from <input name="Datefrom" type="text" id="Datefrom" value="<?php echo date("Y-01-01"); ?>" size="10" /> to <input name="Dateto" type="text" id="Dateto" value="<?php echo date("Y-12-31"); ?>" size="10" /> <input name="Datenow" type="hidden" id="Datenow" value="<?php echo date("Y-m-d"); ?>" size="10"/> <input type="submit" name="button2" id="button2" value="New date" /> </form>
×
×
  • 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.