Need Help With Redirect That Uses Session Variable

I am new to dynamic sites, php, and developer toolbox, but I have been able to create a login site using the different form wizards fairly easily (in CS3 with Developers toolbox).
<br />
<br />I am trying to set a server behavior on a page that redirects the user to a new page if a session variable matches a recordset.
<br />
<br />I was using an extension (PHP Sessions - http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&amp;extid=681308 ) that worked great, but when I installed developers toolbox, it stopped working (get error message about runtime/MX environment).
<br />
<br />Ive been struggling for days and this is what Ive come up with so far:
<br />------------------------------------
<br />session_start();
<br />if (!isset($HTTP_SESSION_VARS[$_SESSION['kt_firstname']]) || $HTTP_SESSION_VARS[$_SESSION['kt_firstname']] = $row_Recordsetfname['firstname']) {
<br /> header ("Location: ../firstname/firstname1.php");
<br />}
<br />------------------------------------
<br />
<br />It redirects regardless of the match. Any ideas on what I can do to get this working? Here is all of the code (with block from above inserted) up until the doc type:
<br />------------------------------------
<br /><?php require_once('../Connections/project1.php'); ?>
<br /><?php<br />// Load the tNG classes<br />require_once('../includes/tng/tNG.inc.php');<br /><br />// Make unified connection variable<br />$conn_project1 = new KT_connection($project1, $database_project1);<br /><br />//Start Restrict Access To Page<br />$restrict = new tNG_RestrictAccess($conn_project1, "../");<br />//Grand Levels: Any<br />$restrict->Execute();<br />//End Restrict Access To Page<br /><br />if (!function_exists("GetSQLValueString")) {<br />function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") <br />{<br />  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;<br /><br />  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);<br /><br />  switch ($theType) {<br />    case "text":<br />      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";<br />      break;    <br />    case "long":<br />    case "int":<br />      $theValue = ($theValue != "") ? intval($theValue) : "NULL";<br />      break;<br />    case "double":<br />      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";<br />      break;<br />    case "date":<br />      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";<br />      break;<br />    case "defined":<br />      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;<br />      break;<br />  }<br />  return $theValue;<br />}<br />}<br /><br />// FELIXONE - 2002   SB by Felice Di Stefano - www.felixone.it<br />session_start();<br />if (!isset($HTTP_SESSION_VARS[$_SESSION['kt_firstname']]) || $HTTP_SESSION_VARS[$_SESSION['kt_firstname']] = $row_Recordsetfname['firstname']) {<br />  header ("Location: ../firstname/firstname1.php");<br />}<br /><br />$colname_Recordsetfname = "-1";<br />if (isset($_SESSION['kt_user_name'])) {<br />  $colname_Recordsetfname = $_SESSION['kt_user_name'];<br />}<br />mysql_select_db($database_project1, $project1);<br />$query_Recordsetfname = sprintf("SELECT firstname FROM registration WHERE user_name = %s", GetSQLValueString($colname_Recordsetfname, "text"));<br />$Recordsetfname = mysql_query($query_Recordsetfname, $project1) or die(mysql_error());<br />$row_Recordsetfname = mysql_fetch_assoc($Recordsetfname);<br />$totalRows_Recordsetfname = mysql_num_rows($Recordsetfname);<br /><br />$colname_Recordset1 = "-1";<br />if (isset($_SESSION['kt_user_name'])) {<br />  $colname_Recordset1 = $_SESSION['kt_user_name'];<br />}<br />mysql_select_db($database_project1, $project1);<br />$query_Recordset1 = sprintf("SELECT `Date` FROM registration WHERE user_name = %s", GetSQLValueString($colname_Recordset1, "text"));<br />$Recordset1 = mysql_query($query_Recordset1, $project1) or die(mysql_error());<br />$row_Recordset1 = mysql_fetch_assoc($Recordset1);<br />$totalRows_Recordset1 = mysql_num_rows($Recordset1);<br />?>
<br />
<br />------------------------------

I am new to adobe toolbox... I ve created a ligin page but not sure how to pass the session variable. I am trying to direct successful login to a page like... index.php?id=filter
<br />
<br />been struggling all day with this. Please help!!!
<br />
<br /><?php require_once('Connections/comm.php'); ?>
<br /><?php<br />// Load the common classes<br />require_once('includes/common/KT_common.php');<br /><br />// Load the tNG classes<br />require_once('includes/tng/tNG.inc.php');<br /><br />// Make a transaction dispatcher instance<br />$tNGs = new tNG_dispatcher("");<br /><br />// Make unified connection variable<br />$conn_comm = new KT_connection($comm, $database_comm);<br /><br />// Start trigger<br />$formValidation = new tNG_FormValidation();<br />$formValidation->addField("kt_login_user", true, "text", "", "", "", "");<br />$formValidation->addField("kt_login_password", true, "text", "", "", "", "");<br />$tNGs->prepareValidation($formValidation);<br />// End trigger<br /><br />// Make a login transaction instance<br />$loginTransaction = new tNG_login($conn_comm);<br />$tNGs->addTransaction($loginTransaction);<br />// Register triggers<br />$loginTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "kt_login1");<br />$loginTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);<br />$loginTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "{kt_login_redirect}");<br />// Add columns<br />$loginTransaction->addColumn("kt_login_user", "STRING_TYPE", "POST", "kt_login_user");<br />$loginTransaction->addColumn("kt_login_password", "STRING_TYPE", "POST", "kt_login_password");<br />$loginTransaction->addColumn("kt_login_rememberme", "CHECKBOX_1_0_TYPE", "POST", "kt_login_rememberme", "0");<br />// End of login transaction instance<br /><br />// Execute all the registered transactions<br />$tNGs->executeTransactions();<br /><br />// Get the transaction recordset<br />$rscustom = $tNGs->getRecordset("custom");<br />$row_rscustom = mysql_fetch_assoc($rscustom);<br />$totalRows_rscustom = mysql_num_rows($rscustom);<br /><br />?>
<br />
<br />
<br />
<br />
<br />
<br />
<script src="includes/common/js/base.js" type="text/javascript"></script>
<br />
<script src="includes/common/js/utility.js" type="text/javascript"></script>
<br />
<script src="includes/skins/style.js" type="text/javascript"></script>
<br /><?php echo $tNGs->displayValidationRules();?>
<br />
<br />
<br />
<br /><?php<br /> echo $tNGs->getLoginMsg();<br />?>
<br /><?php<br /> echo $tNGs->getErrorMsg();<br />?>
<br />
<form method="post" id="form1" class="KT_tngformerror" action="%3C?php%20echo%20KT_escapeAttribute(KT_getFullUri());%20?%3E">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<table cellpadding="2" cellspacing="0" class="KT_tngtable">
<tr>
<td class="KT_th">
<label for="kt_login_user">Username:</label>
</td>
<td>
<input type="text" name="kt_login_user" id="kt_login_user" value="<?php echo KT_escapeAttribute($row_rscustom['kt_login_user']); ?>" size="32" />
<br /> <?php echo $tNGs->displayFieldHint("kt_login_user");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_user"); ?></td>
</tr>
<tr>
<td class="KT_th">
<label for="kt_login_password">Password:</label>
</td>
<td>
<input type="password" name="kt_login_password" id="kt_login_password" value="" size="32" />
<br /> <?php echo $tNGs->displayFieldHint("kt_login_password");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_password"); ?></td>
</tr>
<tr>
<td class="KT_th">
<label for="kt_login_rememberme">Remember me:</label>
</td>
<td>
<input <?php if (!(strcmp(KT_escapeAttribute($row_rscustom['kt_login_rememberme']),"1"))) {echo "checked";} ?> type="checkbox" name="kt_login_rememberme" id="kt_login_rememberme" value="1" />
<br /> <?php echo $tNGs->displayFieldError("custom", "kt_login_rememberme"); ?></td>
</tr>
<tr class="KT_buttons">
<td colspan="2">
<input type="submit" name="kt_login1" id="kt_login1" value="Login" />
<br /></td>
</tr>
</table>
<br />
<a href="forgot_password.php">Forgot your password?</a>
<br /></form>
<br />
<p>&#160;</p>
<br />
<br />

Similar Messages

  • Need help with jsp that uses a java program

    Hi, sorry for my english but i am italian.
    I've got a problem: i use java builder and i have a java program(this program has got a main and includes libraries) about graphich on tree, this program visualizes these trees and makes operations on these.
    Now i must use JSP so that a client can see this program (this program is on the server) and can interact with it.
    I can't use applet.I must use only jsp.
    Who can tell me how can i start???
    Thanks.

    If you are not allowed to use an applet, then you are limited by what can be achieved with HTML in a browser.
    You would have to figure out how to render it with HTML, then program your jsp to write out this html programatically.

  • Need help with query that uses 'SELECT INTO'

    Hi guys,
    I am trying to duplicate the values of a table to another by using the script below:
    ACCEPT TBSNAME           CHAR PROMPT 'Tablespace name>'
    PROMPT Connect As System
    Connect system
    CREATE TABLE FREESPACE
         TABLESPACE_NAME          VARCHAR(20)          NOT NULL,
              CONSTRAINT FREESPACE_PKEY PRIMARY KEY(TABLESPACE_NAME),
         TOTAL_FREE_STORAGE     NUMBER(10)          NOT NULL
    ) TABLESPACE USERS;
    SELECT     TABLESPACE_NAME,
              SUM(BLOCKS) TOTBLOCKS
    INTO      FREESPACE
    FROM      SYS.DBA_FREE_SPACE
    WHERE      TABLESPACE_NAME = UPPER('&TBSNAME')
    GROUP BY TABLESPACE_NAME;
    However, when I execute this script, I was prompted with the 'missing keyword' error which happens at the third line of the select statment. Any idea what's missing here?
    Thanks in advance.

    If you mean "fill up the table FREESPACE" by using "select...into..." then it is totally wrong. You cannot do it in plsql also.
    Use this:
    insert into freespace(tablespace_name,total_free_storage)
    SELECT TABLESPACE_NAME,SUM(BLOCKS) TOTBLOCKS
    FROM SYS.DBA_FREE_SPACE
    WHERE TABLESPACE_NAME = UPPER('&TBSNAME')
    GROUP BY TABLESPACE_NAME;
    Message was edited by:
    Yas

  • Need help with reading XML using File Adapter

    I have created a simple BPEL process that uses a file adapter to read files containing XML messages of a simple xsd schema. But when reading the xml, I get the following error message:
    [2010/03/01 23:43:13] Invalid data: The value for variable "Receive_1_Read_InputVariable", part "revision-report" does not match the schema definition for this part.The invalid xml document is shown below: More...
    [2010/03/01 23:43:13] "{http://schemas.oracle.com/bpel/extension}invalidVariables" has been thrown. less
    -<invalidVariables xmlns="http://schemas.oracle.com/bpel/extension">
    -<part name="code">
    <code>
    9710
    </code>
    </part>
    -<part name="summary">
    <summary>
    Invalid xml document.
    According to the xml schemas, the xml document is invalid. The reason is: Error::cvc-complex-type.4: Attribute 'doc' must appear on element 'revision-report'.
    Error::cvc-complex-type.4: Attribute 'model' must appear on element 'revision-report'.
    Error::cvc-complex-type.4: Attribute 'pubdate' must appear on element 'revision-report'.
    Error::cvc-complex-type.2.4.b: The content of element 'revision-report' is not complete. One of '{"http://xmlns.oracle.com/xmlfile":alternategroup}' is expected.
    Please make sure that the xml document is valid against your schemas.
    </summary>
    </part>
    </invalidVariables>
    It seems that there is some issue with the namespace, but even after trying out various combinations, I am not able to resolve this.
    Here the message schema (xsd):
    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/xmlfile"
    xmlns:tns="http://xmlns.oracle.com/xmlfile"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="revision-report">
    <xs:complexType>
    <xs:sequence maxOccurs="unbounded">
    <xs:element name="alternategroup">
    <xs:complexType>
    <xs:attribute name="name" use="required" type="xs:string"/>
    <xs:attribute name="Desc" use="required" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    <xs:attribute name="doc" use="required" type="xs:string"/>
    <xs:attribute name="model" use="required" type="xs:string"/>
    <xs:attribute name="pubdate" use="required" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    And here is the xml file to be read by the file adapter:
    <?xml version="1.0" encoding="UTF-8" ?>
    <revision-report doc="doc2" model="model4" pubdate="pubdate5">
    <alternategroup Name="ABC" Desc="ABC-Desc">
    </alternategroup>
    <alternategroup Name="DEF" Desc="DEF-Desc">
    </alternategroup>
    <alternategroup Name="GHI" Desc="GHI-Desc">
    </alternategroup>
    </revision-report>
    Appreciate any help.
    Thanks in advance for your attention.
    Jay

    Thanks for your response.
    I am not sure if there is any easier way, but I tried out the following tool available on the net to check an xml against a xsd:
    http://tools.decisionsoft.com/schemaValidate/
    There were a few issues, that I corrected and finally had a xsd and xml that were matching and valid. I tried this out in my file reading BPEL process, but the error still remained the same!
    Here is my updated/simplified xsd and xml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema targetNamespace="http://xmlns.oracle.com/xmlfile"
    xmlns:tns="http://xmlns.oracle.com/xmlfile"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="http://xmlns.oracle.com/xmlfile">
    <xs:element name="revision-report">
    <xs:complexType>
    <xs:sequence>
    <xs:element maxOccurs="unbounded" ref="alternategroup"/>
    </xs:sequence>
    <xs:attribute name="doc" use="required" type="xs:string"/>
    <xs:attribute name="model" use="required" type="xs:string"/>
    <xs:attribute name="pubdate" use="required" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    <xs:element name="alternategroup">
    <xs:complexType>
    <xs:attribute name="Name" use="required" type="xs:string"/>
    <xs:attribute name="Desc" use="required" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    <?xml version="1.0" encoding="UTF-8" ?>
    <revision-report doc="doc2" model="model4" pubdate="pubdate5" xmlns="http://xmlns.oracle.com/xmlfile">
    <alternategroup Name="ABC" Desc="ABC-Desc"/>
    <alternategroup Name="DEF" Desc="DEF-Desc"/>
    <alternategroup Name="GHI" Desc="GHI-Desc"/>
    </revision-report>
    I even tried the option that is available in JDeveloper to generate a sample xml from a xsd (when in the context of a Transformation activity). The xml generated by this also seems exactly like the one above.
    So, I am not able to figure out why my BPEL process errors out with the message Invalid xml document.

  • Need Help With Military DTD Using FrameMaker 8

    Fellow Forum Members,
    I hope someone out there with experience in using Department of Defense DTDs with FrameMaker can contribute to this thread.
    Attached is the MIL STD 400051-2 DTD that needs to play with FrameMaker. Does anyone out there know where I could find FrameMaker templates already setup that comply and play with the MIL STD 400051-2 DTD standard? If the Department of Defense is freely distributing the MIL STD 400051-2 DTD, shouldn't somebody in the Department of Defense also be providing MIL STD 400051-2 FrameMaker Templates for free that are already setup?  I would greatly appreciate if anyone out there could provide an online source where I could download MIL STD 400051-2 FrameMaker templates.
    Lastly, can anyone out there clarify what the purpose of the entities are inside the "Charant" and "Boilerplate" folders?  The Department of Defense does not provide a readme file that define what the "Charant" and "Boilerplate" folders are about.
    Any info will be greatly appreciated. Thanks.

    I'll answer the specifics that I know about your questions, but please look at the post from Srini for additional info:
    1) Do i need to do full export using SYS/SYSTEM user.
    exp80 system/manager file=c:full.dmp log=c:\full.txt full=y consistent=yA full export will move as much information (metadata/data) as possible. In order to do a full export/import, you need to do this from a
    privileged account. A privileged account is one with EXP_FULL_DATABASE for export and IMP_FULL_DATABASE for import.
    2) Will there be any data corruption while export.The data in the objects that you are exporting is being read, nothing is written to user data. I'm not sure what this is available in 8.0.6,
    but if you need a consistent export, look to see if consistent=y is available in 8.0.6. All this means is that the dump file created will have
    consistent data in it.
    3) Is export/import the only method of migration/upgradation.If you are changing hardware, the only supported way from 8.0 to 10.2.0.4, that I know of, is using exp/imp.
    Hope this helps.
    Dean

  • Need help with database migration using export/import

    Hi,
    I am planning to do a database migration from 8.0.6 to 10.2.0.4. I am using export/import. Please answer some of my queries:
    1) Do i need to do full export using SYS/SYSTEM user.
    exp80 system/manager file=c:full.dmp log=c:\full.txt full=y consistent=y
    2) Will there be any data corruption while export.
    3) Is export/import the only method of migration/upgradation.
    Please help
    Thanks.

    I'll answer the specifics that I know about your questions, but please look at the post from Srini for additional info:
    1) Do i need to do full export using SYS/SYSTEM user.
    exp80 system/manager file=c:full.dmp log=c:\full.txt full=y consistent=yA full export will move as much information (metadata/data) as possible. In order to do a full export/import, you need to do this from a
    privileged account. A privileged account is one with EXP_FULL_DATABASE for export and IMP_FULL_DATABASE for import.
    2) Will there be any data corruption while export.The data in the objects that you are exporting is being read, nothing is written to user data. I'm not sure what this is available in 8.0.6,
    but if you need a consistent export, look to see if consistent=y is available in 8.0.6. All this means is that the dump file created will have
    consistent data in it.
    3) Is export/import the only method of migration/upgradation.If you are changing hardware, the only supported way from 8.0 to 10.2.0.4, that I know of, is using exp/imp.
    Hope this helps.
    Dean

  • Need help with Different approaches to setting variables in a Flash movie in Adobe Flash CS3 Professional Version

    Hi,
    I'm using Adobe Flash CS3 Professional version of Flash
    software,
    I need help and guidance on
    Different approaches to setting variables in a Flash movie,
    what I should do in the fla file, and in the html file.
    Thanks, Gil

    Hi petro_jemes,
    Just a little claritification, you need to add the value to the variable "[string]$ou", and also change the language in the variable "$emailbody" in the function "Get-ADUserPasswordExpirationDate".
    I hope this helps.

  • I am Stuck! Need Help With Multicast Streaming Using VLC Player

    I have a Multicast network topology shown below
    and my configs
    HUB ROUTER
    no ip domain lookup
    ip domain name primestarhotel.com
    ip multicast-routing
    interface Loopback0
    ip address 5.5.5.5 255.255.255.255
    ip pim sparse-dense-mode
    interface FastEthernet0/0
    ip address 200.0.0.2 255.255.255.240
    ip pim sparse-dense-mode
    ip virtual-reassembly
    speed 100
    full-duplex
    interface FastEthernet0/1.65
    description "Server Vlan"
    encapsulation dot1Q 65
    ip address 10.1.65.1 255.255.255.0
    ip pim sparse-dense-mode
    ip virtual-reassembly
    router ospf 200
    log-adjacency-changes
    network 5.5.5.5 0.0.0.0 area 0
    network 10.1.65.0 0.0.0.255 area 0
    network 200.0.0.0 0.0.0.15 area 0
    ip route 200.1.1.0 255.255.255.252 200.0.0.1
    ip route 200.2.2.0 255.255.255.252 200.0.0.1
    no ip http server
    no ip http secure-server
    ip pim send-rp-announce Loopback0 scope 6
    ip pim send-rp-discovery Loopback0 scope 6
    ISP ROUTER
    interface FastEthernet1/0
    interface FastEthernet1/1
    no switchport
    ip address 200.0.0.1 255.255.255.240
    ip pim sparse-dense-mode
    duplex full
    speed 100
    interface FastEthernet1/2
    no switchport
    ip address 200.1.1.1 255.255.255.252
    ip pim sparse-dense-mode
    duplex full
    speed 100
    interface FastEthernet1/3
    no switchport
    ip address 200.2.2.1 255.255.255.252
    ip pim sparse-dense-mode
    duplex full
    speed 100
    router ospf 200
    log-adjacency-changes
    network 200.0.0.0 0.0.0.15 area 0
    network 200.1.1.0 0.0.0.3 area 0
    network 200.2.2.0 0.0.0.3 area 0
    SPOKE 1 Router
    interface FastEthernet0/0
    ip address 200.1.1.2 255.255.255.252
    ip pim sparse-dense-mode
    speed 100
    full-duplex
    interface FastEthernet0/1
    no ip address
    ip pim sparse-dense-mode
    ip virtual-reassembly
    speed 100
    full-duplex
    interface FastEthernet0/1.12
    description "Workstation pc"
    encapsulation dot1Q 12
    ip address 10.1.12.1 255.255.255.0
    ip pim sparse-dense-mode
    router ospf 200
    log-adjacency-changes
    network 10.1.12.0 0.0.0.255 area 0
    network 200.1.1.0 0.0.0.3 area 0
    ip route 0.0.0.0 0.0.0.0 200.1.1.1
    SPOKE 2
    interface FastEthernet0/0
    ip address 200.2.2.2 255.255.255.252
    ip pim sparse-dense-mode
    speed 100
    full-duplex
    interface FastEthernet0/1
    ip address 10.2.22.1 255.255.255.0
    ip pim sparse-dense-mode
    speed 100
    full-duplex
    router ospf 200
    log-adjacency-changes
    network 10.2.22.0 0.0.0.255 area 0
    network 200.2.2.0 0.0.0.3 area 0
    ip route 0.0.0.0 0.0.0.0 200.2.2.1
    ip route 200.2.2.0 255.255.255.252 200.0.0.1
    I have implemented multicast on the network in a hub and spoke topology. i have set up ospf routing protocol and broadcast all network and can successfully ping.
    I am currently using VLC player as my media streaming server and client. i have set up rtp streaming from the HUb router using multicast ip 224.2.2.2 and unable to broadcast the multicast traffic across the spokes 1 and 2 PC's
    I have never used vlc player  never set up multicast network before and i am struggling with this and need help.
    these are my router configs below
    http://dl.dropbox.com/u/20145606/ip%20video%20config.txt
    Message was edited by: Louis Ojuwu

    I have edited the message and the configs and topology are visible above now. instead of the links i provided

  • Need help with select that month range with flexible first date

    Hello everyone,
    I am trying to create a selection of month range (will be in a WITH clause) for a report to display monthly data. But the first month start date can be any date. (Not necessarily the first date of the month)
    Examples:
    Report input parameters:
    Start Date: 08/10/12
    End Month: Dec 2012
    I was trying to build a with select that will list
    Month_Start, Month_End
    08/10/12, 31/10/12
    01/11/12, 30/11/12
    01/12/12, 31/12/12
    OR
    Month_Start, Next_Month
    08/10/12, 01/11/12
    01/11/12, 01/12/12
    01/12/12, 01/01/13
    End month is optional, so if no value the select will list only
    08/10/12, 01/11/12
    Oracle Database Details is
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    My code so far is
    VARIABLE  P50_START_DATE  VARCHAR2 (10)
    VARIABLE  P50_END_MONTH    VARCHAR2 (10)
    EXEC  :P50_START_DATE  := '10/10/2012';
    EXEC  :P50_END_MONTH   := '31/12/2012';
      SELECT  to_char(:P50_START_DATE) AS start_date
            ,  ADD_MONTHS( TRUNC(to_date(:P50_START_DATE,'DD/MM/YYYY'),'MONTH'), 1) AS next_month
      FROM dual
      union
       SELECT to_char(ADD_MONTHS( TRUNC(to_date(:P50_START_DATE,'DD/MM/YYYY'),'MONTH'), ROWNUM-1)) AS start_date
       ,      ADD_MONTHS( TRUNC(to_date(:P50_START_DATE,'DD/MM/YYYY'),'MONTH'), ROWNUM) AS next_month
       --, rownum
       from all_objects
       where
       rownum <= months_between(to_date(NVL(:P50_END_MONTH, :P50_START_DATE),'DD/MM/YYYY'), add_months(to_date(:P50_START_DATE,'DD/MM/YYYY'), -1))
       and rownum > 1If I put comment – on line and rownum > 1, as
    -- and rownum > 1The result I get is
    START_DATE                     NEXT_MONTH               
    01/10/12                       01/10/12                 
    01/11/12                       01/11/12                 
    01/12/12                       01/01/13                 
    10/10/2012                     01/11/12    But when I try to remove the duplicate period (of the first month) out by restrict rownum, it do not return any rows for the second select at all. The result I get is:
    START_DATE                     NEXT_MONTH               
    10/10/2012                     01/11/12    Can anyone advise what wrong with the select statement ?
    Thanks a lot in advance,
    Ann

    Hi,
    Here's one way:
    WITH   params      AS
         SELECT     TO_DATE (:p50_start_date, 'DD/MM/YYYY')     AS start_date
         ,     TO_DATE (:p50_end_month,  'DD/MM/YYYY')     AS end_date
         FROM     dual
    SELECT     GREATEST ( start_date
               , ADD_MONTHS ( TRUNC (start_date, 'MONTH')
                            , LEVEL - 1
              )               AS month_start
    ,     LEAST     ( end_date
              , ADD_MONTHS ( TRUNC (start_date, 'MONTH')
                          , LEVEL
                        ) - 1
              )               AS month_end
    FROM    params
    CONNECT BY     LEVEL     <= 1 + MONTHS_BETWEEN ( end_date
                                      , TRUNC (start_date, 'MONTH')
    ;:p50_end_month doesn't have to be the last day of the month; any day will work.
    If you want to generate a Counter Table containing the integers 1 througn x in SQL, you could say
    SELECT  ROWNUM  AS n
    FROM    all_objects
    WHERE   ROWNUM  <= x
    ;but, starting in Oracle 9.1, it's much faster to say
    SELECT  LEVEL   AS n
    FROM    dual    -- or any table containing exactly 1 row
    CONNECT BY  LEVEL <= x
    ;Also, x can be greater than the number of rows in all_objects.

  • Need Help With Script Skipping Word Before Variable

    I borrowed and modified a skip I found here: http://forums.adobe.com/message/4808804 with code borrowed from elsewhere.
    I noticed that it seems to run fine, but it skips any word that appears right before a variable. The point of the script is to find any text using an italic override or bold override, and replace the override with the appropriate character format from the catalog.
    Can someone tell me why the code below skips words before a variable? I am sure it is a simple thing, but I am teaching myself Extendscript, and only recently started the attempt/
    Thanks,
    Marc
    var doc = app.ActiveDoc;
    removeOverrides (doc)
    function removeOverrides (pDoc)
        var vDocStart = pDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
        var vBoldFmt=pDoc.GetNamedCharFmt ('bold')
        var vItalicFmt=pDoc.GetNamedCharFmt ('italic')
        initFA_errno ();
        var vTextLoc = new TextLoc(vDocStart,0);
        var vFindParams=findOverrideParams (pDoc);
        while (FA_errno==Constants.FE_Success)
            var vTextRange=pDoc.Find(vTextLoc,vFindParams);
            if (vTextRange.beg.obj.ObjectValid())
                var vTextItems=pDoc.GetTextForRange (vTextRange, Constants.FTI_CharPropsChange)
                if (vTextItems.length==!0 )
                    $.writeln(vTextItems.String)
                    if (vTextItems[0].idata==Constants.FTF_WEIGHT)
                       pDoc.SetTextProps (vTextRange, vBoldFmt.GetProps())
                    if (vTextItems[0].idata==Constants.FTF_ANGLE)
                       pDoc.SetTextProps (vTextRange, vItalicFmt.GetProps())
                    }// else (Log (vLogFileName, '\nERROR: No items were found in the text format array but format override was found: '+pDoc.Name))
            vTextLoc = vTextRange.end
            vDocStart=vDocStart.NextPgfInFlow;
    function findOverrideParams (pDoc)
        var vFindParams = AllocatePropVals(1);
        vFindParams[0].propIdent.num = Constants.FS_FindObject;
        vFindParams[0].propVal.valType = Constants.FT_Integer;
        vFindParams[0].propVal.ival = Constants.FV_FindCharacterFormatOverride;
       return vFindParams;
      function initFA_errno()
             app.GetNamedMenu("!MakerMainMenu"); //If this fails, you've got bigger problems
             return;

    It looks like home assignment. Home assignment are not very welcome here. I can help you only a little. It's very simple application, but if you dont know basics in OO, you are in trouble.
    Create these three files, even empty with all points you need to accomplish in them as comments.
    Think about gui you need. If you do not know how to make menus and other fancy gui you can do only with one main panel with a few buttons and JOptionPanes appearing for every input.
    Buttons for each task:
    1. get available rooms; press and see JOptionPane telling what rooms are empty (information message)
    2. book: JOptionPane asking how many guests, you input, it checks for availability, if available rooms are not enough (or beds) another OP tells that it's impossible, if enough - offer to input room number, you input, check if the room is booked, then offer to input name, then offer quit.
    3. unbook.
    4.get report
    Once you design how it looks, every step becomes very simple. All methods you need to implement are simple array manipulations. Make report last, because it's just collection of printouts from methods you've already done.
    In book, you need to look for definitions of constructor, passing arguments to methods, returning results from methods, creating object with "new" operator, simple event handling, JOptionPane documentation and examples, which are in every decent textbook.
    Do not panic, it's really simple but rather tiresome application, if you do it by yourself you learn almost everything necessary to start programming in java.

  • Need help with configuring setup cost as variable based on quantity

    Hello,
    I am brand new to PP and my client has inquiry as to how they can make the setup costs variable based on the production quantity. They already have the machine and labor working correctly, so I compared the formulas for machine and labor time with that of the formula for setup time and they are not the same (in fact, setup time does not have any formula). Do I simply need to create a formula for this or are there multiple other steps? If anyone can give instruction on how to set this up it would be of great help.
    Thanks,
    MH

    Check in the Work Center, tab Costing where Setup Time should have a formula using operation quantity / base quantity as ratio.
    Setup time should be included as parameter in the standard value key.
    The formula in the Capacity Tab would have only effect on the capacity evaluation, but no costs impact.
    Edited by: Dario on Feb 2, 2011 7:04 PM

  • Need help with Fluid Grid Layout and variable column balance.

    I'm using the fluid grid layout.  I have multiple columns that are actually fluid grid layout columns done by Dreamweaver.  I'd like them to extend as high as each other (all to the maximum height of each other) within the same section.  An added catch is that in the desktop layout, I have three side by side under one that takes the whole width of the page.  On tablet size, it's 2x2 in a square grid.  On mobile, they're vertically stacked.  I'm trying to get it so that background colour and/or borders looks decent and is fully balanced, no matter which layout is hit with the fluid layout.  The columns reflow, no problem.  But the height of any background and/or border is variable. 
    Any help on fixing this? 
    Example at:  https://music2help.thoughtburst.net/ 
    The example doesn't have borders or colours, as it looked silly unbalanced.  The music2help.css is the only one I'm modifying manually.
    Love the fluid grid layout, but I need a way to make it behave decently with backgrounds/borders.  Any help would be hugely appreciated!
    Thanks!
    mark->

    I tried the solution Nancy posted.  It altered things, but doesn't seem to do the trick.
    Just some quick background.  I did HTML from 1994 through about five years ago by hand in vi on *nix systems.  I learned HTML through 4.01, and never bothered with XHTML at all.  I learned CSS through most of CSS2.  The CSS3 and HTML5 stuff is all new to me, but it can't be that hard.  I'm not exactly a novice in JS (I've done a fair bit of AJAX programming), but it's not even close to my primary language (I'm a Perl guy).
    I'm "stuck on" wanting to use Fluid Grid Layouts.  It's billed as one of the selling points of DW CS6, and I really like the concept and results.  I just want the results embellished a little, namely with sensible identical heights on grid containers set in the same row, so that you can apply background colours, dropshadows, and borders.  That's really all I want to do that it doesn't already do.
    I have a test page at:  http://music2help.thoughtburst.net/ that you can try with your Quick Columns.  I'd be interested to know if you can get it to work.
    Here's the catch, though...  Resize the browser, shrinking it inwards.  (I suggest Firefox, as Chrome only shrinks so far, and you won't get to Mobile width.)  As you can see, on a Tablet, one of the columns that should be equal height actually moves up a row and should be equal height with the row that, on a desktop, would take the entire width of the page area.  So that's like a 4-up output in printing terms.  At Mobile size, the entire thing is vertical, so none of the columns should be resized.
    If your product works and can accomodate these conditions, I think I would be interested in spending the $35 it costs. 
    Let me know?  Thanks!
    EDIT:  Changed URL to be non-SSL.  The server has multiple vhosts on it, and I keep forgetting that I don't have a cert on this new one.  Sorry about that.  You can just add anything to one of the the three middle columns, if you're pulling it down to test.

  • Need help with buttons that react to rollover that create a scoll effect

    hey everyone,
    I'm new to flash and actionscript and am having trouble
    creating what I need. I want to create a scroll area that scrolls
    left and right when you rollover a left or right arrow. what I want
    to scroll looks like a piece of film negative that has about 20
    thumbnails in it. I only want it to show about 4 thumbs at once
    though (thus the scroll is needed). so when the mouse rolls over
    the arrows, it scrolls, and when it rolls out it stops in place.
    eventually, i will add links to the thumbs for a better image.
    I've checked out a couple tutorials on scrollbars and such
    thinking that I can just go in and modify the code a bit, but the
    two turorials i've tried to do have left some of the pieces out...
    not very helpful when you don't know actionscript well. does
    anybody have any tips or ideas?

    Hi there,
    What I did, I took a variable 'counter123' and assign '0' value to this variable.
    I then added a button with Advanced action, I am sharing the Screenshot of the advanced action panel.
    Screen shot 1 :
    Incrementing the Value on click :
    The value of the variable should increase on every click, so lets add a true statement as a condition.
    Screenshot no 2 :
    As normally on buttons/click boxes, the project will continue as soon we click them.
    lets compare the value of our variable and then pause the project.
    Screen shot 3 :
    last if our purpose is solved, here we have clicked the button 4 times, so that has updated the value of our counter to 4, so as soon as the counter exceeds the value, we want the project to continue.
    please let me know if this helps you.
    This will help you in pressing a button 4 times, and i think you can also add actions to show and hide 'zeros' in your project.
    I find such scenarios very interesting and I always find help on Lilybiri's Blog : http://lilybiri.posterous.com/
    Thanks

  • Task Scheduling Script - Need help with passing the scheduled command (variables are not being evaluated)

    Hi Everyone,
    I'm trying to get a simple task scheduler script to work for me and can't get the command I need passed to the scheduler to evaluate properly.
    Here's the script:
    ###Create a new task running $Command and execute it Daily at 6am.
    $TaskName = Read-Host 'What would you like this job to be named?'
    $Proto = Read-Host 'What is the protocol? (FTP/FTPS/SFTP)'
    $User = Read-Host 'What is the user name?'
    $Pwd = Read-Host 'What is the password?'
    $Server = Read-Host 'What is the server address?'
    $NetworkDir = Read-Host 'Please input the network location of the file(s) you wish to send. Refer to documentation for more details.'
    $RemoteDir = Read-Host 'Please input the REMOTE directory to which you will upload your files. If there is none please input a slash'
    $Command = 'winscp.com /command "option batch abort" "option confirm off" "open $Proto://$User:$Pwd@$Server" "put $NetworkDir $RemoteDir" "exit"'
    $TaskAction = New-ScheduledTaskAction -Execute "$Command"
    $TaskTrigger = New-ScheduledTaskTrigger -Daily -At 6am
    Register-ScheduledTask -Action $TaskAction -Trigger $Tasktrigger -TaskName "$TaskName" -User "Administrator" -RunLevel Highest
    Write-Host "$TaskName created to run Daily at $TaskStartTime"
    What's messing up is the $Command creation, the command needs to have the quotes around "option blah blah", but if I wrap the whole line in single quotes the variables that are evaluated for the "open blah blah" strings (which also need
    to be inside quotes) and the "put blah blah" string are not being evaluated properly.
    I've dorked about with different bracketing and quoting but can't nail the syntax down, could someone point me in the right direction? My Google-fu seems to be lacking when it comes to nailing down this issue.
    Thanks

    Hmmn, closer. I'm getting this error now:
    + $Command = $tmpl -f  $User, $Pwd, $Server, $NetworkDir, $RemoteDir
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (winscp.com /com...t {4} {5}" exit:String) [], RuntimeException
        + FullyQualifiedErrorId : FormatError
    And the command being added to the new task looks like this:
    winscp.com /command "option batch abort" "option confirm off" "open ($Proto)://($User):($Pwd)@($Server)" "put $NetworkDir $RemoteDir" "exit"
    Here's the current state of the script. I get what you're doing to try to bypass the quotes issue, using an array. I'm just not awesome at this yet sooooooo...
    $TaskName = Read-Host 'What would you like this job to be named?'
    $Proto = Read-Host 'What is the protocol? (FTP/FTPS/SFTP)'
    $User = Read-Host 'What is the user name?'
    $Pwd = Read-Host 'What is the password?'
    $Server = Read-Host 'What is the server address?'
    $NetworkDir = Read-Host 'Please input the network location of the file(s) you wish to send. Refer to documentation for more details.'
    $RemoteDir = Read-Host 'Please input the REMOTE directory to which you will upload your files. If there is none please input a slash'
    $tmpl = 'winscp.com /command "option batch abort" "option confirm off" "open {0}://{1}:{2}@{3}" "put {4} {5}" exit'
    $Command = $tmpl -f $User, $Pwd, $Server, $NetworkDir, $RemoteDir
    $TaskAction = New-ScheduledTaskAction -Execute $Command
    $TaskTrigger = New-ScheduledTaskTrigger -Daily -At 6am
    Register-ScheduledTask -Action $TaskAction -Trigger $Tasktrigger -TaskName "$TaskName" -User "Administrator" -RunLevel Highest
    Write-Host "$TaskName created to run Daily at $TaskStartTime"

  • Need help with query that can look data back please help.

    hi guys i have a table like such
    CREATE TABLE "FGL"
        "FGL_GRNT_CODE" VARCHAR2(60),
        "FGL_FUND_CODE" VARCHAR2(60),
        "FGL_ACCT_CODE" VARCHAR2(60),
        "FGL_ORGN_CODE" VARCHAR2(60),
        "FGL_PROG_CODE" VARCHAR2(60),
        "FGL_GRNT_YEAR" VARCHAR2(60),
        "FGL_PERIOD"    VARCHAR2(60),
        "FGL_BUDGET"    VARCHAR2(60)
      )and i have a data like such
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','1','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','0');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','14','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','2','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7470','4730','02','10','2','200');I bascially need to get the total of the budget column. however its not as simple as it sound(well atleast not for me.) the totals carry over to the new period. youll noticed the you have a period column. basically what im saying is that
    fgl_grant_year 10 period 1 = for account 7600 its $100 and $100 for period 2 you see 100 dollars again this is not to be added this is the carried over balance. which remains $100.
    so im trying to write a query that basically does the following.
    im given a period for the sake of this example lets say period 1 i get nothing else. I have to find the greates grant year grab the amount for period 14(which is the total from the previous year) and add it to the amount of the current period. in this case period 1 grnt_year 11
    so the expected outcome should be $700
    240055     240055     7240     4730     02     10     14     200
    240055     240055     7600     4730     02     10     14     100
    240055     240055     7600     4730     02     11     1     400keep in mind that im not given a year just a period.
    any help that you guys can offer would be immensely appreciated. I have been trying to get this to work for over 3 days now.
    finally broke down and put together this post
    Edited by: mlov83 on Sep 14, 2011 8:48 PM

    Frank
    wondering if you can help me modify this sql statement that you provided me with .
    table values have been modified a bit.
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','00','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','0');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('360055','360055','7200','4730','02','10','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('360055','360055','7600','4730','02','10','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','14','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','2','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','11','2','600');i need to take one more thing into consideration. if the greatest year has a value on period 00 i need to ignore the period 14 and the current period total would be
    the current period +(current period - greatest year 00)
    hope that makes sense so in other words with the new data above. if i was querying period two of grant year 11. i would end up with $800
    because the greatest year is 11 it contains a period 0 with amount of $400 so my total should be
    period 2 amount $ 600
    period 0 amount $ 400 - period 2 amount of $600 = 200
    600+200 = $800
    if i query period 1 of grant 360055 i would just end up with 800 of grnt year 10.
    i have tried to modify that query you supplied to me with no luck. I have tried for several day but im embarrased to say i just can get it to do what im trying to do .
    can you please help me out.
    Miguel

Maybe you are looking for

  • Windows 2008 server

    has any one manged to get Windows 2008 server working with fully driver support on a MacBook (Black)

  • How do i convert a multi page pdf to a word doc w the same number of pages?

    My file started in Adobe Illustrator. It has several pages of text.  I converted to a pdf. When I tried to convert to Word with Export PDF, all the pages ended up on a single page, instead of a Word doc with the same number of pages. What do i do to

  • My contacts are gone, how do I get them back?

    my contacts were in my phone and 5 minutes later i went to send a message and went into my contacts and I didnt have any at all? how do i get them back?

  • Database 12c certification web pages anonomolies

    1) On he 12c DBA OCP  upgrade page tab Database Certification: 12c Database Administrators the mention of "*Exams 1Z0-007: Introduction to Oracle9i SQL ,1Z0-047: Oracle Database SQL Expert and  1Z0-051 Oracle Database 11g: SQL Fundamentals I will als

  • Podcast subscriptions on iPhone

    I subscribe to a number of podcasts through iTunes and invariably listen on my iPhone. Since I can sync the phone with only one of my computers, I often find myself on the road without the ability to access the iTunes data linked to the phone. This p