23/09/2005, 17:47
|
| | | Fecha de Ingreso: abril-2005
Mensajes: 124
Antigüedad: 19 años, 7 meses Puntos: 0 | |
//slice_sm_6_4.php
<?php
require('slice_methods_6.php');
$num_igual="";
if(isset($_SESSION['invoice_id']))
{
$cq="select * from client_prop_inv where client_invoice_id={$_SESSION['invoice_id']}";
$ra=mysql_query($cq) or die("ERROR EN PROPOSAL_VAR ".mysql_error().$cq);
$ws=mysql_fetch_array($ra);
if($ws['numero']!="") {
$guion = "-".$ws['numero'];
}
}
//
if( $_SESSION['prop_invoice']!="" and $nadd==0 or $nadd=="" and $_SESSION['prop_invoice']!="" )
{
$var_S = explode(PARSER,$_SESSION['prop_invoice']);
$id_1_pro = $var_S[0];
$id_2_num = $var_S[1];
////////////////////////////////
$cq="select * from client_prop_inv where client_proposal_id=".$id_1_pro." ";
$ra=mysql_query($cq) or die("ERROR EN PROPOSAL_VAR ".mysql_error().$cq);
if(mysql_num_rows($ra)!=0)//2 o 1 0 3
{
$ws=mysql_fetch_array($ra);
$_id_cii = $ws['client_invoice_id'];
$ca="select nro from client_invoice where id =".$_id_cii." and estatus ='E'";
$ro=mysql_query($ca) or die("ERROR AL SELECCIONAR INVOICE".mysql_error().$ca);
$fs=mysql_fetch_array($ro);
$num_igual = $fs['nro'];
}
/////////////////////////////////
$consul="select * from client_prop_inv where client_proposal_id=".$id_1_pro." and numero=".$id_2_num."";
$resulta=mysql_query($consul) or die("ERROR EN PROPOSAL_VAR ".mysql_error().$consul);
if(mysql_num_rows($resulta)!=0)
{
$rows=mysql_fetch_array($resulta);
$consulta="select * from client_invoice where id =".$rows['client_invoice_id']." and estatus ='E'";
$resultado=mysql_query($consulta) or die("ERROR AL SELECCIONAR CLIENT_PROPOSAL".mysql_error().$consulta);
$filas=mysql_fetch_array($resultado);
$_SESSION['invoice_id']=$filas['id'];
}
$guion = "-".$id_2_num;
}
////////////////////////////////////////////////////////////////////////////////
$ver_data=false;
//---------------Cambios al Submitar sobre esta misma pagina
$query="select items.id,items.nombre from items,item_profile where items.id =item_profile.items_id and slices_id =".$_SESSION['slices_id'];
$result=mysql_query($query);
//$_SESSION['clients_id'];
if(!isset($fase))
{
$qy = "select max(nro + 1) as idmax from client_invoice";
$rt=mysql_query($qy);
$rw=mysql_fetch_array($rt);
}
if($_SESSION['invoice_id']!=''){
$que2="select * from client_invoice where id=".$_SESSION['invoice_id'];
$res2=mysql_query($que2)or die("error al seleccionar".mysql_error());
$fil2=mysql_fetch_array($res2);
$addr = explode(PARSER,$fil2['direccion']);
$_inv["addr1"] = $addr[0];
$_inv["addr2"] = $addr[1];
$_inv["date1"] = date("m/d/y",strtotime($fil2["sdate"]));
$_inv["date2"] = date("m/d/y",strtotime($fil2["kdate"]));
}
//////////////////////////////////////////////////////////////////////////////////////
if($_SESSION['invoice_id']!='')
{
if($num_igual==''){
$num_igual=$fil2['nro'];
}
}else{
if($num_igual==''){
if($rw['idmax']=='' or $rw['idmax']==0){$rw['idmax']=1;}
$num_igual = formato_num($rw['idmax']);
}
}
// enviar datos a la pagina de invoice
if($_SESSION['invoice_id']==''){
$qr_i="SELECT * FROM client_profile WHERE slices_id=".$_SESSION['slices_id']." and clients_id=".$_SESSION['clients_id'];
$rs_i = mysql_query($qr_i) or die("<strong>lectura de clients profile<pre>".mysql_error()."</pre></strong>");
$row_i = mysql_fetch_array($rs_i, MYSQL_ASSOC);
$dir_i = explode(PARSER,$row_i['address']);
}
?>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function close_invoice()
{
document.getElementById('dat_send').name="cambia_c lient_estado";
document.getElementById('dat_send').value = <?php if(isset($_SESSION['prop_invoice'])and($_SESSION['prop_invoice']!="")){ echo "3";} else { echo "1";}?>;
mayopi_carga('send_data','self');
}
function refresca()
{
document.location.href="<?php echo HOME_DIR;?>";
// mayopi_carga('send_data','self');
}
//agregar items al iframe(como)
function add_items()
{
var sip;
sip = document.getElementById('si').value;
if(sip=="ALL")
{
//en caso dse que no selecccione nada
alert('<?php echo MSG_6_43;?>');
}else if(sip=="00"){
//en caso de seleccione other
invo_6.document.getElementById('id_v').value='all' ;
invo_6.submita_add();
}else{
//en caso de seleccione un items
id_i = document.getElementById('si').value;
invo_6.document.getElementById('id_v').value=id_i;
//en caso de q sea add
var w=true;
//alert(xxxx);
//en caso de q sea leido
xxxxx = invo_6.document.getElementById('items_cod').value;
if(xxxxx!='')
{
for(i=1;i<xxxxx;i++)
{
if(invo_6.document.getElementById('id_i'+i).value= =id_i)
{
//alert("hay igual a ti");
invo_6.document.getElementById('q'+i).value=parseF loat(invo_6.document.getElementById('q'+i).value) + 1;
invo_6.document.getElementById('q'+i).focus();
invo_6.subtotal();
w=false;
break;
}
}
}
xxxx = invo_6.document.getElementById('items_cod1').value ;
if((xxxx!='') && (w==true))
{
for(i=1;i<xxxx;i++)
{
if(invo_6.document.getElementById('id_i'+i).value= =id_i)
{
//alert(" aca ta,mbiuehay igual a ti");
invo_6.document.getElementById('q'+i).value=parseF loat(invo_6.document.getElementById('q'+i).value) + 1;
invo_6.document.getElementById('q'+i).focus();
invo_6.subtotal();
w=false;
break;
}
}
}
if(w){
invo_6.submita_add();
}
}
}
//************************************************** ***//
function copy_inv()
{
if(confirm("<?php echo MSG_6_109;?>"))
{
document.getElementById('dat_send').name="action_i ";
document.getElementById('dat_send').value = "copy";
mayopi_carga('send_data','self');
}
}
//************************************************** ****//
<?php if(isset($_SESSION['invoice_id'])) {?>
function borra_invoice()
{
if(confirm('<?php echo MSG_6_65;?>'))
{
document.getElementById('dat_send').name="action_i ";
document.getElementById('dat_send').value = "delete";
mayopi_carga('send_data','self');
}
}
function fPdfInvoice(n)
{
switch(n)
{
case 1: //E-mail PopUp
var Tp = findPosY(document.getElementById('xx0'))+50;
var Lp = findPosX(document.getElementById('xx0'))+250;
iPopUp("index.php?page_code=600&facid=<?php echo $_SESSION['invoice_id'];?>&type=invoice",290,222,Lp,Tp);
break;
case 2: // Download File
bajar_pdf.location.href="pdf_invoice.php?facid=<?p hp echo $_SESSION['invoice_id'];?>";
break;
}
}
<?php }?>
//-->
</SCRIPT>
<form id="data_profile">
<table cellpadding="0" cellspacing="0" border="0" width="637">
<tr>
<td width="1" bgcolor="#ffffff"><img src="images/nothing.gif" width="1" height="1" border="0"></td>
<td width="635" colspan="3" bgcolor="#999999"><img src="images/nothing.gif" width="1" height="1" border="0"></td> <td width="1" bgcolor="#ffffff"><img src="images/nothing.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td rowspan="3" width="1" bgcolor="#999999"><img src="images/nothing.gif" width="1" height="1" border="0"></td>
<td bgcolor="#FF7C80" colspan="2"><img src="images/nothing.gif" width="1" height="1" border="0"></td>
<td bgcolor="#FF7C80" rowspan="3" align="left" valign="middle"><?if($_SESSION['invoice_id']!=''){?><img src="images/copy.gif" alt="" width="16" height="16" border="0" title="<?php echo MSG_6_108;?>" onclick="copy_inv();" style="cursor:pointer;"><?}?></td>
<td rowspan="3" width="1" bgcolor="#999999"><img src="images/nothing.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td bgcolor="#FF7C80" colspan="2"><img src="images/nothing.gif" width="610" height="2" border="0"></td>
</tr>
<tr>
<td valign="top" align="left" bgcolor="#FF7C80" class="b12" style="color:white;"><img src="images/nothing.gif" width="9" height="1" border="0"><strong><?php echo MSG_6_66;?></strong></td>
<td valign="top" align="right" bgcolor="#FF7C80" class="b12" style="color:white;"><table cellpadding="0" cellspacing="0" border="0"><tr><td><input readonly="true" type="Text" name="id_num" id="id_num" class="b12" style="background-color:#FF7C80;border:0;color:white;text-align:right;" value="<?echo $num_igual;?>"></td><td bgcolor="#FF7C80" class="b12" style="color:white;font-size:13px;"><?echo $guion;?> </td></tr></table></td>
</tr>
<tr>
<td bgcolor="#999999" colspan="5"><img src="images/nothing.gif" width="1" height="1" border="0"></td>
</tr>
<tr>
<td colspan="5">
<table cellpadding="0" cellspacing="0" border="0" width="637">
<tr>
<td width="1" bgcolor="#999999"><img src="images/nothing.gif" width="1" height="1" border="0"></td>
<td width="635" bgcolor="#ffffff" height="335" valign="top">
<!---- Tabla de Data del proposal client
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
-->
<table cellpadding="0" cellspacing="0" border="0" bgcolor="#ffffff"> |