PHP - Como enviar una pagina por email ayuda!!

 
Vista:
sin imagen de perfil
Val: 17
Ha disminuido su posición en 178 puestos en PHP (en relación al último mes)
Gráfica de PHP

Como enviar una pagina por email ayuda!!

Publicado por Pablo Javier (23 intervenciones) el 14/10/2015 22:05:58
Estimados, tengan un buen día, su gentil ayuda por favor.

Les comento que tengo una duda y problema q no puedo resolver, tengo una pagina que quiero enviar completa por correo a una persona que esta dentro de un resultado en dicha pagina, este es el código, gracias.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?php $totalServico = 0; $totalProdutos = 0;?>
<div class="row-fluid" style="margin-top: 0">
    <div class="span12">
        <div class="widget-box">
            <div class="widget-title">
                <span class="icon">
                    <i class="icon-tags"></i>
                </span>
                <h5>Orden de Servicio</h5>
                <div class="buttons">
                    <?php if($this->permission->checkPermission($this->session->userdata('permissao'),'eOs')){
                        echo '<a title="Icon Title" class="btn btn-mini btn-info" href="'.base_url().'index.php/os/editar/'.$result->idOs.'"><i class="icon-pencil icon-white"></i> Editar</a>';
                    } ?>
 
                    <a id="imprimir" title="Imprimir" class="btn btn-mini btn-inverse" href=""><i class="icon-print icon-white"></i> Imprimir</a>
					//Lo que trato de hacer es que este boton me envie el contenido de esta pagina completa al correo del técnico o responsable que aparece en la orden// 
					<input name="submit" type="submit" value="Enviar" />
					</div>
            </div>
            <div class="widget-content" id="printOs">
                <div class="invoice-content">
                  <div class="invoice-head" style="margin-bottom: 0"><img src="../../../img/logofactura.jpg" alt="1" />
 
                        <table class="table">
                            <tbody>
                                <?php if($emitente == null) {?>
 
                                <tr>
                                    <td colspan="3" class="alert">Debe configurar los datos de la Empresa. >>><a href="<?php echo base_url(); ?>index.php/mapos/emitente">Configurar</a><<<</td>
                                </tr>
                                <?php } else {?>
                                <tr>
 
                                    <td width="59%"> <span style="font-size: 20px; "> <?php echo $emitente[0]->nome; ?></span> </br>
									<span> RUC: <?php echo $emitente[0]->cnpj; ?> </br>
                                    <?php echo $emitente[0]->rua.', '.$emitente[0]->numero; ?> </span> </br>
									<span> <?php echo $emitente[0]->bairro.' - '.$emitente[0]->cidade; ?> </br>
                                        <span> Tel.: <?php echo $emitente[0]->telefone; ?>  </span></br>										<span> E-mail: <?php echo $emitente[0]->email; ?></span></td>
                                  <td width="41%" style="width: 18%; text-align: center"></br>#O.S/Reparación: <span ><?php echo $result->idOs?></span> </br> <span>Fecha Inicio: <?php echo date('d/m/Y',  strtotime($result->dataInicial))?></span> </br> <span>Fecha Cierre: <?php echo date('d/m/Y',  strtotime($result->dataFinal))?></span>                                </tr>
 
                                <?php } ?>
                            </tbody>
                        </table>
 
 
                        <table width="802" height="120" class="table">
                            <tbody>
                                <tr>
                                    <td height="120" style="width: 50%; padding-left: 0">
                                        <ul>
                                            <li>
                                              <h5>Cliente
                                            </h5>
                                            </li>
                                      </ul>
                                        <div align="left"><span><?php echo $result->nomeCliente?></span><br/>
                                          <span><?php echo $result->rua?>, <?php echo $result->numero?></span><br/>
                                          <span><?php echo $result->bairro?>, <?php echo $result->cidade?></span><br/>
                                          <span><?php echo $result->telefone?></span></div></td>
                                    <td style="width: 50%; padding-left: 0">
                                        <ul>
                                            <li>
                                              <h5 align="right"><span>Técnico / Responsable</span></h5>
                                              <div align="right"><span><?php echo $result->nome?></span> <br/>
                                                  <span>Email: <?php echo $result->email?></span></div>
                                            </li>
                                        </ul>                                    </td>
                                </tr>
                            </tbody>
                    </table>
 
                  </div>
 
                    <div style="margin-top: 0; padding-top: 0">
                      <?php if($result->descricaoProduto != null){?>
                      <hr style="margin-top: 0" />
                      <h5>Descripción</h5>
                      <p> <?php echo $result->descricaoProduto?> </p>
                      <?php }?>
                      <?php if($result->status != null){?>
  <hr style="margin-top: 0">
                      <table width="749">
                        <tr>
                          <td width="244"><h5>Estado</h5>
                      <p>
                        <?php echo $result->status?>                        </p>
 
                    <?php }?>
 
                            <?php if($result->defeito != null){?></td>
      <td width="265"><h5>Defecto</h5>
                      <p>
                        <?php echo $result->defeito?>                  </p>
                      <?php }?>
        <?php if($result->laudoTecnico != null){?></td>
      <td width="224"><h5>Diagnóstico Técnico</h5>
        <p> <?php echo $result->laudoTecnico?> </p>
        <?php }?>
        <?php if($result->observacoes != null){?></td>
                        </tr>
  </table>
 
 
 
                    <hr style="margin-top: 0">
                    <h5>Observaciones</h5>
                      <p> <?php echo $result->observacoes?> </p>
                      <?php }?>
                      <?php if($produtos != null){?>
                      <hr style="margin-top: 0" />
                      <table class="table table-bordered" id="tblProdutos">
                        <thead>
                          <tr>
                            <th>Producto</th>
                                              <th>Cantidad</th>
                                              <th>Total</th>
                          </tr>
                        </thead>
                        <tbody>
                          <?php
 
                                        foreach ($produtos as $p) {
 
                                            $totalProdutos = $totalProdutos + $p->subTotal;
                                            echo '<tr>';
                                            echo '<td>'.$p->descricao.'</td>';
                                            echo '<td>'.$p->quantidade.'</td>';
 
                                            echo '<td>$ '.number_format($p->subTotal,2,',','.').'</td>';
                                            echo '</tr>';
                                        }?>
 
                          <tr>
                            <td colspan="2" style="text-align: right"><strong>SubTotal:</strong></td>
                                              <td><strong>$<?php echo number_format($totalProdutos,2,',','.');?></strong></td>
                          </tr>
                        </tbody>
                      </table>
                                 <?php }?>
 
                      <?php if($servicos != null){?>
                      <table class="table table-bordered">
                        <thead>
                          <tr>
                            <th>Servicio</th>
                                                  <th>Total</th>
                          </tr>
                        </thead>
                        <tbody>
                          <?php
                                        setlocale(LC_MONETARY, 'en_US');
                                        foreach ($servicos as $s) {
                                            $preco = $s->preco;
                                            $totalServico = $totalServico + $preco;
                                            echo '<tr>';
                                            echo '<td>'.$s->nome.'</td>';
                                            echo '<td>$ '.number_format($s->preco, 2, ',', '.').'</td>';
                                            echo '</tr>';
                                        }?>
 
                          <tr>
                            <td colspan="1" style="text-align: right"><strong>SubTotal:</strong></td>
                                              <td><strong>$<?php  echo number_format($totalServico, 2, ',', '.');?></strong></td>
                          </tr>
                        </tbody>
                      </table>
                          <?php }?>
                      <hr />
                      <td colspan="1" style="text-align: right"><div align="right"><strong>I.V.A 12%</strong></div></td>
                          <h4 style="text-align: right">Valor Total: $ <?
function iva($sin_iva) {
$iva = 12;
$con_iva = $sin_iva + ($iva*($sin_iva/100));
$con_iva = round($con_iva, 2);
return $con_iva;
}
$sin_iva = $totalProdutos + $totalServico;
echo iva($sin_iva);
?></h4>
 
                  </div></div>
            </div>
        </div>
    </div>
</div>
 
<script type="text/javascript">
    $(document).ready(function(){
        $("#imprimir").click(function(){
            PrintElem('#printOs');
        })
 
        function PrintElem(elem)
        {
            Popup($(elem).html());
        }
 
        function Popup(data)
        {
            var mywindow = window.open('', 'RMA/OS', 'height=600,width=800');
            mywindow.document.write('<html><head><title>RMA/OS</title>');
            mywindow.document.write("<link rel='stylesheet' href='<?php echo base_url();?>assets/css/bootstrap.min.css' />");
            mywindow.document.write("<link rel='stylesheet' href='<?php echo base_url();?>assets/css/bootstrap-responsive.min.css' />");
            mywindow.document.write("<link rel='stylesheet' href='<?php echo base_url();?>assets/css/matrix-style.css' />");
            mywindow.document.write("<link rel='stylesheet' href='<?php echo base_url();?>assets/css/matrix-media.css' />");
 
 
            mywindow.document.write("</head><body >");
            mywindow.document.write(data);
 
            mywindow.document.write("</body></html>");
 
            mywindow.print();
            mywindow.close();
 
            return true;
        }
 
    });
</script>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder