<p>Untitled Document <!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12; }
.style4 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style6 {font-size: 12px}
.style7 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
.style8 {font-size: 12pt}
-->
<script type="text/javascript"></script>
</p>
<p class="style3"><span class="style4"><span class="style6"><span class="style8"><span class="style6"><strong>MCR5 -How to create a access log<strong> </strong><br /></strong><br /><strong>Application Name:</strong> login_acess_log<br /><strong>Description:</strong> Login Application with user validate method and generate of a access log. <br /><strong><span class="style1"><span class="style2"><span class="style4"><span class="style2"><strong>Fields that will be displayed in the control</strong></span></span></span></span>:</strong> <br />login, password, date_hour<br /><strong>Table width:</strong> 0 <br /><strong>Table width unit:</strong> Automatic<br /><strong>Header -&gt; Application Title:</strong> using log de acesso</span></span></span></span></p>
<table border="0">
<tbody>
<tr>
<td class="style7" width="194"><strong>onValidate Event:</strong></td>
</tr>
<tr>
<td class="style7">$valid = userValidate();<br />if($valid!=@@##ok@@##){<br />sc_error_message($valid);<br />}<br /></td>
</tr>
</tbody>
</table>
<p><span class="style7"><br /></span></p>
<table border="1" cellspacing="0" width="638" bordercolor="#666666">
<tbody>
<tr>
<td class="style7" width="188" height="23"><strong class="style1">New Method:</strong></td>
<td class="style7" width="434">userValidate</td>
</tr>
<tr>
<td class="style7">
<p><strong><br />Code:</strong></p>
</td>
<td class="style7">sc_lookup(ds,"Select count(*) from seg_users where login=@@##{login}@@## and password=@@##{password}@@##");<br />if({ds[0][0]}&lt;=0){<br />sc_error_message("Invalid User or Password!");<br />}<br />else<br />{<br />sc_lookup(ds2,"Select max(log_id) 1 from seg_logs");<br />$id={ds2[0][0]};<br />sc_exec_sql("Insert into seg_logs values($id,@@##log_acesso@@##,@@##{date_hour}@@##,@@##{login}@@##,null)");<br />echo "
<script type="text/javascript"><!--
alert(@@##Login successful!@@##)
// --></script>
";<br />}<br /></td>
</tr>
</tbody>
</table>
<p class="style7"><strong>Application Name:</strong> menu_exit_logs <br /><strong>Description:</strong> Menu Application calling another applications<br /><strong>Orientation:</strong> Horizontal <br /><strong>Applications called through menu:</strong> <br />customers_cons, suppliers_cons, products_cons, customers_cad_frm, suppliers_cad_frm, products_cad_frm, cons_logs. <br /><strong><span class="style4"><span class="style6"><span class="style8"><span class="style6"><strong>Header -&gt; Application Title</strong></span></span></span></span>:</strong> Menu Application calling another applications</p>