fansa Posted December 22, 2008 Share Posted December 22, 2008 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <script language = "Javascript"> /** * DHTML date validation script. Che Wea Cust 11.09.2006 */ // Declaring valid date character, minimum year and maximum year var dtCh= "/"; var minYear=1900; var maxYear=2100; function isInteger(s){ var i; for (i = 0; i < s.length; i++){ // Check that current character is number. var c = s.charAt(i); if (((c < "0") || (c > "9"))) { return false } } // All characters are numbers. return true; } function stripCharsInBag(s, bag){ var i; var returnString = ""; // Search through string's characters one by one. // If character is not in bag, append to returnString. for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (bag.indexOf© == -1) returnString += c; } return returnString; } function daysInFebruary (year){ // February has 29 days in any year evenly divisible by four, // EXCEPT for centurial years which are not also divisible by 400. return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 ); } function DaysArray(n) { for (var i = 1; i <= n; i++) { this = 31 if (i==4 || i==6 || i==9 || i==11) {this = 30} if (i==2) {this = 29} } return this } function isDate(dtStr){ var daysInMonth = DaysArray(12) var pos1=dtStr.indexOf(dtCh) var pos2=dtStr.indexOf(dtCh,pos1+1) var strDay=dtStr.substring(0,pos1) var strMonth=dtStr.substring(pos1+1,pos2) var strYear=dtStr.substring(pos2+1) strYr=strYear if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1) if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1) for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1) } month=parseInt(strMonth) day=parseInt(strDay) year=parseInt(strYr) if (pos1==-1 || pos2==-1){ alert("Date Format : dd/mm/yyyy") return false } if (strMonth.length<1 || month<1 || month>12){ alert("Please Insert The Right Month") return false } if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){ alert("Please Insert Day") return false } if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){ alert("Please Insert 4 Digit Year Between "+minYear+" and "+maxYear) return false } if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){ alert("Please enter a valid date") return false } return true } function ValidationFormSearch() { var ifp_ic_from = document.adjust.ifp_ic_from var ifp_season = document.adjust.ifp_season var ifp_ic_to = document.adjust.ifp_ic_to var refno = document.adjust.refno var ifp_company = document.adjust.ifp_company if (refno.value =='' && ifp_season.value =='') { alert("Please insert Ref No. & Season!!.") refno.focus() return false } if (refno.value =='' ) { alert("Please insert Ref No. ") refno.focus() return false } if (refno.value !='') { if (ifp_season.value =='') { alert("Please choose SEASON!!.") ifp_season.focus() return false } } if (refno.value !='' && ifp_season !='') { if(ifp_ic_from.value =='') { alert("Please insert From IC No.!!.") ifp_ic_from.focus() return false } if (ifp_ic_to.value =='') { alert("Please insert To IC No!!.") ifp_ic_to.focus() return false } } return true } function validateSave() { var purchase = document.adjust.purchase if(purchase.value =='') { alert("Please Insert Value Before Save!!") purchase.focus return false } return true } function validatePost() { var note = document.adjust.note if(note.value =='') { alert("Please Insert Your Reason In The Note Area!!") note.focus return false } return true } </script> <?php session_start(); include ("../includes/def_cons.php"); include ("../includes/combobox.php"); include ("../includes/inv.persistent.inc.php"); include ("../includes/inv.createdoc.inc.php"); include ("../includes/mxpro.session.php"); /*if(!view_screen(MXPRO_USR_ID,MXPRO_LOC_ID,'mn_iph_27')) { $_SESSION['screen_msg'] = view_screen_msg(); header("Location: ../public_html/mxpro.master.php?ch=6"); exit; }*/ if(!empty($_GET['ifp_company'])) { $ifp_company = $_GET['ifp_company']; } else { $ifp_company = $_SESSION['ifp_company']; } if(!empty($_GET['ifp_season'])) { $ifp_season = $_GET['ifp_season']; } else { $ifp_season = $_SESSION['ifp_season']; } if(!empty($_GET['refno'])) { $refno = $_GET['refno']; } else { $refno = $_SESSION['refno']; } if(!empty($_GET['ifp_id'])) { $ifp_id = $_GET['ifp_id']; } else { $ifp_id = $_SESSION['ifp_id']; } if(!empty($_GET['ifp_ic_from'])) { $ic_from = $_GET['ifp_ic_from']; } else { $ic_from = $_SESSION['ifp_ic_from']; } if(!empty($_GET['ifp_ic_to'])) { $ic_to = $_GET['ifp_ic_to']; } else { $ic_to = $_SESSION['ifp_ic_to']; } $ifp_zone = getrecord("Select iph_zone.iz_id From iph_zone Inner Join org ON org.zon = iph_zone.iz_id WHERE org.id = '".MXPRO_PENGKALAN_ID."'"); if(isset($_POST['Find'])) { $ic_refno=$_POST['ic_refno']; $ic_companyno=$_POST['ic_companyno']; $query="SELECT * FROM iph_correction"; $result=mysql_query($query); $data=1; while($row = mysql_fetch_object($result)) { $ic_refno=$row->ic_refno; $ic_companyno=$row->ic_companyno; if(($ic_refno==$ic_refno) and ($ic_companyno==$ic_companyno)) { $_SESSION['icPatient']=$icPatient; $data=0; header("Location: ../../../../public_html/mxpro.master.php?mnd_code=mn_iph_27&ch=6"); } } if($data==1) { echo "<script language='JavaScript'> alert(' Record is not available. DO you want to register?');</script>"; } } /******************************************************************************************************************/ if(!empty ($refno)) { $ic_refno = $iph_season_refno->ic_refno; $ic_companyno = $iph_season_refno->ic_companyno; $iph_season_refno=new myclass; $iph_season_refno=$iph_season_refno->fetchdata("Select ic_refno,ic_companyno from iph_correction"); } if(($ic_refno != $_SESSION['ic_refno'] && $_GET['ic_refno'] == '') and ($ic_companyno != $_SESSION['ic_companyno'] && $_GET['ic_companyno'] == '')){ ?> <script type="text/javascript">alert("Record is not available. Do you want to register?!!");</script><? } /*******************************************************************************************************************/ if(!empty($refno) && !empty($ifp_season) || (!empty($ic_from) && !empty($ic_to))) { $iph_season_from = new myclass; $iph_season_from = $iph_season_from->fetchdata("Select iph_zone.iz_id, iph_season.is_id, iph_farmer_purchase.ifp_purchase, iph_farmer_purchase.ifp_hectare, iph_farmer_purchase.ifp_org_id, iph_farmer_purchase.ifp_id, o1.ic, o1.orgno, o1.orgname, o1.org_status, iph_note.din_season_code, iph_note.din_process_status, iph_note.din_companyno, iph_note.din_org_id, iph_note.din_id, iph_note.din_no, iph_note.din_status From iph_zone Inner Join iph_season ON iph_season.is_iz_id = iph_zone.iz_id and iph_zone.iz_id = '".$ifp_zone."' Inner Join iph_zone_season ON iph_zone_season.izs_iz_id = iph_zone.iz_id Inner Join iph_farmer_purchase ON iph_zone_season.izs_id = iph_farmer_purchase.ifp_izs_id and iph_zone_season.izs_season = '".$ifp_season."' Inner Join org AS o1 ON iph_farmer_purchase.ifp_org_id = o1.id Inner Join iph_note ON iph_note.din_org_id = o1.id AND iph_season.is_id = iph_note.din_season_id Where o1.ic = '".$ic_from."' AND iph_season.is_current_season = '".$ifp_season."' AND iph_note.din_companyno = '".MXPRO_PENGKALAN_ID."' AND iph_note.din_status NOT IN ('V') AND iph_note.din_process_status != 'RJD'"); //from $ic_from = $iph_season_from->ic; $orgname_from = $iph_season_from->orgname; $orgno_from = $iph_season_from->orgno; $din_season_code = $iph_season_from->din_season_code; $din_status_from = $iph_season_from->din_process_status; $dinno_From = $iph_season_from->din_no; $din_idfrom = $iph_season_from->din_id; $din_company = $iph_season_from->din_companyno; $company = $iph_season_from->companyno; $status_from = $iph_season_from->org_status; $iph_status_from = $iph_season_from->din_status; $is_id_from = $iph_season_from->is_id; $orgid_from = $iph_season_from->ifp_org_id; $ifp_id01 = $iph_season_from->ifp_id; $org_idf = $iph_season_from->din_org_id; $iph_season_to = new myclass; $iph_season_to = $iph_season_to->fetchdata(" Select o1.ic, o1.orgname, o1.orgno, o1.org_status, iph_note.din_season_code, iph_note.din_process_status, iph_note.din_no, iph_note.din_id, iph_note.din_status, iph_note.din_org_id, iph_farmer_purchase.ifp_id, iph_farmer_purchase.ifp_org_id, iph_farmer_purchase.ifp_purchase, iph_season.is_id From iph_zone Inner Join iph_season ON iph_season.is_iz_id = iph_zone.iz_id Inner Join iph_zone_season ON iph_zone_season.izs_iz_id = iph_zone.iz_id Inner Join iph_farmer_purchase ON iph_zone_season.izs_id = iph_farmer_purchase.ifp_izs_id Inner Join org AS o1 ON iph_farmer_purchase.ifp_org_id = o1.id Inner Join iph_note ON iph_note.din_org_id = o1.id AND iph_season.is_id = iph_note.din_season_id Where o1.ic = '".$ic_to."' AND iph_season.is_current_season = '".$ifp_season."' AND iph_note.din_status NOT IN ('V') AND iph_note.din_process_status != 'RJD'"); //to $ic_to = $iph_season_to->ic; $orgname_to = $iph_season_to->orgname; $orgno_to = $iph_season_to->orgno; $din_season_code = $iph_season_to->din_season_code; $din_status_to = $iph_season_to->din_process_status; $iph_status_to = $iph_season_to->din_status; $dinno_To = $iph_season_to->din_no; $din_idto = $iph_season_to->din_id; $ifp_idTo = $iph_season_to->ifp_id; $is_id = $iph_season_to->is_id; $status_to = $iph_season_to->org_status; $orgid_to = $iph_season_to->ifp_org_id; $org_idt = $iph_season_to->din_org_id; } $correction_status = getrecord("Select iph_correction.ic_status From iph_correction Inner Join iph_note ON iph_note.din_id = iph_correction.ic_din_id_01 WHERE iph_note.din_companyno = '".$din_company."'"); $isid=getrecord("Select iph_correction.ic_org_id_01 From iph_correction where iph_correction.ic_org_id_01 = '". $org_idf."' and iph_correction.ic_process_status = 'APD'"); $isid02=getrecord("Select iph_correction.ic_org_id_02 From iph_correction where iph_correction.ic_org_id_02 = '".$org_idt."' and iph_correction.ic_process_status = 'APD'"); $status=getrecord("Select iph_correction.ic_status From iph_correction where iph_correction.ic_org_id_01 = '".$org_idf."'"); $ic_note=getrecord("Select iph_correction.ic_01_requested_remarks From iph_correction where iph_correction.ic_org_id_01 = '".$org_idf."'"); if($ic_from != $_SESSION['ifp_ic_from'] && $_GET['ifp_ic_from'] == '') { ?> <script type="text/javascript">alert("IC From Not In This Season Or Company!!");</script><? } elseif($ic_from == '' && $ic_from != $_GET['ifp_ic_from']) { ?> <script type="text/javascript">alert("IC From Not In This Season Or Company!!");</script><? } if($ic_to != $_SESSION['ifp_ic_to'] && $_GET['ifp_ic_to'] == '') { ?> <script type="text/javascript">alert("IC To Not In This Season!!");</script><? } elseif($ic_to == '' && $ic_to != $_GET['ifp_ic_to']) { ?> <script type="text/javascript">alert("IC To Not In This Season!!");</script><? } /***************************************************************************************************************/ ?> <body> <form method = "post" name = "adjust" action ="../system/iph/module/transaction/iph.purchase.season.adjustment.insert.php"> <table width="99%" align="left"> <tr> <td width="5%"> <table width="849"> <tr> <td> </td> </tr> <tr> <td width="841"><h3 class="lbl">Adjustment Purchase - Season </h3></td> </tr> <tr> <td><table width="100%" class="header_background" > <tr> <td width="500%" colspan="5"><table width="100%" border="0"> <tr class="header_background"> <td>Ref No </td> <td><div align="center">:</div></td> <td><?php if (!empty($refno)) { echo "<input type=hidden name=refno value=\"$refno\" readonly=true> ". $description = $refno; } else { ?> <input type="text" name="refno" value="<?php echo $refno ?>" size="20"> <? } ?></td> <?php if (!empty($refno)) { ?> <td>Season</td> <td><div align="center">:</div></td> <td><?php if (!empty($ifp_season)) { echo "<input type=hidden name=ifp_season value=\"$ifp_season\" readonly=true> ". $description = getrecord("SELECT CONCAT_WS('-',code,description) FROM codemaster_local WHERE code = '".$ifp_season."' AND codeclass = 'season'") ; } else { echo create_new_combobox("SELECT code,CONCAT_WS('-',code,description) FROM codemaster_local WHERE codeclass = 'season' AND code IN (SELECT izs_season FROM iph_zone_season WHERE izs_iz_id = '".$ifp_zone."')","code","ifp_season",$ifp_season ,$date_posted,true); } } ?></td> <td width="33%" colspan="3" align="right"> <?php if (isset ($refno)){?> <input class="button" name="Register" type="submit" value="Register"> <?php }?> <?php if ((!empty($refno) && !empty($ifp_season)) || (!empty($ic_from) && !empty($ic_to))){ ?> <input class="button" name="Clear" type="submit" value="Clear"> <?php } if ((!empty($refno) && !empty($ifp_season)) || (!empty($ic_from) && !empty($ic_to))||(!empty($refno))) { ?> <input class="button" name="Search" type="submit" value="Search" onClick="return ValidationFormFind();"> <?php } ?> <?php if ((empty($refno))) { ?> <input name="Find" type="submit" class="button" id="Find" value="Find" onClick="return ValidationFormSearch();"> <input name="Close" type="submit" class="button" id="Close" value="Close"> <input class="button" name="Clear" type="submit" value="Clear"> </td> <?php }?> </tr> <?php if (!empty($refno) && !empty($ifp_season)) { ?> <tr class="header_background"> <td width="9%"><p>From IC No.</p></td> <td width="1%"><div align="center">:</div></td> <td width="24%"><?php if (!empty($ic_from)) { echo "<input type=hidden name=ifp_ic_from value=\"$ic_from\" readonly=true> ". $description = $ic_from; } else { ?> <input type="text" name="ifp_ic_from" value="<? echo $ic_from; ?>" size="20"> <? } ?></td> <td width="9%">To IC No.</td> <td width="2%"><div align="center">:</div></td> <td width="22%"><?php if (!empty($ic_to)) { echo "<input type=hidden name=ifp_ic_to value=\"$ic_to\" readonly=true> ". $description = $ic_to; } else { ?> <input type="text" name="ifp_ic_to" value="<? echo $ic_to ?>"> <? } ?></td> <td align="right" colspan="3"> </td> </tr><? } ?> </table></td> </tr> </table></td> </tr> </table> </td> </tr> <tr> <td> <div style="width: 900px; height:500px; overflow: auto; padding: 5px"> <table border="0" width="851"> <tr><td><table width="851"> <tr > <td width="843" colspan="6" ><fieldset> <legend>From Farmer Info</legend><table width="691" border="0"> <tr> <td width="1"> </td> <td width="105">Name</td> <td width="5" align="center"> <div align="right">:</div></td> <td colspan="2"><? echo $orgname_from; ?></td> <td width="106">Status</td> <td width="9" align="center"><div align="center"> :</div></td> <td width="207" colspan="2"><?php if (isset($ic_from)) { if ($status_from == 'A') { echo "Active";} else {echo " Not Active";}; } ?></td> </tr> <tr> <td> </td> <td>No IC </td> <td align="center"><div align="center">:</div></td> <td width="216"><? echo $ic_from ?></td> <td width="8"> </td> <td width="106">No. Daftar </td> <td width="9" align="center">:</td> <td width="207" colspan="2"><? echo $orgno_from ?></td> </tr> <tr> <td> </td> <td>IPH No. </td> <td align="center">:</td> <td><? echo $dinno_From; ?></td> <td> </td> <td width="106">Status IPH </td> <td width="9" align="center"><div align="center">:</div></td> <td width="207" colspan="2"><?php if (isset($ic_from)) { if ($iph_status_from == 'P') { echo "POSTED";} elseif ($iph_status_from == 'V') { echo "VERIFIED";} elseif ($iph_status_from == 'N') { echo "NEW";} } ?></td> </tr> <tr> <td> </td> <td> </td> <td align="center"> </td> <td> </td> <td> </td> <td> </td> <td align="center"> </td> <td colspan="2"> </td> </tr> </table> <br> </fieldset></td> </tr> </table></td></tr> <tr><td> </td></tr> <tr><td><table width="851"> <tr> <td width="843" colspan="6"><fieldset> <legend>To Farmer Info</legend><table width="691" border="0"> <tr> <td width="1"> </td> <td width="106">Name</td> <td width="6" align="center"> <div align="right">:</div></td> <td colspan="2"><? echo $orgname_to; ?></td> <td width="103">Status</td> <td width="10" align="center"><div align="center"> :</div></td> <td width="202" colspan="2"><?php if (isset($ic_to)) { if ($status_to == 'A') { echo "Active";} else {echo " Not Active";} } ?></td> </tr> <tr> <td> </td> <td>No IC </td> <td align="center"><div align="center">:</div></td> <td width="218"><?php echo $ic_to ?></td> <td width="11"> </td> <td width="103">No. Daftar </td> <td width="10" align="center">:</td> <td width="202" colspan="2"><?php echo $orgno_to ?></td> </tr> <tr> <td> </td> <td>IPH No. </td> <td align="center">:</td> <td><? echo $dinno_To; ?></td> <td> </td> <td width="103">Status IPH </td> <td width="10" align="center"><div align="center">:</div></td> <td width="202" colspan="2"><?php if (isset($ic_from)) { if ($iph_status_to == 'P') { echo "POSTED";} elseif ($iph_status_to == 'V') { echo "VERIFIED";} elseif ($iph_status_to == 'N') { echo "NEW";} } ?></td> </tr> <tr> <td> </td> <td>IPH No. New </td> <td align="center">:</td> <td> </td> <td> </td> <td> </td> <td align="center"> </td> <td colspan="2"> </td> </tr> </table> </table></td></tr> <tr><td> </td></tr> <tr><td><table width="841"> <tr><td width="833"><fieldset> <table width="827" border="0"> <tr class="header_background"> <td width="23" rowspan="4"> </td> <td width="62" rowspan="4"><div align="center">Season</div></td> <td height="25" colspan="2"><div align="center">From</div></td> <td colspan="2"><div align="center">To</div></td> </tr> <tr class="header_background"> <td width="76" height="24">Name</td> <td width="272"><? echo $orgname_from; ?></td> <td width="82">Name</td> <td width="286"><? echo $orgname_to; ?></td> </tr> <tr class="header_background"> <td height="23">No Daftar </td> <td colspan="-1"><? echo $orgno_from ?></td> <td>No Daftar </td> <td><? echo $orgno_to ?></td> </tr> <tr class="header_background"> <td colspan="2"><table width="325" border="0"> <tr bgcolor="#FFFFCC"> <td width="152"><div align="center">Purchase</div></td> <td width="161"><div align="center">Hectare</div></td> </tr> </table></td> <td colspan="2"><table width="325"> <tr bgcolor="#FFFFCC"> <td width="152"><div align="center">Purchase</div></td> <td width="161"><div align="center">Hectare</div></td> </tr> </table></td> </tr> <?php $season_result = "Select iph_fp01.ifp_id as id_from, iph_fp01.ifp_org_id as org_id_from, iph_fp01.ifp_season, iph_fp01.ifp_izs_id, iph_fp01.ifp_hectare as hectare_from, iph_fp01.ifp_purchase as purchase_from, iph_fp02.ifp_id as id_to, iph_fp02.ifp_org_id as org_id_to, iph_fp02.ifp_hectare as hectare_to, iph_fp02.ifp_purchase as purchase_to From iph_previous_season Inner Join iph_season ON iph_previous_season.ips_season_id = iph_season.is_id AND iph_season.is_id = '".$is_id_from."' Inner Join iph_zone_season ON iph_season.is_iz_id = iph_zone_season.izs_iz_id AND iph_zone_season.izs_season = iph_previous_season.ips_season_code Inner Join iph_farmer_purchase as iph_fp01 ON iph_zone_season.izs_id = iph_fp01.ifp_izs_id AND iph_fp01.ifp_org_id = '".$orgid_from."' Left Join iph_farmer_purchase as iph_fp02 ON iph_fp02.ifp_izs_id = iph_fp01.ifp_izs_id AND iph_fp02.ifp_org_id = '".$orgid_to."'"; $n = 0; $clr = 0; $season_result = mysql_query($season_result); if ($row = mysql_num_rows($season_result)>0) { while ($iph_farmer_from =mysql_fetch_object($season_result)) { ?> <tr <?php if($clr == 0){echo "bgcolor=#E8EFF0";}else{echo "bgcolor=#FFFFCC";} ?>> <td><?php echo $n+1 ?></td> <td align="center"><?php if($status == 'N' && isset($isid)){?> <a href='../public_html/mxpro.master.php?mnd_code=mn_iph_27&ch=6&edit=1&ifp_season=<? echo $ifp_season;?>&ifp_ic_from=<? echo $ic_from;?>&ifp_ic_to=<? echo $ic_to;?>&refno=<? echo $refno;?>&ifp_company=<? echo $ifp_company?>&season=<? echo $iph_farmer_from->ifp_season;?>&purchase=<? echo $iph_farmer_from->purchase_from; ?>&purchase2=<? echo $iph_farmer_from->purchase_to; ?>&orgid_from=<? echo $iph_farmer_from->org_id_from;?>&orgid_to=<? echo $iph_farmer_from->org_id_to;?>&id_from=<? echo $iph_farmer_from->id_from?>&id_to=<? echo $iph_farmer_from->id_to; ?>'> <? echo $iph_farmer_from->ifp_season;?></a> <? } else { echo $iph_farmer_from->ifp_season; } ?> <input type="hidden" name="season_id" value="<? echo $iph_farmer_from->din_season_id; ?>"></td> <td colspan="2"><table width="325" border="0"> <tr> <td width="152"><div align="center"><?php echo number_format($iph_farmer_from->purchase_from,'2','.',',') ?></div></td> <td width="161"><div align="center"><? echo $iph_farmer_from->hectare_from;?></div></td> </tr> </table></td> <td colspan="2"><table width="325" border="0"> <tr> <td width="152"><div align="center"><? echo number_format($iph_farmer_from->purchase_to,'2','.',','); ?></div></td> <td width="161"><div align="center"><? echo $iph_farmer_from->hectare_to; ?></div></td> </tr> </table></td> </tr> <?php if($clr == 0){$clr = 1;}else{$clr = 0;} ?> <?php $n++;};}else{echo "No Record";};?> </table></fieldset></td></tr></table></td></tr> <tr><td><table width="830" border="0"> <tr> <td align="right"><?php if (!empty($ic_from) && !empty($ic_to) && (!isset($isid)) && (!isset($isid02))){ ?> <input type="hidden" name="din_id" value="<? echo $din_idfrom;?>"> <input type="hidden" name="is_id" value="<? echo $is_id_from;?>"> <input type="hidden" name="companyno" value="<? echo $din_company;?>"> <input type="hidden" name="org_id" value="<? echo $org_idf ;?>"> <input type="hidden" name="din_idto" value="<? echo $din_idto;?>"> <input type="hidden" name="org_idto" value="<? echo $org_idt ;?>"> <input type="hidden" name="ifp_id_from" value="<? echo $ipa_ifp_id_from;?>"> <input type="hidden" name="din_id_from" value="<? echo $ipa_din_id_from;?>"> <input type="hidden" name="din_id_to" value="<? echo $ipa_din_id_to;?>"> <input type="hidden" name="refno" value="<? echo $refno;?>"> <input name="Proceed" type="submit" class="button" id="Proceed" value="Proceed" /> <? } ?></td> </tr> </table></td></tr> <tr><td><?php if(isset($isid) && isset($isid02)) { ?> <table width="836"> <tr><td width="841"> <fieldset><legend>Edited Purchase : </legend> <table width="828" border="0"> <tr class="header_background"> <td width="50" rowspan="4"><div align="center">Season</div></td> <td height="25" colspan="2"><div align="center">From</div></td> <td colspan="2"><div align="center">To</div></td> </tr> <tr class="header_background"> <td width="67" height="24">Name</td> <td width="294" colspan="-1"><? echo $orgname_from; ?></td> <td width="78">Name</td> <td width="312"><? echo $orgname_to; ?></td> </tr> <tr class="header_background"> <td height="23">No Daftar </td> <td colspan="-1"><? echo $orgno_from ?></td> <td>No Daftar </td> <td><? echo $orgno_to ?></td> </tr> <tr class="header_background"> <td colspan="2"><table width="371" border="0"> <tr bgcolor="#FFFFCC"> <td width="120"><div align="center">Purchase</div></td> <td width="131"><div align="center">New Purchase</div></td> <td width="106"><div align="center">Hectare</div></td> </tr> </table></td> <td colspan="2"><table width="393"> <tr bgcolor="#FFFFCC"> <td width="84"><div align="center">( - )</div></td> <td width="97"><div align="center">Purchase</div></td> <td width="114"><div align="center">New Purchase</div></td> <td width="78"><div align="center">Hectare</div></td> </tr> </table></td> </tr> <?php $purc_edited = "Select iph_farmer_purchase01.ifp_hectare as ifp_hectare01, iph_farmer_purchase02.ifp_hectare as ifp_hectare02, iph_farmer_purchase01.ifp_purchase as ifp_purchase01, iph_farmer_purchase02.ifp_purchase as ifp_purchase02, iph_farmer_purchase01.ifp_season as ifp_season, ic_detail.icd_01_add_minus from iph_correction_detail as ic_detail Inner Join iph_correction as icorr On ic_detail.icd_ic_id = icorr.ic_id Inner Join iph_farmer_purchase as iph_farmer_purchase01 On icorr.ic_org_id_01 = iph_farmer_purchase01.ifp_org_id Inner Join iph_farmer_purchase as iph_farmer_purchase02 On icorr.ic_org_id_02 = iph_farmer_purchase02.ifp_org_id where ic_detail.icd_ic_id = '".getrecord("Select ic_id from iph_correction where ic_org_id_01 = '".$orgid_from."'")."' AND ic_detail.icd_01_ifp_id = iph_farmer_purchase01.ifp_id AND ic_detail.icd_02_ifp_id = iph_farmer_purchase02.ifp_id group by ic_detail.icd_id"; $k = 0; $clr = 0; $purc_edited = mysql_query($purc_edited); if ($row = mysql_num_rows($purc_edited)>0) { while ($list_purc_edited =mysql_fetch_object($purc_edited)) { ?> <tr <?php if($clr == 0){echo "bgcolor=#FFFFCC";}else{echo "bgcolor=#FFFFDF";} ?>> <td align="center"><? echo $list_purc_edited->ifp_season;?></td> <td colspan="2"><table width="371" border="0"> <tr> <td width="117" align="center"><? echo number_format($list_purc_edited->ifp_purchase01,2,'.',','); ?></td> <td width="134"><div align="center"><? echo number_format($new_purchase = ($list_purc_edited->ifp_purchase01 + ($list_purc_edited->icd_01_add_minus * -1)),2,'.',',');?></div></td> <td width="106"><div align="center"><? echo $list_purc_edited->ifp_hectare01;?></div></td> </tr> </table></td> <td colspan="2"><table width="390" border="0"> <tr> <td width="85" align="center"><? echo number_format($list_purc_edited->icd_01_add_minus,2,'.',',');?></td> <td width="98" align="center"><? echo number_format($list_purc_edited->ifp_purchase02,2,'.',','); ?></td> <td width="114"><div align="center"><? echo number_format($new_purchase2 = ($list_purc_edited->ifp_purchase02 - ($list_purc_edited->icd_01_add_minus * -1)),2,'.',',');?></div></td> <td width="75"><div align="center"><? echo $list_purc_edited->ifp_hectare02;?></div></td> </tr> </table></td> </tr> <?php if($clr == 0){$clr = 1;}else{$clr = 0;} ?> <?php $k++;};}else{echo "No Record";};?> </table></fieldset></td></tr></table> <p> </p> <table> <tr><td width="705"> <?php if(isset($edit)){ $ic_id = getrecord("Select ic_id from iph_correction where ic_org_id_01 = '".$_GET['orgid_from']."' AND ic_org_id_02 = '".$_GET['orgid_to']."'"); $iphc_details = new myclass; $iphc_details = $iphc_details->fetchdata("select icd_id, icd_01_add_minus, icd_01_ifp_purchase, icd_02_ifp_purchase from iph_correction_detail where icd_01_ifp_id = '".$_GET['id_from']."' and icd_02_ifp_id = '".$_GET['id_to']."'"); ?> <fieldset><legend>Edit Purchase : </legend> <table width="704" border="0"> <tr class="header_background"> <td width="62" rowspan="2"><div align="center">Season</div></td> <td height="25" colspan="2"><div align="center">From</div></td> <td colspan="3"><div align="center">To</div></td> </tr> <tr class="header_background"> <td width="104" height="23"><div align="center">Purchase </div></td> <td width="114" colspan="-1"><div align=& Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.