Jump to content

mr.web_developer

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Posts posted by mr.web_developer

  1. Hi all

     

    Good morning / night / afternoon

     

    I have a problem I will describe it in detailes

     

    I have a database that contain a table called request. It contains 3 names as you can see in the pic

    27403895.jpg

     

    I would like to print all thoes names in a way we will see it later

    let's take a look at the php file

     

    [code=php:0]
    <?php
    $e = mysql_query("select Requster_Name from request");
         while ($row = mysql_fetch_array($e)) {
         extract($row);
         $RN = $row [‘Requster_Name’];
    print $easy->display("TEMPLATE.tpl");
             }
    ?>
    

    [/code]

     

    as you can see I'm using template engine

    print $easy->display("TEMPLATE.tpl");
    

     

    It will print all the names bu passing it to the template ((template code))

    <div id="content" align="center">
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
    collapse;width:333px">
        <tr height="25" style="height:18.75pt">
       <td style="width: 329px; font-size: 14.0pt; font-weight: 700; text-align: center; color: black; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: 1.5pt solid black; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #C5D9F1">
       {RN}</td>
      </tr>
      </table>
    </div>

     

    It will print the names like this

    16935489.jpg

     

    as you can see I'm using the template engine print function inside the while loop

    but I want to use it outside the loop for a reason

     

    when I take it out the loop

     

    <?php
    $e = mysql_query("select Requster_Name from request");
         while ($row = mysql_fetch_array($e)) {
         extract($row);
         $RN = $row [‘Requster_Name’];
             }
    print $easy->display("TEMPLATE.tpl");
    ?>

     

    It will only print Cris

    I hope it's clear

    what I want is to print all the names when the print function outside the loop

    I want it be print in one record like this

     

    95789269.jpg

     

    thank you

     

     

     

  2. I want to print only 1 record for each request with all aprovers

    I'm using Oracle

    but I did try it. It doesn't work

     

    see

      $Requster_ID = '1';

      $s1 = oci_parse($c, "select  SIG.Requster_ID, SIG.Requester_Name,SIG.APPROVERS

        from RequestT SIG

        where

        SIG.Requster_ID = '$Requster_ID'

        ");

        oci_execute($s1);

        $res1 = oci_fetch_array($s1, OCI_ASSOC);   

        echo "$res1[0]" . "$res1[1]";

  3. Hi all

     

    Good morning / night / afternoon

     

    I have a duplication problem when I need to print my records in PHP

    First of all let's see the database table

     

    O4H37571.jpg

     

    As you can see the duplication happened duo to the approvers that mean if there is only one approver there will be no duplication

    For example when I want to pint request number 1 it will print

     

    1 - Cris - Hadi

    1 - Cris - Jack

     

    but I want it to be like this

     

    1 - Cris - Hadi,Jack

     

    and thank you for your time

  4. Hi all

    Good morning

     

    I did connect to the Active Dirctroy using PHP

     

      $ldapHost = "ldap://XXX.com";

        $ldapPort = "389";

        $ldapUser ="XXX@XXX.com";

        $ldapPswd ="XXX";

     

        $ldapLink =ldap_connect($ldapHost, $ldapPort)

        or die("Can't establish LDAP connection");

     

     

        ldap_bind($ldapLink,$ldapUser,$ldapPswd)

        or die("Can't bind to server.");

     

    it's working well but how can I print the username I mean since I'm connected with Active Dirctory I want any user who enter the webpage it will print his name that stored in Active Dirctory

     

    thank you :)

  5. I'm really thankful

     

    but actully what I did it was just a sample code and when I applied your sloution it works

    but when I did apply it on my orginal code it didn't work

    see

     

    first I have the CAB.PHP this file like the index.php

    and it contains connection to mysql and oracle database just for your information

     

    <?php
    
        ///////////////////////////////////////////////////////////////////////////////
        require_once "easytemplate.php";
        $easy = new EasyTemplate();
        $easy->Temp = 'template';
        $easy->Cache = 'easycache';
        include '../config.php';
        $date1 = date('Y-CC-W');
        $i = 0;
        ///////////////////////////////////////////////////////////////////////////////
        $e = mysql_query("select* from crdate");
         while ($row = mysql_fetch_array($e)) {
                extract($row);
         $start_d = $row ['Start_Date'];
         $end_d = $row ['End_Date'];
         }
         
         if (isset($start_d) && ($start_d)){
    
         $sdate = date('M j, Y', $start_d);
         $edate = date('M j, Y', $end_d);
         ///////////////////////////////////////////////////////////////////////////////
        $s = oci_parse($c, "select INFRASTRUCTURE_CHANGE_ID,NAME,CHANGE_TIMING,STATUS_REASON,APPROVER_SIGNATURE,APPROVAL_STATUS2,SUPPORT_GROUP_NAME,DESCRIPTION,ASLOGID,ASCHG,REGION,SCHEDULED_START_DATE,SCHEDULED_END_DATE,SERVICECI,RISK_LEVEL,CHANGE_TIMING,PRIORITY,REQUESTOR_ID,CUSTOMER_FIRST_NAME,CUSTOMER_LAST_NAME,CHANGE_REQUEST_STATUS,ASGRP  from ARACCESS.ARAMCO_REPORT_CHGAPDETAILS2480 where SCHEDULED_START_DATE between '$start_d' and '$end_d' ");
    
        oci_execute($s);
        ///////////////////////////////////////////////////////////////////////////////
        include 'template/header.html';
        print $easy->display("try.tpl");
        ///////////////////////////////////////////////////////////////////////////////
       print "<form action='CAB1.php' method=post>";
        while ($res = oci_fetch_array($s, OCI_ASSOC))
        {
        $i = $i++ + 1;
        ///////////////////////////////////////////////////////////////////////////////
        $Change_Id = $res ['INFRASTRUCTURE_CHANGE_ID'];
        $Change_Location = $res ['REGION'];
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['SCHEDULED_START_DATE'])){
        $START_DATE = $res ['SCHEDULED_START_DATE'];
        $START_DATE1 = date('F jS, Y', $START_DATE);
        }
        else{
        $START_DATE = "";
        $START_DATE1 = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['SCHEDULED_END_DATE'])){
        $END_DATE = $res ['SCHEDULED_END_DATE'];
        $END_DATE1 = date('F jS, Y', $END_DATE);
        }
        else{
        $END_DATE = "";
        $END_DATE1 = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['SERVICECI'])){
        $System_Service = $res ['SERVICECI'];
        }
        else{
        $System_Service = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['APPROVER_SIGNATURE']) && ($res ['SUPPORT_GROUP_NAME'])){
        $Approvals = $res ['APPROVER_SIGNATURE'] ."   " . "(". $res ['SUPPORT_GROUP_NAME'].")";
        }
        else{
        $Approvals = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['APPROVAL_STATUS2'])){
        $Approvals1 = "  " . $res ['APPROVAL_STATUS2'];
        }
        else{
        $Approvals1 = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['RISK_LEVEL'])){
        $Risk = $res ['RISK_LEVEL'];
        }
        else{
        $Risk = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['CHANGE_REQUEST_STATUS'])){
        $Status = $res ['CHANGE_REQUEST_STATUS'];
        }
        else{
        $Status = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['CHANGE_TIMING'])){
        $Change_Type = $res ['CHANGE_TIMING'];
        }
        else{
        $Change_Type = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['PRIORITY'])){
        $Priority = $res ['PRIORITY'];
        }
        else{
        $Priority = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['ASCHG']) && ($res['ASLOGID'])){
        $Supervisor = $res ['ASCHG'] . "   " . "(" .$res['ASLOGID'] . ")";
        }
        else{
        $Supervisor = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['CUSTOMER_FIRST_NAME']) && ($res['CUSTOMER_LAST_NAME']) &&($res ['REQUESTOR_ID'])){
        $Requstor = $res ['CUSTOMER_FIRST_NAME'] ."   ,".$res['CUSTOMER_LAST_NAME'] ." (". $res ['REQUESTOR_ID'] .")";
        }
        else{
        $Requstor = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['ASGRP'])){
        $Group_name = $res ['ASGRP'];
        }
        else{
        $Group_name = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['DESCRIPTION'])){
        $Description = $res ['DESCRIPTION'];
        }
        else{
        $Description = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        if (isset ($res ['STATUS_REASON'])){
        $Reason = $res ['STATUS_REASON'];
        }
        else{
        $Reason = "";
        }
        ///////////////////////////////////////////////////////////////////////////////
        print $easy->display("html1.tpl");
        }
         print "</form>";
        ///////////////////////////////////////////////////////////////////////////////
        print $easy->display("try2.tpl");
        include 'template/footer.html';
        ///////////////////////////////////////////////////////////////////////////////
        }
        else{
        include 'template/header.html';
        print $easy->display("try1.tpl");
    
        echo "No changes avaliable";
    
        print $easy->display("try2.tpl");
        include 'template/footer.html';
        }
    ?>

     

    and now with the remplate file

     

    <form action='CAB1.php' method=post>
    <div id="content" align="center">
    <table border="0" cellpadding="0" cellspacing="0" width="942" style="border-collapse:
    collapse;width:708pt">
    	<colgroup>
    		<col width="38" style="width: 29pt">
    		<col width="113" style="width: 85pt">
    		<col width="110" style="width: 83pt">
    		<col width="23" style="width: 17pt">
    		<col width="64" style="width: 48pt">
    		<col width="70" style="width: 53pt">
    		<col width="23" style="width: 17pt">
    		<col width="128" style="width: 96pt">
    		<col width="23" style="width: 17pt">
    		<col width="132" style="width: 99pt">
    		<col width="23" style="width: 17pt">
    		<col width="173" style="width: 130pt">
    		<col width="22" style="width: 17pt">
    	</colgroup>
    	<tr height="25" style="height:18.75pt">
    		<td rowspan="10" height="205" width="38" style="height: 153.75pt; width: 29pt; font-size: 14.0pt; font-weight: 700; text-align: center; vertical-align: middle; color: black; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; white-space: nowrap; border-left: 1.0pt solid windowtext; border-right: .5pt solid windowtext; border-top: .5pt solid windowtext; border-bottom: 1.5pt solid black; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #C5D9F1">
    		{i}</td>
    		<td width="113" style="width: 85pt; font-size: 14.0pt; font-weight: 700; color: black; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; text-align: general; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #C5D9F1">
    		Change ID</td>
                            <input type="checkbox" name="Change_Id[]" value="{Change_Id}" /> <input type="submit" name="submit" value="submit" />
    		<td colspan="5" width="290" style="width: 218pt; font-size: 14.0pt; font-weight: 700; text-align: center; color: black; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #C5D9F1">
    		{Change_Id}</td>
    		<td colspan="6" width="501" style="width: 376pt; font-size: 14.0pt; font-weight: 700; text-align: center; color: black; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: 1.5pt solid black; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #C5D9F1">
    		{Group_name}</td>
    	</tr>
    	<tr height="20" style="height: 15.0pt">
    		<td height="20" style="height: 15%; font-weight: 700; text-align: left; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC; width:16%">
    		Description</td>
    		<td colspan="11" style="color: blue; text-align: left; font-size: 11.0pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: 1.5pt solid black; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		{Description}
    		</td>
    	</tr>
    	<tr height="20" style="height: 15.0pt">
    		<td height="20" style="height: 15%; font-weight: 700; text-align: left; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC; width:16%">
    		Change Location</td>
    		<td colspan="11" style="color: windowtext; font-size: 11.0pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; text-align: general; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: 1.5pt solid black; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		{Change_Location}</td>
    	</tr>
    	<tr height="20" style="height: 15.0pt">
    		<td height="20" style="height: 15%; font-weight: 700; text-align: left; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC; width:16%">
    		Start Date</td>
    		<td colspan="5" style="color: windowtext; font-size: 10.0pt; font-family: Arial, sans-serif; text-align: left; font-weight: 400; font-style: normal; text-decoration: none; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: medium none; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		{START_DATE1}</td>
    		<td style="font-weight: 700; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; text-align: general; vertical-align: bottom; white-space: nowrap; border-left: .5pt solid windowtext; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC; width:15%; height:15%">
    		Change Type</td>
    		<td colspan="5" style="color: red; font-weight: 700; text-align: left; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: 1.5pt solid black; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		<IF NAME="{Change_Type} == 1000">
                            Emergency
                            <ELSEIF NAME="{Change_Type} == 2000">
                            Expedited
                            <ELSEIF NAME="{Change_Type} == 3000">
                            Latent
                            <ELSEIF NAME="{Change_Type} == 4000">
                            Normal
                            <ELSEIF NAME="{Change_Type} == 5000">
                            No Impact
                            <ELSE>
                            Standard
                            </IF>
                            </td>
    	</tr>
    	<tr height="20" style="height: 15.0pt">
    		<td height="20" style="height: 15%; font-weight: 700; text-align: left; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC; width:16%">
    		End Date</td>
    		<td colspan="5" style="color: windowtext; font-size: 10.0pt; font-family: Arial, sans-serif; text-align: left; font-weight: 400; font-style: normal; text-decoration: none; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: medium none; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		{END_DATE1}</td>
    		<td style="font-weight: 700; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; text-align: general; vertical-align: bottom; white-space: nowrap; border-left: .5pt solid windowtext; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC">
    		Priority</td>
    		<td colspan="5" style="text-align: left; color: black; font-size: 11.0pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: 1.5pt solid black; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		<IF NAME="{Priority} == 0">
                            Critical
                            <ELSEIF NAME="{Priority} == 1">
                            High
                            <ELSEIF NAME="{Priority} == 2">
                            Medium
                            <ELSE>
                            Low
                            </IF>
                            </td>
    				</tr>
    	<tr height="20" style="height: 15.0pt">
    		<td height="20" style="height: 15%; font-weight: 700; text-align: left; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC; width:16%">
    		System/Service</td>
    		<td colspan="11" style="text-align: left; color: black; font-size: 11.0pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: 1.5pt solid black; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		{System_Service}</td>
    	</tr>
    	<tr height="20" style="height: 15.0pt">
    		<td height="20" style="height: 15%; font-weight: 700; text-align: left; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC; width:16%">
    		Change Benefits</td>
    		<td colspan="5" style="text-align: left; color: black; font-size: 11.0pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: .5pt solid black; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		<IF NAME="{Reason} == 1000">
                            Fix/Repair
                            <ELSEIF NAME="{Reason} == 2000">
                            New Functionality
                            <ELSEIF NAME="{Reason} == 3000">
                            Maintenance
                            <ELSEIF NAME="{Reason} == 4000">
                            Upgrade
                            <ELSE>
                            Other
                            </IF>
                            </td>
    		<td style="font-weight: 700; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; text-align: general; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC">
    		Coordinator</td>
    		<td colspan="5" style="text-align: left; color: black; font-size: 11.0pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: 1.5pt solid black; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		{Supervisor}</td>
    	</tr>
    	<tr height="20" style="height: 15.0pt">
    		<td height="20" style="height: 15%; color: windowtext; font-weight: 700; text-align: left; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC; width:16%">
    		Risk Level</td>
    		<td colspan="5" style="color: #0D0D0D; text-align: left; font-size: 11.0pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: medium none; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		{Risk}</td>
    		<td style="font-weight: 700; text-align: left; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: .5pt solid windowtext; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC">
    		Requestor</td>
    		<td colspan="5" style="text-align: left; color: black; font-size: 11.0pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: 1.5pt solid black; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		{Requstor}</td>
    	</tr>
    	<tr height="20" style="height: 15.0pt">
    		<td height="20" style="height: 15%; font-weight: 700; text-align: left; vertical-align: middle; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: medium none; border-bottom: medium none; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC; width:16%">
    		Status</td>
    		<td colspan="11" style="text-align: left; color: black; font-size: 11.0pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: 1.5pt solid black; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		<IF NAME="{Status} == 0">
                            Draft
                            <ELSEIF NAME="{Status} == 1">
                            Request For Authorization
                            <ELSEIF NAME="{Status} == 2">
                            Request For Change
                            <ELSEIF NAME="{Status} == 3">
                            Planning In Progress
                            <ELSEIF NAME="{Status} == 4">
                            Scheduled For Review
                            <ELSEIF NAME="{Status} == 5">
                            Scheduled For Approval
                            <ELSEIF NAME="{Status} == 6">
                            Scheduled
                            <ELSEIF NAME="{Status} == 7">
                            Implementation In Progress
                            <ELSEIF NAME="{Status} == 8">
                            Pending
                            <ELSEIF NAME="{Status} == 9">
                            Rejected
                            <ELSEIF NAME="{Status} == 10">
                            Completed
                            <ELSEIF NAME="{Status} == 11">
                            Closed
                            <ELSE>
                            Cancelled
                            </IF>
                            </td>
    	</tr>
    	<tr height="20" style="height: 15.0pt">
    		<td height="20" style="height: 15%; font-weight: 700; text-align: left; vertical-align: middle; color: black; font-size: 11.0pt; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; white-space: nowrap; border-left: medium none; border-right: .5pt solid windowtext; border-top: .5pt solid windowtext; border-bottom: 1.5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px; background: #D8E4BC; width:16%">
    		Approvals</td>
    		<td colspan="11" style="text-align: left; color: black; font-size: 11.0pt; font-weight: 400; font-style: normal; text-decoration: none; font-family: Calibri, sans-serif; vertical-align: bottom; white-space: nowrap; border-left: medium none; border-right: 1.5pt solid black; border-top: .5pt solid windowtext; border-bottom: 1.5pt solid windowtext; padding-left: 1px; padding-right: 1px; padding-top: 1px">
    		{Approvals}
                            <IF NAME="{Approvals1} == 0">
                            Pending
                            <ELSEIF NAME="{Approvals1} == 1">
                            Approved
                            <ELSEIF NAME="{Approvals1} == 2">
                            Rejected
                            <ELSEIF NAME="{Approvals1} == 3">
                            Hold
                            <ELSEIF NAME="{Approvals1} == 4">
                            More Information
                            <ELSEIF NAME="{Approvals1} == 5">
                            Cancelled
                            <ELSEIF NAME="{Approvals1} == 6">
                            Error
                            <ELSE>
                            Preview
                            </IF>
                            </td>
    	</tr>
    </table>
    </div>
    
    </form>
    

     

    and this the next file CAB1.php should print the Chande_Id which is in CAB.php

     

    <?php
    
        require_once "easytemplate.php";
        $easy = new EasyTemplate();
        $easy->Temp = 'template';
        $easy->Cache = 'easycache';
        include '../config.php';
    
        include 'template/header.html';
        print $easy->display("try.tpl");
        ////////////////////////////////////////////////////////////////////////////
    
    
    
    
       $checks=$_POST['Change_Id'];
      
         if ($_POST){
                while (list ($key,$val) = @each ($checks)) {
            print"$val <br>";
            }
    
        }
    
    
        ////////////////////////////////////////////////////////////////////////////
        print $easy->display("try2.tpl");
        include 'template/footer.html';
    
    
    ?>
    
    

     

    when I click sumbit it will only print the Change_Id that the submit botton are next too

    so if i select 3 Change Id it will print only the one that the sumbit bottom realted with for ex

     

    EXt27607.jpg

     

    if I did select the both check box and click on bottom 1 it will print the change Id that is next to it

    if I click on number 2 it will print the chang id that next to it

     

    thank you

  6. Hi

     

    How are you all,

     

    I will explain me issue one by one

    first of all I have created a mysql database ((ftest)) and it contain a table ((test1)) and that table contin a filed ((name))

    In that filed I have 3 names

    1- James

    2- Moly

    3- Cris

     

    let's start with the first file I have it's the config.php which will connect to the mysql database

     

    second we have index.php which contain

    <?php 
    
        /////////////////////////////////////////////////////////////////////////////// 
        require_once "easytemplate.php"; 
        $easy = new EasyTemplate(); 
        $easy->Temp = 'template'; 
        $easy->Cache = 'easycache'; 
        include 'config.php'; 
        /////////////////////////////////////////////////////////////////////////////// 
        $e = mysql_query("select name from test1"); 
         while ($row = mysql_fetch_array($e)) { 
                extract($row); 
         $name = $row ['name']; 
         print $easy->display("html.tpl"); 
         } 
    
    ?>

     

    As you can see I'm defining

    require_once "easytemplate.php"; 

    which is a normal Template Engine anyway It will extract all the 3 names then it will call html.tpl which contain the html design code

     

    let's see what the html.tpl contain

    <form action='main.php' method=post> 
    <head> 
    <meta http-equiv="Content-Language" content="en-us"> 
    </head> 
    
    <p><font color="#FF0000"><span style="background-color: #FFFFFF">{name}</span></font></p> 
    <input type="checkbox" name="name" value="{name}"> <input type="submit" name="submit" value="submit" /> 
    </form>

     

    No I will run the Index.php file to see how it looks with the template file (html.tpl)

    this is the snapshot from the browser

     

    X5z29485.jpg

     

     

    What I want exactly if I did check more than one name

    for example Cris and Moly and then press any of the submit buttons I want the names ((Cris & Moly) to be printed in the next page which is main.php

     

    <?php 
    
        /////////////////////////////////////////////////////////////////////////////// 
        include 'config.php'; 
        /////////////////////////////////////////////////////////////////////////////// 
    
        if(isset($_POST['name'])) 
        $names = $_POST['name']; 
    
        if ($_POST){ 
        echo $names; 
        } 
    
    ?>

     

    Now It will work but it will print only one name

     

    thank you for your time :)

×
×
  • 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.