PageRenderTime 125ms CodeModel.GetById 50ms app.highlight 15ms RepoModel.GetById 55ms app.codeStats 0ms

/magehelp/application/views/products/product_details.php

https://bitbucket.org/jit_bec/shopifine
PHP | 315 lines | 239 code | 74 blank | 2 comment | 1 complexity | e2f7f6810cf9f117ce79fce1bf92349e MD5 | raw file
  1<html><head>
  2  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  3  <title> Add product details and generate barcode</title>
  4  
  5<!--  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  6  <script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
  7  
  8  <link rel="stylesheet" type="text/css" href="/css/normalize.css">
  9  <link rel="stylesheet" type="text/css" href="/css/result-light.css">
 10  
 11    
 12      <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/ui-lightness/jquery-ui.css">
 13    
 14    
 15  
 16    
 17    
 18      <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>-->
 19    
 20  <?php $this->load->view("common/header"); ?>
 21  <link rel="stylesheet" rev="stylesheet" href="<?php echo base_url();?>css/shopifine.css" />
 22<!--  <style type="text/css">
 23    body { font-size: 62.5%; }
 24        label, input { display:block; }
 25        input.text { margin-bottom:12px; width:95%; padding: .4em; }
 26        fieldset { padding:0; border:0; margin-top:25px; }
 27        h1 { font-size: 1.2em; margin: .6em 0; }
 28        div#users-contain { width: 350px; margin: 20px 0; }
 29        div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
 30        div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
 31        .ui-dialog .ui-state-error { padding: .3em; }
 32        .validateTips { border: 1px solid transparent; padding: 0.3em; }
 33
 34* { font-family: Verdana; font-size: 96%; }
 35label { width: 10em; float: left; }
 36label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
 37p , .column{ clear: both; }
 38.submit { margin-left: 12em; }
 39em { font-weight: bold; padding-right: 1em; vertical-align: top; }
 40
 41
 42  </style>-->
 43  
 44
 45
 46<script type="text/javascript">//<![CDATA[ 
 47
 48$(function() {
 49        // a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
 50        $( "#dialog:ui-dialog" ).dialog( "destroy" );
 51
 52         $( "#productForm" ).validate();   
 53                 
 54        
 55        
 56        $( "#dialog-form" ).dialog({
 57            autoOpen: false,
 58            height: 300,
 59            width: 350,
 60            position:[300,200],
 61            modal: true,
 62            buttons: {
 63                "Create the Product": function() {
 64                    bValid =  $("#productForm").valid();
 65                    
 66                    if (bValid ){
 67                        
 68                        $.ajax({
 69                            url:"/echo/html/",
 70                                                    data: { html: "<tr>" +
 71                                                    "<td>" +  $( "#name" ).val() + "</td>" + 
 72                                                    "<td>" + $( "#email" ).val() + "</td>" + 
 73                                                    "<td>" + $( "#password" ).val() + "</td>" +
 74                                                    "</tr>"},
 75                            type:"POST",
 76                            success:function(response)
 77                            {
 78                            console.log(response);
 79                                $( "#users tbody" ).append(response);
 80                            }
 81                        });
 82                        
 83                        $( this ).dialog( "close" );
 84                }
 85                    
 86                },
 87                Cancel: function() {
 88                    $( this ).dialog( "close" );
 89                }
 90            },
 91            close: function() {
 92                
 93            }
 94        });
 95
 96
 97        $( "#create-product" )
 98            .button()
 99            .click(function() {
100                $( "#dialog-form" ).dialog( "open" );
101            });
102            
103            
104            $("#mfr").autocomplete({
105                source: <?php echo $mfrs ?>,
106                focus: function( event, ui ) {
107                $( "#mfr" ).val( ui.item.label );
108                return false;  
109                },   
110                select: function( event, ui ) {                 
111                    $( "#mfr" ).val( ui.item.label );                 
112                    $( "#mfr-hidden" ).val( ui.item.value );                 
113                    return false;             
114                }
115                
116            });
117         
118
119            $("#model").autocomplete({
120                source: "index.php/products/populateBarcodesForStock",
121                focus: function( event, ui ) {
122                $( "#model" ).val( ui.item.label );
123                return false;  
124                },   
125                select: function( event, ui ) {                 
126                    $( "#model" ).val( ui.item.label );                 
127                    $( "#model-hidden" ).val( ui.item.value );                 
128                    return false;             
129                }
130            }); 
131            
132            
133    });
134    
135   
136
137
138 
139//]]>  
140
141</script>
142
143
144</head>
145 <body>
146         <?php  $this->load->view("common/menubar"); ?>
147        <div id ="dialog-form">
148        <h1 id="formHeader">Add New Product Entity</h1>   
149        <form id="productForm">
150            <fieldset>
151                <div class="row">
152                        <div class="column">
153                            <div class="field">
154                                <label for="name">Name of Product Entity:</label>  
155                                <input id="name" name ="name" type="text" class="required"/>
156
157                            </div>
158                        </div>
159                        <div class="column">
160                            <div class="field">
161                                <label for="desc">Description:</label>  
162                                <input id="desc" name ="desc" type="text"/>
163
164                            </div>
165                        </div>
166                 </div>
167                <div class="row">
168                        <div class="column">
169                            <div class="field">
170                                <label for="mfr">Manufacturer:</label>  
171                                <input id="mfr" name ="mfr" type="text" class="required"/>
172
173                            </div>
174                            <input id="mfr-hidden" name ="mfr-hidden" type="hidden"/>
175                        </div>
176                        <div class="column">
177                            <div class="field">
178                                <label for="model">Model:</label>  
179                                <input id="model" name ="model" type="text"/>
180
181                            </div>
182                            <input id="model-hidden" name ="model-hidden" type="hidden"/>
183                        </div>
184                 </div>
185                
186                <div class="row">
187                        <div class="column">
188                            <div class="field">
189                                <label for="categoryOp">Category:</label>  
190                                <select name="categoryOp" id ="categoryOp" class="required"> 
191                                    <option value=0>Choose 
192                                    <?=$categoryOptions?> 
193                                </select>
194
195                            </div>
196                        </div>
197                        <div class="column">
198                            <div class="field">
199                                <label for="supplierOp">Supplier:</label>  
200                                <select name="supplierOp" id ="supplierOp" class="opt required"> 
201                                    <option value=0>Choose 
202                                    <?=$supplierOptions?> 
203                                </select>
204
205                            </div>
206                        </div>
207                        
208                 </div>
209                
210                <div class="row">
211                        <div class="column">
212                            <div class="field">
213                                <label for="packageOp">Package:</label>  
214                                <select name="packageOp" id ="packageOp" class="required"> 
215                                    <option value=0>Choose 
216                                    <?=$pkgOptions?> 
217                                </select>
218
219                            </div>
220                        </div>
221                        <div class="column">
222                            <div class="field">
223                                <label for="pkgType">Package Type:</label>  
224                                <input id="pkgType" name ="pkgType" type="text"/>
225
226                            </div>
227                        </div>
228                 </div>
229                
230                <div class="row">
231                        <div class="column">
232                            <div class="field">
233                                <label for="uomOp">Unit Of Measurement:</label>  
234                                <select name="uomOp" id ="uomOp" class="opt required"> 
235                                  <option value=0>Choose   
236                                </select>
237
238                            </div>
239                        </div>
240                        <div class="column">
241                            <div class="field">
242                                <label for="sizeOp">Measurement Denomination:</label>  
243                                <select name="sizeOp" id ="sizeOp" class="opt required"> 
244                                    <option value=0>Choose 
245                                    
246                                </select>
247
248                            </div>
249                        </div>
250                 </div>
251               
252               
253            </fieldset>
254        </form>
255    </div>
256        
257    <div id="users-contain" class="ui-widget">
258        <h1>Existing Users:</h1>
259        <table id="products" class="ui-widget ui-widget-content">
260            <thead>
261                <tr class="ui-widget-header ">
262                    <th>Barcode</th>
263                    <th>Product</th>
264                    <th>Description</th>
265                    <th>Manufacturer</th>
266                    <th>Model</th>
267                    <th>Supplier</th>
268                    <th>Package</th>
269                    <th>Package Type</th>
270
271                </tr>
272            </thead>
273            <tbody>
274
275            </tbody>
276        </table>
277    </div>
278    <button id="create-product">Create new Product</button>
279</body>   
280</html>
281
282
283    
284    <script type="text/javascript">
285   $("#packageOp").change(function(){
286                var val = $(this).val();
287                $.ajax({type:"post",
288                url:"index.php/products/populateMeasurementDropDowns",
289                data: {pkgId : val},
290                success: function(uomHtml){
291                        $("#uomOp").children('option:not(:first)').remove();
292                        $("#uomOp").append(uomHtml); 
293                }
294            }); 
295   });
296   
297   
298   $("#uomOp").change(function(){
299                var val = $(this).val();
300                $.ajax({type:"post",
301                    data:{uom:val},
302                url:"index.php/products/populateDenomDropdown",
303            success: function(sizeHtml){
304                        $("#sizeOp").children('option:not(:first)').remove();
305                        $("#sizeOp").append(sizeHtml); 
306                }}
307        )
308            });
309               
310       
311       
312    </script>
313
314
315