Server IP : 180.180.241.3 / Your IP : 216.73.216.252 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /AppServ/www/news/tmp/install_53214838987c8/site/views/updtimage/tmpl/ |
Upload File : |
<?php /*------------------------------------------------------------------------ # Timage # ------------------------------------------------------------------------ # author Trust Elegance # copyright Copyright (C) 2012 trustelegance.com. All Rights Reserved. # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL # Websites: http://www.trustelegance.com # Technical Support: http://http://www.trustelegance.com/index.php?option=com_rsform&view=rsform&Itemid=55 -------------------------------------------------------------------------*/ defined('_JEXEC') or die('Restricted access'); JHtml::_('behavior.keepalive'); JHtml::_('behavior.formvalidation'); JHtml::_('behavior.tooltip'); $id = JRequest::getVar('id'); $db =& JFactory::getDBO(); $result_logo = null; $query="SELECT * FROM #__timage WHERE id='".$id."'"; $db->setQuery($query); $result_logo = $db->loadObject(); if( $_POST ){ if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 2000000)) { if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br />"; } else { $filename = str_replace(' ', '_', $_FILES["file"]["name"]); if (file_exists("components/com_timage/assets/images/uploads/upload_" . $filename )) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "components/com_timage/assets/images/uploads/upload_" . $filename ); echo "<h3>The image is uploaded!</h3>"; unset ($_POST); } } } else { echo "Invalid file"; } } $files = scandir('components/com_timage/assets/images/uploads'); $ignore = array( 'cgi-bin', '.', '..' ); $Result_data= isset($_REQUEST['Result']) ? $_REQUEST['Result'] : ""; $user =& JFactory::getUser(); $userid=$user->get('id'); $app = JFactory::getApplication(); if($Result_data){ if($userid){ $htmlcontents='<html> <head> <link type="text/css" href="'.JURI::base().'media/com_timage/css/site.stylesheet.css" rel="stylesheet"> <link type="text/css" href="'.JURI::base().'templates/system/css/system.css" rel="stylesheet"> <link media="screen,projection" type="text/css" href="'.JURI::base().'templates/beez5/css/position.css" rel="stylesheet"> <link media="screen,projection" type="text/css" href="'.JURI::base().'templates/beez5/css/layout.css" rel="stylesheet"> <link media="Print" type="text/css" href="'.JURI::base().'templates/beez5/css/print.css" rel="stylesheet"> <link type="text/css" href="'.JURI::base().'templates/beez5/css/beez5.css" rel="stylesheet"> <link type="text/css" href="'.JURI::base().'templates/beez5/css/general.css" rel="stylesheet"> <link type="text/css" href="'.JURI::base().'templates/beez5/css/general_mozilla.css" rel="stylesheet"> <style type="text/css"> .item { width: 500px; height: 150px; border: 1px solid #EEEEEE;} .image { max-width: 130px; margin:0 auto;display:block;margin-top:10px;cursor: move;} #text {width:500px;height:20px;display:block;color:white;font-weight:bolder;text-align:center;cursor: move;} .form {margin-top:10px;} #container {width:960px;margin:0 auto;padding-top:25px;} </style> </head> <body> </head> '.$Result_data.' </body> </html>'; $currentdate=date('Y-m-d'); $db =& JFactory::getDBO(); $result = null; $idlogo = isset($_REQUEST['id']) ? $_REQUEST['id'] : ""; /* PDF Conversion Code Start Here*/ include("components/com_timage/views/updtimage/tmpl/mpdf.php"); $mpdf=new mPDF('c'); $mpdf->WriteHTML($htmlcontents); $pdf_filename=rand(1, 1000000).date('Y-m-d').'-'.$userid.'.pdf'; $mpdf->Output("media/com_timage/customize_design/".$pdf_filename.""); /* PDF Conversion Code End Here*/ $query="INSERT INTO #__timage_client_customlogo(id,logo_id,customize_text,pdf_name,user_id,published,date) VALUES('','".$idlogo."','".$htmlcontents."','".$pdf_filename."','".$userid."','1','".$currentdate."')"; $db->setQuery($query); $result = $db->loadObject(); $link = 'index.php?option=com_content&view=featured&Itemid=435'; $msg = 'Thank You For Ordering The Logo. We Will Review Your Order Shortly And Get Back To You.'; $app->redirect($link, $msg, $msgType='message'); } else{ $link = 'index.php?option=com_content&view=featured&Itemid=435'; $msg = 'You Need To Login To Make An Order.'; $app->redirect($link, $msg, $msgType='message'); } } ?> <html> <head> <script type="text/javascript" src="<?php echo JURI::base(); ?>components/com_timage/assets/jquery.min.js"></script> <script type="text/javascript" src="<?php echo JURI::base(); ?>components/com_timage/assets/jquery-ui.js"></script> <script type="text/javascript" src="<?php echo JURI::base(); ?>components/com_timage/assets/functions.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#canvas").addClass('default'); }); function senddesign() { var Result=document.getElementById('finalproduct').innerHTML; location.href="index.php?option=com_timage&view=updtimage&id=<?php echo $_REQUEST['id']; ?>&Itemid=<?php echo $_REQUEST['Itemid']; ?>&Result=" + Result; } </script> <style type="text/css"> .item { width: 500px; height: 150px; border: 1px solid #EEEEEE;} .image { max-width: 130px; margin:0 auto;display:block;margin-top:10px;cursor: move;} #text {width:500px;height:20px;display:block;color:white;font-weight:bolder;text-align:center;cursor: move;} .form {margin-top:10px;} #container {width:960px;margin:0 auto;padding-top:25px;} #container #form .button{ background: none repeat scroll 0 0 #000000; border: 1px solid #808000; color: #FFFFFF; padding: 1px 2px; line-height: 1.2em; } #container #form #d_text,#container #form #file,#container #form #d_text_color,#container #form #d_text_fontfamily,#container #form #d_text_fontsize{ border: 1px solid #000000; } #container #form tr,#container #form td { border: 0px solid #DDDDDD !important; padding: 5px !important; } </style> <script> $(function() { $( "#image" ).draggable(); $( "#text" ).draggable(); }); </script> </head> <body> <div id="container"> <div id="finalproduct"> <div id="canvas" style="background-image: url(media/com_timage/timagelevel/<?php echo $result_logo->imageloc; ?>);" class="item"> <div id="text"></div> <div id="image"></div> </div> </div> <div id="form" class="form"> <table border="0" cellspacing="5" cellpadding="5" width="515" > <tr> <td width="100%" colspan="2" style="background: #EEEEEE;"> <label>Text</label> <input type="text" id="d_text" name="d_text" size="18" style="margin-left: 10px;" /> <label style="padding-left: 10px;">Color:</label> <input type="text" id="d_text_color" name="d_text_color" size="5" maxlength="7" /> <label style="padding-left: 10px;">Font :</label> <select id="d_text_fontfamily" name="d_text_fontfamily" size="1" class="button"> <option value="Verdana">Verdana</option> <option value="Times New Roman">Times New Roman</option> <option value="Swiss">Swiss</option> <option value="Script">Script</option> <option value="Roman">Roman</option> <option value="Palatino">Palatino</option> <option value="Monospace">Monospace</option> <option value="Modern">Modern</option> <option value="Minion">Minion</option> <option value="Impact">Impact</option> <option value="Helvetica">Helvetica</option> <option value="Georgia">Georgia</option> <option value="Garamond">Garamond</option> <option value="Frosty">Frosty</option> <option value="Fraktur">Fraktur</option> <option value="Decorative">Decorative</option> <option value="Courier">Courier</option> <option value="Comic Sans">Comic Sans</option> <option value="Calibri">Calibri</option> <option value="Blackletter">Blackletter</option> <option value="Avqest">Avqest</option> <option value="Arial">Arial</option> <option value="Antiqua">Antiqua</option> </select> <div style="line-height: 30px;margin-left: -10px;"> <label style="padding-left: 10px;">Size:</label> <input type="text" id="d_text_fontsize" name="d_text_fontsize" size="5" maxlength="5" style="margin-left: 4px;" /> </div> </td> </tr> <tr> <td><label>Image</label></td> <td> <select id="d_image" name="d_image" class="button" style="max-width: 150px;"> <option value="">Please choose</option> <?php foreach( $files as $file ) { if(!in_array( $file, $ignore )) { echo '<option value=' . $file . '>' . $file . '</option>'; } } ?> </select> </td> </tr> <tr> <form action="" method="post" enctype="multipart/form-data"> <td><label>Upload Image</label></td> <td><input type="file" id="file" name="file" size="18" /><input type="submit" id="upload" name="upload" class="button" value="Upload" style="margin-left: 5px;" /></td> </form> </tr> <tr> <td> </td> <td><button class="button" id="reset" style="display: none;" onClick="reset()">Reset</button> <button class="button" id="update" onClick="update()">Update</button> <button class="button" onClick="senddesign()">Save Design</button></td> </tr> </table> </div> </div> <div style="clear:both;"></div> </body> </html>